diff options
author | Duncan Laurie <dlaurie@chromium.org> | 2015-12-01 18:32:36 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-01-25 21:46:48 -0800 |
commit | 97713dba84a45d78445c9e50f28054c6d7ee5011 (patch) | |
tree | 04ab4d6b482f1444a1bf9b5e23903b170386c75c /chip/mec1322 | |
parent | 8c9210b81e83c94d9d34497d202476c4fa6fb34b (diff) | |
download | chrome-ec-97713dba84a45d78445c9e50f28054c6d7ee5011.tar.gz |
ec: Add a chipset reset hook
There are hooks for chipset power sequencing but not one to indicate
that the system has reset at runtime. Add a hook for this and
implement for lm4 and mec1322. The hook is notified on any platform
reset, including those that happen on the way into S3/S5 state.
There is a new config variable added because the hook is notified in
the interrupt handler and needs a deferrable function that needs to
be added to every board.
BUG=chrome-os-partner:46049
BRANCH=none
TEST=tested on glados and samus
Change-Id: I3be639414e18586344e0ec84632a50dfc1df586b
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/315221
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip/mec1322')
-rw-r--r-- | chip/mec1322/lpc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chip/mec1322/lpc.c b/chip/mec1322/lpc.c index 32d04036de..fe082d51ea 100644 --- a/chip/mec1322/lpc.c +++ b/chip/mec1322/lpc.c @@ -327,6 +327,14 @@ static void lpc_init(void) */ DECLARE_HOOK(HOOK_INIT, lpc_init, HOOK_PRIO_INIT_LPC); +#ifdef CONFIG_CHIPSET_RESET_HOOK +static void lpc_chipset_reset(void) +{ + hook_notify(HOOK_CHIPSET_RESET); +} +DECLARE_DEFERRED(lpc_chipset_reset); +#endif + void girq19_interrupt(void) { /* Check interrupt result for LRESET# trigger */ @@ -337,6 +345,11 @@ void girq19_interrupt(void) } else { /* Store port 80 reset event */ port_80_write(PORT_80_EVENT_RESET); + +#ifdef CONFIG_CHIPSET_RESET_HOOK + /* Notify HOOK_CHIPSET_RESET */ + hook_call_deferred(lpc_chipset_reset, MSEC); +#endif } CPRINTS("LPC RESET# %sasserted", |