From bfcb42ac8dbf9beb2f6634751ff6b71dcdd21691 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Tue, 14 Mar 2023 12:38:41 +0100 Subject: u-boot-distro-boot: introduce KERNEL_DTB_PREFIX for i.MX8 machines Not like ARM machines, which the devicetrees locate at arch/arm/boot/dts in kernel source and the devicetree names directly built into fitImage by bitbake. For i.MX8 machines instead, the devicetrees locate at a vendor specific subdirectory, take NXP as a example, they are under arch/arm64/boot/dts/freescale, so bitbake builds them into fitImage also with a "freescale_" prefix to the real devicetree name. We should distinguish these two situations in boot.scr, let's introduce a variable KERNEL_DTB_PREFIX to achieve that, and set it to "freescale_" for i.MX8 machines. Signed-off-by: Ming Liu (cherry picked from commit f22922827754e40a0cbdbd929826b13e68e0a6c7) --- recipes-bsp/u-boot/u-boot-distro-boot.bb | 6 +++++- recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'recipes-bsp') diff --git a/recipes-bsp/u-boot/u-boot-distro-boot.bb b/recipes-bsp/u-boot/u-boot-distro-boot.bb index 7830e8e..61bfa03 100644 --- a/recipes-bsp/u-boot/u-boot-distro-boot.bb +++ b/recipes-bsp/u-boot/u-boot-distro-boot.bb @@ -12,10 +12,14 @@ SRC_URI = " \ KERNEL_BOOTCMD ??= "bootz" KERNEL_BOOTCMD:aarch64 ?= "booti" +KERNEL_DTB_PREFIX ??= "" +KERNEL_DTB_PREFIX:mx8-generic-bsp ?= "freescale_" +KERNEL_DTB_PREFIX:k3 ?= "ti_" + inherit deploy do_deploy() { - sed -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/;s/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/' \ + sed -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/;s/@@KERNEL_IMAGETYPE@@/${KERNEL_IMAGETYPE}/;s/@@KERNEL_DTB_PREFIX@@/${KERNEL_DTB_PREFIX}/' \ "${WORKDIR}/boot.cmd.in" > boot.cmd mkimage -T script -C none -n "Distro boot script" -d boot.cmd boot.scr diff --git a/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in b/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in index 8d23984..4b84bdd 100644 --- a/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in +++ b/recipes-bsp/u-boot/u-boot-distro-boot/boot.cmd.in @@ -102,7 +102,7 @@ then env set fdt_resize true env set set_bootcmd_dtb 'env set bootcmd_dtb "true"' env set set_apply_overlays 'env set apply_overlays "for overlay_file in \"\\${fdt_overlays}\"; do env set fitconf_fdt_overlays \"\\"\\${fitconf_fdt_overlays}#conf-\\${overlay_file}\\"\"; env set overlay_file; done; true"' - env set bootcmd_boot 'echo "Bootargs: \${bootargs}" && bootm ${ramdisk_addr_r}#conf-\${fdtfile}\${fitconf_fdt_overlays}' + env set bootcmd_boot 'echo "Bootargs: \${bootargs}" && bootm ${ramdisk_addr_r}#conf-@@KERNEL_DTB_PREFIX@@\${fdtfile}\${fitconf_fdt_overlays}' else env set fdt_resize 'fdt addr ${fdt_addr_r} && fdt resize 0x20000' env set set_bootcmd_dtb 'env set bootcmd_dtb "echo Loading DeviceTree: \\${fdtfile}; ${load_cmd} \\${fdt_addr_r} \\${fdtfile}"' -- cgit v1.2.3