Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/58945 )
Change subject: google/guybrush: Move SPI speed override ......................................................................
google/guybrush: Move SPI speed override
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 kyosti.malkki@gmail.com --- M src/mainboard/google/guybrush/Makefile.inc M src/mainboard/google/guybrush/chromeos.c A src/mainboard/google/guybrush/spi_speeds.c 3 files changed, 16 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/58945/1
diff --git a/src/mainboard/google/guybrush/Makefile.inc b/src/mainboard/google/guybrush/Makefile.inc index 6bc3288..1438d86 100644 --- a/src/mainboard/google/guybrush/Makefile.inc +++ b/src/mainboard/google/guybrush/Makefile.inc @@ -16,10 +16,11 @@
ramstage-y += mainboard.c ramstage-y += ec.c -ramstage-$(CONFIG_CHROMEOS) += chromeos.c +ramstage-y += chromeos.c + +all-y += spi_speeds.c
verstage-y += verstage.c -verstage-$(CONFIG_CHROMEOS) += chromeos.c
subdirs-y += variants/baseboard subdirs-y += variants/$(VARIANT_DIR) diff --git a/src/mainboard/google/guybrush/chromeos.c b/src/mainboard/google/guybrush/chromeos.c index a7cc0a8..8ea360a 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 <amdblocks/spi.h> #include <baseboard/gpio.h> -#include <boardid.h> #include <bootmode.h> #include <boot/coreboot_tables.h> #include <gpio.h> @@ -24,10 +22,3 @@ };
DECLARE_CROS_GPIOS(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 0000000..857e02d --- /dev/null +++ b/src/mainboard/google/guybrush/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; +}