summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/board_config.h16
-rw-r--r--include/config.h7
-rw-r--r--power/skylake.c6
3 files changed, 29 insertions, 0 deletions
diff --git a/include/board_config.h b/include/board_config.h
index 0a97b8a181..6742573bc2 100644
--- a/include/board_config.h
+++ b/include/board_config.h
@@ -32,4 +32,20 @@ void board_config_pre_init(void);
void board_config_post_gpio_init(void);
#endif
+#ifdef CONFIG_BOARD_HAS_BEFORE_RSMRST
+/**
+ * Configure board before RSMRST# state change
+ *
+ * This board function allows workarounds to be applied to a board after all
+ * power rails are up but before the AP is out of reset.
+ *
+ * Most workarounds for power sequencing can go in board init hooks, but for
+ * devices where the power sequencing is driven by external PMIC the EC may
+ * not get interrupts in time to handle workarounds. For x86 platforms and
+ * boards which support RSMRST# passthrough this hook will allow the board
+ * to apply workarounds despite the PMIC sequencing.
+ */
+void board_before_rsmrst(int rsmrst);
+#endif
+
#endif /* __CROS_EC_BOARD_CONFIG_H */
diff --git a/include/config.h b/include/config.h
index eb448837de..33d440d31b 100644
--- a/include/config.h
+++ b/include/config.h
@@ -290,6 +290,13 @@
#undef CONFIG_BOARD_HAS_RTC_RESET
/*
+ * Call board_before_rsmrst(state) before passing RSMRST# to the AP.
+ * This is for board workarounds that are required after rails are up
+ * but before the AP is out of reset.
+ */
+#undef CONFIG_BOARD_HAS_BEFORE_RSMRST
+
+/*
* Call board_config_post_gpio_init() after GPIOs are initialized. See
* include/board_config.h for more information.
*/
diff --git a/power/skylake.c b/power/skylake.c
index 5eaf760e2c..7ac5146d93 100644
--- a/power/skylake.c
+++ b/power/skylake.c
@@ -5,6 +5,7 @@
/* Skylake IMVP8 / ROP PMIC chipset power control module for Chrome EC */
+#include "board_config.h"
#include "charge_state.h"
#include "chipset.h"
#include "common.h"
@@ -176,6 +177,11 @@ static void handle_rsmrst(enum power_state state)
/* Nothing to do. */
if (rsmrst_in == rsmrst_out)
return;
+
+#ifdef CONFIG_BOARD_HAS_BEFORE_RSMRST
+ board_before_rsmrst(rsmrst_in);
+#endif
+
/*
* Wait at least 10ms between power signals going high
* and deasserting RSMRST to PCH.