drivers: espi: xec: Report espi reset correctly to app
Handle espi reset interrupt before clearing it So it can send correct notification. Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
This commit is contained in:
parent
d7dbb572e3
commit
d52a3660de
1 changed files with 7 additions and 5 deletions
|
@ -365,15 +365,17 @@ static void espi_init_flash(struct device *dev)
|
||||||
|
|
||||||
static void espi_rst_isr(struct device *dev)
|
static void espi_rst_isr(struct device *dev)
|
||||||
{
|
{
|
||||||
|
u8_t rst_sts;
|
||||||
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
|
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
|
||||||
struct espi_event evt = { ESPI_BUS_RESET, 0, 0 };
|
struct espi_event evt = { ESPI_BUS_RESET, 0, 0 };
|
||||||
|
|
||||||
if (ESPI_CAP_REGS->ERST_STS & MCHP_ESPI_RST_ISTS) {
|
rst_sts = ESPI_CAP_REGS->ERST_STS;
|
||||||
ESPI_CAP_REGS->ERST_STS |= MCHP_ESPI_RST_ISTS;
|
|
||||||
|
|
||||||
/* TODO: Check if we need to detect eSPI reset after boot */
|
/* eSPI reset status register is clear on write register */
|
||||||
ESPI_CAP_REGS->ERST_IEN = 0;
|
ESPI_CAP_REGS->ERST_STS |= MCHP_ESPI_RST_ISTS;
|
||||||
if (ESPI_CAP_REGS->ERST_STS & ~MCHP_ESPI_RST_ISTS_PIN_RO_HI) {
|
|
||||||
|
if (rst_sts & MCHP_ESPI_RST_ISTS) {
|
||||||
|
if (rst_sts & ~MCHP_ESPI_RST_ISTS_PIN_RO_HI) {
|
||||||
data->espi_rst_asserted = 1;
|
data->espi_rst_asserted = 1;
|
||||||
} else {
|
} else {
|
||||||
data->espi_rst_asserted = 0;
|
data->espi_rst_asserted = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue