Newer
Older
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
}
for config in ${UBOOT_CONFIG}; do
# Integrate fw_env.config and u-boot-initial-env
cp "${DEPLOY_DIR_IMAGE}/u-boot-initial-env-${MACHINE}-${config}.bin" "${S}"
cp "${DEPLOY_DIR_IMAGE}/fw_env-${MACHINE}-${config}.config" "${S}"
for target in ${IMXBOOT_TARGETS}; do
# Store an md5sum to check the files on target before installation
md5sum ${BOOT_NAME}-${MACHINE}-${config}.bin-${target} \
u-boot-initial-env-${MACHINE}-${config}.bin \
fw_env-${MACHINE}-${config}.config \
> ${BOOT_NAME}-${MACHINE}-${config}.bin-${target}.md5
done
cd -
done
for config in ${UBOOT_CONFIG}; do
for target in ${IMXBOOT_TARGETS}; do
# Create a tar from the bootfiles, compressed gz, dereference links (copy the file not the link into the tar)
cd ${S}
tar chzf ${DEPLOYDIR}/${BOOT_NAME}-${MACHINE}-${config}.bin-${target}.tar.gz \
${BOOT_NAME}-${MACHINE}-${config}.bin-${target} \
${BOOT_NAME}-${MACHINE}-${config}.bin-${target}.md5 \
u-boot-initial-env-${MACHINE}-${config}.bin \
fw_env-${MACHINE}-${config}.config
cd -
cd ${DEPLOYDIR}
# The creation of the link name is a little hacky, as it assumes the config to begin with sd, but it works
ln -sf ${BOOT_NAME}-${MACHINE}-${config}.bin-${target}.tar.gz ${BOOT_NAME}${config#sd}.tar.gz
cd -
done
done
}
# Copy of the original compile function, as UBOOT_ADDITIONAL_DTB_NAMES had to
# be added to the make call
do_compile:mx8m() {
bbnote 8MQ/8MM/8MN/8MP boot binary build
for ddr_firmware in ${DDR_FIRMWARE_NAME}; do
bbnote "Copy ddr_firmware: ${ddr_firmware} from ${DEPLOY_DIR_IMAGE} -> ${BOOT_STAGING} "
cp ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${BOOT_STAGING}
done
cp ${DEPLOY_DIR_IMAGE}/signed_dp_imx8m.bin ${BOOT_STAGING}
cp ${DEPLOY_DIR_IMAGE}/signed_hdmi_imx8m.bin ${BOOT_STAGING}
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/${UBOOT_DTB_NAME} ${BOOT_STAGING}
if [ "x${UBOOT_SIGN_ENABLE}" = "x1" ] ; then
# Use DTB binary patched with signature node
cp ${DEPLOY_DIR_IMAGE}/${UBOOT_DTB_BINARY} ${BOOT_STAGING}/${UBOOT_DTB_NAME}
fi
cp ${DEPLOY_DIR_IMAGE}/${ATF_MACHINE_NAME} ${BOOT_STAGING}/bl31.bin
# 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
for config in ${UBOOT_CONFIG}; do
cp ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${config} \
${BOOT_STAGING}/u-boot-spl.bin
cp ${DEPLOY_DIR_IMAGE}/${BOOT_TOOLS}/u-boot-nodtb.bin-${MACHINE}-${config} \
${BOOT_STAGING}/u-boot-nodtb.bin
cp ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin-${config} ${BOOT_STAGING}/u-boot.bin
for target in ${IMXBOOT_TARGETS}; do
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_NAME}-${MACHINE}-${config}.bin-${target}
fi
done
done
}
do_compile() {
bberror "SOC specific do_compile override function is not found. Please create one."
}
do_install () {
install -d ${D}/boot
for config in ${UBOOT_CONFIG}; do
for target in ${IMXBOOT_TARGETS}; do
install -m 0644 ${S}/${BOOT_NAME}-${MACHINE}-${config}.bin-${target} ${D}/boot/
done
done
}
deploy_mx8m() {
install -d ${DEPLOYDIR}/${BOOT_TOOLS}
for config in ${UBOOT_CONFIG}; do
install -m 0644 ${DEPLOY_DIR_IMAGE}/u-boot-spl.bin-${MACHINE}-${config} \
${DEPLOYDIR}/${BOOT_TOOLS}
done
for ddr_firmware in ${DDR_FIRMWARE_NAME}; do
install -m 0644 ${DEPLOY_DIR_IMAGE}/${ddr_firmware} ${DEPLOYDIR}/${BOOT_TOOLS}
done
install -m 0644 ${BOOT_STAGING}/signed_dp_imx8m.bin ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0644 ${BOOT_STAGING}/signed_hdmi_imx8m.bin ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0755 ${BOOT_STAGING}/${TOOLS_NAME} ${DEPLOYDIR}/${BOOT_TOOLS}
install -m 0755 ${BOOT_STAGING}/mkimage_fit_atf.sh ${DEPLOYDIR}/${BOOT_TOOLS}
}
do_deploy() {
deploy_${SOC_FAMILY}
# copy the sc fw, dcd and uboot to deploy path
for config in ${UBOOT_CONFIG}; do
install -m 0644 ${DEPLOY_DIR_IMAGE}/u-boot-${MACHINE}.bin-${config} ${DEPLOYDIR}/${BOOT_TOOLS}
done
# copy tee.bin to deploy path
if ${DEPLOY_OPTEE}; then
install -m 0644 ${DEPLOY_DIR_IMAGE}/tee.bin ${DEPLOYDIR}/${BOOT_TOOLS}
fi
# 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 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
for config in ${UBOOT_CONFIG}; do
install -m 0644 ${S}/${BOOT_NAME}-${MACHINE}-${config}.bin-${target} ${DEPLOYDIR}
done
done
ln -sf ${BOOT_NAME}-${MACHINE}-${config}.bin-${IMAGE_IMXBOOT_TARGET} ${DEPLOYDIR}/${BOOT_NAME}