From 6f1155916a8b2f5409d0992963a1c16178794a48 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 11 Aug 2016 18:24:54 -0500 Subject: 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 Reviewed-on: https://review.coreboot.org/16200 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Martin Roth --- src/drivers/spi/Kconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/drivers/spi/Kconfig') diff --git a/src/drivers/spi/Kconfig b/src/drivers/spi/Kconfig index 5eb9b56557..4c2fd1f060 100644 --- a/src/drivers/spi/Kconfig +++ b/src/drivers/spi/Kconfig @@ -39,6 +39,23 @@ config BOOT_DEVICE_SPI_FLASH_BUS help Which SPI bus the boot device is connected to. +config BOOT_DEVICE_SPI_FLASH_RW_NOMMAP + bool + default y if !COMMON_CBFS_SPI_WRAPPER + default n + depends on BOOT_DEVICE_SPI_FLASH + help + Provide common implementation of the RW boot device that + doesn't provide mmap() operations. + +config BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY + bool + default n + depends on BOOT_DEVICE_SPI_FLASH_RW_NOMMAP + help + Include the common implementation in all stages, including the + early ones. + config SPI_FLASH_INCLUDE_ALL_DRIVERS bool default n if COMMON_CBFS_SPI_WRAPPER -- cgit v1.2.3