imx-boot: add support to ConnectCore 8M Nano platform
https://jira.digi.com/browse/DEL-6911 Signed-off-by: Arturo Buzarra <arturo.buzarra@digi.com>
This commit is contained in:
parent
9da5aac063
commit
712fa3f96a
|
|
@ -10,10 +10,10 @@ inherit fsl-eula-unpack pkgconfig deploy
|
|||
PV = "2.0+git${SRCPV}"
|
||||
|
||||
ATF_SRC ?= "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https"
|
||||
SRCBRANCH = "imx_4.14.98_2.1.0"
|
||||
SRCBRANCH = "imx_4.14.98_2.2.0"
|
||||
|
||||
SRC_URI = "${ATF_SRC};branch=${SRCBRANCH}"
|
||||
SRCREV = "727cf896a4c79d152dae4537e28400c747bf39b9"
|
||||
SRCREV = "1355c5d12d75c9c7bdd08826796096bab519b3d5"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
inherit boot-artifacts
|
||||
|
||||
# Use the v4.14 latest BSP branch
|
||||
SRCBRANCH = "imx_4.14.98_2.1.0"
|
||||
SRCREV = "abd6ce551a7b81fc6953d32d92b24a4a1d4b214e"
|
||||
SRCBRANCH = "imx_4.14.98_2.2.0"
|
||||
SRCREV = "c00cd78d2e80178171d2d7f8d0d1ce6e2ea41ac5"
|
||||
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
||||
SRC_URI_append_ccimx8x = " file://0001-iMX8QX-remove-SC_BD_FLAGS_ALT_CONFIG-flag-in-flash_r.patch"
|
||||
|
|
@ -16,7 +16,9 @@ DEPENDS_append_ccimx8x = " coreutils-native"
|
|||
# output. Note that this aggregation replaces the aggregation
|
||||
# that would otherwise be done in the image build as controlled
|
||||
# by IMAGE_BOOTFILES_DEPENDS and IMAGE_BOOTFILES in image_types_fsl.bbclass
|
||||
IMX_M4_DEMOS = "imx-m4-demos"
|
||||
IMX_M4_DEMOS = ""
|
||||
IMX_M4_DEMOS_mx8qm = "imx-m4-demos"
|
||||
IMX_M4_DEMOS_mx8qxp = "imx-m4-demos"
|
||||
|
||||
# This package aggregates output deployed by other packages,
|
||||
# so set the appropriate dependencies
|
||||
|
|
@ -35,11 +37,19 @@ do_populate_lic[depends] += " \
|
|||
firmware-imx:do_populate_lic \
|
||||
"
|
||||
ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin"
|
||||
ATF_MACHINE_NAME_mx8mn = "bl31-imx8mn.bin"
|
||||
|
||||
# 8MQ/8MM/8MN share the same soc folder
|
||||
BOOT_STAGING_mx8mn = "${S}/iMX8M"
|
||||
|
||||
SOC_TARGET_mx8mn = "iMX8MN"
|
||||
|
||||
IMXBOOT_TARGETS_ccimx8x = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
|
||||
'flash flash_regression_linux_m4', d)}"
|
||||
|
||||
do_compile () {
|
||||
IMXBOOT_TARGETS_ccimx8mn = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_evk_flexspi', 'flash_spl_uboot', d)}"
|
||||
|
||||
compile_mx8x() {
|
||||
bbnote 8QX boot binary build
|
||||
cp ${DEPLOY_DIR_IMAGE}/imx8qx_m4_TCM_srtm_demo.bin ${BOOT_STAGING}/m40_tcm.bin
|
||||
cp ${DEPLOY_DIR_IMAGE}/imx8qx_m4_TCM_srtm_demo.bin ${BOOT_STAGING}/m4_image.bin
|
||||
|
|
@ -51,63 +61,103 @@ do_compile () {
|
|||
for ramc in ${RAM_CONFIGS}; do
|
||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME}-${ramc} ${BOOT_STAGING}/
|
||||
done
|
||||
}
|
||||
|
||||
compile_mx8m() {
|
||||
bbnote 8MQ/8MM/8MN boot binary build
|
||||
cp ${DEPLOY_DIR_IMAGE}/signed_*_imx8m.bin ${BOOT_STAGING}
|
||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-spl.bin-${MACHINE}-${UBOOT_CONFIG} ${BOOT_STAGING}/u-boot-spl.bin
|
||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${UBOOT_DTB_NAME} ${BOOT_STAGING}/fsl-imx8mn-evk.dtb
|
||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${UBOOT_CONFIG} ${BOOT_STAGING}/u-boot-nodtb.bin
|
||||
|
||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/mkimage_uboot ${BOOT_STAGING}/
|
||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin
|
||||
|
||||
for ddr_firmware in ${DDR_FIRMWARE_NAME}; do
|
||||
cp ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${BOOT_STAGING}
|
||||
done
|
||||
}
|
||||
|
||||
do_compile () {
|
||||
compile_${SOC_FAMILY}
|
||||
# mkimage for i.MX8
|
||||
for type in ${UBOOT_CONFIG}; do
|
||||
RAM_SIZE="$(echo ${type} | sed -e 's,.*[a-z]\+\([0-9]\+[M|G]B\)$,\1,g')"
|
||||
for ramc in ${RAM_CONFIGS}; do
|
||||
if echo "${ramc}" | grep -qs "${RAM_SIZE}"; then
|
||||
# Match U-Boot memory size and and SCFW memory configuration
|
||||
cd ${BOOT_STAGING}
|
||||
ln -sf u-boot-${type}.bin u-boot.bin
|
||||
ln -sf ${SC_FIRMWARE_NAME}-${ramc} scfw_tcm.bin
|
||||
cd -
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
bbnote "building ${SOC_TARGET} - ${ramc} - ${target}"
|
||||
make SOC=${SOC_TARGET} ${target}
|
||||
if [ -e "${BOOT_STAGING}/flash.bin" ]; then
|
||||
cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target}
|
||||
fi
|
||||
SCFWBUILT="yes"
|
||||
done
|
||||
rm ${BOOT_STAGING}/scfw_tcm.bin
|
||||
rm ${BOOT_STAGING}/u-boot.bin
|
||||
# Remove u-boot-atf.bin and u-boot-hash.bin so they get generated with the next iteration's U-Boot
|
||||
rm ${BOOT_STAGING}/u-boot-atf.bin
|
||||
rm ${BOOT_STAGING}/u-boot-hash.bin
|
||||
if [ "${SOC_TARGET}" = "iMX8QX" ]; then
|
||||
RAM_SIZE="$(echo ${type} | sed -e 's,.*[a-z]\+\([0-9]\+[M|G]B\)$,\1,g')"
|
||||
for ramc in ${RAM_CONFIGS}; do
|
||||
if echo "${ramc}" | grep -qs "${RAM_SIZE}"; then
|
||||
# Match U-Boot memory size and and SCFW memory configuration
|
||||
cd ${BOOT_STAGING}
|
||||
ln -sf u-boot-${type}.bin u-boot.bin
|
||||
ln -sf ${SC_FIRMWARE_NAME}-${ramc} scfw_tcm.bin
|
||||
cd -
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
bbnote "building ${SOC_TARGET} - ${ramc} - ${target}"
|
||||
make SOC=${SOC_TARGET} ${target}
|
||||
if [ -e "${BOOT_STAGING}/flash.bin" ]; then
|
||||
cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target}
|
||||
fi
|
||||
SCFWBUILT="yes"
|
||||
done
|
||||
rm ${BOOT_STAGING}/scfw_tcm.bin
|
||||
rm ${BOOT_STAGING}/u-boot.bin
|
||||
# Remove u-boot-atf.bin and u-boot-hash.bin so they get generated with the next iteration's U-Boot
|
||||
rm ${BOOT_STAGING}/u-boot-atf.bin
|
||||
rm ${BOOT_STAGING}/u-boot-hash.bin
|
||||
fi
|
||||
done
|
||||
else
|
||||
# mkimage for i.MX8M
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
bbnote "building ${SOC_TARGET} - ${target}"
|
||||
make SOC=${SOC_TARGET} ${target}
|
||||
if [ -e "${BOOT_STAGING}/flash.bin" ]; then
|
||||
cp ${BOOT_STAGING}/flash.bin ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target}
|
||||
fi
|
||||
done
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# Check that SCFW was built at least once
|
||||
if [ "${SCFWBUILT}" != "yes" ]; then
|
||||
if [ "${SOC_TARGET}" = "iMX8QX" and "${SCFWBUILT}" != "yes" ]; then
|
||||
bbfatal "SCFW was not built!"
|
||||
fi
|
||||
}
|
||||
|
||||
# ConnectCore 8M Nano does not have different binaries
|
||||
UBOOT_RAM_COMBINATIONS_ccimx8mn = ""
|
||||
|
||||
do_install () {
|
||||
install -d ${D}/boot
|
||||
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
||||
if [ "${UBOOT_RAM_COMBINATIONS}" = "" ]; then
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} ${D}/boot/
|
||||
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${D}/boot/
|
||||
done
|
||||
done
|
||||
else
|
||||
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} ${D}/boot/
|
||||
done
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
do_deploy () {
|
||||
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
|
||||
# copy the tool mkimage to deploy path and sc fw, dcd and uboot
|
||||
install -m 0644 ${BOOT_STAGING}/mx8qx-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
install -m 0644 ${BOOT_STAGING}/m40_tcm.bin ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
install -m 0644 ${BOOT_STAGING}/m4_image.bin ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
if [ "${SOC_TARGET}" = "iMX8QX" ]; then
|
||||
install -m 0644 ${BOOT_STAGING}/mx8qx-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
install -m 0644 ${BOOT_STAGING}/m40_tcm.bin ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
install -m 0644 ${BOOT_STAGING}/m4_image.bin ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
fi
|
||||
install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
|
||||
# copy makefile (soc.mak) for reference
|
||||
install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
|
||||
# copy the generated boot image to deploy path
|
||||
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
||||
if [ "${UBOOT_RAM_COMBINATIONS}" = "" ]; then
|
||||
IMAGE_IMXBOOT_TARGET=""
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
# Use first "target" as IMAGE_IMXBOOT_TARGET
|
||||
|
|
@ -115,15 +165,34 @@ do_deploy () {
|
|||
IMAGE_IMXBOOT_TARGET="$target"
|
||||
echo "Set boot target as $IMAGE_IMXBOOT_TARGET"
|
||||
fi
|
||||
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} ${DEPLOYDIR}
|
||||
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${DEPLOYDIR}
|
||||
done
|
||||
cd ${DEPLOYDIR}
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}.bin
|
||||
# Link to default bootable U-Boot filename. It gets overwritten
|
||||
# on every loop so the only last RAM_CONFIG will survive.
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
||||
cd -
|
||||
done
|
||||
else
|
||||
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
||||
IMAGE_IMXBOOT_TARGET=""
|
||||
for target in ${IMXBOOT_TARGETS}; do
|
||||
# Use first "target" as IMAGE_IMXBOOT_TARGET
|
||||
if [ "$IMAGE_IMXBOOT_TARGET" = "" ]; then
|
||||
IMAGE_IMXBOOT_TARGET="$target"
|
||||
echo "Set boot target as $IMAGE_IMXBOOT_TARGET"
|
||||
fi
|
||||
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${target} ${DEPLOYDIR}
|
||||
done
|
||||
cd ${DEPLOYDIR}
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin
|
||||
# Link to default bootable U-Boot filename. It gets overwritten
|
||||
# on every loop so the only last RAM_CONFIG will survive.
|
||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
||||
cd -
|
||||
done
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
COMPATIBLE_MACHINE = "(ccimx8x)"
|
||||
COMPATIBLE_MACHINE = "(ccimx8x|ccimx8mn)"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Copyright (C) 2018,2019 Digi International, Inc.
|
||||
|
||||
# Use the v4.14 ga BSP branch
|
||||
SRCBRANCH = "imx_4.14.98_2.1.0"
|
||||
SRCREV = "abd6ce551a7b81fc6953d32d92b24a4a1d4b214e"
|
||||
SRCBRANCH = "imx_4.14.98_2.2.0"
|
||||
SRCREV = "c00cd78d2e80178171d2d7f8d0d1ce6e2ea41ac5"
|
||||
|
|
|
|||
|
|
@ -179,3 +179,30 @@ do_deploy_append_ccimx8x() {
|
|||
mv ${DEPLOYDIR}/u-boot* ${DEPLOYDIR}/${BOOT_TOOLS}/
|
||||
mv ${DEPLOYDIR}/${UBOOT_SYMLINK}-* ${DEPLOYDIR}/${BOOT_TOOLS}/
|
||||
}
|
||||
|
||||
do_deploy_append_ccimx8mn() {
|
||||
# Move all U-Boot artifacts to the imx-boot-tools folder
|
||||
# U-Boot images are not bootable on the i.MX8M
|
||||
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||
mv ${DEPLOYDIR}/u-boot-spl* ${DEPLOYDIR}/${BOOT_TOOLS}/
|
||||
|
||||
# Deploy the mkimage, u-boot-nodtb.bin and ccimx8mn-dvk.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}/tools/mkimage ${DEPLOYDIR}/${BOOT_TOOLS}/mkimage_uboot
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue