diff options
-rw-r--r-- | board/cr50/board.c | 2 | ||||
-rw-r--r-- | common/ec_comm.c | 2 | ||||
-rw-r--r-- | common/ec_efs.c | 2 | ||||
-rw-r--r-- | include/hooks.h | 12 |
4 files changed, 15 insertions, 3 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index f1d4d2a743..8aa6dde87d 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -857,7 +857,7 @@ static void board_init(void) * HOOK_INIT, not at +1.0 seconds. */ } -DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_INIT_CR50_BOARD); /** * Hook for CCD config loaded/changed. diff --git a/common/ec_comm.c b/common/ec_comm.c index 169e65eb55..eaf26b4509 100644 --- a/common/ec_comm.c +++ b/common/ec_comm.c @@ -76,7 +76,7 @@ static void ec_comm_init_(void) if (gpio_get_level(GPIO_EC_PACKET_MODE_EN)) ec_comm_packet_mode_en(GPIO_EC_PACKET_MODE_EN); } -DECLARE_HOOK(HOOK_INIT, ec_comm_init_, HOOK_PRIO_DEFAULT + 1); +DECLARE_HOOK(HOOK_INIT, ec_comm_init_, HOOK_PRIO_INIT_EC_CR50_COMM); /* * Process the received packet. diff --git a/common/ec_efs.c b/common/ec_efs.c index 9952e0bc1c..207056dce0 100644 --- a/common/ec_efs.c +++ b/common/ec_efs.c @@ -116,7 +116,7 @@ static void ec_efs_init_(void) ec_efs_refresh(); } -DECLARE_HOOK(HOOK_INIT, ec_efs_init_, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_INIT, ec_efs_init_, HOOK_PRIO_INIT_EC_EFS); /** * TPM vendor command handler to respond with EC Boot Mode. diff --git a/include/hooks.h b/include/hooks.h index e30c420fbb..f349d906cb 100644 --- a/include/hooks.h +++ b/include/hooks.h @@ -51,6 +51,18 @@ enum hook_priority { HOOK_PRIO_INIT_ADC = HOOK_PRIO_DEFAULT, + /* + * Priorities for CR50 modules. + * HOOK_PRIO_INIT_CR50_BOARD is for board_init() in board/cr50/board.c + * which calls nvmem_init(). + * ec_efs_init() should not be called prior to board_init(). + * ec_comm_init() should not be called prior to ec_efs_init(). + */ + HOOK_PRIO_INIT_CR50_BOARD = HOOK_PRIO_DEFAULT, + HOOK_PRIO_INIT_EC_EFS = HOOK_PRIO_INIT_CR50_BOARD + 1, + HOOK_PRIO_INIT_EC_CR50_COMM = HOOK_PRIO_INIT_EC_EFS + 1, + + /* Specific values to lump temperature-related hooks together */ HOOK_PRIO_TEMP_SENSOR = 6000, /* After all sensors have been polled */ |