Message ID | 20231121-b4-qcom-common-target-v1-1-9492198e0c15@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | Qualcomm generic board support | expand |
On Tue, Nov 21, 2023 at 05:09:24PM +0000, Caleb Connolly wrote: > When booting U-Boot on board with a locked down first-stage bootloader, > we emulate the Linux boot header. By passing the U-Boot FDT through this > first-stage bootloader and retrieving it afterwards we can pre-populate > the memory nodes and other info like the KASLR address. > > Add a function to export the FDT addr so that boards can use it over the > built-in FDT. > > Don't check is_addr_accessible() here because we might not yet have a > valid mem_map if it's going to be populated from the FDT, let the board > do their own validation instead. > > Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/arch/arm/lib/save_prev_bl_data.c b/arch/arm/lib/save_prev_bl_data.c index f7b23faf0d66..b286bac9bf00 100644 --- a/arch/arm/lib/save_prev_bl_data.c +++ b/arch/arm/lib/save_prev_bl_data.c @@ -45,6 +45,11 @@ bool is_addr_accessible(phys_addr_t addr) return false; } +phys_addr_t get_prev_bl_fdt_addr(void) +{ + return reg0; +} + int save_prev_bl_data(void) { struct fdt_header *fdt_blob; diff --git a/include/init.h b/include/init.h index d57a24fd00dd..7a3ab152b65f 100644 --- a/include/init.h +++ b/include/init.h @@ -168,6 +168,17 @@ defined(CONFIG_SAVE_PREV_BL_FDT_ADDR) * Return: 0 if ok; -ENODATA on error */ int save_prev_bl_data(void); + +/** + * get_prev_bl_fdt_addr - When u-boot is chainloaded, get the address + * of the FDT passed by the previous bootloader. + * + * Return: the address of the FDT passed by the previous bootloader + * or 0 if not found. + */ +phys_addr_t get_prev_bl_fdt_addr(void); +#else +#define get_prev_bl_fdt_addr() 0LLU #endif /**
When booting U-Boot on board with a locked down first-stage bootloader, we emulate the Linux boot header. By passing the U-Boot FDT through this first-stage bootloader and retrieving it afterwards we can pre-populate the memory nodes and other info like the KASLR address. Add a function to export the FDT addr so that boards can use it over the built-in FDT. Don't check is_addr_accessible() here because we might not yet have a valid mem_map if it's going to be populated from the FDT, let the board do their own validation instead. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> --- This patch has no dependencies Cc: Simon Glass <sjg@chromium.org> --- arch/arm/lib/save_prev_bl_data.c | 5 +++++ include/init.h | 11 +++++++++++ 2 files changed, 16 insertions(+)