aboutsummaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2021-05-21 17:04:28 -0600
committerPatrick Georgi <pgeorgi@google.com>2021-05-30 20:28:41 +0000
commit43aa527eecbf272e179a09b0c3313636b0e6e19c (patch)
tree7c78f66d6824217c65eabd2bbc3f6321ab17f611 /src/soc
parent203698a4cb9101e9c649c990579a197c6693e2a0 (diff)
soc/amd/common/block/espi: Explicitly assert PLTRST#
PLTRST# is currently asserted and latched when eSPI_RST# gets asserted. If eSPI_RST# isn't used on a platform or it doesn't properly assert in all cases, then PLTRST# will never be asserted. This could result in the AP and EC being out of sync. BUG=b:188188172, b:188935533 TEST=Warm reset guybrush with partial #22 rework. Verify that peripheral channel is correctly reset. Signed-off-by: Raul E Rangel <rrangel@chromium.org> Change-Id: I20d12edf3efc6100096e24aa8d1aec76bbde264f Reviewed-on: https://review.coreboot.org/c/coreboot/+/54884 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/amd/common/block/lpc/espi_util.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/soc/amd/common/block/lpc/espi_util.c b/src/soc/amd/common/block/lpc/espi_util.c
index e6ae2cb505..b724408022 100644
--- a/src/soc/amd/common/block/lpc/espi_util.c
+++ b/src/soc/amd/common/block/lpc/espi_util.c
@@ -563,7 +563,7 @@ static int espi_send_reset(void)
return espi_send_command(&cmd);
}
-static int espi_send_pltrst_deassert(const struct espi_config *mb_cfg)
+static int espi_send_pltrst(const struct espi_config *mb_cfg, bool assert)
{
struct espi_cmd cmd = {
.hdr0 = {
@@ -573,7 +573,8 @@ static int espi_send_pltrst_deassert(const struct espi_config *mb_cfg)
},
.data = {
.byte0 = ESPI_VW_INDEX_SYSTEM_EVENT_3,
- .byte1 = ESPI_VW_SIGNAL_HIGH(ESPI_VW_PLTRST),
+ .byte1 = assert ? ESPI_VW_SIGNAL_LOW(ESPI_VW_PLTRST)
+ : ESPI_VW_SIGNAL_HIGH(ESPI_VW_PLTRST),
},
};
@@ -1006,9 +1007,15 @@ int espi_setup(void)
return -1;
}
+ /* Assert PLTRST# if VW channel is enabled by mainboard. */
+ if (espi_send_pltrst(cfg, true) == -1) {
+ printk(BIOS_ERR, "Error: PLTRST# assertion failed!\n");
+ return -1;
+ }
+
/* De-assert PLTRST# if VW channel is enabled by mainboard. */
- if (espi_send_pltrst_deassert(cfg) == -1) {
- printk(BIOS_ERR, "Error: PLTRST deassertion failed!\n");
+ if (espi_send_pltrst(cfg, false) == -1) {
+ printk(BIOS_ERR, "Error: PLTRST# deassertion failed!\n");
return -1;
}