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 REG_SYS_PW_CTRL		0x0004
13 #define REG_SYS_CLK_CTRL	0x0008
14 #define BIT_CPU_CLK_EN		BIT(14)
15 
16 #define REG_RSV_CTRL		0x001C
17 #define DISABLE_PI		0x3
18 #define ENABLE_PI		0x2
19 #define BITS_RFC_DIRECT		(BIT(31) | BIT(30))
20 #define BIT_WLMCU_IOIF		BIT(0)
21 #define REG_RF_CTRL		0x001F
22 #define BIT_RF_SDM_RSTB		BIT(2)
23 #define BIT_RF_RSTB		BIT(1)
24 #define BIT_RF_EN		BIT(0)
25 
26 #define REG_AFE_CTRL1		0x0024
27 #define BIT_MAC_CLK_SEL		(BIT(20) | BIT(21))
28 #define REG_EFUSE_CTRL		0x0030
29 #define BIT_EF_FLAG		BIT(31)
30 #define BIT_SHIFT_EF_ADDR	8
31 #define BIT_MASK_EF_ADDR	0x3ff
32 #define BIT_MASK_EF_DATA	0xff
33 #define BITS_EF_ADDR		(BIT_MASK_EF_ADDR << BIT_SHIFT_EF_ADDR)
34 
35 #define REG_LDO_EFUSE_CTRL	0x0034
36 #define BIT_MASK_EFUSE_BANK_SEL	(BIT(8) | BIT(9))
37 
38 #define REG_GPIO_MUXCFG		0x0040
39 #define BIT_FSPI_EN		BIT(19)
40 #define BIT_WLRFE_4_5_EN	BIT(2)
41 
42 #define REG_LED_CFG		0x004C
43 #define BIT_LNAON_SEL_EN	BIT(26)
44 #define BIT_PAPE_SEL_EN		BIT(25)
45 #define REG_PAD_CTRL1		0x0064
46 #define BIT_PAPE_WLBT_SEL	BIT(29)
47 #define BIT_LNAON_WLBT_SEL	BIT(28)
48 #define REG_WL_BT_PWR_CTRL	0x0068
49 #define BIT_BT_FUNC_EN		BIT(18)
50 #define BIT_BT_DIG_CLK_EN	BIT(8)
51 #define REG_HCI_OPT_CTRL	0x0074
52 
53 #define REG_MCUFW_CTRL		0x0080
54 #define BIT_ANA_PORT_EN		BIT(22)
55 #define BIT_MAC_PORT_EN		BIT(21)
56 #define BIT_BOOT_FSPI_EN	BIT(20)
57 #define BIT_FW_INIT_RDY		BIT(15)
58 #define BIT_FW_DW_RDY		BIT(14)
59 #define BIT_RPWM_TOGGLE		BIT(7)
60 #define BIT_DMEM_CHKSUM_OK	BIT(6)
61 #define BIT_DMEM_DW_OK		BIT(5)
62 #define BIT_IMEM_CHKSUM_OK	BIT(4)
63 #define BIT_IMEM_DW_OK		BIT(3)
64 #define BIT_IMEM_BOOT_LOAD_CHECKSUM_OK BIT(2)
65 #define BIT_MCUFWDL_EN		BIT(0)
66 #define BIT_CHECK_SUM_OK	(BIT(4) | BIT(6))
67 #define FW_READY		(BIT_FW_INIT_RDY | BIT_FW_DW_RDY |             \
68 				 BIT_IMEM_DW_OK | BIT_DMEM_DW_OK |             \
69 				 BIT_CHECK_SUM_OK)
70 #define FW_READY_MASK		0xffff
71 
72 #define REG_WLRF1		0x00EC
73 #define REG_SYS_CFG1		0x00F0
74 #define	BIT_RTL_ID		BIT(23)
75 #define BIT_RF_TYPE_ID		BIT(27)
76 #define BIT_SHIFT_VENDOR_ID	16
77 #define BIT_MASK_VENDOR_ID	0xf
78 #define BIT_VENDOR_ID(x) (((x) & BIT_MASK_VENDOR_ID) << BIT_SHIFT_VENDOR_ID)
79 #define BITS_VENDOR_ID		(BIT_MASK_VENDOR_ID << BIT_SHIFT_VENDOR_ID)
80 #define BIT_CLEAR_VENDOR_ID(x)	((x) & (~BITS_VENDOR_ID))
81 #define BIT_GET_VENDOR_ID(x) (((x) >> BIT_SHIFT_VENDOR_ID) & BIT_MASK_VENDOR_ID)
82 #define BIT_SHIFT_CHIP_VER	12
83 #define BIT_MASK_CHIP_VER	0xf
84 #define BIT_CHIP_VER(x)	 (((x) & BIT_MASK_CHIP_VER) << BIT_SHIFT_CHIP_VER)
85 #define BITS_CHIP_VER		(BIT_MASK_CHIP_VER << BIT_SHIFT_CHIP_VER)
86 #define BIT_CLEAR_CHIP_VER(x)	((x) & (~BITS_CHIP_VER))
87 #define BIT_GET_CHIP_VER(x) (((x) >> BIT_SHIFT_CHIP_VER) & BIT_MASK_CHIP_VER)
88 #define REG_SYS_STATUS1		0x00F4
89 #define REG_SYS_STATUS2		0x00F8
90 #define REG_SYS_CFG2		0x00FC
91 #define REG_WLRF1		0x00EC
92 #define BIT_WLRF1_BBRF_EN	(BIT(24) | BIT(25) | BIT(26))
93 #define REG_CR			0x0100
94 #define BIT_32K_CAL_TMR_EN	BIT(10)
95 #define BIT_MAC_SEC_EN		BIT(9)
96 #define BIT_ENSWBCN		BIT(8)
97 #define BIT_MACRXEN		BIT(7)
98 #define BIT_MACTXEN		BIT(6)
99 #define BIT_SCHEDULE_EN		BIT(5)
100 #define BIT_PROTOCOL_EN		BIT(4)
101 #define BIT_RXDMA_EN		BIT(3)
102 #define BIT_TXDMA_EN		BIT(2)
103 #define BIT_HCI_RXDMA_EN	BIT(1)
104 #define BIT_HCI_TXDMA_EN	BIT(0)
105 #define MAC_TRX_ENABLE	(BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \
106 			BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \
107 			BIT_MACTXEN | BIT_MACRXEN)
108 #define BIT_SHIFT_TXDMA_VOQ_MAP	4
109 #define BIT_MASK_TXDMA_VOQ_MAP	0x3
110 #define BIT_TXDMA_VOQ_MAP(x)                                                   \
111 	(((x) & BIT_MASK_TXDMA_VOQ_MAP) << BIT_SHIFT_TXDMA_VOQ_MAP)
112 #define BIT_SHIFT_TXDMA_VIQ_MAP	6
113 #define BIT_MASK_TXDMA_VIQ_MAP	0x3
114 #define BIT_TXDMA_VIQ_MAP(x)                                                   \
115 	(((x) & BIT_MASK_TXDMA_VIQ_MAP) << BIT_SHIFT_TXDMA_VIQ_MAP)
116 #define REG_TXDMA_PQ_MAP	0x010C
117 #define BIT_SHIFT_TXDMA_BEQ_MAP	8
118 #define BIT_MASK_TXDMA_BEQ_MAP	0x3
119 #define BIT_TXDMA_BEQ_MAP(x)                                                   \
120 	(((x) & BIT_MASK_TXDMA_BEQ_MAP) << BIT_SHIFT_TXDMA_BEQ_MAP)
121 #define BIT_SHIFT_TXDMA_BKQ_MAP	10
122 #define BIT_MASK_TXDMA_BKQ_MAP	0x3
123 #define BIT_TXDMA_BKQ_MAP(x)                                                   \
124 	(((x) & BIT_MASK_TXDMA_BKQ_MAP) << BIT_SHIFT_TXDMA_BKQ_MAP)
125 #define BIT_SHIFT_TXDMA_MGQ_MAP	12
126 #define BIT_MASK_TXDMA_MGQ_MAP	0x3
127 #define BIT_TXDMA_MGQ_MAP(x)                                                   \
128 	(((x) & BIT_MASK_TXDMA_MGQ_MAP) << BIT_SHIFT_TXDMA_MGQ_MAP)
129 #define BIT_SHIFT_TXDMA_HIQ_MAP	14
130 #define BIT_MASK_TXDMA_HIQ_MAP	0x3
131 #define BIT_TXDMA_HIQ_MAP(x)                                                   \
132 	(((x) & BIT_MASK_TXDMA_HIQ_MAP) << BIT_SHIFT_TXDMA_HIQ_MAP)
133 #define BIT_SHIFT_TXSC_40M	4
134 #define BIT_MASK_TXSC_40M	0xf
135 #define BIT_TXSC_40M(x)							       \
136 	(((x) & BIT_MASK_TXSC_40M) << BIT_SHIFT_TXSC_40M)
137 #define BIT_SHIFT_TXSC_20M	0
138 #define BIT_MASK_TXSC_20M	0xf
139 #define BIT_TXSC_20M(x)							       \
140 	(((x) & BIT_MASK_TXSC_20M) << BIT_SHIFT_TXSC_20M)
141 #define BIT_SHIFT_MAC_CLK_SEL	20
142 #define MAC_CLK_HW_DEF_80M	0
143 #define MAC_CLK_HW_DEF_40M	1
144 #define MAC_CLK_HW_DEF_20M	2
145 #define MAC_CLK_SPEED		80
146 
147 #define REG_CR			0x0100
148 #define REG_TRXFF_BNDY		0x0114
149 #define REG_RXFF_BNDY		0x011C
150 #define REG_PKTBUF_DBG_CTRL	0x0140
151 #define REG_C2HEVT		0x01A0
152 #define REG_HMETFR		0x01CC
153 #define REG_HMEBOX0		0x01D0
154 #define REG_HMEBOX1		0x01D4
155 #define REG_HMEBOX2		0x01D8
156 #define REG_HMEBOX3		0x01DC
157 #define REG_HMEBOX0_EX		0x01F0
158 #define REG_HMEBOX1_EX		0x01F4
159 #define REG_HMEBOX2_EX		0x01F8
160 #define REG_HMEBOX3_EX		0x01FC
161 
162 #define REG_FIFOPAGE_CTRL_2	0x0204
163 #define BIT_BCN_VALID_V1	BIT(15)
164 #define BIT_MASK_BCN_HEAD_1_V1	0xfff
165 #define REG_AUTO_LLT_V1		0x0208
166 #define BIT_AUTO_INIT_LLT_V1	BIT(0)
167 #define REG_TXDMA_OFFSET_CHK	0x020C
168 #define REG_TXDMA_STATUS	0x0210
169 #define BTI_PAGE_OVF		BIT(2)
170 #define REG_RQPN_CTRL_1		0x0228
171 #define REG_RQPN_CTRL_2		0x022C
172 #define BIT_LD_RQPN		BIT(31)
173 #define REG_FIFOPAGE_INFO_1	0x0230
174 #define REG_FIFOPAGE_INFO_2	0x0234
175 #define REG_FIFOPAGE_INFO_3	0x0238
176 #define REG_FIFOPAGE_INFO_4	0x023C
177 #define REG_FIFOPAGE_INFO_5	0x0240
178 #define REG_H2C_HEAD		0x0244
179 #define REG_H2C_TAIL		0x0248
180 #define REG_H2C_READ_ADDR	0x024C
181 #define REG_H2C_INFO		0x0254
182 
183 #define REG_FWHW_TXQ_CTRL	0x0420
184 #define BIT_EN_BCNQ_DL		BIT(22)
185 #define BIT_EN_WR_FREE_TAIL	BIT(20)
186 #define REG_BCNQ_BDNY_V1	0x0424
187 #define REG_LIFETIME_EN		0x0426
188 #define BIT_BA_PARSER_EN	BIT(5)
189 #define REG_SPEC_SIFS		0x0428
190 #define REG_DARFRC		0x0430
191 #define REG_DARFRCH		0x0434
192 #define REG_RARFRCH		0x043C
193 #define REG_ARFR0		0x0444
194 #define REG_ARFRH0		0x0448
195 #define REG_ARFR1_V1		0x044C
196 #define REG_ARFRH1_V1		0x0450
197 #define REG_CCK_CHECK		0x0454
198 #define BIT_CHECK_CCK_EN	BIT(7)
199 #define REG_AMPDU_MAX_TIME_V1	0x0455
200 #define REG_BCNQ1_BDNY_V1	0x0456
201 #define REG_TX_HANG_CTRL	0x045E
202 #define BIT_EN_EOF_V1		BIT(2)
203 #define REG_DATA_SC		0x0483
204 #define REG_ARFR4		0x049C
205 #define REG_ARFRH4		0x04A0
206 #define REG_ARFR5		0x04A4
207 #define REG_ARFRH5		0x04A8
208 #define REG_SW_AMPDU_BURST_MODE_CTRL 0x04BC
209 #define BIT_PRE_TX_CMD		BIT(6)
210 #define REG_PROT_MODE_CTRL	0x04C8
211 #define REG_BAR_MODE_CTRL	0x04CC
212 #define REG_PRECNT_CTRL		0x04E5
213 #define BIT_EN_PRECNT		BIT(11)
214 
215 #define REG_EDCA_VO_PARAM	0x0500
216 #define REG_EDCA_VI_PARAM	0x0504
217 #define REG_EDCA_BE_PARAM	0x0508
218 #define REG_EDCA_BK_PARAM	0x050C
219 #define REG_PIFS		0x0512
220 #define REG_SIFS		0x0514
221 #define BIT_SHIFT_SIFS_OFDM_CTX	8
222 #define BIT_SHIFT_SIFS_CCK_TRX	16
223 #define BIT_SHIFT_SIFS_OFDM_TRX	24
224 #define REG_SLOT		0x051B
225 #define REG_TX_PTCL_CTRL	0x0520
226 #define BIT_SIFS_BK_EN		BIT(12)
227 #define REG_TXPAUSE		0x0522
228 #define REG_RD_CTRL		0x0524
229 #define BIT_DIS_TXOP_CFE	BIT(10)
230 #define BIT_DIS_LSIG_CFE	BIT(9)
231 #define BIT_DIS_STBC_CFE	BIT(8)
232 #define REG_TBTT_PROHIBIT	0x0540
233 #define BIT_SHIFT_TBTT_HOLD_TIME_AP 8
234 #define REG_RD_NAV_NXT		0x0544
235 #define REG_BCN_CTRL		0x0550
236 #define BIT_DIS_TSF_UDT		BIT(4)
237 #define BIT_EN_BCN_FUNCTION	BIT(3)
238 #define REG_BCN_CTRL_CLINT0	0x0551
239 #define REG_DRVERLYINT		0x0558
240 #define REG_BCNDMATIM		0x0559
241 #define REG_USTIME_TSF		0x055C
242 #define REG_BCN_MAX_ERR		0x055D
243 #define REG_RXTSF_OFFSET_CCK	0x055E
244 #define REG_MISC_CTRL		0x0577
245 #define BIT_EN_FREE_CNT		BIT(3)
246 #define BIT_DIS_SECOND_CCA	(BIT(0) | BIT(1))
247 #define REG_TIMER0_SRC_SEL	0x05B4
248 #define BIT_TSFT_SEL_TIMER0	(BIT(4) | BIT(5) | BIT(6))
249 
250 #define REG_TCR			0x0604
251 #define REG_RCR			0x0608
252 #define BIT_APP_FCS		BIT(31)
253 #define BIT_APP_MIC		BIT(30)
254 #define BIT_APP_ICV		BIT(29)
255 #define BIT_APP_PHYSTS		BIT(28)
256 #define BIT_APP_BASSN		BIT(27)
257 #define BIT_VHT_DACK		BIT(26)
258 #define BIT_TCPOFLD_EN		BIT(25)
259 #define BIT_ENMBID		BIT(24)
260 #define BIT_LSIGEN		BIT(23)
261 #define BIT_MFBEN		BIT(22)
262 #define BIT_DISCHKPPDLLEN	BIT(21)
263 #define BIT_PKTCTL_DLEN		BIT(20)
264 #define BIT_TIM_PARSER_EN	BIT(18)
265 #define BIT_BC_MD_EN		BIT(17)
266 #define BIT_UC_MD_EN		BIT(16)
267 #define BIT_RXSK_PERPKT		BIT(15)
268 #define BIT_HTC_LOC_CTRL	BIT(14)
269 #define BIT_RPFM_CAM_ENABLE	BIT(12)
270 #define BIT_TA_BCN		BIT(11)
271 #define BIT_DISDECMYPKT		BIT(10)
272 #define BIT_AICV		BIT(9)
273 #define BIT_ACRC32		BIT(8)
274 #define BIT_CBSSID_BCN		BIT(7)
275 #define BIT_CBSSID_DATA		BIT(6)
276 #define BIT_APWRMGT		BIT(5)
277 #define BIT_ADD3		BIT(4)
278 #define BIT_AB			BIT(3)
279 #define BIT_AM			BIT(2)
280 #define BIT_APM			BIT(1)
281 #define BIT_AAP			BIT(0)
282 #define REG_RX_PKT_LIMIT	0x060C
283 #define REG_RX_DRVINFO_SZ	0x060F
284 #define BIT_APP_PHYSTS		BIT(28)
285 #define REG_USTIME_EDCA		0x0638
286 #define REG_ACKTO_CCK		0x0639
287 #define REG_RESP_SIFS_CCK	0x063C
288 #define REG_RESP_SIFS_OFDM	0x063E
289 #define REG_ACKTO		0x0640
290 #define REG_EIFS		0x0642
291 #define REG_NAV_CTRL		0x0650
292 #define REG_WMAC_TRXPTCL_CTL	0x0668
293 #define BIT_RFMOD		(BIT(7) | BIT(8))
294 #define BIT_RFMOD_80M		BIT(8)
295 #define BIT_RFMOD_40M		BIT(7)
296 #define REG_WMAC_TRXPTCL_CTL_H	0x066C
297 #define REG_RXFLTMAP0		0x06A0
298 #define REG_RXFLTMAP1		0x06A2
299 #define REG_RXFLTMAP2		0x06A4
300 #define REG_BBPSF_CTRL		0x06DC
301 
302 #define REG_WMAC_OPTION_FUNCTION 0x07D0
303 #define REG_WMAC_OPTION_FUNCTION_1 0x07D4
304 
305 #define REG_ANAPAR_XTAL_0	0x1040
306 #define REG_CPU_DMEM_CON	0x1080
307 #define BIT_WL_PLATFORM_RST	BIT(16)
308 #define BIT_WL_SECURITY_CLK	BIT(15)
309 #define BIT_DDMA_EN		BIT(8)
310 
311 #define REG_H2C_PKT_READADDR	0x10D0
312 #define REG_H2C_PKT_WRITEADDR	0x10D4
313 #define REG_FW_DBG7		0x10FC
314 #define FW_KEY_MASK		0xffffff00
315 
316 #define REG_CR_EXT		0x1100
317 
318 #define REG_DDMA_CH0SA		0x1200
319 #define REG_DDMA_CH0DA		0x1204
320 #define REG_DDMA_CH0CTRL	0x1208
321 #define BIT_DDMACH0_OWN		BIT(31)
322 #define BIT_DDMACH0_CHKSUM_EN	BIT(29)
323 #define BIT_DDMACH0_CHKSUM_STS	BIT(27)
324 #define BIT_DDMACH0_RESET_CHKSUM_STS BIT(25)
325 #define BIT_DDMACH0_CHKSUM_CONT	BIT(24)
326 #define BIT_MASK_DDMACH0_DLEN	0x3ffff
327 
328 #define REG_H2CQ_CSR		0x1330
329 #define BIT_H2CQ_FULL		BIT(31)
330 #define REG_FAST_EDCA_VOVI_SETTING 0x1448
331 #define REG_FAST_EDCA_BEBK_SETTING 0x144C
332 
333 #define REG_RXPSF_CTRL		0x1610
334 #define BIT_RXGCK_FIFOTHR_EN	BIT(28)
335 
336 #define BIT_SHIFT_RXGCK_VHT_FIFOTHR 26
337 #define BIT_MASK_RXGCK_VHT_FIFOTHR 0x3
338 #define BIT_RXGCK_VHT_FIFOTHR(x)                                               \
339 	(((x) & BIT_MASK_RXGCK_VHT_FIFOTHR) << BIT_SHIFT_RXGCK_VHT_FIFOTHR)
340 #define BITS_RXGCK_VHT_FIFOTHR                                                 \
341 	(BIT_MASK_RXGCK_VHT_FIFOTHR << BIT_SHIFT_RXGCK_VHT_FIFOTHR)
342 
343 #define BIT_SHIFT_RXGCK_HT_FIFOTHR 24
344 #define BIT_MASK_RXGCK_HT_FIFOTHR 0x3
345 #define BIT_RXGCK_HT_FIFOTHR(x)                                                \
346 	(((x) & BIT_MASK_RXGCK_HT_FIFOTHR) << BIT_SHIFT_RXGCK_HT_FIFOTHR)
347 #define BITS_RXGCK_HT_FIFOTHR                                                  \
348 	(BIT_MASK_RXGCK_HT_FIFOTHR << BIT_SHIFT_RXGCK_HT_FIFOTHR)
349 
350 #define BIT_SHIFT_RXGCK_OFDM_FIFOTHR 22
351 #define BIT_MASK_RXGCK_OFDM_FIFOTHR 0x3
352 #define BIT_RXGCK_OFDM_FIFOTHR(x)                                              \
353 	(((x) & BIT_MASK_RXGCK_OFDM_FIFOTHR) << BIT_SHIFT_RXGCK_OFDM_FIFOTHR)
354 #define BITS_RXGCK_OFDM_FIFOTHR                                                \
355 	(BIT_MASK_RXGCK_OFDM_FIFOTHR << BIT_SHIFT_RXGCK_OFDM_FIFOTHR)
356 
357 #define BIT_SHIFT_RXGCK_CCK_FIFOTHR 20
358 #define BIT_MASK_RXGCK_CCK_FIFOTHR 0x3
359 #define BIT_RXGCK_CCK_FIFOTHR(x)                                               \
360 	(((x) & BIT_MASK_RXGCK_CCK_FIFOTHR) << BIT_SHIFT_RXGCK_CCK_FIFOTHR)
361 #define BITS_RXGCK_CCK_FIFOTHR                                                 \
362 	(BIT_MASK_RXGCK_CCK_FIFOTHR << BIT_SHIFT_RXGCK_CCK_FIFOTHR)
363 
364 #define BIT_RXGCK_OFDMCCA_EN BIT(16)
365 
366 #define BIT_SHIFT_RXPSF_PKTLENTHR 13
367 #define BIT_MASK_RXPSF_PKTLENTHR 0x7
368 #define BIT_RXPSF_PKTLENTHR(x)                                                 \
369 	(((x) & BIT_MASK_RXPSF_PKTLENTHR) << BIT_SHIFT_RXPSF_PKTLENTHR)
370 #define BITS_RXPSF_PKTLENTHR                                                   \
371 	(BIT_MASK_RXPSF_PKTLENTHR << BIT_SHIFT_RXPSF_PKTLENTHR)
372 #define BIT_CLEAR_RXPSF_PKTLENTHR(x) ((x) & (~BITS_RXPSF_PKTLENTHR))
373 #define BIT_SET_RXPSF_PKTLENTHR(x, v)                                          \
374 	(BIT_CLEAR_RXPSF_PKTLENTHR(x) | BIT_RXPSF_PKTLENTHR(v))
375 
376 #define BIT_RXPSF_CTRLEN	BIT(12)
377 #define BIT_RXPSF_VHTCHKEN	BIT(11)
378 #define BIT_RXPSF_HTCHKEN	BIT(10)
379 #define BIT_RXPSF_OFDMCHKEN	BIT(9)
380 #define BIT_RXPSF_CCKCHKEN	BIT(8)
381 #define BIT_RXPSF_OFDMRST	BIT(7)
382 #define BIT_RXPSF_CCKRST	BIT(6)
383 #define BIT_RXPSF_MHCHKEN	BIT(5)
384 #define BIT_RXPSF_CONT_ERRCHKEN	BIT(4)
385 #define BIT_RXPSF_ALL_ERRCHKEN	BIT(3)
386 
387 #define BIT_SHIFT_RXPSF_ERRTHR 0
388 #define BIT_MASK_RXPSF_ERRTHR 0x7
389 #define BIT_RXPSF_ERRTHR(x)                                                    \
390 	(((x) & BIT_MASK_RXPSF_ERRTHR) << BIT_SHIFT_RXPSF_ERRTHR)
391 #define BITS_RXPSF_ERRTHR (BIT_MASK_RXPSF_ERRTHR << BIT_SHIFT_RXPSF_ERRTHR)
392 #define BIT_CLEAR_RXPSF_ERRTHR(x) ((x) & (~BITS_RXPSF_ERRTHR))
393 #define BIT_GET_RXPSF_ERRTHR(x)                                                \
394 	(((x) >> BIT_SHIFT_RXPSF_ERRTHR) & BIT_MASK_RXPSF_ERRTHR)
395 #define BIT_SET_RXPSF_ERRTHR(x, v)                                             \
396 	(BIT_CLEAR_RXPSF_ERRTHR(x) | BIT_RXPSF_ERRTHR(v))
397 
398 #define REG_RXPSF_TYPE_CTRL	0x1614
399 #define REG_GENERAL_OPTION	0x1664
400 #define BIT_DUMMY_FCS_READY_MASK_EN BIT(9)
401 
402 #define REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1		0x1700
403 #define REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1	0x1704
404 #define REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1	0x1708
405 #define LTECOEX_READY		BIT(29)
406 #define LTECOEX_ACCESS_CTRL REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1
407 #define LTECOEX_WRITE_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1
408 #define LTECOEX_READ_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1
409 
410 #define RF_DTXLOK	0x08
411 #define RF_CFGCH	0x18
412 #define RF_LUTWA	0x33
413 #define RF_LUTWD1	0x3e
414 #define RF_LUTWD0	0x3f
415 #define RF_XTALX2	0xb8
416 #define RF_MALSEL	0xbe
417 #define RF_LUTDBG	0xdf
418 #define RF_LUTWE2	0xee
419 #define RF_LUTWE	0xef
420 
421 #endif
422