Skip to content

Commit

Permalink
Merge pull request #635 from lumag/fix-rb3g2
Browse files Browse the repository at this point in the history
Fix rb3gen2 firmware packages
  • Loading branch information
lumag authored Sep 12, 2024
2 parents 574b18d + e8bcb80 commit adad377
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
10 changes: 8 additions & 2 deletions recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://${LICENSE_FILE};md5=164e3362a538eb11d3ac51e8e134294b
file://${LICENSE_FILE_PDF};md5=e1d82f4252cf04ba59b8b9d0011e0180 \
"

DEPENDS += "qca-swiss-army-knife-native"
DEPENDS += "qca-swiss-army-knife-native pil-squasher"

FW_D_NAME = "QCM6490_fw"

Expand All @@ -37,8 +37,9 @@ require recipes-bsp/firmware/firmware-qcom.inc
require recipes-bsp/firmware/firmware-qcom-adreno.inc

do_compile:append() {
pil-squasher wpss.mbn ${UNPACKDIR}/${FW_D_NAME}/${QCS6490_FW_SRC_PATH}/wpss.mdt
# Build board-2.bin needed by WiFi
ath11k-generate-board-2_json.sh ${UNPACKDIR}/${FW_D_NAME}/${QCS6490_FW_SRC_PATH} board-2.json
ath11k-generate-ahb-board-2_json.sh ${UNPACKDIR}/${FW_D_NAME}/${QCS6490_FW_SRC_PATH} board-2.json
python3 "${STAGING_BINDIR_NATIVE}/ath11k-bdencoder" -c board-2.json -o board-2.bin
}

Expand All @@ -48,6 +49,8 @@ do_install:append() {
install -m 0644 ${UNPACKDIR}/${FW_D_NAME}/${QCS6490_FW_SRC_PATH}/*dsp*.mbn ${D}${FW_QCOM_PATH}
install -m 0644 ${UNPACKDIR}/${FW_D_NAME}/${QCS6490_FW_SRC_PATH}/*dsp*.jsn ${D}${FW_QCOM_PATH}

install -m 0644 ${B}/wpss.mbn ${D}${FW_QCOM_PATH}

install -m 0644 ${UNPACKDIR}/adreno/${ADRENO_PATH}/a660_zap.mbn ${D}${FW_QCOM_PATH}

install -d ${D}${nonarch_base_libdir}/firmware/ath11k/WCN6750/hw1.0/
Expand All @@ -62,10 +65,13 @@ SPLIT_FIRMWARE_PACKAGES = "\
linux-firmware-qcom-${FW_QCOM_NAME}-audio \
linux-firmware-qcom-${FW_QCOM_NAME}-compute \
linux-firmware-qcom-${FW_QCOM_NAME}-adreno \
linux-firmware-qcom-${FW_QCOM_NAME}-wifi \
"

inherit update-alternatives

ALTERNATIVE:${PN} += "wcn6750-hw10-board-2"
ALTERNATIVE_LINK_NAME[wcn6750-hw10-board-2] = "${nonarch_base_libdir}/firmware/ath11k/WCN6750/hw1.0/board-2.bin"
ALTERNATIVE_PRIORITY = "100"

FILES:linux-firmware-qcom-${FW_QCOM_NAME}-wifi = "${FW_QCOM_PATH}/wpss.mbn"
2 changes: 1 addition & 1 deletion recipes-bsp/packagegroups/packagegroup-firmware-rb3gen2.bb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inherit packagegroup
RRECOMMENDS:${PN} += " \
firmware-qcom-rb3gen2 \
${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'linux-firmware-qcom-adreno-a660', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath11k', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'linux-firmware-ath11k linux-firmware-qcom-qcs6490-wifi', '', d)} \
${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'linux-firmware-qca', '', d)} \
linux-firmware-qcom-qcs6490-audio \
linux-firmware-qcom-qcs6490-compute \
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/sh

JSON="$2"

iter=0
echo "[" > "${JSON}"
echo " {" >> "${JSON}"
echo " \"board\": [" >> "${JSON}"
for file in $1/bdwlan.elf $1/bdwlan.e* ; do
iter=$((iter+1))
[ $iter -ne 1 ] && echo " }," >> "${JSON}"

echo " {" >> "${JSON}"
echo " \"data\": \"$file\"," >> "${JSON}"
if [ `basename $file` = "bdwlan.elf" ]; then
file_ext="255"
else
file_ext="$(( $(basename "${file}" | sed -E 's:^.*\.e?([0-9a-f]*)$:0x\1:') ))"
fi
echo " \"names\": [\"bus=ahb,qmi-chip-id=1,qmi-board-id=${file_ext}\"]" >> "${JSON}"
done

echo " }" >> "${JSON}"

if [ -r $1/regdb.bin ] ; then
echo " ]," >> "${JSON}"
echo " \"regdb\": [" >> "${JSON}"
iter=0
for file in $1/bdwlan.elf $1/bdwlan.e* ; do
iter=$((iter+1))
[ $iter -ne 1 ] && echo " }," >> "${JSON}"

echo " {" >> "${JSON}"
echo " \"data\": \"$1/regdb.bin\"," >> "${JSON}"
if [ `basename $file` = "bdwlan.elf" ]; then
file_ext="255"
else
file_ext="$(( $(basename "${file}" | sed -E 's:^.*\.e?([0-9a-f]*)$:0x\1:') ))"
fi
echo " \"names\": [\"bus=ahb,qmi-chip-id=1,qmi-board-id=${file_ext}\"]" >> "${JSON}"
done
echo " }" >> "${JSON}"
fi

echo " ]" >> "${JSON}"
echo " }" >> "${JSON}"
echo "]" >> "${JSON}"

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ SRC_URI = " \
git://github.com/qca/${BPN}.git;branch=master;protocol=https \
file://ath10k-generate-board-2_json.sh \
file://ath10k-generate-pci-board-2_json.sh \
file://ath11k-generate-board-2_json.sh \
file://ath11k-generate-pci-board-2_json.sh \
file://ath11k-generate-ahb-board-2_json.sh \
"

PV = "0.0+${SRCPV}"
Expand All @@ -21,7 +22,8 @@ do_install () {
install -m 0755 tools/scripts/*/* ${D}/${bindir}
install -m 0755 ${UNPACKDIR}/ath10k-generate-board-2_json.sh ${D}/${bindir}
install -m 0755 ${UNPACKDIR}/ath10k-generate-pci-board-2_json.sh ${D}/${bindir}
install -m 0755 ${UNPACKDIR}/ath11k-generate-board-2_json.sh ${D}/${bindir}
install -m 0755 ${UNPACKDIR}/ath11k-generate-pci-board-2_json.sh ${D}/${bindir}
install -m 0755 ${UNPACKDIR}/ath11k-generate-ahb-board-2_json.sh ${D}/${bindir}
}

BBCLASSEXTEND = "native nativesdk"
Expand Down

0 comments on commit adad377

Please sign in to comment.