mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
189 lines
6.3 KiB
Diff
189 lines
6.3 KiB
Diff
From 1b402e444ff99efe84d09a084b96c39826783a8e Mon Sep 17 00:00:00 2001
|
|
From: Ramya Gnanasekar <rgnanase@codeaurora.org>
|
|
Date: Thu, 10 Sep 2020 13:33:55 +0530
|
|
Subject: [PATCH] ath11k: Enable 512MB profile in ath11k
|
|
|
|
Below changes are made to enable 512MB mem mode in ath11k
|
|
* Makefile changes to implement compilation flag when
|
|
512MB mem profile is configured.
|
|
* Enabling 512MB mem profile by default from Makefile
|
|
for IPQ5018. This can be removed later once
|
|
512MB profile config is supported.
|
|
* Update target_mem_mode, number of stations, peer and vap
|
|
during compile time
|
|
|
|
Signed-off-by: Ramya Gnanasekar <rgnanase@codeaurora.org>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/Kconfig | 7 +++++++
|
|
drivers/net/wireless/ath/ath11k/hw.h | 14 +++++++++++---
|
|
drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
|
|
drivers/net/wireless/ath/ath11k/qmi.h | 6 +++++-
|
|
4 files changed, 24 insertions(+), 5 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/Kconfig
|
|
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
|
|
@@ -60,3 +60,10 @@ config ATH11K_SPECTRAL
|
|
Enable ath11k spectral scan support
|
|
|
|
Say Y to enable access to the FFT/spectral data via debugfs.
|
|
+
|
|
+config ATH11K_MEM_PROFILE_512M
|
|
+ bool "ath11k enable 512MB memory profile"
|
|
+ depends on ATH11K
|
|
+ default n
|
|
+ help
|
|
+ Enables 512MB memory profile for ath11k
|
|
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
|
@@ -9,11 +9,30 @@
|
|
#include "wmi.h"
|
|
|
|
/* Target configuration defines */
|
|
+#ifdef CPTCFG_ATH11K_MEM_PROFILE_512M
|
|
|
|
+#define TARGET_NUM_VDEVS 8
|
|
+#define TARGET_NUM_PEERS_PDEV (128 + TARGET_NUM_VDEVS)
|
|
+/* Max num of stations (per radio) */
|
|
+#define TARGET_NUM_STATIONS 128
|
|
+#define ATH11K_QMI_TARGET_MEM_MODE ATH11K_QMI_TARGET_MEM_MODE_512M
|
|
+#define ATH11K_DP_TX_COMP_RING_SIZE 8192
|
|
+#define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 512
|
|
+#define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 128
|
|
+#define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 128
|
|
+#else
|
|
/* Num VDEVS per radio */
|
|
#define TARGET_NUM_VDEVS (16 + 1)
|
|
|
|
#define TARGET_NUM_PEERS_PDEV (512 + TARGET_NUM_VDEVS)
|
|
+/* Max num of stations (per radio) */
|
|
+#define TARGET_NUM_STATIONS 512
|
|
+#define ATH11K_QMI_TARGET_MEM_MODE ATH11K_QMI_TARGET_MEM_MODE_DEFAULT
|
|
+#define ATH11K_DP_TX_COMP_RING_SIZE 32768
|
|
+#define ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE 1024
|
|
+#define ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE 4096
|
|
+#define ATH11K_DP_RXDMA_MONITOR_DST_RING_SIZE 2048
|
|
+#endif
|
|
|
|
/* Num of peers for Single Radio mode */
|
|
#define TARGET_NUM_PEERS_SINGLE (TARGET_NUM_PEERS_PDEV)
|
|
@@ -24,9 +43,6 @@
|
|
/* Num of peers for DBS_SBS */
|
|
#define TARGET_NUM_PEERS_DBS_SBS (3 * TARGET_NUM_PEERS_PDEV)
|
|
|
|
-/* Max num of stations (per radio) */
|
|
-#define TARGET_NUM_STATIONS 512
|
|
-
|
|
#define TARGET_NUM_PEERS(x) TARGET_NUM_PEERS_##x
|
|
#define TARGET_NUM_PEER_KEYS 2
|
|
#define TARGET_NUM_TIDS(x) (2 * TARGET_NUM_PEERS(x) + \
|
|
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
|
@@ -2675,7 +2675,7 @@ int ath11k_qmi_init_service(struct ath11
|
|
memset(&ab->qmi.target_mem, 0, sizeof(struct target_mem_chunk));
|
|
ab->qmi.ab = ab;
|
|
|
|
- ab->qmi.target_mem_mode = ATH11K_QMI_TARGET_MEM_MODE_DEFAULT;
|
|
+ ab->qmi.target_mem_mode = ATH11K_QMI_TARGET_MEM_MODE;
|
|
ret = qmi_handle_init(&ab->qmi.handle, ATH11K_QMI_RESP_LEN_MAX,
|
|
&ath11k_qmi_ops, ath11k_qmi_msg_handlers);
|
|
if (ret < 0) {
|
|
--- a/drivers/net/wireless/ath/ath11k/qmi.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
|
|
@@ -33,10 +33,14 @@
|
|
|
|
#define QMI_WLANFW_MAX_DATA_SIZE_V01 6144
|
|
#define ATH11K_FIRMWARE_MODE_OFF 4
|
|
-#define ATH11K_QMI_TARGET_MEM_MODE_DEFAULT 0
|
|
|
|
struct ath11k_base;
|
|
|
|
+enum ath11k_target_mem_mode {
|
|
+ ATH11K_QMI_TARGET_MEM_MODE_DEFAULT = 0,
|
|
+ ATH11K_QMI_TARGET_MEM_MODE_512M,
|
|
+};
|
|
+
|
|
enum ath11k_qmi_file_type {
|
|
ATH11K_QMI_FILE_TYPE_BDF_GOLDEN,
|
|
ATH11K_QMI_FILE_TYPE_CALDATA,
|
|
--- a/local-symbols
|
|
+++ b/local-symbols
|
|
@@ -153,6 +153,7 @@ WCN36XX_DEBUGFS=
|
|
ATH11K=
|
|
ATH11K_AHB=
|
|
ATH11K_PCI=
|
|
+ATH11K_MEM_PROFILE_512M=
|
|
ATH11K_DEBUG=
|
|
ATH11K_DEBUGFS=
|
|
ATH11K_TRACING=
|
|
--- a/drivers/net/wireless/ath/ath11k/core.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
|
@@ -734,6 +734,8 @@ struct ath11k_base {
|
|
u32 num_db_cap;
|
|
|
|
struct timer_list mon_reap_timer;
|
|
+ atomic_t num_max_allowed;
|
|
+
|
|
/* must be last */
|
|
u8 drv_priv[0] __aligned(sizeof(void *));
|
|
};
|
|
--- a/drivers/net/wireless/ath/ath11k/dp.h
|
|
+++ b/drivers/net/wireless/ath/ath11k/dp.h
|
|
@@ -174,8 +174,9 @@ struct ath11k_pdev_dp {
|
|
|
|
#define DP_WBM_RELEASE_RING_SIZE 64
|
|
#define DP_TCL_DATA_RING_SIZE 512
|
|
-#define DP_TX_COMP_RING_SIZE 32768
|
|
+#define DP_TX_COMP_RING_SIZE ATH11K_DP_TX_COMP_RING_SIZE
|
|
#define DP_TX_IDR_SIZE DP_TX_COMP_RING_SIZE
|
|
+#define DP_TX_COMP_MAX_ALLOWED ((DP_TX_COMP_RING_SIZE << 1)/3)
|
|
#define DP_TCL_CMD_RING_SIZE 32
|
|
#define DP_TCL_STATUS_RING_SIZE 32
|
|
#define DP_REO_DST_RING_MAX 4
|
|
@@ -188,9 +189,9 @@ struct ath11k_pdev_dp {
|
|
#define DP_RXDMA_BUF_RING_SIZE 4096
|
|
#define DP_RXDMA_REFILL_RING_SIZE 2048
|
|
#define DP_RXDMA_ERR_DST_RING_SIZE 1024
|
|
-#define DP_RXDMA_MON_STATUS_RING_SIZE 1024
|
|
-#define DP_RXDMA_MONITOR_BUF_RING_SIZE 4096
|
|
-#define DP_RXDMA_MONITOR_DST_RING_SIZE 2048
|
|
+#define DP_RXDMA_MON_STATUS_RING_SIZE ATH11K_DP_RXDMA_MON_STATUS_RING_SIZE
|
|
+#define DP_RXDMA_MONITOR_BUF_RING_SIZE ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE
|
|
+#define DP_RXDMA_MONITOR_DST_RING_SIZE ATH11K_DP_RXDMA_MONITOR_BUF_RING_SIZE
|
|
#define DP_RXDMA_MONITOR_DESC_RING_SIZE 4096
|
|
|
|
#define DP_RX_BUFFER_SIZE 2048
|
|
--- a/drivers/net/wireless/ath/ath11k/dp_tx.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
|
|
@@ -262,6 +262,7 @@ tcl_ring_sel:
|
|
skb->data, skb->len);
|
|
|
|
atomic_inc(&ar->dp.num_tx_pending);
|
|
+ atomic_inc(&ab->num_max_allowed);
|
|
|
|
return 0;
|
|
|
|
@@ -308,6 +309,7 @@ static void ath11k_dp_tx_free_txbuf(stru
|
|
ar = ab->pdevs[mac_id].ar;
|
|
if (atomic_dec_and_test(&ar->dp.num_tx_pending))
|
|
wake_up(&ar->dp.tx_empty_waitq);
|
|
+ atomic_dec(&ab->num_max_allowed);
|
|
}
|
|
|
|
static void
|
|
@@ -339,6 +341,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
|
|
|
|
if (atomic_dec_and_test(&ar->dp.num_tx_pending))
|
|
wake_up(&ar->dp.tx_empty_waitq);
|
|
+ atomic_dec(&ab->num_max_allowed);
|
|
|
|
dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
|
|
|
|
@@ -619,6 +622,7 @@ void ath11k_dp_tx_completion_handler(str
|
|
wake_up(&ar->dp.tx_empty_waitq);
|
|
|
|
ath11k_dp_tx_complete_msdu(ar, msdu, &ts);
|
|
+ atomic_dec(&ab->num_max_allowed);
|
|
}
|
|
}
|
|
|