Skip to content

Commit c0a0455

Browse files
Ping-Ke ShihKalle Valo
authored andcommitted
wifi: rtw89: 8922a: add 8922A basic chip info
8922A is a 802.11be chip that can support 2/5/6 GHz bands 160MHz bandwidth. Introduce the basic info such as firmware file name, some hardware address and size, supported spatial stream, TX descriptor and so on, and then we can add more attributes by later patches. Signed-off-by: Ping-Ke Shih <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f60df12 commit c0a0455

File tree

4 files changed

+139
-0
lines changed

4 files changed

+139
-0
lines changed

drivers/net/wireless/realtek/rtw89/reg.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4045,6 +4045,12 @@
40454045
#define R_BE_LTR_LATENCY_IDX2_V1 0x361C
40464046
#define R_BE_LTR_LATENCY_IDX3_V1 0x3620
40474047

4048+
#define R_BE_HCI_FUNC_EN 0x7880
4049+
#define B_BE_HCI_CR_PROTECT BIT(31)
4050+
#define B_BE_HCI_TRXBUF_EN BIT(2)
4051+
#define B_BE_HCI_RXDMA_EN BIT(1)
4052+
#define B_BE_HCI_TXDMA_EN BIT(0)
4053+
40484054
#define R_BE_LTR_CTRL_0 0x8410
40494055
#define B_BE_LTR_REQ_FW BIT(18)
40504056
#define B_BE_LTR_IDX_FW_MASK GENMASK(17, 16)
@@ -4975,6 +4981,7 @@
49754981
#define B_SEG0CSI_EN BIT(23)
49764982
#define R_BSS_CLR_MAP 0x43ac
49774983
#define R_BSS_CLR_MAP_V1 0x43B0
4984+
#define R_BSS_CLR_MAP_V2 0x4EB0
49784985
#define B_BSS_CLR_MAP_VLD0 BIT(28)
49794986
#define B_BSS_CLR_MAP_TGT GENMASK(27, 22)
49804987
#define B_BSS_CLR_MAP_STAID GENMASK(21, 11)
@@ -5268,6 +5275,8 @@
52685275
#define R_BMODE_PDTH_EN_V1 0x4B74
52695276
#define R_BMODE_PDTH_EN_V2 0x6718
52705277
#define B_BMODE_PDTH_LIMIT_EN_MSK_V1 BIT(30)
5278+
#define R_BSS_CLR_VLD_V2 0x4EBC
5279+
#define B_BSS_CLR_VLD0_V2 BIT(2)
52715280
#define R_CFO_COMP_SEG1_L 0x5384
52725281
#define R_CFO_COMP_SEG1_H 0x5388
52735282
#define R_CFO_COMP_SEG1_CTRL 0x538C
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
2+
/* Copyright(c) 2023 Realtek Corporation
3+
*/
4+
5+
#include "debug.h"
6+
#include "fw.h"
7+
#include "mac.h"
8+
#include "phy.h"
9+
#include "reg.h"
10+
#include "rtw8922a.h"
11+
12+
#define RTW8922A_FW_FORMAT_MAX 0
13+
#define RTW8922A_FW_BASENAME "rtw89/rtw8922a_fw"
14+
#define RTW8922A_MODULE_FIRMWARE \
15+
RTW8922A_FW_BASENAME ".bin"
16+
17+
#ifdef CONFIG_PM
18+
static const struct wiphy_wowlan_support rtw_wowlan_stub_8922a = {
19+
.flags = WIPHY_WOWLAN_MAGIC_PKT | WIPHY_WOWLAN_DISCONNECT,
20+
.n_patterns = RTW89_MAX_PATTERN_NUM,
21+
.pattern_max_len = RTW89_MAX_PATTERN_SIZE,
22+
.pattern_min_len = 1,
23+
};
24+
#endif
25+
26+
static const struct rtw89_chip_ops rtw8922a_chip_ops = {
27+
};
28+
29+
const struct rtw89_chip_info rtw8922a_chip_info = {
30+
.chip_id = RTL8922A,
31+
.chip_gen = RTW89_CHIP_BE,
32+
.ops = &rtw8922a_chip_ops,
33+
.mac_def = &rtw89_mac_gen_be,
34+
.phy_def = &rtw89_phy_gen_be,
35+
.fw_basename = RTW8922A_FW_BASENAME,
36+
.fw_format_max = RTW8922A_FW_FORMAT_MAX,
37+
.try_ce_fw = false,
38+
.bbmcu_nr = 1,
39+
.needed_fw_elms = RTW89_BE_GEN_DEF_NEEDED_FW_ELEMENTS,
40+
.fifo_size = 589824,
41+
.small_fifo_size = false,
42+
.dle_scc_rsvd_size = 0,
43+
.max_amsdu_limit = 8000,
44+
.dis_2g_40m_ul_ofdma = false,
45+
.rsvd_ple_ofst = 0x8f800,
46+
.rf_base_addr = {0xe000, 0xf000},
47+
.pwr_on_seq = NULL,
48+
.pwr_off_seq = NULL,
49+
.bb_table = NULL,
50+
.bb_gain_table = NULL,
51+
.rf_table = {},
52+
.nctl_table = NULL,
53+
.nctl_post_table = NULL,
54+
.dflt_parms = NULL, /* load parm from fw */
55+
.rfe_parms_conf = NULL, /* load parm from fw */
56+
.txpwr_factor_rf = 2,
57+
.txpwr_factor_mac = 1,
58+
.dig_table = NULL,
59+
.tssi_dbw_table = NULL,
60+
.support_chanctx_num = 1,
61+
.support_bands = BIT(NL80211_BAND_2GHZ) |
62+
BIT(NL80211_BAND_5GHZ) |
63+
BIT(NL80211_BAND_6GHZ),
64+
.support_unii4 = true,
65+
.ul_tb_waveform_ctrl = false,
66+
.ul_tb_pwr_diff = false,
67+
.hw_sec_hdr = true,
68+
.rf_path_num = 2,
69+
.tx_nss = 2,
70+
.rx_nss = 2,
71+
.acam_num = 128,
72+
.bcam_num = 20,
73+
.scam_num = 32,
74+
.bacam_num = 8,
75+
.bacam_dynamic_num = 8,
76+
.bacam_ver = RTW89_BACAM_V1,
77+
.ppdu_max_usr = 16,
78+
.sec_ctrl_efuse_size = 4,
79+
.physical_efuse_size = 0x1300,
80+
.logical_efuse_size = 0x70000,
81+
.limit_efuse_size = 0x40000,
82+
.dav_phy_efuse_size = 0,
83+
.dav_log_efuse_size = 0,
84+
.phycap_addr = 0x1700,
85+
.phycap_size = 0x38,
86+
87+
.ps_mode_supported = BIT(RTW89_PS_MODE_RFOFF) |
88+
BIT(RTW89_PS_MODE_CLK_GATED) |
89+
BIT(RTW89_PS_MODE_PWR_GATED),
90+
.low_power_hci_modes = 0,
91+
.hci_func_en_addr = R_BE_HCI_FUNC_EN,
92+
.h2c_desc_size = sizeof(struct rtw89_rxdesc_short_v2),
93+
.txwd_body_size = sizeof(struct rtw89_txwd_body_v2),
94+
.txwd_info_size = sizeof(struct rtw89_txwd_info_v2),
95+
.cfo_src_fd = true,
96+
.cfo_hw_comp = true,
97+
.dcfo_comp = NULL,
98+
.dcfo_comp_sft = 0,
99+
.imr_info = NULL,
100+
.bss_clr_vld = {R_BSS_CLR_VLD_V2, B_BSS_CLR_VLD0_V2},
101+
.bss_clr_map_reg = R_BSS_CLR_MAP_V2,
102+
.dma_ch_mask = 0,
103+
#ifdef CONFIG_PM
104+
.wowlan_stub = &rtw_wowlan_stub_8922a,
105+
#endif
106+
.xtal_info = NULL,
107+
};
108+
EXPORT_SYMBOL(rtw8922a_chip_info);
109+
110+
MODULE_FIRMWARE(RTW8922A_MODULE_FIRMWARE);
111+
MODULE_AUTHOR("Realtek Corporation");
112+
MODULE_DESCRIPTION("Realtek 802.11be wireless 8922A driver");
113+
MODULE_LICENSE("Dual BSD/GPL");
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2+
/* Copyright(c) 2023 Realtek Corporation
3+
*/
4+
5+
#ifndef __RTW89_8922A_H__
6+
#define __RTW89_8922A_H__
7+
8+
#include "core.h"
9+
10+
#define RF_PATH_NUM_8922A 2
11+
#define BB_PATH_NUM_8922A 2
12+
13+
extern const struct rtw89_chip_info rtw8922a_chip_info;
14+
15+
#endif

drivers/net/wireless/realtek/rtw89/rtw8922ae.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include "pci.h"
99
#include "reg.h"
10+
#include "rtw8922a.h"
1011

1112
static const struct rtw89_pci_info rtw8922a_pci_info = {
1213
.gen_def = &rtw89_pci_gen_be,
@@ -58,6 +59,7 @@ static const struct rtw89_pci_info rtw8922a_pci_info = {
5859
};
5960

6061
static const struct rtw89_driver_info rtw89_8922ae_info = {
62+
.chip = &rtw8922a_chip_info,
6163
.bus = {
6264
.pci = &rtw8922a_pci_info,
6365
},

0 commit comments

Comments
 (0)