diff options
author | Keith Short <keithshort@chromium.org> | 2021-02-04 12:57:48 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-02-04 21:52:18 +0000 |
commit | 0a6a6103ce93c030a578b5305b2da5e4a0da8768 (patch) | |
tree | 92bbb14174cb626df4a4840aec279846f0c586a0 | |
parent | b69237569f85b460807a85a317a6c48aa5a4babd (diff) | |
download | chrome-ec-0a6a6103ce93c030a578b5305b2da5e4a0da8768.tar.gz |
zephyr: add KCconfig for CONFIG_SWITCH
The CONFIG_SWITCH option is needed to report that state of all switches
to the AP.
BUG=none
BRANCH=none
TEST=make buildall
TEST=zmake testall
TEST=EC can boot AP all the way to the kernel (requires disabling
charger tasks first)
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: Ifa6d7de36a2f7a9fefa81d6d555c93057c461187
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676604
Tested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r-- | zephyr/CMakeLists.txt | 3 | ||||
-rw-r--r-- | zephyr/Kconfig | 17 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 5 |
3 files changed, 25 insertions, 0 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index b4a0fe3ba6..e03f0125f3 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -161,6 +161,9 @@ zephyr_sources_ifdef(CONFIG_PLATFORM_EC_POWERSEQ_HOST_SLEEP zephyr_sources_ifdef(CONFIG_PLATFORM_EC_PANIC "${PLATFORM_EC}/common/panic_output.c") zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SHA256_SW "${PLATFORM_EC}/common/sha256.c") +zephyr_sources_ifdef(CONFIG_PLATFORM_EC_SWITCH + "${PLATFORM_EC}/common/switch.c") + zephyr_sources_ifdef(CONFIG_PLATFORM_EC_THROTTLE_AP "${PLATFORM_EC}/common/throttle_ap.c") diff --git a/zephyr/Kconfig b/zephyr/Kconfig index 2fe50eee82..5b8bfc1f56 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -585,6 +585,23 @@ config PLATFORM_EC_CONSOLE_CMD_SHMEM used and the maximum number of bytes that have been used since the EC started running. +config PLATFORM_EC_SWITCH + bool "Memory mapped switches" + depends on PLATFORM_EC_HOSTCMD + default y + help + Enable the reporting of the platform switches state to the AP using + memory mapped storage provided by the host command interface. + + The platform switches include: + LID open + power button pressed + write protect disabled + recovery switch + + This also enables the "mmapinfo" console command to report the current + state of all switches. + config PLATFORM_EC_THROTTLE_AP bool "CPU throttling" default y if PLATFORM_EC_POWERSEQ diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 0ecac6368a..43836088de 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -914,6 +914,11 @@ enum battery_type { #define CONFIG_HOSTCMD_RTC #endif +#undef CONFIG_SWITCH +#ifdef CONFIG_PLATFORM_EC_SWITCH +#define CONFIG_SWITCH +#endif + #undef CONFIG_BOARD_VERSION_CBI #ifdef CONFIG_PLATFORM_EC_BOARD_VERSION_CBI #define CONFIG_BOARD_VERSION_CBI |