]> code.ossystems Code Review - meta-freescale.git/commitdiff
u-boot-fslc: deploy dtb files for mx8m machines
authorAndrey Zhizhikin <andrey.z@gmail.com>
Thu, 10 Dec 2020 14:26:54 +0000 (14:26 +0000)
committerOtavio Salvador <otavio@ossystems.com.br>
Fri, 11 Dec 2020 22:37:54 +0000 (19:37 -0300)
U-Boot DTB files need to be additionally deployed in order to be picked
up later by imx-boot component to produce boot container.

As the boot container is required to be provided as a boot binary file
for mx8m derivatives, deploy DTB files to a known location within
deployment folder in addition to u-boot binary files.

Signed-off-by: Andrey Zhizhikin <andrey.z@gmail.com>
recipes-bsp/u-boot/u-boot-fslc_2020.10.bb

index 64588efcf5a8c879220c755a67437de755ef4789..522bbbdae8af488850d1e23a385d28dcd5d87cf5 100644 (file)
@@ -8,6 +8,12 @@ version, or because it is not applicable for upstreaming."
 
 DEPENDS_append = " bc-native dtc-native lzop-native"
 
+# Location known to imx-boot component, where U-Boot artifacts
+# should be additionally deployed.
+# See below note above do_deploy_append_mx8m for the purpose of
+# this delopyment location
+BOOT_TOOLS = "imx-boot-tools"
+
 PROVIDES += "u-boot"
 
 B = "${WORKDIR}/build"
@@ -19,5 +25,39 @@ EXTRA_OEMAKE += 'HOSTCC="${BUILD_CC} ${BUILD_CPPFLAGS}" \
                  HOSTLDFLAGS="${BUILD_LDFLAGS}" \
                  HOSTSTRIP=true'
 
+#
+# imx8m machines require additional deployment tasks to be
+# carried out due to the fact that final boot image is constructed
+# using imx-boot recipe. It produces a boot binary image, which is
+# constructed from various binary components (u-boot with separate
+# dtb, atf, DDR firmware and optional op-tee) into a single image
+# using FIT format. This image is then parsed and loaded either via
+# SPL directly (imx8mm), or using bootrom code (imx8mn and imx8mp).
+#
+# In order for imx-boot to construct the final binary boot image,
+# it is required that the U-Boot dtb files are to be deployed into
+# a location known by imx-boot so they could be picked up and
+# inserted into the boot container.
+do_deploy_append_mx8m() {
+    # Deploy the mkimage, u-boot-nodtb.bin and fsl-imx8m*-XX.dtb for mkimage to generate boot binary
+    if [ -n "${UBOOT_CONFIG}" ]; then
+        for config in ${UBOOT_MACHINE}; do
+            i=$(expr $i + 1);
+            for type in ${UBOOT_CONFIG}; do
+                j=$(expr $j + 1);
+                if [ $j -eq $i ]
+                then
+                    install -d ${DEPLOYDIR}/${BOOT_TOOLS}
+                    install -m 0777 ${B}/${config}/arch/arm/dts/${UBOOT_DTB_NAME}  ${DEPLOYDIR}/${BOOT_TOOLS}
+                    install -m 0777 ${B}/${config}/u-boot-nodtb.bin  ${DEPLOYDIR}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG}
+                fi
+            done
+            unset  j
+        done
+        unset  i
+    fi
+}
+
+
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 COMPATIBLE_MACHINE = "(mxs|mx5|mx6|mx7|vf|use-mainline-bsp)"