summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-03-26 10:44:55 -0700
committerCommit Bot <commit-bot@chromium.org>2020-03-26 21:38:15 +0000
commit9d4661b418c5d5856c86333109ab742b9695140a (patch)
treef6f8375576bb37904c76afaa7fa6e7fb9ae4abdb
parentd63416a81bb8a978cd57e8b52275af907f4e1527 (diff)
downloadchrome-ec-9d4661b418c5d5856c86333109ab742b9695140a.tar.gz
x86: Make board_has_[before|after]_rsmrst overridable
There aren't many users of the CONFIG_* options CONFIG_BOARD_HAS_AFTER_RSMRST or CONFIG_BOARD_HAS_BEFORE_RSMRST, therefore this commit removes those CONFIG_* options and adds an empty default implementation that can be overridden by boards. BUG=b:151680590 BRANCH=None TEST=`make -j buildall` Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I3322e5ce07de19e729ca44a736b283641029c3ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2122628 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--baseboard/dedede/baseboard.c2
-rw-r--r--include/board_config.h12
-rw-r--r--include/config.h13
-rw-r--r--power/intel_x86.c12
4 files changed, 15 insertions, 24 deletions
diff --git a/baseboard/dedede/baseboard.c b/baseboard/dedede/baseboard.c
index 26e2a81b1b..00e0c297b7 100644
--- a/baseboard/dedede/baseboard.c
+++ b/baseboard/dedede/baseboard.c
@@ -22,7 +22,7 @@
const enum gpio_signal hibernate_wake_pins[] = {};
const int hibernate_wake_pins_used;
-void board_after_rsmrst(int rsmrst)
+__override void board_after_rsmrst(int rsmrst)
{
/*
* b:148688874: If RSMRST# is de-asserted, enable the pull-up on
diff --git a/include/board_config.h b/include/board_config.h
index 6682d8f9f4..5b21be8236 100644
--- a/include/board_config.h
+++ b/include/board_config.h
@@ -34,7 +34,6 @@ 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
*
@@ -46,19 +45,20 @@ void board_config_post_gpio_init(void);
* 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.
+ *
+ * The default implementation does nothing.
*/
-void board_before_rsmrst(int rsmrst);
-#endif
+__override_proto void board_before_rsmrst(int rsmrst);
-#ifdef CONFIG_BOARD_HAS_AFTER_RSMRST
/**
* Configure board after RSMRST# state change
*
* Similar to board_before_rsmrst, except this is called after passing RSMRST#
* to the AP.
+ *
+ * The default implementation does nothing.
*/
-void board_after_rsmrst(int rsmrst);
-#endif
+__override_proto void board_after_rsmrst(int rsmrst);
/**
* Configure chip early in main(), just after board_config_pre_init().
diff --git a/include/config.h b/include/config.h
index 3729ce0f76..dc137bac87 100644
--- a/include/config.h
+++ b/include/config.h
@@ -635,19 +635,6 @@
#undef CONFIG_BOARD_HAS_RTC_RESET
/*
- * Call board_after_rsmrst(state) after passing RSMRST# to the AP. This is for
- * board workarounds that are required just after RSMRST is passed to the AP.
- */
-#undef CONFIG_BOARD_HAS_AFTER_RSMRST
-
-/*
- * 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/intel_x86.c b/power/intel_x86.c
index 89bc477640..290b16c885 100644
--- a/power/intel_x86.c
+++ b/power/intel_x86.c
@@ -595,6 +595,14 @@ void intel_x86_rsmrst_signal_interrupt(enum gpio_signal signal)
power_signal_interrupt(signal);
}
+__overridable void board_before_rsmrst(int rsmrst)
+{
+}
+
+__overridable void board_after_rsmrst(int rsmrst)
+{
+}
+
void common_intel_x86_handle_rsmrst(enum power_state state)
{
/*
@@ -608,9 +616,7 @@ void common_intel_x86_handle_rsmrst(enum power_state state)
if (rsmrst_in == rsmrst_out)
return;
-#ifdef CONFIG_BOARD_HAS_BEFORE_RSMRST
board_before_rsmrst(rsmrst_in);
-#endif
#ifdef CONFIG_CHIPSET_APL_GLK
/* Only passthrough RSMRST_L de-assertion on power up */
@@ -629,9 +635,7 @@ void common_intel_x86_handle_rsmrst(enum power_state state)
CPRINTS("Pass through GPIO_RSMRST_L_PGOOD: %d", rsmrst_in);
-#ifdef CONFIG_BOARD_HAS_AFTER_RSMRST
board_after_rsmrst(rsmrst_in);
-#endif
}
#ifdef CONFIG_POWER_TRACK_HOST_SLEEP_STATE