diff options
author | Karthikeyan Ramasubramanian <kramasub@google.com> | 2022-10-04 10:08:15 -0600 |
---|---|---|
committer | Karthik Ramasubramanian <kramasub@google.com> | 2022-10-07 19:17:28 +0000 |
commit | aea60bcd43d0b57313ed4ec20ff28f6877095e98 (patch) | |
tree | 920903f0ff91a895d071af78283af3374b32d1ee /src/mainboard/google | |
parent | 93781523a5291bed1faf9f2d9cc5965f22f6c605 (diff) |
mb/google/skyrim: Override SPI flash bus speed
Add configuration to bump up the SPI flash bus speed from 66 MHz to 100
MHz starting the board version where required schematics update is done.
BUG=b:245949155
TEST=Build and boot to OS in Skyrim with 100 MHz SPI bus speed. Perform
warm and cold reboot cycles for 100 iterations each. Observe that the
boot time improved by ~115 ms compared to 66 MHz SPI flash bus speed.
At 66 MHz:
508:finished loading body 538,319 (83,806)
11:start of bootblock 1,196,809 (624,777)
14:finished loading romstage 1,236,905 (39,163)
970:loading FSP-M 1,237,056 (37)
15:starting LZMA decompress (ignore for x86) 1,237,073 (17)
16:finished LZMA decompress (ignore for x86) 1,358,937 (121,864)
8:starting to load ramstage 2,010,304 (0)
15:starting LZMA decompress (ignore for x86) 2,010,312 (8)
16:finished LZMA decompress (ignore for x86) 2,067,181 (56,869)
971:loading FSP-S 2,078,232 (7,999)
17:starting LZ4 decompress (ignore for x86) 2,078,253 (21)
18:finished LZ4 decompress (ignore for x86) 2,084,297 (6,044)
90:starting to load payload 2,316,933 (5)
15:starting LZMA decompress (ignore for x86) 2,316,947 (14)
16:finished LZMA decompress (ignore for x86) 2,339,819 (22,872)
Total Time: 2,464,338
At 100 MHz:
508:finished loading body 515,118 (59,364)
11:start of bootblock 1,115,043 (566,110)
14:finished loading romstage 1,146,713 (29,697)
970:loading FSP-M 1,146,865 (38)
15:starting LZMA decompress (ignore for x86) 1,146,881 (16)
16:finished LZMA decompress (ignore for x86) 1,249,351 (102,470)
8:starting to load ramstage 1,900,568 (1)
15:starting LZMA decompress (ignore for x86) 1,900,576 (8)
16:finished LZMA decompress (ignore for x86) 1,956,337 (55,761)
971:loading FSP-S 1,967,357 (7,930)
17:starting LZ4 decompress (ignore for x86) 1,967,377 (20)
18:finished LZ4 decompress (ignore for x86) 1,972,925 (5,548)
90:starting to load payload 2,205,300 (6)
15:starting LZMA decompress (ignore for x86) 2,205,313 (13)
16:finished LZMA decompress (ignore for x86) 2,227,087 (21,774)
Total Time: 2,349,804
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com>
Change-Id: I5e8db22151fbc2db1f9e81b3644338348160736d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68116
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jon Murphy <jpmurphy@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r-- | src/mainboard/google/skyrim/Kconfig | 16 | ||||
-rw-r--r-- | src/mainboard/google/skyrim/Makefile.inc | 2 | ||||
-rw-r--r-- | src/mainboard/google/skyrim/spi_speeds.c | 13 |
3 files changed, 31 insertions, 0 deletions
diff --git a/src/mainboard/google/skyrim/Kconfig b/src/mainboard/google/skyrim/Kconfig index 87cf6e43a5..0bc9ea981c 100644 --- a/src/mainboard/google/skyrim/Kconfig +++ b/src/mainboard/google/skyrim/Kconfig @@ -126,4 +126,20 @@ config ALT_SPI_SPEED endif # !EM100 +config OVERRIDE_EFS_SPI_SPEED + int + default 3 if EM100 + default 4 # 100MHz + help + Override EFS SPI Speed Configuration to be applied based on certain + board version. + +config OVERRIDE_EFS_SPI_SPEED_MIN_BOARD + hex + default 0x5 if BOARD_GOOGLE_SKYRIM + default 0xffffffff + help + Minimum board version starting which the Override EFS SPI Speed + configuration has to be applied. + endif # BOARD_GOOGLE_BASEBOARD_SKYRIM diff --git a/src/mainboard/google/skyrim/Makefile.inc b/src/mainboard/google/skyrim/Makefile.inc index ba175a2376..a594ceb518 100644 --- a/src/mainboard/google/skyrim/Makefile.inc +++ b/src/mainboard/google/skyrim/Makefile.inc @@ -10,6 +10,8 @@ ramstage-$(CONFIG_CHROMEOS) += chromeos.c verstage-$(CONFIG_VBOOT_STARTS_BEFORE_BOOTBLOCK) += verstage.c +all-y += spi_speeds.c + subdirs-y += variants/baseboard subdirs-y += variants/$(VARIANT_DIR) diff --git a/src/mainboard/google/skyrim/spi_speeds.c b/src/mainboard/google/skyrim/spi_speeds.c new file mode 100644 index 0000000000..857e02d900 --- /dev/null +++ b/src/mainboard/google/skyrim/spi_speeds.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <amdblocks/spi.h> +#include <boardid.h> +#include <stdint.h> + +void mainboard_spi_fast_speed_override(uint8_t *fast_speed) +{ + uint32_t board_ver = board_id(); + + if (board_ver >= CONFIG_OVERRIDE_EFS_SPI_SPEED_MIN_BOARD) + *fast_speed = CONFIG_OVERRIDE_EFS_SPI_SPEED; +} |