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>
This commit is contained in:
Daniel Schwierzeck
2012-04-02 02:57:56 +00:00
committed by Marek Vasut
parent 979cfeaf36
commit 6cb461b4f1
4 changed files with 24 additions and 7 deletions

View File

@@ -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
PLATFORM_CPPFLAGS += $(MIPSFLAGS)
ifdef CONFIG_SYS_BIG_ENDIAN
ENDIANNESS := -EB
endif
# Default to EB if no endianess is configured
ENDIANNESS ?= -EB
PLATFORM_CPPFLAGS += $(MIPSFLAGS) $(ENDIANNESS)
PLATFORM_LDFLAGS += $(ENDIANNESS)