public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] flash: do not fail even if flash_size is zero
@ 2014-12-05  3:20 Masahiro Yamada
  2014-12-05  6:54 ` Stefan Roese
  2014-12-07 16:47 ` Masahiro YAMADA
  0 siblings, 2 replies; 5+ messages in thread
From: Masahiro Yamada @ 2014-12-05  3:20 UTC (permalink / raw)
  To: u-boot

CONFIG_SYS_MAX_FLASH_BANKS_DETECT allows to determine the number of
flash banks at run-time, that is, there is a possibility that no flash
bank is found.  It makes sense to continue the boot process without
any flash device.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Stefan Roese <sr@denx.de>
---

 common/board_r.c | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/common/board_r.c b/common/board_r.c
index 1b8998d..6e59712 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -291,26 +291,14 @@ static int initr_flash(void)
 {
 	ulong flash_size = 0;
 	bd_t *bd = gd->bd;
-	int ok;
 
 	puts("Flash: ");
 
-	if (board_flash_wp_on()) {
+	if (board_flash_wp_on())
 		printf("Uninitialized - Write Protect On\n");
-		/* Since WP is on, we can't find real size.  Set to 0 */
-		ok = 1;
-	} else {
+	else
 		flash_size = flash_init();
-		ok = flash_size > 0;
-	}
-	if (!ok) {
-		puts("*** failed ***\n");
-#ifdef CONFIG_PPC
-		/* Why does PPC do this? */
-		hang();
-#endif
-		return -1;
-	}
+
 	print_size(flash_size, "");
 #ifdef CONFIG_SYS_FLASH_CHECKSUM
 	/*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-12-07 16:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-05  3:20 [U-Boot] [PATCH] flash: do not fail even if flash_size is zero Masahiro Yamada
2014-12-05  6:54 ` Stefan Roese
2014-12-05  8:40   ` Masahiro Yamada
2014-12-05  8:43     ` Stefan Roese
2014-12-07 16:47 ` Masahiro YAMADA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox