diff options
author | Raul E Rangel <rrangel@chromium.org> | 2022-03-24 16:55:44 -0600 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-03-28 15:44:39 +0000 |
commit | 96839d183c0b7ab2e53cf468784a4937a107ec15 (patch) | |
tree | 88bff2fe98fc7e0cbcf1a7485fd30b802edf2628 /src/mainboard | |
parent | cc1426b1cd8f82a3a8f027983a0ef66c6607610e (diff) |
mb/google/skyrim: Implement mb_set_up_early_espi
This will setup the eSPI GPIOs in bootblock right before eSPI init.
BUG=b:226635441
TEST=build skyrim
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: I6ff32bf840aa4b757e98d876cbd4e2ba15a760da
Reviewed-on: https://review.coreboot.org/c/coreboot/+/63094
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/mainboard')
3 files changed, 36 insertions, 0 deletions
diff --git a/src/mainboard/google/skyrim/bootblock.c b/src/mainboard/google/skyrim/bootblock.c index 5a1c4daa9b..c332aed510 100644 --- a/src/mainboard/google/skyrim/bootblock.c +++ b/src/mainboard/google/skyrim/bootblock.c @@ -1,8 +1,18 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <amdblocks/espi.h> #include <bootblock_common.h> #include <baseboard/variants.h> +void mb_set_up_early_espi(void) +{ + size_t num_gpios; + const struct soc_amd_gpio *gpios; + + variant_espi_gpio_table(&gpios, &num_gpios); + gpio_configure_pads(gpios, num_gpios); +} + void bootblock_mainboard_early_init(void) { size_t num_gpios, override_num_gpios; diff --git a/src/mainboard/google/skyrim/variants/baseboard/gpio.c b/src/mainboard/google/skyrim/variants/baseboard/gpio.c index fd85b994bd..a262347fdc 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/gpio.c +++ b/src/mainboard/google/skyrim/variants/baseboard/gpio.c @@ -141,6 +141,23 @@ static const struct soc_amd_gpio base_gpio_table[] = { PAD_NF(GPIO_148, I2C1_SDA, PULL_NONE), }; +static const struct soc_amd_gpio espi_gpio_table[] = { + /* ESPI_CS_L */ + PAD_NF(GPIO_30, ESPI_CS_L, PULL_NONE), + /* ESPI_CLK */ + PAD_NF(GPIO_77, SPI1_CLK, PULL_NONE), + /* ESPI1_DATA0 */ + PAD_NF(GPIO_81, SPI1_DAT0, PULL_NONE), + /* ESPI1_DATA1 */ + PAD_NF(GPIO_80, SPI1_DAT1, PULL_NONE), + /* ESPI1_DATA2 */ + PAD_NF(GPIO_68, SPI1_DAT2, PULL_NONE), + /* ESPI1_DATA3 */ + PAD_NF(GPIO_69, SPI1_DAT3, PULL_NONE), + /* ESPI_ALERT_L */ + PAD_NF(GPIO_22, ESPI_ALERT_D1, PULL_NONE), +}; + static const struct soc_amd_gpio tpm_gpio_table[] = { /* I2C3_SCL */ PAD_NF(GPIO_19, I2C3_SCL, PULL_NONE), @@ -222,6 +239,12 @@ __weak void variant_sleep_gpio_table(const struct soc_amd_gpio **gpio, size_t *s *gpio = sleep_gpio_table; } +__weak void variant_espi_gpio_table(const struct soc_amd_gpio **gpio, size_t *size) +{ + *size = ARRAY_SIZE(espi_gpio_table); + *gpio = espi_gpio_table; +} + __weak void variant_tpm_gpio_table(const struct soc_amd_gpio **gpio, size_t *size) { *size = ARRAY_SIZE(tpm_gpio_table); diff --git a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h index 64a414bcd7..7289e10665 100644 --- a/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/skyrim/variants/baseboard/include/baseboard/variants.h @@ -37,6 +37,9 @@ void variant_early_override_gpio_table(const struct soc_amd_gpio **gpio, size_t /* This function provides GPIO settings before entering sleep. */ void variant_sleep_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); +/* This function provides GPIO settings for eSPI bus. */ +void variant_espi_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); + /* This function provides GPIO settings for TPM i2c bus. */ void variant_tpm_gpio_table(const struct soc_amd_gpio **gpio, size_t *size); |