]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
event: add new EVT_SETTINGS_R event
authorArtur Rojek <artur@conclusive.pl>
Wed, 18 Oct 2023 14:00:57 +0000 (16:00 +0200)
committerEugen Hristev <eugen.hristev@collabora.com>
Mon, 23 Oct 2023 14:07:06 +0000 (17:07 +0300)
Introduce EVT_SETTINGS_R, triggered post-relocation and before console
init.

This event gives an option to perform any platform-dependent setup,
which needs to take place before show_board_info(). Usage examples
include readout of EEPROM stored settings.

Signed-off-by: Artur Rojek <artur@conclusive.pl>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/board_r.c
common/event.c
include/event.h

index 52786901be5507b3f902c37f3e94d787e014841a..a7967849dc0c601a50a7a5765cca1b700b0c08db 100644 (file)
@@ -693,6 +693,7 @@ static init_fnc_t init_sequence_r[] = {
 #if defined(CONFIG_ID_EEPROM)
        mac_read_from_eeprom,
 #endif
+       INITCALL_EVENT(EVT_SETTINGS_R),
        INIT_FUNC_WATCHDOG_RESET
 #if defined(CONFIG_PCI_INIT_R) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
        /*
index 3080d9ed754d41c6c812e9aad0959bf86ee9b680..dc61b9672f32763d2545efec0f22e87ec8a7178d 100644 (file)
@@ -37,6 +37,7 @@ const char *const type_name[] = {
        /* init hooks */
        "misc_init_f",
        "fsp_init_r",
+       "settings_r",
        "last_stage_init",
 
        /* Fpga load hook */
index c5646b713ad8dda41732dbfa6bd4e5d51535f6f0..a8f046da3c320517b2a4a47f6f5b62d2b24f47cc 100644 (file)
@@ -104,6 +104,15 @@ enum event_t {
         */
        EVT_FSP_INIT_F,
 
+       /**
+        * @EVT_SETTINGS_R:
+        * This event is triggered post-relocation and before console init.
+        * This gives an option to perform any platform-dependent setup, which
+        * needs to take place before show_board_info() (e.g. readout of EEPROM
+        * stored settings).
+        */
+       EVT_SETTINGS_R,
+
        /**
         * @EVT_LAST_STAGE_INIT:
         * This event is triggered just before jumping to the main loop.