From 3c10dc95bdd0706ff85ffdc25ecd6381c3d51e4c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Dec 2019 21:41:34 -0700 Subject: binman: Add a library to access binman entries SPL and TPL can access information about binman entries using link-time symbols but this is not available in U-Boot proper. Of course it could be made available, but the intention is to just read the device tree. Add support for this, so that U-Boot can locate entries. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/board_r.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common/board_r.c') diff --git a/common/board_r.c b/common/board_r.c index 5464172259..9902c51c5e 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -18,6 +18,7 @@ #if defined(CONFIG_CMD_BEDBUG) #include #endif +#include #include #include #include @@ -347,6 +348,14 @@ static int initr_manual_reloc_cmdtable(void) } #endif +static int initr_binman(void) +{ + if (!CONFIG_IS_ENABLED(BINMAN_FDT)) + return 0; + + return binman_init(); +} + #if defined(CONFIG_MTD_NOR_FLASH) static int initr_flash(void) { @@ -697,6 +706,7 @@ static init_fnc_t init_sequence_r[] = { #ifdef CONFIG_EFI_LOADER efi_memory_init, #endif + initr_binman, stdio_init_tables, initr_serial, initr_announce, -- cgit v1.2.3 From dd0edcb2508b9abcf828baede32e6b3da5fc0c8a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Dec 2019 21:41:46 -0700 Subject: board_r: Move early-timer init later At present the early timer init happens as soon as driver model is set up. This makes it impossible to do anything that needs driver model but must run before devices are probed (as needed with Intel's FSP-S, for example). In any case it is not a good idea to tie probing of particular drivers too closely to the DM init. Create a new function to init the timer and put it a bit later in the sequence. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/board_r.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'common/board_r.c') diff --git a/common/board_r.c b/common/board_r.c index 9902c51c5e..9a25f6ec28 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -311,16 +311,24 @@ static int initr_dm(void) bootstage_accum(BOOTSTATE_ID_ACCUM_DM_R); if (ret) return ret; -#ifdef CONFIG_TIMER_EARLY - ret = dm_timer_init(); - if (ret) - return ret; -#endif return 0; } #endif +static int initr_dm_devices(void) +{ + int ret; + + if (IS_ENABLED(CONFIG_TIMER_EARLY)) { + ret = dm_timer_init(); + if (ret) + return ret; + } + + return 0; +} + static int initr_bootstage(void) { bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r"); @@ -707,6 +715,7 @@ static init_fnc_t init_sequence_r[] = { efi_memory_init, #endif initr_binman, + initr_dm_devices, stdio_init_tables, initr_serial, initr_announce, -- cgit v1.2.3 From fe08d39d1b5fa908c89030a02482d7310bd58b35 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Dec 2019 21:42:20 -0700 Subject: x86: fsp: Add a new arch_fsp_init_r() hook With FSP2 we need to run silicon init early after relocation. Add a new hook for this. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- common/board_r.c | 3 +++ include/init.h | 11 +++++++++++ 2 files changed, 14 insertions(+) (limited to 'common/board_r.c') diff --git a/common/board_r.c b/common/board_r.c index 9a25f6ec28..e711de64b5 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -715,6 +715,9 @@ static init_fnc_t init_sequence_r[] = { efi_memory_init, #endif initr_binman, +#ifdef CONFIG_FSP_VERSION2 + arch_fsp_init_r, +#endif initr_dm_devices, stdio_init_tables, initr_serial, diff --git a/include/init.h b/include/init.h index 8b65b2afe4..970a39a6a0 100644 --- a/include/init.h +++ b/include/init.h @@ -67,6 +67,17 @@ int mach_cpu_init(void); */ int arch_fsp_init(void); +/** + * arch_fsp_init() - perform post-relocation firmware support package init + * + * Where U-Boot relies on binary blobs to handle part of the system init, this + * function can be used to set up the blobs. This is used on some Intel + * platforms. + * + * Return: 0 + */ +int arch_fsp_init_r(void); + int dram_init(void); /** -- cgit v1.2.3