[U-Boot] [PATCH v2 3/5] MIPS: Optimize the setup of endianess and CPU optimization flags
daniel.schwierzeck at googlemail.com
daniel.schwierzeck at googlemail.com
Mon Mar 14 22:14:56 CET 2011
The current Mips CPU config.mk code always expects a Mips 4kc
core and toolchain. This is not appropiate for other toolchains
and CPUs/SoCs.
Replace the current MIPSFLAGS code by cc-option macro and use
-march=mips32r2 as default optimization level for all Mips32 CPUs.
Replace the endianess determination code from toolchain prefix by
a more generic one inspired by the Linux arch/mips/Makefile.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck at googlemail.com>
Cc: Shinya Kuribayashi <skuribay at pobox.com>
Cc: Wolfgang Denk <wd at denx.de>
---
arch/mips/cpu/mips32/config.mk | 21 +++++++--------------
1 files changed, 7 insertions(+), 14 deletions(-)
diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk
index a173c54..a91dcb4 100644
--- a/arch/mips/cpu/mips32/config.mk
+++ b/arch/mips/cpu/mips32/config.mk
@@ -20,20 +20,13 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
-v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | cut -d. -f2)
-MIPSFLAGS:=$(shell \
-if [ "$v" -lt "14" ]; then \
- echo "-mcpu=4kc"; \
-else \
- echo "-march=4kc -mtune=4kc"; \
-fi)
-ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
-ENDIANNESS = -EL
-else
-ENDIANNESS = -EB
-endif
+# Optimization flags for all Mips32 CPUs
+MIPSFLAGS = $(call cc-option,-march=mips32r2,-mips32r2 -Wa,-mips32r2)
-MIPSFLAGS += $(ENDIANNESS)
+# Determine endianess from toolchain prefix
+ENDIANESS = $(shell $(CC) -dumpmachine | \
+ grep -q 'mips.*el-.*' && echo -EL || echo -EB)
+
+PLATFORM_CPPFLAGS += $(MIPSFLAGS) $(ENDIANESS)
-PLATFORM_CPPFLAGS += $(MIPSFLAGS)
--
1.7.4.1
More information about the U-Boot
mailing list