xref: /linux/drivers/net/wireless/realtek/rtw88/reg.h (revision 7f71507851fc7764b36a3221839607d3a45c2025)
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_EN_25_1		BIT(13)
10 #define BIT_FEN_ELDR		BIT(12)
11 #define BIT_FEN_CPUEN		BIT(2)
12 #define BIT_FEN_USBA		BIT(2)
13 #define BIT_FEN_BB_GLB_RST	BIT(1)
14 #define BIT_FEN_BB_RSTB		BIT(0)
15 #define BIT_R_DIS_PRST		BIT(6)
16 #define BIT_WLOCK_1C_B6		BIT(5)
17 #define REG_SYS_PW_CTRL		0x0004
18 #define BIT_PFM_WOWL		BIT(3)
19 #define BIT_APFM_OFFMAC		BIT(9)
20 #define REG_APS_FSMCO		0x0004
21 #define APS_FSMCO_MAC_ENABLE	BIT(8)
22 #define APS_FSMCO_MAC_OFF	BIT(9)
23 #define APS_FSMCO_HW_POWERDOWN	BIT(15)
24 #define REG_SYS_CLK_CTRL	0x0008
25 #define BIT_CPU_CLK_EN		BIT(14)
26 
27 #define REG_SYS_CLKR		0x0008
28 #define BIT_ANA8M		BIT(1)
29 #define BIT_WAKEPAD_EN		BIT(3)
30 #define BIT_LOADER_CLK_EN	BIT(5)
31 
32 #define REG_RSV_CTRL		0x001C
33 #define DISABLE_PI		0x3
34 #define ENABLE_PI		0x2
35 #define BITS_RFC_DIRECT		(BIT(31) | BIT(30))
36 #define BIT_WLMCU_IOIF		BIT(0)
37 #define REG_RF_CTRL		0x001F
38 #define BIT_RF_SDM_RSTB		BIT(2)
39 #define BIT_RF_RSTB		BIT(1)
40 #define BIT_RF_EN		BIT(0)
41 
42 #define REG_AFE_CTRL1		0x0024
43 #define BIT_MAC_CLK_SEL		(BIT(20) | BIT(21))
44 #define REG_EFUSE_CTRL		0x0030
45 #define BIT_EF_FLAG		BIT(31)
46 #define BIT_SHIFT_EF_ADDR	8
47 #define BIT_MASK_EF_ADDR	0x3ff
48 #define BIT_MASK_EF_DATA	0xff
49 #define BITS_EF_ADDR		(BIT_MASK_EF_ADDR << BIT_SHIFT_EF_ADDR)
50 #define BITS_PLL		0xf0
51 
52 #define REG_AFE_XTAL_CTRL	0x24
53 #define REG_AFE_PLL_CTRL	0x28
54 #define REG_AFE_CTRL3		0x2c
55 #define BIT_MASK_XTAL		0x00FFF000
56 #define BIT_XTAL_GMP_BIT4	BIT(28)
57 
58 #define REG_LDO_EFUSE_CTRL	0x0034
59 #define BIT_MASK_EFUSE_BANK_SEL	(BIT(8) | BIT(9))
60 
61 #define BIT_LDO25_VOLTAGE_V25	0x03
62 #define BIT_MASK_LDO25_VOLTAGE	GENMASK(6, 4)
63 #define BIT_SHIFT_LDO25_VOLTAGE	4
64 #define BIT_LDO25_EN		BIT(7)
65 
66 #define REG_ACLK_MON		0x3e
67 
68 #define REG_GPIO_MUXCFG		0x0040
69 #define BIT_FSPI_EN		BIT(19)
70 #define BIT_EN_SIC		BIT(12)
71 
72 #define BIT_PO_BT_PTA_PINS	BIT(9)
73 #define BIT_BT_PTA_EN		BIT(5)
74 #define BIT_WLRFE_4_5_EN	BIT(2)
75 
76 #define REG_LED_CFG		0x004C
77 #define BIT_LNAON_SEL_EN	BIT(26)
78 #define BIT_PAPE_SEL_EN		BIT(25)
79 #define BIT_DPDT_WL_SEL		BIT(24)
80 #define BIT_DPDT_SEL_EN		BIT(23)
81 #define REG_LEDCFG2		0x004E
82 #define REG_PAD_CTRL1		0x0064
83 #define BIT_BT_BTG_SEL		BIT(31)
84 #define BIT_PAPE_WLBT_SEL	BIT(29)
85 #define BIT_LNAON_WLBT_SEL	BIT(28)
86 #define BIT_BTGP_JTAG_EN	BIT(24)
87 #define BIT_BTGP_SPI_EN		BIT(20)
88 #define BIT_LED1DIS		BIT(15)
89 #define BIT_SW_DPDT_SEL_DATA	BIT(0)
90 #define REG_WL_BT_PWR_CTRL	0x0068
91 #define BIT_BT_FUNC_EN		BIT(18)
92 #define BIT_BT_DIG_CLK_EN	BIT(8)
93 #define REG_SYS_SDIO_CTRL	0x0070
94 #define BIT_DBG_GNT_WL_BT	BIT(27)
95 #define BIT_LTE_MUX_CTRL_PATH	BIT(26)
96 #define REG_HCI_OPT_CTRL	0x0074
97 #define BIT_USB_SUS_DIS		BIT(8)
98 #define BIT_SDIO_PAD_E5		BIT(18)
99 
100 #define REG_RF_B_CTRL		0x76
101 
102 #define REG_AFE_CTRL_4		0x0078
103 #define BIT_CK320M_AFE_EN	BIT(4)
104 #define BIT_EN_SYN		BIT(15)
105 
106 #define REG_LDO_SWR_CTRL	0x007C
107 #define LDO_SEL			0xC3
108 #define SPS_SEL			0x83
109 #define BIT_XTA1		BIT(29)
110 #define BIT_XTA0		BIT(28)
111 
112 #define REG_MCUFW_CTRL		0x0080
113 #define BIT_ANA_PORT_EN		BIT(22)
114 #define BIT_MAC_PORT_EN		BIT(21)
115 #define BIT_BOOT_FSPI_EN	BIT(20)
116 #define BIT_ROM_DLEN		BIT(19)
117 #define BIT_ROM_PGE		GENMASK(18, 16)	/* legacy only */
118 #define BIT_SHIFT_ROM_PGE	16
119 #define BIT_FW_INIT_RDY		BIT(15)
120 #define BIT_FW_DW_RDY		BIT(14)
121 #define BIT_RPWM_TOGGLE		BIT(7)
122 #define BIT_RAM_DL_SEL		BIT(7)	/* legacy only */
123 #define BIT_DMEM_CHKSUM_OK	BIT(6)
124 #define BIT_WINTINI_RDY		BIT(6)	/* legacy only */
125 #define BIT_DMEM_DW_OK		BIT(5)
126 #define BIT_IMEM_CHKSUM_OK	BIT(4)
127 #define BIT_IMEM_DW_OK		BIT(3)
128 #define BIT_IMEM_BOOT_LOAD_CHECKSUM_OK BIT(2)
129 #define BIT_FWDL_CHK_RPT	BIT(2)	/* legacy only */
130 #define BIT_MCUFWDL_RDY		BIT(1)	/* legacy only */
131 #define BIT_MCUFWDL_EN		BIT(0)
132 #define BIT_CHECK_SUM_OK	(BIT(4) | BIT(6))
133 #define FW_READY		(BIT_FW_INIT_RDY | BIT_FW_DW_RDY |             \
134 				 BIT_IMEM_DW_OK | BIT_DMEM_DW_OK |             \
135 				 BIT_CHECK_SUM_OK)
136 #define FW_READY_LEGACY		(BIT_MCUFWDL_RDY | BIT_FWDL_CHK_RPT |	       \
137 				 BIT_WINTINI_RDY | BIT_RAM_DL_SEL)
138 #define FW_READY_MASK		0xffff
139 
140 #define REG_MCU_TST_CFG		0x84
141 #define VAL_FW_TRIGGER		0x1
142 
143 #define REG_PMC_DBG_CTRL1	0xa8
144 #define BITS_PMC_BT_IQK_STS	GENMASK(22, 21)
145 
146 #define REG_HIMR0		0xb0
147 #define REG_HISR0		0xb4
148 #define REG_HIMR1		0xb8
149 #define REG_HISR1		0xbc
150 
151 #define REG_PAD_CTRL2		0x00C4
152 #define BIT_RSM_EN_V1		BIT(16)
153 #define BIT_NO_PDN_CHIPOFF_V1	BIT(17)
154 #define BIT_MASK_USB23_SW_MODE_V1	GENMASK(19, 18)
155 #define BIT_USB3_USB2_TRANSITION	BIT(20)
156 #define BIT_USB_MODE_U2		1
157 #define BIT_USB_MODE_U3		2
158 
159 #define REG_EFUSE_ACCESS	0x00CF
160 #define EFUSE_ACCESS_ON		0x69
161 #define EFUSE_ACCESS_OFF	0x00
162 
163 #define REG_WLRF1		0x00EC
164 #define REG_WIFI_BT_INFO	0x00AA
165 #define BIT_BT_INT_EN		BIT(15)
166 #define REG_SYS_CFG1		0x00F0
167 #define	BIT_RTL_ID		BIT(23)
168 #define BIT_LDO			BIT(24)
169 #define BIT_RF_TYPE_ID		BIT(27)
170 #define BIT_SHIFT_VENDOR_ID	16
171 #define BIT_MASK_VENDOR_ID	0xf
172 #define BIT_VENDOR_ID(x) (((x) & BIT_MASK_VENDOR_ID) << BIT_SHIFT_VENDOR_ID)
173 #define BITS_VENDOR_ID		(BIT_MASK_VENDOR_ID << BIT_SHIFT_VENDOR_ID)
174 #define BIT_CLEAR_VENDOR_ID(x)	((x) & (~BITS_VENDOR_ID))
175 #define BIT_GET_VENDOR_ID(x) (((x) >> BIT_SHIFT_VENDOR_ID) & BIT_MASK_VENDOR_ID)
176 #define BIT_SHIFT_CHIP_VER	12
177 #define BIT_MASK_CHIP_VER	0xf
178 #define BIT_CHIP_VER(x)	 (((x) & BIT_MASK_CHIP_VER) << BIT_SHIFT_CHIP_VER)
179 #define BITS_CHIP_VER		(BIT_MASK_CHIP_VER << BIT_SHIFT_CHIP_VER)
180 #define BIT_CLEAR_CHIP_VER(x)	((x) & (~BITS_CHIP_VER))
181 #define BIT_GET_CHIP_VER(x) (((x) >> BIT_SHIFT_CHIP_VER) & BIT_MASK_CHIP_VER)
182 #define REG_SYS_STATUS1		0x00F4
183 #define REG_SYS_STATUS2		0x00F8
184 #define REG_SYS_CFG2		0x00FC
185 #define REG_WLRF1		0x00EC
186 #define BIT_WLRF1_BBRF_EN	(BIT(24) | BIT(25) | BIT(26))
187 #define REG_CR			0x0100
188 #define BIT_32K_CAL_TMR_EN	BIT(10)
189 #define BIT_MAC_SEC_EN		BIT(9)
190 #define BIT_ENSWBCN		BIT(8)
191 #define BIT_MACRXEN		BIT(7)
192 #define BIT_MACTXEN		BIT(6)
193 #define BIT_SCHEDULE_EN		BIT(5)
194 #define BIT_PROTOCOL_EN		BIT(4)
195 #define BIT_RXDMA_EN		BIT(3)
196 #define BIT_TXDMA_EN		BIT(2)
197 #define BIT_HCI_RXDMA_EN	BIT(1)
198 #define BIT_HCI_TXDMA_EN	BIT(0)
199 #define MAC_TRX_ENABLE	(BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \
200 			BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \
201 			BIT_MACTXEN | BIT_MACRXEN)
202 #define REG_PBP			0x104
203 #define PBP_RX_MASK		0x0f
204 #define PBP_TX_MASK		0xf0
205 #define PBP_64			0x0
206 #define PBP_128			0x1
207 #define PBP_256			0x2
208 #define PBP_512			0x3
209 #define PBP_1024		0x4
210 
211 #define BIT_SHIFT_TXDMA_VOQ_MAP	4
212 #define BIT_MASK_TXDMA_VOQ_MAP	0x3
213 #define BIT_TXDMA_VOQ_MAP(x)                                                   \
214 	(((x) & BIT_MASK_TXDMA_VOQ_MAP) << BIT_SHIFT_TXDMA_VOQ_MAP)
215 #define BIT_SHIFT_TXDMA_VIQ_MAP	6
216 #define BIT_MASK_TXDMA_VIQ_MAP	0x3
217 #define BIT_TXDMA_VIQ_MAP(x)                                                   \
218 	(((x) & BIT_MASK_TXDMA_VIQ_MAP) << BIT_SHIFT_TXDMA_VIQ_MAP)
219 #define REG_TXDMA_PQ_MAP	0x010C
220 #define BIT_RXDMA_ARBBW_EN	BIT(0)
221 #define BIT_RXSHFT_EN		BIT(1)
222 #define BIT_RXDMA_AGG_EN	BIT(2)
223 #define BIT_TXDMA_BW_EN		BIT(3)
224 #define BIT_SHIFT_TXDMA_BEQ_MAP	8
225 #define BIT_MASK_TXDMA_BEQ_MAP	0x3
226 #define BIT_TXDMA_BEQ_MAP(x)                                                   \
227 	(((x) & BIT_MASK_TXDMA_BEQ_MAP) << BIT_SHIFT_TXDMA_BEQ_MAP)
228 #define BIT_SHIFT_TXDMA_BKQ_MAP	10
229 #define BIT_MASK_TXDMA_BKQ_MAP	0x3
230 #define BIT_TXDMA_BKQ_MAP(x)                                                   \
231 	(((x) & BIT_MASK_TXDMA_BKQ_MAP) << BIT_SHIFT_TXDMA_BKQ_MAP)
232 #define BIT_SHIFT_TXDMA_MGQ_MAP	12
233 #define BIT_MASK_TXDMA_MGQ_MAP	0x3
234 #define BIT_TXDMA_MGQ_MAP(x)                                                   \
235 	(((x) & BIT_MASK_TXDMA_MGQ_MAP) << BIT_SHIFT_TXDMA_MGQ_MAP)
236 #define BIT_SHIFT_TXDMA_HIQ_MAP	14
237 #define BIT_MASK_TXDMA_HIQ_MAP	0x3
238 #define BIT_TXDMA_HIQ_MAP(x)                                                   \
239 	(((x) & BIT_MASK_TXDMA_HIQ_MAP) << BIT_SHIFT_TXDMA_HIQ_MAP)
240 #define BIT_SHIFT_TXSC_40M	4
241 #define BIT_MASK_TXSC_40M	0xf
242 #define BIT_TXSC_40M(x)							       \
243 	(((x) & BIT_MASK_TXSC_40M) << BIT_SHIFT_TXSC_40M)
244 #define BIT_SHIFT_TXSC_20M	0
245 #define BIT_MASK_TXSC_20M	0xf
246 #define BIT_TXSC_20M(x)							       \
247 	(((x) & BIT_MASK_TXSC_20M) << BIT_SHIFT_TXSC_20M)
248 #define BIT_SHIFT_MAC_CLK_SEL	20
249 #define MAC_CLK_HW_DEF_80M	0
250 #define MAC_CLK_HW_DEF_40M	1
251 #define MAC_CLK_HW_DEF_20M	2
252 #define MAC_CLK_SPEED		80
253 
254 #define REG_CR			0x0100
255 #define REG_TRXFF_BNDY		0x0114
256 #define REG_RXFF_BNDY		0x011C
257 #define REG_FE1IMR		0x0120
258 #define BIT_FS_RXDONE		BIT(16)
259 #define REG_CPWM		0x012C
260 #define REG_FWIMR		0x0130
261 #define BIT_FS_H2CCMD_INT_EN	BIT(4)
262 #define BIT_FS_HRCV_INT_EN	BIT(5)
263 #define REG_FWISR		0x0134
264 #define BIT_FS_H2CCMD_INT	BIT(4)
265 #define BIT_FS_HRCV_INT		BIT(5)
266 #define REG_PKTBUF_DBG_CTRL	0x0140
267 #define REG_C2HEVT		0x01A0
268 #define REG_MCUTST_1		0x01C0
269 #define REG_MCUTST_II		0x01C4
270 #define REG_WOWLAN_WAKE_REASON	0x01C7
271 #define REG_HMETFR		0x01CC
272 #define BIT_INT_BOX0		BIT(0)
273 #define BIT_INT_BOX1		BIT(1)
274 #define BIT_INT_BOX2		BIT(2)
275 #define BIT_INT_BOX3		BIT(3)
276 #define BIT_INT_BOX_ALL		(BIT_INT_BOX0 | BIT_INT_BOX1 | BIT_INT_BOX2 | \
277 				 BIT_INT_BOX3)
278 #define REG_HMEBOX0		0x01D0
279 #define REG_HMEBOX1		0x01D4
280 #define REG_HMEBOX2		0x01D8
281 #define REG_HMEBOX3		0x01DC
282 #define REG_LLT_INIT		0x01E0
283 #define BIT_LLT_WRITE_ACCESS	BIT(30)
284 #define REG_HMEBOX0_EX		0x01F0
285 #define REG_HMEBOX1_EX		0x01F4
286 #define REG_HMEBOX2_EX		0x01F8
287 #define REG_HMEBOX3_EX		0x01FC
288 
289 #define REG_RQPN		0x0200
290 #define BIT_MASK_HPQ		0xff
291 #define BIT_SHIFT_HPQ		0
292 #define BIT_RQPN_HPQ(x)		(((x) & BIT_MASK_HPQ) << BIT_SHIFT_HPQ)
293 #define BIT_MASK_LPQ		0xff
294 #define BIT_SHIFT_LPQ		8
295 #define BIT_RQPN_LPQ(x)		(((x) & BIT_MASK_LPQ) << BIT_SHIFT_LPQ)
296 #define BIT_MASK_PUBQ		0xff
297 #define BIT_SHIFT_PUBQ		16
298 #define BIT_RQPN_PUBQ(x)	(((x) & BIT_MASK_PUBQ) << BIT_SHIFT_PUBQ)
299 #define BIT_RQPN_HLP(h, l, p)	(BIT_LD_RQPN | BIT_RQPN_HPQ(h) |	       \
300 				 BIT_RQPN_LPQ(l) | BIT_RQPN_PUBQ(p))
301 
302 #define REG_FIFOPAGE_CTRL_2	0x0204
303 #define BIT_BCN_VALID_V1	BIT(15)
304 #define BIT_MASK_BCN_HEAD_1_V1	0xfff
305 #define REG_AUTO_LLT_V1		0x0208
306 #define BIT_AUTO_INIT_LLT_V1	BIT(0)
307 #define BIT_MASK_BLK_DESC_NUM	GENMASK(7, 4)
308 #define REG_DWBCN0_CTRL		0x0208
309 #define BIT_BCN_VALID		BIT(16)
310 #define REG_TXDMA_OFFSET_CHK	0x020C
311 #define BIT_DROP_DATA_EN	BIT(9)
312 #define REG_TXDMA_STATUS	0x0210
313 #define BTI_PAGE_OVF		BIT(2)
314 
315 #define REG_RQPN_NPQ		0x0214
316 #define BIT_MASK_NPQ		0xff
317 #define BIT_SHIFT_NPQ		0
318 #define BIT_MASK_EPQ		0xff
319 #define BIT_SHIFT_EPQ		16
320 #define BIT_RQPN_NPQ(x)		(((x) & BIT_MASK_NPQ) << BIT_SHIFT_NPQ)
321 #define BIT_RQPN_EPQ(x)		(((x) & BIT_MASK_EPQ) << BIT_SHIFT_EPQ)
322 #define BIT_RQPN_NE(n, e)	(BIT_RQPN_NPQ(n) | BIT_RQPN_EPQ(e))
323 
324 #define REG_AUTO_LLT		0x0224
325 #define BIT_AUTO_INIT_LLT	BIT(16)
326 #define REG_DWBCN1_CTRL		0x0228
327 #define REG_RQPN_CTRL_1		0x0228
328 #define REG_RQPN_CTRL_2		0x022C
329 #define BIT_LD_RQPN		BIT(31)
330 #define REG_FIFOPAGE_INFO_1	0x0230
331 #define REG_FIFOPAGE_INFO_2	0x0234
332 #define REG_FIFOPAGE_INFO_3	0x0238
333 #define REG_FIFOPAGE_INFO_4	0x023C
334 #define REG_FIFOPAGE_INFO_5	0x0240
335 #define REG_H2C_HEAD		0x0244
336 #define REG_H2C_TAIL		0x0248
337 #define REG_H2C_READ_ADDR	0x024C
338 #define REG_H2C_INFO		0x0254
339 #define REG_RXDMA_AGG_PG_TH	0x0280
340 #define BIT_RXDMA_AGG_PG_TH	GENMASK(7, 0)
341 #define BIT_DMA_AGG_TO_V1	GENMASK(15, 8)
342 #define BIT_EN_PRE_CALC		BIT(29)
343 #define REG_RXPKT_NUM		0x0284
344 #define BIT_RXDMA_REQ		BIT(19)
345 #define BIT_RW_RELEASE		BIT(18)
346 #define BIT_RXDMA_IDLE		BIT(17)
347 #define REG_RXDMA_STATUS	0x0288
348 #define REG_RXDMA_DPR		0x028C
349 #define REG_RXDMA_MODE		0x0290
350 #define BIT_DMA_MODE		BIT(1)
351 #define BIT_DMA_BURST_CNT	GENMASK(3, 2)
352 #define BIT_DMA_BURST_SIZE	GENMASK(5, 4)
353 #define BIT_DMA_BURST_SIZE_64	2
354 #define BIT_DMA_BURST_SIZE_512	1
355 #define BIT_DMA_BURST_SIZE_1024	0
356 
357 #define REG_RXPKTNUM		0x02B0
358 #define REG_EARLY_MODE_CONTROL	0x02BC
359 
360 #define REG_INT_MIG		0x0304
361 #define REG_HCI_MIX_CFG		0x03FC
362 #define BIT_PCIE_EMAC_PDN_AUX_TO_FAST_CLK BIT(26)
363 
364 #define REG_BCNQ_INFO		0x0418
365 #define BIT_MGQ_CPU_EMPTY	BIT(24)
366 #define REG_TXPKT_EMPTY		0x041A
367 #define REG_FWHW_TXQ_CTRL	0x0420
368 #define BIT_EN_BCNQ_DL		BIT(22)
369 #define BIT_EN_WR_FREE_TAIL	BIT(20)
370 #define REG_HWSEQ_CTRL		0x0423
371 
372 #define REG_BCNQ_BDNY_V1	0x0424
373 #define REG_BCNQ_BDNY		0x0424
374 #define REG_MGQ_BDNY		0x0425
375 #define REG_LIFETIME_EN		0x0426
376 #define BIT_BA_PARSER_EN	BIT(5)
377 #define REG_SPEC_SIFS		0x0428
378 #define REG_RETRY_LIMIT		0x042a
379 #define REG_DARFRC		0x0430
380 #define REG_DARFRCH		0x0434
381 #define REG_RARFRCH		0x043C
382 #define REG_RRSR		0x0440
383 #define BITS_RRSR_RSC		GENMASK(22, 21)
384 #define REG_ARFR0		0x0444
385 #define REG_ARFRH0		0x0448
386 #define REG_ARFR1_V1		0x044C
387 #define REG_ARFRH1_V1		0x0450
388 #define REG_CCK_CHECK		0x0454
389 #define BIT_CHECK_CCK_EN	BIT(7)
390 #define REG_AMPDU_MAX_TIME_V1	0x0455
391 #define REG_BCNQ1_BDNY_V1	0x0456
392 #define REG_AMPDU_MAX_TIME	0x0456
393 #define REG_AMPDU_MAX_LENGTH	0x0458
394 #define REG_WMAC_LBK_BF_HD	0x045D
395 #define REG_TX_HANG_CTRL	0x045E
396 #define BIT_EN_GNT_BT_AWAKE	BIT(3)
397 #define BIT_EN_EOF_V1		BIT(2)
398 #define REG_FAST_EDCA_CTRL	0x0460
399 #define REG_DATA_SC		0x0483
400 #define REG_ARFR2_V1		0x048C
401 #define REG_ARFRH2_V1		0x0490
402 #define REG_ARFR3_V1		0x0494
403 #define BIT_EXC_CODE		GENMASK(6, 2)
404 #define REG_ARFRH3_V1		0x0498
405 #define REG_ARFR4		0x049C
406 #define BIT_WL_RFK		BIT(0)
407 #define REG_ARFRH4		0x04A0
408 #define REG_ARFR5		0x04A4
409 #define REG_ARFRH5		0x04A8
410 #define REG_SW_AMPDU_BURST_MODE_CTRL 0x04BC
411 #define BIT_PRE_TX_CMD		BIT(6)
412 #define REG_QUEUE_CTRL		0x04C6
413 #define BIT_PTA_WL_TX_EN	BIT(4)
414 #define BIT_PTA_EDCCA_EN	BIT(5)
415 #define REG_SINGLE_AMPDU_CTRL	0x04C7
416 #define BIT_EN_SINGLE_APMDU	BIT(7)
417 #define REG_PROT_MODE_CTRL	0x04C8
418 #define REG_MAX_AGGR_NUM	0x04CA
419 #define REG_BAR_MODE_CTRL	0x04CC
420 #define REG_PRECNT_CTRL		0x04E5
421 #define BIT_BTCCA_CTRL		(BIT(0) | BIT(1))
422 #define BIT_EN_PRECNT		BIT(11)
423 #define REG_TX_RPT_CTRL		0x04EC
424 #define REG_TX_RPT_TIME		0x04F0
425 #define REG_DUMMY_PAGE4_V1	0x04FC
426 
427 #define REG_EDCA_VO_PARAM	0x0500
428 #define REG_EDCA_VI_PARAM	0x0504
429 #define REG_EDCA_BE_PARAM	0x0508
430 #define REG_EDCA_BK_PARAM	0x050C
431 #define BIT_MASK_TXOP_LMT	GENMASK(26, 16)
432 #define BIT_MASK_CWMAX		GENMASK(15, 12)
433 #define BIT_MASK_CWMIN		GENMASK(11, 8)
434 #define BIT_MASK_AIFS		GENMASK(7, 0)
435 #define REG_BCNTCFG		0x0510
436 #define REG_PIFS		0x0512
437 #define REG_SIFS		0x0514
438 #define BIT_SHIFT_SIFS_OFDM_CTX	8
439 #define BIT_SHIFT_SIFS_CCK_TRX	16
440 #define BIT_SHIFT_SIFS_OFDM_TRX	24
441 #define REG_AGGR_BREAK_TIME	0x051A
442 #define REG_SLOT		0x051B
443 #define REG_TX_PTCL_CTRL	0x0520
444 #define BIT_DIS_EDCCA		BIT(15)
445 #define BIT_SIFS_BK_EN		BIT(12)
446 #define REG_TXPAUSE		0x0522
447 #define BIT_AC_QUEUE		GENMASK(7, 0)
448 #define BIT_HIGH_QUEUE		BIT(5)
449 #define REG_RD_CTRL		0x0524
450 #define BIT_EDCCA_MSK_CNTDOWN_EN BIT(11)
451 #define BIT_DIS_TXOP_CFE	BIT(10)
452 #define BIT_DIS_LSIG_CFE	BIT(9)
453 #define BIT_DIS_STBC_CFE	BIT(8)
454 #define REG_TBTT_PROHIBIT	0x0540
455 #define BIT_SHIFT_TBTT_HOLD_TIME_AP 8
456 #define REG_RD_NAV_NXT		0x0544
457 #define REG_NAV_PROT_LEN	0x0546
458 #define REG_BCN_CTRL		0x0550
459 #define BIT_DIS_TSF_UDT		BIT(4)
460 #define BIT_EN_BCN_FUNCTION	BIT(3)
461 #define BIT_EN_TXBCN_RPT	BIT(2)
462 #define REG_BCN_CTRL_CLINT0	0x0551
463 #define REG_DRVERLYINT		0x0558
464 #define REG_BCNDMATIM		0x0559
465 #define REG_ATIMWND		0x055A
466 #define REG_USTIME_TSF		0x055C
467 #define REG_BCN_MAX_ERR		0x055D
468 #define REG_RXTSF_OFFSET_CCK	0x055E
469 #define REG_MISC_CTRL		0x0577
470 #define BIT_EN_FREE_CNT		BIT(3)
471 #define BIT_DIS_SECOND_CCA	(BIT(0) | BIT(1))
472 #define REG_HIQ_NO_LMT_EN	0x5A7
473 #define REG_DTIM_COUNTER_ROOT	0x5A8
474 #define BIT_HIQ_NO_LMT_EN_ROOT	BIT(0)
475 #define REG_TIMER0_SRC_SEL	0x05B4
476 #define BIT_TSFT_SEL_TIMER0	(BIT(4) | BIT(5) | BIT(6))
477 
478 #define REG_TCR			0x0604
479 #define BIT_PWRMGT_HWDATA_EN	BIT(7)
480 #define BIT_TCR_UPDATE_TIMIE	BIT(5)
481 #define BIT_TCR_UPDATE_HGQMD	BIT(4)
482 #define REG_RCR			0x0608
483 #define BIT_APP_FCS		BIT(31)
484 #define BIT_APP_MIC		BIT(30)
485 #define BIT_APP_ICV		BIT(29)
486 #define BIT_APP_PHYSTS		BIT(28)
487 #define BIT_APP_BASSN		BIT(27)
488 #define BIT_VHT_DACK		BIT(26)
489 #define BIT_TCPOFLD_EN		BIT(25)
490 #define BIT_ENMBID		BIT(24)
491 #define BIT_LSIGEN		BIT(23)
492 #define BIT_MFBEN		BIT(22)
493 #define BIT_DISCHKPPDLLEN	BIT(21)
494 #define BIT_PKTCTL_DLEN		BIT(20)
495 #define BIT_DISGCLK		BIT(19)
496 #define BIT_TIM_PARSER_EN	BIT(18)
497 #define BIT_BC_MD_EN		BIT(17)
498 #define BIT_UC_MD_EN		BIT(16)
499 #define BIT_RXSK_PERPKT		BIT(15)
500 #define BIT_HTC_LOC_CTRL	BIT(14)
501 #define BIT_RPFM_CAM_ENABLE	BIT(12)
502 #define BIT_TA_BCN		BIT(11)
503 #define BIT_RCR_ADF		BIT(11)
504 #define BIT_DISDECMYPKT		BIT(10)
505 #define BIT_AICV		BIT(9)
506 #define BIT_ACRC32		BIT(8)
507 #define BIT_CBSSID_BCN		BIT(7)
508 #define BIT_CBSSID_DATA		BIT(6)
509 #define BIT_APWRMGT		BIT(5)
510 #define BIT_ADD3		BIT(4)
511 #define BIT_AB			BIT(3)
512 #define BIT_AM			BIT(2)
513 #define BIT_APM			BIT(1)
514 #define BIT_AAP			BIT(0)
515 #define REG_RX_PKT_LIMIT	0x060C
516 #define REG_RX_DRVINFO_SZ	0x060F
517 #define BIT_APP_PHYSTS		BIT(28)
518 #define REG_MAR			0x0620
519 #define REG_USTIME_EDCA		0x0638
520 #define REG_ACKTO_CCK		0x0639
521 #define REG_MAC_SPEC_SIFS	0x063A
522 #define REG_RESP_SIFS_CCK	0x063C
523 #define REG_RESP_SIFS_OFDM	0x063E
524 #define REG_ACKTO		0x0640
525 #define REG_EIFS		0x0642
526 #define REG_NAV_CTRL		0x0650
527 #define REG_WMAC_TRXPTCL_CTL	0x0668
528 #define BIT_RFMOD		(BIT(7) | BIT(8))
529 #define BIT_RFMOD_80M		BIT(8)
530 #define BIT_RFMOD_40M		BIT(7)
531 #define REG_WMAC_TRXPTCL_CTL_H	0x066C
532 #define REG_WKFMCAM_CMD		0x0698
533 #define BIT_WKFCAM_POLLING_V1	BIT(31)
534 #define BIT_WKFCAM_CLR_V1	BIT(30)
535 #define BIT_WKFCAM_WE		BIT(16)
536 #define BIT_SHIFT_WKFCAM_ADDR_V2	8
537 #define BIT_MASK_WKFCAM_ADDR_V2		0xff
538 #define BIT_WKFCAM_ADDR_V2(x)						       \
539 	(((x) & BIT_MASK_WKFCAM_ADDR_V2) << BIT_SHIFT_WKFCAM_ADDR_V2)
540 #define REG_WKFMCAM_RWD         0x069C
541 #define BIT_WKFMCAM_VALID	BIT(31)
542 #define BIT_WKFMCAM_BC		BIT(26)
543 #define BIT_WKFMCAM_MC		BIT(25)
544 #define BIT_WKFMCAM_UC		BIT(24)
545 
546 #define REG_RXFLTMAP0		0x06A0
547 #define REG_RXFLTMAP1		0x06A2
548 #define REG_RXFLTMAP2		0x06A4
549 #define REG_RXFLTMAP4		0x068A
550 #define REG_BT_COEX_TABLE0	0x06C0
551 #define REG_BT_COEX_TABLE1	0x06C4
552 #define REG_BT_COEX_BRK_TABLE	0x06C8
553 #define REG_BT_COEX_TABLE_H	0x06CC
554 #define REG_BT_COEX_TABLE_H1	0x06CD
555 #define REG_BT_COEX_TABLE_H2	0x06CE
556 #define REG_BT_COEX_TABLE_H3	0x06CF
557 #define REG_BBPSF_CTRL		0x06DC
558 
559 #define REG_BT_COEX_V2		0x0762
560 #define BIT_GNT_BT_POLARITY	BIT(12)
561 #define BIT_LTE_COEX_EN		BIT(7)
562 #define REG_GNT_BT		0x0765
563 #define BIT_PTA_SW_CTL		GENMASK(4, 3)
564 #define REG_BT_COEX_ENH_INTR_CTRL	0x76E
565 #define BIT_R_GRANTALL_WLMASK	BIT(3)
566 #define BIT_STATIS_BT_EN	BIT(2)
567 #define REG_BT_ACT_STATISTICS	0x0770
568 #define REG_BT_ACT_STATISTICS_1	0x0774
569 #define REG_BT_STAT_CTRL	0x0778
570 #define REG_BT_TDMA_TIME	0x0790
571 #define BIT_MASK_SAMPLE_RATE	GENMASK(5, 0)
572 #define REG_LTR_IDLE_LATENCY	0x0798
573 #define REG_LTR_ACTIVE_LATENCY	0x079C
574 #define REG_LTR_CTRL_BASIC	0x07A4
575 #define REG_WMAC_OPTION_FUNCTION 0x07D0
576 #define REG_WMAC_OPTION_FUNCTION_1 0x07D4
577 
578 #define REG_FPGA0_RFMOD		0x0800
579 #define BIT_CCKEN		BIT(24)
580 #define BIT_OFDMEN		BIT(25)
581 #define REG_CCK_RPT_FORMAT	0x0804
582 #define BIT_CCK_RPT_FORMAT	BIT(16)
583 #define REG_RXPSEL		0x0808
584 #define BIT_RX_PSEL_RST		(BIT(28) | BIT(29))
585 #define REG_TXPSEL		0x080C
586 #define REG_RX_GAIN_EN		0x081c
587 #define REG_CCASEL		0x082C
588 #define REG_PDMFTH		0x0830
589 #define REG_BWINDICATION	0x0834
590 #define REG_CCA2ND		0x0838
591 #define REG_L1PKTH		0x0848
592 #define REG_CLKTRK		0x0860
593 #define REG_ADCCLK		0x08AC
594 #define REG_HSSI_READ		0x08B0
595 #define REG_FPGA0_XCD_RF_PARA	0x08B4
596 #define REG_RX_MCS_LIMIT	0x08BC
597 #define REG_ADC160		0x08C4
598 #define REG_ANTSEL_SW		0x0900
599 #define REG_DAC_RSTB		0x090c
600 #define REG_SINGLE_TONE_CONT_TX	0x0914
601 
602 #define REG_RFE_CTRL_E		0x0974
603 #define REG_2ND_CCA_CTRL	0x0976
604 #define REG_IQK_COM00		0x0978
605 #define REG_IQK_COM32		0x097c
606 #define REG_IQK_COM64		0x0980
607 #define REG_IQK_COM96		0x0984
608 
609 #define REG_FAS			0x09a4
610 #define REG_RXSB		0x0a00
611 #define REG_CCK_RX		0x0a04
612 #define REG_CCK_PD_TH		0x0a0a
613 
614 #define REG_CCK0_FAREPORT	0xa2c
615 #define BIT_CCK0_2RX		BIT(18)
616 #define BIT_CCK0_MRC		BIT(22)
617 #define REG_FA_CCK		0x0a5c
618 
619 #define REG_DIS_DPD		0x0a70
620 #define DIS_DPD_MASK		GENMASK(9, 0)
621 #define DIS_DPD_RATE6M		BIT(0)
622 #define DIS_DPD_RATE9M		BIT(1)
623 #define DIS_DPD_RATEMCS0	BIT(2)
624 #define DIS_DPD_RATEMCS1	BIT(3)
625 #define DIS_DPD_RATEMCS8	BIT(4)
626 #define DIS_DPD_RATEMCS9	BIT(5)
627 #define DIS_DPD_RATEVHT1SS_MCS0	BIT(6)
628 #define DIS_DPD_RATEVHT1SS_MCS1	BIT(7)
629 #define DIS_DPD_RATEVHT2SS_MCS0	BIT(8)
630 #define DIS_DPD_RATEVHT2SS_MCS1	BIT(9)
631 #define DIS_DPD_RATEALL		GENMASK(9, 0)
632 
633 #define REG_CNTRST		0x0b58
634 
635 #define REG_3WIRE_SWA		0x0c00
636 #define REG_RX_IQC_AB_A		0x0c10
637 #define REG_TXSCALE_A		0x0c1c
638 #define BB_SWING_MASK		GENMASK(31, 21)
639 #define REG_TX_AGC_A_CCK_11_CCK_1		0xc20
640 #define REG_TX_AGC_A_OFDM18_OFDM6		0xc24
641 #define REG_TX_AGC_A_OFDM54_OFDM24		0xc28
642 #define REG_TX_AGC_A_MCS3_MCS0			0xc2c
643 #define REG_TX_AGC_A_MCS7_MCS4			0xc30
644 #define REG_TX_AGC_A_MCS11_MCS8			0xc34
645 #define REG_TX_AGC_A_MCS15_MCS12		0xc38
646 #define REG_TX_AGC_A_NSS1_INDEX3_NSS1_INDEX0	0xc3c
647 #define REG_TX_AGC_A_NSS1_INDEX7_NSS1_INDEX4	0xc40
648 #define REG_TX_AGC_A_NSS2_INDEX1_NSS1_INDEX8	0xc44
649 #define REG_TX_AGC_A_NSS2_INDEX5_NSS2_INDEX2	0xc48
650 #define REG_TX_AGC_A_NSS2_INDEX9_NSS2_INDEX6	0xc4c
651 #define REG_RXIGI_A		0x0c50
652 #define REG_TX_PWR_TRAINING_A	0x0c54
653 #define REG_CK_MONHA		0x0c5c
654 #define REG_AFE_PWR1_A		0x0c60
655 #define REG_AFE_PWR2_A		0x0c64
656 #define REG_RX_WAIT_CCA_TX_CCK_RFON_A	0x0c68
657 #define REG_OFDM0_XA_TX_IQ_IMBALANCE	0x0c80
658 #define REG_OFDM0_A_TX_AFE	0x0c84
659 #define REG_OFDM0_XB_TX_IQ_IMBALANCE	0x0c88
660 #define REG_TSSI_TRK_SW		0x0c8c
661 #define REG_LSSI_WRITE_A	0x0c90
662 #define REG_PREDISTA		0x0c90
663 #define REG_TXAGCIDX		0x0c94
664 
665 #define REG_RFE_PINMUX_A	0x0cb0
666 #define REG_RFE_INV_A		0x0cb4
667 #define REG_RFE_CTRL8		0x0cb4
668 #define BIT_MASK_RFE_SEL89	GENMASK(7, 0)
669 #define PTA_CTRL_PIN		0x66
670 #define DPDT_CTRL_PIN		0x77
671 #define RFE_INV_MASK		0x3ff00000
672 #define REG_RFECTL_A		0x0cb8
673 #define REG_RFE_INV8		0x0cbd
674 #define BIT_MASK_RFE_INV89	GENMASK(1, 0)
675 #define REG_RFE_INV16		0x0cbe
676 #define BIT_RFE_BUF_EN		BIT(3)
677 
678 #define REG_IQK_DPD_CFG		0x0cc4
679 #define REG_CFG_PMPD		0x0cc8
680 #define REG_IQC_Y		0x0ccc
681 #define REG_IQC_X		0x0cd4
682 #define REG_INTPO_SETA		0x0ce8
683 
684 #define REG_IQKA_END		0x0d00
685 #define REG_PI_READ_A		0x0d04
686 #define REG_SI_READ_A		0x0d08
687 #define REG_IQKB_END		0x0d40
688 #define REG_PI_READ_B		0x0d44
689 #define REG_SI_READ_B		0x0d48
690 
691 #define REG_3WIRE_SWB		0x0e00
692 #define REG_RX_IQC_AB_B		0x0e10
693 #define REG_TXSCALE_B		0x0e1c
694 #define REG_TX_AGC_B_CCK_11_CCK_1		0xe20
695 #define REG_TX_AGC_B_OFDM18_OFDM6		0xe24
696 #define REG_TX_AGC_B_OFDM54_OFDM24		0xe28
697 #define REG_TX_AGC_B_MCS3_MCS0			0xe2c
698 #define REG_TX_AGC_B_MCS7_MCS4			0xe30
699 #define REG_TX_AGC_B_MCS11_MCS8			0xe34
700 #define REG_TX_AGC_B_MCS15_MCS12		0xe38
701 #define REG_TX_AGC_B_NSS1_INDEX3_NSS1_INDEX0	0xe3c
702 #define REG_TX_AGC_B_NSS1_INDEX7_NSS1_INDEX4	0xe40
703 #define REG_TX_AGC_B_NSS2_INDEX1_NSS1_INDEX8	0xe44
704 #define REG_TX_AGC_B_NSS2_INDEX5_NSS2_INDEX2	0xe48
705 #define REG_TX_AGC_B_NSS2_INDEX9_NSS2_INDEX6	0xe4c
706 #define REG_RXIGI_B		0x0e50
707 #define REG_TX_PWR_TRAINING_B	0x0e54
708 #define REG_CK_MONHB		0x0e5c
709 #define REG_AFE_PWR1_B		0x0e60
710 #define REG_AFE_PWR2_B		0x0e64
711 #define REG_RX_WAIT_CCA_TX_CCK_RFON_B	0x0e68
712 #define REG_TXTONEB		0x0e80
713 #define REG_RXTONEB		0x0e84
714 #define REG_TXPITMB		0x0e88
715 #define REG_RXPITMB		0x0e8c
716 #define REG_LSSI_WRITE_B	0x0e90
717 #define REG_PREDISTB		0x0e90
718 #define REG_INIDLYB		0x0e94
719 #define REG_RFE_PINMUX_B	0x0eb0
720 #define REG_RFE_INV_B		0x0eb4
721 #define REG_RFECTL_B		0x0eb8
722 #define REG_BPBDB		0x0ec4
723 #define REG_PHYTXONB		0x0ec8
724 #define REG_IQKYB		0x0ecc
725 #define REG_IQKXB		0x0ed4
726 #define REG_INTPO_SETB		0x0ee8
727 
728 #define REG_CRC_CCK		0x0f04
729 #define REG_CCA_OFDM		0x0f08
730 #define REG_CRC_VHT		0x0f0c
731 #define REG_CRC_HT		0x0f10
732 #define REG_CRC_OFDM		0x0f14
733 #define REG_FA_OFDM		0x0f48
734 #define REG_CCA_CCK		0x0fcc
735 
736 #define REG_ANAPARSW_MAC_0	0x1010
737 #define BIT_CF_L_V2		GENMASK(29, 28)
738 
739 #define REG_ANAPAR_XTAL_0	0x1040
740 #define BIT_XCAP_0		GENMASK(23, 10)
741 #define REG_CPU_DMEM_CON	0x1080
742 #define BIT_WL_PLATFORM_RST	BIT(16)
743 #define BIT_WL_SECURITY_CLK	BIT(15)
744 #define BIT_DDMA_EN		BIT(8)
745 
746 #define REG_SW_MDIO		0x10C0
747 
748 #define REG_H2C_PKT_READADDR	0x10D0
749 #define REG_H2C_PKT_WRITEADDR	0x10D4
750 #define REG_FW_DBG6		0x10F8
751 #define REG_FW_DBG7		0x10FC
752 #define FW_KEY_MASK		0xffffff00
753 
754 #define REG_CR_EXT		0x1100
755 
756 #define REG_FT1IMR		0x1138
757 #define BIT_FS_H2C_CMD_OK_INT_EN BIT(25)
758 #define REG_FT1ISR		0x113c
759 #define BIT_FS_H2C_CMD_OK_INT	BIT(25)
760 #define REG_DDMA_CH0SA		0x1200
761 #define REG_DDMA_CH0DA		0x1204
762 #define REG_DDMA_CH0CTRL	0x1208
763 #define BIT_DDMACH0_OWN		BIT(31)
764 #define BIT_DDMACH0_CHKSUM_EN	BIT(29)
765 #define BIT_DDMACH0_CHKSUM_STS	BIT(27)
766 #define BIT_DDMACH0_DDMA_MODE	BIT(26)
767 #define BIT_DDMACH0_RESET_CHKSUM_STS BIT(25)
768 #define BIT_DDMACH0_CHKSUM_CONT	BIT(24)
769 #define BIT_MASK_DDMACH0_DLEN	0x3ffff
770 
771 #define REG_H2CQ_CSR		0x1330
772 #define BIT_H2CQ_FULL		BIT(31)
773 #define REG_FAST_EDCA_VOVI_SETTING 0x1448
774 #define REG_FAST_EDCA_BEBK_SETTING 0x144C
775 
776 #define REG_RXPSF_CTRL		0x1610
777 #define BIT_RXGCK_FIFOTHR_EN	BIT(28)
778 
779 #define BIT_SHIFT_RXGCK_VHT_FIFOTHR 26
780 #define BIT_MASK_RXGCK_VHT_FIFOTHR 0x3
781 #define BIT_RXGCK_VHT_FIFOTHR(x)                                               \
782 	(((x) & BIT_MASK_RXGCK_VHT_FIFOTHR) << BIT_SHIFT_RXGCK_VHT_FIFOTHR)
783 #define BITS_RXGCK_VHT_FIFOTHR                                                 \
784 	(BIT_MASK_RXGCK_VHT_FIFOTHR << BIT_SHIFT_RXGCK_VHT_FIFOTHR)
785 
786 #define BIT_SHIFT_RXGCK_HT_FIFOTHR 24
787 #define BIT_MASK_RXGCK_HT_FIFOTHR 0x3
788 #define BIT_RXGCK_HT_FIFOTHR(x)                                                \
789 	(((x) & BIT_MASK_RXGCK_HT_FIFOTHR) << BIT_SHIFT_RXGCK_HT_FIFOTHR)
790 #define BITS_RXGCK_HT_FIFOTHR                                                  \
791 	(BIT_MASK_RXGCK_HT_FIFOTHR << BIT_SHIFT_RXGCK_HT_FIFOTHR)
792 
793 #define BIT_SHIFT_RXGCK_OFDM_FIFOTHR 22
794 #define BIT_MASK_RXGCK_OFDM_FIFOTHR 0x3
795 #define BIT_RXGCK_OFDM_FIFOTHR(x)                                              \
796 	(((x) & BIT_MASK_RXGCK_OFDM_FIFOTHR) << BIT_SHIFT_RXGCK_OFDM_FIFOTHR)
797 #define BITS_RXGCK_OFDM_FIFOTHR                                                \
798 	(BIT_MASK_RXGCK_OFDM_FIFOTHR << BIT_SHIFT_RXGCK_OFDM_FIFOTHR)
799 
800 #define BIT_SHIFT_RXGCK_CCK_FIFOTHR 20
801 #define BIT_MASK_RXGCK_CCK_FIFOTHR 0x3
802 #define BIT_RXGCK_CCK_FIFOTHR(x)                                               \
803 	(((x) & BIT_MASK_RXGCK_CCK_FIFOTHR) << BIT_SHIFT_RXGCK_CCK_FIFOTHR)
804 #define BITS_RXGCK_CCK_FIFOTHR                                                 \
805 	(BIT_MASK_RXGCK_CCK_FIFOTHR << BIT_SHIFT_RXGCK_CCK_FIFOTHR)
806 
807 #define BIT_RXGCK_OFDMCCA_EN BIT(16)
808 
809 #define BIT_SHIFT_RXPSF_PKTLENTHR 13
810 #define BIT_MASK_RXPSF_PKTLENTHR 0x7
811 #define BIT_RXPSF_PKTLENTHR(x)                                                 \
812 	(((x) & BIT_MASK_RXPSF_PKTLENTHR) << BIT_SHIFT_RXPSF_PKTLENTHR)
813 #define BITS_RXPSF_PKTLENTHR                                                   \
814 	(BIT_MASK_RXPSF_PKTLENTHR << BIT_SHIFT_RXPSF_PKTLENTHR)
815 #define BIT_CLEAR_RXPSF_PKTLENTHR(x) ((x) & (~BITS_RXPSF_PKTLENTHR))
816 #define BIT_SET_RXPSF_PKTLENTHR(x, v)                                          \
817 	(BIT_CLEAR_RXPSF_PKTLENTHR(x) | BIT_RXPSF_PKTLENTHR(v))
818 
819 #define BIT_RXPSF_CTRLEN	BIT(12)
820 #define BIT_RXPSF_VHTCHKEN	BIT(11)
821 #define BIT_RXPSF_HTCHKEN	BIT(10)
822 #define BIT_RXPSF_OFDMCHKEN	BIT(9)
823 #define BIT_RXPSF_CCKCHKEN	BIT(8)
824 #define BIT_RXPSF_OFDMRST	BIT(7)
825 #define BIT_RXPSF_CCKRST	BIT(6)
826 #define BIT_RXPSF_MHCHKEN	BIT(5)
827 #define BIT_RXPSF_CONT_ERRCHKEN	BIT(4)
828 #define BIT_RXPSF_ALL_ERRCHKEN	BIT(3)
829 
830 #define BIT_SHIFT_RXPSF_ERRTHR 0
831 #define BIT_MASK_RXPSF_ERRTHR 0x7
832 #define BIT_RXPSF_ERRTHR(x)                                                    \
833 	(((x) & BIT_MASK_RXPSF_ERRTHR) << BIT_SHIFT_RXPSF_ERRTHR)
834 #define BITS_RXPSF_ERRTHR (BIT_MASK_RXPSF_ERRTHR << BIT_SHIFT_RXPSF_ERRTHR)
835 #define BIT_CLEAR_RXPSF_ERRTHR(x) ((x) & (~BITS_RXPSF_ERRTHR))
836 #define BIT_GET_RXPSF_ERRTHR(x)                                                \
837 	(((x) >> BIT_SHIFT_RXPSF_ERRTHR) & BIT_MASK_RXPSF_ERRTHR)
838 #define BIT_SET_RXPSF_ERRTHR(x, v)                                             \
839 	(BIT_CLEAR_RXPSF_ERRTHR(x) | BIT_RXPSF_ERRTHR(v))
840 
841 #define REG_RXPSF_TYPE_CTRL	0x1614
842 #define REG_GENERAL_OPTION	0x1664
843 #define BIT_DUMMY_FCS_READY_MASK_EN BIT(9)
844 
845 #define REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1		0x1700
846 #define REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1	0x1704
847 #define REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1	0x1708
848 #define LTECOEX_READY		BIT(29)
849 #define LTECOEX_ACCESS_CTRL REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1
850 #define LTECOEX_WRITE_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1
851 #define LTECOEX_READ_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1
852 
853 #define REG_IGN_GNT_BT1	0x1860
854 
855 #define REG_RFESEL_CTRL	0x1990
856 
857 #define REG_NOMASK_TXBT	0x1ca7
858 #define REG_ANAPAR	0x1c30
859 #define BIT_ANAPAR_BTPS	BIT(22)
860 #define REG_RSTB_SEL	0x1c38
861 #define BIT_DAC_OFF_ENABLE	BIT(4)
862 #define BIT_PI_IGNORE_GNT_BT	BIT(3)
863 #define BIT_NOMASK_TXBT_ENABLE	BIT(3)
864 
865 #define REG_HRCV_MSG	0x1cf
866 
867 #define REG_EDCCA_REPORT	0x2d38
868 #define BIT_EDCCA_FLAG		BIT(24)
869 
870 #define REG_IGN_GNTBT4	0x4160
871 
872 #define REG_USB_MOD	0xf008
873 #define REG_USB3_RXITV	0xf050
874 #define REG_USB_HRPWM	0xfe58
875 
876 #define RF_MODE		0x00
877 #define RF_MODOPT	0x01
878 #define RF_WLINT	0x01
879 #define RF_WLSEL	0x02
880 #define RF_DTXLOK	0x08
881 #define RF_CFGCH	0x18
882 #define BIT_BAND	GENMASK(18, 16)
883 #define RF18_BAND_MASK	(BIT(16) | BIT(9) | BIT(8))
884 #define RF18_CHANNEL_MASK	(MASKBYTE0)
885 #define RF18_RFSI_MASK	(BIT(18) | BIT(17))
886 #define RF_RCK		0x1d
887 #define RF_MODE_TABLE_ADDR	0x30
888 #define RF_MODE_TABLE_DATA0	0x31
889 #define RF_MODE_TABLE_DATA1	0x32
890 #define RF_LUTWA	0x33
891 #define RF_LUTWD1	0x3e
892 #define RF_LUTWD0	0x3f
893 #define BIT_GAIN_EXT	BIT(12)
894 #define BIT_DATA_L	GENMASK(11, 0)
895 #define RF_T_METER	0x42
896 #define RF_BSPAD	0x54
897 #define RF_GAINTX	0x56
898 #define RF_TXMOD	0x58
899 #define RF_TXATANK	0x64
900 #define RF_TXA_PREPAD	0x65
901 #define RF_TRXIQ	0x66
902 #define RF_RXIQGEN	0x8d
903 #define RF_RXBB2	0x8f
904 #define RF_SYN_PFD	0xb0
905 #define RF_LCK		0xb4
906 #define RF_XTALX2	0xb8
907 #define RF_SYN_CTRL	0xbb
908 #define RF_MALSEL	0xbe
909 #define RF_SYN_AAC	0xc9
910 #define RF_AAC_CTRL	0xca
911 #define RF_FAST_LCK	0xcc
912 #define RF_RCKD		0xde
913 #define RF_TXADBG	0xde
914 #define RF_LUTDBG	0xdf
915 #define BIT_TXA_TANK	BIT(4)
916 #define RF_LUTWE2	0xee
917 #define RF_LUTWE	0xef
918 
919 #define LTE_COEX_CTRL	0x38
920 #define LTE_WL_TRX_CTRL	0xa0
921 #define LTE_BT_TRX_CTRL	0xa4
922 
923 #endif
924