From 76271e77fdfbe88bfabab1a8532a5ba53a529201 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 17 Jan 2025 23:19:06 +0800 Subject: [PATCH] ath11k-firmware: add QCN6122 wifi firmware --- package/firmware/ath11k-firmware/Makefile | 14 ++++++++ .../910-ath11k-kernel_6.6-support.patch | 32 +++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 package/kernel/mac80211/patches/ath11k/910-ath11k-kernel_6.6-support.patch diff --git a/package/firmware/ath11k-firmware/Makefile b/package/firmware/ath11k-firmware/Makefile index c2803b46a..2257313b4 100644 --- a/package/firmware/ath11k-firmware/Makefile +++ b/package/firmware/ath11k-firmware/Makefile @@ -47,6 +47,12 @@ $(Package/ath11k-firmware-default) TITLE:=IPQ8074 ath11k firmware endef +define Package/ath11k-firmware-qcn6122 +$(Package/ath11k-firmware-default) + TITLE:=QCN6122 ath11k firmware + DEPENDS:=ath11k-firmware-ipq5018 +endef + define Package/ath11k-firmware-qcn9074 $(Package/ath11k-firmware-default) TITLE:=QCN9074 ath11k firmware @@ -89,6 +95,13 @@ define Package/ath11k-firmware-ipq8074/install $(1)/lib/firmware/IPQ8074/ endef +define Package/ath11k-firmware-qcn6122/install + $(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN6122/hw1.0 + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/ath11k-firmware/IPQ5018_QCN6122_QCN6122/hw1.0/2.7.0.1/WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1/qcn6122/* \ + $(1)/lib/firmware/ath11k/QCN6122/hw1.0/ +endef + define Package/ath11k-firmware-qcn9074/install $(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0 $(INSTALL_DATA) \ @@ -101,4 +114,5 @@ endef $(eval $(call BuildPackage,ath11k-firmware-ipq5018)) $(eval $(call BuildPackage,ath11k-firmware-ipq6018)) $(eval $(call BuildPackage,ath11k-firmware-ipq8074)) +$(eval $(call BuildPackage,ath11k-firmware-qcn6122)) $(eval $(call BuildPackage,ath11k-firmware-qcn9074)) diff --git a/package/kernel/mac80211/patches/ath11k/910-ath11k-kernel_6.6-support.patch b/package/kernel/mac80211/patches/ath11k/910-ath11k-kernel_6.6-support.patch new file mode 100644 index 000000000..2349bf108 --- /dev/null +++ b/package/kernel/mac80211/patches/ath11k/910-ath11k-kernel_6.6-support.patch @@ -0,0 +1,32 @@ +--- a/drivers/net/wireless/ath/ath11k/ahb.c ++++ b/drivers/net/wireless/ath/ath11k/ahb.c +@@ -1008,17 +1008,29 @@ + goto err_iommu_free; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) + ret = iommu_map(iommu_dom, ab_ahb->fw.msa_paddr, + ab_ahb->fw.msa_paddr, ab_ahb->fw.msa_size, + IOMMU_READ | IOMMU_WRITE); ++#else ++ ret = iommu_map(iommu_dom, ab_ahb->fw.msa_paddr, ++ ab_ahb->fw.msa_paddr, ab_ahb->fw.msa_size, ++ IOMMU_READ | IOMMU_WRITE, GFP_KERNEL); ++#endif + if (ret) { + ath11k_err(ab, "failed to map firmware region: %d\n", ret); + goto err_iommu_detach; + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0) + ret = iommu_map(iommu_dom, ab_ahb->fw.ce_paddr, + ab_ahb->fw.ce_paddr, ab_ahb->fw.ce_size, + IOMMU_READ | IOMMU_WRITE); ++#else ++ ret = iommu_map(iommu_dom, ab_ahb->fw.ce_paddr, ++ ab_ahb->fw.ce_paddr, ab_ahb->fw.ce_size, ++ IOMMU_READ | IOMMU_WRITE, GFP_KERNEL); ++#endif + if (ret) { + ath11k_err(ab, "failed to map firmware CE region: %d\n", ret); + goto err_iommu_unmap;