diff options
-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 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/spi.h | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/spi/fch_spi.c | 4 |
5 files changed, 15 insertions, 6 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; } diff --git a/src/soc/amd/common/block/include/amdblocks/spi.h b/src/soc/amd/common/block/include/amdblocks/spi.h index 4be3739bcf..dc7097f275 100644 --- a/src/soc/amd/common/block/include/amdblocks/spi.h +++ b/src/soc/amd/common/block/include/amdblocks/spi.h @@ -118,7 +118,7 @@ void spi_write16(uint8_t reg, uint16_t val); void spi_write32(uint8_t reg, uint32_t val); void fch_spi_config_modes(void); -void mainboard_spi_fast_speed_override(uint8_t *fast_speed); +void mainboard_spi_cfg_override(uint8_t *fast_speed, uint8_t *read_mode); /* Ensure you hold the mutex when performing SPI transactions */ extern struct thread_mutex spi_hw_mutex; diff --git a/src/soc/amd/common/block/spi/fch_spi.c b/src/soc/amd/common/block/spi/fch_spi.c index 5ef900c3c5..4a8482e97e 100644 --- a/src/soc/amd/common/block/spi/fch_spi.c +++ b/src/soc/amd/common/block/spi/fch_spi.c @@ -50,7 +50,7 @@ void show_spi_speeds_and_modes(void) printk(BIOS_DEBUG, "SPI Read Mode: %s\n", read_mode_str[DECODE_SPI_READ_MODE(val32)]); } -void __weak mainboard_spi_fast_speed_override(uint8_t *fast_speed) +void __weak mainboard_spi_cfg_override(uint8_t *fast_speed, uint8_t *read_mode) { /* No overriding SPI speeds. */ } @@ -107,7 +107,7 @@ void fch_spi_config_modes(void) read_mode = CONFIG_EFS_SPI_READ_MODE; fast_speed = CONFIG_EFS_SPI_SPEED; } - mainboard_spi_fast_speed_override(&fast_speed); + mainboard_spi_cfg_override(&fast_speed, &read_mode); if (fast_speed != CONFIG_EFS_SPI_SPEED) { normal_speed = lower_speed(normal_speed, fast_speed); |