mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-24 21:02:35 +00:00
172 lines
5.1 KiB
Diff
172 lines
5.1 KiB
Diff
From 21faabb69319073e19b48a531c530216138564dc Mon Sep 17 00:00:00 2001
|
|
From: Anilkumar Kolli <akolli@codeaurora.org>
|
|
Date: Tue, 18 Aug 2020 21:58:16 +0530
|
|
Subject: [PATCH 05/15] ath11k: update msi_config and pci_bus_config
|
|
|
|
update msi_config and pci_bus_config structures, to add multiple
|
|
pci device support.
|
|
|
|
Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/pci.c | 39 ++++++++++++++++++++---------------
|
|
drivers/net/wireless/ath/ath11k/pci.h | 1 +
|
|
2 files changed, 23 insertions(+), 17 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
|
@@ -13,6 +13,7 @@
|
|
#include "hif.h"
|
|
#include "mhi.h"
|
|
#include "debug.h"
|
|
+#include <linux/of.h>
|
|
|
|
#define ATH11K_PCI_BAR_NUM 0
|
|
#define ATH11K_PCI_DMA_MASK 32
|
|
@@ -923,6 +924,7 @@ err_irq_affinity_cleanup:
|
|
static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab)
|
|
{
|
|
struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
|
|
+ int ret, node_id;
|
|
|
|
cfg->tgt_ce = ab->hw_params.target_ce_config;
|
|
cfg->tgt_ce_len = ab->hw_params.target_ce_count;
|
|
@@ -931,6 +933,9 @@ static void ath11k_pci_init_qmi_ce_confi
|
|
cfg->svc_to_ce_map_len = ab->hw_params.svc_to_ce_map_len;
|
|
ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
|
|
|
|
+ ret = of_property_read_u32(ab->dev->of_node, "qrtr_instance_id", &node_id);
|
|
+ if (!ret)
|
|
+ ab->qmi.service_ins_id += node_id;
|
|
ath11k_ce_get_shadow_config(ab, &cfg->shadow_reg_v2,
|
|
&cfg->shadow_reg_v2_len);
|
|
}
|
|
@@ -984,7 +989,7 @@ static int ath11k_pci_alloc_msi(struct a
|
|
num_vectors = pci_alloc_irq_vectors(ab_pci->pdev,
|
|
msi_config->total_vectors,
|
|
msi_config->total_vectors,
|
|
- PCI_IRQ_MSI);
|
|
+ PCI_IRQ_NOMSIX);
|
|
if (num_vectors == msi_config->total_vectors) {
|
|
set_bit(ATH11K_PCI_FLAG_MULTI_MSI_VECTORS, &ab_pci->flags);
|
|
ab_pci->irq_flags = IRQF_SHARED;
|
|
@@ -1158,6 +1163,7 @@ static int ath11k_pci_power_up(struct at
|
|
{
|
|
struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);
|
|
int ret;
|
|
+ u32 addr;
|
|
|
|
ab_pci->register_window = 0;
|
|
clear_bit(ATH11K_PCI_FLAG_INIT_DONE, &ab_pci->flags);
|
|
@@ -1382,6 +1388,14 @@ static int ath11k_pci_probe(struct pci_d
|
|
if (!ret)
|
|
set_bit(ATH11K_FLAG_FIXED_MEM_RGN, &ab->dev_flags);
|
|
|
|
+ /* IPQ8074 reserves memory for FW, ath11k does not need to
|
|
+ * allocate memory for FW in DDR, set fixed_mem_region to true for
|
|
+ * these pltforms supports reserved memory.
|
|
+ */
|
|
+ ret = of_property_read_u32(ab->dev->of_node, "base-addr", &addr);
|
|
+ if (ret == 0)
|
|
+ ab->bus_params.fixed_mem_region = true;
|
|
+
|
|
ret = ath11k_pci_claim(ab_pci, pdev);
|
|
if (ret) {
|
|
ath11k_err(ab, "failed to claim device: %d\n", ret);
|
|
--- a/drivers/net/wireless/ath/ath11k/mhi.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/mhi.c
|
|
@@ -28,6 +28,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = false,
|
|
+ .auto_start = false,
|
|
},
|
|
{
|
|
.num = 1,
|
|
@@ -42,6 +43,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = false,
|
|
+ .auto_start = false,
|
|
},
|
|
{
|
|
.num = 20,
|
|
@@ -56,6 +58,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = false,
|
|
+ .auto_start = true,
|
|
},
|
|
{
|
|
.num = 21,
|
|
@@ -70,6 +73,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = true,
|
|
+ .auto_start = true,
|
|
},
|
|
};
|
|
|
|
@@ -121,6 +125,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = false,
|
|
+ .auto_start = false,
|
|
},
|
|
{
|
|
.num = 1,
|
|
@@ -135,6 +140,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = false,
|
|
+ .auto_start = false,
|
|
},
|
|
{
|
|
.num = 20,
|
|
@@ -149,6 +155,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = false,
|
|
+ .auto_start = true,
|
|
},
|
|
{
|
|
.num = 21,
|
|
@@ -163,6 +170,7 @@ static struct mhi_channel_config ath11k_
|
|
.offload_channel = false,
|
|
.doorbell_mode_switch = false,
|
|
.auto_queue = true,
|
|
+ .auto_start = true,
|
|
},
|
|
};
|
|
|
|
@@ -384,6 +392,10 @@ int ath11k_mhi_register(struct ath11k_pc
|
|
mhi_ctrl->iova_stop = 0xFFFFFFFF;
|
|
}
|
|
|
|
+ ath11k_info(ab, "mhi_ctrl start addr %llx end addr %llx\n",
|
|
+ (u64)mhi_ctrl->iova_start, (u64)mhi_ctrl->iova_stop);
|
|
+
|
|
+
|
|
mhi_ctrl->sbl_size = SZ_512K;
|
|
mhi_ctrl->seg_len = SZ_512K;
|
|
mhi_ctrl->fbc_download = true;
|
|
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
|
@@ -3154,7 +3154,7 @@ static void ath11k_qmi_msg_mem_request_c
|
|
ret);
|
|
return;
|
|
}
|
|
- } else {
|
|
+ } else if (msg->mem_seg_len > 3) {
|
|
ret = ath11k_qmi_alloc_target_mem_chunk(ab);
|
|
if (ret) {
|
|
ath11k_warn(ab, "failed to allocate qmi target memory: %d\n",
|
|
@@ -3324,7 +3324,7 @@ static void ath11k_qmi_driver_event_work
|
|
break;
|
|
}
|
|
|
|
- if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 &&
|
|
+ if (ab->enable_cold_boot_cal && ab->qmi.cal_done == 0 &&
|
|
ab->hw_params.cold_boot_calib) {
|
|
ath11k_qmi_process_coldboot_calibration(ab);
|
|
} else {
|