From 71919cf15337c62b9ab389875a6a0855f0ed4461 Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Mon, 2 Apr 2012 02:57:54 +0000 Subject: MIPS: board.c: fix init of flash data in bd_info Boards with CONFIG_SYS_NO_FLASH should not forced to define CONFIG_SYS_FLASH_BASE. In this case the flash data in bd_info should be initialized with 0 like the other archs do. Signed-off-by: Daniel Schwierzeck --- arch/mips/lib/board.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c index d998f0e749..38e6e77a34 100644 --- a/arch/mips/lib/board.c +++ b/arch/mips/lib/board.c @@ -294,15 +294,19 @@ void board_init_r(gd_t *id, ulong dest_addr) /* configure available FLASH banks */ size = flash_init(); display_flash_config(size); + bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; bd->bi_flashsize = size; -#endif - bd->bi_flashstart = CONFIG_SYS_FLASH_BASE; #if CONFIG_SYS_MONITOR_BASE == CONFIG_SYS_FLASH_BASE bd->bi_flashoffset = monitor_flash_len; /* reserved area for U-Boot */ #else bd->bi_flashoffset = 0; #endif +#else + bd->bi_flashstart = 0; + bd->bi_flashsize = 0; + bd->bi_flashoffset = 0; +#endif #ifdef CONFIG_CMD_NAND puts("NAND: "); -- cgit v1.2.3 From 979cfeaf36bf8719d4a1a98f1e8a3e16ef3d1fba Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Mon, 2 Apr 2012 02:57:55 +0000 Subject: MIPS: fix inconsistency in config option for cache operation mode Commit ab2a98b11716364bc5a8c43cdfa7fee176cda1d8 missed to use the new config option in dcache_enable(). Fix this to avoid inconsistencies if someone wants to disable and enable D-caches. Signed-off-by: Daniel Schwierzeck --- arch/mips/cpu/mips32/cache.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/mips/cpu/mips32/cache.S b/arch/mips/cpu/mips32/cache.S index 5ce0ec45fc..e683e8be8c 100644 --- a/arch/mips/cpu/mips32/cache.S +++ b/arch/mips/cpu/mips32/cache.S @@ -30,6 +30,10 @@ #include #include +#ifndef CONFIG_SYS_MIPS_CACHE_MODE +#define CONFIG_SYS_MIPS_CACHE_MODE CONF_CM_CACHABLE_NONCOHERENT +#endif + #define RA t8 /* @@ -224,7 +228,7 @@ LEAF(dcache_enable) mfc0 t0, CP0_CONFIG ori t0, CONF_CM_CMASK xori t0, CONF_CM_CMASK - ori t0, CONF_CM_CACHABLE_NONCOHERENT + ori t0, CONFIG_SYS_MIPS_CACHE_MODE mtc0 t0, CP0_CONFIG jr ra END(dcache_enable) -- cgit v1.2.3 From 6cb461b4f1531dbae5c0bae857f649b7943114ec Mon Sep 17 00:00:00 2001 From: Daniel Schwierzeck Date: Mon, 2 Apr 2012 02:57:56 +0000 Subject: 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 --- README | 6 ++++++ arch/mips/cpu/mips32/config.mk | 21 +++++++++++++++------ boards.cfg | 2 +- include/configs/pb1x00.h | 2 ++ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/README b/README index c98afa74b1..9702067174 100644 --- a/README +++ b/README @@ -374,6 +374,12 @@ The following options need to be configured: Defines the string to utilize when trying to match PCIe device tree nodes for the given platform. +- Generic CPU options: + CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN + + Defines the endianess of the CPU. Implementation of those + values is arch specific. + - Intel Monahans options: CONFIG_SYS_MONAHANS_RUN_MODE_OSC_RATIO diff --git a/arch/mips/cpu/mips32/config.mk b/arch/mips/cpu/mips32/config.mk index 4d1b27379d..a1cd590a00 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) diff --git a/boards.cfg b/boards.cfg index c6090bab90..3cf75c3151 100644 --- a/boards.cfg +++ b/boards.cfg @@ -360,7 +360,7 @@ dbau1000 mips mips32 dbau1x00 - dbau1100 mips mips32 dbau1x00 - au1x00 dbau1x00:DBAU1100 dbau1500 mips mips32 dbau1x00 - au1x00 dbau1x00:DBAU1500 dbau1550 mips mips32 dbau1x00 - au1x00 dbau1x00:DBAU1550 -dbau1550_el mips mips32 dbau1x00 - au1x00 dbau1x00:DBAU1550 +dbau1550_el mips mips32 dbau1x00 - au1x00 dbau1x00:DBAU1550,SYS_LITTLE_ENDIAN gth2 mips mips32 - - au1x00 pb1000 mips mips32 pb1x00 - au1x00 pb1x00:PB1000 incaip mips mips32 incaip - incaip diff --git a/include/configs/pb1x00.h b/include/configs/pb1x00.h index eea8ed3adb..d056884e7e 100644 --- a/include/configs/pb1x00.h +++ b/include/configs/pb1x00.h @@ -46,6 +46,8 @@ #endif #endif +#define CONFIG_SYS_LITTLE_ENDIAN + #define CONFIG_ETHADDR DE:AD:BE:EF:01:01 /* Ethernet address */ #define CONFIG_BOOTDELAY 2 /* autoboot after 2 seconds */ -- cgit v1.2.3 From f4cdde40195078a9183a0e29f741dac31ea3d425 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 1 Apr 2012 03:59:46 +0000 Subject: LMB: Fix undefined lmb_reserve() on non-lmb platforms Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Mike Frysinger Cc: Stephen Warren Cc: Tom Warren Cc: Graeme Russ Acked-by: Mike Frysinger --- common/cmd_bootm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c index 9ad2535d4b..5685232892 100644 --- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c @@ -186,6 +186,7 @@ static void boot_start_lmb(bootm_headers_t *images) board_lmb_reserve(&images->lmb); } #else +#define lmb_reserve(lmb, base, size) static inline void boot_start_lmb(bootm_headers_t *images) { } #endif -- cgit v1.2.3