summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/config.h8
-rw-r--r--power/intel_x86.c3
-rw-r--r--zephyr/Kconfig.powerseq11
-rw-r--r--zephyr/shim/include/config_chip.h1
4 files changed, 22 insertions, 1 deletions
diff --git a/include/config.h b/include/config.h
index 17af7d6b5a..9cf522a98a 100644
--- a/include/config.h
+++ b/include/config.h
@@ -6784,4 +6784,12 @@
#define CONFIG_AMD_SB_RMI
#endif
+/*
+ * Default timeout value for which EC has to wait for system to exit from S5
+ * before performing RTC reset and moving the system to G3.
+ */
+#if defined(CONFIG_BOARD_HAS_RTC_RESET) && !defined(CONFIG_S5_EXIT_WAIT)
+#define CONFIG_S5_EXIT_WAIT 4
+#endif
+
#endif /* __CROS_EC_CONFIG_H */
diff --git a/power/intel_x86.c b/power/intel_x86.c
index e020874de6..9f26943dae 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -105,7 +105,8 @@ static enum power_state power_wait_s5_rtc_reset(void)
while ((power_get_signals() & IN_PCH_SLP_S4_DEASSERTED) == 0) {
/* Handle RSMRST passthru event while waiting */
common_intel_x86_handle_rsmrst(POWER_S5);
- if (task_wait_event(SECOND*4) == TASK_EVENT_TIMER) {
+ if (task_wait_event(SECOND * CONFIG_S5_EXIT_WAIT) ==
+ TASK_EVENT_TIMER) {
CPRINTS("timeout waiting for S5 exit");
chipset_force_g3();
diff --git a/zephyr/Kconfig.powerseq b/zephyr/Kconfig.powerseq
index 0fb0df3acb..10459ed8ce 100644
--- a/zephyr/Kconfig.powerseq
+++ b/zephyr/Kconfig.powerseq
@@ -171,6 +171,17 @@ config PLATFORM_EC_POWERSEQ_PP3300_RAIL_FIRST
endif # PLATFORM_EC_POWERSEQ_ICELAKE
+if PLATFORM_EC_POWERSEQ_RTC_RESET
+
+config PLATFORM_EC_S5_EXIT_WAIT
+ int "time(in secs) for EC to wait for system to exit from S5"
+ default 4
+ help
+ Timeout value for which EC has to wait for system to exit from S5
+ before performing RTC reset and moving the system to G3.
+
+endif # PLATFORM_EC_POWERSEQ_RTC_RESET
+
endif # PLATFORM_EC_POWERSEQ_INTEL
config PLATFORM_EC_POWERSEQ_MT8192
diff --git a/zephyr/shim/include/config_chip.h b/zephyr/shim/include/config_chip.h
index a662cf3465..c313a9df15 100644
--- a/zephyr/shim/include/config_chip.h
+++ b/zephyr/shim/include/config_chip.h
@@ -818,6 +818,7 @@ extern struct jump_data mock_jump_data;
#ifdef CONFIG_PLATFORM_EC_POWERSEQ_RTC_RESET
#define CONFIG_BOARD_HAS_RTC_RESET
+#define CONFIG_S5_EXIT_WAIT CONFIG_PLATFORM_EC_S5_EXIT_WAIT
#endif
#ifdef CONFIG_PLATFORM_EC_POWERSEQ_PP5000_CONTROL