Skip to content

Commit

Permalink
mac80211: ath11k: Support setting bdf-addr and caldb-addr via DT
Browse files Browse the repository at this point in the history
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@outlook.com>
Signed-off-by: George Moussalem <george.moussalem@outlook.com>
  • Loading branch information
georgemoussalem committed Oct 8, 2024
1 parent 13d08b5 commit 42b0627
Showing 1 changed file with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
From 824dde8652815aa67b4e2bf2d8a9455a8ef82b8f Mon Sep 17 00:00:00 2001
From: hzy <hzyitc@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: hzy <hzyitc@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;

0 comments on commit 42b0627

Please sign in to comment.