summaryrefslogtreecommitdiff
path: root/arch/mips/cpu/mips32
diff options
context:
space:
mode:
authorDaniel Schwierzeck <daniel.schwierzeck@googlemail.com>2012-04-02 02:57:56 +0000
committerMarek Vasut <marex@denx.de>2012-04-02 15:54:53 +0200
commit6cb461b4f1531dbae5c0bae857f649b7943114ec (patch)
treebd8df91ecc1ebbd2d2cef76bfd1940b74e9920ee /arch/mips/cpu/mips32
parent979cfeaf36bf8719d4a1a98f1e8a3e16ef3d1fba (diff)
downloadu-boot-imx-6cb461b4f1531dbae5c0bae857f649b7943114ec.zip
u-boot-imx-6cb461b4f1531dbae5c0bae857f649b7943114ec.tar.gz
u-boot-imx-6cb461b4f1531dbae5c0bae857f649b7943114ec.tar.bz2
MIPS: fix endianess handling
Make endianess of target CPU configurable. Use the new config option for dbau1550_el and pb1000 boards. Adapt linking of standalone applications to pass through endianess options to LD. Build tested with: - ELDK 4 mips_4KC- and mips4KCle - Sourcery CodeBench Lite 2011.03-93 With this patch all 26 MIPS boards can be compiled now in one step by running "MAKEALL -a mips". Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Diffstat (limited to 'arch/mips/cpu/mips32')
-rw-r--r--arch/mips/cpu/mips32/config.mk21
1 files changed, 15 insertions, 6 deletions
diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk
index 4d1b273..a1cd590 100644
--- a/arch/mips/cpu/mips32/config.mk
+++ b/arch/mips/cpu/mips32/config.mk
@@ -27,14 +27,23 @@
# Note: Toolchains with binutils prior to v2.16
# are no longer supported by U-Boot MIPS tree!
#
-MIPSFLAGS = -march=mips32r2
+MIPSFLAGS := -march=mips32r2
+# Handle special prefix in ELDK 4.0 toolchain
ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
-ENDIANNESS = -EL
-else
-ENDIANNESS = -EB
+ENDIANNESS := -EL
endif
-MIPSFLAGS += $(ENDIANNESS)
+ifdef CONFIG_SYS_LITTLE_ENDIAN
+ENDIANNESS := -EL
+endif
+
+ifdef CONFIG_SYS_BIG_ENDIAN
+ENDIANNESS := -EB
+endif
+
+# Default to EB if no endianess is configured
+ENDIANNESS ?= -EB
-PLATFORM_CPPFLAGS += $(MIPSFLAGS)
+PLATFORM_CPPFLAGS += $(MIPSFLAGS) $(ENDIANNESS)
+PLATFORM_LDFLAGS += $(ENDIANNESS)