summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chip/lm4/lpc.c2
-rw-r--r--chip/lm4/power_button.c3
-rw-r--r--common/x86_power.c2
-rw-r--r--include/hooks.h9
4 files changed, 13 insertions, 3 deletions
diff --git a/chip/lm4/lpc.c b/chip/lm4/lpc.c
index a5a2220fcb..78dbdb6dda 100644
--- a/chip/lm4/lpc.c
+++ b/chip/lm4/lpc.c
@@ -667,7 +667,7 @@ static int lpc_init(void)
* Set prio to higher than default so other inits can initialize their
* memmap data.
*/
-DECLARE_HOOK(HOOK_INIT, lpc_init, HOOK_PRIO_DEFAULT - 1);
+DECLARE_HOOK(HOOK_INIT, lpc_init, HOOK_PRIO_INIT_LPC);
static int lpc_resume(void)
diff --git a/chip/lm4/power_button.c b/chip/lm4/power_button.c
index e209cd4403..9d6185a869 100644
--- a/chip/lm4/power_button.c
+++ b/chip/lm4/power_button.c
@@ -295,7 +295,10 @@ static void set_initial_pwrbtn_state(void)
*/
if (get_power_button_pressed()) {
*memmap_switches |= EC_SWITCH_POWER_BUTTON_PRESSED;
+ CPRINTF("[%T PB init-jumped-held]\n");
set_pwrbtn_to_pch(0);
+ } else {
+ CPRINTF("[%T PB init-jumped]\n");
}
} else if ((reset_flags & RESET_FLAG_AP_OFF) ||
((reset_flags & RESET_FLAG_RESET_PIN) &&
diff --git a/common/x86_power.c b/common/x86_power.c
index cd599692d2..1838643def 100644
--- a/common/x86_power.c
+++ b/common/x86_power.c
@@ -397,7 +397,7 @@ static int x86_power_init(void)
return EC_SUCCESS;
}
-DECLARE_HOOK(HOOK_INIT, x86_power_init, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_INIT, x86_power_init, HOOK_PRIO_INIT_CHIPSET);
/*****************************************************************************/
/* Task function */
diff --git a/include/hooks.h b/include/hooks.h
index b27c52fc66..b8ed296529 100644
--- a/include/hooks.h
+++ b/include/hooks.h
@@ -11,9 +11,16 @@
#include "common.h"
enum hook_priority {
+ /* Generic values across all hooks */
HOOK_PRIO_FIRST = 1, /* Highest priority */
HOOK_PRIO_DEFAULT = 5000, /* Default priority */
- HOOK_PRIO_LAST = 9999 /* Lowest priority */
+ HOOK_PRIO_LAST = 9999, /* Lowest priority */
+
+ /* Specific hook vales for HOOK_INIT */
+ /* LPC inits before modules which need memory-mapped I/O */
+ HOOK_PRIO_INIT_LPC = HOOK_PRIO_FIRST + 1,
+ /* Chipset inits before modules which need to know its initial state. */
+ HOOK_PRIO_INIT_CHIPSET = HOOK_PRIO_FIRST + 2,
};