firmware-qcom-adreno: package Adreno-specific firmware

Adreno firmware is not a part of the NON-HLOS.bin, but it can be found
inside the vendor-provided 'proprietary.tar.gz' archives. Add support
for packaging Adreno zap shaders from such archives.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
This commit is contained in:
Dmitry Baryshkov
2022-12-07 22:10:52 +03:00
parent e94335431a
commit 82e6efeafc

View File

@@ -0,0 +1,40 @@
# Handle Adreno firmware unpacking in a generic way
# Include the file to be able to dissect the archive.
# If ADRENO_URI is defined, the image will be dissected automatically
# Handle fwpath=... as a path to Adreno firmware inside the archive
ADRENO_URI ??= ""
# Conditionally populate SRC_URI. We have to do it here rather than in python
# script to let base.bbclass to pick up dependencies
SRC_URI += "${@['', '${ADRENO_URI};subdir=adreno;name=adreno'][d.getVar('ADRENO_URI') != ''] }"
# the file is unpacked to this dir, clean it up
do_unpack[cleandirs] = "${WORKDIR}/adreno"
DEPENDS += "pil-squasher-native"
python () {
uri = d.getVar("ADRENO_URI")
if uri == "":
bb.warn("%s: not packaging ADRENO firmware. Please provide ADRENO_URI" % d.getVar("PN"))
else:
urldata = bb.fetch2.FetchData(d.getVar("ADRENO_URI"), d)
if "fwpath" in urldata.parm:
d.setVar("ADRENO_PATH", urldata.parm["fwpath"])
else:
d.setVar("ADRENO_PATH", "")
}
do_compile:append() {
if [ -n "${ADRENO_URI}" ] ; then
for fw in ${WORKDIR}/adreno/${ADRENO_PATH}/*_zap.mdt ; do
pil-squasher ${B}/`basename $fw mdt`mbn $fw || exit 1
done
for fw in ${FW_QCOM_LIST} ; do
if [ -r ${WORKDIR}/adreno/${ADRENO_PATH}/$fw ] ; then
cp ${WORKDIR}/adreno/${ADRENO_PATH}/$fw ${B}/
fi
done
fi
}