From 9a77bb3d4aa0135669a1746552b03042bcc3b065 Mon Sep 17 00:00:00 2001 From: Knox Chiou Date: Thu, 30 Mar 2023 19:32:18 +0800 Subject: zephyr: Support PLATFORM_EC_CMD_POWERINDEBUG flag Support PLATFORM_EC_CMD_POWERINDEBUG flag for `powerindebug` on zephyr. BUG=b:272185086 BRANCH=none TEST=zmake build geralt TEST=disable flag and check powerindebug Signed-off-by: Knox Chiou Change-Id: I89af4161b6bcc351e750d2716e0cc594cfe74814 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383291 Tested-by: Knox Chiou Commit-Queue: Knox Chiou Reviewed-by: Zhuohao Lee Reviewed-by: Keith Short Code-Coverage: Knox Chiou --- util/config_allowed.txt | 1 - zephyr/Kconfig | 8 ++++++++ zephyr/shim/include/config_chip.h | 5 +++++ zephyr/test/drivers/default/prj.conf | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/util/config_allowed.txt b/util/config_allowed.txt index af4f40e232..130e6e9421 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -269,7 +269,6 @@ CONFIG_CMD_PD_SRCCAPS_REDUCED_SIZE CONFIG_CMD_PD_TIMER CONFIG_CMD_PECI CONFIG_CMD_PLL -CONFIG_CMD_POWERINDEBUG CONFIG_CMD_POWERLED CONFIG_CMD_POWER_AP CONFIG_CMD_PPC_DUMP diff --git a/zephyr/Kconfig b/zephyr/Kconfig index abb4a11c92..2f018a92c7 100644 --- a/zephyr/Kconfig +++ b/zephyr/Kconfig @@ -223,6 +223,14 @@ config PLATFORM_EC_CMD_GPIO_EXTENDED NOTE: This flag should be removed on a shipping device. +config PLATFORM_EC_CMD_POWERINDEBUG + bool "Console command: powerindebug" + default y + help + Enable the `powerindebug` console command. This command is used to + get and set power signal. This flag should be disabled on a shipping + device. + config PLATFORM_EC_CONSOLE_CMD_HCDEBUG bool "Console command: hcdebug" default y diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 5375b0aa81..e044b8dc66 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -2032,6 +2032,11 @@ extern char mock_jump_data[CONFIG_PLATFORM_EC_PRESERVED_END_OF_RAM_SIZE]; #define CONFIG_CMD_HCDEBUG #endif +#undef CONFIG_CMD_POWERINDEBUG +#ifdef CONFIG_PLATFORM_EC_CMD_POWERINDEBUG +#define CONFIG_CMD_POWERINDEBUG +#endif + #undef CONFIG_CMD_USB_PD_PE #ifdef CONFIG_PLATFORM_EC_CONSOLE_CMD_USB_PD_PE #define CONFIG_CMD_USB_PD_PE diff --git a/zephyr/test/drivers/default/prj.conf b/zephyr/test/drivers/default/prj.conf index fbc7c4336b..d125545fdb 100644 --- a/zephyr/test/drivers/default/prj.conf +++ b/zephyr/test/drivers/default/prj.conf @@ -3,6 +3,7 @@ # found in the LICENSE file. CONFIG_PLATFORM_EC_CMD_BUTTON=y +CONFIG_PLATFORM_EC_CMD_POWERINDEBUG=y CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC=y CONFIG_PLATFORM_EC_CONSOLE_CMD_RTC_ALARM=y CONFIG_PLATFORM_EC_RTC=y -- cgit v1.2.1