[PATCH 5/7] arm: add endian config support

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Mon Nov 2 13:51:29 EST 2009


Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/Makefile    |   10 ++++++++++
 arch/arm/cpu/Kconfig |   11 +++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index af2bb12..f6605ab 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -3,6 +3,16 @@ CPPFLAGS	+= -D__ARM__ -fno-strict-aliasing
 # Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
 CPPFLAGS	+=$(call cc-option,-marm,)
 
+ifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
+CPPFLAGS	+= -mbig-endian
+AS		+= -EB
+LD		+= -EB
+else
+CPPFLAGS	+= -mlittle-endian
+AS		+= -EL
+LD		+= -EL
+endif
+
 # Machine directory name.  This list is sorted alphanumerically
 # by CONFIG_* macro name.
 machine-$(CONFIG_ARCH_AT91)		:= at91
diff --git a/arch/arm/cpu/Kconfig b/arch/arm/cpu/Kconfig
index f89cce9..cbec793 100644
--- a/arch/arm/cpu/Kconfig
+++ b/arch/arm/cpu/Kconfig
@@ -50,3 +50,14 @@ config CPU_32v5
 
 config CPU_32v7
 	bool
+
+comment "processor features"
+
+config CPU_BIG_ENDIAN
+	bool "Build big-endian kernel"
+	depends on ARCH_SUPPORTS_BIG_ENDIAN
+	help
+	  Say Y if you plan on running a kernel in big-endian mode.
+	  Note that your board must be properly built and your board
+	  port must properly enable any big-endian related features
+	  of your chipset/board/processor.
-- 
1.6.5





More information about the u-boot-v2 mailing list