
On Tue, 26 Dec 2023 at 11:48, Simon Glass sjg@chromium.org wrote:
Hi,
On Fri, Dec 22, 2023 at 9:32 PM Raymond Mao raymond.mao@linaro.org wrote:
Get devicetree from a bloblist if it exists. If not, fallback to get FDT from the specified memory address.
Signed-off-by: Raymond Mao raymond.mao@linaro.org
Changes in v2
- Refactor of board_fdt_blob_setup().
board/emulation/qemu-arm/qemu-arm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
I believe this patch will not be needed, since we have fdtdec_setup() to do this.
Yep, it's not. The board-specific portion should be limited to what happens if the bloblist is *not* detected by fdtdec_setup() (assuming the user wants to allow a fallback)
diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index e225011bf0..d326668caf 100644 --- a/board/emulation/qemu-arm/qemu-arm.c +++ b/board/emulation/qemu-arm/qemu-arm.c @@ -149,9 +149,17 @@ int dram_init_banksize(void)
void *board_fdt_blob_setup(int *err) {
void *fdt = NULL; *err = 0;
/* QEMU loads a generated DTB for us at the start of RAM. */
return (void *)CFG_SYS_SDRAM_BASE;
/* Check if a DTB exists in bloblist */
if (IS_ENABLED(CONFIG_BLOBLIST) && !bloblist_maybe_init())
fdt = bloblist_find(BLOBLISTT_CONTROL_FDT, 0);
if (!fdt)
/* QEMU loads a generated DTB for us at the start of RAM. */
return (void *)CFG_SYS_SDRAM_BASE;
return fdt;
}
int board_bloblist_from_boot_arg(unsigned long addr, unsigned long size)
2.25.1
Regards, Simon