* [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
* [U-Boot] [PATCH] flash: do not fail even if flash_size is zero
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-07 16:47 ` Masahiro YAMADA
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2014-12-05 6:54 UTC (permalink / raw)
To: u-boot
On 05.12.2014 04:20, Masahiro Yamada wrote:
> 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>
I also think its better to continue to boot in this case. So:
Acked-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] flash: do not fail even if flash_size is zero
2014-12-05 6:54 ` Stefan Roese
@ 2014-12-05 8:40 ` Masahiro Yamada
2014-12-05 8:43 ` Stefan Roese
0 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2014-12-05 8:40 UTC (permalink / raw)
To: u-boot
Hi Stefan,
Thanks for your quick review.
I want to use this patch to clean up my board support code.
( I want to enable CONFIG_SYS_MAX_FLASH_BANKS_DETECT on my boards
but in some use cases, there is a possibility that no flash is found.)
CFI-flash patches are generally supposed to be applied by you, but if you do not mind,
can I apply this patch with your Acked-by credit as a prerequisite for my series?
On Fri, 05 Dec 2014 07:54:53 +0100
Stefan Roese <sr@denx.de> wrote:
> On 05.12.2014 04:20, Masahiro Yamada wrote:
> > 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>
>
> I also think its better to continue to boot in this case. So:
>
> Acked-by: Stefan Roese <sr@denx.de>
>
> Thanks,
> Stefan
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] flash: do not fail even if flash_size is zero
2014-12-05 8:40 ` Masahiro Yamada
@ 2014-12-05 8:43 ` Stefan Roese
0 siblings, 0 replies; 5+ messages in thread
From: Stefan Roese @ 2014-12-05 8:43 UTC (permalink / raw)
To: u-boot
Hi Masahiro-san,
On 05.12.2014 09:40, Masahiro Yamada wrote:
> I want to use this patch to clean up my board support code.
> ( I want to enable CONFIG_SYS_MAX_FLASH_BANKS_DETECT on my boards
> but in some use cases, there is a possibility that no flash is found.)
>
> CFI-flash patches are generally supposed to be applied by you, but if you do not mind,
> can I apply this patch with your Acked-by credit as a prerequisite for my series?
Sure. Please go ahead.
Thanks,
Stefan
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] flash: do not fail even if flash_size is zero
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-07 16:47 ` Masahiro YAMADA
1 sibling, 0 replies; 5+ messages in thread
From: Masahiro YAMADA @ 2014-12-07 16:47 UTC (permalink / raw)
To: u-boot
2014-12-05 12:20 GMT+09:00 Masahiro Yamada <yamada.m@jp.panasonic.com>:
> 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>
Applied to u-boot-uniphier/master.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [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