From 4b064f1006c69e045e42b41cbe115cb232e5ed02 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 7 Sep 2024 11:39:07 +0300 Subject: [PATCH 1/4] qca-swiss-army-kinfe: provide AHB board-2.json generation script Existing ath11k-generate-board-2_json.sh generates PCI ids. Add a script to generate AHB-targeted board-2.json. Include regdb.bin if one is provided. Signed-off-by: Dmitry Baryshkov --- .../ath11k-generate-ahb-board-2_json.sh | 48 +++++++++++++++++++ ...sh => ath11k-generate-pci-board-2_json.sh} | 0 .../qca-swiss-army-knife_git.bb | 6 ++- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-ahb-board-2_json.sh rename recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/{ath11k-generate-board-2_json.sh => ath11k-generate-pci-board-2_json.sh} (100%) diff --git a/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-ahb-board-2_json.sh b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-ahb-board-2_json.sh new file mode 100644 index 000000000..bf740bfaf --- /dev/null +++ b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-ahb-board-2_json.sh @@ -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}" + diff --git a/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-pci-board-2_json.sh similarity index 100% rename from recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-board-2_json.sh rename to recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife/ath11k-generate-pci-board-2_json.sh diff --git a/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife_git.bb b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife_git.bb index d519df246..24a04f417 100644 --- a/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife_git.bb +++ b/recipes-devtools/qca-swiss-army-knife/qca-swiss-army-knife_git.bb @@ -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}" @@ -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" From d8a422bc1ed6030e101da73f733c5d7072c1fae6 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 7 Sep 2024 11:42:24 +0300 Subject: [PATCH 2/4] firmware-qcom-rb3gen2: use AHB ids when generating board-2.bin Use AHB rather than PCI ids when generating the board-2.json. This makes the board-2.bin actually useful for the RB3gen2 device. It was unusable otherwise. Signed-off-by: Dmitry Baryshkov --- recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb b/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb index 9724ed56a..eb1b2755e 100644 --- a/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb +++ b/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb @@ -38,7 +38,7 @@ require recipes-bsp/firmware/firmware-qcom-adreno.inc do_compile:append() { # 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 } From 2ae74a48eccf09d281d4c525d6da18cc1f84971c Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 7 Sep 2024 11:43:45 +0300 Subject: [PATCH 3/4] firmware-qcom-rb3gen2: provide WiFi firmware Squash WiFi firmware file and add it to the -wifi firmware package. Signed-off-by: Dmitry Baryshkov --- recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb b/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb index eb1b2755e..702441e09 100644 --- a/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb +++ b/recipes-bsp/firmware/firmware-qcom-rb3gen2_00039.2.bb @@ -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" @@ -37,6 +37,7 @@ 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-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 @@ -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/ @@ -62,6 +65,7 @@ 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 @@ -69,3 +73,5 @@ 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" From e8bcb80dafd896f88e1f2c9df5546e6ce5966124 Mon Sep 17 00:00:00 2001 From: Dmitry Baryshkov Date: Sat, 7 Sep 2024 11:44:46 +0300 Subject: [PATCH 4/4] packagegroup-firmware-rb3gen2: pull in WiFi firmware package Pull the WiFi firmware package to get wpss.mbn installed on the target device. Signed-off-by: Dmitry Baryshkov --- recipes-bsp/packagegroups/packagegroup-firmware-rb3gen2.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes-bsp/packagegroups/packagegroup-firmware-rb3gen2.bb b/recipes-bsp/packagegroups/packagegroup-firmware-rb3gen2.bb index 13b849b3c..f4a8d89c7 100644 --- a/recipes-bsp/packagegroups/packagegroup-firmware-rb3gen2.bb +++ b/recipes-bsp/packagegroups/packagegroup-firmware-rb3gen2.bb @@ -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 \