aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-03-04 08:43:04 -0700
committerTom Rini <trini@konsulko.com>2022-03-10 08:28:36 -0500
commit42fdcebf859f93139d58defd5abef44dedb9b17a (patch)
tree51cb886505b82fa87bd38ef898fcb153e0c2cd49 /common
parent5b896ed5856f768cdd55cdeb44c5f8f6b6a7a18a (diff)
downloadu-boot-42fdcebf859f93139d58defd5abef44dedb9b17a.zip
u-boot-42fdcebf859f93139d58defd5abef44dedb9b17a.tar.gz
u-boot-42fdcebf859f93139d58defd5abef44dedb9b17a.tar.bz2
event: Convert misc_init_f() to use events
This hook can be implmented using events, for the three boards that actually use it. Add the event type and event handlers. Drop CONFIG_MISC_INIT_F since we can just use CONFIG_EVENT to control this. Since sandbox always enables CONFIG_EVENT, we can drop the defconfig lines there too. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/Kconfig6
-rw-r--r--common/board_f.c7
-rw-r--r--common/event.c3
3 files changed, 8 insertions, 8 deletions
diff --git a/common/Kconfig b/common/Kconfig
index cabc24f..24c83f0 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -589,12 +589,6 @@ config LAST_STAGE_INIT
U-Boot calls last_stage_init() before the command-line interpreter is
started.
-config MISC_INIT_F
- bool "Execute pre-relocation misc init"
- help
- Enabling this option calls the 'misc_init_f' function in the init
- sequence just before DRAM is inited.
-
config MISC_INIT_R
bool "Execute Misc Init"
default y if ARCH_KEYSTONE || ARCH_SUNXI || MPC85xx
diff --git a/common/board_f.c b/common/board_f.c
index e36bdbc..0ef34c7 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -818,6 +818,11 @@ __weak int clear_bss(void)
return 0;
}
+static int misc_init_f(void)
+{
+ return event_notify_null(EVT_MISC_INIT_F);
+}
+
static const init_fnc_t init_sequence_f[] = {
setup_mon_len,
#ifdef CONFIG_OF_CONTROL
@@ -877,9 +882,7 @@ static const init_fnc_t init_sequence_f[] = {
show_board_info,
#endif
INIT_FUNC_WATCHDOG_INIT
-#if defined(CONFIG_MISC_INIT_F)
misc_init_f,
-#endif
INIT_FUNC_WATCHDOG_RESET
#if CONFIG_IS_ENABLED(SYS_I2C_LEGACY)
init_func_i2c,
diff --git a/common/event.c b/common/event.c
index 737d3ac..4270809 100644
--- a/common/event.c
+++ b/common/event.c
@@ -30,6 +30,9 @@ const char *const type_name[] = {
"dm_post_probe",
"dm_pre_remove",
"dm_post_remove",
+
+ /* init hooks */
+ "misc_init_f",
};
_Static_assert(ARRAY_SIZE(type_name) == EVT_COUNT, "event type_name size");