From 381860454fb5a1a6ffc4c8d1fdf3f021f75cbcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Thu, 4 Nov 2021 06:36:25 +0200 Subject: [PATCH] google/guybrush: Move SPI speed override MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SPI speed override is not related to ChromeOS, thus the location in chromeos.c was poor choice. Change-Id: Ie3db89f252af1f44e9539497c05bdf965565a191 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/58945 Tested-by: build bot (Jenkins) Reviewed-by: Raul Rangel Reviewed-by: Felix Held --- src/mainboard/google/guybrush/Makefile.inc | 2 ++ src/mainboard/google/guybrush/chromeos.c | 10 ---------- src/mainboard/google/guybrush/spi_speeds.c | 13 +++++++++++++ 3 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 src/mainboard/google/guybrush/spi_speeds.c diff --git a/src/mainboard/google/guybrush/Makefile.inc b/src/mainboard/google/guybrush/Makefile.inc index 6bc3288276..fa729feccf 100644 --- a/src/mainboard/google/guybrush/Makefile.inc +++ b/src/mainboard/google/guybrush/Makefile.inc @@ -18,6 +18,8 @@ ramstage-y += mainboard.c ramstage-y += ec.c ramstage-$(CONFIG_CHROMEOS) += chromeos.c +all-y += spi_speeds.c + verstage-y += verstage.c verstage-$(CONFIG_CHROMEOS) += chromeos.c diff --git a/src/mainboard/google/guybrush/chromeos.c b/src/mainboard/google/guybrush/chromeos.c index 6cd48ea440..61313223fe 100644 --- a/src/mainboard/google/guybrush/chromeos.c +++ b/src/mainboard/google/guybrush/chromeos.c @@ -1,8 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-or-later */ -#include #include -#include #include #include #include @@ -27,11 +25,3 @@ void mainboard_chromeos_acpi_generate(void) { chromeos_acpi_gpio_generate(cros_gpios, ARRAY_SIZE(cros_gpios)); } - -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; -} diff --git a/src/mainboard/google/guybrush/spi_speeds.c b/src/mainboard/google/guybrush/spi_speeds.c new file mode 100644 index 0000000000..857e02d900 --- /dev/null +++ b/src/mainboard/google/guybrush/spi_speeds.c @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include +#include +#include + +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; +}