diff options
author | Keith Short <keithshort@chromium.org> | 2021-04-16 10:18:44 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-29 18:33:42 +0000 |
commit | 0a4905af4b7eda51f17633c8a54a4d4d17860453 (patch) | |
tree | 000e9689e4ed159b7d9a27047d18e2adf76a0827 | |
parent | d9d1b8599e893b75a9f99d9c9f9979d8f7e0d036 (diff) | |
download | chrome-ec-0a4905af4b7eda51f17633c8a54a4d4d17860453.tar.gz |
zephyr: add sleepmask command
Add KConfig options to enable the "sleepmask" console command.
BUG=b:186307921
BRANCH=none
TEST=zmake testall
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I36c01317bc593242e549e154c26caff13000d766
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829983
Reviewed-by: Yuval Peress <peress@chromium.org>
-rw-r--r-- | zephyr/Kconfig | 32 | ||||
-rw-r--r-- | zephyr/shim/include/config_chip.h | 15 |
2 files changed, 47 insertions, 0 deletions
diff --git a/zephyr/Kconfig b/zephyr/Kconfig index a52fbd6e6e..6530089458 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -208,6 +208,30 @@ config PLATFORM_EC_CONSOLE_CMD_MEM md - dump memory values rw - read or write in memory +config PLATFORM_EC_CONSOLE_CMD_SLEEPMASK + bool "Console command: sleepmask read" + default y if PM + help + Enable the 'sleepmask' console command. This command is used to + display the state of the sleep mask, which controls whether the EC + chip is allowed to enter deep sleep states to save power. + +config PLATFORM_EC_CONSOLE_CMD_SLEEPMASK_SET + bool "Console command: sleepmask set" + depends on PLATFORM_EC_CONSOLE_CMD_SLEEPMASK + default y + help + Enable changing the state of the current sleep mask. + + sleepmask on - Sets the SLEEP_MASK_FORCE_NO_DSLEEP bit in the + sleep mask, preventing the system from entering + sleep. + sleepmask off - Clears the SLEEP_MASK_FORCE_NO_DSLEEP bit in the + sleep mask. The system may enter deep sleep + depending on the state of other mask bits. + sleepmask <value> - Sets the sleepmask to <value>, overriding all + bits with the specified value. + config PLATFORM_EC_CONSOLE_CMD_S5_TIMEOUT bool "Console command: s5_timeout" default n @@ -338,6 +362,14 @@ config PLATFORM_EC_LID_SWITCH This requires a GPIO named GPIO_LID_OPEN to be defined in gpio_map.h. +config PLATFORM_EC_LOW_POWER_IDLE + bool + default y if PM + help + Enable low power idle modes in the EC chipset. This is automatically + enabled when the Zephyr power management options are enabled with the + PM option. + config PLATFORM_EC_MKBP_EVENT bool "MKBP event" help diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 7e79ddf4b1..8dece3a623 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -1472,4 +1472,19 @@ #define CONFIG_ACCELGYRO_BMI_COMM_I2C #endif +#undef CONFIG_CMD_SLEEPMASK +#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_SLEEPMASK +#define CONFIG_CMD_SLEEPMASK +#endif + +#undef CONFIG_CMD_SLEEPMASK_SET +#ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_SLEEPMASK_SET +#define CONFIG_CMD_SLEEPMASK_SET +#endif + +#undef CONFIG_LOW_POWER_IDLE +#ifdef CONFIG_PLATFORM_EC_LOW_POWER_IDLE +#define CONFIG_LOW_POWER_IDLE +#endif + #endif /* __CROS_EC_CONFIG_CHIP_H */ |