Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17715
-gerrit
commit d1fcc987a1eb5284600f89ada966f9d3f632362c Author: Aaron Durbin adurbin@chromium.org Date: Sat Dec 3 17:04:06 2016 -0600
drivers/spi: provide a mechanism to obtain the SPI flash boot device
The MRC cache wants to be able to access the SPI flash boot device. Allow an easy way to provide that so that there isn't duplicate spi_flash objects representing the same device.
BUG=chrome-os-partner:56151
Change-Id: Iba92e8bb8a6060cdd327b10f5f8ec23ac61101e7 Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/drivers/spi/boot_device_rw_nommap.c | 6 ++++++ src/include/spi_flash.h | 4 ++++ 2 files changed, 10 insertions(+)
diff --git a/src/drivers/spi/boot_device_rw_nommap.c b/src/drivers/spi/boot_device_rw_nommap.c index a52a7be..e7d9b9a 100644 --- a/src/drivers/spi/boot_device_rw_nommap.c +++ b/src/drivers/spi/boot_device_rw_nommap.c @@ -95,3 +95,9 @@ const struct region_device *boot_device_rw(void)
return &spi_rw; } + +const struct spi_flash *boot_device_spi_flash(void) +{ + boot_device_rw_init(); + return car_get_var(sfg); +} diff --git a/src/include/spi_flash.h b/src/include/spi_flash.h index 8fec484..95b8251 100644 --- a/src/include/spi_flash.h +++ b/src/include/spi_flash.h @@ -87,4 +87,8 @@ int spi_flash_volatile_group_end(const struct spi_flash *flash); int chipset_volatile_group_begin(const struct spi_flash *flash); int chipset_volatile_group_end(const struct spi_flash *flash);
+/* Return spi_flash object reference for the boot device. This is only valid + * if CONFIG_BOOT_DEVICE_SPI_FLASH is enabled. */ +const struct spi_flash *boot_device_spi_flash(void); + #endif /* _SPI_FLASH_H_ */