xref: /linux/drivers/net/wireless/realtek/rtl8xxxu/regs.h (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
1*028fa281SKalle Valo /* SPDX-License-Identifier: GPL-2.0-only */
2*028fa281SKalle Valo /*
3*028fa281SKalle Valo  * Copyright (c) 2014 - 2017 Jes Sorensen <Jes.Sorensen@gmail.com>
4*028fa281SKalle Valo  *
5*028fa281SKalle Valo  * Register definitions taken from original Realtek rtl8723au driver
6*028fa281SKalle Valo  */
7*028fa281SKalle Valo 
8*028fa281SKalle Valo /* 0x0000 ~ 0x00FF	System Configuration */
9*028fa281SKalle Valo #define REG_SYS_ISO_CTRL		0x0000
10*028fa281SKalle Valo #define  SYS_ISO_MD2PP			BIT(0)
11*028fa281SKalle Valo #define  SYS_ISO_ANALOG_IPS		BIT(5)
12*028fa281SKalle Valo #define  SYS_ISO_DIOR			BIT(9)
13*028fa281SKalle Valo #define  SYS_ISO_PWC_EV25V		BIT(14)
14*028fa281SKalle Valo #define  SYS_ISO_PWC_EV12V		BIT(15)
15*028fa281SKalle Valo 
16*028fa281SKalle Valo #define REG_SYS_FUNC			0x0002
17*028fa281SKalle Valo #define  SYS_FUNC_BBRSTB		BIT(0)
18*028fa281SKalle Valo #define  SYS_FUNC_BB_GLB_RSTN		BIT(1)
19*028fa281SKalle Valo #define  SYS_FUNC_USBA			BIT(2)
20*028fa281SKalle Valo #define  SYS_FUNC_UPLL			BIT(3)
21*028fa281SKalle Valo #define  SYS_FUNC_USBD			BIT(4)
22*028fa281SKalle Valo #define  SYS_FUNC_DIO_PCIE		BIT(5)
23*028fa281SKalle Valo #define  SYS_FUNC_PCIEA			BIT(6)
24*028fa281SKalle Valo #define  SYS_FUNC_PPLL			BIT(7)
25*028fa281SKalle Valo #define  SYS_FUNC_PCIED			BIT(8)
26*028fa281SKalle Valo #define  SYS_FUNC_DIOE			BIT(9)
27*028fa281SKalle Valo #define  SYS_FUNC_CPU_ENABLE		BIT(10)
28*028fa281SKalle Valo #define  SYS_FUNC_DCORE			BIT(11)
29*028fa281SKalle Valo #define  SYS_FUNC_ELDR			BIT(12)
30*028fa281SKalle Valo #define  SYS_FUNC_DIO_RF		BIT(13)
31*028fa281SKalle Valo #define  SYS_FUNC_HWPDN			BIT(14)
32*028fa281SKalle Valo #define  SYS_FUNC_MREGEN		BIT(15)
33*028fa281SKalle Valo 
34*028fa281SKalle Valo #define REG_APS_FSMCO			0x0004
35*028fa281SKalle Valo #define  APS_FSMCO_PFM_ALDN		BIT(1)
36*028fa281SKalle Valo #define  APS_FSMCO_PFM_WOWL		BIT(3)
37*028fa281SKalle Valo #define  APS_FSMCO_ENABLE_POWERDOWN	BIT(4)
38*028fa281SKalle Valo #define  APS_FSMCO_MAC_ENABLE		BIT(8)
39*028fa281SKalle Valo #define  APS_FSMCO_MAC_OFF		BIT(9)
40*028fa281SKalle Valo #define  APS_FSMCO_SW_LPS		BIT(10)
41*028fa281SKalle Valo #define  APS_FSMCO_HW_SUSPEND		BIT(11)
42*028fa281SKalle Valo #define  APS_FSMCO_PCIE			BIT(12)
43*028fa281SKalle Valo #define  APS_FSMCO_HW_POWERDOWN		BIT(15)
44*028fa281SKalle Valo #define  APS_FSMCO_WLON_RESET		BIT(16)
45*028fa281SKalle Valo 
46*028fa281SKalle Valo #define REG_SYS_CLKR			0x0008
47*028fa281SKalle Valo #define  SYS_CLK_ANAD16V_ENABLE		BIT(0)
48*028fa281SKalle Valo #define  SYS_CLK_ANA8M			BIT(1)
49*028fa281SKalle Valo #define  SYS_CLK_MACSLP			BIT(4)
50*028fa281SKalle Valo #define  SYS_CLK_LOADER_ENABLE		BIT(5)
51*028fa281SKalle Valo #define  SYS_CLK_80M_SSC_DISABLE	BIT(7)
52*028fa281SKalle Valo #define  SYS_CLK_80M_SSC_ENABLE_HO	BIT(8)
53*028fa281SKalle Valo #define  SYS_CLK_PHY_SSC_RSTB		BIT(9)
54*028fa281SKalle Valo #define  SYS_CLK_SEC_CLK_ENABLE		BIT(10)
55*028fa281SKalle Valo #define  SYS_CLK_MAC_CLK_ENABLE		BIT(11)
56*028fa281SKalle Valo #define  SYS_CLK_ENABLE			BIT(12)
57*028fa281SKalle Valo #define  SYS_CLK_RING_CLK_ENABLE	BIT(13)
58*028fa281SKalle Valo 
59*028fa281SKalle Valo #define REG_9346CR			0x000a
60*028fa281SKalle Valo #define  EEPROM_BOOT			BIT(4)
61*028fa281SKalle Valo #define  EEPROM_ENABLE			BIT(5)
62*028fa281SKalle Valo 
63*028fa281SKalle Valo #define REG_EE_VPD			0x000c
64*028fa281SKalle Valo #define REG_AFE_MISC			0x0010
65*028fa281SKalle Valo #define  AFE_MISC_WL_XTAL_CTRL		BIT(6)
66*028fa281SKalle Valo 
67*028fa281SKalle Valo #define REG_SPS0_CTRL			0x0011
68*028fa281SKalle Valo #define REG_SPS_OCP_CFG			0x0018
69*028fa281SKalle Valo #define REG_8192E_LDOV12_CTRL		0x0014
70*028fa281SKalle Valo #define REG_SYS_SWR_CTRL2		0x0014
71*028fa281SKalle Valo #define REG_RSV_CTRL			0x001c
72*028fa281SKalle Valo #define  RSV_CTRL_WLOCK_1C		BIT(5)
73*028fa281SKalle Valo #define  RSV_CTRL_DIS_PRST		BIT(6)
74*028fa281SKalle Valo 
75*028fa281SKalle Valo #define REG_RF_CTRL			0x001f
76*028fa281SKalle Valo #define  RF_ENABLE			BIT(0)
77*028fa281SKalle Valo #define  RF_RSTB			BIT(1)
78*028fa281SKalle Valo #define  RF_SDMRSTB			BIT(2)
79*028fa281SKalle Valo 
80*028fa281SKalle Valo #define REG_LDOA15_CTRL			0x0020
81*028fa281SKalle Valo #define  LDOA15_ENABLE			BIT(0)
82*028fa281SKalle Valo #define  LDOA15_STANDBY			BIT(1)
83*028fa281SKalle Valo #define  LDOA15_OBUF			BIT(2)
84*028fa281SKalle Valo #define  LDOA15_REG_VOS			BIT(3)
85*028fa281SKalle Valo #define  LDOA15_VOADJ_SHIFT		4
86*028fa281SKalle Valo 
87*028fa281SKalle Valo #define REG_LDOV12D_CTRL		0x0021
88*028fa281SKalle Valo #define  LDOV12D_ENABLE			BIT(0)
89*028fa281SKalle Valo #define  LDOV12D_STANDBY		BIT(1)
90*028fa281SKalle Valo #define  LDOV12D_VADJ_SHIFT		4
91*028fa281SKalle Valo 
92*028fa281SKalle Valo #define REG_LDOHCI12_CTRL		0x0022
93*028fa281SKalle Valo 
94*028fa281SKalle Valo #define REG_LPLDO_CTRL			0x0023
95*028fa281SKalle Valo #define  LPLDO_HSM			BIT(2)
96*028fa281SKalle Valo #define  LPLDO_LSM_DIS			BIT(3)
97*028fa281SKalle Valo 
98*028fa281SKalle Valo #define REG_AFE_XTAL_CTRL		0x0024
99*028fa281SKalle Valo #define  AFE_XTAL_ENABLE		BIT(0)
100*028fa281SKalle Valo #define  AFE_XTAL_B_SELECT		BIT(1)
101*028fa281SKalle Valo #define  AFE_XTAL_GATE_USB		BIT(8)
102*028fa281SKalle Valo #define  AFE_XTAL_GATE_AFE		BIT(11)
103*028fa281SKalle Valo #define  AFE_XTAL_RF_GATE		BIT(14)
104*028fa281SKalle Valo #define  AFE_XTAL_GATE_DIG		BIT(17)
105*028fa281SKalle Valo #define  AFE_XTAL_BT_GATE		BIT(20)
106*028fa281SKalle Valo 
107*028fa281SKalle Valo /*
108*028fa281SKalle Valo  * 0x0028 is also known as REG_AFE_CTRL2 on 8723bu/8192eu
109*028fa281SKalle Valo  */
110*028fa281SKalle Valo #define REG_AFE_PLL_CTRL		0x0028
111*028fa281SKalle Valo #define  AFE_PLL_ENABLE			BIT(0)
112*028fa281SKalle Valo #define  AFE_PLL_320_ENABLE		BIT(1)
113*028fa281SKalle Valo #define  APE_PLL_FREF_SELECT		BIT(2)
114*028fa281SKalle Valo #define  AFE_PLL_EDGE_SELECT		BIT(3)
115*028fa281SKalle Valo #define  AFE_PLL_WDOGB			BIT(4)
116*028fa281SKalle Valo #define  AFE_PLL_LPF_ENABLE		BIT(5)
117*028fa281SKalle Valo 
118*028fa281SKalle Valo #define REG_MAC_PHY_CTRL		0x002c
119*028fa281SKalle Valo 
120*028fa281SKalle Valo #define REG_EFUSE_CTRL			0x0030
121*028fa281SKalle Valo #define REG_EFUSE_TEST			0x0034
122*028fa281SKalle Valo #define  EFUSE_TRPT			BIT(7)
123*028fa281SKalle Valo 	/*  00: Wifi Efuse, 01: BT Efuse0, 10: BT Efuse1, 11: BT Efuse2 */
124*028fa281SKalle Valo #define  EFUSE_CELL_SEL			(BIT(8) | BIT(9))
125*028fa281SKalle Valo #define  EFUSE_LDOE25_ENABLE		BIT(31)
126*028fa281SKalle Valo #define  EFUSE_SELECT_MASK		0x0300
127*028fa281SKalle Valo #define  EFUSE_WIFI_SELECT		0x0000
128*028fa281SKalle Valo #define  EFUSE_BT0_SELECT		0x0100
129*028fa281SKalle Valo #define  EFUSE_BT1_SELECT		0x0200
130*028fa281SKalle Valo #define  EFUSE_BT2_SELECT		0x0300
131*028fa281SKalle Valo 
132*028fa281SKalle Valo #define  EFUSE_ACCESS_ENABLE		0x69	/* RTL8723 only */
133*028fa281SKalle Valo #define  EFUSE_ACCESS_DISABLE		0x00	/* RTL8723 only */
134*028fa281SKalle Valo 
135*028fa281SKalle Valo #define REG_PWR_DATA			0x0038
136*028fa281SKalle Valo #define  PWR_DATA_EEPRPAD_RFE_CTRL_EN	BIT(11)
137*028fa281SKalle Valo 
138*028fa281SKalle Valo #define REG_CAL_TIMER			0x003c
139*028fa281SKalle Valo #define REG_ACLK_MON			0x003e
140*028fa281SKalle Valo #define REG_GPIO_MUXCFG			0x0040
141*028fa281SKalle Valo #define  GPIO_MUXCFG_IO_SEL_ENBT	BIT(5)
142*028fa281SKalle Valo #define REG_GPIO_IO_SEL			0x0042
143*028fa281SKalle Valo #define REG_MAC_PINMUX_CFG		0x0043
144*028fa281SKalle Valo #define REG_GPIO_PIN_CTRL		0x0044
145*028fa281SKalle Valo #define REG_GPIO_INTM			0x0048
146*028fa281SKalle Valo #define  GPIO_INTM_EDGE_TRIG_IRQ	BIT(9)
147*028fa281SKalle Valo 
148*028fa281SKalle Valo #define REG_LEDCFG0			0x004c
149*028fa281SKalle Valo #define  LEDCFG0_LED0CM			GENMASK(2, 0)
150*028fa281SKalle Valo #define  LEDCFG0_LED1CM			GENMASK(10, 8)
151*028fa281SKalle Valo #define   LED_MODE_SW_CTRL		0x0
152*028fa281SKalle Valo #define   LED_MODE_TX_OR_RX_EVENTS	0x3
153*028fa281SKalle Valo #define  LEDCFG0_LED0SV			BIT(3)
154*028fa281SKalle Valo #define  LEDCFG0_LED1SV			BIT(11)
155*028fa281SKalle Valo #define   LED_SW_OFF			0x0
156*028fa281SKalle Valo #define   LED_SW_ON			0x1
157*028fa281SKalle Valo #define  LEDCFG0_LED0_IO_MODE		BIT(7)
158*028fa281SKalle Valo #define  LEDCFG0_LED1_IO_MODE		BIT(15)
159*028fa281SKalle Valo #define   LED_IO_MODE_OUTPUT		0x0
160*028fa281SKalle Valo #define   LED_IO_MODE_INPUT		0x1
161*028fa281SKalle Valo #define  LEDCFG0_LED2EN			BIT(21)
162*028fa281SKalle Valo #define   LED_GPIO_DISABLE		0x0
163*028fa281SKalle Valo #define   LED_GPIO_ENABLE		0x1
164*028fa281SKalle Valo #define  LEDCFG0_DPDT_SELECT		BIT(23)
165*028fa281SKalle Valo #define REG_LEDCFG1			0x004d
166*028fa281SKalle Valo #define  LEDCFG1_HW_LED_CONTROL		BIT(1)
167*028fa281SKalle Valo #define  LEDCFG1_LED_DISABLE		BIT(7)
168*028fa281SKalle Valo #define REG_LEDCFG2			0x004e
169*028fa281SKalle Valo #define  LEDCFG2_HW_LED_CONTROL		BIT(1)
170*028fa281SKalle Valo #define  LEDCFG2_HW_LED_ENABLE		BIT(5)
171*028fa281SKalle Valo #define  LEDCFG2_SW_LED_DISABLE		BIT(3)
172*028fa281SKalle Valo #define  LEDCFG2_SW_LED_CONTROL   	BIT(5)
173*028fa281SKalle Valo #define  LEDCFG2_DPDT_SELECT		BIT(7)
174*028fa281SKalle Valo #define REG_LEDCFG3			0x004f
175*028fa281SKalle Valo #define REG_LEDCFG			REG_LEDCFG2
176*028fa281SKalle Valo #define REG_FSIMR			0x0050
177*028fa281SKalle Valo #define REG_FSISR			0x0054
178*028fa281SKalle Valo #define REG_HSIMR			0x0058
179*028fa281SKalle Valo #define REG_HSISR			0x005c
180*028fa281SKalle Valo /*  RTL8723 WIFI/BT/GPS Multi-Function GPIO Pin Control. */
181*028fa281SKalle Valo #define REG_GPIO_PIN_CTRL_2		0x0060
182*028fa281SKalle Valo /*  RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
183*028fa281SKalle Valo #define REG_GPIO_IO_SEL_2		0x0062
184*028fa281SKalle Valo #define  GPIO_IO_SEL_2_GPIO09_INPUT	BIT(1)
185*028fa281SKalle Valo #define  GPIO_IO_SEL_2_GPIO09_IRQ	BIT(9)
186*028fa281SKalle Valo 
187*028fa281SKalle Valo /*  RTL8723B */
188*028fa281SKalle Valo #define REG_PAD_CTRL1			0x0064
189*028fa281SKalle Valo #define  PAD_CTRL1_SW_DPDT_SEL_DATA	BIT(0)
190*028fa281SKalle Valo 
191*028fa281SKalle Valo /*  RTL8723 only WIFI/BT/GPS Multi-Function control source. */
192*028fa281SKalle Valo #define REG_MULTI_FUNC_CTRL		0x0068
193*028fa281SKalle Valo 
194*028fa281SKalle Valo #define  MULTI_FN_WIFI_HW_PWRDOWN_EN	BIT(0)	/* Enable GPIO[9] as WiFi HW
195*028fa281SKalle Valo 						   powerdown source */
196*028fa281SKalle Valo #define  MULTI_FN_WIFI_HW_PWRDOWN_SL	BIT(1)	/* WiFi HW powerdown polarity
197*028fa281SKalle Valo 						   control */
198*028fa281SKalle Valo #define  MULTI_WIFI_FUNC_EN		BIT(2)	/* WiFi function enable */
199*028fa281SKalle Valo 
200*028fa281SKalle Valo #define  MULTI_WIFI_HW_ROF_EN		BIT(3)	/* Enable GPIO[9] as WiFi RF HW
201*028fa281SKalle Valo 						   powerdown source */
202*028fa281SKalle Valo #define  MULTI_BT_HW_PWRDOWN_EN		BIT(16)	/* Enable GPIO[11] as BT HW
203*028fa281SKalle Valo 						   powerdown source */
204*028fa281SKalle Valo #define  MULTI_BT_HW_PWRDOWN_SL		BIT(17)	/* BT HW powerdown polarity
205*028fa281SKalle Valo 						   control */
206*028fa281SKalle Valo #define  MULTI_BT_FUNC_EN		BIT(18)	/* BT function enable */
207*028fa281SKalle Valo #define  MULTI_BT_HW_ROF_EN		BIT(19)	/* Enable GPIO[11] as BT/GPS
208*028fa281SKalle Valo 						   RF HW powerdown source */
209*028fa281SKalle Valo #define  MULTI_GPS_HW_PWRDOWN_EN	BIT(20)	/* Enable GPIO[10] as GPS HW
210*028fa281SKalle Valo 						   powerdown source */
211*028fa281SKalle Valo #define  MULTI_GPS_HW_PWRDOWN_SL	BIT(21)	/* GPS HW powerdown polarity
212*028fa281SKalle Valo 						   control */
213*028fa281SKalle Valo #define  MULTI_GPS_FUNC_EN		BIT(22)	/* GPS function enable */
214*028fa281SKalle Valo 
215*028fa281SKalle Valo #define REG_AFE_CTRL4			0x0078	/* 8192eu/8723bu */
216*028fa281SKalle Valo #define REG_LDO_SW_CTRL			0x007c	/* 8192eu */
217*028fa281SKalle Valo 
218*028fa281SKalle Valo #define REG_MCU_FW_DL			0x0080
219*028fa281SKalle Valo #define  MCU_FW_DL_ENABLE		BIT(0)
220*028fa281SKalle Valo #define  MCU_FW_DL_READY		BIT(1)
221*028fa281SKalle Valo #define  MCU_FW_DL_CSUM_REPORT		BIT(2)
222*028fa281SKalle Valo #define  MCU_MAC_INIT_READY		BIT(3)
223*028fa281SKalle Valo #define  MCU_BB_INIT_READY		BIT(4)
224*028fa281SKalle Valo #define  MCU_RF_INIT_READY		BIT(5)
225*028fa281SKalle Valo #define  MCU_WINT_INIT_READY		BIT(6)
226*028fa281SKalle Valo #define  MCU_FW_RAM_SEL			BIT(7)	/* 1: RAM, 0:ROM */
227*028fa281SKalle Valo #define  MCU_CP_RESET			BIT(23)
228*028fa281SKalle Valo 
229*028fa281SKalle Valo #define REG_HMBOX_EXT_0			0x0088
230*028fa281SKalle Valo #define REG_HMBOX_EXT_1			0x008a
231*028fa281SKalle Valo #define REG_HMBOX_EXT_2			0x008c
232*028fa281SKalle Valo #define REG_HMBOX_EXT_3			0x008e
233*028fa281SKalle Valo 
234*028fa281SKalle Valo #define REG_RSVD_1			0x0097
235*028fa281SKalle Valo 
236*028fa281SKalle Valo /* Interrupt registers for 8192e/8723bu/8812 */
237*028fa281SKalle Valo #define REG_HIMR0			0x00b0
238*028fa281SKalle Valo #define	 IMR0_TXCCK			BIT(30)	/* TXRPT interrupt when CCX bit
239*028fa281SKalle Valo 						   of the packet is set */
240*028fa281SKalle Valo #define	 IMR0_PSTIMEOUT			BIT(29)	/* Power Save Time Out Int */
241*028fa281SKalle Valo #define	 IMR0_GTINT4			BIT(28)	/* Set when GTIMER4 expires */
242*028fa281SKalle Valo #define	 IMR0_GTINT3			BIT(27)	/* Set when GTIMER3 expires */
243*028fa281SKalle Valo #define	 IMR0_TBDER			BIT(26)	/* Transmit Beacon0 Error */
244*028fa281SKalle Valo #define	 IMR0_TBDOK			BIT(25)	/* Transmit Beacon0 OK */
245*028fa281SKalle Valo #define	 IMR0_TSF_BIT32_TOGGLE		BIT(24)	/* TSF Timer BIT32 toggle
246*028fa281SKalle Valo 						   indication interrupt */
247*028fa281SKalle Valo #define	 IMR0_BCNDMAINT0		BIT(20)	/* Beacon DMA Interrupt 0 */
248*028fa281SKalle Valo #define	 IMR0_BCNDERR0			BIT(16)	/* Beacon Queue DMA Error 0 */
249*028fa281SKalle Valo #define	 IMR0_HSISR_IND_ON_INT		BIT(15)	/* HSISR Indicator (HSIMR &
250*028fa281SKalle Valo 						   HSISR is true) */
251*028fa281SKalle Valo #define	 IMR0_BCNDMAINT_E		BIT(14)	/* Beacon DMA Interrupt
252*028fa281SKalle Valo 						   Extension for Win7 */
253*028fa281SKalle Valo #define	 IMR0_ATIMEND			BIT(12)	/* CTWidnow End or
254*028fa281SKalle Valo 						   ATIM Window End */
255*028fa281SKalle Valo #define	 IMR0_HISR1_IND_INT		BIT(11)	/* HISR1 Indicator
256*028fa281SKalle Valo 						   (HISR1 & HIMR1 is true) */
257*028fa281SKalle Valo #define	 IMR0_C2HCMD			BIT(10)	/* CPU to Host Command INT
258*028fa281SKalle Valo 						   Status, Write 1 to clear */
259*028fa281SKalle Valo #define	 IMR0_CPWM2			BIT(9)	/* CPU power Mode exchange INT
260*028fa281SKalle Valo 						   Status, Write 1 to clear */
261*028fa281SKalle Valo #define	 IMR0_CPWM			BIT(8)	/* CPU power Mode exchange INT
262*028fa281SKalle Valo 						   Status, Write 1 to clear */
263*028fa281SKalle Valo #define	 IMR0_HIGHDOK			BIT(7)	/* High Queue DMA OK */
264*028fa281SKalle Valo #define	 IMR0_MGNTDOK			BIT(6)	/* Management Queue DMA OK */
265*028fa281SKalle Valo #define	 IMR0_BKDOK			BIT(5)	/* AC_BK DMA OK */
266*028fa281SKalle Valo #define	 IMR0_BEDOK			BIT(4)	/* AC_BE DMA OK */
267*028fa281SKalle Valo #define	 IMR0_VIDOK			BIT(3)	/* AC_VI DMA OK */
268*028fa281SKalle Valo #define	 IMR0_VODOK			BIT(2)	/* AC_VO DMA OK */
269*028fa281SKalle Valo #define	 IMR0_RDU			BIT(1)	/* Rx Descriptor Unavailable */
270*028fa281SKalle Valo #define	 IMR0_ROK			BIT(0)	/* Receive DMA OK */
271*028fa281SKalle Valo #define REG_HISR0			0x00b4
272*028fa281SKalle Valo #define REG_HIMR1			0x00b8
273*028fa281SKalle Valo #define	 IMR1_BCNDMAINT7		BIT(27)	/* Beacon DMA Interrupt 7 */
274*028fa281SKalle Valo #define	 IMR1_BCNDMAINT6		BIT(26)	/* Beacon DMA Interrupt 6 */
275*028fa281SKalle Valo #define	 IMR1_BCNDMAINT5		BIT(25)	/* Beacon DMA Interrupt 5 */
276*028fa281SKalle Valo #define	 IMR1_BCNDMAINT4		BIT(24)	/* Beacon DMA Interrupt 4 */
277*028fa281SKalle Valo #define	 IMR1_BCNDMAINT3		BIT(23)	/* Beacon DMA Interrupt 3 */
278*028fa281SKalle Valo #define	 IMR1_BCNDMAINT2		BIT(22)	/* Beacon DMA Interrupt 2 */
279*028fa281SKalle Valo #define	 IMR1_BCNDMAINT1		BIT(21)	/* Beacon DMA Interrupt 1 */
280*028fa281SKalle Valo #define	 IMR1_BCNDERR7			BIT(20)	/* Beacon Queue DMA Err Int 7 */
281*028fa281SKalle Valo #define	 IMR1_BCNDERR6			BIT(19)	/* Beacon Queue DMA Err Int 6 */
282*028fa281SKalle Valo #define	 IMR1_BCNDERR5			BIT(18)	/* Beacon Queue DMA Err Int 5 */
283*028fa281SKalle Valo #define	 IMR1_BCNDERR4			BIT(17)	/* Beacon Queue DMA Err Int 4 */
284*028fa281SKalle Valo #define	 IMR1_BCNDERR3			BIT(16)	/* Beacon Queue DMA Err Int 3 */
285*028fa281SKalle Valo #define	 IMR1_BCNDERR2			BIT(15)	/* Beacon Queue DMA Err Int 2 */
286*028fa281SKalle Valo #define	 IMR1_BCNDERR1			BIT(14)	/* Beacon Queue DMA Err Int 1 */
287*028fa281SKalle Valo #define	 IMR1_ATIMEND_E			BIT(13)	/* ATIM Window End Extension
288*028fa281SKalle Valo 						   for Win7 */
289*028fa281SKalle Valo #define	 IMR1_TXERR			BIT(11)	/* Tx Error Flag Int Status,
290*028fa281SKalle Valo 						   write 1 to clear */
291*028fa281SKalle Valo #define	 IMR1_RXERR			BIT(10)	/* Rx Error Flag Int Status,
292*028fa281SKalle Valo 						   write 1 to clear */
293*028fa281SKalle Valo #define	 IMR1_TXFOVW			BIT(9)	/* Transmit FIFO Overflow */
294*028fa281SKalle Valo #define	 IMR1_RXFOVW			BIT(8)	/* Receive FIFO Overflow */
295*028fa281SKalle Valo #define REG_HISR1			0x00bc
296*028fa281SKalle Valo 
297*028fa281SKalle Valo /*  Host suspend counter on FPGA platform */
298*028fa281SKalle Valo #define REG_HOST_SUSP_CNT		0x00bc
299*028fa281SKalle Valo /*  Efuse access protection for RTL8723 */
300*028fa281SKalle Valo #define REG_EFUSE_ACCESS		0x00cf
301*028fa281SKalle Valo #define REG_BIST_SCAN			0x00d0
302*028fa281SKalle Valo #define REG_BIST_RPT			0x00d4
303*028fa281SKalle Valo #define REG_BIST_ROM_RPT		0x00d8
304*028fa281SKalle Valo #define REG_RSVD_4			0x00dc
305*028fa281SKalle Valo #define REG_USB_SIE_INTF		0x00e0
306*028fa281SKalle Valo #define REG_PCIE_MIO_INTF		0x00e4
307*028fa281SKalle Valo #define REG_PCIE_MIO_INTD		0x00e8
308*028fa281SKalle Valo #define REG_HPON_FSM			0x00ec
309*028fa281SKalle Valo #define  HPON_FSM_BONDING_MASK		(BIT(22) | BIT(23))
310*028fa281SKalle Valo #define  HPON_FSM_BONDING_1T2R		BIT(22)
311*028fa281SKalle Valo #define REG_SYS_CFG			0x00f0
312*028fa281SKalle Valo #define  SYS_CFG_XCLK_VLD		BIT(0)
313*028fa281SKalle Valo #define  SYS_CFG_ACLK_VLD		BIT(1)
314*028fa281SKalle Valo #define  SYS_CFG_UCLK_VLD		BIT(2)
315*028fa281SKalle Valo #define  SYS_CFG_PCLK_VLD		BIT(3)
316*028fa281SKalle Valo #define  SYS_CFG_PCIRSTB		BIT(4)
317*028fa281SKalle Valo #define  SYS_CFG_V15_VLD		BIT(5)
318*028fa281SKalle Valo #define  SYS_CFG_TRP_B15V_EN		BIT(7)
319*028fa281SKalle Valo #define  SYS_CFG_SW_OFFLOAD_EN		BIT(7)	/* For chips with IOL support */
320*028fa281SKalle Valo #define  SYS_CFG_SIC_IDLE		BIT(8)
321*028fa281SKalle Valo #define  SYS_CFG_BD_MAC2		BIT(9)
322*028fa281SKalle Valo #define  SYS_CFG_BD_MAC1		BIT(10)
323*028fa281SKalle Valo #define  SYS_CFG_IC_MACPHY_MODE		BIT(11)
324*028fa281SKalle Valo #define  SYS_CFG_CHIP_VER		(BIT(12) | BIT(13) | BIT(14) | BIT(15))
325*028fa281SKalle Valo #define  SYS_CFG_BT_FUNC		BIT(16)
326*028fa281SKalle Valo #define  SYS_CFG_VENDOR_ID		BIT(19)
327*028fa281SKalle Valo #define  SYS_CFG_VENDOR_EXT_MASK	(BIT(18) | BIT(19))
328*028fa281SKalle Valo #define   SYS_CFG_VENDOR_ID_TSMC	0
329*028fa281SKalle Valo #define   SYS_CFG_VENDOR_ID_SMIC	BIT(18)
330*028fa281SKalle Valo #define   SYS_CFG_VENDOR_ID_UMC		BIT(19)
331*028fa281SKalle Valo #define  SYS_CFG_PAD_HWPD_IDN		BIT(22)
332*028fa281SKalle Valo #define  SYS_CFG_TRP_VAUX_EN		BIT(23)
333*028fa281SKalle Valo #define  SYS_CFG_TRP_BT_EN		BIT(24)
334*028fa281SKalle Valo #define  SYS_CFG_SPS_LDO_SEL		BIT(24)	/* 8192eu */
335*028fa281SKalle Valo #define  SYS_CFG_BD_PKG_SEL		BIT(25)
336*028fa281SKalle Valo #define  SYS_CFG_BD_HCI_SEL		BIT(26)
337*028fa281SKalle Valo #define  SYS_CFG_TYPE_ID		BIT(27)
338*028fa281SKalle Valo #define  SYS_CFG_RTL_ID			BIT(23) /*  TestChip ID,
339*028fa281SKalle Valo 						    1:Test(RLE); 0:MP(RL) */
340*028fa281SKalle Valo #define  SYS_CFG_SPS_SEL		BIT(24) /*  1:LDO regulator mode;
341*028fa281SKalle Valo 						    0:Switching regulator mode*/
342*028fa281SKalle Valo #define  SYS_CFG_CHIP_VERSION_MASK	0xf000	/* Bit 12 - 15 */
343*028fa281SKalle Valo 
344*028fa281SKalle Valo #define REG_GPIO_OUTSTS			0x00f4	/*  For RTL8723 only. */
345*028fa281SKalle Valo #define  GPIO_EFS_HCI_SEL		(BIT(0) | BIT(1))
346*028fa281SKalle Valo #define  GPIO_PAD_HCI_SEL		(BIT(2) | BIT(3))
347*028fa281SKalle Valo #define  GPIO_HCI_SEL			(BIT(4) | BIT(5))
348*028fa281SKalle Valo #define  GPIO_PKG_SEL_HCI		BIT(6)
349*028fa281SKalle Valo #define  GPIO_FEN_GPS			BIT(7)
350*028fa281SKalle Valo #define  GPIO_FEN_BT			BIT(8)
351*028fa281SKalle Valo #define  GPIO_FEN_WL			BIT(9)
352*028fa281SKalle Valo #define  GPIO_FEN_PCI			BIT(10)
353*028fa281SKalle Valo #define  GPIO_FEN_USB			BIT(11)
354*028fa281SKalle Valo #define  GPIO_BTRF_HWPDN_N		BIT(12)
355*028fa281SKalle Valo #define  GPIO_WLRF_HWPDN_N		BIT(13)
356*028fa281SKalle Valo #define  GPIO_PDN_BT_N			BIT(14)
357*028fa281SKalle Valo #define  GPIO_PDN_GPS_N			BIT(15)
358*028fa281SKalle Valo #define  GPIO_BT_CTL_HWPDN		BIT(16)
359*028fa281SKalle Valo #define  GPIO_GPS_CTL_HWPDN		BIT(17)
360*028fa281SKalle Valo #define  GPIO_PPHY_SUSB			BIT(20)
361*028fa281SKalle Valo #define  GPIO_UPHY_SUSB			BIT(21)
362*028fa281SKalle Valo #define  GPIO_PCI_SUSEN			BIT(22)
363*028fa281SKalle Valo #define  GPIO_USB_SUSEN			BIT(23)
364*028fa281SKalle Valo #define  GPIO_RF_RL_ID			(BIT(31) | BIT(30) | BIT(29) | BIT(28))
365*028fa281SKalle Valo 
366*028fa281SKalle Valo #define REG_SYS_CFG2			0x00fc	/* 8192eu */
367*028fa281SKalle Valo 
368*028fa281SKalle Valo /* 0x0100 ~ 0x01FF	MACTOP General Configuration */
369*028fa281SKalle Valo #define REG_CR				0x0100
370*028fa281SKalle Valo #define  CR_HCI_TXDMA_ENABLE		BIT(0)
371*028fa281SKalle Valo #define  CR_HCI_RXDMA_ENABLE		BIT(1)
372*028fa281SKalle Valo #define  CR_TXDMA_ENABLE		BIT(2)
373*028fa281SKalle Valo #define  CR_RXDMA_ENABLE		BIT(3)
374*028fa281SKalle Valo #define  CR_PROTOCOL_ENABLE		BIT(4)
375*028fa281SKalle Valo #define  CR_SCHEDULE_ENABLE		BIT(5)
376*028fa281SKalle Valo #define  CR_MAC_TX_ENABLE		BIT(6)
377*028fa281SKalle Valo #define  CR_MAC_RX_ENABLE		BIT(7)
378*028fa281SKalle Valo #define  CR_SW_BEACON_ENABLE		BIT(8)
379*028fa281SKalle Valo #define  CR_SECURITY_ENABLE		BIT(9)
380*028fa281SKalle Valo #define  CR_CALTIMER_ENABLE		BIT(10)
381*028fa281SKalle Valo 
382*028fa281SKalle Valo /* Media Status Register */
383*028fa281SKalle Valo #define REG_MSR				0x0102
384*028fa281SKalle Valo #define  MSR_LINKTYPE_MASK		0x3
385*028fa281SKalle Valo #define  MSR_LINKTYPE_NONE		0x0
386*028fa281SKalle Valo #define  MSR_LINKTYPE_ADHOC		0x1
387*028fa281SKalle Valo #define  MSR_LINKTYPE_STATION		0x2
388*028fa281SKalle Valo #define  MSR_LINKTYPE_AP		0x3
389*028fa281SKalle Valo 
390*028fa281SKalle Valo #define REG_PBP				0x0104
391*028fa281SKalle Valo #define  PBP_PAGE_SIZE_RX_SHIFT		0
392*028fa281SKalle Valo #define  PBP_PAGE_SIZE_TX_SHIFT		4
393*028fa281SKalle Valo #define  PBP_PAGE_SIZE_64		0x0
394*028fa281SKalle Valo #define  PBP_PAGE_SIZE_128		0x1
395*028fa281SKalle Valo #define  PBP_PAGE_SIZE_256		0x2
396*028fa281SKalle Valo #define  PBP_PAGE_SIZE_512		0x3
397*028fa281SKalle Valo #define  PBP_PAGE_SIZE_1024		0x4
398*028fa281SKalle Valo 
399*028fa281SKalle Valo /* 8188eu IOL magic */
400*028fa281SKalle Valo #define REG_PKT_BUF_ACCESS_CTRL		0x0106
401*028fa281SKalle Valo #define  PKT_BUF_ACCESS_CTRL_TX		0x69
402*028fa281SKalle Valo #define  PKT_BUF_ACCESS_CTRL_RX		0xa5
403*028fa281SKalle Valo 
404*028fa281SKalle Valo #define REG_TRXDMA_CTRL			0x010c
405*028fa281SKalle Valo #define  TRXDMA_CTRL_RXDMA_AGG_EN	BIT(2)
406*028fa281SKalle Valo #define  TRXDMA_CTRL_VOQ_SHIFT		4
407*028fa281SKalle Valo #define  TRXDMA_CTRL_VIQ_SHIFT		6
408*028fa281SKalle Valo #define  TRXDMA_CTRL_BEQ_SHIFT		8
409*028fa281SKalle Valo #define  TRXDMA_CTRL_BKQ_SHIFT		10
410*028fa281SKalle Valo #define  TRXDMA_CTRL_MGQ_SHIFT		12
411*028fa281SKalle Valo #define  TRXDMA_CTRL_HIQ_SHIFT		14
412*028fa281SKalle Valo #define  TRXDMA_CTRL_VOQ_SHIFT_8192F	4
413*028fa281SKalle Valo #define  TRXDMA_CTRL_VIQ_SHIFT_8192F	7
414*028fa281SKalle Valo #define  TRXDMA_CTRL_BEQ_SHIFT_8192F	10
415*028fa281SKalle Valo #define  TRXDMA_CTRL_BKQ_SHIFT_8192F	13
416*028fa281SKalle Valo #define  TRXDMA_CTRL_MGQ_SHIFT_8192F	16
417*028fa281SKalle Valo #define  TRXDMA_CTRL_HIQ_SHIFT_8192F	19
418*028fa281SKalle Valo #define  TRXDMA_QUEUE_LOW		1
419*028fa281SKalle Valo #define  TRXDMA_QUEUE_NORMAL		2
420*028fa281SKalle Valo #define  TRXDMA_QUEUE_HIGH		3
421*028fa281SKalle Valo 
422*028fa281SKalle Valo #define REG_TRXFF_BNDY			0x0114
423*028fa281SKalle Valo #define REG_TRXFF_STATUS		0x0118
424*028fa281SKalle Valo #define REG_RXFF_PTR			0x011c
425*028fa281SKalle Valo #define REG_HIMR			0x0120
426*028fa281SKalle Valo #define REG_HISR			0x0124
427*028fa281SKalle Valo #define REG_HIMRE			0x0128
428*028fa281SKalle Valo #define REG_HISRE			0x012c
429*028fa281SKalle Valo #define REG_CPWM			0x012f
430*028fa281SKalle Valo #define REG_FWIMR			0x0130
431*028fa281SKalle Valo #define REG_FWISR			0x0134
432*028fa281SKalle Valo #define REG_FTIMR			0x0138
433*028fa281SKalle Valo #define REG_PKTBUF_DBG_CTRL		0x0140
434*028fa281SKalle Valo #define REG_PKTBUF_DBG_DATA_L		0x0144
435*028fa281SKalle Valo #define REG_PKTBUF_DBG_DATA_H		0x0148
436*028fa281SKalle Valo 
437*028fa281SKalle Valo #define REG_TC0_CTRL			0x0150
438*028fa281SKalle Valo #define REG_TC1_CTRL			0x0154
439*028fa281SKalle Valo #define REG_TC2_CTRL			0x0158
440*028fa281SKalle Valo #define REG_TC3_CTRL			0x015c
441*028fa281SKalle Valo #define REG_TC4_CTRL			0x0160
442*028fa281SKalle Valo #define REG_TCUNIT_BASE			0x0164
443*028fa281SKalle Valo #define REG_MBIST_START			0x0174
444*028fa281SKalle Valo #define REG_MBIST_DONE			0x0178
445*028fa281SKalle Valo #define REG_MBIST_FAIL			0x017c
446*028fa281SKalle Valo /* 8188EU */
447*028fa281SKalle Valo #define REG_32K_CTRL			0x0194
448*028fa281SKalle Valo #define REG_C2HEVT_MSG_NORMAL		0x01a0
449*028fa281SKalle Valo /* 8192EU/8723BU/8812 */
450*028fa281SKalle Valo #define REG_C2HEVT_CMD_ID_8723B		0x01ae
451*028fa281SKalle Valo #define REG_C2HEVT_CLEAR		0x01af
452*028fa281SKalle Valo #define REG_C2HEVT_MSG_TEST		0x01b8
453*028fa281SKalle Valo #define REG_MCUTST_1			0x01c0
454*028fa281SKalle Valo #define REG_FMTHR			0x01c8
455*028fa281SKalle Valo #define REG_HMTFR			0x01cc
456*028fa281SKalle Valo #define REG_HMBOX_0			0x01d0
457*028fa281SKalle Valo #define REG_HMBOX_1			0x01d4
458*028fa281SKalle Valo #define REG_HMBOX_2			0x01d8
459*028fa281SKalle Valo #define REG_HMBOX_3			0x01dc
460*028fa281SKalle Valo 
461*028fa281SKalle Valo #define REG_LLT_INIT			0x01e0
462*028fa281SKalle Valo #define  LLT_OP_INACTIVE		0x0
463*028fa281SKalle Valo #define  LLT_OP_WRITE			(0x1 << 30)
464*028fa281SKalle Valo #define  LLT_OP_READ			(0x2 << 30)
465*028fa281SKalle Valo #define  LLT_OP_MASK			(0x3 << 30)
466*028fa281SKalle Valo 
467*028fa281SKalle Valo #define REG_BB_ACCESS_CTRL		0x01e8
468*028fa281SKalle Valo #define REG_BB_ACCESS_DATA		0x01ec
469*028fa281SKalle Valo 
470*028fa281SKalle Valo #define REG_HMBOX_EXT0_8723B		0x01f0
471*028fa281SKalle Valo #define REG_HMBOX_EXT1_8723B		0x01f4
472*028fa281SKalle Valo #define REG_HMBOX_EXT2_8723B		0x01f8
473*028fa281SKalle Valo #define REG_HMBOX_EXT3_8723B		0x01fc
474*028fa281SKalle Valo 
475*028fa281SKalle Valo /* 0x0200 ~ 0x027F	TXDMA Configuration */
476*028fa281SKalle Valo #define REG_RQPN			0x0200
477*028fa281SKalle Valo #define  RQPN_HI_PQ_SHIFT		0
478*028fa281SKalle Valo #define  RQPN_LO_PQ_SHIFT		8
479*028fa281SKalle Valo #define  RQPN_PUB_PQ_SHIFT		16
480*028fa281SKalle Valo #define  RQPN_LOAD			BIT(31)
481*028fa281SKalle Valo 
482*028fa281SKalle Valo #define REG_FIFOPAGE			0x0204
483*028fa281SKalle Valo #define REG_TDECTRL			0x0208
484*028fa281SKalle Valo #define  BIT_BCN_VALID			BIT(16)
485*028fa281SKalle Valo 
486*028fa281SKalle Valo #define REG_DWBCN0_CTRL_8188F		REG_TDECTRL
487*028fa281SKalle Valo 
488*028fa281SKalle Valo #define REG_TXDMA_OFFSET_CHK		0x020c
489*028fa281SKalle Valo #define  TXDMA_OFFSET_DROP_DATA_EN	BIT(9)
490*028fa281SKalle Valo #define REG_TXDMA_STATUS		0x0210
491*028fa281SKalle Valo #define REG_RQPN_NPQ			0x0214
492*028fa281SKalle Valo #define  RQPN_NPQ_SHIFT			0
493*028fa281SKalle Valo #define  RQPN_EPQ_SHIFT			16
494*028fa281SKalle Valo 
495*028fa281SKalle Valo #define REG_AUTO_LLT			0x0224
496*028fa281SKalle Valo #define  AUTO_LLT_INIT_LLT		BIT(16)
497*028fa281SKalle Valo 
498*028fa281SKalle Valo #define REG_DWBCN1_CTRL_8723B		0x0228
499*028fa281SKalle Valo #define  BIT_SW_BCN_SEL			BIT(20)
500*028fa281SKalle Valo 
501*028fa281SKalle Valo /* 0x0280 ~ 0x02FF	RXDMA Configuration */
502*028fa281SKalle Valo #define REG_RXDMA_AGG_PG_TH		0x0280	/* 0-7 : USB DMA size bits
503*028fa281SKalle Valo 						   8-14: USB DMA timeout
504*028fa281SKalle Valo 						   15  : Aggregation enable
505*028fa281SKalle Valo 						         Only seems to be used
506*028fa281SKalle Valo 							 on 8723bu/8192eu */
507*028fa281SKalle Valo #define  RXDMA_USB_AGG_ENABLE		BIT(31)
508*028fa281SKalle Valo #define REG_RXPKT_NUM			0x0284
509*028fa281SKalle Valo #define  RXPKT_NUM_RXDMA_IDLE		BIT(17)
510*028fa281SKalle Valo #define  RXPKT_NUM_RW_RELEASE_EN	BIT(18)
511*028fa281SKalle Valo #define REG_RXDMA_STATUS		0x0288
512*028fa281SKalle Valo 
513*028fa281SKalle Valo /* Presumably only found on newer chips such as 8723bu */
514*028fa281SKalle Valo #define REG_RX_DMA_CTRL_8723B		0x0286
515*028fa281SKalle Valo #define REG_RXDMA_PRO_8723B		0x0290
516*028fa281SKalle Valo #define  RXDMA_PRO_DMA_MODE		BIT(1)		/* Set to 0x1. */
517*028fa281SKalle Valo #define  RXDMA_PRO_DMA_BURST_CNT	GENMASK(3, 2)	/* Set to 0x3. */
518*028fa281SKalle Valo #define  RXDMA_PRO_DMA_BURST_SIZE	GENMASK(5, 4)	/* Set to 0x1. */
519*028fa281SKalle Valo 
520*028fa281SKalle Valo #define REG_EARLY_MODE_CONTROL_8710B	0x02bc
521*028fa281SKalle Valo 
522*028fa281SKalle Valo #define REG_RF_BB_CMD_ADDR		0x02c0
523*028fa281SKalle Valo #define REG_RF_BB_CMD_DATA		0x02c4
524*028fa281SKalle Valo 
525*028fa281SKalle Valo /*  spec version 11 */
526*028fa281SKalle Valo /* 0x0400 ~ 0x047F	Protocol Configuration */
527*028fa281SKalle Valo /* 8192c, 8192d */
528*028fa281SKalle Valo #define REG_VOQ_INFO			0x0400
529*028fa281SKalle Valo #define REG_VIQ_INFO			0x0404
530*028fa281SKalle Valo #define REG_BEQ_INFO			0x0408
531*028fa281SKalle Valo #define REG_BKQ_INFO			0x040c
532*028fa281SKalle Valo /* 8188e, 8723a, 8812a, 8821a, 8192e, 8723b */
533*028fa281SKalle Valo #define REG_Q0_INFO			0x400
534*028fa281SKalle Valo #define REG_Q1_INFO			0x404
535*028fa281SKalle Valo #define REG_Q2_INFO			0x408
536*028fa281SKalle Valo #define REG_Q3_INFO			0x40c
537*028fa281SKalle Valo 
538*028fa281SKalle Valo #define REG_MGQ_INFO			0x0410
539*028fa281SKalle Valo #define REG_HGQ_INFO			0x0414
540*028fa281SKalle Valo #define REG_BCNQ_INFO			0x0418
541*028fa281SKalle Valo 
542*028fa281SKalle Valo #define REG_CPU_MGQ_INFORMATION		0x041c
543*028fa281SKalle Valo #define REG_FWHW_TXQ_CTRL		0x0420
544*028fa281SKalle Valo #define  FWHW_TXQ_CTRL_AMPDU_RETRY	BIT(7)
545*028fa281SKalle Valo #define  FWHW_TXQ_CTRL_XMIT_MGMT_ACK	BIT(12)
546*028fa281SKalle Valo #define  EN_BCNQ_DL			BIT(22)
547*028fa281SKalle Valo 
548*028fa281SKalle Valo #define REG_HWSEQ_CTRL			0x0423
549*028fa281SKalle Valo #define REG_TXPKTBUF_BCNQ_BDNY		0x0424
550*028fa281SKalle Valo #define REG_TXPKTBUF_MGQ_BDNY		0x0425
551*028fa281SKalle Valo #define REG_LIFETIME_EN			0x0426
552*028fa281SKalle Valo #define REG_MULTI_BCNQ_OFFSET		0x0427
553*028fa281SKalle Valo 
554*028fa281SKalle Valo #define REG_SPEC_SIFS			0x0428
555*028fa281SKalle Valo #define  SPEC_SIFS_CCK_MASK		0x00ff
556*028fa281SKalle Valo #define  SPEC_SIFS_CCK_SHIFT		0
557*028fa281SKalle Valo #define  SPEC_SIFS_OFDM_MASK		0xff00
558*028fa281SKalle Valo #define  SPEC_SIFS_OFDM_SHIFT		8
559*028fa281SKalle Valo 
560*028fa281SKalle Valo #define REG_RETRY_LIMIT			0x042a
561*028fa281SKalle Valo #define  RETRY_LIMIT_LONG_SHIFT		0
562*028fa281SKalle Valo #define  RETRY_LIMIT_LONG_MASK		0x003f
563*028fa281SKalle Valo #define  RETRY_LIMIT_SHORT_SHIFT	8
564*028fa281SKalle Valo #define  RETRY_LIMIT_SHORT_MASK		0x3f00
565*028fa281SKalle Valo 
566*028fa281SKalle Valo #define REG_DARFRC			0x0430
567*028fa281SKalle Valo #define REG_RARFRC			0x0438
568*028fa281SKalle Valo #define REG_RESPONSE_RATE_SET		0x0440
569*028fa281SKalle Valo #define  RESPONSE_RATE_BITMAP_ALL	0xfffff
570*028fa281SKalle Valo #define  RESPONSE_RATE_RRSR_CCK_ONLY_1M	0xffff1
571*028fa281SKalle Valo #define  RESPONSE_RATE_RRSR_INIT_2G	0x15f
572*028fa281SKalle Valo #define  RESPONSE_RATE_RRSR_INIT_5G	0x150
573*028fa281SKalle Valo #define  RSR_1M				BIT(0)
574*028fa281SKalle Valo #define  RSR_2M				BIT(1)
575*028fa281SKalle Valo #define  RSR_5_5M			BIT(2)
576*028fa281SKalle Valo #define  RSR_11M			BIT(3)
577*028fa281SKalle Valo #define  RSR_6M				BIT(4)
578*028fa281SKalle Valo #define  RSR_9M				BIT(5)
579*028fa281SKalle Valo #define  RSR_12M			BIT(6)
580*028fa281SKalle Valo #define  RSR_18M			BIT(7)
581*028fa281SKalle Valo #define  RSR_24M			BIT(8)
582*028fa281SKalle Valo #define  RSR_36M			BIT(9)
583*028fa281SKalle Valo #define  RSR_48M			BIT(10)
584*028fa281SKalle Valo #define  RSR_54M			BIT(11)
585*028fa281SKalle Valo #define  RSR_MCS0			BIT(12)
586*028fa281SKalle Valo #define  RSR_MCS1			BIT(13)
587*028fa281SKalle Valo #define  RSR_MCS2			BIT(14)
588*028fa281SKalle Valo #define  RSR_MCS3			BIT(15)
589*028fa281SKalle Valo #define  RSR_MCS4			BIT(16)
590*028fa281SKalle Valo #define  RSR_MCS5			BIT(17)
591*028fa281SKalle Valo #define  RSR_MCS6			BIT(18)
592*028fa281SKalle Valo #define  RSR_MCS7			BIT(19)
593*028fa281SKalle Valo #define  RSR_RSC_LOWER_SUB_CHANNEL	BIT(21)	/* 0x200000 */
594*028fa281SKalle Valo #define  RSR_RSC_UPPER_SUB_CHANNEL	BIT(22)	/* 0x400000 */
595*028fa281SKalle Valo #define  RSR_RSC_BANDWIDTH_40M		(RSR_RSC_UPPER_SUB_CHANNEL | \
596*028fa281SKalle Valo 					 RSR_RSC_LOWER_SUB_CHANNEL)
597*028fa281SKalle Valo #define  RSR_ACK_SHORT_PREAMBLE		BIT(23)
598*028fa281SKalle Valo 
599*028fa281SKalle Valo #define REG_ARFR0			0x0444
600*028fa281SKalle Valo #define REG_ARFR1			0x0448
601*028fa281SKalle Valo #define REG_ARFR2			0x044c
602*028fa281SKalle Valo #define REG_ARFR3			0x0450
603*028fa281SKalle Valo #define REG_CCK_CHECK			0x0454
604*028fa281SKalle Valo #define BIT_BCN_PORT_SEL		BIT(5)
605*028fa281SKalle Valo #define REG_AMPDU_MAX_TIME_8723B	0x0456
606*028fa281SKalle Valo #define REG_AGGLEN_LMT			0x0458
607*028fa281SKalle Valo #define REG_AMPDU_MIN_SPACE		0x045c
608*028fa281SKalle Valo #define REG_TXPKTBUF_WMAC_LBK_BF_HD	0x045d
609*028fa281SKalle Valo #define REG_FAST_EDCA_CTRL		0x0460
610*028fa281SKalle Valo #define REG_RD_RESP_PKT_TH		0x0463
611*028fa281SKalle Valo #define REG_INIRTS_RATE_SEL		0x0480
612*028fa281SKalle Valo /* 8723bu */
613*028fa281SKalle Valo #define REG_DATA_SUBCHANNEL		0x0483
614*028fa281SKalle Valo /* 8723au */
615*028fa281SKalle Valo #define REG_INIDATA_RATE_SEL		0x0484
616*028fa281SKalle Valo /* MACID_SLEEP_1/3 for 8723b, 8192e, 8812a, 8821a */
617*028fa281SKalle Valo #define REG_MACID_SLEEP_3_8732B		0x0484
618*028fa281SKalle Valo #define REG_MACID_SLEEP_1_8732B		0x0488
619*028fa281SKalle Valo 
620*028fa281SKalle Valo #define REG_POWER_STATUS		0x04a4
621*028fa281SKalle Valo #define REG_POWER_STAGE1		0x04b4
622*028fa281SKalle Valo #define REG_POWER_STAGE2		0x04b8
623*028fa281SKalle Valo #define REG_AMPDU_BURST_MODE_8723B	0x04bc
624*028fa281SKalle Valo #define REG_PKT_VO_VI_LIFE_TIME		0x04c0
625*028fa281SKalle Valo #define REG_PKT_BE_BK_LIFE_TIME		0x04c2
626*028fa281SKalle Valo #define REG_STBC_SETTING		0x04c4
627*028fa281SKalle Valo #define REG_QUEUE_CTRL			0x04c6
628*028fa281SKalle Valo #define REG_HT_SINGLE_AMPDU_8723B	0x04c7
629*028fa281SKalle Valo #define  HT_SINGLE_AMPDU_ENABLE		BIT(7)
630*028fa281SKalle Valo #define REG_PROT_MODE_CTRL		0x04c8
631*028fa281SKalle Valo #define REG_MAX_AGGR_NUM		0x04ca
632*028fa281SKalle Valo #define REG_RTS_MAX_AGGR_NUM		0x04cb
633*028fa281SKalle Valo #define REG_BAR_MODE_CTRL		0x04cc
634*028fa281SKalle Valo #define REG_RA_TRY_RATE_AGG_LMT		0x04cf
635*028fa281SKalle Valo /* MACID_DROP for 8723a */
636*028fa281SKalle Valo #define REG_MACID_DROP_8732A		0x04d0
637*028fa281SKalle Valo /* EARLY_MODE_CONTROL 8188e */
638*028fa281SKalle Valo #define REG_EARLY_MODE_CONTROL_8188E	0x04d0
639*028fa281SKalle Valo /* MACID_SLEEP_2 for 8723b, 8192e, 8812a, 8821a */
640*028fa281SKalle Valo #define REG_MACID_SLEEP_2_8732B		0x04d0
641*028fa281SKalle Valo #define REG_MACID_SLEEP			0x04d4
642*028fa281SKalle Valo #define REG_NQOS_SEQ			0x04dc
643*028fa281SKalle Valo #define REG_QOS_SEQ			0x04de
644*028fa281SKalle Valo #define REG_NEED_CPU_HANDLE		0x04e0
645*028fa281SKalle Valo #define REG_PKT_LOSE_RPT		0x04e1
646*028fa281SKalle Valo #define REG_PTCL_ERR_STATUS		0x04e2
647*028fa281SKalle Valo #define REG_TX_REPORT_CTRL		0x04ec
648*028fa281SKalle Valo #define  TX_REPORT_CTRL_TIMER_ENABLE	BIT(1)
649*028fa281SKalle Valo 
650*028fa281SKalle Valo #define REG_TX_REPORT_TIME		0x04f0
651*028fa281SKalle Valo #define REG_DUMMY			0x04fc
652*028fa281SKalle Valo 
653*028fa281SKalle Valo /* 0x0500 ~ 0x05FF	EDCA Configuration */
654*028fa281SKalle Valo #define REG_EDCA_VO_PARAM		0x0500
655*028fa281SKalle Valo #define REG_EDCA_VI_PARAM		0x0504
656*028fa281SKalle Valo #define REG_EDCA_BE_PARAM		0x0508
657*028fa281SKalle Valo #define REG_EDCA_BK_PARAM		0x050c
658*028fa281SKalle Valo #define  EDCA_PARAM_ECW_MIN_SHIFT	8
659*028fa281SKalle Valo #define  EDCA_PARAM_ECW_MAX_SHIFT	12
660*028fa281SKalle Valo #define  EDCA_PARAM_TXOP_SHIFT		16
661*028fa281SKalle Valo #define REG_BEACON_TCFG			0x0510
662*028fa281SKalle Valo #define REG_PIFS			0x0512
663*028fa281SKalle Valo #define REG_RDG_PIFS			0x0513
664*028fa281SKalle Valo #define REG_SIFS_CCK			0x0514
665*028fa281SKalle Valo #define REG_SIFS_OFDM			0x0516
666*028fa281SKalle Valo #define REG_TSFTR_SYN_OFFSET		0x0518
667*028fa281SKalle Valo #define REG_AGGR_BREAK_TIME		0x051a
668*028fa281SKalle Valo #define REG_SLOT			0x051b
669*028fa281SKalle Valo #define REG_TX_PTCL_CTRL		0x0520
670*028fa281SKalle Valo #define REG_TXPAUSE			0x0522
671*028fa281SKalle Valo #define REG_DIS_TXREQ_CLR		0x0523
672*028fa281SKalle Valo #define REG_RD_CTRL			0x0524
673*028fa281SKalle Valo #define REG_TBTT_PROHIBIT		0x0540
674*028fa281SKalle Valo #define REG_RD_NAV_NXT			0x0544
675*028fa281SKalle Valo #define REG_NAV_PROT_LEN		0x0546
676*028fa281SKalle Valo 
677*028fa281SKalle Valo #define REG_BEACON_CTRL			0x0550
678*028fa281SKalle Valo #define REG_BEACON_CTRL_1		0x0551
679*028fa281SKalle Valo #define  BEACON_ATIM			BIT(0)
680*028fa281SKalle Valo #define  BEACON_CTRL_MBSSID		BIT(1)
681*028fa281SKalle Valo #define  BEACON_CTRL_TX_BEACON_RPT	BIT(2)
682*028fa281SKalle Valo #define  BEACON_FUNCTION_ENABLE		BIT(3)
683*028fa281SKalle Valo #define  BEACON_DISABLE_TSF_UPDATE	BIT(4)
684*028fa281SKalle Valo 
685*028fa281SKalle Valo #define REG_MBID_NUM			0x0552
686*028fa281SKalle Valo #define REG_DUAL_TSF_RST		0x0553
687*028fa281SKalle Valo #define  DUAL_TSF_RESET_TSF0		BIT(0)
688*028fa281SKalle Valo #define  DUAL_TSF_RESET_TSF1		BIT(1)
689*028fa281SKalle Valo #define  DUAL_TSF_RESET_P2P		BIT(4)
690*028fa281SKalle Valo #define  DUAL_TSF_TX_OK			BIT(5)
691*028fa281SKalle Valo 
692*028fa281SKalle Valo /*  The same as REG_MBSSID_BCN_SPACE */
693*028fa281SKalle Valo #define REG_BCN_INTERVAL		0x0554
694*028fa281SKalle Valo #define REG_MBSSID_BCN_SPACE		0x0554
695*028fa281SKalle Valo 
696*028fa281SKalle Valo #define REG_DRIVER_EARLY_INT		0x0558
697*028fa281SKalle Valo #define  DRIVER_EARLY_INT_TIME		5
698*028fa281SKalle Valo 
699*028fa281SKalle Valo #define REG_BEACON_DMA_TIME		0x0559
700*028fa281SKalle Valo #define  BEACON_DMA_ATIME_INT_TIME	2
701*028fa281SKalle Valo 
702*028fa281SKalle Valo #define REG_ATIMWND			0x055a
703*028fa281SKalle Valo #define REG_USTIME_TSF_8723B		0x055c
704*028fa281SKalle Valo #define REG_BCN_MAX_ERR			0x055d
705*028fa281SKalle Valo #define REG_RXTSF_OFFSET_CCK		0x055e
706*028fa281SKalle Valo #define REG_RXTSF_OFFSET_OFDM		0x055f
707*028fa281SKalle Valo #define REG_TSFTR			0x0560
708*028fa281SKalle Valo #define REG_TSFTR1			0x0568
709*028fa281SKalle Valo #define REG_INIT_TSFTR			0x0564
710*028fa281SKalle Valo #define REG_ATIMWND_1			0x0570
711*028fa281SKalle Valo #define REG_PSTIMER			0x0580
712*028fa281SKalle Valo #define REG_TIMER0			0x0584
713*028fa281SKalle Valo #define REG_TIMER1			0x0588
714*028fa281SKalle Valo #define REG_ACM_HW_CTRL			0x05c0
715*028fa281SKalle Valo #define  ACM_HW_CTRL_BK			BIT(0)
716*028fa281SKalle Valo #define  ACM_HW_CTRL_BE			BIT(1)
717*028fa281SKalle Valo #define  ACM_HW_CTRL_VI			BIT(2)
718*028fa281SKalle Valo #define  ACM_HW_CTRL_VO			BIT(3)
719*028fa281SKalle Valo #define REG_ACM_RST_CTRL		0x05c1
720*028fa281SKalle Valo #define REG_ACMAVG			0x05c2
721*028fa281SKalle Valo #define REG_VO_ADMTIME			0x05c4
722*028fa281SKalle Valo #define REG_VI_ADMTIME			0x05c6
723*028fa281SKalle Valo #define REG_BE_ADMTIME			0x05c8
724*028fa281SKalle Valo #define REG_EDCA_RANDOM_GEN		0x05cc
725*028fa281SKalle Valo #define REG_SCH_TXCMD			0x05d0
726*028fa281SKalle Valo 
727*028fa281SKalle Valo /* define REG_FW_TSF_SYNC_CNT		0x04a0 */
728*028fa281SKalle Valo #define REG_SCH_TX_CMD			0x05f8
729*028fa281SKalle Valo #define REG_FW_RESET_TSF_CNT_1		0x05fc
730*028fa281SKalle Valo #define REG_FW_RESET_TSF_CNT_0		0x05fd
731*028fa281SKalle Valo #define REG_FW_BCN_DIS_CNT		0x05fe
732*028fa281SKalle Valo 
733*028fa281SKalle Valo /* 0x0600 ~ 0x07FF  WMAC Configuration */
734*028fa281SKalle Valo #define REG_APSD_CTRL			0x0600
735*028fa281SKalle Valo #define  APSD_CTRL_OFF			BIT(6)
736*028fa281SKalle Valo #define  APSD_CTRL_OFF_STATUS		BIT(7)
737*028fa281SKalle Valo #define REG_BW_OPMODE			0x0603
738*028fa281SKalle Valo #define  BW_OPMODE_20MHZ		BIT(2)
739*028fa281SKalle Valo #define  BW_OPMODE_5G			BIT(1)
740*028fa281SKalle Valo #define  BW_OPMODE_11J			BIT(0)
741*028fa281SKalle Valo 
742*028fa281SKalle Valo #define REG_TCR				0x0604
743*028fa281SKalle Valo 
744*028fa281SKalle Valo /* Receive Configuration Register */
745*028fa281SKalle Valo #define REG_RCR				0x0608
746*028fa281SKalle Valo #define  RCR_ACCEPT_AP			BIT(0)  /* Accept all unicast packet */
747*028fa281SKalle Valo #define  RCR_ACCEPT_PHYS_MATCH		BIT(1)  /* Accept phys match packet */
748*028fa281SKalle Valo #define  RCR_ACCEPT_MCAST		BIT(2)
749*028fa281SKalle Valo #define  RCR_ACCEPT_BCAST		BIT(3)
750*028fa281SKalle Valo #define  RCR_ACCEPT_ADDR3		BIT(4)  /* Accept address 3 match
751*028fa281SKalle Valo 						 packet */
752*028fa281SKalle Valo #define  RCR_ACCEPT_PM			BIT(5)  /* Accept power management
753*028fa281SKalle Valo 						 packet */
754*028fa281SKalle Valo #define  RCR_CHECK_BSSID_MATCH		BIT(6)  /* Accept BSSID match packet */
755*028fa281SKalle Valo #define  RCR_CHECK_BSSID_BEACON		BIT(7)  /* Accept BSSID match packet
756*028fa281SKalle Valo 						 (Rx beacon, probe rsp) */
757*028fa281SKalle Valo #define  RCR_ACCEPT_CRC32		BIT(8)  /* Accept CRC32 error packet */
758*028fa281SKalle Valo #define  RCR_ACCEPT_ICV			BIT(9)  /* Accept ICV error packet */
759*028fa281SKalle Valo #define  RCR_ACCEPT_DATA_FRAME		BIT(11) /* Accept all data pkt or use
760*028fa281SKalle Valo 						   REG_RXFLTMAP2 */
761*028fa281SKalle Valo #define  RCR_ACCEPT_CTRL_FRAME		BIT(12) /* Accept all control pkt or use
762*028fa281SKalle Valo 						   REG_RXFLTMAP1 */
763*028fa281SKalle Valo #define  RCR_ACCEPT_MGMT_FRAME		BIT(13) /* Accept all mgmt pkt or use
764*028fa281SKalle Valo 						   REG_RXFLTMAP0 */
765*028fa281SKalle Valo #define  RCR_HTC_LOC_CTRL		BIT(14) /* MFC<--HTC=1 MFC-->HTC=0 */
766*028fa281SKalle Valo #define  RCR_UC_DATA_PKT_INT_ENABLE	BIT(16) /* Enable unicast data packet
767*028fa281SKalle Valo 						   interrupt */
768*028fa281SKalle Valo #define  RCR_BM_DATA_PKT_INT_ENABLE	BIT(17) /* Enable broadcast data packet
769*028fa281SKalle Valo 						   interrupt */
770*028fa281SKalle Valo #define  RCR_TIM_PARSER_ENABLE		BIT(18) /* Enable RX beacon TIM parser*/
771*028fa281SKalle Valo #define  RCR_MFBEN			BIT(22)
772*028fa281SKalle Valo #define  RCR_LSIG_ENABLE		BIT(23) /* Enable LSIG TXOP Protection
773*028fa281SKalle Valo 						   function. Search KEYCAM for
774*028fa281SKalle Valo 						   each rx packet to check if
775*028fa281SKalle Valo 						   LSIGEN bit is set. */
776*028fa281SKalle Valo #define  RCR_MULTI_BSSID_ENABLE		BIT(24) /* Enable Multiple BssId */
777*028fa281SKalle Valo #define  RCR_FORCE_ACK			BIT(26)
778*028fa281SKalle Valo #define  RCR_ACCEPT_BA_SSN		BIT(27) /* Accept BA SSN */
779*028fa281SKalle Valo #define  RCR_APPEND_PHYSTAT		BIT(28)
780*028fa281SKalle Valo #define  RCR_APPEND_ICV			BIT(29)
781*028fa281SKalle Valo #define  RCR_APPEND_MIC			BIT(30)
782*028fa281SKalle Valo #define  RCR_APPEND_FCS			BIT(31) /* WMAC append FCS after */
783*028fa281SKalle Valo 
784*028fa281SKalle Valo #define REG_RX_PKT_LIMIT		0x060c
785*028fa281SKalle Valo #define REG_RX_DLK_TIME			0x060d
786*028fa281SKalle Valo #define REG_RX_DRVINFO_SZ		0x060f
787*028fa281SKalle Valo 
788*028fa281SKalle Valo #define REG_MACID			0x0610
789*028fa281SKalle Valo #define REG_BSSID			0x0618
790*028fa281SKalle Valo #define REG_MAR				0x0620
791*028fa281SKalle Valo #define REG_MBIDCAMCFG			0x0628
792*028fa281SKalle Valo 
793*028fa281SKalle Valo #define REG_USTIME_EDCA			0x0638
794*028fa281SKalle Valo #define REG_MAC_SPEC_SIFS		0x063a
795*028fa281SKalle Valo 
796*028fa281SKalle Valo /*  20100719 Joseph: Hardware register definition change. (HW datasheet v54) */
797*028fa281SKalle Valo 	/*  [15:8]SIFS_R2T_OFDM, [7:0]SIFS_R2T_CCK */
798*028fa281SKalle Valo #define REG_R2T_SIFS			0x063c
799*028fa281SKalle Valo 	/*  [15:8]SIFS_T2T_OFDM, [7:0]SIFS_T2T_CCK */
800*028fa281SKalle Valo #define REG_T2T_SIFS			0x063e
801*028fa281SKalle Valo #define REG_ACKTO			0x0640
802*028fa281SKalle Valo #define REG_CTS2TO			0x0641
803*028fa281SKalle Valo #define REG_EIFS			0x0642
804*028fa281SKalle Valo 
805*028fa281SKalle Valo /* WMA, BA, CCX */
806*028fa281SKalle Valo #define REG_NAV_CTRL			0x0650
807*028fa281SKalle Valo /* In units of 128us */
808*028fa281SKalle Valo #define REG_NAV_UPPER			0x0652
809*028fa281SKalle Valo #define  NAV_UPPER_UNIT			128
810*028fa281SKalle Valo 
811*028fa281SKalle Valo #define REG_BACAMCMD			0x0654
812*028fa281SKalle Valo #define REG_BACAMCONTENT		0x0658
813*028fa281SKalle Valo #define REG_LBDLY			0x0660
814*028fa281SKalle Valo #define REG_FWDLY			0x0661
815*028fa281SKalle Valo #define REG_RXERR_RPT			0x0664
816*028fa281SKalle Valo #define REG_WMAC_TRXPTCL_CTL		0x0668
817*028fa281SKalle Valo #define  WMAC_TRXPTCL_CTL_BW_MASK	(BIT(7) | BIT(8))
818*028fa281SKalle Valo #define  WMAC_TRXPTCL_CTL_BW_20		0
819*028fa281SKalle Valo #define  WMAC_TRXPTCL_CTL_BW_40		BIT(7)
820*028fa281SKalle Valo #define  WMAC_TRXPTCL_CTL_BW_80		BIT(8)
821*028fa281SKalle Valo 
822*028fa281SKalle Valo /*  Security */
823*028fa281SKalle Valo #define REG_CAM_CMD			0x0670
824*028fa281SKalle Valo #define  CAM_CMD_POLLING		BIT(31)
825*028fa281SKalle Valo #define  CAM_CMD_WRITE			BIT(16)
826*028fa281SKalle Valo #define  CAM_CMD_KEY_SHIFT		3
827*028fa281SKalle Valo #define REG_CAM_WRITE			0x0674
828*028fa281SKalle Valo #define  CAM_WRITE_VALID		BIT(15)
829*028fa281SKalle Valo #define REG_CAM_READ			0x0678
830*028fa281SKalle Valo #define REG_CAM_DEBUG			0x067c
831*028fa281SKalle Valo #define REG_SECURITY_CFG		0x0680
832*028fa281SKalle Valo #define  SEC_CFG_TX_USE_DEFKEY		BIT(0)
833*028fa281SKalle Valo #define  SEC_CFG_RX_USE_DEFKEY		BIT(1)
834*028fa281SKalle Valo #define  SEC_CFG_TX_SEC_ENABLE		BIT(2)
835*028fa281SKalle Valo #define  SEC_CFG_RX_SEC_ENABLE		BIT(3)
836*028fa281SKalle Valo #define  SEC_CFG_SKBYA2			BIT(4)
837*028fa281SKalle Valo #define  SEC_CFG_NO_SKMC		BIT(5)
838*028fa281SKalle Valo #define  SEC_CFG_TXBC_USE_DEFKEY	BIT(6)
839*028fa281SKalle Valo #define  SEC_CFG_RXBC_USE_DEFKEY	BIT(7)
840*028fa281SKalle Valo 
841*028fa281SKalle Valo /*  Power */
842*028fa281SKalle Valo #define REG_WOW_CTRL			0x0690
843*028fa281SKalle Valo #define REG_PSSTATUS			0x0691
844*028fa281SKalle Valo #define REG_PS_RX_INFO			0x0692
845*028fa281SKalle Valo #define REG_LPNAV_CTRL			0x0694
846*028fa281SKalle Valo #define REG_WKFMCAM_CMD			0x0698
847*028fa281SKalle Valo #define REG_WKFMCAM_RWD			0x069c
848*028fa281SKalle Valo 
849*028fa281SKalle Valo /*
850*028fa281SKalle Valo  * RX Filters: each bit corresponds to the numerical value of the subtype.
851*028fa281SKalle Valo  * If it is set the subtype frame type is passed. The filter is only used when
852*028fa281SKalle Valo  * the RCR_ACCEPT_DATA_FRAME, RCR_ACCEPT_CTRL_FRAME, RCR_ACCEPT_MGMT_FRAME bit
853*028fa281SKalle Valo  * in the RCR are low.
854*028fa281SKalle Valo  *
855*028fa281SKalle Valo  * Example: Beacon subtype is binary 1000 which is decimal 8 so we have to set
856*028fa281SKalle Valo  * bit 8 (0x100) in REG_RXFLTMAP0 to enable reception.
857*028fa281SKalle Valo  */
858*028fa281SKalle Valo #define REG_RXFLTMAP0			0x06a0	/* Management frames */
859*028fa281SKalle Valo #define REG_RXFLTMAP1			0x06a2	/* Control frames */
860*028fa281SKalle Valo #define REG_RXFLTMAP2			0x06a4	/* Data frames */
861*028fa281SKalle Valo 
862*028fa281SKalle Valo #define REG_BCN_PSR_RPT			0x06a8
863*028fa281SKalle Valo #define REG_CALB32K_CTRL		0x06ac
864*028fa281SKalle Valo #define REG_PKT_MON_CTRL		0x06b4
865*028fa281SKalle Valo #define REG_BT_COEX_TABLE1		0x06c0
866*028fa281SKalle Valo #define REG_BT_COEX_TABLE2		0x06c4
867*028fa281SKalle Valo #define REG_BT_COEX_TABLE3		0x06c8
868*028fa281SKalle Valo #define REG_BT_COEX_TABLE4		0x06cc
869*028fa281SKalle Valo #define REG_WMAC_RESP_TXINFO		0x06d8
870*028fa281SKalle Valo 
871*028fa281SKalle Valo #define REG_MACID1			0x0700
872*028fa281SKalle Valo #define REG_BSSID1			0x0708
873*028fa281SKalle Valo 
874*028fa281SKalle Valo /*
875*028fa281SKalle Valo  * This seems to be 8723bu specific
876*028fa281SKalle Valo  */
877*028fa281SKalle Valo #define REG_BT_CONTROL_8723BU		0x0764
878*028fa281SKalle Valo #define  BT_CONTROL_BT_GRANT		BIT(12)
879*028fa281SKalle Valo 
880*028fa281SKalle Valo #define REG_PORT_CONTROL_8710B		0x076d
881*028fa281SKalle Valo #define REG_WLAN_ACT_CONTROL_8723B	0x076e
882*028fa281SKalle Valo 
883*028fa281SKalle Valo #define REG_FPGA0_RF_MODE		0x0800
884*028fa281SKalle Valo #define  FPGA_RF_MODE			BIT(0)
885*028fa281SKalle Valo #define  FPGA_RF_MODE_JAPAN		BIT(1)
886*028fa281SKalle Valo #define  FPGA_RF_MODE_CCK		BIT(24)
887*028fa281SKalle Valo #define  FPGA_RF_MODE_OFDM		BIT(25)
888*028fa281SKalle Valo 
889*028fa281SKalle Valo #define REG_FPGA0_TX_INFO		0x0804
890*028fa281SKalle Valo #define  FPGA0_TX_INFO_OFDM_PATH_A	BIT(0)
891*028fa281SKalle Valo #define  FPGA0_TX_INFO_OFDM_PATH_B	BIT(1)
892*028fa281SKalle Valo #define  FPGA0_TX_INFO_OFDM_PATH_C	BIT(2)
893*028fa281SKalle Valo #define  FPGA0_TX_INFO_OFDM_PATH_D	BIT(3)
894*028fa281SKalle Valo #define REG_FPGA0_PSD_FUNC		0x0808
895*028fa281SKalle Valo #define REG_FPGA0_TX_GAIN		0x080c
896*028fa281SKalle Valo #define REG_FPGA0_RF_TIMING1		0x0810
897*028fa281SKalle Valo #define REG_FPGA0_RF_TIMING2		0x0814
898*028fa281SKalle Valo #define REG_FPGA0_POWER_SAVE		0x0818
899*028fa281SKalle Valo #define  FPGA0_PS_LOWER_CHANNEL		BIT(26)
900*028fa281SKalle Valo #define  FPGA0_PS_UPPER_CHANNEL		BIT(27)
901*028fa281SKalle Valo 
902*028fa281SKalle Valo #define REG_FPGA0_XA_HSSI_PARM1		0x0820	/* RF 3 wire register */
903*028fa281SKalle Valo #define  FPGA0_HSSI_PARM1_PI		BIT(8)
904*028fa281SKalle Valo #define REG_FPGA0_XA_HSSI_PARM2		0x0824
905*028fa281SKalle Valo #define REG_FPGA0_XB_HSSI_PARM1		0x0828
906*028fa281SKalle Valo #define REG_FPGA0_XB_HSSI_PARM2		0x082c
907*028fa281SKalle Valo #define  FPGA0_HSSI_3WIRE_DATA_LEN	0x800
908*028fa281SKalle Valo #define  FPGA0_HSSI_3WIRE_ADDR_LEN	0x400
909*028fa281SKalle Valo #define  FPGA0_HSSI_PARM2_ADDR_SHIFT	23
910*028fa281SKalle Valo #define  FPGA0_HSSI_PARM2_ADDR_MASK	0x7f800000	/* 0xff << 23 */
911*028fa281SKalle Valo #define  FPGA0_HSSI_PARM2_CCK_HIGH_PWR	BIT(9)
912*028fa281SKalle Valo #define  FPGA0_HSSI_PARM2_EDGE_READ	BIT(31)
913*028fa281SKalle Valo 
914*028fa281SKalle Valo #define REG_TX_AGC_B_RATE18_06		0x0830
915*028fa281SKalle Valo #define REG_TX_AGC_B_RATE54_24		0x0834
916*028fa281SKalle Valo #define REG_TX_AGC_B_CCK1_55_MCS32	0x0838
917*028fa281SKalle Valo #define REG_TX_AGC_B_MCS03_MCS00	0x083c
918*028fa281SKalle Valo 
919*028fa281SKalle Valo #define REG_FPGA0_XA_LSSI_PARM		0x0840
920*028fa281SKalle Valo #define REG_FPGA0_XB_LSSI_PARM		0x0844
921*028fa281SKalle Valo #define  FPGA0_LSSI_PARM_ADDR_SHIFT	20
922*028fa281SKalle Valo #define  FPGA0_LSSI_PARM_ADDR_MASK	0x0ff00000
923*028fa281SKalle Valo #define  FPGA0_LSSI_PARM_DATA_MASK	0x000fffff
924*028fa281SKalle Valo 
925*028fa281SKalle Valo #define REG_TX_AGC_B_MCS07_MCS04	0x0848
926*028fa281SKalle Valo #define REG_TX_AGC_B_MCS11_MCS08	0x084c
927*028fa281SKalle Valo 
928*028fa281SKalle Valo #define REG_FPGA0_XCD_SWITCH_CTRL	0x085c
929*028fa281SKalle Valo 
930*028fa281SKalle Valo #define REG_FPGA0_XA_RF_INT_OE		0x0860	/* RF Channel switch */
931*028fa281SKalle Valo #define REG_FPGA0_XB_RF_INT_OE		0x0864
932*028fa281SKalle Valo #define  FPGA0_INT_OE_ANTENNA_AB_OPEN	0x000
933*028fa281SKalle Valo #define  FPGA0_INT_OE_ANTENNA_A		BIT(8)
934*028fa281SKalle Valo #define  FPGA0_INT_OE_ANTENNA_B		BIT(9)
935*028fa281SKalle Valo #define  FPGA0_INT_OE_ANTENNA_MASK	(FPGA0_INT_OE_ANTENNA_A | \
936*028fa281SKalle Valo 					 FPGA0_INT_OE_ANTENNA_B)
937*028fa281SKalle Valo 
938*028fa281SKalle Valo #define REG_TX_AGC_B_MCS15_MCS12	0x0868
939*028fa281SKalle Valo #define REG_TX_AGC_B_CCK11_A_CCK2_11	0x086c
940*028fa281SKalle Valo 
941*028fa281SKalle Valo #define REG_FPGA0_XAB_RF_SW_CTRL	0x0870
942*028fa281SKalle Valo #define REG_FPGA0_XA_RF_SW_CTRL		0x0870	/* 16 bit */
943*028fa281SKalle Valo #define REG_FPGA0_XB_RF_SW_CTRL		0x0872	/* 16 bit */
944*028fa281SKalle Valo #define REG_FPGA0_XCD_RF_SW_CTRL	0x0874
945*028fa281SKalle Valo #define REG_FPGA0_XC_RF_SW_CTRL		0x0874	/* 16 bit */
946*028fa281SKalle Valo #define REG_FPGA0_XD_RF_SW_CTRL		0x0876	/* 16 bit */
947*028fa281SKalle Valo #define  FPGA0_RF_3WIRE_DATA		BIT(0)
948*028fa281SKalle Valo #define  FPGA0_RF_3WIRE_CLOC		BIT(1)
949*028fa281SKalle Valo #define  FPGA0_RF_3WIRE_LOAD		BIT(2)
950*028fa281SKalle Valo #define  FPGA0_RF_3WIRE_RW		BIT(3)
951*028fa281SKalle Valo #define  FPGA0_RF_3WIRE_MASK		0xf
952*028fa281SKalle Valo #define  FPGA0_RF_RFENV			BIT(4)
953*028fa281SKalle Valo #define  FPGA0_RF_TRSW			BIT(5)	/* Useless now */
954*028fa281SKalle Valo #define  FPGA0_RF_TRSWB			BIT(6)
955*028fa281SKalle Valo #define  FPGA0_RF_ANTSW			BIT(8)
956*028fa281SKalle Valo #define  FPGA0_RF_ANTSWB		BIT(9)
957*028fa281SKalle Valo #define  FPGA0_RF_PAPE			BIT(10)
958*028fa281SKalle Valo #define  FPGA0_RF_PAPE5G		BIT(11)
959*028fa281SKalle Valo #define  FPGA0_RF_BD_CTRL_SHIFT		16
960*028fa281SKalle Valo 
961*028fa281SKalle Valo #define REG_FPGA0_XAB_RF_PARM		0x0878	/* Antenna select path in ODM */
962*028fa281SKalle Valo #define REG_FPGA0_XA_RF_PARM		0x0878	/* 16 bit */
963*028fa281SKalle Valo #define REG_FPGA0_XB_RF_PARM		0x087a	/* 16 bit */
964*028fa281SKalle Valo #define REG_FPGA0_XCD_RF_PARM		0x087c
965*028fa281SKalle Valo #define REG_FPGA0_XC_RF_PARM		0x087c	/* 16 bit */
966*028fa281SKalle Valo #define REG_FPGA0_XD_RF_PARM		0x087e	/* 16 bit */
967*028fa281SKalle Valo #define  FPGA0_RF_PARM_RFA_ENABLE	BIT(1)
968*028fa281SKalle Valo #define  FPGA0_RF_PARM_RFB_ENABLE	BIT(17)
969*028fa281SKalle Valo #define  FPGA0_RF_PARM_CLK_GATE		BIT(31)
970*028fa281SKalle Valo 
971*028fa281SKalle Valo #define REG_FPGA0_ANALOG1		0x0880
972*028fa281SKalle Valo #define REG_FPGA0_ANALOG2		0x0884
973*028fa281SKalle Valo #define  FPGA0_ANALOG2_20MHZ		BIT(10)
974*028fa281SKalle Valo #define REG_FPGA0_ANALOG3		0x0888
975*028fa281SKalle Valo #define REG_FPGA0_ANALOG4		0x088c
976*028fa281SKalle Valo 
977*028fa281SKalle Valo #define REG_NHM_TH9_TH10_8723B		0x0890
978*028fa281SKalle Valo #define REG_NHM_TIMER_8723B		0x0894
979*028fa281SKalle Valo #define REG_NHM_TH3_TO_TH0_8723B	0x0898
980*028fa281SKalle Valo #define REG_NHM_TH7_TO_TH4_8723B	0x089c
981*028fa281SKalle Valo 
982*028fa281SKalle Valo #define REG_FPGA0_XA_LSSI_READBACK	0x08a0	/* Tranceiver LSSI Readback */
983*028fa281SKalle Valo #define REG_FPGA0_XB_LSSI_READBACK	0x08a4
984*028fa281SKalle Valo #define REG_FPGA0_PSD_REPORT		0x08b4
985*028fa281SKalle Valo #define REG_HSPI_XA_READBACK		0x08b8	/* Transceiver A HSPI read */
986*028fa281SKalle Valo #define REG_HSPI_XB_READBACK		0x08bc	/* Transceiver B HSPI read */
987*028fa281SKalle Valo 
988*028fa281SKalle Valo #define REG_FPGA1_RF_MODE		0x0900
989*028fa281SKalle Valo 
990*028fa281SKalle Valo #define REG_FPGA1_TX_INFO		0x090c
991*028fa281SKalle Valo #define  FPGA1_TX_ANT_MASK		0x0000000f
992*028fa281SKalle Valo #define  FPGA1_TX_ANT_L_MASK		0x000000f0
993*028fa281SKalle Valo #define  FPGA1_TX_ANT_NON_HT_MASK	0x00000f00
994*028fa281SKalle Valo #define  FPGA1_TX_ANT_HT1_MASK		0x0000f000
995*028fa281SKalle Valo #define  FPGA1_TX_ANT_HT2_MASK		0x000f0000
996*028fa281SKalle Valo #define  FPGA1_TX_ANT_HT_S1_MASK	0x00f00000
997*028fa281SKalle Valo #define  FPGA1_TX_ANT_NON_HT_S1_MASK	0x0f000000
998*028fa281SKalle Valo #define  FPGA1_TX_OFDM_TXSC_MASK	0x30000000
999*028fa281SKalle Valo 
1000*028fa281SKalle Valo #define REG_ANT_MAPPING1		0x0914
1001*028fa281SKalle Valo #define REG_RFE_OPT			0x0920
1002*028fa281SKalle Valo #define REG_DPDT_CTRL			0x092c	/* 8723BU */
1003*028fa281SKalle Valo #define REG_RFE_CTRL_ANTA_SRC		0x0930	/* 8723BU */
1004*028fa281SKalle Valo #define REG_RFE_CTRL_ANT_SRC1		0x0934
1005*028fa281SKalle Valo #define REG_RFE_CTRL_ANT_SRC2		0x0938
1006*028fa281SKalle Valo #define REG_RFE_CTRL_ANT_SRC3		0x093c
1007*028fa281SKalle Valo #define REG_RFE_PATH_SELECT		0x0940	/* 8723BU */
1008*028fa281SKalle Valo #define REG_RFE_BUFFER			0x0944	/* 8723BU */
1009*028fa281SKalle Valo #define REG_S0S1_PATH_SWITCH		0x0948	/* 8723BU */
1010*028fa281SKalle Valo #define REG_RX_DFIR_MOD_97F		0x0948
1011*028fa281SKalle Valo #define REG_OFDM_RX_DFIR		0x954
1012*028fa281SKalle Valo #define REG_RFE_OPT62			0x0968
1013*028fa281SKalle Valo 
1014*028fa281SKalle Valo #define REG_CCK0_SYSTEM			0x0a00
1015*028fa281SKalle Valo #define  CCK0_SIDEBAND			BIT(4)
1016*028fa281SKalle Valo 
1017*028fa281SKalle Valo #define REG_CCK0_AFE_SETTING		0x0a04
1018*028fa281SKalle Valo #define  CCK0_AFE_RX_MASK		0x0f000000
1019*028fa281SKalle Valo #define  CCK0_AFE_TX_MASK		0xf0000000
1020*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_A		0
1021*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_B		BIT(26)
1022*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_C		BIT(27)
1023*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_D		(BIT(26) | BIT(27))
1024*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_OPTION_A	0
1025*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_OPTION_B	BIT(24)
1026*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_OPTION_C	BIT(25)
1027*028fa281SKalle Valo #define  CCK0_AFE_RX_ANT_OPTION_D	(BIT(24) | BIT(25))
1028*028fa281SKalle Valo #define  CCK0_AFE_TX_ANT_A		BIT(31)
1029*028fa281SKalle Valo #define  CCK0_AFE_TX_ANT_B		BIT(30)
1030*028fa281SKalle Valo 
1031*028fa281SKalle Valo #define REG_CCK_ANTDIV_PARA2		0x0a04
1032*028fa281SKalle Valo #define REG_BB_POWER_SAVE4		0x0a74
1033*028fa281SKalle Valo 
1034*028fa281SKalle Valo /* 8188eu */
1035*028fa281SKalle Valo #define REG_LNA_SWITCH			0x0b2c
1036*028fa281SKalle Valo #define  LNA_SWITCH_DISABLE_CSCG	BIT(22)
1037*028fa281SKalle Valo #define  LNA_SWITCH_OUTPUT_CG		BIT(31)
1038*028fa281SKalle Valo 
1039*028fa281SKalle Valo #define REG_CCK_PD_THRESH			0x0a0a
1040*028fa281SKalle Valo #define  CCK_PD_TYPE1_LV0_TH		0x40
1041*028fa281SKalle Valo #define  CCK_PD_TYPE1_LV1_TH		0x83
1042*028fa281SKalle Valo #define  CCK_PD_TYPE1_LV2_TH		0xcd
1043*028fa281SKalle Valo #define  CCK_PD_TYPE1_LV3_TH		0xdd
1044*028fa281SKalle Valo #define  CCK_PD_TYPE1_LV4_TH		0xed
1045*028fa281SKalle Valo 
1046*028fa281SKalle Valo #define REG_CCK0_TX_FILTER1		0x0a20
1047*028fa281SKalle Valo #define REG_CCK0_TX_FILTER2		0x0a24
1048*028fa281SKalle Valo #define REG_CCK0_DEBUG_PORT		0x0a28	/* debug port and Tx filter3 */
1049*028fa281SKalle Valo #define REG_AGC_RPT			0xa80
1050*028fa281SKalle Valo #define  AGC_RPT_CCK			BIT(7)
1051*028fa281SKalle Valo #define REG_CCK0_TX_FILTER3		0x0aac
1052*028fa281SKalle Valo 
1053*028fa281SKalle Valo #define REG_CONFIG_ANT_A		0x0b68
1054*028fa281SKalle Valo #define REG_CONFIG_ANT_B		0x0b6c
1055*028fa281SKalle Valo 
1056*028fa281SKalle Valo #define REG_OFDM0_TRX_PATH_ENABLE	0x0c04
1057*028fa281SKalle Valo #define OFDM_RF_PATH_RX_MASK		0x0f
1058*028fa281SKalle Valo #define OFDM_RF_PATH_RX_A		BIT(0)
1059*028fa281SKalle Valo #define OFDM_RF_PATH_RX_B		BIT(1)
1060*028fa281SKalle Valo #define OFDM_RF_PATH_RX_C		BIT(2)
1061*028fa281SKalle Valo #define OFDM_RF_PATH_RX_D		BIT(3)
1062*028fa281SKalle Valo #define OFDM_RF_PATH_TX_MASK		0xf0
1063*028fa281SKalle Valo #define OFDM_RF_PATH_TX_A		BIT(4)
1064*028fa281SKalle Valo #define OFDM_RF_PATH_TX_B		BIT(5)
1065*028fa281SKalle Valo #define OFDM_RF_PATH_TX_C		BIT(6)
1066*028fa281SKalle Valo #define OFDM_RF_PATH_TX_D		BIT(7)
1067*028fa281SKalle Valo 
1068*028fa281SKalle Valo #define REG_OFDM0_TR_MUX_PAR		0x0c08
1069*028fa281SKalle Valo 
1070*028fa281SKalle Valo #define REG_OFDM0_FA_RSTC		0x0c0c
1071*028fa281SKalle Valo 
1072*028fa281SKalle Valo #define REG_DOWNSAM_FACTOR		0x0c10
1073*028fa281SKalle Valo 
1074*028fa281SKalle Valo #define REG_OFDM0_XA_RX_AFE		0x0c10
1075*028fa281SKalle Valo #define REG_OFDM0_XA_RX_IQ_IMBALANCE	0x0c14
1076*028fa281SKalle Valo #define REG_OFDM0_XB_RX_IQ_IMBALANCE	0x0c1c
1077*028fa281SKalle Valo 
1078*028fa281SKalle Valo #define REG_OFDM0_ENERGY_CCA_THRES	0x0c4c
1079*028fa281SKalle Valo 
1080*028fa281SKalle Valo #define REG_OFDM0_RX_D_SYNC_PATH	0x0c40
1081*028fa281SKalle Valo #define  OFDM0_SYNC_PATH_NOTCH_FILTER	BIT(1)
1082*028fa281SKalle Valo 
1083*028fa281SKalle Valo #define REG_OFDM0_XA_AGC_CORE1		0x0c50
1084*028fa281SKalle Valo #define REG_OFDM0_XA_AGC_CORE2		0x0c54
1085*028fa281SKalle Valo #define REG_OFDM0_XB_AGC_CORE1		0x0c58
1086*028fa281SKalle Valo #define REG_OFDM0_XB_AGC_CORE2		0x0c5c
1087*028fa281SKalle Valo #define REG_OFDM0_XC_AGC_CORE1		0x0c60
1088*028fa281SKalle Valo #define REG_OFDM0_XC_AGC_CORE2		0x0c64
1089*028fa281SKalle Valo #define REG_OFDM0_XD_AGC_CORE1		0x0c68
1090*028fa281SKalle Valo #define REG_OFDM0_XD_AGC_CORE2		0x0c6c
1091*028fa281SKalle Valo #define  OFDM0_X_AGC_CORE1_IGI_MASK	0x0000007F
1092*028fa281SKalle Valo 
1093*028fa281SKalle Valo #define REG_OFDM0_AGC_PARM1		0x0c70
1094*028fa281SKalle Valo 
1095*028fa281SKalle Valo #define REG_OFDM0_AGC_RSSI_TABLE	0x0c78
1096*028fa281SKalle Valo 
1097*028fa281SKalle Valo #define REG_OFDM0_XA_TX_IQ_IMBALANCE	0x0c80
1098*028fa281SKalle Valo #define REG_OFDM0_XB_TX_IQ_IMBALANCE	0x0c88
1099*028fa281SKalle Valo #define REG_OFDM0_XC_TX_IQ_IMBALANCE	0x0c90
1100*028fa281SKalle Valo #define REG_OFDM0_XD_TX_IQ_IMBALANCE	0x0c98
1101*028fa281SKalle Valo 
1102*028fa281SKalle Valo #define REG_OFDM0_XC_TX_AFE		0x0c94
1103*028fa281SKalle Valo #define REG_OFDM0_XD_TX_AFE		0x0c9c
1104*028fa281SKalle Valo 
1105*028fa281SKalle Valo #define REG_OFDM0_RX_IQ_EXT_ANTA	0x0ca0
1106*028fa281SKalle Valo 
1107*028fa281SKalle Valo /* 8188eu */
1108*028fa281SKalle Valo #define REG_ANTDIV_PARA1		0x0ca4
1109*028fa281SKalle Valo 
1110*028fa281SKalle Valo #define REG_RXIQB_EXT			0x0ca8
1111*028fa281SKalle Valo 
1112*028fa281SKalle Valo /* 8723bu */
1113*028fa281SKalle Valo #define REG_OFDM0_TX_PSDO_NOISE_WEIGHT	0x0ce4
1114*028fa281SKalle Valo 
1115*028fa281SKalle Valo #define REG_OFDM1_LSTF			0x0d00
1116*028fa281SKalle Valo #define  OFDM_LSTF_PRIME_CH_LOW		BIT(10)
1117*028fa281SKalle Valo #define  OFDM_LSTF_PRIME_CH_HIGH	BIT(11)
1118*028fa281SKalle Valo #define  OFDM_LSTF_PRIME_CH_MASK	(OFDM_LSTF_PRIME_CH_LOW | \
1119*028fa281SKalle Valo 					 OFDM_LSTF_PRIME_CH_HIGH)
1120*028fa281SKalle Valo #define  OFDM_LSTF_CONTINUE_TX		BIT(28)
1121*028fa281SKalle Valo #define  OFDM_LSTF_SINGLE_CARRIER	BIT(29)
1122*028fa281SKalle Valo #define  OFDM_LSTF_SINGLE_TONE		BIT(30)
1123*028fa281SKalle Valo #define  OFDM_LSTF_MASK			0x70000000
1124*028fa281SKalle Valo 
1125*028fa281SKalle Valo #define REG_OFDM1_TRX_PATH_ENABLE	0x0d04
1126*028fa281SKalle Valo #define REG_OFDM1_CFO_TRACKING		0x0d2c
1127*028fa281SKalle Valo #define  CFO_TRACKING_ATC_STATUS	BIT(11)
1128*028fa281SKalle Valo #define REG_OFDM1_CSI_FIX_MASK1		0x0d40
1129*028fa281SKalle Valo #define REG_OFDM1_CSI_FIX_MASK2		0x0d44
1130*028fa281SKalle Valo 
1131*028fa281SKalle Valo #define REG_ANAPWR1			0x0d94
1132*028fa281SKalle Valo 
1133*028fa281SKalle Valo #define REG_TX_AGC_A_RATE18_06		0x0e00
1134*028fa281SKalle Valo #define REG_TX_AGC_A_RATE54_24		0x0e04
1135*028fa281SKalle Valo #define REG_TX_AGC_A_CCK1_MCS32		0x0e08
1136*028fa281SKalle Valo #define REG_TX_AGC_A_MCS03_MCS00	0x0e10
1137*028fa281SKalle Valo #define REG_TX_AGC_A_MCS07_MCS04	0x0e14
1138*028fa281SKalle Valo #define REG_TX_AGC_A_MCS11_MCS08	0x0e18
1139*028fa281SKalle Valo #define REG_TX_AGC_A_MCS15_MCS12	0x0e1c
1140*028fa281SKalle Valo 
1141*028fa281SKalle Valo #define REG_NP_ANTA			0x0e20
1142*028fa281SKalle Valo 
1143*028fa281SKalle Valo #define REG_TAP_UPD_97F			0x0e24
1144*028fa281SKalle Valo 
1145*028fa281SKalle Valo #define REG_FPGA0_IQK			0x0e28
1146*028fa281SKalle Valo 
1147*028fa281SKalle Valo #define REG_TX_IQK_TONE_A		0x0e30
1148*028fa281SKalle Valo #define REG_RX_IQK_TONE_A		0x0e34
1149*028fa281SKalle Valo #define REG_TX_IQK_PI_A			0x0e38
1150*028fa281SKalle Valo #define REG_RX_IQK_PI_A			0x0e3c
1151*028fa281SKalle Valo 
1152*028fa281SKalle Valo #define REG_TX_IQK			0x0e40
1153*028fa281SKalle Valo #define REG_RX_IQK			0x0e44
1154*028fa281SKalle Valo #define REG_IQK_AGC_PTS			0x0e48
1155*028fa281SKalle Valo #define REG_IQK_AGC_RSP			0x0e4c
1156*028fa281SKalle Valo #define REG_TX_IQK_TONE_B		0x0e50
1157*028fa281SKalle Valo #define REG_RX_IQK_TONE_B		0x0e54
1158*028fa281SKalle Valo #define REG_TX_IQK_PI_B			0x0e58
1159*028fa281SKalle Valo #define REG_RX_IQK_PI_B			0x0e5c
1160*028fa281SKalle Valo #define REG_IQK_AGC_CONT		0x0e60
1161*028fa281SKalle Valo 
1162*028fa281SKalle Valo #define REG_BLUETOOTH			0x0e6c
1163*028fa281SKalle Valo #define REG_RX_WAIT_CCA			0x0e70
1164*028fa281SKalle Valo #define REG_TX_CCK_RFON			0x0e74
1165*028fa281SKalle Valo #define REG_TX_CCK_BBON			0x0e78
1166*028fa281SKalle Valo #define REG_TX_OFDM_RFON		0x0e7c
1167*028fa281SKalle Valo #define REG_TX_OFDM_BBON		0x0e80
1168*028fa281SKalle Valo #define REG_TX_TO_RX			0x0e84
1169*028fa281SKalle Valo #define REG_TX_TO_TX			0x0e88
1170*028fa281SKalle Valo #define REG_RX_CCK			0x0e8c
1171*028fa281SKalle Valo 
1172*028fa281SKalle Valo #define REG_TX_POWER_BEFORE_IQK_A	0x0e94
1173*028fa281SKalle Valo #define REG_IQK_RPT_TXA			0x0e98
1174*028fa281SKalle Valo #define REG_TX_POWER_AFTER_IQK_A	0x0e9c
1175*028fa281SKalle Valo 
1176*028fa281SKalle Valo #define REG_RX_POWER_BEFORE_IQK_A	0x0ea0
1177*028fa281SKalle Valo #define REG_RX_POWER_BEFORE_IQK_A_2	0x0ea4
1178*028fa281SKalle Valo #define REG_RX_POWER_AFTER_IQK_A	0x0ea8
1179*028fa281SKalle Valo #define REG_IQK_RPT_RXA			0x0ea8
1180*028fa281SKalle Valo #define REG_RX_POWER_AFTER_IQK_A_2	0x0eac
1181*028fa281SKalle Valo 
1182*028fa281SKalle Valo #define REG_TX_POWER_BEFORE_IQK_B	0x0eb4
1183*028fa281SKalle Valo #define REG_IQK_RPT_TXB			0x0eb8
1184*028fa281SKalle Valo #define REG_TX_POWER_AFTER_IQK_B	0x0ebc
1185*028fa281SKalle Valo 
1186*028fa281SKalle Valo #define REG_RX_POWER_BEFORE_IQK_B	0x0ec0
1187*028fa281SKalle Valo #define REG_RX_POWER_BEFORE_IQK_B_2	0x0ec4
1188*028fa281SKalle Valo #define REG_RX_POWER_AFTER_IQK_B	0x0ec8
1189*028fa281SKalle Valo #define REG_IQK_RPT_RXB			0x0ec8
1190*028fa281SKalle Valo #define REG_RX_POWER_AFTER_IQK_B_2	0x0ecc
1191*028fa281SKalle Valo 
1192*028fa281SKalle Valo #define REG_RX_OFDM			0x0ed0
1193*028fa281SKalle Valo #define REG_RX_WAIT_RIFS		0x0ed4
1194*028fa281SKalle Valo #define REG_RX_TO_RX			0x0ed8
1195*028fa281SKalle Valo #define REG_STANDBY			0x0edc
1196*028fa281SKalle Valo #define REG_SLEEP			0x0ee0
1197*028fa281SKalle Valo #define REG_PMPD_ANAEN			0x0eec
1198*028fa281SKalle Valo 
1199*028fa281SKalle Valo #define REG_FW_START_ADDRESS		0x1000
1200*028fa281SKalle Valo #define REG_FW_START_ADDRESS_8192F	0x4000
1201*028fa281SKalle Valo 
1202*028fa281SKalle Valo #define REG_SW_GPIO_SHARE_CTRL_0	0x1038
1203*028fa281SKalle Valo #define REG_SW_GPIO_SHARE_CTRL_1	0x103c
1204*028fa281SKalle Valo #define REG_GPIO_A0			0x1050
1205*028fa281SKalle Valo #define REG_GPIO_B0			0x105b
1206*028fa281SKalle Valo 
1207*028fa281SKalle Valo #define REG_USB_INFO			0xfe17
1208*028fa281SKalle Valo #define REG_USB_HIMR			0xfe38
1209*028fa281SKalle Valo #define  USB_HIMR_TIMEOUT2		BIT(31)
1210*028fa281SKalle Valo #define  USB_HIMR_TIMEOUT1		BIT(30)
1211*028fa281SKalle Valo #define  USB_HIMR_PSTIMEOUT		BIT(29)
1212*028fa281SKalle Valo #define  USB_HIMR_GTINT4		BIT(28)
1213*028fa281SKalle Valo #define  USB_HIMR_GTINT3		BIT(27)
1214*028fa281SKalle Valo #define  USB_HIMR_TXBCNERR		BIT(26)
1215*028fa281SKalle Valo #define  USB_HIMR_TXBCNOK		BIT(25)
1216*028fa281SKalle Valo #define  USB_HIMR_TSF_BIT32_TOGGLE	BIT(24)
1217*028fa281SKalle Valo #define  USB_HIMR_BCNDMAINT3		BIT(23)
1218*028fa281SKalle Valo #define  USB_HIMR_BCNDMAINT2		BIT(22)
1219*028fa281SKalle Valo #define  USB_HIMR_BCNDMAINT1		BIT(21)
1220*028fa281SKalle Valo #define  USB_HIMR_BCNDMAINT0		BIT(20)
1221*028fa281SKalle Valo #define  USB_HIMR_BCNDOK3		BIT(19)
1222*028fa281SKalle Valo #define  USB_HIMR_BCNDOK2		BIT(18)
1223*028fa281SKalle Valo #define  USB_HIMR_BCNDOK1		BIT(17)
1224*028fa281SKalle Valo #define  USB_HIMR_BCNDOK0		BIT(16)
1225*028fa281SKalle Valo #define  USB_HIMR_HSISR_IND		BIT(15)
1226*028fa281SKalle Valo #define  USB_HIMR_BCNDMAINT_E		BIT(14)
1227*028fa281SKalle Valo /* RSVD	BIT(13) */
1228*028fa281SKalle Valo #define  USB_HIMR_CTW_END		BIT(12)
1229*028fa281SKalle Valo /* RSVD	BIT(11) */
1230*028fa281SKalle Valo #define  USB_HIMR_C2HCMD		BIT(10)
1231*028fa281SKalle Valo #define  USB_HIMR_CPWM2			BIT(9)
1232*028fa281SKalle Valo #define  USB_HIMR_CPWM			BIT(8)
1233*028fa281SKalle Valo #define  USB_HIMR_HIGHDOK		BIT(7)	/*  High Queue DMA OK
1234*028fa281SKalle Valo 						    Interrupt */
1235*028fa281SKalle Valo #define  USB_HIMR_MGNTDOK		BIT(6)	/*  Management Queue DMA OK
1236*028fa281SKalle Valo 						    Interrupt */
1237*028fa281SKalle Valo #define  USB_HIMR_BKDOK			BIT(5)	/*  AC_BK DMA OK Interrupt */
1238*028fa281SKalle Valo #define  USB_HIMR_BEDOK			BIT(4)	/*  AC_BE DMA OK Interrupt */
1239*028fa281SKalle Valo #define  USB_HIMR_VIDOK			BIT(3)	/*  AC_VI DMA OK Interrupt */
1240*028fa281SKalle Valo #define  USB_HIMR_VODOK			BIT(2)	/*  AC_VO DMA Interrupt */
1241*028fa281SKalle Valo #define  USB_HIMR_RDU			BIT(1)	/*  Receive Descriptor
1242*028fa281SKalle Valo 						    Unavailable */
1243*028fa281SKalle Valo #define  USB_HIMR_ROK			BIT(0)	/*  Receive DMA OK Interrupt */
1244*028fa281SKalle Valo 
1245*028fa281SKalle Valo #define REG_USB_ACCESS_TIMEOUT		0xfe4c
1246*028fa281SKalle Valo 
1247*028fa281SKalle Valo #define REG_USB_SPECIAL_OPTION		0xfe55
1248*028fa281SKalle Valo #define  USB_SPEC_USB_AGG_ENABLE	BIT(3)	/* Enable USB aggregation */
1249*028fa281SKalle Valo #define  USB_SPEC_INT_BULK_SELECT	BIT(4)	/* Use interrupt endpoint to
1250*028fa281SKalle Valo 						   deliver interrupt packet.
1251*028fa281SKalle Valo 						   0: Use int, 1: use bulk */
1252*028fa281SKalle Valo #define REG_USB_HRPWM			0xfe58
1253*028fa281SKalle Valo #define REG_USB_DMA_AGG_TO		0xfe5b
1254*028fa281SKalle Valo #define REG_USB_AGG_TIMEOUT		0xfe5c
1255*028fa281SKalle Valo #define REG_USB_AGG_THRESH		0xfe5d
1256*028fa281SKalle Valo 
1257*028fa281SKalle Valo #define REG_NORMAL_SIE_VID		0xfe60	/* 0xfe60 - 0xfe61 */
1258*028fa281SKalle Valo #define REG_NORMAL_SIE_PID		0xfe62	/* 0xfe62 - 0xfe63 */
1259*028fa281SKalle Valo #define REG_NORMAL_SIE_OPTIONAL		0xfe64
1260*028fa281SKalle Valo #define REG_NORMAL_SIE_EP		0xfe65	/* 0xfe65 - 0xfe67 */
1261*028fa281SKalle Valo #define REG_NORMAL_SIE_EP_TX		0xfe66
1262*028fa281SKalle Valo #define  NORMAL_SIE_EP_TX_HIGH_MASK	0x000f
1263*028fa281SKalle Valo #define  NORMAL_SIE_EP_TX_NORMAL_MASK	0x00f0
1264*028fa281SKalle Valo #define  NORMAL_SIE_EP_TX_LOW_MASK	0x0f00
1265*028fa281SKalle Valo 
1266*028fa281SKalle Valo #define REG_NORMAL_SIE_PHY		0xfe68	/* 0xfe68 - 0xfe6b */
1267*028fa281SKalle Valo #define REG_NORMAL_SIE_OPTIONAL2	0xfe6c
1268*028fa281SKalle Valo #define REG_NORMAL_SIE_GPS_EP		0xfe6d	/* RTL8723 only */
1269*028fa281SKalle Valo #define REG_NORMAL_SIE_MAC_ADDR		0xfe70	/* 0xfe70 - 0xfe75 */
1270*028fa281SKalle Valo #define REG_NORMAL_SIE_STRING		0xfe80	/* 0xfe80 - 0xfedf */
1271*028fa281SKalle Valo 
1272*028fa281SKalle Valo /*
1273*028fa281SKalle Valo  * 8710B register addresses between 0x00 and 0xff must have 0x8000
1274*028fa281SKalle Valo  * added to them. We take care of that in the rtl8xxxu_read{8,16,32}
1275*028fa281SKalle Valo  * and rtl8xxxu_write{8,16,32} functions.
1276*028fa281SKalle Valo  */
1277*028fa281SKalle Valo #define REG_SYS_FUNC_8710B		0x0004
1278*028fa281SKalle Valo #define REG_AFE_CTRL_8710B		0x0050
1279*028fa281SKalle Valo #define REG_WL_RF_PSS_8710B		0x005c
1280*028fa281SKalle Valo #define REG_EFUSE_INDIRECT_CTRL_8710B	0x006c
1281*028fa281SKalle Valo #define  NORMAL_REG_READ_OFFSET		0x83000000
1282*028fa281SKalle Valo #define  NORMAL_REG_WRITE_OFFSET	0x84000000
1283*028fa281SKalle Valo #define  EFUSE_READ_OFFSET		0x85000000
1284*028fa281SKalle Valo #define  EFUSE_WRITE_OFFSET		0x86000000
1285*028fa281SKalle Valo #define REG_HIMR0_8710B			0x0080
1286*028fa281SKalle Valo #define REG_HISR0_8710B			0x0084
1287*028fa281SKalle Valo /*
1288*028fa281SKalle Valo  * 8710B uses this instead of REG_MCU_FW_DL, but at least bits
1289*028fa281SKalle Valo  * 0-7 have the same meaning.
1290*028fa281SKalle Valo  */
1291*028fa281SKalle Valo #define REG_8051FW_CTRL_V1_8710B	0x0090
1292*028fa281SKalle Valo #define REG_USB_HOST_INDIRECT_DATA_8710B	0x009c
1293*028fa281SKalle Valo #define REG_WL_STATUS_8710B		0x00f0
1294*028fa281SKalle Valo #define REG_USB_HOST_INDIRECT_ADDR_8710B	0x00f8
1295*028fa281SKalle Valo 
1296*028fa281SKalle Valo /*
1297*028fa281SKalle Valo  * 8710B registers which must be accessed through rtl8710b_read_syson_reg
1298*028fa281SKalle Valo  * and rtl8710b_write_syson_reg.
1299*028fa281SKalle Valo  */
1300*028fa281SKalle Valo #define SYSON_REG_BASE_ADDR_8710B	0x40000000
1301*028fa281SKalle Valo #define REG_SYS_XTAL_CTRL0_8710B	0x060
1302*028fa281SKalle Valo #define REG_SYS_EEPROM_CTRL0_8710B	0x0e0
1303*028fa281SKalle Valo #define REG_SYS_SYSTEM_CFG0_8710B	0x1f0
1304*028fa281SKalle Valo #define REG_SYS_SYSTEM_CFG1_8710B	0x1f4
1305*028fa281SKalle Valo #define REG_SYS_SYSTEM_CFG2_8710B	0x1f8
1306*028fa281SKalle Valo 
1307*028fa281SKalle Valo /* RF6052 registers */
1308*028fa281SKalle Valo #define RF6052_REG_AC			0x00
1309*028fa281SKalle Valo #define RF6052_REG_IQADJ_G1		0x01
1310*028fa281SKalle Valo #define RF6052_REG_IQADJ_G2		0x02
1311*028fa281SKalle Valo #define RF6052_REG_BS_PA_APSET_G1_G4	0x03
1312*028fa281SKalle Valo #define RF6052_REG_BS_PA_APSET_G5_G8	0x04
1313*028fa281SKalle Valo #define RF6052_REG_POW_TRSW		0x05
1314*028fa281SKalle Valo #define RF6052_REG_GAIN_RX		0x06
1315*028fa281SKalle Valo #define RF6052_REG_GAIN_TX		0x07
1316*028fa281SKalle Valo #define RF6052_REG_TXM_IDAC		0x08
1317*028fa281SKalle Valo #define RF6052_REG_IPA_G		0x09
1318*028fa281SKalle Valo #define RF6052_REG_TXBIAS_G		0x0a
1319*028fa281SKalle Valo #define RF6052_REG_TXPA_AG		0x0b
1320*028fa281SKalle Valo #define RF6052_REG_IPA_A		0x0c
1321*028fa281SKalle Valo #define RF6052_REG_TXBIAS_A		0x0d
1322*028fa281SKalle Valo #define RF6052_REG_BS_PA_APSET_G9_G11	0x0e
1323*028fa281SKalle Valo #define RF6052_REG_BS_IQGEN		0x0f
1324*028fa281SKalle Valo #define RF6052_REG_MODE1		0x10
1325*028fa281SKalle Valo #define RF6052_REG_MODE2		0x11
1326*028fa281SKalle Valo #define RF6052_REG_RX_AGC_HP		0x12
1327*028fa281SKalle Valo #define RF6052_REG_TX_AGC		0x13
1328*028fa281SKalle Valo #define RF6052_REG_BIAS			0x14
1329*028fa281SKalle Valo #define RF6052_REG_IPA			0x15
1330*028fa281SKalle Valo #define RF6052_REG_TXBIAS		0x16
1331*028fa281SKalle Valo #define RF6052_REG_POW_ABILITY		0x17
1332*028fa281SKalle Valo #define RF6052_REG_MODE_AG		0x18	/* RF channel and BW switch */
1333*028fa281SKalle Valo #define  MODE_AG_CHANNEL_MASK		0x3ff
1334*028fa281SKalle Valo #define  MODE_AG_CHANNEL_20MHZ		BIT(10)
1335*028fa281SKalle Valo #define  MODE_AG_BW_MASK		(BIT(10) | BIT(11))
1336*028fa281SKalle Valo #define  MODE_AG_BW_20MHZ_8723B		(BIT(10) | BIT(11))
1337*028fa281SKalle Valo #define  MODE_AG_BW_40MHZ_8723B		BIT(10)
1338*028fa281SKalle Valo #define  MODE_AG_BW_80MHZ_8723B		0
1339*028fa281SKalle Valo 
1340*028fa281SKalle Valo #define RF6052_REG_TOP			0x19
1341*028fa281SKalle Valo #define RF6052_REG_RX_G1		0x1a
1342*028fa281SKalle Valo #define RF6052_REG_RX_G2		0x1b
1343*028fa281SKalle Valo #define RF6052_REG_RX_BB2		0x1c
1344*028fa281SKalle Valo #define RF6052_REG_RX_BB1		0x1d
1345*028fa281SKalle Valo #define RF6052_REG_RCK1			0x1e
1346*028fa281SKalle Valo #define RF6052_REG_RCK2			0x1f
1347*028fa281SKalle Valo #define RF6052_REG_TX_G1		0x20
1348*028fa281SKalle Valo #define RF6052_REG_TX_G2		0x21
1349*028fa281SKalle Valo #define RF6052_REG_TX_G3		0x22
1350*028fa281SKalle Valo #define RF6052_REG_TX_BB1		0x23
1351*028fa281SKalle Valo #define RF6052_REG_T_METER		0x24
1352*028fa281SKalle Valo #define RF6052_REG_SYN_G1		0x25	/* RF TX Power control */
1353*028fa281SKalle Valo #define RF6052_REG_SYN_G2		0x26	/* RF TX Power control */
1354*028fa281SKalle Valo #define RF6052_REG_SYN_G3		0x27	/* RF TX Power control */
1355*028fa281SKalle Valo #define RF6052_REG_SYN_G4		0x28	/* RF TX Power control */
1356*028fa281SKalle Valo #define RF6052_REG_SYN_G5		0x29	/* RF TX Power control */
1357*028fa281SKalle Valo #define RF6052_REG_SYN_G6		0x2a	/* RF TX Power control */
1358*028fa281SKalle Valo #define RF6052_REG_SYN_G7		0x2b	/* RF TX Power control */
1359*028fa281SKalle Valo #define RF6052_REG_SYN_G8		0x2c	/* RF TX Power control */
1360*028fa281SKalle Valo 
1361*028fa281SKalle Valo #define RF6052_REG_RCK_OS		0x30	/* RF TX PA control */
1362*028fa281SKalle Valo 
1363*028fa281SKalle Valo #define RF6052_REG_TXPA_G1		0x31	/* RF TX PA control */
1364*028fa281SKalle Valo #define RF6052_REG_TXPA_G2		0x32	/* RF TX PA control */
1365*028fa281SKalle Valo #define RF6052_REG_TXPA_G3		0x33	/* RF TX PA control */
1366*028fa281SKalle Valo 
1367*028fa281SKalle Valo /*
1368*028fa281SKalle Valo  * NextGen regs: 8723BU
1369*028fa281SKalle Valo  */
1370*028fa281SKalle Valo #define RF6052_REG_GAIN_P1		0x35
1371*028fa281SKalle Valo #define RF6052_REG_T_METER_8723B	0x42
1372*028fa281SKalle Valo #define RF6052_REG_UNKNOWN_43		0x43
1373*028fa281SKalle Valo #define RF6052_REG_UNKNOWN_55		0x55
1374*028fa281SKalle Valo #define RF6052_REG_PAD_TXG		0x56
1375*028fa281SKalle Valo #define RF6052_REG_TXMOD		0x58
1376*028fa281SKalle Valo #define RF6052_REG_RXG_MIX_SWBW		0x87
1377*028fa281SKalle Valo #define RF6052_REG_S0S1			0xb0
1378*028fa281SKalle Valo #define RF6052_REG_GAIN_CCA		0xdf
1379*028fa281SKalle Valo #define RF6052_REG_UNKNOWN_ED		0xed
1380*028fa281SKalle Valo #define RF6052_REG_WE_LUT		0xef
1381*028fa281SKalle Valo #define RF6052_REG_GAIN_CTRL		0xf5
1382