162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2014 - 2017 Jes Sorensen <Jes.Sorensen@gmail.com>
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Register definitions taken from original Realtek rtl8723au driver
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* 0x0000 ~ 0x00FF	System Configuration */
962306a36Sopenharmony_ci#define REG_SYS_ISO_CTRL		0x0000
1062306a36Sopenharmony_ci#define  SYS_ISO_MD2PP			BIT(0)
1162306a36Sopenharmony_ci#define  SYS_ISO_ANALOG_IPS		BIT(5)
1262306a36Sopenharmony_ci#define  SYS_ISO_DIOR			BIT(9)
1362306a36Sopenharmony_ci#define  SYS_ISO_PWC_EV25V		BIT(14)
1462306a36Sopenharmony_ci#define  SYS_ISO_PWC_EV12V		BIT(15)
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#define REG_SYS_FUNC			0x0002
1762306a36Sopenharmony_ci#define  SYS_FUNC_BBRSTB		BIT(0)
1862306a36Sopenharmony_ci#define  SYS_FUNC_BB_GLB_RSTN		BIT(1)
1962306a36Sopenharmony_ci#define  SYS_FUNC_USBA			BIT(2)
2062306a36Sopenharmony_ci#define  SYS_FUNC_UPLL			BIT(3)
2162306a36Sopenharmony_ci#define  SYS_FUNC_USBD			BIT(4)
2262306a36Sopenharmony_ci#define  SYS_FUNC_DIO_PCIE		BIT(5)
2362306a36Sopenharmony_ci#define  SYS_FUNC_PCIEA			BIT(6)
2462306a36Sopenharmony_ci#define  SYS_FUNC_PPLL			BIT(7)
2562306a36Sopenharmony_ci#define  SYS_FUNC_PCIED			BIT(8)
2662306a36Sopenharmony_ci#define  SYS_FUNC_DIOE			BIT(9)
2762306a36Sopenharmony_ci#define  SYS_FUNC_CPU_ENABLE		BIT(10)
2862306a36Sopenharmony_ci#define  SYS_FUNC_DCORE			BIT(11)
2962306a36Sopenharmony_ci#define  SYS_FUNC_ELDR			BIT(12)
3062306a36Sopenharmony_ci#define  SYS_FUNC_DIO_RF		BIT(13)
3162306a36Sopenharmony_ci#define  SYS_FUNC_HWPDN			BIT(14)
3262306a36Sopenharmony_ci#define  SYS_FUNC_MREGEN		BIT(15)
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define REG_APS_FSMCO			0x0004
3562306a36Sopenharmony_ci#define  APS_FSMCO_PFM_ALDN		BIT(1)
3662306a36Sopenharmony_ci#define  APS_FSMCO_PFM_WOWL		BIT(3)
3762306a36Sopenharmony_ci#define  APS_FSMCO_ENABLE_POWERDOWN	BIT(4)
3862306a36Sopenharmony_ci#define  APS_FSMCO_MAC_ENABLE		BIT(8)
3962306a36Sopenharmony_ci#define  APS_FSMCO_MAC_OFF		BIT(9)
4062306a36Sopenharmony_ci#define  APS_FSMCO_SW_LPS		BIT(10)
4162306a36Sopenharmony_ci#define  APS_FSMCO_HW_SUSPEND		BIT(11)
4262306a36Sopenharmony_ci#define  APS_FSMCO_PCIE			BIT(12)
4362306a36Sopenharmony_ci#define  APS_FSMCO_HW_POWERDOWN		BIT(15)
4462306a36Sopenharmony_ci#define  APS_FSMCO_WLON_RESET		BIT(16)
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#define REG_SYS_CLKR			0x0008
4762306a36Sopenharmony_ci#define  SYS_CLK_ANAD16V_ENABLE		BIT(0)
4862306a36Sopenharmony_ci#define  SYS_CLK_ANA8M			BIT(1)
4962306a36Sopenharmony_ci#define  SYS_CLK_MACSLP			BIT(4)
5062306a36Sopenharmony_ci#define  SYS_CLK_LOADER_ENABLE		BIT(5)
5162306a36Sopenharmony_ci#define  SYS_CLK_80M_SSC_DISABLE	BIT(7)
5262306a36Sopenharmony_ci#define  SYS_CLK_80M_SSC_ENABLE_HO	BIT(8)
5362306a36Sopenharmony_ci#define  SYS_CLK_PHY_SSC_RSTB		BIT(9)
5462306a36Sopenharmony_ci#define  SYS_CLK_SEC_CLK_ENABLE		BIT(10)
5562306a36Sopenharmony_ci#define  SYS_CLK_MAC_CLK_ENABLE		BIT(11)
5662306a36Sopenharmony_ci#define  SYS_CLK_ENABLE			BIT(12)
5762306a36Sopenharmony_ci#define  SYS_CLK_RING_CLK_ENABLE	BIT(13)
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci#define REG_9346CR			0x000a
6062306a36Sopenharmony_ci#define  EEPROM_BOOT			BIT(4)
6162306a36Sopenharmony_ci#define  EEPROM_ENABLE			BIT(5)
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define REG_EE_VPD			0x000c
6462306a36Sopenharmony_ci#define REG_AFE_MISC			0x0010
6562306a36Sopenharmony_ci#define  AFE_MISC_WL_XTAL_CTRL		BIT(6)
6662306a36Sopenharmony_ci
6762306a36Sopenharmony_ci#define REG_SPS0_CTRL			0x0011
6862306a36Sopenharmony_ci#define REG_SPS_OCP_CFG			0x0018
6962306a36Sopenharmony_ci#define REG_8192E_LDOV12_CTRL		0x0014
7062306a36Sopenharmony_ci#define REG_SYS_SWR_CTRL2		0x0014
7162306a36Sopenharmony_ci#define REG_RSV_CTRL			0x001c
7262306a36Sopenharmony_ci#define  RSV_CTRL_WLOCK_1C		BIT(5)
7362306a36Sopenharmony_ci#define  RSV_CTRL_DIS_PRST		BIT(6)
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#define REG_RF_CTRL			0x001f
7662306a36Sopenharmony_ci#define  RF_ENABLE			BIT(0)
7762306a36Sopenharmony_ci#define  RF_RSTB			BIT(1)
7862306a36Sopenharmony_ci#define  RF_SDMRSTB			BIT(2)
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci#define REG_LDOA15_CTRL			0x0020
8162306a36Sopenharmony_ci#define  LDOA15_ENABLE			BIT(0)
8262306a36Sopenharmony_ci#define  LDOA15_STANDBY			BIT(1)
8362306a36Sopenharmony_ci#define  LDOA15_OBUF			BIT(2)
8462306a36Sopenharmony_ci#define  LDOA15_REG_VOS			BIT(3)
8562306a36Sopenharmony_ci#define  LDOA15_VOADJ_SHIFT		4
8662306a36Sopenharmony_ci
8762306a36Sopenharmony_ci#define REG_LDOV12D_CTRL		0x0021
8862306a36Sopenharmony_ci#define  LDOV12D_ENABLE			BIT(0)
8962306a36Sopenharmony_ci#define  LDOV12D_STANDBY		BIT(1)
9062306a36Sopenharmony_ci#define  LDOV12D_VADJ_SHIFT		4
9162306a36Sopenharmony_ci
9262306a36Sopenharmony_ci#define REG_LDOHCI12_CTRL		0x0022
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci#define REG_LPLDO_CTRL			0x0023
9562306a36Sopenharmony_ci#define  LPLDO_HSM			BIT(2)
9662306a36Sopenharmony_ci#define  LPLDO_LSM_DIS			BIT(3)
9762306a36Sopenharmony_ci
9862306a36Sopenharmony_ci#define REG_AFE_XTAL_CTRL		0x0024
9962306a36Sopenharmony_ci#define  AFE_XTAL_ENABLE		BIT(0)
10062306a36Sopenharmony_ci#define  AFE_XTAL_B_SELECT		BIT(1)
10162306a36Sopenharmony_ci#define  AFE_XTAL_GATE_USB		BIT(8)
10262306a36Sopenharmony_ci#define  AFE_XTAL_GATE_AFE		BIT(11)
10362306a36Sopenharmony_ci#define  AFE_XTAL_RF_GATE		BIT(14)
10462306a36Sopenharmony_ci#define  AFE_XTAL_GATE_DIG		BIT(17)
10562306a36Sopenharmony_ci#define  AFE_XTAL_BT_GATE		BIT(20)
10662306a36Sopenharmony_ci
10762306a36Sopenharmony_ci/*
10862306a36Sopenharmony_ci * 0x0028 is also known as REG_AFE_CTRL2 on 8723bu/8192eu
10962306a36Sopenharmony_ci */
11062306a36Sopenharmony_ci#define REG_AFE_PLL_CTRL		0x0028
11162306a36Sopenharmony_ci#define  AFE_PLL_ENABLE			BIT(0)
11262306a36Sopenharmony_ci#define  AFE_PLL_320_ENABLE		BIT(1)
11362306a36Sopenharmony_ci#define  APE_PLL_FREF_SELECT		BIT(2)
11462306a36Sopenharmony_ci#define  AFE_PLL_EDGE_SELECT		BIT(3)
11562306a36Sopenharmony_ci#define  AFE_PLL_WDOGB			BIT(4)
11662306a36Sopenharmony_ci#define  AFE_PLL_LPF_ENABLE		BIT(5)
11762306a36Sopenharmony_ci
11862306a36Sopenharmony_ci#define REG_MAC_PHY_CTRL		0x002c
11962306a36Sopenharmony_ci
12062306a36Sopenharmony_ci#define REG_EFUSE_CTRL			0x0030
12162306a36Sopenharmony_ci#define REG_EFUSE_TEST			0x0034
12262306a36Sopenharmony_ci#define  EFUSE_TRPT			BIT(7)
12362306a36Sopenharmony_ci	/*  00: Wifi Efuse, 01: BT Efuse0, 10: BT Efuse1, 11: BT Efuse2 */
12462306a36Sopenharmony_ci#define  EFUSE_CELL_SEL			(BIT(8) | BIT(9))
12562306a36Sopenharmony_ci#define  EFUSE_LDOE25_ENABLE		BIT(31)
12662306a36Sopenharmony_ci#define  EFUSE_SELECT_MASK		0x0300
12762306a36Sopenharmony_ci#define  EFUSE_WIFI_SELECT		0x0000
12862306a36Sopenharmony_ci#define  EFUSE_BT0_SELECT		0x0100
12962306a36Sopenharmony_ci#define  EFUSE_BT1_SELECT		0x0200
13062306a36Sopenharmony_ci#define  EFUSE_BT2_SELECT		0x0300
13162306a36Sopenharmony_ci
13262306a36Sopenharmony_ci#define  EFUSE_ACCESS_ENABLE		0x69	/* RTL8723 only */
13362306a36Sopenharmony_ci#define  EFUSE_ACCESS_DISABLE		0x00	/* RTL8723 only */
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci#define REG_PWR_DATA			0x0038
13662306a36Sopenharmony_ci#define  PWR_DATA_EEPRPAD_RFE_CTRL_EN	BIT(11)
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci#define REG_CAL_TIMER			0x003c
13962306a36Sopenharmony_ci#define REG_ACLK_MON			0x003e
14062306a36Sopenharmony_ci#define REG_GPIO_MUXCFG			0x0040
14162306a36Sopenharmony_ci#define  GPIO_MUXCFG_IO_SEL_ENBT	BIT(5)
14262306a36Sopenharmony_ci#define REG_GPIO_IO_SEL			0x0042
14362306a36Sopenharmony_ci#define REG_MAC_PINMUX_CFG		0x0043
14462306a36Sopenharmony_ci#define REG_GPIO_PIN_CTRL		0x0044
14562306a36Sopenharmony_ci#define REG_GPIO_INTM			0x0048
14662306a36Sopenharmony_ci#define  GPIO_INTM_EDGE_TRIG_IRQ	BIT(9)
14762306a36Sopenharmony_ci
14862306a36Sopenharmony_ci#define REG_LEDCFG0			0x004c
14962306a36Sopenharmony_ci#define  LEDCFG0_DPDT_SELECT		BIT(23)
15062306a36Sopenharmony_ci#define REG_LEDCFG1			0x004d
15162306a36Sopenharmony_ci#define  LEDCFG1_HW_LED_CONTROL		BIT(1)
15262306a36Sopenharmony_ci#define  LEDCFG1_LED_DISABLE		BIT(7)
15362306a36Sopenharmony_ci#define REG_LEDCFG2			0x004e
15462306a36Sopenharmony_ci#define  LEDCFG2_HW_LED_CONTROL		BIT(1)
15562306a36Sopenharmony_ci#define  LEDCFG2_HW_LED_ENABLE		BIT(5)
15662306a36Sopenharmony_ci#define  LEDCFG2_SW_LED_DISABLE		BIT(3)
15762306a36Sopenharmony_ci#define  LEDCFG2_SW_LED_CONTROL   	BIT(5)
15862306a36Sopenharmony_ci#define  LEDCFG2_DPDT_SELECT		BIT(7)
15962306a36Sopenharmony_ci#define REG_LEDCFG3			0x004f
16062306a36Sopenharmony_ci#define REG_LEDCFG			REG_LEDCFG2
16162306a36Sopenharmony_ci#define REG_FSIMR			0x0050
16262306a36Sopenharmony_ci#define REG_FSISR			0x0054
16362306a36Sopenharmony_ci#define REG_HSIMR			0x0058
16462306a36Sopenharmony_ci#define REG_HSISR			0x005c
16562306a36Sopenharmony_ci/*  RTL8723 WIFI/BT/GPS Multi-Function GPIO Pin Control. */
16662306a36Sopenharmony_ci#define REG_GPIO_PIN_CTRL_2		0x0060
16762306a36Sopenharmony_ci/*  RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
16862306a36Sopenharmony_ci#define REG_GPIO_IO_SEL_2		0x0062
16962306a36Sopenharmony_ci#define  GPIO_IO_SEL_2_GPIO09_INPUT	BIT(1)
17062306a36Sopenharmony_ci#define  GPIO_IO_SEL_2_GPIO09_IRQ	BIT(9)
17162306a36Sopenharmony_ci
17262306a36Sopenharmony_ci/*  RTL8723B */
17362306a36Sopenharmony_ci#define REG_PAD_CTRL1			0x0064
17462306a36Sopenharmony_ci#define  PAD_CTRL1_SW_DPDT_SEL_DATA	BIT(0)
17562306a36Sopenharmony_ci
17662306a36Sopenharmony_ci/*  RTL8723 only WIFI/BT/GPS Multi-Function control source. */
17762306a36Sopenharmony_ci#define REG_MULTI_FUNC_CTRL		0x0068
17862306a36Sopenharmony_ci
17962306a36Sopenharmony_ci#define  MULTI_FN_WIFI_HW_PWRDOWN_EN	BIT(0)	/* Enable GPIO[9] as WiFi HW
18062306a36Sopenharmony_ci						   powerdown source */
18162306a36Sopenharmony_ci#define  MULTI_FN_WIFI_HW_PWRDOWN_SL	BIT(1)	/* WiFi HW powerdown polarity
18262306a36Sopenharmony_ci						   control */
18362306a36Sopenharmony_ci#define  MULTI_WIFI_FUNC_EN		BIT(2)	/* WiFi function enable */
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci#define  MULTI_WIFI_HW_ROF_EN		BIT(3)	/* Enable GPIO[9] as WiFi RF HW
18662306a36Sopenharmony_ci						   powerdown source */
18762306a36Sopenharmony_ci#define  MULTI_BT_HW_PWRDOWN_EN		BIT(16)	/* Enable GPIO[11] as BT HW
18862306a36Sopenharmony_ci						   powerdown source */
18962306a36Sopenharmony_ci#define  MULTI_BT_HW_PWRDOWN_SL		BIT(17)	/* BT HW powerdown polarity
19062306a36Sopenharmony_ci						   control */
19162306a36Sopenharmony_ci#define  MULTI_BT_FUNC_EN		BIT(18)	/* BT function enable */
19262306a36Sopenharmony_ci#define  MULTI_BT_HW_ROF_EN		BIT(19)	/* Enable GPIO[11] as BT/GPS
19362306a36Sopenharmony_ci						   RF HW powerdown source */
19462306a36Sopenharmony_ci#define  MULTI_GPS_HW_PWRDOWN_EN	BIT(20)	/* Enable GPIO[10] as GPS HW
19562306a36Sopenharmony_ci						   powerdown source */
19662306a36Sopenharmony_ci#define  MULTI_GPS_HW_PWRDOWN_SL	BIT(21)	/* GPS HW powerdown polarity
19762306a36Sopenharmony_ci						   control */
19862306a36Sopenharmony_ci#define  MULTI_GPS_FUNC_EN		BIT(22)	/* GPS function enable */
19962306a36Sopenharmony_ci
20062306a36Sopenharmony_ci#define REG_AFE_CTRL4			0x0078	/* 8192eu/8723bu */
20162306a36Sopenharmony_ci#define REG_LDO_SW_CTRL			0x007c	/* 8192eu */
20262306a36Sopenharmony_ci
20362306a36Sopenharmony_ci#define REG_MCU_FW_DL			0x0080
20462306a36Sopenharmony_ci#define  MCU_FW_DL_ENABLE		BIT(0)
20562306a36Sopenharmony_ci#define  MCU_FW_DL_READY		BIT(1)
20662306a36Sopenharmony_ci#define  MCU_FW_DL_CSUM_REPORT		BIT(2)
20762306a36Sopenharmony_ci#define  MCU_MAC_INIT_READY		BIT(3)
20862306a36Sopenharmony_ci#define  MCU_BB_INIT_READY		BIT(4)
20962306a36Sopenharmony_ci#define  MCU_RF_INIT_READY		BIT(5)
21062306a36Sopenharmony_ci#define  MCU_WINT_INIT_READY		BIT(6)
21162306a36Sopenharmony_ci#define  MCU_FW_RAM_SEL			BIT(7)	/* 1: RAM, 0:ROM */
21262306a36Sopenharmony_ci#define  MCU_CP_RESET			BIT(23)
21362306a36Sopenharmony_ci
21462306a36Sopenharmony_ci#define REG_HMBOX_EXT_0			0x0088
21562306a36Sopenharmony_ci#define REG_HMBOX_EXT_1			0x008a
21662306a36Sopenharmony_ci#define REG_HMBOX_EXT_2			0x008c
21762306a36Sopenharmony_ci#define REG_HMBOX_EXT_3			0x008e
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ci#define REG_RSVD_1			0x0097
22062306a36Sopenharmony_ci
22162306a36Sopenharmony_ci/* Interrupt registers for 8192e/8723bu/8812 */
22262306a36Sopenharmony_ci#define REG_HIMR0			0x00b0
22362306a36Sopenharmony_ci#define	 IMR0_TXCCK			BIT(30)	/* TXRPT interrupt when CCX bit
22462306a36Sopenharmony_ci						   of the packet is set */
22562306a36Sopenharmony_ci#define	 IMR0_PSTIMEOUT			BIT(29)	/* Power Save Time Out Int */
22662306a36Sopenharmony_ci#define	 IMR0_GTINT4			BIT(28)	/* Set when GTIMER4 expires */
22762306a36Sopenharmony_ci#define	 IMR0_GTINT3			BIT(27)	/* Set when GTIMER3 expires */
22862306a36Sopenharmony_ci#define	 IMR0_TBDER			BIT(26)	/* Transmit Beacon0 Error */
22962306a36Sopenharmony_ci#define	 IMR0_TBDOK			BIT(25)	/* Transmit Beacon0 OK */
23062306a36Sopenharmony_ci#define	 IMR0_TSF_BIT32_TOGGLE		BIT(24)	/* TSF Timer BIT32 toggle
23162306a36Sopenharmony_ci						   indication interrupt */
23262306a36Sopenharmony_ci#define	 IMR0_BCNDMAINT0		BIT(20)	/* Beacon DMA Interrupt 0 */
23362306a36Sopenharmony_ci#define	 IMR0_BCNDERR0			BIT(16)	/* Beacon Queue DMA Error 0 */
23462306a36Sopenharmony_ci#define	 IMR0_HSISR_IND_ON_INT		BIT(15)	/* HSISR Indicator (HSIMR &
23562306a36Sopenharmony_ci						   HSISR is true) */
23662306a36Sopenharmony_ci#define	 IMR0_BCNDMAINT_E		BIT(14)	/* Beacon DMA Interrupt
23762306a36Sopenharmony_ci						   Extension for Win7 */
23862306a36Sopenharmony_ci#define	 IMR0_ATIMEND			BIT(12)	/* CTWidnow End or
23962306a36Sopenharmony_ci						   ATIM Window End */
24062306a36Sopenharmony_ci#define	 IMR0_HISR1_IND_INT		BIT(11)	/* HISR1 Indicator
24162306a36Sopenharmony_ci						   (HISR1 & HIMR1 is true) */
24262306a36Sopenharmony_ci#define	 IMR0_C2HCMD			BIT(10)	/* CPU to Host Command INT
24362306a36Sopenharmony_ci						   Status, Write 1 to clear */
24462306a36Sopenharmony_ci#define	 IMR0_CPWM2			BIT(9)	/* CPU power Mode exchange INT
24562306a36Sopenharmony_ci						   Status, Write 1 to clear */
24662306a36Sopenharmony_ci#define	 IMR0_CPWM			BIT(8)	/* CPU power Mode exchange INT
24762306a36Sopenharmony_ci						   Status, Write 1 to clear */
24862306a36Sopenharmony_ci#define	 IMR0_HIGHDOK			BIT(7)	/* High Queue DMA OK */
24962306a36Sopenharmony_ci#define	 IMR0_MGNTDOK			BIT(6)	/* Management Queue DMA OK */
25062306a36Sopenharmony_ci#define	 IMR0_BKDOK			BIT(5)	/* AC_BK DMA OK */
25162306a36Sopenharmony_ci#define	 IMR0_BEDOK			BIT(4)	/* AC_BE DMA OK */
25262306a36Sopenharmony_ci#define	 IMR0_VIDOK			BIT(3)	/* AC_VI DMA OK */
25362306a36Sopenharmony_ci#define	 IMR0_VODOK			BIT(2)	/* AC_VO DMA OK */
25462306a36Sopenharmony_ci#define	 IMR0_RDU			BIT(1)	/* Rx Descriptor Unavailable */
25562306a36Sopenharmony_ci#define	 IMR0_ROK			BIT(0)	/* Receive DMA OK */
25662306a36Sopenharmony_ci#define REG_HISR0			0x00b4
25762306a36Sopenharmony_ci#define REG_HIMR1			0x00b8
25862306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT7		BIT(27)	/* Beacon DMA Interrupt 7 */
25962306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT6		BIT(26)	/* Beacon DMA Interrupt 6 */
26062306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT5		BIT(25)	/* Beacon DMA Interrupt 5 */
26162306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT4		BIT(24)	/* Beacon DMA Interrupt 4 */
26262306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT3		BIT(23)	/* Beacon DMA Interrupt 3 */
26362306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT2		BIT(22)	/* Beacon DMA Interrupt 2 */
26462306a36Sopenharmony_ci#define	 IMR1_BCNDMAINT1		BIT(21)	/* Beacon DMA Interrupt 1 */
26562306a36Sopenharmony_ci#define	 IMR1_BCNDERR7			BIT(20)	/* Beacon Queue DMA Err Int 7 */
26662306a36Sopenharmony_ci#define	 IMR1_BCNDERR6			BIT(19)	/* Beacon Queue DMA Err Int 6 */
26762306a36Sopenharmony_ci#define	 IMR1_BCNDERR5			BIT(18)	/* Beacon Queue DMA Err Int 5 */
26862306a36Sopenharmony_ci#define	 IMR1_BCNDERR4			BIT(17)	/* Beacon Queue DMA Err Int 4 */
26962306a36Sopenharmony_ci#define	 IMR1_BCNDERR3			BIT(16)	/* Beacon Queue DMA Err Int 3 */
27062306a36Sopenharmony_ci#define	 IMR1_BCNDERR2			BIT(15)	/* Beacon Queue DMA Err Int 2 */
27162306a36Sopenharmony_ci#define	 IMR1_BCNDERR1			BIT(14)	/* Beacon Queue DMA Err Int 1 */
27262306a36Sopenharmony_ci#define	 IMR1_ATIMEND_E			BIT(13)	/* ATIM Window End Extension
27362306a36Sopenharmony_ci						   for Win7 */
27462306a36Sopenharmony_ci#define	 IMR1_TXERR			BIT(11)	/* Tx Error Flag Int Status,
27562306a36Sopenharmony_ci						   write 1 to clear */
27662306a36Sopenharmony_ci#define	 IMR1_RXERR			BIT(10)	/* Rx Error Flag Int Status,
27762306a36Sopenharmony_ci						   write 1 to clear */
27862306a36Sopenharmony_ci#define	 IMR1_TXFOVW			BIT(9)	/* Transmit FIFO Overflow */
27962306a36Sopenharmony_ci#define	 IMR1_RXFOVW			BIT(8)	/* Receive FIFO Overflow */
28062306a36Sopenharmony_ci#define REG_HISR1			0x00bc
28162306a36Sopenharmony_ci
28262306a36Sopenharmony_ci/*  Host suspend counter on FPGA platform */
28362306a36Sopenharmony_ci#define REG_HOST_SUSP_CNT		0x00bc
28462306a36Sopenharmony_ci/*  Efuse access protection for RTL8723 */
28562306a36Sopenharmony_ci#define REG_EFUSE_ACCESS		0x00cf
28662306a36Sopenharmony_ci#define REG_BIST_SCAN			0x00d0
28762306a36Sopenharmony_ci#define REG_BIST_RPT			0x00d4
28862306a36Sopenharmony_ci#define REG_BIST_ROM_RPT		0x00d8
28962306a36Sopenharmony_ci#define REG_RSVD_4			0x00dc
29062306a36Sopenharmony_ci#define REG_USB_SIE_INTF		0x00e0
29162306a36Sopenharmony_ci#define REG_PCIE_MIO_INTF		0x00e4
29262306a36Sopenharmony_ci#define REG_PCIE_MIO_INTD		0x00e8
29362306a36Sopenharmony_ci#define REG_HPON_FSM			0x00ec
29462306a36Sopenharmony_ci#define  HPON_FSM_BONDING_MASK		(BIT(22) | BIT(23))
29562306a36Sopenharmony_ci#define  HPON_FSM_BONDING_1T2R		BIT(22)
29662306a36Sopenharmony_ci#define REG_SYS_CFG			0x00f0
29762306a36Sopenharmony_ci#define  SYS_CFG_XCLK_VLD		BIT(0)
29862306a36Sopenharmony_ci#define  SYS_CFG_ACLK_VLD		BIT(1)
29962306a36Sopenharmony_ci#define  SYS_CFG_UCLK_VLD		BIT(2)
30062306a36Sopenharmony_ci#define  SYS_CFG_PCLK_VLD		BIT(3)
30162306a36Sopenharmony_ci#define  SYS_CFG_PCIRSTB		BIT(4)
30262306a36Sopenharmony_ci#define  SYS_CFG_V15_VLD		BIT(5)
30362306a36Sopenharmony_ci#define  SYS_CFG_TRP_B15V_EN		BIT(7)
30462306a36Sopenharmony_ci#define  SYS_CFG_SW_OFFLOAD_EN		BIT(7)	/* For chips with IOL support */
30562306a36Sopenharmony_ci#define  SYS_CFG_SIC_IDLE		BIT(8)
30662306a36Sopenharmony_ci#define  SYS_CFG_BD_MAC2		BIT(9)
30762306a36Sopenharmony_ci#define  SYS_CFG_BD_MAC1		BIT(10)
30862306a36Sopenharmony_ci#define  SYS_CFG_IC_MACPHY_MODE		BIT(11)
30962306a36Sopenharmony_ci#define  SYS_CFG_CHIP_VER		(BIT(12) | BIT(13) | BIT(14) | BIT(15))
31062306a36Sopenharmony_ci#define  SYS_CFG_BT_FUNC		BIT(16)
31162306a36Sopenharmony_ci#define  SYS_CFG_VENDOR_ID		BIT(19)
31262306a36Sopenharmony_ci#define  SYS_CFG_VENDOR_EXT_MASK	(BIT(18) | BIT(19))
31362306a36Sopenharmony_ci#define   SYS_CFG_VENDOR_ID_TSMC	0
31462306a36Sopenharmony_ci#define   SYS_CFG_VENDOR_ID_SMIC	BIT(18)
31562306a36Sopenharmony_ci#define   SYS_CFG_VENDOR_ID_UMC		BIT(19)
31662306a36Sopenharmony_ci#define  SYS_CFG_PAD_HWPD_IDN		BIT(22)
31762306a36Sopenharmony_ci#define  SYS_CFG_TRP_VAUX_EN		BIT(23)
31862306a36Sopenharmony_ci#define  SYS_CFG_TRP_BT_EN		BIT(24)
31962306a36Sopenharmony_ci#define  SYS_CFG_SPS_LDO_SEL		BIT(24)	/* 8192eu */
32062306a36Sopenharmony_ci#define  SYS_CFG_BD_PKG_SEL		BIT(25)
32162306a36Sopenharmony_ci#define  SYS_CFG_BD_HCI_SEL		BIT(26)
32262306a36Sopenharmony_ci#define  SYS_CFG_TYPE_ID		BIT(27)
32362306a36Sopenharmony_ci#define  SYS_CFG_RTL_ID			BIT(23) /*  TestChip ID,
32462306a36Sopenharmony_ci						    1:Test(RLE); 0:MP(RL) */
32562306a36Sopenharmony_ci#define  SYS_CFG_SPS_SEL		BIT(24) /*  1:LDO regulator mode;
32662306a36Sopenharmony_ci						    0:Switching regulator mode*/
32762306a36Sopenharmony_ci#define  SYS_CFG_CHIP_VERSION_MASK	0xf000	/* Bit 12 - 15 */
32862306a36Sopenharmony_ci
32962306a36Sopenharmony_ci#define REG_GPIO_OUTSTS			0x00f4	/*  For RTL8723 only. */
33062306a36Sopenharmony_ci#define  GPIO_EFS_HCI_SEL		(BIT(0) | BIT(1))
33162306a36Sopenharmony_ci#define  GPIO_PAD_HCI_SEL		(BIT(2) | BIT(3))
33262306a36Sopenharmony_ci#define  GPIO_HCI_SEL			(BIT(4) | BIT(5))
33362306a36Sopenharmony_ci#define  GPIO_PKG_SEL_HCI		BIT(6)
33462306a36Sopenharmony_ci#define  GPIO_FEN_GPS			BIT(7)
33562306a36Sopenharmony_ci#define  GPIO_FEN_BT			BIT(8)
33662306a36Sopenharmony_ci#define  GPIO_FEN_WL			BIT(9)
33762306a36Sopenharmony_ci#define  GPIO_FEN_PCI			BIT(10)
33862306a36Sopenharmony_ci#define  GPIO_FEN_USB			BIT(11)
33962306a36Sopenharmony_ci#define  GPIO_BTRF_HWPDN_N		BIT(12)
34062306a36Sopenharmony_ci#define  GPIO_WLRF_HWPDN_N		BIT(13)
34162306a36Sopenharmony_ci#define  GPIO_PDN_BT_N			BIT(14)
34262306a36Sopenharmony_ci#define  GPIO_PDN_GPS_N			BIT(15)
34362306a36Sopenharmony_ci#define  GPIO_BT_CTL_HWPDN		BIT(16)
34462306a36Sopenharmony_ci#define  GPIO_GPS_CTL_HWPDN		BIT(17)
34562306a36Sopenharmony_ci#define  GPIO_PPHY_SUSB			BIT(20)
34662306a36Sopenharmony_ci#define  GPIO_UPHY_SUSB			BIT(21)
34762306a36Sopenharmony_ci#define  GPIO_PCI_SUSEN			BIT(22)
34862306a36Sopenharmony_ci#define  GPIO_USB_SUSEN			BIT(23)
34962306a36Sopenharmony_ci#define  GPIO_RF_RL_ID			(BIT(31) | BIT(30) | BIT(29) | BIT(28))
35062306a36Sopenharmony_ci
35162306a36Sopenharmony_ci#define REG_SYS_CFG2			0x00fc	/* 8192eu */
35262306a36Sopenharmony_ci
35362306a36Sopenharmony_ci/* 0x0100 ~ 0x01FF	MACTOP General Configuration */
35462306a36Sopenharmony_ci#define REG_CR				0x0100
35562306a36Sopenharmony_ci#define  CR_HCI_TXDMA_ENABLE		BIT(0)
35662306a36Sopenharmony_ci#define  CR_HCI_RXDMA_ENABLE		BIT(1)
35762306a36Sopenharmony_ci#define  CR_TXDMA_ENABLE		BIT(2)
35862306a36Sopenharmony_ci#define  CR_RXDMA_ENABLE		BIT(3)
35962306a36Sopenharmony_ci#define  CR_PROTOCOL_ENABLE		BIT(4)
36062306a36Sopenharmony_ci#define  CR_SCHEDULE_ENABLE		BIT(5)
36162306a36Sopenharmony_ci#define  CR_MAC_TX_ENABLE		BIT(6)
36262306a36Sopenharmony_ci#define  CR_MAC_RX_ENABLE		BIT(7)
36362306a36Sopenharmony_ci#define  CR_SW_BEACON_ENABLE		BIT(8)
36462306a36Sopenharmony_ci#define  CR_SECURITY_ENABLE		BIT(9)
36562306a36Sopenharmony_ci#define  CR_CALTIMER_ENABLE		BIT(10)
36662306a36Sopenharmony_ci
36762306a36Sopenharmony_ci/* Media Status Register */
36862306a36Sopenharmony_ci#define REG_MSR				0x0102
36962306a36Sopenharmony_ci#define  MSR_LINKTYPE_MASK		0x3
37062306a36Sopenharmony_ci#define  MSR_LINKTYPE_NONE		0x0
37162306a36Sopenharmony_ci#define  MSR_LINKTYPE_ADHOC		0x1
37262306a36Sopenharmony_ci#define  MSR_LINKTYPE_STATION		0x2
37362306a36Sopenharmony_ci#define  MSR_LINKTYPE_AP		0x3
37462306a36Sopenharmony_ci
37562306a36Sopenharmony_ci#define REG_PBP				0x0104
37662306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_RX_SHIFT		0
37762306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_TX_SHIFT		4
37862306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_64		0x0
37962306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_128		0x1
38062306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_256		0x2
38162306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_512		0x3
38262306a36Sopenharmony_ci#define  PBP_PAGE_SIZE_1024		0x4
38362306a36Sopenharmony_ci
38462306a36Sopenharmony_ci/* 8188eu IOL magic */
38562306a36Sopenharmony_ci#define REG_PKT_BUF_ACCESS_CTRL		0x0106
38662306a36Sopenharmony_ci#define  PKT_BUF_ACCESS_CTRL_TX		0x69
38762306a36Sopenharmony_ci#define  PKT_BUF_ACCESS_CTRL_RX		0xa5
38862306a36Sopenharmony_ci
38962306a36Sopenharmony_ci#define REG_TRXDMA_CTRL			0x010c
39062306a36Sopenharmony_ci#define  TRXDMA_CTRL_RXDMA_AGG_EN	BIT(2)
39162306a36Sopenharmony_ci#define  TRXDMA_CTRL_VOQ_SHIFT		4
39262306a36Sopenharmony_ci#define  TRXDMA_CTRL_VIQ_SHIFT		6
39362306a36Sopenharmony_ci#define  TRXDMA_CTRL_BEQ_SHIFT		8
39462306a36Sopenharmony_ci#define  TRXDMA_CTRL_BKQ_SHIFT		10
39562306a36Sopenharmony_ci#define  TRXDMA_CTRL_MGQ_SHIFT		12
39662306a36Sopenharmony_ci#define  TRXDMA_CTRL_HIQ_SHIFT		14
39762306a36Sopenharmony_ci#define  TRXDMA_CTRL_VOQ_SHIFT_8192F	4
39862306a36Sopenharmony_ci#define  TRXDMA_CTRL_VIQ_SHIFT_8192F	7
39962306a36Sopenharmony_ci#define  TRXDMA_CTRL_BEQ_SHIFT_8192F	10
40062306a36Sopenharmony_ci#define  TRXDMA_CTRL_BKQ_SHIFT_8192F	13
40162306a36Sopenharmony_ci#define  TRXDMA_CTRL_MGQ_SHIFT_8192F	16
40262306a36Sopenharmony_ci#define  TRXDMA_CTRL_HIQ_SHIFT_8192F	19
40362306a36Sopenharmony_ci#define  TRXDMA_QUEUE_LOW		1
40462306a36Sopenharmony_ci#define  TRXDMA_QUEUE_NORMAL		2
40562306a36Sopenharmony_ci#define  TRXDMA_QUEUE_HIGH		3
40662306a36Sopenharmony_ci
40762306a36Sopenharmony_ci#define REG_TRXFF_BNDY			0x0114
40862306a36Sopenharmony_ci#define REG_TRXFF_STATUS		0x0118
40962306a36Sopenharmony_ci#define REG_RXFF_PTR			0x011c
41062306a36Sopenharmony_ci#define REG_HIMR			0x0120
41162306a36Sopenharmony_ci#define REG_HISR			0x0124
41262306a36Sopenharmony_ci#define REG_HIMRE			0x0128
41362306a36Sopenharmony_ci#define REG_HISRE			0x012c
41462306a36Sopenharmony_ci#define REG_CPWM			0x012f
41562306a36Sopenharmony_ci#define REG_FWIMR			0x0130
41662306a36Sopenharmony_ci#define REG_FWISR			0x0134
41762306a36Sopenharmony_ci#define REG_FTIMR			0x0138
41862306a36Sopenharmony_ci#define REG_PKTBUF_DBG_CTRL		0x0140
41962306a36Sopenharmony_ci#define REG_PKTBUF_DBG_DATA_L		0x0144
42062306a36Sopenharmony_ci#define REG_PKTBUF_DBG_DATA_H		0x0148
42162306a36Sopenharmony_ci
42262306a36Sopenharmony_ci#define REG_TC0_CTRL			0x0150
42362306a36Sopenharmony_ci#define REG_TC1_CTRL			0x0154
42462306a36Sopenharmony_ci#define REG_TC2_CTRL			0x0158
42562306a36Sopenharmony_ci#define REG_TC3_CTRL			0x015c
42662306a36Sopenharmony_ci#define REG_TC4_CTRL			0x0160
42762306a36Sopenharmony_ci#define REG_TCUNIT_BASE			0x0164
42862306a36Sopenharmony_ci#define REG_MBIST_START			0x0174
42962306a36Sopenharmony_ci#define REG_MBIST_DONE			0x0178
43062306a36Sopenharmony_ci#define REG_MBIST_FAIL			0x017c
43162306a36Sopenharmony_ci/* 8188EU */
43262306a36Sopenharmony_ci#define REG_32K_CTRL			0x0194
43362306a36Sopenharmony_ci#define REG_C2HEVT_MSG_NORMAL		0x01a0
43462306a36Sopenharmony_ci/* 8192EU/8723BU/8812 */
43562306a36Sopenharmony_ci#define REG_C2HEVT_CMD_ID_8723B		0x01ae
43662306a36Sopenharmony_ci#define REG_C2HEVT_CLEAR		0x01af
43762306a36Sopenharmony_ci#define REG_C2HEVT_MSG_TEST		0x01b8
43862306a36Sopenharmony_ci#define REG_MCUTST_1			0x01c0
43962306a36Sopenharmony_ci#define REG_FMTHR			0x01c8
44062306a36Sopenharmony_ci#define REG_HMTFR			0x01cc
44162306a36Sopenharmony_ci#define REG_HMBOX_0			0x01d0
44262306a36Sopenharmony_ci#define REG_HMBOX_1			0x01d4
44362306a36Sopenharmony_ci#define REG_HMBOX_2			0x01d8
44462306a36Sopenharmony_ci#define REG_HMBOX_3			0x01dc
44562306a36Sopenharmony_ci
44662306a36Sopenharmony_ci#define REG_LLT_INIT			0x01e0
44762306a36Sopenharmony_ci#define  LLT_OP_INACTIVE		0x0
44862306a36Sopenharmony_ci#define  LLT_OP_WRITE			(0x1 << 30)
44962306a36Sopenharmony_ci#define  LLT_OP_READ			(0x2 << 30)
45062306a36Sopenharmony_ci#define  LLT_OP_MASK			(0x3 << 30)
45162306a36Sopenharmony_ci
45262306a36Sopenharmony_ci#define REG_BB_ACCESS_CTRL		0x01e8
45362306a36Sopenharmony_ci#define REG_BB_ACCESS_DATA		0x01ec
45462306a36Sopenharmony_ci
45562306a36Sopenharmony_ci#define REG_HMBOX_EXT0_8723B		0x01f0
45662306a36Sopenharmony_ci#define REG_HMBOX_EXT1_8723B		0x01f4
45762306a36Sopenharmony_ci#define REG_HMBOX_EXT2_8723B		0x01f8
45862306a36Sopenharmony_ci#define REG_HMBOX_EXT3_8723B		0x01fc
45962306a36Sopenharmony_ci
46062306a36Sopenharmony_ci/* 0x0200 ~ 0x027F	TXDMA Configuration */
46162306a36Sopenharmony_ci#define REG_RQPN			0x0200
46262306a36Sopenharmony_ci#define  RQPN_HI_PQ_SHIFT		0
46362306a36Sopenharmony_ci#define  RQPN_LO_PQ_SHIFT		8
46462306a36Sopenharmony_ci#define  RQPN_PUB_PQ_SHIFT		16
46562306a36Sopenharmony_ci#define  RQPN_LOAD			BIT(31)
46662306a36Sopenharmony_ci
46762306a36Sopenharmony_ci#define REG_FIFOPAGE			0x0204
46862306a36Sopenharmony_ci#define REG_TDECTRL			0x0208
46962306a36Sopenharmony_ci#define  BIT_BCN_VALID			BIT(16)
47062306a36Sopenharmony_ci
47162306a36Sopenharmony_ci#define REG_DWBCN0_CTRL_8188F		REG_TDECTRL
47262306a36Sopenharmony_ci
47362306a36Sopenharmony_ci#define REG_TXDMA_OFFSET_CHK		0x020c
47462306a36Sopenharmony_ci#define  TXDMA_OFFSET_DROP_DATA_EN	BIT(9)
47562306a36Sopenharmony_ci#define REG_TXDMA_STATUS		0x0210
47662306a36Sopenharmony_ci#define REG_RQPN_NPQ			0x0214
47762306a36Sopenharmony_ci#define  RQPN_NPQ_SHIFT			0
47862306a36Sopenharmony_ci#define  RQPN_EPQ_SHIFT			16
47962306a36Sopenharmony_ci
48062306a36Sopenharmony_ci#define REG_AUTO_LLT			0x0224
48162306a36Sopenharmony_ci#define  AUTO_LLT_INIT_LLT		BIT(16)
48262306a36Sopenharmony_ci
48362306a36Sopenharmony_ci#define REG_DWBCN1_CTRL_8723B		0x0228
48462306a36Sopenharmony_ci#define  BIT_SW_BCN_SEL			BIT(20)
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci/* 0x0280 ~ 0x02FF	RXDMA Configuration */
48762306a36Sopenharmony_ci#define REG_RXDMA_AGG_PG_TH		0x0280	/* 0-7 : USB DMA size bits
48862306a36Sopenharmony_ci						   8-14: USB DMA timeout
48962306a36Sopenharmony_ci						   15  : Aggregation enable
49062306a36Sopenharmony_ci						         Only seems to be used
49162306a36Sopenharmony_ci							 on 8723bu/8192eu */
49262306a36Sopenharmony_ci#define  RXDMA_USB_AGG_ENABLE		BIT(31)
49362306a36Sopenharmony_ci#define REG_RXPKT_NUM			0x0284
49462306a36Sopenharmony_ci#define  RXPKT_NUM_RXDMA_IDLE		BIT(17)
49562306a36Sopenharmony_ci#define  RXPKT_NUM_RW_RELEASE_EN	BIT(18)
49662306a36Sopenharmony_ci#define REG_RXDMA_STATUS		0x0288
49762306a36Sopenharmony_ci
49862306a36Sopenharmony_ci/* Presumably only found on newer chips such as 8723bu */
49962306a36Sopenharmony_ci#define REG_RX_DMA_CTRL_8723B		0x0286
50062306a36Sopenharmony_ci#define REG_RXDMA_PRO_8723B		0x0290
50162306a36Sopenharmony_ci#define  RXDMA_PRO_DMA_MODE		BIT(1)		/* Set to 0x1. */
50262306a36Sopenharmony_ci#define  RXDMA_PRO_DMA_BURST_CNT	GENMASK(3, 2)	/* Set to 0x3. */
50362306a36Sopenharmony_ci#define  RXDMA_PRO_DMA_BURST_SIZE	GENMASK(5, 4)	/* Set to 0x1. */
50462306a36Sopenharmony_ci
50562306a36Sopenharmony_ci#define REG_EARLY_MODE_CONTROL_8710B	0x02bc
50662306a36Sopenharmony_ci
50762306a36Sopenharmony_ci#define REG_RF_BB_CMD_ADDR		0x02c0
50862306a36Sopenharmony_ci#define REG_RF_BB_CMD_DATA		0x02c4
50962306a36Sopenharmony_ci
51062306a36Sopenharmony_ci/*  spec version 11 */
51162306a36Sopenharmony_ci/* 0x0400 ~ 0x047F	Protocol Configuration */
51262306a36Sopenharmony_ci/* 8192c, 8192d */
51362306a36Sopenharmony_ci#define REG_VOQ_INFO			0x0400
51462306a36Sopenharmony_ci#define REG_VIQ_INFO			0x0404
51562306a36Sopenharmony_ci#define REG_BEQ_INFO			0x0408
51662306a36Sopenharmony_ci#define REG_BKQ_INFO			0x040c
51762306a36Sopenharmony_ci/* 8188e, 8723a, 8812a, 8821a, 8192e, 8723b */
51862306a36Sopenharmony_ci#define REG_Q0_INFO			0x400
51962306a36Sopenharmony_ci#define REG_Q1_INFO			0x404
52062306a36Sopenharmony_ci#define REG_Q2_INFO			0x408
52162306a36Sopenharmony_ci#define REG_Q3_INFO			0x40c
52262306a36Sopenharmony_ci
52362306a36Sopenharmony_ci#define REG_MGQ_INFO			0x0410
52462306a36Sopenharmony_ci#define REG_HGQ_INFO			0x0414
52562306a36Sopenharmony_ci#define REG_BCNQ_INFO			0x0418
52662306a36Sopenharmony_ci
52762306a36Sopenharmony_ci#define REG_CPU_MGQ_INFORMATION		0x041c
52862306a36Sopenharmony_ci#define REG_FWHW_TXQ_CTRL		0x0420
52962306a36Sopenharmony_ci#define  FWHW_TXQ_CTRL_AMPDU_RETRY	BIT(7)
53062306a36Sopenharmony_ci#define  FWHW_TXQ_CTRL_XMIT_MGMT_ACK	BIT(12)
53162306a36Sopenharmony_ci#define  EN_BCNQ_DL			BIT(22)
53262306a36Sopenharmony_ci
53362306a36Sopenharmony_ci#define REG_HWSEQ_CTRL			0x0423
53462306a36Sopenharmony_ci#define REG_TXPKTBUF_BCNQ_BDNY		0x0424
53562306a36Sopenharmony_ci#define REG_TXPKTBUF_MGQ_BDNY		0x0425
53662306a36Sopenharmony_ci#define REG_LIFETIME_EN			0x0426
53762306a36Sopenharmony_ci#define REG_MULTI_BCNQ_OFFSET		0x0427
53862306a36Sopenharmony_ci
53962306a36Sopenharmony_ci#define REG_SPEC_SIFS			0x0428
54062306a36Sopenharmony_ci#define  SPEC_SIFS_CCK_MASK		0x00ff
54162306a36Sopenharmony_ci#define  SPEC_SIFS_CCK_SHIFT		0
54262306a36Sopenharmony_ci#define  SPEC_SIFS_OFDM_MASK		0xff00
54362306a36Sopenharmony_ci#define  SPEC_SIFS_OFDM_SHIFT		8
54462306a36Sopenharmony_ci
54562306a36Sopenharmony_ci#define REG_RETRY_LIMIT			0x042a
54662306a36Sopenharmony_ci#define  RETRY_LIMIT_LONG_SHIFT		0
54762306a36Sopenharmony_ci#define  RETRY_LIMIT_LONG_MASK		0x003f
54862306a36Sopenharmony_ci#define  RETRY_LIMIT_SHORT_SHIFT	8
54962306a36Sopenharmony_ci#define  RETRY_LIMIT_SHORT_MASK		0x3f00
55062306a36Sopenharmony_ci
55162306a36Sopenharmony_ci#define REG_DARFRC			0x0430
55262306a36Sopenharmony_ci#define REG_RARFRC			0x0438
55362306a36Sopenharmony_ci#define REG_RESPONSE_RATE_SET		0x0440
55462306a36Sopenharmony_ci#define  RESPONSE_RATE_BITMAP_ALL	0xfffff
55562306a36Sopenharmony_ci#define  RESPONSE_RATE_RRSR_CCK_ONLY_1M	0xffff1
55662306a36Sopenharmony_ci#define  RESPONSE_RATE_RRSR_INIT_2G	0x15f
55762306a36Sopenharmony_ci#define  RESPONSE_RATE_RRSR_INIT_5G	0x150
55862306a36Sopenharmony_ci#define  RSR_1M				BIT(0)
55962306a36Sopenharmony_ci#define  RSR_2M				BIT(1)
56062306a36Sopenharmony_ci#define  RSR_5_5M			BIT(2)
56162306a36Sopenharmony_ci#define  RSR_11M			BIT(3)
56262306a36Sopenharmony_ci#define  RSR_6M				BIT(4)
56362306a36Sopenharmony_ci#define  RSR_9M				BIT(5)
56462306a36Sopenharmony_ci#define  RSR_12M			BIT(6)
56562306a36Sopenharmony_ci#define  RSR_18M			BIT(7)
56662306a36Sopenharmony_ci#define  RSR_24M			BIT(8)
56762306a36Sopenharmony_ci#define  RSR_36M			BIT(9)
56862306a36Sopenharmony_ci#define  RSR_48M			BIT(10)
56962306a36Sopenharmony_ci#define  RSR_54M			BIT(11)
57062306a36Sopenharmony_ci#define  RSR_MCS0			BIT(12)
57162306a36Sopenharmony_ci#define  RSR_MCS1			BIT(13)
57262306a36Sopenharmony_ci#define  RSR_MCS2			BIT(14)
57362306a36Sopenharmony_ci#define  RSR_MCS3			BIT(15)
57462306a36Sopenharmony_ci#define  RSR_MCS4			BIT(16)
57562306a36Sopenharmony_ci#define  RSR_MCS5			BIT(17)
57662306a36Sopenharmony_ci#define  RSR_MCS6			BIT(18)
57762306a36Sopenharmony_ci#define  RSR_MCS7			BIT(19)
57862306a36Sopenharmony_ci#define  RSR_RSC_LOWER_SUB_CHANNEL	BIT(21)	/* 0x200000 */
57962306a36Sopenharmony_ci#define  RSR_RSC_UPPER_SUB_CHANNEL	BIT(22)	/* 0x400000 */
58062306a36Sopenharmony_ci#define  RSR_RSC_BANDWIDTH_40M		(RSR_RSC_UPPER_SUB_CHANNEL | \
58162306a36Sopenharmony_ci					 RSR_RSC_LOWER_SUB_CHANNEL)
58262306a36Sopenharmony_ci#define  RSR_ACK_SHORT_PREAMBLE		BIT(23)
58362306a36Sopenharmony_ci
58462306a36Sopenharmony_ci#define REG_ARFR0			0x0444
58562306a36Sopenharmony_ci#define REG_ARFR1			0x0448
58662306a36Sopenharmony_ci#define REG_ARFR2			0x044c
58762306a36Sopenharmony_ci#define REG_ARFR3			0x0450
58862306a36Sopenharmony_ci#define REG_CCK_CHECK			0x0454
58962306a36Sopenharmony_ci#define BIT_BCN_PORT_SEL		BIT(5)
59062306a36Sopenharmony_ci#define REG_AMPDU_MAX_TIME_8723B	0x0456
59162306a36Sopenharmony_ci#define REG_AGGLEN_LMT			0x0458
59262306a36Sopenharmony_ci#define REG_AMPDU_MIN_SPACE		0x045c
59362306a36Sopenharmony_ci#define REG_TXPKTBUF_WMAC_LBK_BF_HD	0x045d
59462306a36Sopenharmony_ci#define REG_FAST_EDCA_CTRL		0x0460
59562306a36Sopenharmony_ci#define REG_RD_RESP_PKT_TH		0x0463
59662306a36Sopenharmony_ci#define REG_INIRTS_RATE_SEL		0x0480
59762306a36Sopenharmony_ci/* 8723bu */
59862306a36Sopenharmony_ci#define REG_DATA_SUBCHANNEL		0x0483
59962306a36Sopenharmony_ci/* 8723au */
60062306a36Sopenharmony_ci#define REG_INIDATA_RATE_SEL		0x0484
60162306a36Sopenharmony_ci/* MACID_SLEEP_1/3 for 8723b, 8192e, 8812a, 8821a */
60262306a36Sopenharmony_ci#define REG_MACID_SLEEP_3_8732B		0x0484
60362306a36Sopenharmony_ci#define REG_MACID_SLEEP_1_8732B		0x0488
60462306a36Sopenharmony_ci
60562306a36Sopenharmony_ci#define REG_POWER_STATUS		0x04a4
60662306a36Sopenharmony_ci#define REG_POWER_STAGE1		0x04b4
60762306a36Sopenharmony_ci#define REG_POWER_STAGE2		0x04b8
60862306a36Sopenharmony_ci#define REG_AMPDU_BURST_MODE_8723B	0x04bc
60962306a36Sopenharmony_ci#define REG_PKT_VO_VI_LIFE_TIME		0x04c0
61062306a36Sopenharmony_ci#define REG_PKT_BE_BK_LIFE_TIME		0x04c2
61162306a36Sopenharmony_ci#define REG_STBC_SETTING		0x04c4
61262306a36Sopenharmony_ci#define REG_QUEUE_CTRL			0x04c6
61362306a36Sopenharmony_ci#define REG_HT_SINGLE_AMPDU_8723B	0x04c7
61462306a36Sopenharmony_ci#define  HT_SINGLE_AMPDU_ENABLE		BIT(7)
61562306a36Sopenharmony_ci#define REG_PROT_MODE_CTRL		0x04c8
61662306a36Sopenharmony_ci#define REG_MAX_AGGR_NUM		0x04ca
61762306a36Sopenharmony_ci#define REG_RTS_MAX_AGGR_NUM		0x04cb
61862306a36Sopenharmony_ci#define REG_BAR_MODE_CTRL		0x04cc
61962306a36Sopenharmony_ci#define REG_RA_TRY_RATE_AGG_LMT		0x04cf
62062306a36Sopenharmony_ci/* MACID_DROP for 8723a */
62162306a36Sopenharmony_ci#define REG_MACID_DROP_8732A		0x04d0
62262306a36Sopenharmony_ci/* EARLY_MODE_CONTROL 8188e */
62362306a36Sopenharmony_ci#define REG_EARLY_MODE_CONTROL_8188E	0x04d0
62462306a36Sopenharmony_ci/* MACID_SLEEP_2 for 8723b, 8192e, 8812a, 8821a */
62562306a36Sopenharmony_ci#define REG_MACID_SLEEP_2_8732B		0x04d0
62662306a36Sopenharmony_ci#define REG_MACID_SLEEP			0x04d4
62762306a36Sopenharmony_ci#define REG_NQOS_SEQ			0x04dc
62862306a36Sopenharmony_ci#define REG_QOS_SEQ			0x04de
62962306a36Sopenharmony_ci#define REG_NEED_CPU_HANDLE		0x04e0
63062306a36Sopenharmony_ci#define REG_PKT_LOSE_RPT		0x04e1
63162306a36Sopenharmony_ci#define REG_PTCL_ERR_STATUS		0x04e2
63262306a36Sopenharmony_ci#define REG_TX_REPORT_CTRL		0x04ec
63362306a36Sopenharmony_ci#define  TX_REPORT_CTRL_TIMER_ENABLE	BIT(1)
63462306a36Sopenharmony_ci
63562306a36Sopenharmony_ci#define REG_TX_REPORT_TIME		0x04f0
63662306a36Sopenharmony_ci#define REG_DUMMY			0x04fc
63762306a36Sopenharmony_ci
63862306a36Sopenharmony_ci/* 0x0500 ~ 0x05FF	EDCA Configuration */
63962306a36Sopenharmony_ci#define REG_EDCA_VO_PARAM		0x0500
64062306a36Sopenharmony_ci#define REG_EDCA_VI_PARAM		0x0504
64162306a36Sopenharmony_ci#define REG_EDCA_BE_PARAM		0x0508
64262306a36Sopenharmony_ci#define REG_EDCA_BK_PARAM		0x050c
64362306a36Sopenharmony_ci#define  EDCA_PARAM_ECW_MIN_SHIFT	8
64462306a36Sopenharmony_ci#define  EDCA_PARAM_ECW_MAX_SHIFT	12
64562306a36Sopenharmony_ci#define  EDCA_PARAM_TXOP_SHIFT		16
64662306a36Sopenharmony_ci#define REG_BEACON_TCFG			0x0510
64762306a36Sopenharmony_ci#define REG_PIFS			0x0512
64862306a36Sopenharmony_ci#define REG_RDG_PIFS			0x0513
64962306a36Sopenharmony_ci#define REG_SIFS_CCK			0x0514
65062306a36Sopenharmony_ci#define REG_SIFS_OFDM			0x0516
65162306a36Sopenharmony_ci#define REG_TSFTR_SYN_OFFSET		0x0518
65262306a36Sopenharmony_ci#define REG_AGGR_BREAK_TIME		0x051a
65362306a36Sopenharmony_ci#define REG_SLOT			0x051b
65462306a36Sopenharmony_ci#define REG_TX_PTCL_CTRL		0x0520
65562306a36Sopenharmony_ci#define REG_TXPAUSE			0x0522
65662306a36Sopenharmony_ci#define REG_DIS_TXREQ_CLR		0x0523
65762306a36Sopenharmony_ci#define REG_RD_CTRL			0x0524
65862306a36Sopenharmony_ci#define REG_TBTT_PROHIBIT		0x0540
65962306a36Sopenharmony_ci#define REG_RD_NAV_NXT			0x0544
66062306a36Sopenharmony_ci#define REG_NAV_PROT_LEN		0x0546
66162306a36Sopenharmony_ci
66262306a36Sopenharmony_ci#define REG_BEACON_CTRL			0x0550
66362306a36Sopenharmony_ci#define REG_BEACON_CTRL_1		0x0551
66462306a36Sopenharmony_ci#define  BEACON_ATIM			BIT(0)
66562306a36Sopenharmony_ci#define  BEACON_CTRL_MBSSID		BIT(1)
66662306a36Sopenharmony_ci#define  BEACON_CTRL_TX_BEACON_RPT	BIT(2)
66762306a36Sopenharmony_ci#define  BEACON_FUNCTION_ENABLE		BIT(3)
66862306a36Sopenharmony_ci#define  BEACON_DISABLE_TSF_UPDATE	BIT(4)
66962306a36Sopenharmony_ci
67062306a36Sopenharmony_ci#define REG_MBID_NUM			0x0552
67162306a36Sopenharmony_ci#define REG_DUAL_TSF_RST		0x0553
67262306a36Sopenharmony_ci#define  DUAL_TSF_RESET_TSF0		BIT(0)
67362306a36Sopenharmony_ci#define  DUAL_TSF_RESET_TSF1		BIT(1)
67462306a36Sopenharmony_ci#define  DUAL_TSF_RESET_P2P		BIT(4)
67562306a36Sopenharmony_ci#define  DUAL_TSF_TX_OK			BIT(5)
67662306a36Sopenharmony_ci
67762306a36Sopenharmony_ci/*  The same as REG_MBSSID_BCN_SPACE */
67862306a36Sopenharmony_ci#define REG_BCN_INTERVAL		0x0554
67962306a36Sopenharmony_ci#define REG_MBSSID_BCN_SPACE		0x0554
68062306a36Sopenharmony_ci
68162306a36Sopenharmony_ci#define REG_DRIVER_EARLY_INT		0x0558
68262306a36Sopenharmony_ci#define  DRIVER_EARLY_INT_TIME		5
68362306a36Sopenharmony_ci
68462306a36Sopenharmony_ci#define REG_BEACON_DMA_TIME		0x0559
68562306a36Sopenharmony_ci#define  BEACON_DMA_ATIME_INT_TIME	2
68662306a36Sopenharmony_ci
68762306a36Sopenharmony_ci#define REG_ATIMWND			0x055a
68862306a36Sopenharmony_ci#define REG_USTIME_TSF_8723B		0x055c
68962306a36Sopenharmony_ci#define REG_BCN_MAX_ERR			0x055d
69062306a36Sopenharmony_ci#define REG_RXTSF_OFFSET_CCK		0x055e
69162306a36Sopenharmony_ci#define REG_RXTSF_OFFSET_OFDM		0x055f
69262306a36Sopenharmony_ci#define REG_TSFTR			0x0560
69362306a36Sopenharmony_ci#define REG_TSFTR1			0x0568
69462306a36Sopenharmony_ci#define REG_INIT_TSFTR			0x0564
69562306a36Sopenharmony_ci#define REG_ATIMWND_1			0x0570
69662306a36Sopenharmony_ci#define REG_PSTIMER			0x0580
69762306a36Sopenharmony_ci#define REG_TIMER0			0x0584
69862306a36Sopenharmony_ci#define REG_TIMER1			0x0588
69962306a36Sopenharmony_ci#define REG_ACM_HW_CTRL			0x05c0
70062306a36Sopenharmony_ci#define  ACM_HW_CTRL_BK			BIT(0)
70162306a36Sopenharmony_ci#define  ACM_HW_CTRL_BE			BIT(1)
70262306a36Sopenharmony_ci#define  ACM_HW_CTRL_VI			BIT(2)
70362306a36Sopenharmony_ci#define  ACM_HW_CTRL_VO			BIT(3)
70462306a36Sopenharmony_ci#define REG_ACM_RST_CTRL		0x05c1
70562306a36Sopenharmony_ci#define REG_ACMAVG			0x05c2
70662306a36Sopenharmony_ci#define REG_VO_ADMTIME			0x05c4
70762306a36Sopenharmony_ci#define REG_VI_ADMTIME			0x05c6
70862306a36Sopenharmony_ci#define REG_BE_ADMTIME			0x05c8
70962306a36Sopenharmony_ci#define REG_EDCA_RANDOM_GEN		0x05cc
71062306a36Sopenharmony_ci#define REG_SCH_TXCMD			0x05d0
71162306a36Sopenharmony_ci
71262306a36Sopenharmony_ci/* define REG_FW_TSF_SYNC_CNT		0x04a0 */
71362306a36Sopenharmony_ci#define REG_SCH_TX_CMD			0x05f8
71462306a36Sopenharmony_ci#define REG_FW_RESET_TSF_CNT_1		0x05fc
71562306a36Sopenharmony_ci#define REG_FW_RESET_TSF_CNT_0		0x05fd
71662306a36Sopenharmony_ci#define REG_FW_BCN_DIS_CNT		0x05fe
71762306a36Sopenharmony_ci
71862306a36Sopenharmony_ci/* 0x0600 ~ 0x07FF  WMAC Configuration */
71962306a36Sopenharmony_ci#define REG_APSD_CTRL			0x0600
72062306a36Sopenharmony_ci#define  APSD_CTRL_OFF			BIT(6)
72162306a36Sopenharmony_ci#define  APSD_CTRL_OFF_STATUS		BIT(7)
72262306a36Sopenharmony_ci#define REG_BW_OPMODE			0x0603
72362306a36Sopenharmony_ci#define  BW_OPMODE_20MHZ		BIT(2)
72462306a36Sopenharmony_ci#define  BW_OPMODE_5G			BIT(1)
72562306a36Sopenharmony_ci#define  BW_OPMODE_11J			BIT(0)
72662306a36Sopenharmony_ci
72762306a36Sopenharmony_ci#define REG_TCR				0x0604
72862306a36Sopenharmony_ci
72962306a36Sopenharmony_ci/* Receive Configuration Register */
73062306a36Sopenharmony_ci#define REG_RCR				0x0608
73162306a36Sopenharmony_ci#define  RCR_ACCEPT_AP			BIT(0)  /* Accept all unicast packet */
73262306a36Sopenharmony_ci#define  RCR_ACCEPT_PHYS_MATCH		BIT(1)  /* Accept phys match packet */
73362306a36Sopenharmony_ci#define  RCR_ACCEPT_MCAST		BIT(2)
73462306a36Sopenharmony_ci#define  RCR_ACCEPT_BCAST		BIT(3)
73562306a36Sopenharmony_ci#define  RCR_ACCEPT_ADDR3		BIT(4)  /* Accept address 3 match
73662306a36Sopenharmony_ci						 packet */
73762306a36Sopenharmony_ci#define  RCR_ACCEPT_PM			BIT(5)  /* Accept power management
73862306a36Sopenharmony_ci						 packet */
73962306a36Sopenharmony_ci#define  RCR_CHECK_BSSID_MATCH		BIT(6)  /* Accept BSSID match packet */
74062306a36Sopenharmony_ci#define  RCR_CHECK_BSSID_BEACON		BIT(7)  /* Accept BSSID match packet
74162306a36Sopenharmony_ci						 (Rx beacon, probe rsp) */
74262306a36Sopenharmony_ci#define  RCR_ACCEPT_CRC32		BIT(8)  /* Accept CRC32 error packet */
74362306a36Sopenharmony_ci#define  RCR_ACCEPT_ICV			BIT(9)  /* Accept ICV error packet */
74462306a36Sopenharmony_ci#define  RCR_ACCEPT_DATA_FRAME		BIT(11) /* Accept all data pkt or use
74562306a36Sopenharmony_ci						   REG_RXFLTMAP2 */
74662306a36Sopenharmony_ci#define  RCR_ACCEPT_CTRL_FRAME		BIT(12) /* Accept all control pkt or use
74762306a36Sopenharmony_ci						   REG_RXFLTMAP1 */
74862306a36Sopenharmony_ci#define  RCR_ACCEPT_MGMT_FRAME		BIT(13) /* Accept all mgmt pkt or use
74962306a36Sopenharmony_ci						   REG_RXFLTMAP0 */
75062306a36Sopenharmony_ci#define  RCR_HTC_LOC_CTRL		BIT(14) /* MFC<--HTC=1 MFC-->HTC=0 */
75162306a36Sopenharmony_ci#define  RCR_UC_DATA_PKT_INT_ENABLE	BIT(16) /* Enable unicast data packet
75262306a36Sopenharmony_ci						   interrupt */
75362306a36Sopenharmony_ci#define  RCR_BM_DATA_PKT_INT_ENABLE	BIT(17) /* Enable broadcast data packet
75462306a36Sopenharmony_ci						   interrupt */
75562306a36Sopenharmony_ci#define  RCR_TIM_PARSER_ENABLE		BIT(18) /* Enable RX beacon TIM parser*/
75662306a36Sopenharmony_ci#define  RCR_MFBEN			BIT(22)
75762306a36Sopenharmony_ci#define  RCR_LSIG_ENABLE		BIT(23) /* Enable LSIG TXOP Protection
75862306a36Sopenharmony_ci						   function. Search KEYCAM for
75962306a36Sopenharmony_ci						   each rx packet to check if
76062306a36Sopenharmony_ci						   LSIGEN bit is set. */
76162306a36Sopenharmony_ci#define  RCR_MULTI_BSSID_ENABLE		BIT(24) /* Enable Multiple BssId */
76262306a36Sopenharmony_ci#define  RCR_FORCE_ACK			BIT(26)
76362306a36Sopenharmony_ci#define  RCR_ACCEPT_BA_SSN		BIT(27) /* Accept BA SSN */
76462306a36Sopenharmony_ci#define  RCR_APPEND_PHYSTAT		BIT(28)
76562306a36Sopenharmony_ci#define  RCR_APPEND_ICV			BIT(29)
76662306a36Sopenharmony_ci#define  RCR_APPEND_MIC			BIT(30)
76762306a36Sopenharmony_ci#define  RCR_APPEND_FCS			BIT(31) /* WMAC append FCS after */
76862306a36Sopenharmony_ci
76962306a36Sopenharmony_ci#define REG_RX_PKT_LIMIT		0x060c
77062306a36Sopenharmony_ci#define REG_RX_DLK_TIME			0x060d
77162306a36Sopenharmony_ci#define REG_RX_DRVINFO_SZ		0x060f
77262306a36Sopenharmony_ci
77362306a36Sopenharmony_ci#define REG_MACID			0x0610
77462306a36Sopenharmony_ci#define REG_BSSID			0x0618
77562306a36Sopenharmony_ci#define REG_MAR				0x0620
77662306a36Sopenharmony_ci#define REG_MBIDCAMCFG			0x0628
77762306a36Sopenharmony_ci
77862306a36Sopenharmony_ci#define REG_USTIME_EDCA			0x0638
77962306a36Sopenharmony_ci#define REG_MAC_SPEC_SIFS		0x063a
78062306a36Sopenharmony_ci
78162306a36Sopenharmony_ci/*  20100719 Joseph: Hardware register definition change. (HW datasheet v54) */
78262306a36Sopenharmony_ci	/*  [15:8]SIFS_R2T_OFDM, [7:0]SIFS_R2T_CCK */
78362306a36Sopenharmony_ci#define REG_R2T_SIFS			0x063c
78462306a36Sopenharmony_ci	/*  [15:8]SIFS_T2T_OFDM, [7:0]SIFS_T2T_CCK */
78562306a36Sopenharmony_ci#define REG_T2T_SIFS			0x063e
78662306a36Sopenharmony_ci#define REG_ACKTO			0x0640
78762306a36Sopenharmony_ci#define REG_CTS2TO			0x0641
78862306a36Sopenharmony_ci#define REG_EIFS			0x0642
78962306a36Sopenharmony_ci
79062306a36Sopenharmony_ci/* WMA, BA, CCX */
79162306a36Sopenharmony_ci#define REG_NAV_CTRL			0x0650
79262306a36Sopenharmony_ci/* In units of 128us */
79362306a36Sopenharmony_ci#define REG_NAV_UPPER			0x0652
79462306a36Sopenharmony_ci#define  NAV_UPPER_UNIT			128
79562306a36Sopenharmony_ci
79662306a36Sopenharmony_ci#define REG_BACAMCMD			0x0654
79762306a36Sopenharmony_ci#define REG_BACAMCONTENT		0x0658
79862306a36Sopenharmony_ci#define REG_LBDLY			0x0660
79962306a36Sopenharmony_ci#define REG_FWDLY			0x0661
80062306a36Sopenharmony_ci#define REG_RXERR_RPT			0x0664
80162306a36Sopenharmony_ci#define REG_WMAC_TRXPTCL_CTL		0x0668
80262306a36Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_MASK	(BIT(7) | BIT(8))
80362306a36Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_20		0
80462306a36Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_40		BIT(7)
80562306a36Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_80		BIT(8)
80662306a36Sopenharmony_ci
80762306a36Sopenharmony_ci/*  Security */
80862306a36Sopenharmony_ci#define REG_CAM_CMD			0x0670
80962306a36Sopenharmony_ci#define  CAM_CMD_POLLING		BIT(31)
81062306a36Sopenharmony_ci#define  CAM_CMD_WRITE			BIT(16)
81162306a36Sopenharmony_ci#define  CAM_CMD_KEY_SHIFT		3
81262306a36Sopenharmony_ci#define REG_CAM_WRITE			0x0674
81362306a36Sopenharmony_ci#define  CAM_WRITE_VALID		BIT(15)
81462306a36Sopenharmony_ci#define REG_CAM_READ			0x0678
81562306a36Sopenharmony_ci#define REG_CAM_DEBUG			0x067c
81662306a36Sopenharmony_ci#define REG_SECURITY_CFG		0x0680
81762306a36Sopenharmony_ci#define  SEC_CFG_TX_USE_DEFKEY		BIT(0)
81862306a36Sopenharmony_ci#define  SEC_CFG_RX_USE_DEFKEY		BIT(1)
81962306a36Sopenharmony_ci#define  SEC_CFG_TX_SEC_ENABLE		BIT(2)
82062306a36Sopenharmony_ci#define  SEC_CFG_RX_SEC_ENABLE		BIT(3)
82162306a36Sopenharmony_ci#define  SEC_CFG_SKBYA2			BIT(4)
82262306a36Sopenharmony_ci#define  SEC_CFG_NO_SKMC		BIT(5)
82362306a36Sopenharmony_ci#define  SEC_CFG_TXBC_USE_DEFKEY	BIT(6)
82462306a36Sopenharmony_ci#define  SEC_CFG_RXBC_USE_DEFKEY	BIT(7)
82562306a36Sopenharmony_ci
82662306a36Sopenharmony_ci/*  Power */
82762306a36Sopenharmony_ci#define REG_WOW_CTRL			0x0690
82862306a36Sopenharmony_ci#define REG_PSSTATUS			0x0691
82962306a36Sopenharmony_ci#define REG_PS_RX_INFO			0x0692
83062306a36Sopenharmony_ci#define REG_LPNAV_CTRL			0x0694
83162306a36Sopenharmony_ci#define REG_WKFMCAM_CMD			0x0698
83262306a36Sopenharmony_ci#define REG_WKFMCAM_RWD			0x069c
83362306a36Sopenharmony_ci
83462306a36Sopenharmony_ci/*
83562306a36Sopenharmony_ci * RX Filters: each bit corresponds to the numerical value of the subtype.
83662306a36Sopenharmony_ci * If it is set the subtype frame type is passed. The filter is only used when
83762306a36Sopenharmony_ci * the RCR_ACCEPT_DATA_FRAME, RCR_ACCEPT_CTRL_FRAME, RCR_ACCEPT_MGMT_FRAME bit
83862306a36Sopenharmony_ci * in the RCR are low.
83962306a36Sopenharmony_ci *
84062306a36Sopenharmony_ci * Example: Beacon subtype is binary 1000 which is decimal 8 so we have to set
84162306a36Sopenharmony_ci * bit 8 (0x100) in REG_RXFLTMAP0 to enable reception.
84262306a36Sopenharmony_ci */
84362306a36Sopenharmony_ci#define REG_RXFLTMAP0			0x06a0	/* Management frames */
84462306a36Sopenharmony_ci#define REG_RXFLTMAP1			0x06a2	/* Control frames */
84562306a36Sopenharmony_ci#define REG_RXFLTMAP2			0x06a4	/* Data frames */
84662306a36Sopenharmony_ci
84762306a36Sopenharmony_ci#define REG_BCN_PSR_RPT			0x06a8
84862306a36Sopenharmony_ci#define REG_CALB32K_CTRL		0x06ac
84962306a36Sopenharmony_ci#define REG_PKT_MON_CTRL		0x06b4
85062306a36Sopenharmony_ci#define REG_BT_COEX_TABLE1		0x06c0
85162306a36Sopenharmony_ci#define REG_BT_COEX_TABLE2		0x06c4
85262306a36Sopenharmony_ci#define REG_BT_COEX_TABLE3		0x06c8
85362306a36Sopenharmony_ci#define REG_BT_COEX_TABLE4		0x06cc
85462306a36Sopenharmony_ci#define REG_WMAC_RESP_TXINFO		0x06d8
85562306a36Sopenharmony_ci
85662306a36Sopenharmony_ci#define REG_MACID1			0x0700
85762306a36Sopenharmony_ci#define REG_BSSID1			0x0708
85862306a36Sopenharmony_ci
85962306a36Sopenharmony_ci/*
86062306a36Sopenharmony_ci * This seems to be 8723bu specific
86162306a36Sopenharmony_ci */
86262306a36Sopenharmony_ci#define REG_BT_CONTROL_8723BU		0x0764
86362306a36Sopenharmony_ci#define  BT_CONTROL_BT_GRANT		BIT(12)
86462306a36Sopenharmony_ci
86562306a36Sopenharmony_ci#define REG_PORT_CONTROL_8710B		0x076d
86662306a36Sopenharmony_ci#define REG_WLAN_ACT_CONTROL_8723B	0x076e
86762306a36Sopenharmony_ci
86862306a36Sopenharmony_ci#define REG_FPGA0_RF_MODE		0x0800
86962306a36Sopenharmony_ci#define  FPGA_RF_MODE			BIT(0)
87062306a36Sopenharmony_ci#define  FPGA_RF_MODE_JAPAN		BIT(1)
87162306a36Sopenharmony_ci#define  FPGA_RF_MODE_CCK		BIT(24)
87262306a36Sopenharmony_ci#define  FPGA_RF_MODE_OFDM		BIT(25)
87362306a36Sopenharmony_ci
87462306a36Sopenharmony_ci#define REG_FPGA0_TX_INFO		0x0804
87562306a36Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_A	BIT(0)
87662306a36Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_B	BIT(1)
87762306a36Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_C	BIT(2)
87862306a36Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_D	BIT(3)
87962306a36Sopenharmony_ci#define REG_FPGA0_PSD_FUNC		0x0808
88062306a36Sopenharmony_ci#define REG_FPGA0_TX_GAIN		0x080c
88162306a36Sopenharmony_ci#define REG_FPGA0_RF_TIMING1		0x0810
88262306a36Sopenharmony_ci#define REG_FPGA0_RF_TIMING2		0x0814
88362306a36Sopenharmony_ci#define REG_FPGA0_POWER_SAVE		0x0818
88462306a36Sopenharmony_ci#define  FPGA0_PS_LOWER_CHANNEL		BIT(26)
88562306a36Sopenharmony_ci#define  FPGA0_PS_UPPER_CHANNEL		BIT(27)
88662306a36Sopenharmony_ci
88762306a36Sopenharmony_ci#define REG_FPGA0_XA_HSSI_PARM1		0x0820	/* RF 3 wire register */
88862306a36Sopenharmony_ci#define  FPGA0_HSSI_PARM1_PI		BIT(8)
88962306a36Sopenharmony_ci#define REG_FPGA0_XA_HSSI_PARM2		0x0824
89062306a36Sopenharmony_ci#define REG_FPGA0_XB_HSSI_PARM1		0x0828
89162306a36Sopenharmony_ci#define REG_FPGA0_XB_HSSI_PARM2		0x082c
89262306a36Sopenharmony_ci#define  FPGA0_HSSI_3WIRE_DATA_LEN	0x800
89362306a36Sopenharmony_ci#define  FPGA0_HSSI_3WIRE_ADDR_LEN	0x400
89462306a36Sopenharmony_ci#define  FPGA0_HSSI_PARM2_ADDR_SHIFT	23
89562306a36Sopenharmony_ci#define  FPGA0_HSSI_PARM2_ADDR_MASK	0x7f800000	/* 0xff << 23 */
89662306a36Sopenharmony_ci#define  FPGA0_HSSI_PARM2_CCK_HIGH_PWR	BIT(9)
89762306a36Sopenharmony_ci#define  FPGA0_HSSI_PARM2_EDGE_READ	BIT(31)
89862306a36Sopenharmony_ci
89962306a36Sopenharmony_ci#define REG_TX_AGC_B_RATE18_06		0x0830
90062306a36Sopenharmony_ci#define REG_TX_AGC_B_RATE54_24		0x0834
90162306a36Sopenharmony_ci#define REG_TX_AGC_B_CCK1_55_MCS32	0x0838
90262306a36Sopenharmony_ci#define REG_TX_AGC_B_MCS03_MCS00	0x083c
90362306a36Sopenharmony_ci
90462306a36Sopenharmony_ci#define REG_FPGA0_XA_LSSI_PARM		0x0840
90562306a36Sopenharmony_ci#define REG_FPGA0_XB_LSSI_PARM		0x0844
90662306a36Sopenharmony_ci#define  FPGA0_LSSI_PARM_ADDR_SHIFT	20
90762306a36Sopenharmony_ci#define  FPGA0_LSSI_PARM_ADDR_MASK	0x0ff00000
90862306a36Sopenharmony_ci#define  FPGA0_LSSI_PARM_DATA_MASK	0x000fffff
90962306a36Sopenharmony_ci
91062306a36Sopenharmony_ci#define REG_TX_AGC_B_MCS07_MCS04	0x0848
91162306a36Sopenharmony_ci#define REG_TX_AGC_B_MCS11_MCS08	0x084c
91262306a36Sopenharmony_ci
91362306a36Sopenharmony_ci#define REG_FPGA0_XCD_SWITCH_CTRL	0x085c
91462306a36Sopenharmony_ci
91562306a36Sopenharmony_ci#define REG_FPGA0_XA_RF_INT_OE		0x0860	/* RF Channel switch */
91662306a36Sopenharmony_ci#define REG_FPGA0_XB_RF_INT_OE		0x0864
91762306a36Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_AB_OPEN	0x000
91862306a36Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_A		BIT(8)
91962306a36Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_B		BIT(9)
92062306a36Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_MASK	(FPGA0_INT_OE_ANTENNA_A | \
92162306a36Sopenharmony_ci					 FPGA0_INT_OE_ANTENNA_B)
92262306a36Sopenharmony_ci
92362306a36Sopenharmony_ci#define REG_TX_AGC_B_MCS15_MCS12	0x0868
92462306a36Sopenharmony_ci#define REG_TX_AGC_B_CCK11_A_CCK2_11	0x086c
92562306a36Sopenharmony_ci
92662306a36Sopenharmony_ci#define REG_FPGA0_XAB_RF_SW_CTRL	0x0870
92762306a36Sopenharmony_ci#define REG_FPGA0_XA_RF_SW_CTRL		0x0870	/* 16 bit */
92862306a36Sopenharmony_ci#define REG_FPGA0_XB_RF_SW_CTRL		0x0872	/* 16 bit */
92962306a36Sopenharmony_ci#define REG_FPGA0_XCD_RF_SW_CTRL	0x0874
93062306a36Sopenharmony_ci#define REG_FPGA0_XC_RF_SW_CTRL		0x0874	/* 16 bit */
93162306a36Sopenharmony_ci#define REG_FPGA0_XD_RF_SW_CTRL		0x0876	/* 16 bit */
93262306a36Sopenharmony_ci#define  FPGA0_RF_3WIRE_DATA		BIT(0)
93362306a36Sopenharmony_ci#define  FPGA0_RF_3WIRE_CLOC		BIT(1)
93462306a36Sopenharmony_ci#define  FPGA0_RF_3WIRE_LOAD		BIT(2)
93562306a36Sopenharmony_ci#define  FPGA0_RF_3WIRE_RW		BIT(3)
93662306a36Sopenharmony_ci#define  FPGA0_RF_3WIRE_MASK		0xf
93762306a36Sopenharmony_ci#define  FPGA0_RF_RFENV			BIT(4)
93862306a36Sopenharmony_ci#define  FPGA0_RF_TRSW			BIT(5)	/* Useless now */
93962306a36Sopenharmony_ci#define  FPGA0_RF_TRSWB			BIT(6)
94062306a36Sopenharmony_ci#define  FPGA0_RF_ANTSW			BIT(8)
94162306a36Sopenharmony_ci#define  FPGA0_RF_ANTSWB		BIT(9)
94262306a36Sopenharmony_ci#define  FPGA0_RF_PAPE			BIT(10)
94362306a36Sopenharmony_ci#define  FPGA0_RF_PAPE5G		BIT(11)
94462306a36Sopenharmony_ci#define  FPGA0_RF_BD_CTRL_SHIFT		16
94562306a36Sopenharmony_ci
94662306a36Sopenharmony_ci#define REG_FPGA0_XAB_RF_PARM		0x0878	/* Antenna select path in ODM */
94762306a36Sopenharmony_ci#define REG_FPGA0_XA_RF_PARM		0x0878	/* 16 bit */
94862306a36Sopenharmony_ci#define REG_FPGA0_XB_RF_PARM		0x087a	/* 16 bit */
94962306a36Sopenharmony_ci#define REG_FPGA0_XCD_RF_PARM		0x087c
95062306a36Sopenharmony_ci#define REG_FPGA0_XC_RF_PARM		0x087c	/* 16 bit */
95162306a36Sopenharmony_ci#define REG_FPGA0_XD_RF_PARM		0x087e	/* 16 bit */
95262306a36Sopenharmony_ci#define  FPGA0_RF_PARM_RFA_ENABLE	BIT(1)
95362306a36Sopenharmony_ci#define  FPGA0_RF_PARM_RFB_ENABLE	BIT(17)
95462306a36Sopenharmony_ci#define  FPGA0_RF_PARM_CLK_GATE		BIT(31)
95562306a36Sopenharmony_ci
95662306a36Sopenharmony_ci#define REG_FPGA0_ANALOG1		0x0880
95762306a36Sopenharmony_ci#define REG_FPGA0_ANALOG2		0x0884
95862306a36Sopenharmony_ci#define  FPGA0_ANALOG2_20MHZ		BIT(10)
95962306a36Sopenharmony_ci#define REG_FPGA0_ANALOG3		0x0888
96062306a36Sopenharmony_ci#define REG_FPGA0_ANALOG4		0x088c
96162306a36Sopenharmony_ci
96262306a36Sopenharmony_ci#define REG_NHM_TH9_TH10_8723B		0x0890
96362306a36Sopenharmony_ci#define REG_NHM_TIMER_8723B		0x0894
96462306a36Sopenharmony_ci#define REG_NHM_TH3_TO_TH0_8723B	0x0898
96562306a36Sopenharmony_ci#define REG_NHM_TH7_TO_TH4_8723B	0x089c
96662306a36Sopenharmony_ci
96762306a36Sopenharmony_ci#define REG_FPGA0_XA_LSSI_READBACK	0x08a0	/* Tranceiver LSSI Readback */
96862306a36Sopenharmony_ci#define REG_FPGA0_XB_LSSI_READBACK	0x08a4
96962306a36Sopenharmony_ci#define REG_FPGA0_PSD_REPORT		0x08b4
97062306a36Sopenharmony_ci#define REG_HSPI_XA_READBACK		0x08b8	/* Transceiver A HSPI read */
97162306a36Sopenharmony_ci#define REG_HSPI_XB_READBACK		0x08bc	/* Transceiver B HSPI read */
97262306a36Sopenharmony_ci
97362306a36Sopenharmony_ci#define REG_FPGA1_RF_MODE		0x0900
97462306a36Sopenharmony_ci
97562306a36Sopenharmony_ci#define REG_FPGA1_TX_INFO		0x090c
97662306a36Sopenharmony_ci#define  FPGA1_TX_ANT_MASK		0x0000000f
97762306a36Sopenharmony_ci#define  FPGA1_TX_ANT_L_MASK		0x000000f0
97862306a36Sopenharmony_ci#define  FPGA1_TX_ANT_NON_HT_MASK	0x00000f00
97962306a36Sopenharmony_ci#define  FPGA1_TX_ANT_HT1_MASK		0x0000f000
98062306a36Sopenharmony_ci#define  FPGA1_TX_ANT_HT2_MASK		0x000f0000
98162306a36Sopenharmony_ci#define  FPGA1_TX_ANT_HT_S1_MASK	0x00f00000
98262306a36Sopenharmony_ci#define  FPGA1_TX_ANT_NON_HT_S1_MASK	0x0f000000
98362306a36Sopenharmony_ci#define  FPGA1_TX_OFDM_TXSC_MASK	0x30000000
98462306a36Sopenharmony_ci
98562306a36Sopenharmony_ci#define REG_ANT_MAPPING1		0x0914
98662306a36Sopenharmony_ci#define REG_RFE_OPT			0x0920
98762306a36Sopenharmony_ci#define REG_DPDT_CTRL			0x092c	/* 8723BU */
98862306a36Sopenharmony_ci#define REG_RFE_CTRL_ANTA_SRC		0x0930	/* 8723BU */
98962306a36Sopenharmony_ci#define REG_RFE_CTRL_ANT_SRC1		0x0934
99062306a36Sopenharmony_ci#define REG_RFE_CTRL_ANT_SRC2		0x0938
99162306a36Sopenharmony_ci#define REG_RFE_CTRL_ANT_SRC3		0x093c
99262306a36Sopenharmony_ci#define REG_RFE_PATH_SELECT		0x0940	/* 8723BU */
99362306a36Sopenharmony_ci#define REG_RFE_BUFFER			0x0944	/* 8723BU */
99462306a36Sopenharmony_ci#define REG_S0S1_PATH_SWITCH		0x0948	/* 8723BU */
99562306a36Sopenharmony_ci#define REG_RX_DFIR_MOD_97F		0x0948
99662306a36Sopenharmony_ci#define REG_OFDM_RX_DFIR		0x954
99762306a36Sopenharmony_ci#define REG_RFE_OPT62			0x0968
99862306a36Sopenharmony_ci
99962306a36Sopenharmony_ci#define REG_CCK0_SYSTEM			0x0a00
100062306a36Sopenharmony_ci#define  CCK0_SIDEBAND			BIT(4)
100162306a36Sopenharmony_ci
100262306a36Sopenharmony_ci#define REG_CCK0_AFE_SETTING		0x0a04
100362306a36Sopenharmony_ci#define  CCK0_AFE_RX_MASK		0x0f000000
100462306a36Sopenharmony_ci#define  CCK0_AFE_TX_MASK		0xf0000000
100562306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_A		0
100662306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_B		BIT(26)
100762306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_C		BIT(27)
100862306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_D		(BIT(26) | BIT(27))
100962306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_OPTION_A	0
101062306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_OPTION_B	BIT(24)
101162306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_OPTION_C	BIT(25)
101262306a36Sopenharmony_ci#define  CCK0_AFE_RX_ANT_OPTION_D	(BIT(24) | BIT(25))
101362306a36Sopenharmony_ci#define  CCK0_AFE_TX_ANT_A		BIT(31)
101462306a36Sopenharmony_ci#define  CCK0_AFE_TX_ANT_B		BIT(30)
101562306a36Sopenharmony_ci
101662306a36Sopenharmony_ci#define REG_CCK_ANTDIV_PARA2		0x0a04
101762306a36Sopenharmony_ci#define REG_BB_POWER_SAVE4		0x0a74
101862306a36Sopenharmony_ci
101962306a36Sopenharmony_ci/* 8188eu */
102062306a36Sopenharmony_ci#define REG_LNA_SWITCH			0x0b2c
102162306a36Sopenharmony_ci#define  LNA_SWITCH_DISABLE_CSCG	BIT(22)
102262306a36Sopenharmony_ci#define  LNA_SWITCH_OUTPUT_CG		BIT(31)
102362306a36Sopenharmony_ci
102462306a36Sopenharmony_ci#define REG_CCK_PD_THRESH			0x0a0a
102562306a36Sopenharmony_ci#define  CCK_PD_TYPE1_LV0_TH		0x40
102662306a36Sopenharmony_ci#define  CCK_PD_TYPE1_LV1_TH		0x83
102762306a36Sopenharmony_ci#define  CCK_PD_TYPE1_LV2_TH		0xcd
102862306a36Sopenharmony_ci#define  CCK_PD_TYPE1_LV3_TH		0xdd
102962306a36Sopenharmony_ci#define  CCK_PD_TYPE1_LV4_TH		0xed
103062306a36Sopenharmony_ci
103162306a36Sopenharmony_ci#define REG_CCK0_TX_FILTER1		0x0a20
103262306a36Sopenharmony_ci#define REG_CCK0_TX_FILTER2		0x0a24
103362306a36Sopenharmony_ci#define REG_CCK0_DEBUG_PORT		0x0a28	/* debug port and Tx filter3 */
103462306a36Sopenharmony_ci#define REG_AGC_RPT			0xa80
103562306a36Sopenharmony_ci#define  AGC_RPT_CCK			BIT(7)
103662306a36Sopenharmony_ci#define REG_CCK0_TX_FILTER3		0x0aac
103762306a36Sopenharmony_ci
103862306a36Sopenharmony_ci#define REG_CONFIG_ANT_A		0x0b68
103962306a36Sopenharmony_ci#define REG_CONFIG_ANT_B		0x0b6c
104062306a36Sopenharmony_ci
104162306a36Sopenharmony_ci#define REG_OFDM0_TRX_PATH_ENABLE	0x0c04
104262306a36Sopenharmony_ci#define OFDM_RF_PATH_RX_MASK		0x0f
104362306a36Sopenharmony_ci#define OFDM_RF_PATH_RX_A		BIT(0)
104462306a36Sopenharmony_ci#define OFDM_RF_PATH_RX_B		BIT(1)
104562306a36Sopenharmony_ci#define OFDM_RF_PATH_RX_C		BIT(2)
104662306a36Sopenharmony_ci#define OFDM_RF_PATH_RX_D		BIT(3)
104762306a36Sopenharmony_ci#define OFDM_RF_PATH_TX_MASK		0xf0
104862306a36Sopenharmony_ci#define OFDM_RF_PATH_TX_A		BIT(4)
104962306a36Sopenharmony_ci#define OFDM_RF_PATH_TX_B		BIT(5)
105062306a36Sopenharmony_ci#define OFDM_RF_PATH_TX_C		BIT(6)
105162306a36Sopenharmony_ci#define OFDM_RF_PATH_TX_D		BIT(7)
105262306a36Sopenharmony_ci
105362306a36Sopenharmony_ci#define REG_OFDM0_TR_MUX_PAR		0x0c08
105462306a36Sopenharmony_ci
105562306a36Sopenharmony_ci#define REG_OFDM0_FA_RSTC		0x0c0c
105662306a36Sopenharmony_ci
105762306a36Sopenharmony_ci#define REG_DOWNSAM_FACTOR		0x0c10
105862306a36Sopenharmony_ci
105962306a36Sopenharmony_ci#define REG_OFDM0_XA_RX_AFE		0x0c10
106062306a36Sopenharmony_ci#define REG_OFDM0_XA_RX_IQ_IMBALANCE	0x0c14
106162306a36Sopenharmony_ci#define REG_OFDM0_XB_RX_IQ_IMBALANCE	0x0c1c
106262306a36Sopenharmony_ci
106362306a36Sopenharmony_ci#define REG_OFDM0_ENERGY_CCA_THRES	0x0c4c
106462306a36Sopenharmony_ci
106562306a36Sopenharmony_ci#define REG_OFDM0_RX_D_SYNC_PATH	0x0c40
106662306a36Sopenharmony_ci#define  OFDM0_SYNC_PATH_NOTCH_FILTER	BIT(1)
106762306a36Sopenharmony_ci
106862306a36Sopenharmony_ci#define REG_OFDM0_XA_AGC_CORE1		0x0c50
106962306a36Sopenharmony_ci#define REG_OFDM0_XA_AGC_CORE2		0x0c54
107062306a36Sopenharmony_ci#define REG_OFDM0_XB_AGC_CORE1		0x0c58
107162306a36Sopenharmony_ci#define REG_OFDM0_XB_AGC_CORE2		0x0c5c
107262306a36Sopenharmony_ci#define REG_OFDM0_XC_AGC_CORE1		0x0c60
107362306a36Sopenharmony_ci#define REG_OFDM0_XC_AGC_CORE2		0x0c64
107462306a36Sopenharmony_ci#define REG_OFDM0_XD_AGC_CORE1		0x0c68
107562306a36Sopenharmony_ci#define REG_OFDM0_XD_AGC_CORE2		0x0c6c
107662306a36Sopenharmony_ci#define  OFDM0_X_AGC_CORE1_IGI_MASK	0x0000007F
107762306a36Sopenharmony_ci
107862306a36Sopenharmony_ci#define REG_OFDM0_AGC_PARM1		0x0c70
107962306a36Sopenharmony_ci
108062306a36Sopenharmony_ci#define REG_OFDM0_AGC_RSSI_TABLE	0x0c78
108162306a36Sopenharmony_ci
108262306a36Sopenharmony_ci#define REG_OFDM0_XA_TX_IQ_IMBALANCE	0x0c80
108362306a36Sopenharmony_ci#define REG_OFDM0_XB_TX_IQ_IMBALANCE	0x0c88
108462306a36Sopenharmony_ci#define REG_OFDM0_XC_TX_IQ_IMBALANCE	0x0c90
108562306a36Sopenharmony_ci#define REG_OFDM0_XD_TX_IQ_IMBALANCE	0x0c98
108662306a36Sopenharmony_ci
108762306a36Sopenharmony_ci#define REG_OFDM0_XC_TX_AFE		0x0c94
108862306a36Sopenharmony_ci#define REG_OFDM0_XD_TX_AFE		0x0c9c
108962306a36Sopenharmony_ci
109062306a36Sopenharmony_ci#define REG_OFDM0_RX_IQ_EXT_ANTA	0x0ca0
109162306a36Sopenharmony_ci
109262306a36Sopenharmony_ci/* 8188eu */
109362306a36Sopenharmony_ci#define REG_ANTDIV_PARA1		0x0ca4
109462306a36Sopenharmony_ci
109562306a36Sopenharmony_ci#define REG_RXIQB_EXT			0x0ca8
109662306a36Sopenharmony_ci
109762306a36Sopenharmony_ci/* 8723bu */
109862306a36Sopenharmony_ci#define REG_OFDM0_TX_PSDO_NOISE_WEIGHT	0x0ce4
109962306a36Sopenharmony_ci
110062306a36Sopenharmony_ci#define REG_OFDM1_LSTF			0x0d00
110162306a36Sopenharmony_ci#define  OFDM_LSTF_PRIME_CH_LOW		BIT(10)
110262306a36Sopenharmony_ci#define  OFDM_LSTF_PRIME_CH_HIGH	BIT(11)
110362306a36Sopenharmony_ci#define  OFDM_LSTF_PRIME_CH_MASK	(OFDM_LSTF_PRIME_CH_LOW | \
110462306a36Sopenharmony_ci					 OFDM_LSTF_PRIME_CH_HIGH)
110562306a36Sopenharmony_ci#define  OFDM_LSTF_CONTINUE_TX		BIT(28)
110662306a36Sopenharmony_ci#define  OFDM_LSTF_SINGLE_CARRIER	BIT(29)
110762306a36Sopenharmony_ci#define  OFDM_LSTF_SINGLE_TONE		BIT(30)
110862306a36Sopenharmony_ci#define  OFDM_LSTF_MASK			0x70000000
110962306a36Sopenharmony_ci
111062306a36Sopenharmony_ci#define REG_OFDM1_TRX_PATH_ENABLE	0x0d04
111162306a36Sopenharmony_ci#define REG_OFDM1_CFO_TRACKING		0x0d2c
111262306a36Sopenharmony_ci#define  CFO_TRACKING_ATC_STATUS	BIT(11)
111362306a36Sopenharmony_ci#define REG_OFDM1_CSI_FIX_MASK1		0x0d40
111462306a36Sopenharmony_ci#define REG_OFDM1_CSI_FIX_MASK2		0x0d44
111562306a36Sopenharmony_ci
111662306a36Sopenharmony_ci#define REG_ANAPWR1			0x0d94
111762306a36Sopenharmony_ci
111862306a36Sopenharmony_ci#define REG_TX_AGC_A_RATE18_06		0x0e00
111962306a36Sopenharmony_ci#define REG_TX_AGC_A_RATE54_24		0x0e04
112062306a36Sopenharmony_ci#define REG_TX_AGC_A_CCK1_MCS32		0x0e08
112162306a36Sopenharmony_ci#define REG_TX_AGC_A_MCS03_MCS00	0x0e10
112262306a36Sopenharmony_ci#define REG_TX_AGC_A_MCS07_MCS04	0x0e14
112362306a36Sopenharmony_ci#define REG_TX_AGC_A_MCS11_MCS08	0x0e18
112462306a36Sopenharmony_ci#define REG_TX_AGC_A_MCS15_MCS12	0x0e1c
112562306a36Sopenharmony_ci
112662306a36Sopenharmony_ci#define REG_NP_ANTA			0x0e20
112762306a36Sopenharmony_ci
112862306a36Sopenharmony_ci#define REG_TAP_UPD_97F			0x0e24
112962306a36Sopenharmony_ci
113062306a36Sopenharmony_ci#define REG_FPGA0_IQK			0x0e28
113162306a36Sopenharmony_ci
113262306a36Sopenharmony_ci#define REG_TX_IQK_TONE_A		0x0e30
113362306a36Sopenharmony_ci#define REG_RX_IQK_TONE_A		0x0e34
113462306a36Sopenharmony_ci#define REG_TX_IQK_PI_A			0x0e38
113562306a36Sopenharmony_ci#define REG_RX_IQK_PI_A			0x0e3c
113662306a36Sopenharmony_ci
113762306a36Sopenharmony_ci#define REG_TX_IQK			0x0e40
113862306a36Sopenharmony_ci#define REG_RX_IQK			0x0e44
113962306a36Sopenharmony_ci#define REG_IQK_AGC_PTS			0x0e48
114062306a36Sopenharmony_ci#define REG_IQK_AGC_RSP			0x0e4c
114162306a36Sopenharmony_ci#define REG_TX_IQK_TONE_B		0x0e50
114262306a36Sopenharmony_ci#define REG_RX_IQK_TONE_B		0x0e54
114362306a36Sopenharmony_ci#define REG_TX_IQK_PI_B			0x0e58
114462306a36Sopenharmony_ci#define REG_RX_IQK_PI_B			0x0e5c
114562306a36Sopenharmony_ci#define REG_IQK_AGC_CONT		0x0e60
114662306a36Sopenharmony_ci
114762306a36Sopenharmony_ci#define REG_BLUETOOTH			0x0e6c
114862306a36Sopenharmony_ci#define REG_RX_WAIT_CCA			0x0e70
114962306a36Sopenharmony_ci#define REG_TX_CCK_RFON			0x0e74
115062306a36Sopenharmony_ci#define REG_TX_CCK_BBON			0x0e78
115162306a36Sopenharmony_ci#define REG_TX_OFDM_RFON		0x0e7c
115262306a36Sopenharmony_ci#define REG_TX_OFDM_BBON		0x0e80
115362306a36Sopenharmony_ci#define REG_TX_TO_RX			0x0e84
115462306a36Sopenharmony_ci#define REG_TX_TO_TX			0x0e88
115562306a36Sopenharmony_ci#define REG_RX_CCK			0x0e8c
115662306a36Sopenharmony_ci
115762306a36Sopenharmony_ci#define REG_TX_POWER_BEFORE_IQK_A	0x0e94
115862306a36Sopenharmony_ci#define REG_IQK_RPT_TXA			0x0e98
115962306a36Sopenharmony_ci#define REG_TX_POWER_AFTER_IQK_A	0x0e9c
116062306a36Sopenharmony_ci
116162306a36Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_A	0x0ea0
116262306a36Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_A_2	0x0ea4
116362306a36Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_A	0x0ea8
116462306a36Sopenharmony_ci#define REG_IQK_RPT_RXA			0x0ea8
116562306a36Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_A_2	0x0eac
116662306a36Sopenharmony_ci
116762306a36Sopenharmony_ci#define REG_TX_POWER_BEFORE_IQK_B	0x0eb4
116862306a36Sopenharmony_ci#define REG_IQK_RPT_TXB			0x0eb8
116962306a36Sopenharmony_ci#define REG_TX_POWER_AFTER_IQK_B	0x0ebc
117062306a36Sopenharmony_ci
117162306a36Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_B	0x0ec0
117262306a36Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_B_2	0x0ec4
117362306a36Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_B	0x0ec8
117462306a36Sopenharmony_ci#define REG_IQK_RPT_RXB			0x0ec8
117562306a36Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_B_2	0x0ecc
117662306a36Sopenharmony_ci
117762306a36Sopenharmony_ci#define REG_RX_OFDM			0x0ed0
117862306a36Sopenharmony_ci#define REG_RX_WAIT_RIFS		0x0ed4
117962306a36Sopenharmony_ci#define REG_RX_TO_RX			0x0ed8
118062306a36Sopenharmony_ci#define REG_STANDBY			0x0edc
118162306a36Sopenharmony_ci#define REG_SLEEP			0x0ee0
118262306a36Sopenharmony_ci#define REG_PMPD_ANAEN			0x0eec
118362306a36Sopenharmony_ci
118462306a36Sopenharmony_ci#define REG_FW_START_ADDRESS		0x1000
118562306a36Sopenharmony_ci#define REG_FW_START_ADDRESS_8192F	0x4000
118662306a36Sopenharmony_ci
118762306a36Sopenharmony_ci#define REG_SW_GPIO_SHARE_CTRL_0	0x1038
118862306a36Sopenharmony_ci#define REG_SW_GPIO_SHARE_CTRL_1	0x103c
118962306a36Sopenharmony_ci#define REG_GPIO_A0			0x1050
119062306a36Sopenharmony_ci#define REG_GPIO_B0			0x105b
119162306a36Sopenharmony_ci
119262306a36Sopenharmony_ci#define REG_USB_INFO			0xfe17
119362306a36Sopenharmony_ci#define REG_USB_HIMR			0xfe38
119462306a36Sopenharmony_ci#define  USB_HIMR_TIMEOUT2		BIT(31)
119562306a36Sopenharmony_ci#define  USB_HIMR_TIMEOUT1		BIT(30)
119662306a36Sopenharmony_ci#define  USB_HIMR_PSTIMEOUT		BIT(29)
119762306a36Sopenharmony_ci#define  USB_HIMR_GTINT4		BIT(28)
119862306a36Sopenharmony_ci#define  USB_HIMR_GTINT3		BIT(27)
119962306a36Sopenharmony_ci#define  USB_HIMR_TXBCNERR		BIT(26)
120062306a36Sopenharmony_ci#define  USB_HIMR_TXBCNOK		BIT(25)
120162306a36Sopenharmony_ci#define  USB_HIMR_TSF_BIT32_TOGGLE	BIT(24)
120262306a36Sopenharmony_ci#define  USB_HIMR_BCNDMAINT3		BIT(23)
120362306a36Sopenharmony_ci#define  USB_HIMR_BCNDMAINT2		BIT(22)
120462306a36Sopenharmony_ci#define  USB_HIMR_BCNDMAINT1		BIT(21)
120562306a36Sopenharmony_ci#define  USB_HIMR_BCNDMAINT0		BIT(20)
120662306a36Sopenharmony_ci#define  USB_HIMR_BCNDOK3		BIT(19)
120762306a36Sopenharmony_ci#define  USB_HIMR_BCNDOK2		BIT(18)
120862306a36Sopenharmony_ci#define  USB_HIMR_BCNDOK1		BIT(17)
120962306a36Sopenharmony_ci#define  USB_HIMR_BCNDOK0		BIT(16)
121062306a36Sopenharmony_ci#define  USB_HIMR_HSISR_IND		BIT(15)
121162306a36Sopenharmony_ci#define  USB_HIMR_BCNDMAINT_E		BIT(14)
121262306a36Sopenharmony_ci/* RSVD	BIT(13) */
121362306a36Sopenharmony_ci#define  USB_HIMR_CTW_END		BIT(12)
121462306a36Sopenharmony_ci/* RSVD	BIT(11) */
121562306a36Sopenharmony_ci#define  USB_HIMR_C2HCMD		BIT(10)
121662306a36Sopenharmony_ci#define  USB_HIMR_CPWM2			BIT(9)
121762306a36Sopenharmony_ci#define  USB_HIMR_CPWM			BIT(8)
121862306a36Sopenharmony_ci#define  USB_HIMR_HIGHDOK		BIT(7)	/*  High Queue DMA OK
121962306a36Sopenharmony_ci						    Interrupt */
122062306a36Sopenharmony_ci#define  USB_HIMR_MGNTDOK		BIT(6)	/*  Management Queue DMA OK
122162306a36Sopenharmony_ci						    Interrupt */
122262306a36Sopenharmony_ci#define  USB_HIMR_BKDOK			BIT(5)	/*  AC_BK DMA OK Interrupt */
122362306a36Sopenharmony_ci#define  USB_HIMR_BEDOK			BIT(4)	/*  AC_BE DMA OK Interrupt */
122462306a36Sopenharmony_ci#define  USB_HIMR_VIDOK			BIT(3)	/*  AC_VI DMA OK Interrupt */
122562306a36Sopenharmony_ci#define  USB_HIMR_VODOK			BIT(2)	/*  AC_VO DMA Interrupt */
122662306a36Sopenharmony_ci#define  USB_HIMR_RDU			BIT(1)	/*  Receive Descriptor
122762306a36Sopenharmony_ci						    Unavailable */
122862306a36Sopenharmony_ci#define  USB_HIMR_ROK			BIT(0)	/*  Receive DMA OK Interrupt */
122962306a36Sopenharmony_ci
123062306a36Sopenharmony_ci#define REG_USB_ACCESS_TIMEOUT		0xfe4c
123162306a36Sopenharmony_ci
123262306a36Sopenharmony_ci#define REG_USB_SPECIAL_OPTION		0xfe55
123362306a36Sopenharmony_ci#define  USB_SPEC_USB_AGG_ENABLE	BIT(3)	/* Enable USB aggregation */
123462306a36Sopenharmony_ci#define  USB_SPEC_INT_BULK_SELECT	BIT(4)	/* Use interrupt endpoint to
123562306a36Sopenharmony_ci						   deliver interrupt packet.
123662306a36Sopenharmony_ci						   0: Use int, 1: use bulk */
123762306a36Sopenharmony_ci#define REG_USB_HRPWM			0xfe58
123862306a36Sopenharmony_ci#define REG_USB_DMA_AGG_TO		0xfe5b
123962306a36Sopenharmony_ci#define REG_USB_AGG_TIMEOUT		0xfe5c
124062306a36Sopenharmony_ci#define REG_USB_AGG_THRESH		0xfe5d
124162306a36Sopenharmony_ci
124262306a36Sopenharmony_ci#define REG_NORMAL_SIE_VID		0xfe60	/* 0xfe60 - 0xfe61 */
124362306a36Sopenharmony_ci#define REG_NORMAL_SIE_PID		0xfe62	/* 0xfe62 - 0xfe63 */
124462306a36Sopenharmony_ci#define REG_NORMAL_SIE_OPTIONAL		0xfe64
124562306a36Sopenharmony_ci#define REG_NORMAL_SIE_EP		0xfe65	/* 0xfe65 - 0xfe67 */
124662306a36Sopenharmony_ci#define REG_NORMAL_SIE_EP_TX		0xfe66
124762306a36Sopenharmony_ci#define  NORMAL_SIE_EP_TX_HIGH_MASK	0x000f
124862306a36Sopenharmony_ci#define  NORMAL_SIE_EP_TX_NORMAL_MASK	0x00f0
124962306a36Sopenharmony_ci#define  NORMAL_SIE_EP_TX_LOW_MASK	0x0f00
125062306a36Sopenharmony_ci
125162306a36Sopenharmony_ci#define REG_NORMAL_SIE_PHY		0xfe68	/* 0xfe68 - 0xfe6b */
125262306a36Sopenharmony_ci#define REG_NORMAL_SIE_OPTIONAL2	0xfe6c
125362306a36Sopenharmony_ci#define REG_NORMAL_SIE_GPS_EP		0xfe6d	/* RTL8723 only */
125462306a36Sopenharmony_ci#define REG_NORMAL_SIE_MAC_ADDR		0xfe70	/* 0xfe70 - 0xfe75 */
125562306a36Sopenharmony_ci#define REG_NORMAL_SIE_STRING		0xfe80	/* 0xfe80 - 0xfedf */
125662306a36Sopenharmony_ci
125762306a36Sopenharmony_ci/*
125862306a36Sopenharmony_ci * 8710B register addresses between 0x00 and 0xff must have 0x8000
125962306a36Sopenharmony_ci * added to them. We take care of that in the rtl8xxxu_read{8,16,32}
126062306a36Sopenharmony_ci * and rtl8xxxu_write{8,16,32} functions.
126162306a36Sopenharmony_ci */
126262306a36Sopenharmony_ci#define REG_SYS_FUNC_8710B		0x0004
126362306a36Sopenharmony_ci#define REG_AFE_CTRL_8710B		0x0050
126462306a36Sopenharmony_ci#define REG_WL_RF_PSS_8710B		0x005c
126562306a36Sopenharmony_ci#define REG_EFUSE_INDIRECT_CTRL_8710B	0x006c
126662306a36Sopenharmony_ci#define  NORMAL_REG_READ_OFFSET		0x83000000
126762306a36Sopenharmony_ci#define  NORMAL_REG_WRITE_OFFSET	0x84000000
126862306a36Sopenharmony_ci#define  EFUSE_READ_OFFSET		0x85000000
126962306a36Sopenharmony_ci#define  EFUSE_WRITE_OFFSET		0x86000000
127062306a36Sopenharmony_ci#define REG_HIMR0_8710B			0x0080
127162306a36Sopenharmony_ci#define REG_HISR0_8710B			0x0084
127262306a36Sopenharmony_ci/*
127362306a36Sopenharmony_ci * 8710B uses this instead of REG_MCU_FW_DL, but at least bits
127462306a36Sopenharmony_ci * 0-7 have the same meaning.
127562306a36Sopenharmony_ci */
127662306a36Sopenharmony_ci#define REG_8051FW_CTRL_V1_8710B	0x0090
127762306a36Sopenharmony_ci#define REG_USB_HOST_INDIRECT_DATA_8710B	0x009c
127862306a36Sopenharmony_ci#define REG_WL_STATUS_8710B		0x00f0
127962306a36Sopenharmony_ci#define REG_USB_HOST_INDIRECT_ADDR_8710B	0x00f8
128062306a36Sopenharmony_ci
128162306a36Sopenharmony_ci/*
128262306a36Sopenharmony_ci * 8710B registers which must be accessed through rtl8710b_read_syson_reg
128362306a36Sopenharmony_ci * and rtl8710b_write_syson_reg.
128462306a36Sopenharmony_ci */
128562306a36Sopenharmony_ci#define SYSON_REG_BASE_ADDR_8710B	0x40000000
128662306a36Sopenharmony_ci#define REG_SYS_XTAL_CTRL0_8710B	0x060
128762306a36Sopenharmony_ci#define REG_SYS_EEPROM_CTRL0_8710B	0x0e0
128862306a36Sopenharmony_ci#define REG_SYS_SYSTEM_CFG0_8710B	0x1f0
128962306a36Sopenharmony_ci#define REG_SYS_SYSTEM_CFG1_8710B	0x1f4
129062306a36Sopenharmony_ci#define REG_SYS_SYSTEM_CFG2_8710B	0x1f8
129162306a36Sopenharmony_ci
129262306a36Sopenharmony_ci/* RF6052 registers */
129362306a36Sopenharmony_ci#define RF6052_REG_AC			0x00
129462306a36Sopenharmony_ci#define RF6052_REG_IQADJ_G1		0x01
129562306a36Sopenharmony_ci#define RF6052_REG_IQADJ_G2		0x02
129662306a36Sopenharmony_ci#define RF6052_REG_BS_PA_APSET_G1_G4	0x03
129762306a36Sopenharmony_ci#define RF6052_REG_BS_PA_APSET_G5_G8	0x04
129862306a36Sopenharmony_ci#define RF6052_REG_POW_TRSW		0x05
129962306a36Sopenharmony_ci#define RF6052_REG_GAIN_RX		0x06
130062306a36Sopenharmony_ci#define RF6052_REG_GAIN_TX		0x07
130162306a36Sopenharmony_ci#define RF6052_REG_TXM_IDAC		0x08
130262306a36Sopenharmony_ci#define RF6052_REG_IPA_G		0x09
130362306a36Sopenharmony_ci#define RF6052_REG_TXBIAS_G		0x0a
130462306a36Sopenharmony_ci#define RF6052_REG_TXPA_AG		0x0b
130562306a36Sopenharmony_ci#define RF6052_REG_IPA_A		0x0c
130662306a36Sopenharmony_ci#define RF6052_REG_TXBIAS_A		0x0d
130762306a36Sopenharmony_ci#define RF6052_REG_BS_PA_APSET_G9_G11	0x0e
130862306a36Sopenharmony_ci#define RF6052_REG_BS_IQGEN		0x0f
130962306a36Sopenharmony_ci#define RF6052_REG_MODE1		0x10
131062306a36Sopenharmony_ci#define RF6052_REG_MODE2		0x11
131162306a36Sopenharmony_ci#define RF6052_REG_RX_AGC_HP		0x12
131262306a36Sopenharmony_ci#define RF6052_REG_TX_AGC		0x13
131362306a36Sopenharmony_ci#define RF6052_REG_BIAS			0x14
131462306a36Sopenharmony_ci#define RF6052_REG_IPA			0x15
131562306a36Sopenharmony_ci#define RF6052_REG_TXBIAS		0x16
131662306a36Sopenharmony_ci#define RF6052_REG_POW_ABILITY		0x17
131762306a36Sopenharmony_ci#define RF6052_REG_MODE_AG		0x18	/* RF channel and BW switch */
131862306a36Sopenharmony_ci#define  MODE_AG_CHANNEL_MASK		0x3ff
131962306a36Sopenharmony_ci#define  MODE_AG_CHANNEL_20MHZ		BIT(10)
132062306a36Sopenharmony_ci#define  MODE_AG_BW_MASK		(BIT(10) | BIT(11))
132162306a36Sopenharmony_ci#define  MODE_AG_BW_20MHZ_8723B		(BIT(10) | BIT(11))
132262306a36Sopenharmony_ci#define  MODE_AG_BW_40MHZ_8723B		BIT(10)
132362306a36Sopenharmony_ci#define  MODE_AG_BW_80MHZ_8723B		0
132462306a36Sopenharmony_ci
132562306a36Sopenharmony_ci#define RF6052_REG_TOP			0x19
132662306a36Sopenharmony_ci#define RF6052_REG_RX_G1		0x1a
132762306a36Sopenharmony_ci#define RF6052_REG_RX_G2		0x1b
132862306a36Sopenharmony_ci#define RF6052_REG_RX_BB2		0x1c
132962306a36Sopenharmony_ci#define RF6052_REG_RX_BB1		0x1d
133062306a36Sopenharmony_ci#define RF6052_REG_RCK1			0x1e
133162306a36Sopenharmony_ci#define RF6052_REG_RCK2			0x1f
133262306a36Sopenharmony_ci#define RF6052_REG_TX_G1		0x20
133362306a36Sopenharmony_ci#define RF6052_REG_TX_G2		0x21
133462306a36Sopenharmony_ci#define RF6052_REG_TX_G3		0x22
133562306a36Sopenharmony_ci#define RF6052_REG_TX_BB1		0x23
133662306a36Sopenharmony_ci#define RF6052_REG_T_METER		0x24
133762306a36Sopenharmony_ci#define RF6052_REG_SYN_G1		0x25	/* RF TX Power control */
133862306a36Sopenharmony_ci#define RF6052_REG_SYN_G2		0x26	/* RF TX Power control */
133962306a36Sopenharmony_ci#define RF6052_REG_SYN_G3		0x27	/* RF TX Power control */
134062306a36Sopenharmony_ci#define RF6052_REG_SYN_G4		0x28	/* RF TX Power control */
134162306a36Sopenharmony_ci#define RF6052_REG_SYN_G5		0x29	/* RF TX Power control */
134262306a36Sopenharmony_ci#define RF6052_REG_SYN_G6		0x2a	/* RF TX Power control */
134362306a36Sopenharmony_ci#define RF6052_REG_SYN_G7		0x2b	/* RF TX Power control */
134462306a36Sopenharmony_ci#define RF6052_REG_SYN_G8		0x2c	/* RF TX Power control */
134562306a36Sopenharmony_ci
134662306a36Sopenharmony_ci#define RF6052_REG_RCK_OS		0x30	/* RF TX PA control */
134762306a36Sopenharmony_ci
134862306a36Sopenharmony_ci#define RF6052_REG_TXPA_G1		0x31	/* RF TX PA control */
134962306a36Sopenharmony_ci#define RF6052_REG_TXPA_G2		0x32	/* RF TX PA control */
135062306a36Sopenharmony_ci#define RF6052_REG_TXPA_G3		0x33	/* RF TX PA control */
135162306a36Sopenharmony_ci
135262306a36Sopenharmony_ci/*
135362306a36Sopenharmony_ci * NextGen regs: 8723BU
135462306a36Sopenharmony_ci */
135562306a36Sopenharmony_ci#define RF6052_REG_GAIN_P1		0x35
135662306a36Sopenharmony_ci#define RF6052_REG_T_METER_8723B	0x42
135762306a36Sopenharmony_ci#define RF6052_REG_UNKNOWN_43		0x43
135862306a36Sopenharmony_ci#define RF6052_REG_UNKNOWN_55		0x55
135962306a36Sopenharmony_ci#define RF6052_REG_PAD_TXG		0x56
136062306a36Sopenharmony_ci#define RF6052_REG_TXMOD		0x58
136162306a36Sopenharmony_ci#define RF6052_REG_RXG_MIX_SWBW		0x87
136262306a36Sopenharmony_ci#define RF6052_REG_S0S1			0xb0
136362306a36Sopenharmony_ci#define RF6052_REG_GAIN_CCA		0xdf
136462306a36Sopenharmony_ci#define RF6052_REG_UNKNOWN_ED		0xed
136562306a36Sopenharmony_ci#define RF6052_REG_WE_LUT		0xef
136662306a36Sopenharmony_ci#define RF6052_REG_GAIN_CTRL		0xf5
1367