summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/subsys/ap_pwrseq/signal_vw.c18
-rw-r--r--zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_console.c8
2 files changed, 14 insertions, 12 deletions
diff --git a/zephyr/subsys/ap_pwrseq/signal_vw.c b/zephyr/subsys/ap_pwrseq/signal_vw.c
index de2756c137..53719a9c4f 100644
--- a/zephyr/subsys/ap_pwrseq/signal_vw.c
+++ b/zephyr/subsys/ap_pwrseq/signal_vw.c
@@ -40,9 +40,8 @@ DT_FOREACH_STATUS_OKAY(MY_COMPAT, INIT_ESPI_SIGNAL)
*/
static atomic_t signal_data;
/*
- * Mask of valid signals. If the bus is reset, this is cleared,
- * and when a signal is updated the associated bit is set to indicate
- * the signal is valid.
+ * Mask of valid signals. A signal is considered valid once an
+ * initial value has been received for it.
*/
static atomic_t signal_valid;
@@ -62,11 +61,12 @@ static void espi_handler(const struct device *dev,
event.evt_type);
break;
- case ESPI_BUS_RESET:
- /*
- * Clear the signal valid mask.
- */
- atomic_clear(&signal_valid);
+ case ESPI_BUS_EVENT_CHANNEL_READY:
+ /* Virtual wire channel is not ready, clear valid flag */
+ if (event.evt_details == ESPI_CHANNEL_VWIRE &&
+ !event.evt_data) {
+ atomic_clear(&signal_valid);
+ }
break;
case ESPI_BUS_EVENT_VWIRE_RECEIVED:
@@ -103,7 +103,7 @@ void power_signal_vw_init(void)
/* Configure handler for eSPI events */
espi_init_callback(&espi_cb, espi_handler,
- ESPI_BUS_RESET |
+ ESPI_BUS_EVENT_CHANNEL_READY |
ESPI_BUS_EVENT_VWIRE_RECEIVED);
espi_add_callback(espi_dev, &espi_cb);
/*
diff --git a/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_console.c b/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_console.c
index e671e46113..77f8134d10 100644
--- a/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_console.c
+++ b/zephyr/subsys/ap_pwrseq/x86_non_dsx_common_pwrseq_console.c
@@ -42,17 +42,19 @@ static int powerindebug_handler(const struct shell *shell, size_t argc,
/* Print the mask */
current = power_get_signals();
- shell_fprintf(shell, SHELL_INFO, "power in: 0x%04x\n", current);
- shell_fprintf(shell, SHELL_INFO, "debug mask: 0x%04x\n",
+ shell_fprintf(shell, SHELL_INFO, "power in: 0x%05x\n", current);
+ shell_fprintf(shell, SHELL_INFO, "debug mask: 0x%05x\n",
power_get_debug());
/* Print the decode */
shell_fprintf(shell, SHELL_INFO, "bit meanings:\n");
for (i = 0; i < POWER_SIGNAL_COUNT; i++) {
power_signal_mask_t mask = POWER_SIGNAL_MASK(i);
+ bool valid = (power_signal_get(i) >= 0);
- shell_fprintf(shell, SHELL_INFO, " 0x%04x %d %s\n",
+ shell_fprintf(shell, SHELL_INFO, " 0x%05x %d%s %s\n",
mask, (current & mask) ? 1 : 0,
+ valid ? " " : "!",
power_signal_name(i));
}