summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2020-11-11 09:39:56 -0700
committerCommit Bot <commit-bot@chromium.org>2020-11-19 03:08:28 +0000
commit16511b74ee424521f884a2adcec94f08bd008635 (patch)
tree303735b3f19a4a7d47df1124593ce985a4cfd2f4
parent2f82556bb550f9a162e1c2a100faeda1b9dd291f (diff)
downloadchrome-ec-16511b74ee424521f884a2adcec94f08bd008635.tar.gz
power: allow eSPI virtual wires without eSPI host commands for zephyr
For Zephyr OS, we want to get eSPI up and going for power sequencing without having to bring in all of the host command dependencies. Right now the power sequencing code assumes that if we are using eSPI for host commands, that means we might have eSPI virtual wires too. Instead, use the separate option CONFIG_HOST_ESPI_VW_POWER_SIGNAL, which is what we actually want, and allow that to be defined without CONFIG_HOSTCMD_ESPI. BUG=b:171312361 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I2f56ef3ab9cc566f5e0e3926fea96484daa93236 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548302 Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r--include/config.h7
-rw-r--r--power/common.c6
2 files changed, 9 insertions, 4 deletions
diff --git a/include/config.h b/include/config.h
index 0e189dd625..23fe474ff4 100644
--- a/include/config.h
+++ b/include/config.h
@@ -4937,7 +4937,12 @@
#define CONFIG_HOST_ESPI_VW_POWER_SIGNAL
#endif
-#if defined(CONFIG_HOST_ESPI_VW_POWER_SIGNAL) && !defined(CONFIG_HOSTCMD_ESPI)
+/*
+ * Note that in Zephyr OS, eSPI can be enabled for virtual wires
+ * without using eSPI for host commands.
+ */
+#if (!defined(CONFIG_ZEPHYR) && defined(CONFIG_HOST_ESPI_VW_POWER_SIGNAL) && \
+ !defined(CONFIG_HOSTCMD_ESPI))
#error Must enable eSPI to enable virtual wires.
#endif
diff --git a/power/common.c b/power/common.c
index 8806c9a3b6..054206519f 100644
--- a/power/common.c
+++ b/power/common.c
@@ -92,7 +92,7 @@ DECLARE_HOST_COMMAND(EC_CMD_REBOOT_AP_ON_G3,
__overridable int power_signal_get_level(enum gpio_signal signal)
{
- if (IS_ENABLED(CONFIG_HOSTCMD_ESPI)) {
+ if (IS_ENABLED(CONFIG_HOST_ESPI_VW_POWER_SIGNAL)) {
/* Check signal is from GPIOs or VWs */
if (espi_signal_is_vw(signal))
return espi_vw_get_wire(signal);
@@ -102,7 +102,7 @@ __overridable int power_signal_get_level(enum gpio_signal signal)
int power_signal_disable_interrupt(enum gpio_signal signal)
{
- if (IS_ENABLED(CONFIG_HOSTCMD_ESPI)) {
+ if (IS_ENABLED(CONFIG_HOST_ESPI_VW_POWER_SIGNAL)) {
/* Check signal is from GPIOs or VWs */
if (espi_signal_is_vw(signal))
return espi_vw_disable_wire_int(signal);
@@ -112,7 +112,7 @@ int power_signal_disable_interrupt(enum gpio_signal signal)
int power_signal_enable_interrupt(enum gpio_signal signal)
{
- if (IS_ENABLED(CONFIG_HOSTCMD_ESPI)) {
+ if (IS_ENABLED(CONFIG_HOST_ESPI_VW_POWER_SIGNAL)) {
/* Check signal is from GPIOs or VWs */
if (espi_signal_is_vw(signal))
return espi_vw_enable_wire_int(signal);