drivers: espi: xec: Allow to intercept eSPI host suspend/reset warnings
Fix #22188 Introduce config option to disable automatic acknowledge via virtual wires on response to eSPI host suspend and reset warnings. This will give the opportunity for eSPI slave systems that need to perform preparations before reset or suspend. Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
This commit is contained in:
parent
35c28a3dbf
commit
77b7b42f1d
2 changed files with 38 additions and 0 deletions
|
@ -40,6 +40,19 @@ config ESPI_VWIRE_CHANNEL
|
|||
help
|
||||
eSPI Controller supports virtual wires channel.
|
||||
|
||||
if ESPI_VWIRE_CHANNEL
|
||||
|
||||
config ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE
|
||||
bool "Automatic acknowledge for eSPI HOST warnings"
|
||||
default y
|
||||
help
|
||||
Enable automatic acknowledge from eSPI slave towards eSPI host
|
||||
whenever it receives suspend or reset warning.
|
||||
If this is disabled, it means the app wants to be give the opportunity
|
||||
to prepare for either HOST suspend or reset.
|
||||
|
||||
endif # ESPI_VWIRE_CHANNEL
|
||||
|
||||
config ESPI_OOB_CHANNEL
|
||||
bool "eSPI Out-of-band channel"
|
||||
help
|
||||
|
|
|
@ -789,18 +789,43 @@ static void vw_host_rst_warn_isr(struct device *dev)
|
|||
{
|
||||
u8_t status;
|
||||
|
||||
#ifndef CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE
|
||||
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
|
||||
struct espi_event evt = { ESPI_BUS_EVENT_VWIRE_RECEIVED, 0, 0 };
|
||||
#endif
|
||||
|
||||
espi_xec_receive_vwire(dev, ESPI_VWIRE_SIGNAL_HOST_RST_WARN, &status);
|
||||
|
||||
#ifndef CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE
|
||||
evt.evt_details = ESPI_VWIRE_SIGNAL_HOST_RST_WARN;
|
||||
evt.evt_details = ESPI_BUS_EVENT_VWIRE_RECEIVED;
|
||||
espi_send_callbacks(&data->callbacks, dev, evt);
|
||||
#else
|
||||
|
||||
k_busy_wait(ESPI_XEC_VWIRE_ACK_DELAY);
|
||||
espi_xec_send_vwire(dev, ESPI_VWIRE_SIGNAL_HOST_RST_ACK, status);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void vw_sus_warn_isr(struct device *dev)
|
||||
{
|
||||
u8_t status;
|
||||
|
||||
#ifndef CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE
|
||||
struct espi_xec_data *data = (struct espi_xec_data *)(dev->driver_data);
|
||||
struct espi_event evt = { ESPI_BUS_EVENT_VWIRE_RECEIVED, 0, 0 };
|
||||
#endif
|
||||
|
||||
espi_xec_receive_vwire(dev, ESPI_VWIRE_SIGNAL_SUS_WARN, &status);
|
||||
|
||||
#ifndef CONFIG_ESPI_AUTOMATIC_WARNING_ACKNOWLEDGE
|
||||
evt.evt_details = ESPI_BUS_EVENT_VWIRE_RECEIVED;
|
||||
evt.evt_data = status;
|
||||
espi_send_callbacks(&data->callbacks, dev, evt);
|
||||
#else
|
||||
k_busy_wait(ESPI_XEC_VWIRE_ACK_DELAY);
|
||||
espi_xec_send_vwire(dev, ESPI_VWIRE_SIGNAL_SUS_ACK, status);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ibf_isr(struct device *dev)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue