From 0fc406ab20e6fa1e92e68a2c51b73fc4d59b057f Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 7 Aug 2024 16:47:34 -0600 Subject: upl: Plumb in universal payload to the init process Read the UPL early in boot so that it is available. For now none of the information is used. Signed-off-by: Simon Glass --- common/board_f.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'common/board_f.c') diff --git a/common/board_f.c b/common/board_f.c index 29e185137ad..d71005d9f83 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -859,6 +860,26 @@ __weak int clear_bss(void) return 0; } +static int initf_upl(void) +{ + struct upl *upl; + int ret; + + if (!IS_ENABLED(CONFIG_UPL_IN) || !(gd->flags & GD_FLG_UPL)) + return 0; + + upl = malloc(sizeof(struct upl)); + if (upl) + ret = upl_read_handoff(upl, oftree_default()); + if (ret) { + printf("UPL handoff: read failure (err=%dE)\n", ret); + return ret; + } + gd_set_upl(upl); + + return 0; +} + static const init_fnc_t init_sequence_f[] = { setup_mon_len, #ifdef CONFIG_OF_CONTROL @@ -868,6 +889,7 @@ static const init_fnc_t init_sequence_f[] = { trace_early_init, #endif initf_malloc, + initf_upl, log_init, initf_bootstage, /* uses its own timer, so does not need DM */ event_init, -- cgit v1.2.3