diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2022-10-28 10:23:39 -0600 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-11-09 13:40:02 +0000 |
commit | 5717ce6e995f7a442c2aec482091543391ef7784 (patch) | |
tree | 0f558dc0266826f01c27a0ca847c6bc5161870e4 /src/mainboard | |
parent | d08deaabe15f39df6610df7bc06544722002279c (diff) |
soc/amd/common/block/spi: Mainboard to override SPI Read Mode
On certain mainboards due to hardware design limitations, certain SPI
Read Modes eg. (Dual I/O 1-2-2) cannot be supported. Add ability to
override SPI read modes in boards which do not have hardware
limitations. Currently there is an API to override SPI fast speeds.
Update this API for mainboards to override SPI read mode as well.
BUG=b:225213679
TEST=Build and boot to OS in Skyrim. Observe a boot time improvement of
~25 ms with 100 MHz SPI speeds.
Before:
11:start of bootblock 688,046
14:finished loading romstage 30,865
16:FSP-M finished LZMA decompress (ignore for x86) 91,049
Total Time: 1,972,625
After:
11:start of bootblock 667,642
14:finished loading romstage 29,798
16:FSP-M finished LZMA decompress (ignore for x86) 87,743
Total Time: 1,943,924
Change-Id: I160b56f6201a798ce59e977ca40301e23ab63805
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68946
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jon Murphy <jpmurphy@google.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r-- | src/mainboard/google/guybrush/spi_speeds.c | 2 | ||||
-rw-r--r-- | src/mainboard/google/skyrim/Kconfig | 3 | ||||
-rw-r--r-- | src/mainboard/google/skyrim/spi_speeds.c | 10 |
3 files changed, 12 insertions, 3 deletions
diff --git a/src/mainboard/google/guybrush/spi_speeds.c b/src/mainboard/google/guybrush/spi_speeds.c index 857e02d900..7e7ff711b7 100644 --- a/src/mainboard/google/guybrush/spi_speeds.c +++ b/src/mainboard/google/guybrush/spi_speeds.c @@ -4,7 +4,7 @@ #include <boardid.h> #include <stdint.h> -void mainboard_spi_fast_speed_override(uint8_t *fast_speed) +void mainboard_spi_cfg_override(uint8_t *fast_speed, uint8_t *read_mode) { uint32_t board_ver = board_id(); diff --git a/src/mainboard/google/skyrim/Kconfig b/src/mainboard/google/skyrim/Kconfig index 9036406211..d21bcc8630 100644 --- a/src/mainboard/google/skyrim/Kconfig +++ b/src/mainboard/google/skyrim/Kconfig @@ -107,7 +107,8 @@ config VBOOT_STARTS_IN_BOOTBLOCK if !EM100 # EM100 defaults in soc/amd/common/blocks/spi/Kconfig config EFS_SPI_READ_MODE - default 2 # Dual IO (1-1-2) + default 2 if BOARD_GOOGLE_SKYRIM # Dual IO (1-1-2) + default 4 # Dual IO (1-2-2) config EFS_SPI_SPEED default 0 # 66MHz diff --git a/src/mainboard/google/skyrim/spi_speeds.c b/src/mainboard/google/skyrim/spi_speeds.c index 857e02d900..90a6b47677 100644 --- a/src/mainboard/google/skyrim/spi_speeds.c +++ b/src/mainboard/google/skyrim/spi_speeds.c @@ -4,10 +4,18 @@ #include <boardid.h> #include <stdint.h> -void mainboard_spi_fast_speed_override(uint8_t *fast_speed) +void mainboard_spi_cfg_override(uint8_t *fast_speed, uint8_t *read_mode) { uint32_t board_ver = board_id(); if (board_ver >= CONFIG_OVERRIDE_EFS_SPI_SPEED_MIN_BOARD) *fast_speed = CONFIG_OVERRIDE_EFS_SPI_SPEED; + + /* + * Due to a hardware limitation, Dual I/O 1-2-2 Read mode is supported starting + * board version 3. This hardware limitation applies only to Skyrim reference + * design. + */ + if (CONFIG(BOARD_GOOGLE_SKYRIM) && board_ver >= 3) + *read_mode = SPI_READ_MODE_DUAL122; } |