Skip to content

Commit

Permalink
Merge pull request #674 from lumag/hexagon-dsp-binaries
Browse files Browse the repository at this point in the history
Use Hexagon DSP binaries recipe
  • Loading branch information
lumag authored Nov 12, 2024
2 parents 5e56a4a + 96eb8e5 commit c0112ba
Show file tree
Hide file tree
Showing 20 changed files with 140 additions and 201 deletions.
27 changes: 19 additions & 8 deletions recipes-bsp/firmware-nexus/firmware-qcom-pixel.inc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ DEPENDS += "pil-squasher-native"

VENDOR_IMG_SPARSE ?= "1"

PACKAGES =+ "${PN}-dsp-binaries"
INSANE_SKIP:${PN}-dsp-binaries += "arch libdir file-rdeps textrel"
FILES:${PN}-dsp-binaries = "${DSP_QCOM_BASE_PATH}"
RDEPENDS:${PN}-dsp-binaries += "${PN} (= ${PV})"
RRECOMMENDS:${PN} += "${PN}-dsp-binaries"

# extract the license file
do_extract() {
head -n 280 ${UNPACKDIR}/extract-${VENDOR}-${FW_QCOM_NAME}.sh | tail -n +16 > ${S}/license.txt
Expand All @@ -27,14 +33,13 @@ do_extract() {
ln -sr ${S}/vendor/${VENDOR}/${FW_QCOM_NAME}/proprietary/vendor.img ${B}/vendor.img
fi

# FIXME: also extract fastrpc shell
mkdir -p ${B}/firmware
debugfs ${B}/vendor.img -R 'ls -p /firmware' | \
grep '^/[0-9]*/100' | cut -d/ -f6 > ${B}/firmware/fw.lst
debugfs ${B}/vendor.img -R 'ls -p /firmware' | \
grep '^/[0-9]*/100' | cut -d/ -f6 | \
while read name ; do echo "dump /firmware/$name ${B}/firmware/$name" ; done | \
debugfs ${B}/vendor.img
for path in firmware dsp/adsp dsp/cdsp dsp/sdsp lib/rfsa/adsp ; do
mkdir -p ${B}/$path
debugfs ${B}/vendor.img -R "ls -p /$path" | \
grep '^/[0-9]*/100' | cut -d/ -f6 | \
while read name ; do echo "dump /$path/$name ${B}/$path/$name" ; done | \
debugfs ${B}/vendor.img
done

radio="${S}/vendor/${VENDOR}/${FW_QCOM_NAME}/proprietary/radio.img"
if [ -r "${radio}" ] ; then
Expand Down Expand Up @@ -75,11 +80,17 @@ do_install() {
ls ${B}/firmware/a[0-9]*_gmu.bin && install -m 0644 ${B}/firmware/a[0-9]*_gmu.bin ${D}${FW_QCOM_PATH}
ls ${B}/a[0-9]*.mbn && install -m 0644 ${B}/a[0-9]*.mbn ${D}${FW_QCOM_PATH}

ls ${B}/dsp/adsp/* && mkdir -p ${D}${DSP_QCOM_PATH}/dsp/adsp && install -m 0644 ${B}/dsp/adsp/* ${D}${DSP_QCOM_PATH}/dsp/adsp
ls ${B}/dsp/cdsp/* && mkdir -p ${D}${DSP_QCOM_PATH}/dsp/cdsp && install -m 0644 ${B}/dsp/cdsp/* ${D}${DSP_QCOM_PATH}/dsp/cdsp
ls ${B}/dsp/sdsp/* && mkdir -p ${D}${DSP_QCOM_PATH}/dsp/sdsp && install -m 0644 ${B}/dsp/sdsp/* ${D}${DSP_QCOM_PATH}/dsp/sdsp
ls ${B}/lib/rfsa/adsp/* && mkdir -p ${D}${DSP_QCOM_PATH}/dsp/lib && install -m 0644 ${B}/lib/rfsa/adsp/* ${D}${DSP_QCOM_PATH}/dsp/lib

install -m 0644 license.txt ${D}${FW_QCOM_PATH}

# Remove duplicates
rm -f ${D}${FW_QCOM_PATH}/a630_gmu.bin
rm -f ${D}${FW_QCOM_PATH}/a650_gmu.bin

[ -z "${EXTRA_DEVICE_SUBDIR}" ] || ln -sr ${D}${FW_QCOM_PATH} ${D}${FW_QCOM_BASE_PATH}/${EXTRA_DEVICE_SUBDIR}
[ -n "${EXTRA_DEVICE_SUBDIR}" -a -d ${D}${DSP_QCOM_PATH} ] && ln -sr ${D}${DSP_QCOM_PATH} ${D}${DSP_QCOM_BASE_PATH}/${EXTRA_DEVICE_SUBDIR} || true
}
17 changes: 0 additions & 17 deletions recipes-bsp/firmware/firmware-qcom-dragonboard410c.inc

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions recipes-bsp/firmware/firmware-qcom-dragonboard410c_1036.1.bb

This file was deleted.

28 changes: 0 additions & 28 deletions recipes-bsp/firmware/firmware-qcom-dragonboard820c_01700.1.bb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,13 @@ SRC_URI = "https://releases.linaro.org/96boards/dragonboard845c/qualcomm/firmwar
SRC_URI[md5sum] = "ad69855a1275547b16d94a1b5405ac62"
SRC_URI[sha256sum] = "4289d2f2a7124b104d0274879e702aae9b1e50c42eec3747f8584c6744ef65e3"

FW_QCOM_NAME = "sdm845"

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

DEPENDS += "pil-squasher-native"
FILES:${PN} += "${nonarch_base_libdir}/firmware/"

do_install() {
install -d ${D}${nonarch_base_libdir}/firmware/
install -d ${D}${FW_QCOM_PATH}

install -m 0444 ./08-dspso/dspso.bin ${D}${FW_QCOM_PATH}

install -m 0444 ./17-USB3-201-202-FW/K2026090.mem ${D}${nonarch_base_libdir}/firmware/renesas_usb_fw.mem

install -d ${D}${sysconfdir}/
install -m 0644 LICENSE.qcom.txt ${D}${sysconfdir}/QCOM-LINUX-BOARD-SUPPORT-LICENSE-${PN}
}

SPLIT_FIRMWARE_PACKAGES = " \
${PN}-dspso \
"
25 changes: 0 additions & 25 deletions recipes-bsp/firmware/firmware-qcom-rb1_20230823-v2.bb

This file was deleted.

25 changes: 0 additions & 25 deletions recipes-bsp/firmware/firmware-qcom-rb2_20230823-v2.bb

This file was deleted.

32 changes: 0 additions & 32 deletions recipes-bsp/firmware/firmware-qcom-rb5_20210331-v4.bb

This file was deleted.

4 changes: 3 additions & 1 deletion recipes-bsp/firmware/firmware-qcom.inc
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ FW_QCOM_SUBDIR ?= "${FW_QCOM_NAME}"
FW_QCOM_BASE_PATH = "${nonarch_base_libdir}/firmware/qcom"
FW_QCOM_PATH = "${FW_QCOM_BASE_PATH}/${FW_QCOM_SUBDIR}"

DSP_QCOM_BASE_PATH = "${datadir}/qcom"
DSP_QCOM_PATH = "${DSP_QCOM_BASE_PATH}/${FW_QCOM_SUBDIR}"

SPLIT_FIRMWARE_PACKAGES ?= ""

PACKAGE_BEFORE_PN += "${SPLIT_FIRMWARE_PACKAGES}"
# RRECOMMEND all non-split packages split from this recipe. Split firmware files re usually replaced with the squashed ones.
RRECOMMENDS:${PN} += "${@ ' '.join(filter(lambda p: not p.endswith('-split'), d.getVar('SPLIT_FIRMWARE_PACKAGES').split())) }"

# Default settings for several split packages
FILES:${PN}-dspso += "${FW_QCOM_BASE_PATH}/*/*dspso.bin"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-adreno = "${FW_QCOM_PATH}/*_zap.mbn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-audio = "${FW_QCOM_PATH}/adsp.mbn ${FW_QCOM_PATH}/adsp_dtb.mbn ${FW_QCOM_PATH}/adsp*.jsn ${FW_QCOM_PATH}/battmgr.jsn"
FILES:linux-firmware-qcom-${FW_QCOM_NAME}-audio-split = "${FW_QCOM_PATH}/adsp.mdt ${FW_QCOM_PATH}/adsp.b*"
Expand Down
75 changes: 75 additions & 0 deletions recipes-bsp/hexagon-dsp-binaries/hexagon-dsp-binaries_20241017.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
SUMMARY = "Hexagon DSP binaries for Qualcomm hardware"
DESCRIPTION = "Hexagon DSP binaries is a package distributed alongside the \
Linux firmware release. It contains libraries and executables to be used \
with the corresponding DSP firmware using the FastRPC interface in order \
to provide additional functionality by the DSPs."

LICENSE = "dspso-qcom"
LIC_FILES_CHKSUM = "file://LICENSE.qcom;md5=56e86b6c508490dadc343f39468b5f5e"
NO_GENERIC_LICENSE[dspso-qcom] = "LICENSE.qcom"

SRC_URI = "git://github.com/linux-msm/dsp-binaries;protocol=https;branch=trunk"

SRCREV = "744ee1450a5e73ab041cb55cb134898e34ebbbbb"

S = "${WORKDIR}/git"

inherit allarch

INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_DEFAULT_DEPS = "1"

do_install () {
oe_runmake install 'DESTDIR=${D}'
install -m 0644 LICENSE.qcom ${D}${datadir}/qcom/
}

PACKAGES =+ "\
${PN}-qcom-license \
${PN}-qcom-db820c-adsp \
${PN}-thundercomm-db845c-adsp \
${PN}-thundercomm-db845c-cdsp \
${PN}-thundercomm-db845c-sdsp \
${PN}-thundercomm-rb1-adsp \
${PN}-thundercomm-rb2-adsp \
${PN}-thundercomm-rb2-cdsp \
${PN}-thundercomm-rb5-adsp \
${PN}-thundercomm-rb5-cdsp \
${PN}-thundercomm-rb5-sdsp \
"

RDEPENDS:${PN}-qcom-db820c-adsp = "${PN}-qcom-license linux-firmware-qcom-apq8096-audio (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-db845c-adsp = "${PN}-qcom-license linux-firmware-qcom-sdm845-audio (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-db845c-cdsp = "${PN}-qcom-license linux-firmware-qcom-sdm845-compute (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-db845c-sdsp = "${PN}-qcom-license linux-firmware-qcom-sdm845-thundercomm-db845c-sensors (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-rb1-adsp = "${PN}-qcom-license linux-firmware-qcom-qcm2290-audio (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-rb2-adsp = "${PN}-qcom-license linux-firmware-qcom-qrb4210-audio (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-rb2-cdsp = "${PN}-qcom-license linux-firmware-qcom-qrb4210-compute (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-rb5-adsp = "${PN}-qcom-license linux-firmware-qcom-sm8250-audio (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-rb5-cdsp = "${PN}-qcom-license linux-firmware-qcom-sm8250-compute (= 1:${PV})"
RDEPENDS:${PN}-thundercomm-rb5-sdsp = "${PN}-qcom-license linux-firmware-qcom-sm8250-thundercomm-rb5-sensors (= 1:${PV})"

FILES:${PN}-qcom-license = "${datadir}/qcom/LICENSE.qcom"

FILES:${PN}-qcom-db820c-adsp = "${datadir}/qcom/apq8096/Qualcomm/db820c/dsp/adsp"
FILES:${PN}-thundercomm-db845c-adsp = "${datadir}/qcom/sdm845/Thundercomm/db845c/dsp/adsp"
FILES:${PN}-thundercomm-db845c-cdsp = "${datadir}/qcom/sdm845/Thundercomm/db845c/dsp/cdsp"
FILES:${PN}-thundercomm-db845c-sdsp = "${datadir}/qcom/sdm845/Thundercomm/db845c/dsp/sdsp"
FILES:${PN}-thundercomm-rb1-adsp = "${datadir}/qcom/qcm2290/Thundercomm/RB1/dsp/adsp"
FILES:${PN}-thundercomm-rb2-adsp = "${datadir}/qcom/qrb4210/Thundercomm/RB2/dsp/adsp"
FILES:${PN}-thundercomm-rb2-cdsp = "${datadir}/qcom/qrb4210/Thundercomm/RB2/dsp/cdsp"
FILES:${PN}-thundercomm-rb5-adsp = "${datadir}/qcom/sm8250/Thundercomm/RB5/dsp/adsp"
FILES:${PN}-thundercomm-rb5-cdsp = "${datadir}/qcom/sm8250/Thundercomm/RB5/dsp/cdsp"
FILES:${PN}-thundercomm-rb5-sdsp = "${datadir}/qcom/sm8250/Thundercomm/RB5/dsp/sdsp"

INSANE_SKIP:${PN}-qcom-db820c-adsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-db845c-adsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-db845c-cdsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-db845c-sdsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-rb1-adsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-rb2-adsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-rb2-cdsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-rb5-adsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-rb5-cdsp = "arch libdir file-rdeps textrel"
INSANE_SKIP:${PN}-thundercomm-rb5-sdsp = "arch libdir file-rdeps textrel"
15 changes: 10 additions & 5 deletions recipes-bsp/images/initramfs-firmware-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ PACKAGE_INSTALL:qcom-armv8a = " \
"

BAD_RECOMMENDATIONS = " \
firmware-qcom-dragonboard820c-dspso \
firmware-qcom-dragonboard845c-dspso \
firmware-qcom-rb1-dspso \
firmware-qcom-rb2-dspso \
firmware-qcom-rb5-dspso \
hexagon-dsp-binaries-qcom-db820c-adsp \
hexagon-dsp-binaries-thundercomm-db845c-adsp \
hexagon-dsp-binaries-thundercomm-db845c-cdsp \
hexagon-dsp-binaries-thundercomm-db845c-sdsp \
hexagon-dsp-binaries-thundercomm-rb1-adsp \
hexagon-dsp-binaries-thundercomm-rb2-adsp \
hexagon-dsp-binaries-thundercomm-rb2-cdsp \
hexagon-dsp-binaries-thundercomm-rb5-adsp \
hexagon-dsp-binaries-thundercomm-rb5-cdsp \
hexagon-dsp-binaries-thundercomm-rb5-sdsp \
"

PACKAGE_INSTALL:qcom-armv7a = " \
Expand Down
5 changes: 3 additions & 2 deletions recipes-bsp/images/initramfs-firmware-rb12-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ PACKAGE_INSTALL += " \
"

BAD_RECOMMENDATIONS = " \
firmware-qcom-rb1-dspso \
firmware-qcom-rb2-dspso \
hexagon-dsp-binaries-thundercomm-rb1-adsp \
hexagon-dsp-binaries-thundercomm-rb2-adsp \
hexagon-dsp-binaries-thundercomm-rb2-cdsp \
linux-firmware-qcom-venus-6.0 \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ SUMMARY = "Firmware packages for the DragonBoard 410c board"
inherit packagegroup

RRECOMMENDS:${PN} += " \
firmware-qcom-dragonboard410c \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'linux-firmware-qcom-adreno-a3xx', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-qcom-apq8016-wifi', '', d)} \
linux-firmware-qcom-apq8016-modem \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ SUMMARY = "Firmware packages for the DragonBoard 820c board"
inherit packagegroup

RRECOMMENDS:${PN} += " \
firmware-qcom-dragonboard820c \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'linux-firmware-qcom-adreno-a530 linux-firmware-qcom-apq8096-adreno', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath10k', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'linux-firmware-qca', '', d)} \
linux-firmware-qcom-apq8096-audio \
linux-firmware-qcom-apq8096-modem \
linux-firmware-qcom-venus-4.2 \
hexagon-dsp-binaries-qcom-db820c-adsp \
"
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ RRECOMMENDS:${PN} += " \
linux-firmware-qcom-sdm845-audio \
linux-firmware-qcom-sdm845-compute \
linux-firmware-qcom-venus-5.2 \
hexagon-dsp-binaries-thundercomm-db845c-adsp \
hexagon-dsp-binaries-thundercomm-db845c-cdsp \
"
Loading

0 comments on commit c0112ba

Please sign in to comment.