Skip to content

Commit

Permalink
Merge pull request #701 from lumag/fw-8060
Browse files Browse the repository at this point in the history
Firmware for Dragonboard APQ8060
  • Loading branch information
lumag authored Jan 8, 2025
2 parents 210c102 + a5e6339 commit 08c56f5
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
30 changes: 30 additions & 0 deletions recipes-bsp/firmware/firmware-qcom-dragonboard-apq8060.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Specify location of the corresponding NON-HLOS.bin file by adding
# NHLOS_URI:pn-firmware-qcom-dragonboard-apq8060 = "..." to local.conf. Use
# "file://" if the file is provided locally.

DESCRIPTION = "QCOM Firmware for Dragonboard APQ8060 board"

LICENSE = "CLOSED"

# dragonboard8060 firmware is unsigned, so install into generic location
FW_QCOM_NAME = "apq8060"

FW_QCOM_LIST = "q6.mbn"

S = "${UNPACKDIR}"

require recipes-bsp/firmware/firmware-qcom.inc
require recipes-bsp/firmware/firmware-qcom-nhlos.inc

unpack_nhlos_image:append() {
if [ -d ${B}/firmware/IMAGE ] ; then
mv ${B}/firmware/IMAGE ${B}/firmware/image
for file in ${B}/firmware/image/* ; do
mv "${file}" ${B}/firmware/image/`basename ${file} | tr A-Z a-z`
done
fi
}

SPLIT_FIRMWARE_PACKAGES = " \
linux-firmware-qcom-${FW_QCOM_NAME}-q6 \
"
8 changes: 6 additions & 2 deletions recipes-bsp/firmware/firmware-qcom-nhlos.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ DEPENDS += "pil-squasher-native mtools-native"
# script to let base.bbclass to pick up dependencies
SRC_URI += "${NHLOS_URI}"

handle_nonhlos_image() {
unpack_nhlos_image() {
mkdir -p ${B}/firmware
mcopy -n -s -i "$1" ::/* ${B}/firmware/
}

handle_nonhlos_image() {
for fw in ${B}/firmware/image/*.mdt ; do
pil-squasher ${B}/`basename $fw mdt`mbn $fw || exit 1
done
Expand All @@ -36,7 +39,8 @@ do_compile:prepend() {
if [ -z "${NHLOS_URI}" ] ; then
bbwarn "${PN}: not packaging NHLOS firmware. Please provide HNLOS_URI"
else
handle_nonhlos_image ${UNPACKDIR}/${@get_nhlos_path(d.getVar("NHLOS_URI"))}
unpack_nhlos_image ${UNPACKDIR}/${@get_nhlos_path(d.getVar("NHLOS_URI"))}
handle_nonhlos_image
fi
}

Expand Down

0 comments on commit 08c56f5

Please sign in to comment.