From dcec409e95703b7a99600187e4b56c0b458114eb Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Fri, 7 May 2021 15:35:10 -0600 Subject: [PATCH] Revert "soc/amd/common/espi: Don't set alert pin in espi_set_initial_config" This reverts commit 6eced03b25954e370e20e62f2cbe41f9d5626eae. This prevents zork from booting. We get the following error: eSPI cmd0-cmd2: 00080009 00000000 00000000 data: 00000000. Error: unexpected eSPI status register bits set (Status = 0x10000010) Error: Slave GET_CONFIGURATION failed! This isn't a pure revert. It is more of a fix that keeps the old behavior. BUG=b:187122344 TEST=Boot zork an no longer see eSPI error Signed-off-by: Raul E Rangel Change-Id: If75a35d3994b0fd23945a450032d3cc81abeb136 Reviewed-on: https://review.coreboot.org/c/coreboot/+/53932 Reviewed-by: Felix Held Tested-by: build bot (Jenkins) --- src/soc/amd/common/block/lpc/espi_util.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/soc/amd/common/block/lpc/espi_util.c b/src/soc/amd/common/block/lpc/espi_util.c index 81056b0222..276bb3cdc3 100644 --- a/src/soc/amd/common/block/lpc/espi_util.c +++ b/src/soc/amd/common/block/lpc/espi_util.c @@ -883,6 +883,17 @@ static void espi_set_initial_config(const struct espi_config *mb_cfg) { uint32_t espi_initial_mode = ESPI_OP_FREQ_16_MHZ | ESPI_IO_MODE_SINGLE; + switch (mb_cfg->alert_pin) { + case ESPI_ALERT_PIN_IN_BAND: + break; + case ESPI_ALERT_PIN_PUSH_PULL: + case ESPI_ALERT_PIN_OPEN_DRAIN: + espi_initial_mode |= ESPI_ALERT_MODE; + break; + default: + die("Unknown espi alert config: %u!\n", mb_cfg->alert_pin); + } + espi_write32(ESPI_SLAVE0_CONFIG, espi_initial_mode); }