Files
meta-qcom-extras/classes/linux-qcom-dtbbin.bbclass
Viswanath Kraleti f48bd85edf classes/linux-qcom-dtbbin.bbclass: Add a bbclass to generate dtb image
To be ARM System Ready IR compliant, QCOM UEFI implementation is now
supporting loading a matching device-tree by reading 'combined-dtb.dtb'
from the dtb partition.

linux-qcom-dtbbin.bbclass when inherited by kernel recipe, generates one
vfat image per dtb by packing dtb as 'combined-dtb.dtb'. This image can
be flashed into dtb parititon for UEFI to read and load device-tree.

Signed-off-by: Viswanath Kraleti <quic_vkraleti@quicinc.com>
2024-09-05 16:01:07 +05:30

34 lines
1.4 KiB
Plaintext

# SPDX-License-Identifier: BSD-3-Clause-Clear
DTBBIN_DEPLOYDIR = "${WORKDIR}/qcom_dtbbin_deploy-${PN}"
DTBBIN_SIZE ?= "4096"
do_qcom_dtbbin_deploy[depends] += "dosfstools-native:do_populate_sysroot mtools-native:do_populate_sysroot"
do_qcom_dtbbin_deploy[cleandirs] = "${DTBBIN_DEPLOYDIR}"
do_qcom_dtbbin_deploy() {
for dtbf in ${KERNEL_DEVICETREE}; do
bbdebug 1 " combining: $dtbf"
dtb=`normalize_dtb "$dtbf"`
dtb_ext=${dtb##*.}
dtb_base_name=`basename $dtb .$dtb_ext`
mkdir -p ${DTBBIN_DEPLOYDIR}/$dtb_base_name
cp ${D}/${KERNEL_DTBDEST}/$dtb_base_name.dtb ${DTBBIN_DEPLOYDIR}/$dtb_base_name/combined-dtb.dtb
mkfs.vfat $@ -C ${DTBBIN_DEPLOYDIR}/dtb-${dtb_base_name}-image.vfat ${DTBBIN_SIZE}
mcopy -i "${DTBBIN_DEPLOYDIR}/dtb-${dtb_base_name}-image.vfat" -vsmpQ ${DTBBIN_DEPLOYDIR}/$dtb_base_name/* ::/
rm -rf ${DTBBIN_DEPLOYDIR}/$dtb_base_name
done
}
addtask qcom_dtbbin_deploy after do_populate_sysroot do_packagedata before do_deploy
# Setup sstate, see deploy.bbclass
SSTATETASKS += "do_qcom_dtbbin_deploy"
do_qcom_dtbbin_deploy[sstate-inputdirs] = "${DTBBIN_DEPLOYDIR}"
do_qcom_dtbbin_deploy[sstate-outputdirs] = "${DEPLOY_DIR_IMAGE}"
python do_qcom_dtbbin_deploy_setscene () {
sstate_setscene(d)
}
addtask do_qcom_dtbbin_deploy_setscene
do_qcom_dtbbin_deploy[stamp-extra-info] = "${MACHINE_ARCH}"