summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib
diff options
context:
space:
mode:
authorJohn Schmoller <jschmoller@xes-inc.com>2010-09-29 14:05:44 -0500
committerWolfgang Denk <wd@denx.de>2010-10-20 21:58:16 +0200
commitc62491d2602b353a815a909e27eec0df9f2c06a2 (patch)
tree9a3c3c152238319c0a160b51bb901a17617d9d0e /arch/powerpc/lib
parent7a8ddeea5ed0b80fc83b6ae57ef3e98fc69a92da (diff)
downloadu-boot-imx-c62491d2602b353a815a909e27eec0df9f2c06a2.zip
u-boot-imx-c62491d2602b353a815a909e27eec0df9f2c06a2.tar.gz
u-boot-imx-c62491d2602b353a815a909e27eec0df9f2c06a2.tar.bz2
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 <jschmoller@xes-inc.com> Signed-off-by: Peter Tyser <ptyser@xes-inc.com> CC: sr@denx.de Acked-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/powerpc/lib')
-rw-r--r--arch/powerpc/lib/board.c16
1 files changed, 15 insertions, 1 deletions
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, "");
/*