Commit 5356f5451e85695cf8f9782dee54cc8dfa5445e5

Authored by Aneesh V
Committed by Albert ARIBAUD
1 parent 74236acacc

ARM: enable Thumb build

Enable Thumb build and ARM-Thumb interworking based on the new
config flag CONFIG_SYS_THUMB_BUILD

Signed-off-by: Aneesh V <aneesh@ti.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>

Showing 2 changed files with 23 additions and 7 deletions Side-by-side Diff

... ... @@ -432,6 +432,14 @@
432 432 Select high exception vectors of the ARM core, e.g., do not
433 433 clear the V bit of the c1 register of CP15.
434 434  
  435 + CONFIG_SYS_THUMB_BUILD
  436 +
  437 + Use this flag to build U-Boot using the Thumb instruction
  438 + set for ARM architectures. Thumb instruction set provides
  439 + better code density. For ARM architectures that support
  440 + Thumb2 this flag will result in Thumb2 code generated by
  441 + GCC.
  442 +
435 443 - Linux Kernel Interface:
436 444 CONFIG_CLOCKS_IN_MHZ
437 445  
... ... @@ -33,25 +33,33 @@
33 33  
34 34 PLATFORM_CPPFLAGS += -DCONFIG_ARM -D__ARM__
35 35  
36   -# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
37   -PF_CPPFLAGS_ARM := $(call cc-option,-marm,)
  36 +# Choose between ARM/Thumb instruction sets
  37 +ifeq ($(CONFIG_SYS_THUMB_BUILD),y)
  38 +PF_CPPFLAGS_ARM := $(call cc-option, -mthumb -mthumb-interwork,\
  39 + $(call cc-option,-marm,)\
  40 + $(call cc-option,-mno-thumb-interwork,)\
  41 + )
  42 +else
  43 +PF_CPPFLAGS_ARM := $(call cc-option,-marm,) \
  44 + $(call cc-option,-mno-thumb-interwork,)
  45 +endif
38 46  
39 47 # Try if EABI is supported, else fall back to old API,
40 48 # i. e. for example:
41 49 # - with ELDK 4.2 (EABI supported), use:
42   -# -mabi=aapcs-linux -mno-thumb-interwork
  50 +# -mabi=aapcs-linux
43 51 # - with ELDK 4.1 (gcc 4.x, no EABI), use:
44   -# -mabi=apcs-gnu -mno-thumb-interwork
  52 +# -mabi=apcs-gnu
45 53 # - with ELDK 3.1 (gcc 3.x), use:
46   -# -mapcs-32 -mno-thumb-interwork
  54 +# -mapcs-32
47 55 PF_CPPFLAGS_ABI := $(call cc-option,\
48   - -mabi=aapcs-linux -mno-thumb-interwork,\
  56 + -mabi=aapcs-linux,\
49 57 $(call cc-option,\
50 58 -mapcs-32,\
51 59 $(call cc-option,\
52 60 -mabi=apcs-gnu,\
53 61 )\
54   - ) $(call cc-option,-mno-thumb-interwork,)\
  62 + )\
55 63 )
56 64 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
57 65