mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-29 16:10:58 +00:00
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. Even in such cases, it makes sense to continue the boot process without any flash device. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
9248a78f40
commit
70879a9256
1 changed files with 3 additions and 15 deletions
|
@ -291,26 +291,14 @@ static int initr_flash(void)
|
||||||
{
|
{
|
||||||
ulong flash_size = 0;
|
ulong flash_size = 0;
|
||||||
bd_t *bd = gd->bd;
|
bd_t *bd = gd->bd;
|
||||||
int ok;
|
|
||||||
|
|
||||||
puts("Flash: ");
|
puts("Flash: ");
|
||||||
|
|
||||||
if (board_flash_wp_on()) {
|
if (board_flash_wp_on())
|
||||||
printf("Uninitialized - Write Protect On\n");
|
printf("Uninitialized - Write Protect On\n");
|
||||||
/* Since WP is on, we can't find real size. Set to 0 */
|
else
|
||||||
ok = 1;
|
|
||||||
} else {
|
|
||||||
flash_size = flash_init();
|
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, "");
|
print_size(flash_size, "");
|
||||||
#ifdef CONFIG_SYS_FLASH_CHECKSUM
|
#ifdef CONFIG_SYS_FLASH_CHECKSUM
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue