mirror of
https://github.com/fail0verflow/switch-coreboot.git
synced 2025-05-04 01:39:18 -04:00
UPSTREAM: 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 BRANCH=None TEST=None Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17715 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com> Change-Id: Iba92e8bb8a6060cdd327b10f5f8ec23ac61101e7 Reviewed-on: https://chromium-review.googlesource.com/418435 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
abf56875a5
commit
5d4276f439
2 changed files with 10 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -88,4 +88,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_ */
|
||||
|
|
Loading…
Add table
Reference in a new issue