mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: added Kconfig option for -mno-unaligned compiler flag
@ 2012-12-04 12:02 Enrico Scholz
  2012-12-04 12:02 ` [PATCH 2/2] OMAP: disable unaligned access when building the IFT Enrico Scholz
  0 siblings, 1 reply; 8+ messages in thread
From: Enrico Scholz @ 2012-12-04 12:02 UTC (permalink / raw)
  To: barebox; +Cc: Enrico Scholz

With recent gcc, unaligned access is enabled by default on ARMv6+
CPUs.  This can cause problems when bootloader is located e.g. in SRAM
where such an access is not supported.

Patch adds a Kconfig option were the default behavior can be overridden.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 arch/arm/Kconfig  | 8 ++++++++
 arch/arm/Makefile | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 3afd885..53c36d1 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -200,6 +200,14 @@ config ARM_UNWIND
 	  the performance is not affected. Currently, this feature
 	  only works with EABI compilers. If unsure say Y.
 
+config ARM_NOUNALIGNED
+	bool "disable unaligned access"
+        help
+          With recent gcc, unaligned access is enabled by default on ARMv6+
+          CPUs.  This can cause problems when bootloader is located e.g. in
+          SRAM were such an access is not supported. Selection this option
+          sets the '-mno-unaligned-access' compiler flag.
+
 endmenu
 
 source common/Kconfig
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8cef771..9544cca 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -39,6 +39,10 @@ ifeq ($(CONFIG_ARM_UNWIND),y)
 CFLAGS_ABI	+=-funwind-tables
 endif
 
+ifeq ($(CONFIG_ARM_NOUNALIGNED),y)
+CFLAGS_ABI	+=$(call cc-option,-mno-unaligned-access)
+endif
+
 ifeq ($(CONFIG_THUMB2_BAREBOX),y)
 AFLAGS_AUTOIT	:=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it)
 AFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
-- 
1.7.11.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-12-05 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-04 12:02 [PATCH 1/2] ARM: added Kconfig option for -mno-unaligned compiler flag Enrico Scholz
2012-12-04 12:02 ` [PATCH 2/2] OMAP: disable unaligned access when building the IFT Enrico Scholz
2012-12-05 10:46   ` Sascha Hauer
2012-12-05 11:33     ` Enrico Scholz
2012-12-05 11:43       ` Enrico Scholz
2012-12-05 12:15       ` Sascha Hauer
2012-12-05 13:25         ` Enrico Scholz
2012-12-05 14:43   ` Enrico Scholz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox