From ee1653985dc5418f978a242345b477ae48a1a169 Mon Sep 17 00:00:00 2001 From: Jose Alberto Meza Date: Mon, 28 Feb 2022 17:15:42 -0800 Subject: [PATCH] drivers: espi: xec: mec172x: Handle eSPI peripheral channel error Handle eSPI periperal channel error to avoid continous interrupt beyond the bus error. Whenever an eSPI access causes an internal bus error, PC_BUS_ERROR bit is set, it remains set until cleared by written with an 1. Signed-off-by: Jose Alberto Meza --- drivers/espi/espi_mchp_xec_v2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/espi/espi_mchp_xec_v2.c b/drivers/espi/espi_mchp_xec_v2.c index 9dc37d35ffd..bfdbc56c266 100644 --- a/drivers/espi/espi_mchp_xec_v2.c +++ b/drivers/espi/espi_mchp_xec_v2.c @@ -852,6 +852,12 @@ static void espi_pc_isr(const struct device *dev) struct espi_iom_regs *regs = ESPI_XEC_REG_BASE(dev); uint32_t status = regs->PCSTS; + LOG_DBG("%s %x", __func__, status); + if (status & MCHP_ESPI_PC_STS_BUS_ERR) { + LOG_ERR("%s bus error", __func__); + regs->PCSTS = MCHP_ESPI_PC_STS_BUS_ERR; + } + if (status & MCHP_ESPI_PC_STS_EN_CHG) { if (status & MCHP_ESPI_PC_STS_EN) { setup_espi_io_config(dev, MCHP_ESPI_IOBAR_INIT_DFLT);