Skip to content
Snippets Groups Projects
Commit 34ac23c2 authored by Jonas Höppner's avatar Jonas Höppner
Browse files

u-boot:mc3: Add support for multiple devicetrees for u-boot and imx-boot

Adding new variable UBOOT_ADDITIONAL_DTB_NAMES to specify more then one
devicetree, use it in the u-boot and the imx-boot recipe to integrate
everything into one fit image.

imx-boot needs a patch, to use the addional devicetrees in the makefile
when writing the fit image.
parent 1d6853b1
No related branches found
No related tags found
1 merge request!290u-boot:mc3: Add support for multiple devicetrees for u-boot and imx-boot
Pipeline #30185 passed with stage
in 7 seconds
......@@ -17,15 +17,12 @@ MACHINEOVERRIDES =. "mx8:mx8m:mx8mp:"
# Setting both is not possible.
UBOOT_CONFIG[sd] = "trizeps8plus_defconfig,sdcard"
# @TODO: Can we move to a proper DTB (like tanaro.dtb)?
UBOOT_DTB_NAME = "kuk-trizeps8plus.dtb"
UBOOT_ADDITIONAL_DTB_NAMES = " seco-mx8mp-mc3.dtb "
# Set imx-mkimage boot target
IMXBOOT_TARGETS = "flash_evk"
IMX_BOOT_SOC_TARGET = "iMX8MP"
# TODO trizeps uses uart 1 but mc3 uart 2
ATF_BOOT_UART_BASE = "0x30860000"
#ATF_BOOT_UART_BASE = "0x30890000"
# The i.MX8MM needs a seek of 32 (used for WIC images only)
IMX_BOOT_SEEK = "32"
......
From 60efc73735fdca8533b7f4ced482df1d5cb9cb3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20H=C3=B6ppner?= <jonas.hoeppner@garz-fricke.com>
Date: Tue, 13 Sep 2022 08:04:05 +0200
Subject: [PATCH] iMX8M: Add additional devicetrees in 'dtbs' to the u-boot.itb
target
With this, it is possible to add multiple dtbs to the fit image.
---
iMX8M/soc.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/iMX8M/soc.mak b/iMX8M/soc.mak
index 60502d8..760eed1 100644
--- a/iMX8M/soc.mak
+++ b/iMX8M/soc.mak
@@ -148,7 +148,7 @@ u-boot.itb: $(dtb)
./$(PAD_IMAGE) $(TEE)
./$(PAD_IMAGE) bl31.bin
./$(PAD_IMAGE) u-boot-nodtb.bin $(dtb)
- BL32=$(TEE) DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb) > u-boot.its
+ BL32=$(TEE) DEK_BLOB_LOAD_ADDR=$(DEK_BLOB_LOAD_ADDR) TEE_LOAD_ADDR=$(TEE_LOAD_ADDR) ATF_LOAD_ADDR=$(ATF_LOAD_ADDR) ./mkimage_fit_atf.sh $(dtb) $(dtbs) > u-boot.its
mkimage -E -p 0x3000 -f u-boot.its u-boot.itb
@rm -f u-boot.its $(dtb)
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "file://0001-iMX8M-Add-additional-devicetrees-in-dtbs-to-the-u-bo.patch"
do_compile:prepend() {
for dtb in ${UBOOT_ADDITIONAL_DTB_NAMES};do
cp -v ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${dtb} ${BOOT_STAGING}
done
}
do_compile:append() {
# Integrate fw_env.config and u-boot-initial-env
......@@ -34,3 +42,27 @@ do_deploy:append() {
cd -
done
}
# Copy of the original compile function, as UBOOT_ADDITIONAL_DTB_NAMES had to
# be added to the make call
do_compile() {
# mkimage for i.MX8
# Copy TEE binary to SoC target folder to mkimage
if ${DEPLOY_OPTEE}; then
cp ${DEPLOY_DIR_IMAGE}/tee.bin ${BOOT_STAGING}
fi
for target in ${IMXBOOT_TARGETS}; do
compile_${SOC_FAMILY}
if [ "$target" = "flash_linux_m4_no_v2x" ]; then
# Special target build for i.MX 8DXL with V2X off
bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} V2X=NO ${target}"
make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} V2X=NO dtbs=${UBOOT_DTB_NAME} flash_linux_m4
else
bbnote "building ${IMX_BOOT_SOC_TARGET} - ${REV_OPTION} ${target}"
make SOC=${IMX_BOOT_SOC_TARGET} ${REV_OPTION} dtbs="${UBOOT_DTB_NAME} ${UBOOT_ADDITIONAL_DTB_NAMES}" ${target}
fi
if [ -e "${BOOT_STAGING}/flash.bin" ]; then
cp ${BOOT_STAGING}/flash.bin ${S}/${BOOT_CONFIG_MACHINE}-${target}
fi
done
}
......@@ -126,6 +126,10 @@ do_deploy:append () {
ln -sf fw_env-${MACHINE}-${type}-${PV}-${PR}.config fw_env-${MACHINE}-${type}.config
ln -sf fw_env-${MACHINE}-${type}-${PV}-${PR}.config fw_env-${type}.config
fi
# Deploy additional devicetrees, if more then one should integrated into the image
for dtb in ${UBOOT_ADDITIONAL_DTB_NAMES};do
install -m 0777 ${B}/${config}/arch/arm/dts/${dtb} ${DEPLOYDIR}/${BOOT_TOOLS}
done
fi
done
unset j
......@@ -144,6 +148,10 @@ do_deploy:append () {
ln -sf fw_env-${MACHINE}-${PV}-${PR}.config fw_env-${MACHINE}.config
ln -sf fw_env-${MACHINE}-${PV}-${PR}.config fw_env.config
fi
# Deploy additional devicetrees, if more then one should integrated into the image
for dtb in ${UBOOT_ADDITIONAL_DTB_NAMES};do
install -m 0777 ${B}/${config}/arch/arm/dts/${dtb} ${DEPLOYDIR}/${BOOT_TOOLS}
done
fi
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment