flash: do not fail even if flash_size is zero
PATCH 1/1 flash: do not fail even if flash_size is zero
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.
---
common/board_r.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
common/board_r.c +3 -15
@@ -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 /*
Signature · 1 line
1.9.1
PATCH 1/1 flash: do not fail even if flash_size is zero
Quoted 7 lines · Masahiro Yamada
CONFIG_SYS_MAX_FLASH_BANKS_DETECTallows 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 <[email protected]>Cc Stefan Roese <[email protected]>
I also think its better to continue to boot in this case. So:
Thanks,
Stefan
PATCH 1/1 flash: do not fail even if flash_size is zero
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?
Quoted 9 lines · On Fri, 05 Dec 2014 07:54:53 +0100 Stefan Roese <[email protected]> wrote:
Quoted 7 lines · Masahiro Yamada
CONFIG_SYS_MAX_FLASH_BANKS_DETECTallows 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 <[email protected]>Cc Stefan Roese <[email protected]>
Quoted 6 lines
I also think its better to continue to boot in this case. So:
Acked-by Stefan Roese <[email protected]>Thanks,
Stefan
Best Regards
Masahiro Yamada
PATCH 1/1 flash: do not fail even if flash_size is zero
Hi Masahiro-san,
Quoted 6 lines · Masahiro Yamada
I want to use this patch to clean up my board support code. ( I want to enable
CONFIG_SYS_MAX_FLASH_BANKS_DETECTon 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
PATCH 1/1 flash: do not fail even if flash_size is zero
In reply to Masahiro Yamada2014-12-05 12:20 GMT+09:00 Masahiro Yamada <[email protected]>:
Quoted 7 lines
CONFIG_SYS_MAX_FLASH_BANKS_DETECTallows 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 <[email protected]>Cc Stefan Roese <[email protected]>
Applied to u-boot-uniphier/master.
Signature · 2 lines
Best Regards Masahiro Yamada