aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-bsp/firmware/firmware-qcom-adreno.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/firmware/firmware-qcom-adreno.inc')
-rw-r--r--recipes-bsp/firmware/firmware-qcom-adreno.inc40
1 files changed, 40 insertions, 0 deletions
diff --git a/recipes-bsp/firmware/firmware-qcom-adreno.inc b/recipes-bsp/firmware/firmware-qcom-adreno.inc
new file mode 100644
index 0000000..2fad318
--- /dev/null
+++ b/recipes-bsp/firmware/firmware-qcom-adreno.inc
@@ -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
+}