Patchwork [U-Boot,3/4] armv7: Use -march=armv7-a and thereby enable Thumb-2

mail settings
Submitter Aneesh V
Date Feb. 15, 2012, 1:57 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/141321/
State Deferred
Delegated to: Tom Rini
Headers show


Aneesh V - Feb. 15, 2012, 1:57 p.m.
Enable -march=armv7-a for armv7 platforms if the tool-chain
supports it. This in turn results in Thumb-2 code generated
for these platforms if CONFIG_SYS_THUMB_BUILD is enabled.

Signed-off-by: Aneesh V <>
I believe armv7-a is fine for all the SoCs except Tegra2
and I see that Tegra2 is already making the necessary
exception in .../armv7/tegra2/

Let me know if any other SoC has a problem with armv7-a

Changes from RFC to V1:
- Enabled armv7-a from armv7/ instead of from
  omap files
 arch/arm/cpu/armv7/ |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/arch/arm/cpu/armv7/ b/arch/arm/cpu/armv7/
index 83ddf10..b66fb6f 100644
--- a/arch/arm/cpu/armv7/
+++ b/arch/arm/cpu/armv7/
@@ -22,8 +22,9 @@ 
 PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-# Make ARMv5 to allow more compilers to work, even though its v7a.
-PLATFORM_CPPFLAGS += -march=armv5
+# If armv7-a is not supported by GCC fall-back to armv5, which is
+# supported by more tool-chains
+PLATFORM_CPPFLAGS += $(call cc-option, -march=armv7-a, -march=armv5)
 # =========================================================================
 # Supply options according to compiler version