[openwrt/openwrt] mac80211: ath11k: Support setting bdf-addr and caldb-addr via DT

LEDE Commits lede-commits at lists.infradead.org
Thu Feb 6 00:51:27 PST 2025


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/432f2f83decb826df7e20324919a32bd4491f862

commit 432f2f83decb826df7e20324919a32bd4491f862
Author: George Moussalem <george.moussalem at outlook.com>
AuthorDate: Mon Oct 7 15:31:17 2024 +0400

    mac80211: ath11k: Support setting bdf-addr and caldb-addr via DT
    
    IPQ5018 uses different BDF and caldb addresses for vairous boards,
    so let's support reading these addresses from the device tree.
    
    Signed-off-by: Ziyang Huang <hzyitc at outlook.com>
    Signed-off-by: George Moussalem <george.moussalem at outlook.com>
    Link: https://github.com/openwrt/openwrt/pull/17182
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...-Support-setting-bdf-addr-and-caldb-addr-.patch | 62 ++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch b/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch
new file mode 100644
index 0000000000..109daf02f2
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch
@@ -0,0 +1,62 @@
+From 824dde8652815aa67b4e2bf2d8a9455a8ef82b8f Mon Sep 17 00:00:00 2001
+From: Ziyang Huang <hzyitc at outlook.com>
+Date: Thu, 29 Jun 2023 06:12:45 +0000
+Subject: [PATCH] wifi: ath11k: Support setting bdf-addr and caldb-addr via DT
+
+Signed-off-by: Ziyang Huang <hzyitc at outlook.com>
+---
+ drivers/net/wireless/ath/ath11k/qmi.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/qmi.c
++++ b/drivers/net/wireless/ath/ath11k/qmi.c
+@@ -2028,6 +2028,7 @@ static int ath11k_qmi_assign_target_mem_
+ 	struct device_node *hremote_node = NULL;
+ 	struct resource res;
+ 	u32 host_ddr_sz;
++	u32 addr;
+ 	int i, idx, ret;
+ 
+ 	for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) {
+@@ -2067,7 +2068,9 @@ static int ath11k_qmi_assign_target_mem_
+ 			idx++;
+ 			break;
+ 		case BDF_MEM_REGION_TYPE:
+-			ab->qmi.target_mem[idx].paddr = ab->hw_params.bdf_addr;
++			if(of_property_read_u32(dev->of_node, "qcom,bdf-addr", &addr))
++				addr = ab->hw_params.bdf_addr;
++			ab->qmi.target_mem[idx].paddr = addr;
+ 			ab->qmi.target_mem[idx].vaddr = NULL;
+ 			ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size;
+ 			ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type;
+@@ -2089,8 +2092,9 @@ static int ath11k_qmi_assign_target_mem_
+ 					if (!ab->qmi.target_mem[idx].iaddr)
+ 						return -EIO;
+ 				} else {
+-					ab->qmi.target_mem[idx].paddr =
+-						ATH11K_QMI_CALDB_ADDRESS;
++					if(of_property_read_u32(dev->of_node, "qcom,caldb-addr", &addr))
++						addr = ATH11K_QMI_CALDB_ADDRESS;
++					ab->qmi.target_mem[idx].paddr = addr;
+ 				}
+ 			} else {
+ 				ab->qmi.target_mem[idx].paddr = 0;
+@@ -2292,6 +2296,7 @@ static int ath11k_qmi_load_file_target_m
+ 	struct qmi_wlanfw_bdf_download_resp_msg_v01 resp;
+ 	struct qmi_txn txn;
+ 	const u8 *temp = data;
++	u32 addr;
+ 	void __iomem *bdf_addr = NULL;
+ 	int ret = 0;
+ 	u32 remaining = len;
+@@ -2303,7 +2308,9 @@ static int ath11k_qmi_load_file_target_m
+ 	memset(&resp, 0, sizeof(resp));
+ 
+ 	if (ab->hw_params.fixed_bdf_addr) {
+-		bdf_addr = ioremap(ab->hw_params.bdf_addr, ab->hw_params.fw.board_size);
++		if(of_property_read_u32(ab->dev->of_node, "qcom,bdf-addr", &addr))
++			addr = ab->hw_params.bdf_addr;
++		bdf_addr = ioremap(addr, ab->hw_params.fw.board_size);
+ 		if (!bdf_addr) {
+ 			ath11k_warn(ab, "qmi ioremap error for bdf_addr\n");
+ 			ret = -EIO;




More information about the lede-commits mailing list