diff options
author | Aaron Durbin <adurbin@chromium.org> | 2016-08-23 08:45:55 -0500 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2016-08-24 15:46:38 +0200 |
commit | 67e4df8b65c0b48717e3550089e7d230aeb6fe52 (patch) | |
tree | 609cafd55f7769ae9f1f2eecf9dea4466885661a /src/drivers | |
parent | 93f34e1a741044b13d1a666ff6ab0db2b85f74a5 (diff) |
drivers/spi: remove unconditional RW boot device initialization
The SPI drivers for the various chipsets are not consistent in
their handling of when they are accessible. Coupled with the
unknown ordering of boot_device_init() being called this can
lead to unexpected behavior (probing failures or hangs). Instead
move the act of initializing the SPI flash boot device to when
the various infrastructure requires its usage when it calls
boot_device_rw(). Those platforms utilizing the RW boot device
would need to ensure their SPI drivers are functional and
ready when the call happens.
This further removes any other systems failing to boot as
reported in https://ticket.coreboot.org/issues/67.
BUG=chrome-os-partner:56151
Change-Id: Ib3bddf5e26bf5322f3dd20345eeef6bee40f0f66
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/16300
Tested-by: build bot (Jenkins)
Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/spi/boot_device_rw_nommap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/drivers/spi/boot_device_rw_nommap.c b/src/drivers/spi/boot_device_rw_nommap.c index bf15e99f94..32ded9c393 100644 --- a/src/drivers/spi/boot_device_rw_nommap.c +++ b/src/drivers/spi/boot_device_rw_nommap.c @@ -70,7 +70,7 @@ static const struct region_device_ops spi_ops = { static const struct region_device spi_rw = REGION_DEV_INIT(&spi_ops, 0, CONFIG_ROM_SIZE); -void boot_device_init(void) +static void boot_device_rw_init(void) { const int bus = CONFIG_BOOT_DEVICE_SPI_FLASH_BUS; const int cs = 0; @@ -86,6 +86,9 @@ void boot_device_init(void) const struct region_device *boot_device_rw(void) { + /* Probe for the SPI flash device if not already done. */ + boot_device_rw_init(); + if (car_get_var(sfg) == NULL) return NULL; |