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>
This commit is contained in:
Raul E Rangel 2022-03-24 16:55:44 -06:00 committed by Felix Held
parent cc1426b1cd
commit 96839d183c
3 changed files with 36 additions and 0 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);