25d39ddb0d35305056c419d2bcbe0e16971a4f75
[openwrt/staging/wigyori.git] / package / kernel / mac80211 / patches / ath11k / 0019-wifi-ath11k-update-hw-params-for-IPQ5018.patch
1 From 8dfe875aa24aec68baf6702018633c84c2c1feca Mon Sep 17 00:00:00 2001
2 From: Sriram R <quic_srirrama@quicinc.com>
3 Date: Fri, 2 Dec 2022 23:37:13 +0200
4 Subject: [PATCH] wifi: ath11k: update hw params for IPQ5018
5
6 Add new compatible string for IPQ5018 and add
7 required hw params for IPQ5018. The hw descriptors size and
8 datapath ops are similar to QCN9074, hence reuse the same.
9
10 Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
11
12 Signed-off-by: Sriram R <quic_srirrama@quicinc.com>
13 Co-developed-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
14 Signed-off-by: Karthikeyan Kathirvel <quic_kathirve@quicinc.com>
15 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
16 Link: https://lore.kernel.org/r/20221122132152.17771-3-quic_kathirve@quicinc.com
17 ---
18 drivers/net/wireless/ath/ath11k/core.c | 71 ++++++++++++++++++++++++++
19 drivers/net/wireless/ath/ath11k/core.h | 8 +++
20 2 files changed, 79 insertions(+)
21
22 --- a/drivers/net/wireless/ath/ath11k/core.c
23 +++ b/drivers/net/wireless/ath/ath11k/core.c
24 @@ -604,6 +604,77 @@ static const struct ath11k_hw_params ath
25 .smp2p_wow_exit = true,
26 .support_fw_mac_sequence = true,
27 },
28 + {
29 + .hw_rev = ATH11K_HW_IPQ5018_HW10,
30 + .name = "ipq5018 hw1.0",
31 + .fw = {
32 + .dir = "IPQ5018/hw1.0",
33 + .board_size = 256 * 1024,
34 + .cal_offset = 128 * 1024,
35 + },
36 + .max_radios = MAX_RADIOS_5018,
37 + .bdf_addr = 0x4BA00000,
38 + /* hal_desc_sz and hw ops are similar to qcn9074 */
39 + .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
40 + .qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074,
41 + .ring_mask = &ath11k_hw_ring_mask_ipq8074,
42 + .credit_flow = false,
43 + .max_tx_ring = 1,
44 + .spectral = {
45 + .fft_sz = 2,
46 + .fft_pad_sz = 0,
47 + .summary_pad_sz = 16,
48 + .fft_hdr_len = 24,
49 + .max_fft_bins = 1024,
50 + },
51 + .internal_sleep_clock = false,
52 + .host_ce_config = ath11k_host_ce_config_qcn9074,
53 + .ce_count = CE_CNT_5018,
54 + .rxdma1_enable = true,
55 + .num_rxmda_per_pdev = RXDMA_PER_PDEV_5018,
56 + .rx_mac_buf_ring = false,
57 + .vdev_start_delay = false,
58 + .htt_peer_map_v2 = true,
59 + .interface_modes = BIT(NL80211_IFTYPE_STATION) |
60 + BIT(NL80211_IFTYPE_AP) |
61 + BIT(NL80211_IFTYPE_MESH_POINT),
62 + .supports_monitor = false,
63 + .supports_sta_ps = false,
64 + .supports_shadow_regs = false,
65 + .fw_mem_mode = 0,
66 + .num_vdevs = 16 + 1,
67 + .num_peers = 512,
68 + .supports_regdb = false,
69 + .idle_ps = false,
70 + .supports_suspend = false,
71 + .hal_params = &ath11k_hw_hal_params_ipq8074,
72 + .single_pdev_only = false,
73 + .cold_boot_calib = true,
74 + .fix_l1ss = true,
75 + .supports_dynamic_smps_6ghz = false,
76 + .alloc_cacheable_memory = true,
77 + .supports_rssi_stats = false,
78 + .fw_wmi_diag_event = false,
79 + .current_cc_support = false,
80 + .dbr_debug_support = true,
81 + .global_reset = false,
82 + .bios_sar_capa = NULL,
83 + .m3_fw_support = false,
84 + .fixed_bdf_addr = true,
85 + .fixed_mem_region = true,
86 + .static_window_map = false,
87 + .hybrid_bus_type = false,
88 + .fixed_fw_mem = false,
89 + .support_off_channel_tx = false,
90 + .supports_multi_bssid = false,
91 +
92 + .sram_dump = {},
93 +
94 + .tcl_ring_retry = true,
95 + .tx_ring_size = DP_TCL_DATA_RING_SIZE,
96 + .smp2p_wow_exit = false,
97 + .support_fw_mac_sequence = false,
98 + },
99 };
100
101 static inline struct ath11k_pdev *ath11k_core_get_single_pdev(struct ath11k_base *ab)
102 --- a/drivers/net/wireless/ath/ath11k/core.h
103 +++ b/drivers/net/wireless/ath/ath11k/core.h
104 @@ -142,6 +142,7 @@ enum ath11k_hw_rev {
105 ATH11K_HW_WCN6855_HW20,
106 ATH11K_HW_WCN6855_HW21,
107 ATH11K_HW_WCN6750_HW10,
108 + ATH11K_HW_IPQ5018_HW10,
109 };
110
111 enum ath11k_firmware_mode {
112 @@ -230,6 +231,13 @@ struct ath11k_he {
113
114 #define MAX_RADIOS 3
115
116 +/* ipq5018 hw param macros */
117 +#define MAX_RADIOS_5018 1
118 +#define CE_CNT_5018 6
119 +#define TARGET_CE_CNT_5018 9
120 +#define SVC_CE_MAP_LEN_5018 17
121 +#define RXDMA_PER_PDEV_5018 1
122 +
123 enum {
124 WMI_HOST_TP_SCALE_MAX = 0,
125 WMI_HOST_TP_SCALE_50 = 1,