drivers/spi: Add BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES config

Added new config BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES to accomodate
older x86 platforms that don't allow writing to SPI flash when early
stages are running XIP from flash.  If
BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES is not selected,
BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY will get auto-selected if
BOOT_DEVICE_SPI_FLASH_RW_NOMMAP=y.  This allows for current platforms
that write to flash in the earlier stages, assuming that they have
that capability.

BUG=b:150502246
BRANCH=None

TEST=diff the coreboot.rom files resulting from running
     ./util/abuild/abuild -p none -t GOOGLE_NAMI -x -a --timeless
     with and without this change to make sure that there was no
     difference.  Also did this for GOOGLE_CANDY board, which is
     baytrail based (and has BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES
     enabled).

Change-Id: I3aef8be702f55873233610b8e20d0662aa951ca7
Signed-off-by: Shelley Chen <shchen@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45740
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Shelley Chen
2020-09-25 09:30:44 -07:00
parent ba9f82ed73
commit 6c2568f4f5
20 changed files with 19 additions and 12 deletions

View File

@@ -42,8 +42,20 @@ config BOOT_DEVICE_SPI_FLASH_RW_NOMMAP
Provide common implementation of the RW boot device that
doesn't provide mmap() operations.
config BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES
bool
default n
depends on BOOT_DEVICE_SPI_FLASH_RW_NOMMAP
help
For platforms who do not allow writes to SPI flash in early
stages like romstage. Not selecting this config will result
in the auto-selection of
BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY if
BOOT_DEVICE_SPI_FLASH_RW_NOMMAP is selected by the platform.
config BOOT_DEVICE_SPI_FLASH_RW_NOMMAP_EARLY
bool
default y if BOOT_DEVICE_SPI_FLASH_RW_NOMMAP && !BOOT_DEVICE_SPI_FLASH_NO_EARLY_WRITES
default n
depends on BOOT_DEVICE_SPI_FLASH_RW_NOMMAP
help