From c62491d2602b353a815a909e27eec0df9f2c06a2 Mon Sep 17 00:00:00 2001 From: John Schmoller Date: Wed, 29 Sep 2010 14:05:44 -0500 Subject: ppc: Don't initialize write protected NOR flashes If a NOR flash is write protected it can not be initialized/detected so add the ability for boards to skip NOR initialization on bootup. A board can skip NOR initialization by implementing the board_flash_wp_on() function. Signed-off-by: John Schmoller Signed-off-by: Peter Tyser CC: sr@denx.de Acked-by: Stefan Roese --- arch/powerpc/lib/board.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'arch/powerpc') diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index c0c7fd4..2e0749d 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -175,6 +175,16 @@ void __board_add_ram_info(int use_default) } void board_add_ram_info(int) __attribute__((weak, alias("__board_add_ram_info"))); +int __board_flash_wp_on(void) +{ + /* + * Most flashes can't be detected when write protection is enabled, + * so provide a way to let U-Boot gracefully ignore write protected + * devices. + */ + return 0; +} +int board_flash_wp_on(void) __attribute__((weak, alias("__board_flash_wp_on"))); static int init_func_ram (void) { @@ -698,7 +708,11 @@ void board_init_r (gd_t *id, ulong dest_addr) #if !defined(CONFIG_SYS_NO_FLASH) puts ("FLASH: "); - if ((flash_size = flash_init ()) > 0) { + if (board_flash_wp_on()) { + printf("Uninitialized - Write Protect On\n"); + /* Since WP is on, we can't find real size. Set to 0 */ + flash_size = 0; + } else if ((flash_size = flash_init ()) > 0) { # ifdef CONFIG_SYS_FLASH_CHECKSUM print_size (flash_size, ""); /* -- cgit v1.1 From 1db3fca7192dc3ce7196c628db308ee6ac1ac87a Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 24 Oct 2010 16:07:23 +0200 Subject: MPC8315ERD: fix build error Commit 29c6fbe "MPC5121: Add USB EHCI support" renamed CONFIG_SYS_MPC8xxx_USB_ADDR into CONFIG_SYS_FSL_USB_ADDR but missed to update arch/powerpc/cpu/mpc83xx/cpu_init.c, resulting in: cpu_init.c: In function 'cpu_init_f': cpu_init.c:332: error: 'CONFIG_SYS_MPC8xxx_USB_ADDR' undeclared (first use in this function) cpu_init.c:332: error: (Each undeclared identifier is reported only once cpu_init.c:332: error: for each function it appears in.) make[1]: *** [/work/wd/tmp-ppc/arch/powerpc/cpu/mpc83xx/cpu_init.o] Error 1 Fix this. Signed-off-by: Wolfgang Denk Cc: Kim Phillips --- arch/powerpc/cpu/mpc83xx/cpu_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/powerpc') diff --git a/arch/powerpc/cpu/mpc83xx/cpu_init.c b/arch/powerpc/cpu/mpc83xx/cpu_init.c index f01c09a..7a1cae7 100644 --- a/arch/powerpc/cpu/mpc83xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc83xx/cpu_init.c @@ -329,7 +329,7 @@ void cpu_init_f (volatile immap_t * im) #ifdef CONFIG_USB_EHCI_FSL #ifndef CONFIG_MPC834x uint32_t temp; - struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_MPC8xxx_USB_ADDR; + struct usb_ehci *ehci = (struct usb_ehci *)CONFIG_SYS_FSL_USB_ADDR; /* Configure interface. */ setbits_be32(&ehci->control, REFSEL_16MHZ | UTMI_PHY_EN); -- cgit v1.1 From 553f09823cced77296825f615f00321d932bf914 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Tue, 26 Oct 2010 13:32:32 +0200 Subject: Rename CONFIG_SYS_INIT_RAM_END into CONFIG_SYS_INIT_RAM_SIZE CONFIG_SYS_INIT_RAM_END was a misnomer as it suggests this might be some end address; to make the meaning more clear we rename it into CONFIG_SYS_INIT_RAM_SIZE No other code changes are performed in this patch, only minor editing of white space (due to the changed length) and the comments was done, where noticed. Note that the code for the PATI and cmi_mpc5xx board configurations looks seriously broken. Last known maintainers on Cc: Signed-off-by: Wolfgang Denk Cc: Denis Peter Cc: Martin Winistoerfer Acked-by: Kumar Gala --- arch/powerpc/cpu/74xx_7xx/start.S | 4 ++-- arch/powerpc/cpu/mpc83xx/start.S | 4 ++-- arch/powerpc/cpu/mpc86xx/start.S | 4 ++-- arch/powerpc/cpu/ppc4xx/start.S | 22 +++++++++++----------- 4 files changed, 17 insertions(+), 17 deletions(-) (limited to 'arch/powerpc') diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S index 573e6d0..b4121df 100644 --- a/arch/powerpc/cpu/74xx_7xx/start.S +++ b/arch/powerpc/cpu/74xx_7xx/start.S @@ -819,7 +819,7 @@ lock_ram_in_cache: */ lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l - li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ + li r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \ (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 mtctr r4 1: @@ -840,7 +840,7 @@ unlock_ram_in_cache: /* invalidate the INIT_RAM section */ lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l - li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ + li r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \ (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 mtctr r4 1: icbi r0, r3 diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index 536604f..403fda4 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -1072,7 +1072,7 @@ lock_ram_in_cache: */ lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l - li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ + li r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \ (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 mtctr r4 1: @@ -1094,7 +1094,7 @@ unlock_ram_in_cache: /* invalidate the INIT_RAM section */ lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l - li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ + li r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \ (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 mtctr r4 1: icbi r0, r3 diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S index 3817f19..36004b7 100644 --- a/arch/powerpc/cpu/mpc86xx/start.S +++ b/arch/powerpc/cpu/mpc86xx/start.S @@ -870,7 +870,7 @@ lock_ram_in_cache: */ lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l - li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ + li r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \ (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 mtctr r4 1: @@ -905,7 +905,7 @@ unlock_ram_in_cache: /* invalidate the INIT_RAM section */ lis r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@h ori r3, r3, (CONFIG_SYS_INIT_RAM_ADDR & ~31)@l - li r4, ((CONFIG_SYS_INIT_RAM_END & ~31) + \ + li r4, ((CONFIG_SYS_INIT_RAM_SIZE & ~31) + \ (CONFIG_SYS_INIT_RAM_ADDR & 31) + 31) / 32 mtctr r4 1: icbi r0, r3 diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S index 87caea1..140bfc9 100644 --- a/arch/powerpc/cpu/ppc4xx/start.S +++ b/arch/powerpc/cpu/ppc4xx/start.S @@ -182,8 +182,8 @@ # endif #endif /* CONFIG_SYS_INIT_DCACHE_CS */ -#if (defined(CONFIG_SYS_INIT_RAM_DCACHE) && (CONFIG_SYS_INIT_RAM_END > (4 << 10))) -#error Only 4k of init-ram is supported - please adjust CONFIG_SYS_INIT_RAM_END! +#if (defined(CONFIG_SYS_INIT_RAM_DCACHE) && (CONFIG_SYS_INIT_RAM_SIZE > (4 << 10))) +#error Only 4k of init-ram is supported - please adjust CONFIG_SYS_INIT_RAM_SIZE! #endif /* @@ -656,8 +656,8 @@ _start: /* Clear Dcache to use as RAM */ addis r3,r0,CONFIG_SYS_INIT_RAM_ADDR@h ori r3,r3,CONFIG_SYS_INIT_RAM_ADDR@l - addis r4,r0,CONFIG_SYS_INIT_RAM_END@h - ori r4,r4,CONFIG_SYS_INIT_RAM_END@l + addis r4,r0,CONFIG_SYS_INIT_RAM_SIZE@h + ori r4,r4,CONFIG_SYS_INIT_RAM_SIZE@l rlwinm. r5,r4,0,27,31 rlwinm r5,r4,27,5,31 beq ..d_ran @@ -1091,8 +1091,8 @@ _start: lis r3, CONFIG_SYS_INIT_RAM_ADDR@h ori r3, r3, CONFIG_SYS_INIT_RAM_ADDR@l - lis r4, CONFIG_SYS_INIT_RAM_END@h - ori r4, r4, CONFIG_SYS_INIT_RAM_END@l + lis r4, CONFIG_SYS_INIT_RAM_SIZE@h + ori r4, r4, CONFIG_SYS_INIT_RAM_SIZE@l /* * Convert the size, in bytes, to the number of cache lines/blocks @@ -1119,12 +1119,12 @@ _start: lis r1, CONFIG_SYS_INIT_RAM_ADDR@h ori r1, r1, CONFIG_SYS_INIT_SP_OFFSET@l - lis r4, (CONFIG_SYS_INIT_RAM_END >> 2)@h - ori r4, r4, (CONFIG_SYS_INIT_RAM_END >> 2)@l + lis r4, (CONFIG_SYS_INIT_RAM_SIZE >> 2)@h + ori r4, r4, (CONFIG_SYS_INIT_RAM_SIZE >> 2)@l mtctr r4 lis r2, CONFIG_SYS_INIT_RAM_ADDR@h - ori r2, r2, CONFIG_SYS_INIT_RAM_END@l + ori r2, r2, CONFIG_SYS_INIT_RAM_SIZE@l lis r4, CONFIG_SYS_INIT_RAM_PATTERN@h ori r4, r4, CONFIG_SYS_INIT_RAM_PATTERN@l @@ -1414,8 +1414,8 @@ relocate_code: lis r3, CONFIG_SYS_INIT_RAM_ADDR@h ori r3, r3, CONFIG_SYS_INIT_RAM_ADDR@l - lis r4, CONFIG_SYS_INIT_RAM_END@h - ori r4, r4, CONFIG_SYS_INIT_RAM_END@l + lis r4, CONFIG_SYS_INIT_RAM_SIZE@h + ori r4, r4, CONFIG_SYS_INIT_RAM_SIZE@l add r4, r4, r3 bl invalidate_dcache_range -- cgit v1.1 From 25ddd1fb0a2281b182529afbc8fda5de2dc16d96 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Tue, 26 Oct 2010 14:34:52 +0200 Subject: Replace CONFIG_SYS_GBL_DATA_SIZE by auto-generated value CONFIG_SYS_GBL_DATA_SIZE has always been just a bad workarond for not being able to use "sizeof(struct global_data)" in assembler files. Recent experience has shown that manual synchronization is not reliable enough. This patch renames CONFIG_SYS_GBL_DATA_SIZE into GENERATED_GBL_DATA_SIZE which gets automatically generated by the asm-offsets tool. In the result, all definitions of this value can be deleted from the board config files. We have to make sure that all files that reference such data include the new file. No other changes have been done yet, but it is obvious that similar changes / simplifications can be done for other, related macro definitions as well. Signed-off-by: Wolfgang Denk Acked-by: Kumar Gala --- arch/powerpc/cpu/74xx_7xx/start.S | 1 + arch/powerpc/cpu/mpc512x/start.S | 1 + arch/powerpc/cpu/mpc5xx/start.S | 1 + arch/powerpc/cpu/mpc5xxx/start.S | 1 + arch/powerpc/cpu/mpc8220/start.S | 1 + arch/powerpc/cpu/mpc824x/start.S | 1 + arch/powerpc/cpu/mpc8260/start.S | 1 + arch/powerpc/cpu/mpc83xx/start.S | 1 + arch/powerpc/cpu/mpc85xx/release.S | 1 + arch/powerpc/cpu/mpc85xx/start.S | 1 + arch/powerpc/cpu/mpc86xx/start.S | 1 + arch/powerpc/cpu/mpc8xx/start.S | 1 + arch/powerpc/cpu/ppc4xx/start.S | 3 ++- arch/powerpc/include/asm/global_data.h | 2 +- 14 files changed, 15 insertions(+), 2 deletions(-) (limited to 'arch/powerpc') diff --git a/arch/powerpc/cpu/74xx_7xx/start.S b/arch/powerpc/cpu/74xx_7xx/start.S index b4121df..280781e 100644 --- a/arch/powerpc/cpu/74xx_7xx/start.S +++ b/arch/powerpc/cpu/74xx_7xx/start.S @@ -32,6 +32,7 @@ * board_init lies at a quite high address and when the cpu has * jumped there, everything is ok. */ +#include #include #include <74xx_7xx.h> #include diff --git a/arch/powerpc/cpu/mpc512x/start.S b/arch/powerpc/cpu/mpc512x/start.S index 2265c8c..fe35190 100644 --- a/arch/powerpc/cpu/mpc512x/start.S +++ b/arch/powerpc/cpu/mpc512x/start.S @@ -29,6 +29,7 @@ * U-Boot - Startup Code for MPC512x based Embedded Boards */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc5xx/start.S b/arch/powerpc/cpu/mpc5xx/start.S index da42557..63449c3 100644 --- a/arch/powerpc/cpu/mpc5xx/start.S +++ b/arch/powerpc/cpu/mpc5xx/start.S @@ -30,6 +30,7 @@ * */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc5xxx/start.S b/arch/powerpc/cpu/mpc5xxx/start.S index 92858fc..ad54677 100644 --- a/arch/powerpc/cpu/mpc5xxx/start.S +++ b/arch/powerpc/cpu/mpc5xxx/start.S @@ -25,6 +25,7 @@ /* * U-Boot - Startup Code for MPC5xxx CPUs */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc8220/start.S b/arch/powerpc/cpu/mpc8220/start.S index b5c160b..b029e84 100644 --- a/arch/powerpc/cpu/mpc8220/start.S +++ b/arch/powerpc/cpu/mpc8220/start.S @@ -25,6 +25,7 @@ /* * U-Boot - Startup Code for MPC8220 CPUs */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc824x/start.S b/arch/powerpc/cpu/mpc824x/start.S index d10231e..616de58 100644 --- a/arch/powerpc/cpu/mpc824x/start.S +++ b/arch/powerpc/cpu/mpc824x/start.S @@ -37,6 +37,7 @@ * board_init will change CS0 to be positioned at the correct * address and (s)dram will be positioned at address 0 */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc8260/start.S b/arch/powerpc/cpu/mpc8260/start.S index 55c64ea..521a639 100644 --- a/arch/powerpc/cpu/mpc8260/start.S +++ b/arch/powerpc/cpu/mpc8260/start.S @@ -25,6 +25,7 @@ /* * U-Boot - Startup Code for MPC8260 PowerPC based Embedded Boards */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc83xx/start.S b/arch/powerpc/cpu/mpc83xx/start.S index 403fda4..a35697d 100644 --- a/arch/powerpc/cpu/mpc83xx/start.S +++ b/arch/powerpc/cpu/mpc83xx/start.S @@ -27,6 +27,7 @@ * U-Boot - Startup Code for MPC83xx PowerPC based Embedded Boards */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc85xx/release.S b/arch/powerpc/cpu/mpc85xx/release.S index 53cefaf..56a853e 100644 --- a/arch/powerpc/cpu/mpc85xx/release.S +++ b/arch/powerpc/cpu/mpc85xx/release.S @@ -21,6 +21,7 @@ * MA 02111-1307 USA */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc85xx/start.S b/arch/powerpc/cpu/mpc85xx/start.S index 7e5e6b1..291557d 100644 --- a/arch/powerpc/cpu/mpc85xx/start.S +++ b/arch/powerpc/cpu/mpc85xx/start.S @@ -28,6 +28,7 @@ * */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc86xx/start.S b/arch/powerpc/cpu/mpc86xx/start.S index 36004b7..6127115 100644 --- a/arch/powerpc/cpu/mpc86xx/start.S +++ b/arch/powerpc/cpu/mpc86xx/start.S @@ -30,6 +30,7 @@ * board_init lies at a quite high address and when the cpu has * jumped there, everything is ok. */ +#include #include #include #include diff --git a/arch/powerpc/cpu/mpc8xx/start.S b/arch/powerpc/cpu/mpc8xx/start.S index 4a8c5d9..9d022bf 100644 --- a/arch/powerpc/cpu/mpc8xx/start.S +++ b/arch/powerpc/cpu/mpc8xx/start.S @@ -37,6 +37,7 @@ * board_init will change CS0 to be positioned at the correct * address and (s)dram will be positioned at address 0 */ +#include #include #include #include diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S index 140bfc9..363becc 100644 --- a/arch/powerpc/cpu/ppc4xx/start.S +++ b/arch/powerpc/cpu/ppc4xx/start.S @@ -63,6 +63,7 @@ * board_init will change CS0 to be positioned at the correct * address and (s)dram will be positioned at address 0 */ +#include #include #include #include @@ -1399,7 +1400,7 @@ relocate_code: /* Flush initial global data range */ mr r3, r4 - addi r4, r4, CONFIG_SYS_GBL_DATA_SIZE@l + addi r4, r4, GENERATED_GBL_DATA_SIZE@l bl flush_dcache_range #if defined(CONFIG_SYS_INIT_DCACHE_CS) diff --git a/arch/powerpc/include/asm/global_data.h b/arch/powerpc/include/asm/global_data.h index 2a323e1..2e218de 100644 --- a/arch/powerpc/include/asm/global_data.h +++ b/arch/powerpc/include/asm/global_data.h @@ -34,7 +34,7 @@ * global variables during system initialization (until we have set * up the memory controller so that we can use RAM). * - * Keep it *SMALL* and remember to set CONFIG_SYS_GBL_DATA_SIZE > sizeof(gd_t) + * Keep it *SMALL* and remember to set GENERATED_GBL_DATA_SIZE > sizeof(gd_t) */ typedef struct global_data { -- cgit v1.1 From 2e5167ccad93ca9cfa6a2acfab5e4785418e477e Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 28 Oct 2010 20:00:11 +0200 Subject: Replace CONFIG_RELOC_FIXUP_WORKS by CONFIG_NEEDS_MANUAL_RELOC By now, the majority of architectures have working relocation support, so the few remaining architectures have become exceptions. To make this more obvious, we make working relocation now the default case, and flag the remaining cases with CONFIG_NEEDS_MANUAL_RELOC. Signed-off-by: Wolfgang Denk Tested-by: Heiko Schocher Tested-by: Reinhard Meyer --- arch/powerpc/include/asm/config.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'arch/powerpc') diff --git a/arch/powerpc/include/asm/config.h b/arch/powerpc/include/asm/config.h index a1942ca..76dedeb 100644 --- a/arch/powerpc/include/asm/config.h +++ b/arch/powerpc/include/asm/config.h @@ -89,9 +89,6 @@ #define CONFIG_SYS_NUM_TLBCAMS 16 #endif -/* Relocation to SDRAM works on all PPC boards */ -#define CONFIG_RELOC_FIXUP_WORKS - /* Since so many PPC SOCs have a semi-common LBC, define this here */ #if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx) || \ defined(CONFIG_MPC83xx) -- cgit v1.1