From 9eaaf0d309af6fce19132676314932e85b790b65 Mon Sep 17 00:00:00 2001 From: Karthikeyan Ramasubramanian Date: Tue, 5 Oct 2021 14:20:14 -0600 Subject: mb/google/guybrush: Override SPI Fast speeds Add support to override SPI fast speeds based on board version from both bootblock and verstage. Overrides apply for Guybrush only and SPI speed is overridden from 66 MHz to 100 MHz starting board version 4. This will help to improve the boot time on board version by ~60 ms and still allow the old boards to boot with 66 MHz. BUG=b:199779306 TEST=Build and boot to OS in Guybrush. Perform S5->S0, G3->S0, warm reset and suspend/resume cycles for 50 iterations each. Signed-off-by: Karthikeyan Ramasubramanian Change-Id: I5bf03ab8772f27aca346589e9c5662caf014d0d2 Reviewed-on: https://review.coreboot.org/c/coreboot/+/58117 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held Reviewed-by: Raul Rangel --- src/mainboard/google/guybrush/chromeos.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mainboard/google/guybrush/chromeos.c') diff --git a/src/mainboard/google/guybrush/chromeos.c b/src/mainboard/google/guybrush/chromeos.c index c1621d917e..a43b3032bb 100644 --- a/src/mainboard/google/guybrush/chromeos.c +++ b/src/mainboard/google/guybrush/chromeos.c @@ -1,5 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ +#include #include #include #include @@ -36,3 +37,11 @@ int get_ec_is_trusted(void) /* EC is trusted if not in RW. */ return !gpio_get(GPIO_EC_IN_RW); } + +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; +} -- cgit v1.2.3