From 872dfcaf69cf233aff5eebc71ac5ee6a6dbcf8d7 Mon Sep 17 00:00:00 2001 From: Andrew McRae Date: Fri, 6 May 2022 18:03:59 +1000 Subject: zephyr: Add PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT option Add a PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT Kconfig to set CONFIG_POWER_BUTTON_INIT_TIMEOUT so that the powerbtn task startup timeout can be configurable. BUG=b:231675142 TEST=zmake build nereid; flash & run BRANCH=none Signed-off-by: Andrew McRae Change-Id: I5eb3ebadbaa9a0d9f433acc7bbf07807f2e3a1c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631720 Reviewed-by: Denis Brockus --- util/config_allowed.txt | 1 - zephyr/Kconfig.ap_power | 10 ++++++++++ zephyr/shim/include/config_chip.h | 7 +++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/util/config_allowed.txt b/util/config_allowed.txt index d8e6959794..dd86152799 100644 --- a/util/config_allowed.txt +++ b/util/config_allowed.txt @@ -707,7 +707,6 @@ CONFIG_PORT80_PRINT_IN_INT CONFIG_POWER_BUTTON_FLAGS CONFIG_POWER_BUTTON_IGNORE_LID CONFIG_POWER_BUTTON_INIT_IDLE -CONFIG_POWER_BUTTON_INIT_TIMEOUT CONFIG_POWER_BUTTON_X86 CONFIG_POWER_PP5000_CONTROL CONFIG_POWER_S0IX diff --git a/zephyr/Kconfig.ap_power b/zephyr/Kconfig.ap_power index 7937ccf4d4..3db5a1fef8 100644 --- a/zephyr/Kconfig.ap_power +++ b/zephyr/Kconfig.ap_power @@ -16,6 +16,16 @@ menuconfig PLATFORM_EC_BOOT_AP_POWER_REQUIREMENTS if PLATFORM_EC_BOOT_AP_POWER_REQUIREMENTS +config PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT + int "Timeout before power button task gives up starting system" + depends on HAS_TASK_POWERBTN + default 1 + help + Sets the maximum time, in seconds, before the power button + task stops waiting for conditions to be OK to start + the system. If the timeout is reached, the AP is + not started, and the power task's state is set to idle. + config PLATFORM_EC_CHARGER_MIN_BAT_PCT_FOR_POWER_ON int "Minimal battery level to boot AP without AC" depends on PLATFORM_EC_BATTERY diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h index 342d1c9a09..7b99af207d 100644 --- a/zephyr/shim/include/config_chip.h +++ b/zephyr/shim/include/config_chip.h @@ -888,6 +888,13 @@ extern struct jump_data mock_jump_data; #define CONFIG_POWER_BUTTON_TO_PCH_CUSTOM #endif +#undef CONFIG_POWER_BUTTON_INIT_TIMEOUT +#ifdef CONFIG_PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT +#define CONFIG_POWER_BUTTON_INIT_TIMEOUT \ + CONFIG_PLATFORM_EC_POWER_BUTTON_INIT_TIMEOUT +#endif + + #undef CONFIG_POWERSEQ_FAKE_CONTROL #ifdef CONFIG_PLATFORM_EC_POWERSEQ_FAKE_CONTROL #define CONFIG_POWERSEQ_FAKE_CONTROL -- cgit v1.2.1