summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2022-05-06 18:03:59 +1000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-05-06 16:15:52 +0000
commit872dfcaf69cf233aff5eebc71ac5ee6a6dbcf8d7 (patch)
tree81d8e627e313a3fc6f3f014b14bd9aa4afdb1e8d
parent25d4c01f9d1b2f891901a9ab1c670dce8d64542d (diff)
downloadchrome-ec-872dfcaf69cf233aff5eebc71ac5ee6a6dbcf8d7.tar.gz
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 <amcrae@google.com> Change-Id: I5eb3ebadbaa9a0d9f433acc7bbf07807f2e3a1c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3631720 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--util/config_allowed.txt1
-rw-r--r--zephyr/Kconfig.ap_power10
-rw-r--r--zephyr/shim/include/config_chip.h7
3 files changed, 17 insertions, 1 deletions
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