drivers/spi: provide optional implementation of boot_device_rw()
commit6f1155916a8b2f5409d0992963a1c16178794a48
authorAaron Durbin <adurbin@chromium.org>
Thu, 11 Aug 2016 23:24:54 +0000 (11 18:24 -0500)
committerMartin Roth <martinroth@google.com>
Fri, 19 Aug 2016 16:15:08 +0000 (19 18:15 +0200)
tree5949ec3c31b4a3dd150aa70a4f95257e43cc1888
parent5180dd2c4b6fa7756c43485a8a0f2ca5015cc774
drivers/spi: provide optional implementation of boot_device_rw()

On many x86 platforms the boot device is SPI which is memory
mapped. However, in order to write to the boot device one needs
to use the SPI api. Therefore, provide a common implementation
of boot_device_rw() which has no mmap() functionality. It only
reads, writes, and erases. This will be used in the existing
infrastructure but in a SPI agnostic way.

Two options are added:
1. BOOT_DEVICE_SPI_FLASH_RW_NOMMAP
2. BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY

The former is auto-selected when COMMON_CBFS_SPI_WRAPPER is not
selected. The latter can be used to include the implementation
in the early stages such as bootblock, verstage, and romstage.

BUG=chrome-os-partner:56151

Change-Id: I2aa75f88409309e3f9b9bd79b52d27c0061139c8
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/16200
Tested-by: build bot (Jenkins)
Reviewed-by: Furquan Shaikh <furquan@google.com>
Reviewed-by: Martin Roth <martinroth@google.com>
src/drivers/spi/Kconfig
src/drivers/spi/Makefile.inc
src/drivers/spi/boot_device_rw_nommap.c [new file with mode: 0644]