[PATCH] arm: init: add an option to use FDT from previous bootloader

Caleb Connolly caleb.connolly at linaro.org
Tue Oct 24 21:52:22 CEST 2023



On 24/10/2023 20:25, Tom Rini wrote:
> On Tue, Oct 24, 2023 at 12:32:35PM +0100, Caleb Connolly wrote:
> 
>> Add a new config option to allow u-boot to reuse the FDT provided by the
>> previous stage bootloader when available.
>>
>> On some boards the previous stage bootloader can populate
>> platform-specific parts of the devicetree such as the memory node, this
>> allows us to avoid hardcoding it in u-boot and instead determine it
>> dynamically at runtime.
>>
>> Signed-off-by: Caleb Connolly <caleb.connolly at linaro.org>
>> ---
>> This patch will improve generic support for Qualcomm boards by enabling
>> us to configure the memory map at runtime rather than having hardcoded
>> maps on a per-device basis. I've gone for this approach initially to try
>> and avoid introducing board specific code where possible, but I'm happy
>> to rework this into mach-snapdragon if that's preferred.
>> ---
>> base-commit: e65b5d35c9116485366bb08138043d51220551da
>>
>> // Caleb (they/them)
>> ---
>>  arch/arm/lib/save_prev_bl_data.c |  7 +++++++
>>  boot/Kconfig                     | 10 ++++++++++
>>  include/init.h                   |  9 +++++++++
>>  lib/fdtdec.c                     |  7 ++++++-
> 
> So what is different with this instead of using save_boot_params ? I'm
> not saying this isn't needed, but I don't immediately see why
> save_boot_params + (OF_HAS_PRIOR_STAGE=y&&OF_BOARD=y) isn't the solution
> to the problem.

OF_BOARD would work here by implementing board_fdt_blob_setup() for
mach-snapdragon, my hope was to avoid doing this in a board-specific
way, but if that's preferred then I can totally do that instead.

I left a comment below the patch about this, although it probably wasn't
super clear.

Thanks,
> 

-- 
// Caleb (they/them)


More information about the U-Boot mailing list