drivers: espi: xec: mec172x: Handle eSPI bus host enable
Add eSPI bus host enable/disable events from eSPI host. Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
This commit is contained in:
parent
b8e1ce7f98
commit
33fde4b10a
1 changed files with 14 additions and 0 deletions
|
@ -851,6 +851,10 @@ static void espi_pc_isr(const struct device *dev)
|
||||||
{
|
{
|
||||||
struct espi_iom_regs *regs = ESPI_XEC_REG_BASE(dev);
|
struct espi_iom_regs *regs = ESPI_XEC_REG_BASE(dev);
|
||||||
uint32_t status = regs->PCSTS;
|
uint32_t status = regs->PCSTS;
|
||||||
|
struct espi_event evt = { .evt_type = ESPI_BUS_EVENT_CHANNEL_READY,
|
||||||
|
.evt_details = ESPI_CHANNEL_PERIPHERAL,
|
||||||
|
.evt_data = 0 };
|
||||||
|
struct espi_xec_data *data = (struct espi_xec_data *)(dev->data);
|
||||||
|
|
||||||
LOG_DBG("%s %x", __func__, status);
|
LOG_DBG("%s %x", __func__, status);
|
||||||
if (status & MCHP_ESPI_PC_STS_BUS_ERR) {
|
if (status & MCHP_ESPI_PC_STS_BUS_ERR) {
|
||||||
|
@ -866,6 +870,16 @@ static void espi_pc_isr(const struct device *dev)
|
||||||
regs->PCSTS = MCHP_ESPI_PC_STS_EN_CHG;
|
regs->PCSTS = MCHP_ESPI_PC_STS_EN_CHG;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (status & MCHP_ESPI_PC_STS_BM_EN_CHG) {
|
||||||
|
if (status & MCHP_ESPI_PC_STS_BM_EN) {
|
||||||
|
evt.evt_data = ESPI_PC_EVT_BUS_MASTER_ENABLE;
|
||||||
|
LOG_WRN("%s BM change %x", __func__, status);
|
||||||
|
espi_send_callbacks(&data->callbacks, dev, evt);
|
||||||
|
}
|
||||||
|
|
||||||
|
regs->PCSTS = MCHP_ESPI_PC_STS_BM_EN_CHG;
|
||||||
|
}
|
||||||
|
|
||||||
xec_espi_bus_intr_clr(dev, pc_girq_idx);
|
xec_espi_bus_intr_clr(dev, pc_girq_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue