mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-19 03:43:29 +00:00
ipq807x: ax6/ax3600 use 512M RAM profile
This commit is contained in:
parent
c8468aa59c
commit
6967bf73f0
@ -12,6 +12,7 @@ PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_ATH9K_TX99 \
|
||||
CONFIG_ATH10K_LEDS \
|
||||
CONFIG_ATH10K_THERMAL \
|
||||
CONFIG_ATH11K_MEM_PROFILE_512M \
|
||||
CONFIG_ATH_USER_REGD
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
|
||||
@ -54,6 +55,7 @@ config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
|
||||
config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
|
||||
config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
|
||||
config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
|
||||
config-$(CONFIG_ATH11K_MEM_PROFILE_512M) += ATH11K_MEM_PROFILE_512M
|
||||
|
||||
config-$(call config_package,ath9k-htc) += ATH9K_HTC
|
||||
config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
|
||||
@ -309,6 +311,11 @@ define KernelPackage/ath11k/config
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
default y if TARGET_ipq807x
|
||||
|
||||
config ATH11K_MEM_PROFILE_512M
|
||||
bool "Enable 512MB profile"
|
||||
depends on PACKAGE_kmod-ath11k
|
||||
default y if TARGET_ipq807x_generic_DEVICE_redmi_ax6 || TARGET_ipq807x_generic_DEVICE_xiaomi_ax3600
|
||||
|
||||
endef
|
||||
|
||||
define KernelPackage/ath11k-ahb
|
||||
|
@ -0,0 +1,189 @@
|
||||
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,9 @@ 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);
|
||||
|
||||
@@ -600,6 +603,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);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include "ipq8074.dtsi"
|
||||
#include "ipq8074-ac-cpu.dtsi"
|
||||
#include "ipq8074-ac-nss.dtsi"
|
||||
#include "ipq8074-memory-512m.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
@ -41,6 +42,12 @@
|
||||
linux,code = <KEY_RESTART>;
|
||||
};
|
||||
};
|
||||
|
||||
reserved-memory {
|
||||
/delete-node/ tzapp@4a400000;
|
||||
/delete-node/ q6_etr_dump@50f00000;
|
||||
/delete-node/ m3_dump@51000000;
|
||||
};
|
||||
};
|
||||
|
||||
&tlmm {
|
||||
|
@ -0,0 +1,50 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
|
||||
/* Copyright (C) 2021 AmadeusGhost <amadeus@immortalwrt.org> */
|
||||
|
||||
/ {
|
||||
reserved-memory {
|
||||
#address-cells = <2>;
|
||||
#size-cells = <2>;
|
||||
ranges;
|
||||
|
||||
nss@40000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x40000000 0x0 0x01000000>;
|
||||
};
|
||||
|
||||
uboot@4a600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4a600000 0x0 0x00400000>;
|
||||
};
|
||||
|
||||
sbl@4aa00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4aa00000 0x0 0x00100000>;
|
||||
};
|
||||
|
||||
smem_region: smem@4ab00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ab00000 0x0 0x00100000>;
|
||||
};
|
||||
|
||||
tz@4ac00000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ac00000 0x0 0x00400000>;
|
||||
};
|
||||
|
||||
q6_region: wcnss@4b000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4b000000 0x0 0x03700000>;
|
||||
};
|
||||
|
||||
q6_etr_region: q6_etr_dump@4e700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4e700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
wifi_dump@50500000 {
|
||||
no-map;
|
||||
reg = <0x0 0x50500000 0x0 0x200000>;
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user