From e77f8ca209d81d64b5d33af64481eccc241ad13d Mon Sep 17 00:00:00 2001 From: Quentin Schulz Date: Thu, 19 Dec 2024 16:25:17 +0100 Subject: [PATCH] uboot-extlinux-config.bbclass: add support for DTBOs Also known as FDTO, DTO or Device Tree Overlay. This adds a new property per label in extlinux.conf for which device tree overlays to apply on top of the base device tree (the one specified in FDT or guessed by the bootloader if only FDTDIR is set). It is a space-separated list of paths to the .dtbo file(s). Note that the base FDT needs to have symbols enabled (DTC_FLAGS needs to have -@ in it) for an overlay to be applicable. This is only applicable for non-FIT setups. (From OE-Core rev: 3ac21b32b5f5616cc7c0641fb3132eec9b27e5b7) Signed-off-by: Quentin Schulz Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- meta/classes-recipe/uboot-extlinux-config.bbclass | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/meta/classes-recipe/uboot-extlinux-config.bbclass b/meta/classes-recipe/uboot-extlinux-config.bbclass index a6938ab063..2fa83b2c8b 100644 --- a/meta/classes-recipe/uboot-extlinux-config.bbclass +++ b/meta/classes-recipe/uboot-extlinux-config.bbclass @@ -15,6 +15,7 @@ # UBOOT_EXTLINUX_KERNEL_IMAGE - Kernel image name. # UBOOT_EXTLINUX_FDTDIR - Device tree directory. # UBOOT_EXTLINUX_FDT - Device tree file. +# UBOOT_EXTLINUX_FDTOVERLAYS - Device tree overlay files. Space-separated list. # UBOOT_EXTLINUX_INITRD - Indicates a list of filesystem images to # concatenate and use as an initrd (optional). # UBOOT_EXTLINUX_MENU_DESCRIPTION - Name to use as description. @@ -66,6 +67,7 @@ UBOOT_EXTLINUX_CONSOLE ??= "console=${console},${baudrate}" UBOOT_EXTLINUX_LABELS ??= "linux" UBOOT_EXTLINUX_FDT ??= "" +UBOOT_EXTLINUX_FDTOVERLAYS ??= "" UBOOT_EXTLINUX_FDTDIR ??= "../" UBOOT_EXTLINUX_KERNEL_IMAGE ??= "../${KERNEL_IMAGETYPE}" UBOOT_EXTLINUX_KERNEL_ARGS ??= "rootwait rw" @@ -136,6 +138,7 @@ python do_create_extlinux_config() { fdtdir = localdata.getVar('UBOOT_EXTLINUX_FDTDIR') fdt = localdata.getVar('UBOOT_EXTLINUX_FDT') + fdtoverlays = localdata.getVar('UBOOT_EXTLINUX_FDTOVERLAYS') cfgfile.write('LABEL %s\n\tKERNEL %s\n' % (menu_description, kernel_image)) @@ -144,6 +147,9 @@ python do_create_extlinux_config() { elif fdtdir: cfgfile.write('\tFDTDIR %s\n' % (fdtdir)) + if fdtoverlays: + cfgfile.write('\tFDTOVERLAYS %s\n' % (' '.join(fdtoverlays.split()))) + kernel_args = localdata.getVar('UBOOT_EXTLINUX_KERNEL_ARGS') initrd = localdata.getVar('UBOOT_EXTLINUX_INITRD')