xref: /linux/drivers/net/wireless/realtek/rtw88/reg.h (revision 95dbf14b236f3147f716cd159bd29461916c610e)
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2018-2019  Realtek Corporation
3  */
4 
5 #ifndef __RTW_REG_DEF_H__
6 #define __RTW_REG_DEF_H__
7 
8 #define REG_SYS_FUNC_EN		0x0002
9 #define BIT_FEN_CPUEN		BIT(2)
10 #define BIT_FEN_BB_GLB_RST	BIT(1)
11 #define BIT_FEN_BB_RSTB		BIT(0)
12 #define BIT_R_DIS_PRST		BIT(6)
13 #define BIT_WLOCK_1C_B6		BIT(5)
14 #define REG_SYS_PW_CTRL		0x0004
15 #define REG_SYS_CLK_CTRL	0x0008
16 #define BIT_CPU_CLK_EN		BIT(14)
17 
18 #define REG_RSV_CTRL		0x001C
19 #define DISABLE_PI		0x3
20 #define ENABLE_PI		0x2
21 #define BITS_RFC_DIRECT		(BIT(31) | BIT(30))
22 #define BIT_WLMCU_IOIF		BIT(0)
23 #define REG_RF_CTRL		0x001F
24 #define BIT_RF_SDM_RSTB		BIT(2)
25 #define BIT_RF_RSTB		BIT(1)
26 #define BIT_RF_EN		BIT(0)
27 
28 #define REG_AFE_CTRL1		0x0024
29 #define BIT_MAC_CLK_SEL		(BIT(20) | BIT(21))
30 #define REG_EFUSE_CTRL		0x0030
31 #define BIT_EF_FLAG		BIT(31)
32 #define BIT_SHIFT_EF_ADDR	8
33 #define BIT_MASK_EF_ADDR	0x3ff
34 #define BIT_MASK_EF_DATA	0xff
35 #define BITS_EF_ADDR		(BIT_MASK_EF_ADDR << BIT_SHIFT_EF_ADDR)
36 
37 #define REG_LDO_EFUSE_CTRL	0x0034
38 #define BIT_MASK_EFUSE_BANK_SEL	(BIT(8) | BIT(9))
39 
40 #define REG_GPIO_MUXCFG		0x0040
41 #define BIT_FSPI_EN		BIT(19)
42 #define BIT_BT_AOD_GPIO3	BIT(9)
43 #define BIT_BT_PTA_EN		BIT(5)
44 #define BIT_WLRFE_4_5_EN	BIT(2)
45 
46 #define REG_LED_CFG		0x004C
47 #define BIT_LNAON_SEL_EN	BIT(26)
48 #define BIT_PAPE_SEL_EN		BIT(25)
49 #define BIT_DPDT_WL_SEL		BIT(24)
50 #define BIT_DPDT_SEL_EN		BIT(23)
51 #define REG_PAD_CTRL1		0x0064
52 #define BIT_PAPE_WLBT_SEL	BIT(29)
53 #define BIT_LNAON_WLBT_SEL	BIT(28)
54 #define BIT_BTGP_JTAG_EN	BIT(24)
55 #define BIT_BTGP_SPI_EN		BIT(20)
56 #define BIT_LED1DIS		BIT(15)
57 #define BIT_SW_DPDT_SEL_DATA	BIT(0)
58 #define REG_WL_BT_PWR_CTRL	0x0068
59 #define BIT_BT_FUNC_EN		BIT(18)
60 #define BIT_BT_DIG_CLK_EN	BIT(8)
61 #define REG_SYS_SDIO_CTRL	0x0070
62 #define BIT_DBG_GNT_WL_BT	BIT(27)
63 #define BIT_LTE_MUX_CTRL_PATH	BIT(26)
64 #define REG_HCI_OPT_CTRL	0x0074
65 
66 #define REG_MCUFW_CTRL		0x0080
67 #define BIT_ANA_PORT_EN		BIT(22)
68 #define BIT_MAC_PORT_EN		BIT(21)
69 #define BIT_BOOT_FSPI_EN	BIT(20)
70 #define BIT_FW_INIT_RDY		BIT(15)
71 #define BIT_FW_DW_RDY		BIT(14)
72 #define BIT_RPWM_TOGGLE		BIT(7)
73 #define BIT_DMEM_CHKSUM_OK	BIT(6)
74 #define BIT_DMEM_DW_OK		BIT(5)
75 #define BIT_IMEM_CHKSUM_OK	BIT(4)
76 #define BIT_IMEM_DW_OK		BIT(3)
77 #define BIT_IMEM_BOOT_LOAD_CHECKSUM_OK BIT(2)
78 #define BIT_MCUFWDL_EN		BIT(0)
79 #define BIT_CHECK_SUM_OK	(BIT(4) | BIT(6))
80 #define FW_READY		(BIT_FW_INIT_RDY | BIT_FW_DW_RDY |             \
81 				 BIT_IMEM_DW_OK | BIT_DMEM_DW_OK |             \
82 				 BIT_CHECK_SUM_OK)
83 #define FW_READY_MASK		0xffff
84 
85 #define REG_WLRF1		0x00EC
86 #define REG_WIFI_BT_INFO	0x00AA
87 #define BIT_BT_INT_EN		BIT(15)
88 #define REG_SYS_CFG1		0x00F0
89 #define	BIT_RTL_ID		BIT(23)
90 #define BIT_RF_TYPE_ID		BIT(27)
91 #define BIT_SHIFT_VENDOR_ID	16
92 #define BIT_MASK_VENDOR_ID	0xf
93 #define BIT_VENDOR_ID(x) (((x) & BIT_MASK_VENDOR_ID) << BIT_SHIFT_VENDOR_ID)
94 #define BITS_VENDOR_ID		(BIT_MASK_VENDOR_ID << BIT_SHIFT_VENDOR_ID)
95 #define BIT_CLEAR_VENDOR_ID(x)	((x) & (~BITS_VENDOR_ID))
96 #define BIT_GET_VENDOR_ID(x) (((x) >> BIT_SHIFT_VENDOR_ID) & BIT_MASK_VENDOR_ID)
97 #define BIT_SHIFT_CHIP_VER	12
98 #define BIT_MASK_CHIP_VER	0xf
99 #define BIT_CHIP_VER(x)	 (((x) & BIT_MASK_CHIP_VER) << BIT_SHIFT_CHIP_VER)
100 #define BITS_CHIP_VER		(BIT_MASK_CHIP_VER << BIT_SHIFT_CHIP_VER)
101 #define BIT_CLEAR_CHIP_VER(x)	((x) & (~BITS_CHIP_VER))
102 #define BIT_GET_CHIP_VER(x) (((x) >> BIT_SHIFT_CHIP_VER) & BIT_MASK_CHIP_VER)
103 #define REG_SYS_STATUS1		0x00F4
104 #define REG_SYS_STATUS2		0x00F8
105 #define REG_SYS_CFG2		0x00FC
106 #define REG_WLRF1		0x00EC
107 #define BIT_WLRF1_BBRF_EN	(BIT(24) | BIT(25) | BIT(26))
108 #define REG_CR			0x0100
109 #define BIT_32K_CAL_TMR_EN	BIT(10)
110 #define BIT_MAC_SEC_EN		BIT(9)
111 #define BIT_ENSWBCN		BIT(8)
112 #define BIT_MACRXEN		BIT(7)
113 #define BIT_MACTXEN		BIT(6)
114 #define BIT_SCHEDULE_EN		BIT(5)
115 #define BIT_PROTOCOL_EN		BIT(4)
116 #define BIT_RXDMA_EN		BIT(3)
117 #define BIT_TXDMA_EN		BIT(2)
118 #define BIT_HCI_RXDMA_EN	BIT(1)
119 #define BIT_HCI_TXDMA_EN	BIT(0)
120 #define MAC_TRX_ENABLE	(BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \
121 			BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \
122 			BIT_MACTXEN | BIT_MACRXEN)
123 #define BIT_SHIFT_TXDMA_VOQ_MAP	4
124 #define BIT_MASK_TXDMA_VOQ_MAP	0x3
125 #define BIT_TXDMA_VOQ_MAP(x)                                                   \
126 	(((x) & BIT_MASK_TXDMA_VOQ_MAP) << BIT_SHIFT_TXDMA_VOQ_MAP)
127 #define BIT_SHIFT_TXDMA_VIQ_MAP	6
128 #define BIT_MASK_TXDMA_VIQ_MAP	0x3
129 #define BIT_TXDMA_VIQ_MAP(x)                                                   \
130 	(((x) & BIT_MASK_TXDMA_VIQ_MAP) << BIT_SHIFT_TXDMA_VIQ_MAP)
131 #define REG_TXDMA_PQ_MAP	0x010C
132 #define BIT_SHIFT_TXDMA_BEQ_MAP	8
133 #define BIT_MASK_TXDMA_BEQ_MAP	0x3
134 #define BIT_TXDMA_BEQ_MAP(x)                                                   \
135 	(((x) & BIT_MASK_TXDMA_BEQ_MAP) << BIT_SHIFT_TXDMA_BEQ_MAP)
136 #define BIT_SHIFT_TXDMA_BKQ_MAP	10
137 #define BIT_MASK_TXDMA_BKQ_MAP	0x3
138 #define BIT_TXDMA_BKQ_MAP(x)                                                   \
139 	(((x) & BIT_MASK_TXDMA_BKQ_MAP) << BIT_SHIFT_TXDMA_BKQ_MAP)
140 #define BIT_SHIFT_TXDMA_MGQ_MAP	12
141 #define BIT_MASK_TXDMA_MGQ_MAP	0x3
142 #define BIT_TXDMA_MGQ_MAP(x)                                                   \
143 	(((x) & BIT_MASK_TXDMA_MGQ_MAP) << BIT_SHIFT_TXDMA_MGQ_MAP)
144 #define BIT_SHIFT_TXDMA_HIQ_MAP	14
145 #define BIT_MASK_TXDMA_HIQ_MAP	0x3
146 #define BIT_TXDMA_HIQ_MAP(x)                                                   \
147 	(((x) & BIT_MASK_TXDMA_HIQ_MAP) << BIT_SHIFT_TXDMA_HIQ_MAP)
148 #define BIT_SHIFT_TXSC_40M	4
149 #define BIT_MASK_TXSC_40M	0xf
150 #define BIT_TXSC_40M(x)							       \
151 	(((x) & BIT_MASK_TXSC_40M) << BIT_SHIFT_TXSC_40M)
152 #define BIT_SHIFT_TXSC_20M	0
153 #define BIT_MASK_TXSC_20M	0xf
154 #define BIT_TXSC_20M(x)							       \
155 	(((x) & BIT_MASK_TXSC_20M) << BIT_SHIFT_TXSC_20M)
156 #define BIT_SHIFT_MAC_CLK_SEL	20
157 #define MAC_CLK_HW_DEF_80M	0
158 #define MAC_CLK_HW_DEF_40M	1
159 #define MAC_CLK_HW_DEF_20M	2
160 #define MAC_CLK_SPEED		80
161 
162 #define REG_CR			0x0100
163 #define REG_TRXFF_BNDY		0x0114
164 #define REG_RXFF_BNDY		0x011C
165 #define REG_FE1IMR		0x0120
166 #define BIT_FS_RXDONE		BIT(16)
167 #define REG_PKTBUF_DBG_CTRL	0x0140
168 #define REG_C2HEVT		0x01A0
169 #define REG_MCUTST_II		0x01C4
170 #define REG_WOWLAN_WAKE_REASON	0x01C7
171 #define REG_HMETFR		0x01CC
172 #define REG_HMEBOX0		0x01D0
173 #define REG_HMEBOX1		0x01D4
174 #define REG_HMEBOX2		0x01D8
175 #define REG_HMEBOX3		0x01DC
176 #define REG_HMEBOX0_EX		0x01F0
177 #define REG_HMEBOX1_EX		0x01F4
178 #define REG_HMEBOX2_EX		0x01F8
179 #define REG_HMEBOX3_EX		0x01FC
180 
181 #define REG_FIFOPAGE_CTRL_2	0x0204
182 #define BIT_BCN_VALID_V1	BIT(15)
183 #define BIT_MASK_BCN_HEAD_1_V1	0xfff
184 #define REG_AUTO_LLT_V1		0x0208
185 #define BIT_AUTO_INIT_LLT_V1	BIT(0)
186 #define REG_TXDMA_OFFSET_CHK	0x020C
187 #define REG_TXDMA_STATUS	0x0210
188 #define BTI_PAGE_OVF		BIT(2)
189 #define REG_RQPN_CTRL_1		0x0228
190 #define REG_RQPN_CTRL_2		0x022C
191 #define BIT_LD_RQPN		BIT(31)
192 #define REG_FIFOPAGE_INFO_1	0x0230
193 #define REG_FIFOPAGE_INFO_2	0x0234
194 #define REG_FIFOPAGE_INFO_3	0x0238
195 #define REG_FIFOPAGE_INFO_4	0x023C
196 #define REG_FIFOPAGE_INFO_5	0x0240
197 #define REG_H2C_HEAD		0x0244
198 #define REG_H2C_TAIL		0x0248
199 #define REG_H2C_READ_ADDR	0x024C
200 #define REG_H2C_INFO		0x0254
201 #define REG_RXPKT_NUM		0x0284
202 #define BIT_RXDMA_REQ		BIT(19)
203 #define BIT_RW_RELEASE		BIT(18)
204 #define BIT_RXDMA_IDLE		BIT(17)
205 #define REG_RXPKTNUM		0x02B0
206 
207 #define REG_INT_MIG		0x0304
208 #define REG_HCI_MIX_CFG		0x03FC
209 #define BIT_PCIE_EMAC_PDN_AUX_TO_FAST_CLK BIT(26)
210 
211 #define REG_BCNQ_INFO		0x0418
212 #define BIT_MGQ_CPU_EMPTY	BIT(24)
213 #define REG_FWHW_TXQ_CTRL	0x0420
214 #define BIT_EN_BCNQ_DL		BIT(22)
215 #define BIT_EN_WR_FREE_TAIL	BIT(20)
216 #define REG_BCNQ_BDNY_V1	0x0424
217 #define REG_LIFETIME_EN		0x0426
218 #define BIT_BA_PARSER_EN	BIT(5)
219 #define REG_SPEC_SIFS		0x0428
220 #define REG_RETRY_LIMIT		0x042a
221 #define REG_DARFRC		0x0430
222 #define REG_DARFRCH		0x0434
223 #define REG_RARFRCH		0x043C
224 #define REG_ARFR0		0x0444
225 #define REG_ARFRH0		0x0448
226 #define REG_ARFR1_V1		0x044C
227 #define REG_ARFRH1_V1		0x0450
228 #define REG_CCK_CHECK		0x0454
229 #define BIT_CHECK_CCK_EN	BIT(7)
230 #define REG_AMPDU_MAX_TIME_V1	0x0455
231 #define REG_BCNQ1_BDNY_V1	0x0456
232 #define REG_TX_HANG_CTRL	0x045E
233 #define BIT_EN_GNT_BT_AWAKE	BIT(3)
234 #define BIT_EN_EOF_V1		BIT(2)
235 #define REG_DATA_SC		0x0483
236 #define REG_ARFR4		0x049C
237 #define BIT_WL_RFK		BIT(0)
238 #define REG_ARFRH4		0x04A0
239 #define REG_ARFR5		0x04A4
240 #define REG_ARFRH5		0x04A8
241 #define REG_SW_AMPDU_BURST_MODE_CTRL 0x04BC
242 #define BIT_PRE_TX_CMD		BIT(6)
243 #define REG_QUEUE_CTRL		0x04C6
244 #define BIT_PTA_WL_TX_EN	BIT(4)
245 #define BIT_PTA_EDCCA_EN	BIT(5)
246 #define REG_PROT_MODE_CTRL	0x04C8
247 #define REG_BAR_MODE_CTRL	0x04CC
248 #define REG_PRECNT_CTRL		0x04E5
249 #define BIT_BTCCA_CTRL		(BIT(0) | BIT(1))
250 #define BIT_EN_PRECNT		BIT(11)
251 #define REG_DUMMY_PAGE4_V1	0x04FC
252 
253 #define REG_EDCA_VO_PARAM	0x0500
254 #define REG_EDCA_VI_PARAM	0x0504
255 #define REG_EDCA_BE_PARAM	0x0508
256 #define REG_EDCA_BK_PARAM	0x050C
257 #define BIT_MASK_TXOP_LMT	GENMASK(26, 16)
258 #define BIT_MASK_CWMAX		GENMASK(15, 12)
259 #define BIT_MASK_CWMIN		GENMASK(11, 8)
260 #define BIT_MASK_AIFS		GENMASK(7, 0)
261 #define REG_PIFS		0x0512
262 #define REG_SIFS		0x0514
263 #define BIT_SHIFT_SIFS_OFDM_CTX	8
264 #define BIT_SHIFT_SIFS_CCK_TRX	16
265 #define BIT_SHIFT_SIFS_OFDM_TRX	24
266 #define REG_SLOT		0x051B
267 #define REG_TX_PTCL_CTRL	0x0520
268 #define BIT_SIFS_BK_EN		BIT(12)
269 #define REG_TXPAUSE		0x0522
270 #define REG_RD_CTRL		0x0524
271 #define BIT_DIS_TXOP_CFE	BIT(10)
272 #define BIT_DIS_LSIG_CFE	BIT(9)
273 #define BIT_DIS_STBC_CFE	BIT(8)
274 #define REG_TBTT_PROHIBIT	0x0540
275 #define BIT_SHIFT_TBTT_HOLD_TIME_AP 8
276 #define REG_RD_NAV_NXT		0x0544
277 #define REG_BCN_CTRL		0x0550
278 #define BIT_DIS_TSF_UDT		BIT(4)
279 #define BIT_EN_BCN_FUNCTION	BIT(3)
280 #define REG_BCN_CTRL_CLINT0	0x0551
281 #define REG_DRVERLYINT		0x0558
282 #define REG_BCNDMATIM		0x0559
283 #define REG_USTIME_TSF		0x055C
284 #define REG_BCN_MAX_ERR		0x055D
285 #define REG_RXTSF_OFFSET_CCK	0x055E
286 #define REG_MISC_CTRL		0x0577
287 #define BIT_EN_FREE_CNT		BIT(3)
288 #define BIT_DIS_SECOND_CCA	(BIT(0) | BIT(1))
289 #define REG_TIMER0_SRC_SEL	0x05B4
290 #define BIT_TSFT_SEL_TIMER0	(BIT(4) | BIT(5) | BIT(6))
291 
292 #define REG_TCR			0x0604
293 #define BIT_PWRMGT_HWDATA_EN	BIT(7)
294 #define REG_RCR			0x0608
295 #define BIT_APP_FCS		BIT(31)
296 #define BIT_APP_MIC		BIT(30)
297 #define BIT_APP_ICV		BIT(29)
298 #define BIT_APP_PHYSTS		BIT(28)
299 #define BIT_APP_BASSN		BIT(27)
300 #define BIT_VHT_DACK		BIT(26)
301 #define BIT_TCPOFLD_EN		BIT(25)
302 #define BIT_ENMBID		BIT(24)
303 #define BIT_LSIGEN		BIT(23)
304 #define BIT_MFBEN		BIT(22)
305 #define BIT_DISCHKPPDLLEN	BIT(21)
306 #define BIT_PKTCTL_DLEN		BIT(20)
307 #define BIT_TIM_PARSER_EN	BIT(18)
308 #define BIT_BC_MD_EN		BIT(17)
309 #define BIT_UC_MD_EN		BIT(16)
310 #define BIT_RXSK_PERPKT		BIT(15)
311 #define BIT_HTC_LOC_CTRL	BIT(14)
312 #define BIT_RPFM_CAM_ENABLE	BIT(12)
313 #define BIT_TA_BCN		BIT(11)
314 #define BIT_DISDECMYPKT		BIT(10)
315 #define BIT_AICV		BIT(9)
316 #define BIT_ACRC32		BIT(8)
317 #define BIT_CBSSID_BCN		BIT(7)
318 #define BIT_CBSSID_DATA		BIT(6)
319 #define BIT_APWRMGT		BIT(5)
320 #define BIT_ADD3		BIT(4)
321 #define BIT_AB			BIT(3)
322 #define BIT_AM			BIT(2)
323 #define BIT_APM			BIT(1)
324 #define BIT_AAP			BIT(0)
325 #define REG_RX_PKT_LIMIT	0x060C
326 #define REG_RX_DRVINFO_SZ	0x060F
327 #define BIT_APP_PHYSTS		BIT(28)
328 #define REG_MAR			0x0620
329 #define REG_USTIME_EDCA		0x0638
330 #define REG_ACKTO_CCK		0x0639
331 #define REG_RESP_SIFS_CCK	0x063C
332 #define REG_RESP_SIFS_OFDM	0x063E
333 #define REG_ACKTO		0x0640
334 #define REG_EIFS		0x0642
335 #define REG_NAV_CTRL		0x0650
336 #define REG_WMAC_TRXPTCL_CTL	0x0668
337 #define BIT_RFMOD		(BIT(7) | BIT(8))
338 #define BIT_RFMOD_80M		BIT(8)
339 #define BIT_RFMOD_40M		BIT(7)
340 #define REG_WMAC_TRXPTCL_CTL_H	0x066C
341 #define REG_WKFMCAM_CMD		0x0698
342 #define BIT_WKFCAM_POLLING_V1	BIT(31)
343 #define BIT_WKFCAM_CLR_V1	BIT(30)
344 #define BIT_WKFCAM_WE		BIT(16)
345 #define BIT_SHIFT_WKFCAM_ADDR_V2	8
346 #define BIT_MASK_WKFCAM_ADDR_V2		0xff
347 #define BIT_WKFCAM_ADDR_V2(x)						       \
348 	(((x) & BIT_MASK_WKFCAM_ADDR_V2) << BIT_SHIFT_WKFCAM_ADDR_V2)
349 #define REG_WKFMCAM_RWD         0x069C
350 #define BIT_WKFMCAM_VALID	BIT(31)
351 #define BIT_WKFMCAM_BC		BIT(26)
352 #define BIT_WKFMCAM_MC		BIT(25)
353 #define BIT_WKFMCAM_UC		BIT(24)
354 
355 #define REG_RXFLTMAP0		0x06A0
356 #define REG_RXFLTMAP1		0x06A2
357 #define REG_RXFLTMAP2		0x06A4
358 #define REG_RXFLTMAP4		0x068A
359 #define REG_BT_COEX_TABLE0	0x06C0
360 #define REG_BT_COEX_TABLE1	0x06C4
361 #define REG_BT_COEX_BRK_TABLE	0x06C8
362 #define REG_BT_COEX_TABLE_H	0x06CC
363 #define REG_BT_COEX_TABLE_H1	0x06CD
364 #define REG_BT_COEX_TABLE_H2	0x06CE
365 #define REG_BT_COEX_TABLE_H3	0x06CF
366 #define REG_BBPSF_CTRL		0x06DC
367 
368 #define REG_BT_COEX_V2		0x0763
369 #define BIT_GNT_BT_POLARITY	BIT(4)
370 #define BIT_LTE_COEX_EN		BIT(7)
371 #define REG_BT_STAT_CTRL	0x0778
372 #define REG_BT_TDMA_TIME	0x0790
373 #define REG_WMAC_OPTION_FUNCTION 0x07D0
374 #define REG_WMAC_OPTION_FUNCTION_1 0x07D4
375 
376 #define REG_RX_GAIN_EN		0x081c
377 
378 #define REG_RFE_CTRL_E		0x0974
379 
380 #define REG_DIS_DPD		0x0a70
381 #define DIS_DPD_MASK		GENMASK(9, 0)
382 #define DIS_DPD_RATE6M		BIT(0)
383 #define DIS_DPD_RATE9M		BIT(1)
384 #define DIS_DPD_RATEMCS0	BIT(2)
385 #define DIS_DPD_RATEMCS1	BIT(3)
386 #define DIS_DPD_RATEMCS8	BIT(4)
387 #define DIS_DPD_RATEMCS9	BIT(5)
388 #define DIS_DPD_RATEVHT1SS_MCS0	BIT(6)
389 #define DIS_DPD_RATEVHT1SS_MCS1	BIT(7)
390 #define DIS_DPD_RATEVHT2SS_MCS0	BIT(8)
391 #define DIS_DPD_RATEVHT2SS_MCS1	BIT(9)
392 #define DIS_DPD_RATEALL		GENMASK(9, 0)
393 
394 #define REG_RFE_CTRL8		0x0cb4
395 #define BIT_MASK_RFE_SEL89	GENMASK(7, 0)
396 #define REG_RFE_INV8		0x0cbd
397 #define BIT_MASK_RFE_INV89	GENMASK(1, 0)
398 #define REG_RFE_INV16		0x0cbe
399 #define BIT_RFE_BUF_EN		BIT(3)
400 
401 #define REG_ANAPAR_XTAL_0	0x1040
402 #define REG_CPU_DMEM_CON	0x1080
403 #define BIT_WL_PLATFORM_RST	BIT(16)
404 #define BIT_WL_SECURITY_CLK	BIT(15)
405 #define BIT_DDMA_EN		BIT(8)
406 
407 #define REG_H2C_PKT_READADDR	0x10D0
408 #define REG_H2C_PKT_WRITEADDR	0x10D4
409 #define REG_FW_DBG7		0x10FC
410 #define FW_KEY_MASK		0xffffff00
411 
412 #define REG_CR_EXT		0x1100
413 
414 #define REG_DDMA_CH0SA		0x1200
415 #define REG_DDMA_CH0DA		0x1204
416 #define REG_DDMA_CH0CTRL	0x1208
417 #define BIT_DDMACH0_OWN		BIT(31)
418 #define BIT_DDMACH0_CHKSUM_EN	BIT(29)
419 #define BIT_DDMACH0_CHKSUM_STS	BIT(27)
420 #define BIT_DDMACH0_RESET_CHKSUM_STS BIT(25)
421 #define BIT_DDMACH0_CHKSUM_CONT	BIT(24)
422 #define BIT_MASK_DDMACH0_DLEN	0x3ffff
423 
424 #define REG_H2CQ_CSR		0x1330
425 #define BIT_H2CQ_FULL		BIT(31)
426 #define REG_FAST_EDCA_VOVI_SETTING 0x1448
427 #define REG_FAST_EDCA_BEBK_SETTING 0x144C
428 
429 #define REG_RXPSF_CTRL		0x1610
430 #define BIT_RXGCK_FIFOTHR_EN	BIT(28)
431 
432 #define BIT_SHIFT_RXGCK_VHT_FIFOTHR 26
433 #define BIT_MASK_RXGCK_VHT_FIFOTHR 0x3
434 #define BIT_RXGCK_VHT_FIFOTHR(x)                                               \
435 	(((x) & BIT_MASK_RXGCK_VHT_FIFOTHR) << BIT_SHIFT_RXGCK_VHT_FIFOTHR)
436 #define BITS_RXGCK_VHT_FIFOTHR                                                 \
437 	(BIT_MASK_RXGCK_VHT_FIFOTHR << BIT_SHIFT_RXGCK_VHT_FIFOTHR)
438 
439 #define BIT_SHIFT_RXGCK_HT_FIFOTHR 24
440 #define BIT_MASK_RXGCK_HT_FIFOTHR 0x3
441 #define BIT_RXGCK_HT_FIFOTHR(x)                                                \
442 	(((x) & BIT_MASK_RXGCK_HT_FIFOTHR) << BIT_SHIFT_RXGCK_HT_FIFOTHR)
443 #define BITS_RXGCK_HT_FIFOTHR                                                  \
444 	(BIT_MASK_RXGCK_HT_FIFOTHR << BIT_SHIFT_RXGCK_HT_FIFOTHR)
445 
446 #define BIT_SHIFT_RXGCK_OFDM_FIFOTHR 22
447 #define BIT_MASK_RXGCK_OFDM_FIFOTHR 0x3
448 #define BIT_RXGCK_OFDM_FIFOTHR(x)                                              \
449 	(((x) & BIT_MASK_RXGCK_OFDM_FIFOTHR) << BIT_SHIFT_RXGCK_OFDM_FIFOTHR)
450 #define BITS_RXGCK_OFDM_FIFOTHR                                                \
451 	(BIT_MASK_RXGCK_OFDM_FIFOTHR << BIT_SHIFT_RXGCK_OFDM_FIFOTHR)
452 
453 #define BIT_SHIFT_RXGCK_CCK_FIFOTHR 20
454 #define BIT_MASK_RXGCK_CCK_FIFOTHR 0x3
455 #define BIT_RXGCK_CCK_FIFOTHR(x)                                               \
456 	(((x) & BIT_MASK_RXGCK_CCK_FIFOTHR) << BIT_SHIFT_RXGCK_CCK_FIFOTHR)
457 #define BITS_RXGCK_CCK_FIFOTHR                                                 \
458 	(BIT_MASK_RXGCK_CCK_FIFOTHR << BIT_SHIFT_RXGCK_CCK_FIFOTHR)
459 
460 #define BIT_RXGCK_OFDMCCA_EN BIT(16)
461 
462 #define BIT_SHIFT_RXPSF_PKTLENTHR 13
463 #define BIT_MASK_RXPSF_PKTLENTHR 0x7
464 #define BIT_RXPSF_PKTLENTHR(x)                                                 \
465 	(((x) & BIT_MASK_RXPSF_PKTLENTHR) << BIT_SHIFT_RXPSF_PKTLENTHR)
466 #define BITS_RXPSF_PKTLENTHR                                                   \
467 	(BIT_MASK_RXPSF_PKTLENTHR << BIT_SHIFT_RXPSF_PKTLENTHR)
468 #define BIT_CLEAR_RXPSF_PKTLENTHR(x) ((x) & (~BITS_RXPSF_PKTLENTHR))
469 #define BIT_SET_RXPSF_PKTLENTHR(x, v)                                          \
470 	(BIT_CLEAR_RXPSF_PKTLENTHR(x) | BIT_RXPSF_PKTLENTHR(v))
471 
472 #define BIT_RXPSF_CTRLEN	BIT(12)
473 #define BIT_RXPSF_VHTCHKEN	BIT(11)
474 #define BIT_RXPSF_HTCHKEN	BIT(10)
475 #define BIT_RXPSF_OFDMCHKEN	BIT(9)
476 #define BIT_RXPSF_CCKCHKEN	BIT(8)
477 #define BIT_RXPSF_OFDMRST	BIT(7)
478 #define BIT_RXPSF_CCKRST	BIT(6)
479 #define BIT_RXPSF_MHCHKEN	BIT(5)
480 #define BIT_RXPSF_CONT_ERRCHKEN	BIT(4)
481 #define BIT_RXPSF_ALL_ERRCHKEN	BIT(3)
482 
483 #define BIT_SHIFT_RXPSF_ERRTHR 0
484 #define BIT_MASK_RXPSF_ERRTHR 0x7
485 #define BIT_RXPSF_ERRTHR(x)                                                    \
486 	(((x) & BIT_MASK_RXPSF_ERRTHR) << BIT_SHIFT_RXPSF_ERRTHR)
487 #define BITS_RXPSF_ERRTHR (BIT_MASK_RXPSF_ERRTHR << BIT_SHIFT_RXPSF_ERRTHR)
488 #define BIT_CLEAR_RXPSF_ERRTHR(x) ((x) & (~BITS_RXPSF_ERRTHR))
489 #define BIT_GET_RXPSF_ERRTHR(x)                                                \
490 	(((x) >> BIT_SHIFT_RXPSF_ERRTHR) & BIT_MASK_RXPSF_ERRTHR)
491 #define BIT_SET_RXPSF_ERRTHR(x, v)                                             \
492 	(BIT_CLEAR_RXPSF_ERRTHR(x) | BIT_RXPSF_ERRTHR(v))
493 
494 #define REG_RXPSF_TYPE_CTRL	0x1614
495 #define REG_GENERAL_OPTION	0x1664
496 #define BIT_DUMMY_FCS_READY_MASK_EN BIT(9)
497 
498 #define REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1		0x1700
499 #define REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1	0x1704
500 #define REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1	0x1708
501 #define LTECOEX_READY		BIT(29)
502 #define LTECOEX_ACCESS_CTRL REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1
503 #define LTECOEX_WRITE_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1
504 #define LTECOEX_READ_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1
505 
506 #define REG_IGN_GNT_BT1	0x1860
507 
508 #define REG_RFESEL_CTRL	0x1990
509 
510 #define REG_NOMASK_TXBT	0x1ca7
511 #define REG_ANAPAR	0x1c30
512 #define BIT_ANAPAR_BTPS	BIT(22)
513 #define REG_RSTB_SEL	0x1c38
514 
515 #define REG_IGN_GNTBT4	0x4160
516 
517 #define RF_MODOPT	0x01
518 #define RF_DTXLOK	0x08
519 #define RF_CFGCH	0x18
520 #define RF_RCK		0x1d
521 #define RF_LUTWA	0x33
522 #define RF_LUTWD1	0x3e
523 #define RF_LUTWD0	0x3f
524 #define RF_T_METER	0x42
525 #define RF_XTALX2	0xb8
526 #define RF_MALSEL	0xbe
527 #define RF_RCKD		0xde
528 #define RF_LUTDBG	0xdf
529 #define RF_LUTWE2	0xee
530 #define RF_LUTWE	0xef
531 
532 #define LTE_COEX_CTRL	0x38
533 #define LTE_WL_TRX_CTRL	0xa0
534 #define LTE_BT_TRX_CTRL	0xa4
535 
536 #endif
537