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}"
|
PV = "2.0+git${SRCPV}"
|
||||||
|
|
||||||
ATF_SRC ?= "git://source.codeaurora.org/external/imx/imx-atf.git;protocol=https"
|
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}"
|
SRC_URI = "${ATF_SRC};branch=${SRCBRANCH}"
|
||||||
SRCREV = "727cf896a4c79d152dae4537e28400c747bf39b9"
|
SRCREV = "1355c5d12d75c9c7bdd08826796096bab519b3d5"
|
||||||
|
|
||||||
S = "${WORKDIR}/git"
|
S = "${WORKDIR}/git"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
inherit boot-artifacts
|
inherit boot-artifacts
|
||||||
|
|
||||||
# Use the v4.14 latest BSP branch
|
# Use the v4.14 latest BSP branch
|
||||||
SRCBRANCH = "imx_4.14.98_2.1.0"
|
SRCBRANCH = "imx_4.14.98_2.2.0"
|
||||||
SRCREV = "abd6ce551a7b81fc6953d32d92b24a4a1d4b214e"
|
SRCREV = "c00cd78d2e80178171d2d7f8d0d1ce6e2ea41ac5"
|
||||||
|
|
||||||
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
FILESEXTRAPATHS_prepend := "${THISDIR}/${BPN}:"
|
||||||
SRC_URI_append_ccimx8x = " file://0001-iMX8QX-remove-SC_BD_FLAGS_ALT_CONFIG-flag-in-flash_r.patch"
|
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
|
# output. Note that this aggregation replaces the aggregation
|
||||||
# that would otherwise be done in the image build as controlled
|
# that would otherwise be done in the image build as controlled
|
||||||
# by IMAGE_BOOTFILES_DEPENDS and IMAGE_BOOTFILES in image_types_fsl.bbclass
|
# 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,
|
# This package aggregates output deployed by other packages,
|
||||||
# so set the appropriate dependencies
|
# so set the appropriate dependencies
|
||||||
|
|
@ -35,11 +37,19 @@ do_populate_lic[depends] += " \
|
||||||
firmware-imx:do_populate_lic \
|
firmware-imx:do_populate_lic \
|
||||||
"
|
"
|
||||||
ATF_MACHINE_NAME_mx8qxp = "bl31-imx8qx.bin"
|
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', \
|
IMXBOOT_TARGETS_ccimx8x = "${@bb.utils.contains('UBOOT_CONFIG', 'fspi', 'flash_flexspi', \
|
||||||
'flash flash_regression_linux_m4', d)}"
|
'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
|
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}/m40_tcm.bin
|
||||||
cp ${DEPLOY_DIR_IMAGE}/imx8qx_m4_TCM_srtm_demo.bin ${BOOT_STAGING}/m4_image.bin
|
cp ${DEPLOY_DIR_IMAGE}/imx8qx_m4_TCM_srtm_demo.bin ${BOOT_STAGING}/m4_image.bin
|
||||||
|
|
@ -51,9 +61,28 @@ do_compile () {
|
||||||
for ramc in ${RAM_CONFIGS}; do
|
for ramc in ${RAM_CONFIGS}; do
|
||||||
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME}-${ramc} ${BOOT_STAGING}/
|
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${SC_FIRMWARE_NAME}-${ramc} ${BOOT_STAGING}/
|
||||||
done
|
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
|
# mkimage for i.MX8
|
||||||
for type in ${UBOOT_CONFIG}; do
|
for type in ${UBOOT_CONFIG}; do
|
||||||
|
if [ "${SOC_TARGET}" = "iMX8QX" ]; then
|
||||||
RAM_SIZE="$(echo ${type} | sed -e 's,.*[a-z]\+\([0-9]\+[M|G]B\)$,\1,g')"
|
RAM_SIZE="$(echo ${type} | sed -e 's,.*[a-z]\+\([0-9]\+[M|G]B\)$,\1,g')"
|
||||||
for ramc in ${RAM_CONFIGS}; do
|
for ramc in ${RAM_CONFIGS}; do
|
||||||
if echo "${ramc}" | grep -qs "${RAM_SIZE}"; then
|
if echo "${ramc}" | grep -qs "${RAM_SIZE}"; then
|
||||||
|
|
@ -77,36 +106,74 @@ do_compile () {
|
||||||
rm ${BOOT_STAGING}/u-boot-hash.bin
|
rm ${BOOT_STAGING}/u-boot-hash.bin
|
||||||
fi
|
fi
|
||||||
done
|
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
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check that SCFW was built at least once
|
# 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!"
|
bbfatal "SCFW was not built!"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ConnectCore 8M Nano does not have different binaries
|
||||||
|
UBOOT_RAM_COMBINATIONS_ccimx8mn = ""
|
||||||
|
|
||||||
do_install () {
|
do_install () {
|
||||||
install -d ${D}/boot
|
install -d ${D}/boot
|
||||||
|
if [ "${UBOOT_RAM_COMBINATIONS}" = "" ]; then
|
||||||
|
for target in ${IMXBOOT_TARGETS}; do
|
||||||
|
install -m 0644 ${S}/${UBOOT_PREFIX}-${MACHINE}.bin-${target} ${D}/boot/
|
||||||
|
done
|
||||||
|
else
|
||||||
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
||||||
for target in ${IMXBOOT_TARGETS}; do
|
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}-${ramc}.bin-${target} ${D}/boot/
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
do_deploy () {
|
do_deploy () {
|
||||||
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
|
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||||
|
|
||||||
# copy the tool mkimage to deploy path and sc fw, dcd and uboot
|
# copy the tool mkimage to deploy path and sc fw, dcd and uboot
|
||||||
|
if [ "${SOC_TARGET}" = "iMX8QX" ]; then
|
||||||
install -m 0644 ${BOOT_STAGING}/mx8qx-ahab-container.img ${DEPLOYDIR}/${BOOT_TOOLS}
|
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}/m40_tcm.bin ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||||
install -m 0644 ${BOOT_STAGING}/m4_image.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}
|
install -m 0755 ${S}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||||
|
|
||||||
# copy makefile (soc.mak) for reference
|
# copy makefile (soc.mak) for reference
|
||||||
install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS}
|
install -m 0644 ${BOOT_STAGING}/soc.mak ${DEPLOYDIR}/${BOOT_TOOLS}
|
||||||
|
|
||||||
# copy the generated boot image to deploy path
|
# copy the generated boot image to deploy path
|
||||||
|
if [ "${UBOOT_RAM_COMBINATIONS}" = "" ]; then
|
||||||
|
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}.bin-${target} ${DEPLOYDIR}
|
||||||
|
done
|
||||||
|
cd ${DEPLOYDIR}
|
||||||
|
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}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
||||||
|
cd -
|
||||||
|
else
|
||||||
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
for ramc in ${UBOOT_RAM_COMBINATIONS}; do
|
||||||
IMAGE_IMXBOOT_TARGET=""
|
IMAGE_IMXBOOT_TARGET=""
|
||||||
for target in ${IMXBOOT_TARGETS}; do
|
for target in ${IMXBOOT_TARGETS}; do
|
||||||
|
|
@ -124,6 +191,8 @@ do_deploy () {
|
||||||
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
ln -sf ${UBOOT_PREFIX}-${MACHINE}-${ramc}.bin-${IMAGE_IMXBOOT_TARGET} ${BOOTABLE_FILENAME}
|
||||||
cd -
|
cd -
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
COMPATIBLE_MACHINE = "(ccimx8x)"
|
COMPATIBLE_MACHINE = "(ccimx8x|ccimx8mn)"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# Copyright (C) 2018,2019 Digi International, Inc.
|
# Copyright (C) 2018,2019 Digi International, Inc.
|
||||||
|
|
||||||
# Use the v4.14 ga BSP branch
|
# Use the v4.14 ga BSP branch
|
||||||
SRCBRANCH = "imx_4.14.98_2.1.0"
|
SRCBRANCH = "imx_4.14.98_2.2.0"
|
||||||
SRCREV = "abd6ce551a7b81fc6953d32d92b24a4a1d4b214e"
|
SRCREV = "c00cd78d2e80178171d2d7f8d0d1ce6e2ea41ac5"
|
||||||
|
|
|
||||||
|
|
@ -179,3 +179,30 @@ do_deploy_append_ccimx8x() {
|
||||||
mv ${DEPLOYDIR}/u-boot* ${DEPLOYDIR}/${BOOT_TOOLS}/
|
mv ${DEPLOYDIR}/u-boot* ${DEPLOYDIR}/${BOOT_TOOLS}/
|
||||||
mv ${DEPLOYDIR}/${UBOOT_SYMLINK}-* ${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