18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (c) 2014 - 2017 Jes Sorensen <Jes.Sorensen@gmail.com>
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Register definitions taken from original Realtek rtl8723au driver
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/* 0x0000 ~ 0x00FF	System Configuration */
98c2ecf20Sopenharmony_ci#define REG_SYS_ISO_CTRL		0x0000
108c2ecf20Sopenharmony_ci#define  SYS_ISO_MD2PP			BIT(0)
118c2ecf20Sopenharmony_ci#define  SYS_ISO_ANALOG_IPS		BIT(5)
128c2ecf20Sopenharmony_ci#define  SYS_ISO_DIOR			BIT(9)
138c2ecf20Sopenharmony_ci#define  SYS_ISO_PWC_EV25V		BIT(14)
148c2ecf20Sopenharmony_ci#define  SYS_ISO_PWC_EV12V		BIT(15)
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci#define REG_SYS_FUNC			0x0002
178c2ecf20Sopenharmony_ci#define  SYS_FUNC_BBRSTB		BIT(0)
188c2ecf20Sopenharmony_ci#define  SYS_FUNC_BB_GLB_RSTN		BIT(1)
198c2ecf20Sopenharmony_ci#define  SYS_FUNC_USBA			BIT(2)
208c2ecf20Sopenharmony_ci#define  SYS_FUNC_UPLL			BIT(3)
218c2ecf20Sopenharmony_ci#define  SYS_FUNC_USBD			BIT(4)
228c2ecf20Sopenharmony_ci#define  SYS_FUNC_DIO_PCIE		BIT(5)
238c2ecf20Sopenharmony_ci#define  SYS_FUNC_PCIEA			BIT(6)
248c2ecf20Sopenharmony_ci#define  SYS_FUNC_PPLL			BIT(7)
258c2ecf20Sopenharmony_ci#define  SYS_FUNC_PCIED			BIT(8)
268c2ecf20Sopenharmony_ci#define  SYS_FUNC_DIOE			BIT(9)
278c2ecf20Sopenharmony_ci#define  SYS_FUNC_CPU_ENABLE		BIT(10)
288c2ecf20Sopenharmony_ci#define  SYS_FUNC_DCORE			BIT(11)
298c2ecf20Sopenharmony_ci#define  SYS_FUNC_ELDR			BIT(12)
308c2ecf20Sopenharmony_ci#define  SYS_FUNC_DIO_RF		BIT(13)
318c2ecf20Sopenharmony_ci#define  SYS_FUNC_HWPDN			BIT(14)
328c2ecf20Sopenharmony_ci#define  SYS_FUNC_MREGEN		BIT(15)
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define REG_APS_FSMCO			0x0004
358c2ecf20Sopenharmony_ci#define  APS_FSMCO_PFM_ALDN		BIT(1)
368c2ecf20Sopenharmony_ci#define  APS_FSMCO_PFM_WOWL		BIT(3)
378c2ecf20Sopenharmony_ci#define  APS_FSMCO_ENABLE_POWERDOWN	BIT(4)
388c2ecf20Sopenharmony_ci#define  APS_FSMCO_MAC_ENABLE		BIT(8)
398c2ecf20Sopenharmony_ci#define  APS_FSMCO_MAC_OFF		BIT(9)
408c2ecf20Sopenharmony_ci#define  APS_FSMCO_SW_LPS		BIT(10)
418c2ecf20Sopenharmony_ci#define  APS_FSMCO_HW_SUSPEND		BIT(11)
428c2ecf20Sopenharmony_ci#define  APS_FSMCO_PCIE			BIT(12)
438c2ecf20Sopenharmony_ci#define  APS_FSMCO_HW_POWERDOWN		BIT(15)
448c2ecf20Sopenharmony_ci#define  APS_FSMCO_WLON_RESET		BIT(16)
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#define REG_SYS_CLKR			0x0008
478c2ecf20Sopenharmony_ci#define  SYS_CLK_ANAD16V_ENABLE		BIT(0)
488c2ecf20Sopenharmony_ci#define  SYS_CLK_ANA8M			BIT(1)
498c2ecf20Sopenharmony_ci#define  SYS_CLK_MACSLP			BIT(4)
508c2ecf20Sopenharmony_ci#define  SYS_CLK_LOADER_ENABLE		BIT(5)
518c2ecf20Sopenharmony_ci#define  SYS_CLK_80M_SSC_DISABLE	BIT(7)
528c2ecf20Sopenharmony_ci#define  SYS_CLK_80M_SSC_ENABLE_HO	BIT(8)
538c2ecf20Sopenharmony_ci#define  SYS_CLK_PHY_SSC_RSTB		BIT(9)
548c2ecf20Sopenharmony_ci#define  SYS_CLK_SEC_CLK_ENABLE		BIT(10)
558c2ecf20Sopenharmony_ci#define  SYS_CLK_MAC_CLK_ENABLE		BIT(11)
568c2ecf20Sopenharmony_ci#define  SYS_CLK_ENABLE			BIT(12)
578c2ecf20Sopenharmony_ci#define  SYS_CLK_RING_CLK_ENABLE	BIT(13)
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci#define REG_9346CR			0x000a
608c2ecf20Sopenharmony_ci#define  EEPROM_BOOT			BIT(4)
618c2ecf20Sopenharmony_ci#define  EEPROM_ENABLE			BIT(5)
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci#define REG_EE_VPD			0x000c
648c2ecf20Sopenharmony_ci#define REG_AFE_MISC			0x0010
658c2ecf20Sopenharmony_ci#define  AFE_MISC_WL_XTAL_CTRL		BIT(6)
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#define REG_SPS0_CTRL			0x0011
688c2ecf20Sopenharmony_ci#define REG_SPS_OCP_CFG			0x0018
698c2ecf20Sopenharmony_ci#define REG_8192E_LDOV12_CTRL		0x0014
708c2ecf20Sopenharmony_ci#define REG_RSV_CTRL			0x001c
718c2ecf20Sopenharmony_ci
728c2ecf20Sopenharmony_ci#define REG_RF_CTRL			0x001f
738c2ecf20Sopenharmony_ci#define  RF_ENABLE			BIT(0)
748c2ecf20Sopenharmony_ci#define  RF_RSTB			BIT(1)
758c2ecf20Sopenharmony_ci#define  RF_SDMRSTB			BIT(2)
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci#define REG_LDOA15_CTRL			0x0020
788c2ecf20Sopenharmony_ci#define  LDOA15_ENABLE			BIT(0)
798c2ecf20Sopenharmony_ci#define  LDOA15_STANDBY			BIT(1)
808c2ecf20Sopenharmony_ci#define  LDOA15_OBUF			BIT(2)
818c2ecf20Sopenharmony_ci#define  LDOA15_REG_VOS			BIT(3)
828c2ecf20Sopenharmony_ci#define  LDOA15_VOADJ_SHIFT		4
838c2ecf20Sopenharmony_ci
848c2ecf20Sopenharmony_ci#define REG_LDOV12D_CTRL		0x0021
858c2ecf20Sopenharmony_ci#define  LDOV12D_ENABLE			BIT(0)
868c2ecf20Sopenharmony_ci#define  LDOV12D_STANDBY		BIT(1)
878c2ecf20Sopenharmony_ci#define  LDOV12D_VADJ_SHIFT		4
888c2ecf20Sopenharmony_ci
898c2ecf20Sopenharmony_ci#define REG_LDOHCI12_CTRL		0x0022
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci#define REG_LPLDO_CTRL			0x0023
928c2ecf20Sopenharmony_ci#define  LPLDO_HSM			BIT(2)
938c2ecf20Sopenharmony_ci#define  LPLDO_LSM_DIS			BIT(3)
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci#define REG_AFE_XTAL_CTRL		0x0024
968c2ecf20Sopenharmony_ci#define  AFE_XTAL_ENABLE		BIT(0)
978c2ecf20Sopenharmony_ci#define  AFE_XTAL_B_SELECT		BIT(1)
988c2ecf20Sopenharmony_ci#define  AFE_XTAL_GATE_USB		BIT(8)
998c2ecf20Sopenharmony_ci#define  AFE_XTAL_GATE_AFE		BIT(11)
1008c2ecf20Sopenharmony_ci#define  AFE_XTAL_RF_GATE		BIT(14)
1018c2ecf20Sopenharmony_ci#define  AFE_XTAL_GATE_DIG		BIT(17)
1028c2ecf20Sopenharmony_ci#define  AFE_XTAL_BT_GATE		BIT(20)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/*
1058c2ecf20Sopenharmony_ci * 0x0028 is also known as REG_AFE_CTRL2 on 8723bu/8192eu
1068c2ecf20Sopenharmony_ci */
1078c2ecf20Sopenharmony_ci#define REG_AFE_PLL_CTRL		0x0028
1088c2ecf20Sopenharmony_ci#define  AFE_PLL_ENABLE			BIT(0)
1098c2ecf20Sopenharmony_ci#define  AFE_PLL_320_ENABLE		BIT(1)
1108c2ecf20Sopenharmony_ci#define  APE_PLL_FREF_SELECT		BIT(2)
1118c2ecf20Sopenharmony_ci#define  AFE_PLL_EDGE_SELECT		BIT(3)
1128c2ecf20Sopenharmony_ci#define  AFE_PLL_WDOGB			BIT(4)
1138c2ecf20Sopenharmony_ci#define  AFE_PLL_LPF_ENABLE		BIT(5)
1148c2ecf20Sopenharmony_ci
1158c2ecf20Sopenharmony_ci#define REG_MAC_PHY_CTRL		0x002c
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_ci#define REG_EFUSE_CTRL			0x0030
1188c2ecf20Sopenharmony_ci#define REG_EFUSE_TEST			0x0034
1198c2ecf20Sopenharmony_ci#define  EFUSE_TRPT			BIT(7)
1208c2ecf20Sopenharmony_ci	/*  00: Wifi Efuse, 01: BT Efuse0, 10: BT Efuse1, 11: BT Efuse2 */
1218c2ecf20Sopenharmony_ci#define  EFUSE_CELL_SEL			(BIT(8) | BIT(9))
1228c2ecf20Sopenharmony_ci#define  EFUSE_LDOE25_ENABLE		BIT(31)
1238c2ecf20Sopenharmony_ci#define  EFUSE_SELECT_MASK		0x0300
1248c2ecf20Sopenharmony_ci#define  EFUSE_WIFI_SELECT		0x0000
1258c2ecf20Sopenharmony_ci#define  EFUSE_BT0_SELECT		0x0100
1268c2ecf20Sopenharmony_ci#define  EFUSE_BT1_SELECT		0x0200
1278c2ecf20Sopenharmony_ci#define  EFUSE_BT2_SELECT		0x0300
1288c2ecf20Sopenharmony_ci
1298c2ecf20Sopenharmony_ci#define  EFUSE_ACCESS_ENABLE		0x69	/* RTL8723 only */
1308c2ecf20Sopenharmony_ci#define  EFUSE_ACCESS_DISABLE		0x00	/* RTL8723 only */
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#define REG_PWR_DATA			0x0038
1338c2ecf20Sopenharmony_ci#define  PWR_DATA_EEPRPAD_RFE_CTRL_EN	BIT(11)
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci#define REG_CAL_TIMER			0x003c
1368c2ecf20Sopenharmony_ci#define REG_ACLK_MON			0x003e
1378c2ecf20Sopenharmony_ci#define REG_GPIO_MUXCFG			0x0040
1388c2ecf20Sopenharmony_ci#define REG_GPIO_IO_SEL			0x0042
1398c2ecf20Sopenharmony_ci#define REG_MAC_PINMUX_CFG		0x0043
1408c2ecf20Sopenharmony_ci#define REG_GPIO_PIN_CTRL		0x0044
1418c2ecf20Sopenharmony_ci#define REG_GPIO_INTM			0x0048
1428c2ecf20Sopenharmony_ci#define  GPIO_INTM_EDGE_TRIG_IRQ	BIT(9)
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci#define REG_LEDCFG0			0x004c
1458c2ecf20Sopenharmony_ci#define  LEDCFG0_DPDT_SELECT		BIT(23)
1468c2ecf20Sopenharmony_ci#define REG_LEDCFG1			0x004d
1478c2ecf20Sopenharmony_ci#define REG_LEDCFG2			0x004e
1488c2ecf20Sopenharmony_ci#define  LEDCFG2_DPDT_SELECT		BIT(7)
1498c2ecf20Sopenharmony_ci#define REG_LEDCFG3			0x004f
1508c2ecf20Sopenharmony_ci#define REG_LEDCFG			REG_LEDCFG2
1518c2ecf20Sopenharmony_ci#define REG_FSIMR			0x0050
1528c2ecf20Sopenharmony_ci#define REG_FSISR			0x0054
1538c2ecf20Sopenharmony_ci#define REG_HSIMR			0x0058
1548c2ecf20Sopenharmony_ci#define REG_HSISR			0x005c
1558c2ecf20Sopenharmony_ci/*  RTL8723 WIFI/BT/GPS Multi-Function GPIO Pin Control. */
1568c2ecf20Sopenharmony_ci#define REG_GPIO_PIN_CTRL_2		0x0060
1578c2ecf20Sopenharmony_ci/*  RTL8723 WIFI/BT/GPS Multi-Function GPIO Select. */
1588c2ecf20Sopenharmony_ci#define REG_GPIO_IO_SEL_2		0x0062
1598c2ecf20Sopenharmony_ci#define  GPIO_IO_SEL_2_GPIO09_INPUT	BIT(1)
1608c2ecf20Sopenharmony_ci#define  GPIO_IO_SEL_2_GPIO09_IRQ	BIT(9)
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ci/*  RTL8723B */
1638c2ecf20Sopenharmony_ci#define REG_PAD_CTRL1			0x0064
1648c2ecf20Sopenharmony_ci#define  PAD_CTRL1_SW_DPDT_SEL_DATA	BIT(0)
1658c2ecf20Sopenharmony_ci
1668c2ecf20Sopenharmony_ci/*  RTL8723 only WIFI/BT/GPS Multi-Function control source. */
1678c2ecf20Sopenharmony_ci#define REG_MULTI_FUNC_CTRL		0x0068
1688c2ecf20Sopenharmony_ci
1698c2ecf20Sopenharmony_ci#define  MULTI_FN_WIFI_HW_PWRDOWN_EN	BIT(0)	/* Enable GPIO[9] as WiFi HW
1708c2ecf20Sopenharmony_ci						   powerdown source */
1718c2ecf20Sopenharmony_ci#define  MULTI_FN_WIFI_HW_PWRDOWN_SL	BIT(1)	/* WiFi HW powerdown polarity
1728c2ecf20Sopenharmony_ci						   control */
1738c2ecf20Sopenharmony_ci#define  MULTI_WIFI_FUNC_EN		BIT(2)	/* WiFi function enable */
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci#define  MULTI_WIFI_HW_ROF_EN		BIT(3)	/* Enable GPIO[9] as WiFi RF HW
1768c2ecf20Sopenharmony_ci						   powerdown source */
1778c2ecf20Sopenharmony_ci#define  MULTI_BT_HW_PWRDOWN_EN		BIT(16)	/* Enable GPIO[11] as BT HW
1788c2ecf20Sopenharmony_ci						   powerdown source */
1798c2ecf20Sopenharmony_ci#define  MULTI_BT_HW_PWRDOWN_SL		BIT(17)	/* BT HW powerdown polarity
1808c2ecf20Sopenharmony_ci						   control */
1818c2ecf20Sopenharmony_ci#define  MULTI_BT_FUNC_EN		BIT(18)	/* BT function enable */
1828c2ecf20Sopenharmony_ci#define  MULTI_BT_HW_ROF_EN		BIT(19)	/* Enable GPIO[11] as BT/GPS
1838c2ecf20Sopenharmony_ci						   RF HW powerdown source */
1848c2ecf20Sopenharmony_ci#define  MULTI_GPS_HW_PWRDOWN_EN	BIT(20)	/* Enable GPIO[10] as GPS HW
1858c2ecf20Sopenharmony_ci						   powerdown source */
1868c2ecf20Sopenharmony_ci#define  MULTI_GPS_HW_PWRDOWN_SL	BIT(21)	/* GPS HW powerdown polarity
1878c2ecf20Sopenharmony_ci						   control */
1888c2ecf20Sopenharmony_ci#define  MULTI_GPS_FUNC_EN		BIT(22)	/* GPS function enable */
1898c2ecf20Sopenharmony_ci
1908c2ecf20Sopenharmony_ci#define REG_AFE_CTRL4			0x0078	/* 8192eu/8723bu */
1918c2ecf20Sopenharmony_ci#define REG_LDO_SW_CTRL			0x007c	/* 8192eu */
1928c2ecf20Sopenharmony_ci
1938c2ecf20Sopenharmony_ci#define REG_MCU_FW_DL			0x0080
1948c2ecf20Sopenharmony_ci#define  MCU_FW_DL_ENABLE		BIT(0)
1958c2ecf20Sopenharmony_ci#define  MCU_FW_DL_READY		BIT(1)
1968c2ecf20Sopenharmony_ci#define  MCU_FW_DL_CSUM_REPORT		BIT(2)
1978c2ecf20Sopenharmony_ci#define  MCU_MAC_INIT_READY		BIT(3)
1988c2ecf20Sopenharmony_ci#define  MCU_BB_INIT_READY		BIT(4)
1998c2ecf20Sopenharmony_ci#define  MCU_RF_INIT_READY		BIT(5)
2008c2ecf20Sopenharmony_ci#define  MCU_WINT_INIT_READY		BIT(6)
2018c2ecf20Sopenharmony_ci#define  MCU_FW_RAM_SEL			BIT(7)	/* 1: RAM, 0:ROM */
2028c2ecf20Sopenharmony_ci#define  MCU_CP_RESET			BIT(23)
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT_0			0x0088
2058c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT_1			0x008a
2068c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT_2			0x008c
2078c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT_3			0x008e
2088c2ecf20Sopenharmony_ci
2098c2ecf20Sopenharmony_ci/* Interrupt registers for 8192e/8723bu/8812 */
2108c2ecf20Sopenharmony_ci#define REG_HIMR0			0x00b0
2118c2ecf20Sopenharmony_ci#define	 IMR0_TXCCK			BIT(30)	/* TXRPT interrupt when CCX bit
2128c2ecf20Sopenharmony_ci						   of the packet is set */
2138c2ecf20Sopenharmony_ci#define	 IMR0_PSTIMEOUT			BIT(29)	/* Power Save Time Out Int */
2148c2ecf20Sopenharmony_ci#define	 IMR0_GTINT4			BIT(28)	/* Set when GTIMER4 expires */
2158c2ecf20Sopenharmony_ci#define	 IMR0_GTINT3			BIT(27)	/* Set when GTIMER3 expires */
2168c2ecf20Sopenharmony_ci#define	 IMR0_TBDER			BIT(26)	/* Transmit Beacon0 Error */
2178c2ecf20Sopenharmony_ci#define	 IMR0_TBDOK			BIT(25)	/* Transmit Beacon0 OK */
2188c2ecf20Sopenharmony_ci#define	 IMR0_TSF_BIT32_TOGGLE		BIT(24)	/* TSF Timer BIT32 toggle
2198c2ecf20Sopenharmony_ci						   indication interrupt */
2208c2ecf20Sopenharmony_ci#define	 IMR0_BCNDMAINT0		BIT(20)	/* Beacon DMA Interrupt 0 */
2218c2ecf20Sopenharmony_ci#define	 IMR0_BCNDERR0			BIT(16)	/* Beacon Queue DMA Error 0 */
2228c2ecf20Sopenharmony_ci#define	 IMR0_HSISR_IND_ON_INT		BIT(15)	/* HSISR Indicator (HSIMR &
2238c2ecf20Sopenharmony_ci						   HSISR is true) */
2248c2ecf20Sopenharmony_ci#define	 IMR0_BCNDMAINT_E		BIT(14)	/* Beacon DMA Interrupt
2258c2ecf20Sopenharmony_ci						   Extension for Win7 */
2268c2ecf20Sopenharmony_ci#define	 IMR0_ATIMEND			BIT(12)	/* CTWidnow End or
2278c2ecf20Sopenharmony_ci						   ATIM Window End */
2288c2ecf20Sopenharmony_ci#define	 IMR0_HISR1_IND_INT		BIT(11)	/* HISR1 Indicator
2298c2ecf20Sopenharmony_ci						   (HISR1 & HIMR1 is true) */
2308c2ecf20Sopenharmony_ci#define	 IMR0_C2HCMD			BIT(10)	/* CPU to Host Command INT
2318c2ecf20Sopenharmony_ci						   Status, Write 1 to clear */
2328c2ecf20Sopenharmony_ci#define	 IMR0_CPWM2			BIT(9)	/* CPU power Mode exchange INT
2338c2ecf20Sopenharmony_ci						   Status, Write 1 to clear */
2348c2ecf20Sopenharmony_ci#define	 IMR0_CPWM			BIT(8)	/* CPU power Mode exchange INT
2358c2ecf20Sopenharmony_ci						   Status, Write 1 to clear */
2368c2ecf20Sopenharmony_ci#define	 IMR0_HIGHDOK			BIT(7)	/* High Queue DMA OK */
2378c2ecf20Sopenharmony_ci#define	 IMR0_MGNTDOK			BIT(6)	/* Management Queue DMA OK */
2388c2ecf20Sopenharmony_ci#define	 IMR0_BKDOK			BIT(5)	/* AC_BK DMA OK */
2398c2ecf20Sopenharmony_ci#define	 IMR0_BEDOK			BIT(4)	/* AC_BE DMA OK */
2408c2ecf20Sopenharmony_ci#define	 IMR0_VIDOK			BIT(3)	/* AC_VI DMA OK */
2418c2ecf20Sopenharmony_ci#define	 IMR0_VODOK			BIT(2)	/* AC_VO DMA OK */
2428c2ecf20Sopenharmony_ci#define	 IMR0_RDU			BIT(1)	/* Rx Descriptor Unavailable */
2438c2ecf20Sopenharmony_ci#define	 IMR0_ROK			BIT(0)	/* Receive DMA OK */
2448c2ecf20Sopenharmony_ci#define REG_HISR0			0x00b4
2458c2ecf20Sopenharmony_ci#define REG_HIMR1			0x00b8
2468c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT7		BIT(27)	/* Beacon DMA Interrupt 7 */
2478c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT6		BIT(26)	/* Beacon DMA Interrupt 6 */
2488c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT5		BIT(25)	/* Beacon DMA Interrupt 5 */
2498c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT4		BIT(24)	/* Beacon DMA Interrupt 4 */
2508c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT3		BIT(23)	/* Beacon DMA Interrupt 3 */
2518c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT2		BIT(22)	/* Beacon DMA Interrupt 2 */
2528c2ecf20Sopenharmony_ci#define	 IMR1_BCNDMAINT1		BIT(21)	/* Beacon DMA Interrupt 1 */
2538c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR7			BIT(20)	/* Beacon Queue DMA Err Int 7 */
2548c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR6			BIT(19)	/* Beacon Queue DMA Err Int 6 */
2558c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR5			BIT(18)	/* Beacon Queue DMA Err Int 5 */
2568c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR4			BIT(17)	/* Beacon Queue DMA Err Int 4 */
2578c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR3			BIT(16)	/* Beacon Queue DMA Err Int 3 */
2588c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR2			BIT(15)	/* Beacon Queue DMA Err Int 2 */
2598c2ecf20Sopenharmony_ci#define	 IMR1_BCNDERR1			BIT(14)	/* Beacon Queue DMA Err Int 1 */
2608c2ecf20Sopenharmony_ci#define	 IMR1_ATIMEND_E			BIT(13)	/* ATIM Window End Extension
2618c2ecf20Sopenharmony_ci						   for Win7 */
2628c2ecf20Sopenharmony_ci#define	 IMR1_TXERR			BIT(11)	/* Tx Error Flag Int Status,
2638c2ecf20Sopenharmony_ci						   write 1 to clear */
2648c2ecf20Sopenharmony_ci#define	 IMR1_RXERR			BIT(10)	/* Rx Error Flag Int Status,
2658c2ecf20Sopenharmony_ci						   write 1 to clear */
2668c2ecf20Sopenharmony_ci#define	 IMR1_TXFOVW			BIT(9)	/* Transmit FIFO Overflow */
2678c2ecf20Sopenharmony_ci#define	 IMR1_RXFOVW			BIT(8)	/* Receive FIFO Overflow */
2688c2ecf20Sopenharmony_ci#define REG_HISR1			0x00bc
2698c2ecf20Sopenharmony_ci
2708c2ecf20Sopenharmony_ci/*  Host suspend counter on FPGA platform */
2718c2ecf20Sopenharmony_ci#define REG_HOST_SUSP_CNT		0x00bc
2728c2ecf20Sopenharmony_ci/*  Efuse access protection for RTL8723 */
2738c2ecf20Sopenharmony_ci#define REG_EFUSE_ACCESS		0x00cf
2748c2ecf20Sopenharmony_ci#define REG_BIST_SCAN			0x00d0
2758c2ecf20Sopenharmony_ci#define REG_BIST_RPT			0x00d4
2768c2ecf20Sopenharmony_ci#define REG_BIST_ROM_RPT		0x00d8
2778c2ecf20Sopenharmony_ci#define REG_USB_SIE_INTF		0x00e0
2788c2ecf20Sopenharmony_ci#define REG_PCIE_MIO_INTF		0x00e4
2798c2ecf20Sopenharmony_ci#define REG_PCIE_MIO_INTD		0x00e8
2808c2ecf20Sopenharmony_ci#define REG_HPON_FSM			0x00ec
2818c2ecf20Sopenharmony_ci#define  HPON_FSM_BONDING_MASK		(BIT(22) | BIT(23))
2828c2ecf20Sopenharmony_ci#define  HPON_FSM_BONDING_1T2R		BIT(22)
2838c2ecf20Sopenharmony_ci#define REG_SYS_CFG			0x00f0
2848c2ecf20Sopenharmony_ci#define  SYS_CFG_XCLK_VLD		BIT(0)
2858c2ecf20Sopenharmony_ci#define  SYS_CFG_ACLK_VLD		BIT(1)
2868c2ecf20Sopenharmony_ci#define  SYS_CFG_UCLK_VLD		BIT(2)
2878c2ecf20Sopenharmony_ci#define  SYS_CFG_PCLK_VLD		BIT(3)
2888c2ecf20Sopenharmony_ci#define  SYS_CFG_PCIRSTB		BIT(4)
2898c2ecf20Sopenharmony_ci#define  SYS_CFG_V15_VLD		BIT(5)
2908c2ecf20Sopenharmony_ci#define  SYS_CFG_TRP_B15V_EN		BIT(7)
2918c2ecf20Sopenharmony_ci#define  SYS_CFG_SW_OFFLOAD_EN		BIT(7)	/* For chips with IOL support */
2928c2ecf20Sopenharmony_ci#define  SYS_CFG_SIC_IDLE		BIT(8)
2938c2ecf20Sopenharmony_ci#define  SYS_CFG_BD_MAC2		BIT(9)
2948c2ecf20Sopenharmony_ci#define  SYS_CFG_BD_MAC1		BIT(10)
2958c2ecf20Sopenharmony_ci#define  SYS_CFG_IC_MACPHY_MODE		BIT(11)
2968c2ecf20Sopenharmony_ci#define  SYS_CFG_CHIP_VER		(BIT(12) | BIT(13) | BIT(14) | BIT(15))
2978c2ecf20Sopenharmony_ci#define  SYS_CFG_BT_FUNC		BIT(16)
2988c2ecf20Sopenharmony_ci#define  SYS_CFG_VENDOR_ID		BIT(19)
2998c2ecf20Sopenharmony_ci#define  SYS_CFG_VENDOR_EXT_MASK	(BIT(18) | BIT(19))
3008c2ecf20Sopenharmony_ci#define   SYS_CFG_VENDOR_ID_TSMC	0
3018c2ecf20Sopenharmony_ci#define   SYS_CFG_VENDOR_ID_SMIC	BIT(18)
3028c2ecf20Sopenharmony_ci#define   SYS_CFG_VENDOR_ID_UMC		BIT(19)
3038c2ecf20Sopenharmony_ci#define  SYS_CFG_PAD_HWPD_IDN		BIT(22)
3048c2ecf20Sopenharmony_ci#define  SYS_CFG_TRP_VAUX_EN		BIT(23)
3058c2ecf20Sopenharmony_ci#define  SYS_CFG_TRP_BT_EN		BIT(24)
3068c2ecf20Sopenharmony_ci#define  SYS_CFG_SPS_LDO_SEL		BIT(24)	/* 8192eu */
3078c2ecf20Sopenharmony_ci#define  SYS_CFG_BD_PKG_SEL		BIT(25)
3088c2ecf20Sopenharmony_ci#define  SYS_CFG_BD_HCI_SEL		BIT(26)
3098c2ecf20Sopenharmony_ci#define  SYS_CFG_TYPE_ID		BIT(27)
3108c2ecf20Sopenharmony_ci#define  SYS_CFG_RTL_ID			BIT(23) /*  TestChip ID,
3118c2ecf20Sopenharmony_ci						    1:Test(RLE); 0:MP(RL) */
3128c2ecf20Sopenharmony_ci#define  SYS_CFG_SPS_SEL		BIT(24) /*  1:LDO regulator mode;
3138c2ecf20Sopenharmony_ci						    0:Switching regulator mode*/
3148c2ecf20Sopenharmony_ci#define  SYS_CFG_CHIP_VERSION_MASK	0xf000	/* Bit 12 - 15 */
3158c2ecf20Sopenharmony_ci#define  SYS_CFG_CHIP_VERSION_SHIFT	12
3168c2ecf20Sopenharmony_ci
3178c2ecf20Sopenharmony_ci#define REG_GPIO_OUTSTS			0x00f4	/*  For RTL8723 only. */
3188c2ecf20Sopenharmony_ci#define  GPIO_EFS_HCI_SEL		(BIT(0) | BIT(1))
3198c2ecf20Sopenharmony_ci#define  GPIO_PAD_HCI_SEL		(BIT(2) | BIT(3))
3208c2ecf20Sopenharmony_ci#define  GPIO_HCI_SEL			(BIT(4) | BIT(5))
3218c2ecf20Sopenharmony_ci#define  GPIO_PKG_SEL_HCI		BIT(6)
3228c2ecf20Sopenharmony_ci#define  GPIO_FEN_GPS			BIT(7)
3238c2ecf20Sopenharmony_ci#define  GPIO_FEN_BT			BIT(8)
3248c2ecf20Sopenharmony_ci#define  GPIO_FEN_WL			BIT(9)
3258c2ecf20Sopenharmony_ci#define  GPIO_FEN_PCI			BIT(10)
3268c2ecf20Sopenharmony_ci#define  GPIO_FEN_USB			BIT(11)
3278c2ecf20Sopenharmony_ci#define  GPIO_BTRF_HWPDN_N		BIT(12)
3288c2ecf20Sopenharmony_ci#define  GPIO_WLRF_HWPDN_N		BIT(13)
3298c2ecf20Sopenharmony_ci#define  GPIO_PDN_BT_N			BIT(14)
3308c2ecf20Sopenharmony_ci#define  GPIO_PDN_GPS_N			BIT(15)
3318c2ecf20Sopenharmony_ci#define  GPIO_BT_CTL_HWPDN		BIT(16)
3328c2ecf20Sopenharmony_ci#define  GPIO_GPS_CTL_HWPDN		BIT(17)
3338c2ecf20Sopenharmony_ci#define  GPIO_PPHY_SUSB			BIT(20)
3348c2ecf20Sopenharmony_ci#define  GPIO_UPHY_SUSB			BIT(21)
3358c2ecf20Sopenharmony_ci#define  GPIO_PCI_SUSEN			BIT(22)
3368c2ecf20Sopenharmony_ci#define  GPIO_USB_SUSEN			BIT(23)
3378c2ecf20Sopenharmony_ci#define  GPIO_RF_RL_ID			(BIT(31) | BIT(30) | BIT(29) | BIT(28))
3388c2ecf20Sopenharmony_ci
3398c2ecf20Sopenharmony_ci#define REG_SYS_CFG2			0x00fc	/* 8192eu */
3408c2ecf20Sopenharmony_ci
3418c2ecf20Sopenharmony_ci/* 0x0100 ~ 0x01FF	MACTOP General Configuration */
3428c2ecf20Sopenharmony_ci#define REG_CR				0x0100
3438c2ecf20Sopenharmony_ci#define  CR_HCI_TXDMA_ENABLE		BIT(0)
3448c2ecf20Sopenharmony_ci#define  CR_HCI_RXDMA_ENABLE		BIT(1)
3458c2ecf20Sopenharmony_ci#define  CR_TXDMA_ENABLE		BIT(2)
3468c2ecf20Sopenharmony_ci#define  CR_RXDMA_ENABLE		BIT(3)
3478c2ecf20Sopenharmony_ci#define  CR_PROTOCOL_ENABLE		BIT(4)
3488c2ecf20Sopenharmony_ci#define  CR_SCHEDULE_ENABLE		BIT(5)
3498c2ecf20Sopenharmony_ci#define  CR_MAC_TX_ENABLE		BIT(6)
3508c2ecf20Sopenharmony_ci#define  CR_MAC_RX_ENABLE		BIT(7)
3518c2ecf20Sopenharmony_ci#define  CR_SW_BEACON_ENABLE		BIT(8)
3528c2ecf20Sopenharmony_ci#define  CR_SECURITY_ENABLE		BIT(9)
3538c2ecf20Sopenharmony_ci#define  CR_CALTIMER_ENABLE		BIT(10)
3548c2ecf20Sopenharmony_ci
3558c2ecf20Sopenharmony_ci/* Media Status Register */
3568c2ecf20Sopenharmony_ci#define REG_MSR				0x0102
3578c2ecf20Sopenharmony_ci#define  MSR_LINKTYPE_MASK		0x3
3588c2ecf20Sopenharmony_ci#define  MSR_LINKTYPE_NONE		0x0
3598c2ecf20Sopenharmony_ci#define  MSR_LINKTYPE_ADHOC		0x1
3608c2ecf20Sopenharmony_ci#define  MSR_LINKTYPE_STATION		0x2
3618c2ecf20Sopenharmony_ci#define  MSR_LINKTYPE_AP		0x3
3628c2ecf20Sopenharmony_ci
3638c2ecf20Sopenharmony_ci#define REG_PBP				0x0104
3648c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_RX_SHIFT		0
3658c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_TX_SHIFT		4
3668c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_64		0x0
3678c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_128		0x1
3688c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_256		0x2
3698c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_512		0x3
3708c2ecf20Sopenharmony_ci#define  PBP_PAGE_SIZE_1024		0x4
3718c2ecf20Sopenharmony_ci
3728c2ecf20Sopenharmony_ci#define REG_TRXDMA_CTRL			0x010c
3738c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_RXDMA_AGG_EN	BIT(2)
3748c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_VOQ_SHIFT		4
3758c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_VIQ_SHIFT		6
3768c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_BEQ_SHIFT		8
3778c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_BKQ_SHIFT		10
3788c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_MGQ_SHIFT		12
3798c2ecf20Sopenharmony_ci#define  TRXDMA_CTRL_HIQ_SHIFT		14
3808c2ecf20Sopenharmony_ci#define  TRXDMA_QUEUE_LOW		1
3818c2ecf20Sopenharmony_ci#define  TRXDMA_QUEUE_NORMAL		2
3828c2ecf20Sopenharmony_ci#define  TRXDMA_QUEUE_HIGH		3
3838c2ecf20Sopenharmony_ci
3848c2ecf20Sopenharmony_ci#define REG_TRXFF_BNDY			0x0114
3858c2ecf20Sopenharmony_ci#define REG_TRXFF_STATUS		0x0118
3868c2ecf20Sopenharmony_ci#define REG_RXFF_PTR			0x011c
3878c2ecf20Sopenharmony_ci#define REG_HIMR			0x0120
3888c2ecf20Sopenharmony_ci#define REG_HISR			0x0124
3898c2ecf20Sopenharmony_ci#define REG_HIMRE			0x0128
3908c2ecf20Sopenharmony_ci#define REG_HISRE			0x012c
3918c2ecf20Sopenharmony_ci#define REG_CPWM			0x012f
3928c2ecf20Sopenharmony_ci#define REG_FWIMR			0x0130
3938c2ecf20Sopenharmony_ci#define REG_FWISR			0x0134
3948c2ecf20Sopenharmony_ci#define REG_PKTBUF_DBG_CTRL		0x0140
3958c2ecf20Sopenharmony_ci#define REG_PKTBUF_DBG_DATA_L		0x0144
3968c2ecf20Sopenharmony_ci#define REG_PKTBUF_DBG_DATA_H		0x0148
3978c2ecf20Sopenharmony_ci
3988c2ecf20Sopenharmony_ci#define REG_TC0_CTRL			0x0150
3998c2ecf20Sopenharmony_ci#define REG_TC1_CTRL			0x0154
4008c2ecf20Sopenharmony_ci#define REG_TC2_CTRL			0x0158
4018c2ecf20Sopenharmony_ci#define REG_TC3_CTRL			0x015c
4028c2ecf20Sopenharmony_ci#define REG_TC4_CTRL			0x0160
4038c2ecf20Sopenharmony_ci#define REG_TCUNIT_BASE			0x0164
4048c2ecf20Sopenharmony_ci#define REG_MBIST_START			0x0174
4058c2ecf20Sopenharmony_ci#define REG_MBIST_DONE			0x0178
4068c2ecf20Sopenharmony_ci#define REG_MBIST_FAIL			0x017c
4078c2ecf20Sopenharmony_ci#define REG_C2HEVT_MSG_NORMAL		0x01a0
4088c2ecf20Sopenharmony_ci/* 8192EU/8723BU/8812 */
4098c2ecf20Sopenharmony_ci#define REG_C2HEVT_CMD_ID_8723B		0x01ae
4108c2ecf20Sopenharmony_ci#define REG_C2HEVT_CLEAR		0x01af
4118c2ecf20Sopenharmony_ci#define REG_C2HEVT_MSG_TEST		0x01b8
4128c2ecf20Sopenharmony_ci#define REG_MCUTST_1			0x01c0
4138c2ecf20Sopenharmony_ci#define REG_FMTHR			0x01c8
4148c2ecf20Sopenharmony_ci#define REG_HMTFR			0x01cc
4158c2ecf20Sopenharmony_ci#define REG_HMBOX_0			0x01d0
4168c2ecf20Sopenharmony_ci#define REG_HMBOX_1			0x01d4
4178c2ecf20Sopenharmony_ci#define REG_HMBOX_2			0x01d8
4188c2ecf20Sopenharmony_ci#define REG_HMBOX_3			0x01dc
4198c2ecf20Sopenharmony_ci
4208c2ecf20Sopenharmony_ci#define REG_LLT_INIT			0x01e0
4218c2ecf20Sopenharmony_ci#define  LLT_OP_INACTIVE		0x0
4228c2ecf20Sopenharmony_ci#define  LLT_OP_WRITE			(0x1 << 30)
4238c2ecf20Sopenharmony_ci#define  LLT_OP_READ			(0x2 << 30)
4248c2ecf20Sopenharmony_ci#define  LLT_OP_MASK			(0x3 << 30)
4258c2ecf20Sopenharmony_ci
4268c2ecf20Sopenharmony_ci#define REG_BB_ACCEESS_CTRL		0x01e8
4278c2ecf20Sopenharmony_ci#define REG_BB_ACCESS_DATA		0x01ec
4288c2ecf20Sopenharmony_ci
4298c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT0_8723B		0x01f0
4308c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT1_8723B		0x01f4
4318c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT2_8723B		0x01f8
4328c2ecf20Sopenharmony_ci#define REG_HMBOX_EXT3_8723B		0x01fc
4338c2ecf20Sopenharmony_ci
4348c2ecf20Sopenharmony_ci/* 0x0200 ~ 0x027F	TXDMA Configuration */
4358c2ecf20Sopenharmony_ci#define REG_RQPN			0x0200
4368c2ecf20Sopenharmony_ci#define  RQPN_HI_PQ_SHIFT		0
4378c2ecf20Sopenharmony_ci#define  RQPN_LO_PQ_SHIFT		8
4388c2ecf20Sopenharmony_ci#define  RQPN_PUB_PQ_SHIFT		16
4398c2ecf20Sopenharmony_ci#define  RQPN_LOAD			BIT(31)
4408c2ecf20Sopenharmony_ci
4418c2ecf20Sopenharmony_ci#define REG_FIFOPAGE			0x0204
4428c2ecf20Sopenharmony_ci#define REG_TDECTRL			0x0208
4438c2ecf20Sopenharmony_ci#define REG_TXDMA_OFFSET_CHK		0x020c
4448c2ecf20Sopenharmony_ci#define  TXDMA_OFFSET_DROP_DATA_EN	BIT(9)
4458c2ecf20Sopenharmony_ci#define REG_TXDMA_STATUS		0x0210
4468c2ecf20Sopenharmony_ci#define REG_RQPN_NPQ			0x0214
4478c2ecf20Sopenharmony_ci#define  RQPN_NPQ_SHIFT			0
4488c2ecf20Sopenharmony_ci#define  RQPN_EPQ_SHIFT			16
4498c2ecf20Sopenharmony_ci
4508c2ecf20Sopenharmony_ci#define REG_AUTO_LLT			0x0224
4518c2ecf20Sopenharmony_ci#define  AUTO_LLT_INIT_LLT		BIT(16)
4528c2ecf20Sopenharmony_ci
4538c2ecf20Sopenharmony_ci#define REG_DWBCN1_CTRL_8723B		0x0228
4548c2ecf20Sopenharmony_ci
4558c2ecf20Sopenharmony_ci/* 0x0280 ~ 0x02FF	RXDMA Configuration */
4568c2ecf20Sopenharmony_ci#define REG_RXDMA_AGG_PG_TH		0x0280	/* 0-7 : USB DMA size bits
4578c2ecf20Sopenharmony_ci						   8-14: USB DMA timeout
4588c2ecf20Sopenharmony_ci						   15  : Aggregation enable
4598c2ecf20Sopenharmony_ci						         Only seems to be used
4608c2ecf20Sopenharmony_ci							 on 8723bu/8192eu */
4618c2ecf20Sopenharmony_ci#define  RXDMA_USB_AGG_ENABLE		BIT(31)
4628c2ecf20Sopenharmony_ci#define REG_RXPKT_NUM			0x0284
4638c2ecf20Sopenharmony_ci#define  RXPKT_NUM_RXDMA_IDLE		BIT(17)
4648c2ecf20Sopenharmony_ci#define  RXPKT_NUM_RW_RELEASE_EN	BIT(18)
4658c2ecf20Sopenharmony_ci#define REG_RXDMA_STATUS		0x0288
4668c2ecf20Sopenharmony_ci
4678c2ecf20Sopenharmony_ci/* Presumably only found on newer chips such as 8723bu */
4688c2ecf20Sopenharmony_ci#define REG_RX_DMA_CTRL_8723B		0x0286
4698c2ecf20Sopenharmony_ci#define REG_RXDMA_PRO_8723B		0x0290
4708c2ecf20Sopenharmony_ci
4718c2ecf20Sopenharmony_ci#define REG_RF_BB_CMD_ADDR		0x02c0
4728c2ecf20Sopenharmony_ci#define REG_RF_BB_CMD_DATA		0x02c4
4738c2ecf20Sopenharmony_ci
4748c2ecf20Sopenharmony_ci/*  spec version 11 */
4758c2ecf20Sopenharmony_ci/* 0x0400 ~ 0x047F	Protocol Configuration */
4768c2ecf20Sopenharmony_ci/* 8192c, 8192d */
4778c2ecf20Sopenharmony_ci#define REG_VOQ_INFO			0x0400
4788c2ecf20Sopenharmony_ci#define REG_VIQ_INFO			0x0404
4798c2ecf20Sopenharmony_ci#define REG_BEQ_INFO			0x0408
4808c2ecf20Sopenharmony_ci#define REG_BKQ_INFO			0x040c
4818c2ecf20Sopenharmony_ci/* 8188e, 8723a, 8812a, 8821a, 8192e, 8723b */
4828c2ecf20Sopenharmony_ci#define REG_Q0_INFO			0x400
4838c2ecf20Sopenharmony_ci#define REG_Q1_INFO			0x404
4848c2ecf20Sopenharmony_ci#define REG_Q2_INFO			0x408
4858c2ecf20Sopenharmony_ci#define REG_Q3_INFO			0x40c
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_ci#define REG_MGQ_INFO			0x0410
4888c2ecf20Sopenharmony_ci#define REG_HGQ_INFO			0x0414
4898c2ecf20Sopenharmony_ci#define REG_BCNQ_INFO			0x0418
4908c2ecf20Sopenharmony_ci
4918c2ecf20Sopenharmony_ci#define REG_CPU_MGQ_INFORMATION		0x041c
4928c2ecf20Sopenharmony_ci#define REG_FWHW_TXQ_CTRL		0x0420
4938c2ecf20Sopenharmony_ci#define  FWHW_TXQ_CTRL_AMPDU_RETRY	BIT(7)
4948c2ecf20Sopenharmony_ci#define  FWHW_TXQ_CTRL_XMIT_MGMT_ACK	BIT(12)
4958c2ecf20Sopenharmony_ci
4968c2ecf20Sopenharmony_ci#define REG_HWSEQ_CTRL			0x0423
4978c2ecf20Sopenharmony_ci#define REG_TXPKTBUF_BCNQ_BDNY		0x0424
4988c2ecf20Sopenharmony_ci#define REG_TXPKTBUF_MGQ_BDNY		0x0425
4998c2ecf20Sopenharmony_ci#define REG_LIFETIME_EN			0x0426
5008c2ecf20Sopenharmony_ci#define REG_MULTI_BCNQ_OFFSET		0x0427
5018c2ecf20Sopenharmony_ci
5028c2ecf20Sopenharmony_ci#define REG_SPEC_SIFS			0x0428
5038c2ecf20Sopenharmony_ci#define  SPEC_SIFS_CCK_MASK		0x00ff
5048c2ecf20Sopenharmony_ci#define  SPEC_SIFS_CCK_SHIFT		0
5058c2ecf20Sopenharmony_ci#define  SPEC_SIFS_OFDM_MASK		0xff00
5068c2ecf20Sopenharmony_ci#define  SPEC_SIFS_OFDM_SHIFT		8
5078c2ecf20Sopenharmony_ci
5088c2ecf20Sopenharmony_ci#define REG_RETRY_LIMIT			0x042a
5098c2ecf20Sopenharmony_ci#define  RETRY_LIMIT_LONG_SHIFT		0
5108c2ecf20Sopenharmony_ci#define  RETRY_LIMIT_LONG_MASK		0x003f
5118c2ecf20Sopenharmony_ci#define  RETRY_LIMIT_SHORT_SHIFT	8
5128c2ecf20Sopenharmony_ci#define  RETRY_LIMIT_SHORT_MASK		0x3f00
5138c2ecf20Sopenharmony_ci
5148c2ecf20Sopenharmony_ci#define REG_DARFRC			0x0430
5158c2ecf20Sopenharmony_ci#define REG_RARFRC			0x0438
5168c2ecf20Sopenharmony_ci#define REG_RESPONSE_RATE_SET		0x0440
5178c2ecf20Sopenharmony_ci#define  RESPONSE_RATE_BITMAP_ALL	0xfffff
5188c2ecf20Sopenharmony_ci#define  RESPONSE_RATE_RRSR_CCK_ONLY_1M	0xffff1
5198c2ecf20Sopenharmony_ci#define  RSR_1M				BIT(0)
5208c2ecf20Sopenharmony_ci#define  RSR_2M				BIT(1)
5218c2ecf20Sopenharmony_ci#define  RSR_5_5M			BIT(2)
5228c2ecf20Sopenharmony_ci#define  RSR_11M			BIT(3)
5238c2ecf20Sopenharmony_ci#define  RSR_6M				BIT(4)
5248c2ecf20Sopenharmony_ci#define  RSR_9M				BIT(5)
5258c2ecf20Sopenharmony_ci#define  RSR_12M			BIT(6)
5268c2ecf20Sopenharmony_ci#define  RSR_18M			BIT(7)
5278c2ecf20Sopenharmony_ci#define  RSR_24M			BIT(8)
5288c2ecf20Sopenharmony_ci#define  RSR_36M			BIT(9)
5298c2ecf20Sopenharmony_ci#define  RSR_48M			BIT(10)
5308c2ecf20Sopenharmony_ci#define  RSR_54M			BIT(11)
5318c2ecf20Sopenharmony_ci#define  RSR_MCS0			BIT(12)
5328c2ecf20Sopenharmony_ci#define  RSR_MCS1			BIT(13)
5338c2ecf20Sopenharmony_ci#define  RSR_MCS2			BIT(14)
5348c2ecf20Sopenharmony_ci#define  RSR_MCS3			BIT(15)
5358c2ecf20Sopenharmony_ci#define  RSR_MCS4			BIT(16)
5368c2ecf20Sopenharmony_ci#define  RSR_MCS5			BIT(17)
5378c2ecf20Sopenharmony_ci#define  RSR_MCS6			BIT(18)
5388c2ecf20Sopenharmony_ci#define  RSR_MCS7			BIT(19)
5398c2ecf20Sopenharmony_ci#define  RSR_RSC_LOWER_SUB_CHANNEL	BIT(21)	/* 0x200000 */
5408c2ecf20Sopenharmony_ci#define  RSR_RSC_UPPER_SUB_CHANNEL	BIT(22)	/* 0x400000 */
5418c2ecf20Sopenharmony_ci#define  RSR_RSC_BANDWIDTH_40M		(RSR_RSC_UPPER_SUB_CHANNEL | \
5428c2ecf20Sopenharmony_ci					 RSR_RSC_LOWER_SUB_CHANNEL)
5438c2ecf20Sopenharmony_ci#define  RSR_ACK_SHORT_PREAMBLE		BIT(23)
5448c2ecf20Sopenharmony_ci
5458c2ecf20Sopenharmony_ci#define REG_ARFR0			0x0444
5468c2ecf20Sopenharmony_ci#define REG_ARFR1			0x0448
5478c2ecf20Sopenharmony_ci#define REG_ARFR2			0x044c
5488c2ecf20Sopenharmony_ci#define REG_ARFR3			0x0450
5498c2ecf20Sopenharmony_ci#define REG_AMPDU_MAX_TIME_8723B	0x0456
5508c2ecf20Sopenharmony_ci#define REG_AGGLEN_LMT			0x0458
5518c2ecf20Sopenharmony_ci#define REG_AMPDU_MIN_SPACE		0x045c
5528c2ecf20Sopenharmony_ci#define REG_TXPKTBUF_WMAC_LBK_BF_HD	0x045d
5538c2ecf20Sopenharmony_ci#define REG_FAST_EDCA_CTRL		0x0460
5548c2ecf20Sopenharmony_ci#define REG_RD_RESP_PKT_TH		0x0463
5558c2ecf20Sopenharmony_ci#define REG_INIRTS_RATE_SEL		0x0480
5568c2ecf20Sopenharmony_ci/* 8723bu */
5578c2ecf20Sopenharmony_ci#define REG_DATA_SUBCHANNEL		0x0483
5588c2ecf20Sopenharmony_ci/* 8723au */
5598c2ecf20Sopenharmony_ci#define REG_INIDATA_RATE_SEL		0x0484
5608c2ecf20Sopenharmony_ci/* MACID_SLEEP_1/3 for 8723b, 8192e, 8812a, 8821a */
5618c2ecf20Sopenharmony_ci#define REG_MACID_SLEEP_3_8732B		0x0484
5628c2ecf20Sopenharmony_ci#define REG_MACID_SLEEP_1_8732B		0x0488
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci#define REG_POWER_STATUS		0x04a4
5658c2ecf20Sopenharmony_ci#define REG_POWER_STAGE1		0x04b4
5668c2ecf20Sopenharmony_ci#define REG_POWER_STAGE2		0x04b8
5678c2ecf20Sopenharmony_ci#define REG_AMPDU_BURST_MODE_8723B	0x04bc
5688c2ecf20Sopenharmony_ci#define REG_PKT_VO_VI_LIFE_TIME		0x04c0
5698c2ecf20Sopenharmony_ci#define REG_PKT_BE_BK_LIFE_TIME		0x04c2
5708c2ecf20Sopenharmony_ci#define REG_STBC_SETTING		0x04c4
5718c2ecf20Sopenharmony_ci#define REG_QUEUE_CTRL			0x04c6
5728c2ecf20Sopenharmony_ci#define REG_HT_SINGLE_AMPDU_8723B	0x04c7
5738c2ecf20Sopenharmony_ci#define REG_PROT_MODE_CTRL		0x04c8
5748c2ecf20Sopenharmony_ci#define REG_MAX_AGGR_NUM		0x04ca
5758c2ecf20Sopenharmony_ci#define REG_RTS_MAX_AGGR_NUM		0x04cb
5768c2ecf20Sopenharmony_ci#define REG_BAR_MODE_CTRL		0x04cc
5778c2ecf20Sopenharmony_ci#define REG_RA_TRY_RATE_AGG_LMT		0x04cf
5788c2ecf20Sopenharmony_ci/* MACID_DROP for 8723a */
5798c2ecf20Sopenharmony_ci#define REG_MACID_DROP_8732A		0x04d0
5808c2ecf20Sopenharmony_ci/* EARLY_MODE_CONTROL 8188e */
5818c2ecf20Sopenharmony_ci#define REG_EARLY_MODE_CONTROL_8188E	0x04d0
5828c2ecf20Sopenharmony_ci/* MACID_SLEEP_2 for 8723b, 8192e, 8812a, 8821a */
5838c2ecf20Sopenharmony_ci#define REG_MACID_SLEEP_2_8732B		0x04d0
5848c2ecf20Sopenharmony_ci#define REG_MACID_SLEEP			0x04d4
5858c2ecf20Sopenharmony_ci#define REG_NQOS_SEQ			0x04dc
5868c2ecf20Sopenharmony_ci#define REG_QOS_SEQ			0x04de
5878c2ecf20Sopenharmony_ci#define REG_NEED_CPU_HANDLE		0x04e0
5888c2ecf20Sopenharmony_ci#define REG_PKT_LOSE_RPT		0x04e1
5898c2ecf20Sopenharmony_ci#define REG_PTCL_ERR_STATUS		0x04e2
5908c2ecf20Sopenharmony_ci#define REG_TX_REPORT_CTRL		0x04ec
5918c2ecf20Sopenharmony_ci#define  TX_REPORT_CTRL_TIMER_ENABLE	BIT(1)
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_ci#define REG_TX_REPORT_TIME		0x04f0
5948c2ecf20Sopenharmony_ci#define REG_DUMMY			0x04fc
5958c2ecf20Sopenharmony_ci
5968c2ecf20Sopenharmony_ci/* 0x0500 ~ 0x05FF	EDCA Configuration */
5978c2ecf20Sopenharmony_ci#define REG_EDCA_VO_PARAM		0x0500
5988c2ecf20Sopenharmony_ci#define REG_EDCA_VI_PARAM		0x0504
5998c2ecf20Sopenharmony_ci#define REG_EDCA_BE_PARAM		0x0508
6008c2ecf20Sopenharmony_ci#define REG_EDCA_BK_PARAM		0x050c
6018c2ecf20Sopenharmony_ci#define  EDCA_PARAM_ECW_MIN_SHIFT	8
6028c2ecf20Sopenharmony_ci#define  EDCA_PARAM_ECW_MAX_SHIFT	12
6038c2ecf20Sopenharmony_ci#define  EDCA_PARAM_TXOP_SHIFT		16
6048c2ecf20Sopenharmony_ci#define REG_BEACON_TCFG			0x0510
6058c2ecf20Sopenharmony_ci#define REG_PIFS			0x0512
6068c2ecf20Sopenharmony_ci#define REG_RDG_PIFS			0x0513
6078c2ecf20Sopenharmony_ci#define REG_SIFS_CCK			0x0514
6088c2ecf20Sopenharmony_ci#define REG_SIFS_OFDM			0x0516
6098c2ecf20Sopenharmony_ci#define REG_TSFTR_SYN_OFFSET		0x0518
6108c2ecf20Sopenharmony_ci#define REG_AGGR_BREAK_TIME		0x051a
6118c2ecf20Sopenharmony_ci#define REG_SLOT			0x051b
6128c2ecf20Sopenharmony_ci#define REG_TX_PTCL_CTRL		0x0520
6138c2ecf20Sopenharmony_ci#define REG_TXPAUSE			0x0522
6148c2ecf20Sopenharmony_ci#define REG_DIS_TXREQ_CLR		0x0523
6158c2ecf20Sopenharmony_ci#define REG_RD_CTRL			0x0524
6168c2ecf20Sopenharmony_ci#define REG_TBTT_PROHIBIT		0x0540
6178c2ecf20Sopenharmony_ci#define REG_RD_NAV_NXT			0x0544
6188c2ecf20Sopenharmony_ci#define REG_NAV_PROT_LEN		0x0546
6198c2ecf20Sopenharmony_ci
6208c2ecf20Sopenharmony_ci#define REG_BEACON_CTRL			0x0550
6218c2ecf20Sopenharmony_ci#define REG_BEACON_CTRL_1		0x0551
6228c2ecf20Sopenharmony_ci#define  BEACON_ATIM			BIT(0)
6238c2ecf20Sopenharmony_ci#define  BEACON_CTRL_MBSSID		BIT(1)
6248c2ecf20Sopenharmony_ci#define  BEACON_CTRL_TX_BEACON_RPT	BIT(2)
6258c2ecf20Sopenharmony_ci#define  BEACON_FUNCTION_ENABLE		BIT(3)
6268c2ecf20Sopenharmony_ci#define  BEACON_DISABLE_TSF_UPDATE	BIT(4)
6278c2ecf20Sopenharmony_ci
6288c2ecf20Sopenharmony_ci#define REG_MBID_NUM			0x0552
6298c2ecf20Sopenharmony_ci#define REG_DUAL_TSF_RST		0x0553
6308c2ecf20Sopenharmony_ci#define  DUAL_TSF_RESET_TSF0		BIT(0)
6318c2ecf20Sopenharmony_ci#define  DUAL_TSF_RESET_TSF1		BIT(1)
6328c2ecf20Sopenharmony_ci#define  DUAL_TSF_RESET_P2P		BIT(4)
6338c2ecf20Sopenharmony_ci#define  DUAL_TSF_TX_OK			BIT(5)
6348c2ecf20Sopenharmony_ci
6358c2ecf20Sopenharmony_ci/*  The same as REG_MBSSID_BCN_SPACE */
6368c2ecf20Sopenharmony_ci#define REG_BCN_INTERVAL		0x0554
6378c2ecf20Sopenharmony_ci#define REG_MBSSID_BCN_SPACE		0x0554
6388c2ecf20Sopenharmony_ci
6398c2ecf20Sopenharmony_ci#define REG_DRIVER_EARLY_INT		0x0558
6408c2ecf20Sopenharmony_ci#define  DRIVER_EARLY_INT_TIME		5
6418c2ecf20Sopenharmony_ci
6428c2ecf20Sopenharmony_ci#define REG_BEACON_DMA_TIME		0x0559
6438c2ecf20Sopenharmony_ci#define  BEACON_DMA_ATIME_INT_TIME	2
6448c2ecf20Sopenharmony_ci
6458c2ecf20Sopenharmony_ci#define REG_ATIMWND			0x055a
6468c2ecf20Sopenharmony_ci#define REG_USTIME_TSF_8723B		0x055c
6478c2ecf20Sopenharmony_ci#define REG_BCN_MAX_ERR			0x055d
6488c2ecf20Sopenharmony_ci#define REG_RXTSF_OFFSET_CCK		0x055e
6498c2ecf20Sopenharmony_ci#define REG_RXTSF_OFFSET_OFDM		0x055f
6508c2ecf20Sopenharmony_ci#define REG_TSFTR			0x0560
6518c2ecf20Sopenharmony_ci#define REG_TSFTR1			0x0568
6528c2ecf20Sopenharmony_ci#define REG_INIT_TSFTR			0x0564
6538c2ecf20Sopenharmony_ci#define REG_ATIMWND_1			0x0570
6548c2ecf20Sopenharmony_ci#define REG_PSTIMER			0x0580
6558c2ecf20Sopenharmony_ci#define REG_TIMER0			0x0584
6568c2ecf20Sopenharmony_ci#define REG_TIMER1			0x0588
6578c2ecf20Sopenharmony_ci#define REG_ACM_HW_CTRL			0x05c0
6588c2ecf20Sopenharmony_ci#define  ACM_HW_CTRL_BK			BIT(0)
6598c2ecf20Sopenharmony_ci#define  ACM_HW_CTRL_BE			BIT(1)
6608c2ecf20Sopenharmony_ci#define  ACM_HW_CTRL_VI			BIT(2)
6618c2ecf20Sopenharmony_ci#define  ACM_HW_CTRL_VO			BIT(3)
6628c2ecf20Sopenharmony_ci#define REG_ACM_RST_CTRL		0x05c1
6638c2ecf20Sopenharmony_ci#define REG_ACMAVG			0x05c2
6648c2ecf20Sopenharmony_ci#define REG_VO_ADMTIME			0x05c4
6658c2ecf20Sopenharmony_ci#define REG_VI_ADMTIME			0x05c6
6668c2ecf20Sopenharmony_ci#define REG_BE_ADMTIME			0x05c8
6678c2ecf20Sopenharmony_ci#define REG_EDCA_RANDOM_GEN		0x05cc
6688c2ecf20Sopenharmony_ci#define REG_SCH_TXCMD			0x05d0
6698c2ecf20Sopenharmony_ci
6708c2ecf20Sopenharmony_ci/* define REG_FW_TSF_SYNC_CNT		0x04a0 */
6718c2ecf20Sopenharmony_ci#define REG_SCH_TX_CMD			0x05f8
6728c2ecf20Sopenharmony_ci#define REG_FW_RESET_TSF_CNT_1		0x05fc
6738c2ecf20Sopenharmony_ci#define REG_FW_RESET_TSF_CNT_0		0x05fd
6748c2ecf20Sopenharmony_ci#define REG_FW_BCN_DIS_CNT		0x05fe
6758c2ecf20Sopenharmony_ci
6768c2ecf20Sopenharmony_ci/* 0x0600 ~ 0x07FF  WMAC Configuration */
6778c2ecf20Sopenharmony_ci#define REG_APSD_CTRL			0x0600
6788c2ecf20Sopenharmony_ci#define  APSD_CTRL_OFF			BIT(6)
6798c2ecf20Sopenharmony_ci#define  APSD_CTRL_OFF_STATUS		BIT(7)
6808c2ecf20Sopenharmony_ci#define REG_BW_OPMODE			0x0603
6818c2ecf20Sopenharmony_ci#define  BW_OPMODE_20MHZ		BIT(2)
6828c2ecf20Sopenharmony_ci#define  BW_OPMODE_5G			BIT(1)
6838c2ecf20Sopenharmony_ci#define  BW_OPMODE_11J			BIT(0)
6848c2ecf20Sopenharmony_ci
6858c2ecf20Sopenharmony_ci#define REG_TCR				0x0604
6868c2ecf20Sopenharmony_ci
6878c2ecf20Sopenharmony_ci/* Receive Configuration Register */
6888c2ecf20Sopenharmony_ci#define REG_RCR				0x0608
6898c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_AP			BIT(0)  /* Accept all unicast packet */
6908c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_PHYS_MATCH		BIT(1)  /* Accept phys match packet */
6918c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_MCAST		BIT(2)
6928c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_BCAST		BIT(3)
6938c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_ADDR3		BIT(4)  /* Accept address 3 match
6948c2ecf20Sopenharmony_ci						 packet */
6958c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_PM			BIT(5)  /* Accept power management
6968c2ecf20Sopenharmony_ci						 packet */
6978c2ecf20Sopenharmony_ci#define  RCR_CHECK_BSSID_MATCH		BIT(6)  /* Accept BSSID match packet */
6988c2ecf20Sopenharmony_ci#define  RCR_CHECK_BSSID_BEACON		BIT(7)  /* Accept BSSID match packet
6998c2ecf20Sopenharmony_ci						 (Rx beacon, probe rsp) */
7008c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_CRC32		BIT(8)  /* Accept CRC32 error packet */
7018c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_ICV			BIT(9)  /* Accept ICV error packet */
7028c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_DATA_FRAME		BIT(11) /* Accept all data pkt or use
7038c2ecf20Sopenharmony_ci						   REG_RXFLTMAP2 */
7048c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_CTRL_FRAME		BIT(12) /* Accept all control pkt or use
7058c2ecf20Sopenharmony_ci						   REG_RXFLTMAP1 */
7068c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_MGMT_FRAME		BIT(13) /* Accept all mgmt pkt or use
7078c2ecf20Sopenharmony_ci						   REG_RXFLTMAP0 */
7088c2ecf20Sopenharmony_ci#define  RCR_HTC_LOC_CTRL		BIT(14) /* MFC<--HTC=1 MFC-->HTC=0 */
7098c2ecf20Sopenharmony_ci#define  RCR_UC_DATA_PKT_INT_ENABLE	BIT(16) /* Enable unicast data packet
7108c2ecf20Sopenharmony_ci						   interrupt */
7118c2ecf20Sopenharmony_ci#define  RCR_BM_DATA_PKT_INT_ENABLE	BIT(17) /* Enable broadcast data packet
7128c2ecf20Sopenharmony_ci						   interrupt */
7138c2ecf20Sopenharmony_ci#define  RCR_TIM_PARSER_ENABLE		BIT(18) /* Enable RX beacon TIM parser*/
7148c2ecf20Sopenharmony_ci#define  RCR_MFBEN			BIT(22)
7158c2ecf20Sopenharmony_ci#define  RCR_LSIG_ENABLE		BIT(23) /* Enable LSIG TXOP Protection
7168c2ecf20Sopenharmony_ci						   function. Search KEYCAM for
7178c2ecf20Sopenharmony_ci						   each rx packet to check if
7188c2ecf20Sopenharmony_ci						   LSIGEN bit is set. */
7198c2ecf20Sopenharmony_ci#define  RCR_MULTI_BSSID_ENABLE		BIT(24) /* Enable Multiple BssId */
7208c2ecf20Sopenharmony_ci#define  RCR_FORCE_ACK			BIT(26)
7218c2ecf20Sopenharmony_ci#define  RCR_ACCEPT_BA_SSN		BIT(27) /* Accept BA SSN */
7228c2ecf20Sopenharmony_ci#define  RCR_APPEND_PHYSTAT		BIT(28)
7238c2ecf20Sopenharmony_ci#define  RCR_APPEND_ICV			BIT(29)
7248c2ecf20Sopenharmony_ci#define  RCR_APPEND_MIC			BIT(30)
7258c2ecf20Sopenharmony_ci#define  RCR_APPEND_FCS			BIT(31) /* WMAC append FCS after */
7268c2ecf20Sopenharmony_ci
7278c2ecf20Sopenharmony_ci#define REG_RX_PKT_LIMIT		0x060c
7288c2ecf20Sopenharmony_ci#define REG_RX_DLK_TIME			0x060d
7298c2ecf20Sopenharmony_ci#define REG_RX_DRVINFO_SZ		0x060f
7308c2ecf20Sopenharmony_ci
7318c2ecf20Sopenharmony_ci#define REG_MACID			0x0610
7328c2ecf20Sopenharmony_ci#define REG_BSSID			0x0618
7338c2ecf20Sopenharmony_ci#define REG_MAR				0x0620
7348c2ecf20Sopenharmony_ci#define REG_MBIDCAMCFG			0x0628
7358c2ecf20Sopenharmony_ci
7368c2ecf20Sopenharmony_ci#define REG_USTIME_EDCA			0x0638
7378c2ecf20Sopenharmony_ci#define REG_MAC_SPEC_SIFS		0x063a
7388c2ecf20Sopenharmony_ci
7398c2ecf20Sopenharmony_ci/*  20100719 Joseph: Hardware register definition change. (HW datasheet v54) */
7408c2ecf20Sopenharmony_ci	/*  [15:8]SIFS_R2T_OFDM, [7:0]SIFS_R2T_CCK */
7418c2ecf20Sopenharmony_ci#define REG_R2T_SIFS			0x063c
7428c2ecf20Sopenharmony_ci	/*  [15:8]SIFS_T2T_OFDM, [7:0]SIFS_T2T_CCK */
7438c2ecf20Sopenharmony_ci#define REG_T2T_SIFS			0x063e
7448c2ecf20Sopenharmony_ci#define REG_ACKTO			0x0640
7458c2ecf20Sopenharmony_ci#define REG_CTS2TO			0x0641
7468c2ecf20Sopenharmony_ci#define REG_EIFS			0x0642
7478c2ecf20Sopenharmony_ci
7488c2ecf20Sopenharmony_ci/* WMA, BA, CCX */
7498c2ecf20Sopenharmony_ci#define REG_NAV_CTRL			0x0650
7508c2ecf20Sopenharmony_ci/* In units of 128us */
7518c2ecf20Sopenharmony_ci#define REG_NAV_UPPER			0x0652
7528c2ecf20Sopenharmony_ci#define  NAV_UPPER_UNIT			128
7538c2ecf20Sopenharmony_ci
7548c2ecf20Sopenharmony_ci#define REG_BACAMCMD			0x0654
7558c2ecf20Sopenharmony_ci#define REG_BACAMCONTENT		0x0658
7568c2ecf20Sopenharmony_ci#define REG_LBDLY			0x0660
7578c2ecf20Sopenharmony_ci#define REG_FWDLY			0x0661
7588c2ecf20Sopenharmony_ci#define REG_RXERR_RPT			0x0664
7598c2ecf20Sopenharmony_ci#define REG_WMAC_TRXPTCL_CTL		0x0668
7608c2ecf20Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_MASK	(BIT(7) | BIT(8))
7618c2ecf20Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_20		0
7628c2ecf20Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_40		BIT(7)
7638c2ecf20Sopenharmony_ci#define  WMAC_TRXPTCL_CTL_BW_80		BIT(8)
7648c2ecf20Sopenharmony_ci
7658c2ecf20Sopenharmony_ci/*  Security */
7668c2ecf20Sopenharmony_ci#define REG_CAM_CMD			0x0670
7678c2ecf20Sopenharmony_ci#define  CAM_CMD_POLLING		BIT(31)
7688c2ecf20Sopenharmony_ci#define  CAM_CMD_WRITE			BIT(16)
7698c2ecf20Sopenharmony_ci#define  CAM_CMD_KEY_SHIFT		3
7708c2ecf20Sopenharmony_ci#define REG_CAM_WRITE			0x0674
7718c2ecf20Sopenharmony_ci#define  CAM_WRITE_VALID		BIT(15)
7728c2ecf20Sopenharmony_ci#define REG_CAM_READ			0x0678
7738c2ecf20Sopenharmony_ci#define REG_CAM_DEBUG			0x067c
7748c2ecf20Sopenharmony_ci#define REG_SECURITY_CFG		0x0680
7758c2ecf20Sopenharmony_ci#define  SEC_CFG_TX_USE_DEFKEY		BIT(0)
7768c2ecf20Sopenharmony_ci#define  SEC_CFG_RX_USE_DEFKEY		BIT(1)
7778c2ecf20Sopenharmony_ci#define  SEC_CFG_TX_SEC_ENABLE		BIT(2)
7788c2ecf20Sopenharmony_ci#define  SEC_CFG_RX_SEC_ENABLE		BIT(3)
7798c2ecf20Sopenharmony_ci#define  SEC_CFG_SKBYA2			BIT(4)
7808c2ecf20Sopenharmony_ci#define  SEC_CFG_NO_SKMC		BIT(5)
7818c2ecf20Sopenharmony_ci#define  SEC_CFG_TXBC_USE_DEFKEY	BIT(6)
7828c2ecf20Sopenharmony_ci#define  SEC_CFG_RXBC_USE_DEFKEY	BIT(7)
7838c2ecf20Sopenharmony_ci
7848c2ecf20Sopenharmony_ci/*  Power */
7858c2ecf20Sopenharmony_ci#define REG_WOW_CTRL			0x0690
7868c2ecf20Sopenharmony_ci#define REG_PSSTATUS			0x0691
7878c2ecf20Sopenharmony_ci#define REG_PS_RX_INFO			0x0692
7888c2ecf20Sopenharmony_ci#define REG_LPNAV_CTRL			0x0694
7898c2ecf20Sopenharmony_ci#define REG_WKFMCAM_CMD			0x0698
7908c2ecf20Sopenharmony_ci#define REG_WKFMCAM_RWD			0x069c
7918c2ecf20Sopenharmony_ci
7928c2ecf20Sopenharmony_ci/*
7938c2ecf20Sopenharmony_ci * RX Filters: each bit corresponds to the numerical value of the subtype.
7948c2ecf20Sopenharmony_ci * If it is set the subtype frame type is passed. The filter is only used when
7958c2ecf20Sopenharmony_ci * the RCR_ACCEPT_DATA_FRAME, RCR_ACCEPT_CTRL_FRAME, RCR_ACCEPT_MGMT_FRAME bit
7968c2ecf20Sopenharmony_ci * in the RCR are low.
7978c2ecf20Sopenharmony_ci *
7988c2ecf20Sopenharmony_ci * Example: Beacon subtype is binary 1000 which is decimal 8 so we have to set
7998c2ecf20Sopenharmony_ci * bit 8 (0x100) in REG_RXFLTMAP0 to enable reception.
8008c2ecf20Sopenharmony_ci */
8018c2ecf20Sopenharmony_ci#define REG_RXFLTMAP0			0x06a0	/* Management frames */
8028c2ecf20Sopenharmony_ci#define REG_RXFLTMAP1			0x06a2	/* Control frames */
8038c2ecf20Sopenharmony_ci#define REG_RXFLTMAP2			0x06a4	/* Data frames */
8048c2ecf20Sopenharmony_ci
8058c2ecf20Sopenharmony_ci#define REG_BCN_PSR_RPT			0x06a8
8068c2ecf20Sopenharmony_ci#define REG_CALB32K_CTRL		0x06ac
8078c2ecf20Sopenharmony_ci#define REG_PKT_MON_CTRL		0x06b4
8088c2ecf20Sopenharmony_ci#define REG_BT_COEX_TABLE1		0x06c0
8098c2ecf20Sopenharmony_ci#define REG_BT_COEX_TABLE2		0x06c4
8108c2ecf20Sopenharmony_ci#define REG_BT_COEX_TABLE3		0x06c8
8118c2ecf20Sopenharmony_ci#define REG_BT_COEX_TABLE4		0x06cc
8128c2ecf20Sopenharmony_ci#define REG_WMAC_RESP_TXINFO		0x06d8
8138c2ecf20Sopenharmony_ci
8148c2ecf20Sopenharmony_ci#define REG_MACID1			0x0700
8158c2ecf20Sopenharmony_ci#define REG_BSSID1			0x0708
8168c2ecf20Sopenharmony_ci
8178c2ecf20Sopenharmony_ci/*
8188c2ecf20Sopenharmony_ci * This seems to be 8723bu specific
8198c2ecf20Sopenharmony_ci */
8208c2ecf20Sopenharmony_ci#define REG_BT_CONTROL_8723BU		0x0764
8218c2ecf20Sopenharmony_ci#define  BT_CONTROL_BT_GRANT		BIT(12)
8228c2ecf20Sopenharmony_ci
8238c2ecf20Sopenharmony_ci#define REG_WLAN_ACT_CONTROL_8723B	0x076e
8248c2ecf20Sopenharmony_ci
8258c2ecf20Sopenharmony_ci#define REG_FPGA0_RF_MODE		0x0800
8268c2ecf20Sopenharmony_ci#define  FPGA_RF_MODE			BIT(0)
8278c2ecf20Sopenharmony_ci#define  FPGA_RF_MODE_JAPAN		BIT(1)
8288c2ecf20Sopenharmony_ci#define  FPGA_RF_MODE_CCK		BIT(24)
8298c2ecf20Sopenharmony_ci#define  FPGA_RF_MODE_OFDM		BIT(25)
8308c2ecf20Sopenharmony_ci
8318c2ecf20Sopenharmony_ci#define REG_FPGA0_TX_INFO		0x0804
8328c2ecf20Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_A	BIT(0)
8338c2ecf20Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_B	BIT(1)
8348c2ecf20Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_C	BIT(2)
8358c2ecf20Sopenharmony_ci#define  FPGA0_TX_INFO_OFDM_PATH_D	BIT(3)
8368c2ecf20Sopenharmony_ci#define REG_FPGA0_PSD_FUNC		0x0808
8378c2ecf20Sopenharmony_ci#define REG_FPGA0_TX_GAIN		0x080c
8388c2ecf20Sopenharmony_ci#define REG_FPGA0_RF_TIMING1		0x0810
8398c2ecf20Sopenharmony_ci#define REG_FPGA0_RF_TIMING2		0x0814
8408c2ecf20Sopenharmony_ci#define REG_FPGA0_POWER_SAVE		0x0818
8418c2ecf20Sopenharmony_ci#define  FPGA0_PS_LOWER_CHANNEL		BIT(26)
8428c2ecf20Sopenharmony_ci#define  FPGA0_PS_UPPER_CHANNEL		BIT(27)
8438c2ecf20Sopenharmony_ci
8448c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_HSSI_PARM1		0x0820	/* RF 3 wire register */
8458c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_PARM1_PI		BIT(8)
8468c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_HSSI_PARM2		0x0824
8478c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_HSSI_PARM1		0x0828
8488c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_HSSI_PARM2		0x082c
8498c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_3WIRE_DATA_LEN	0x800
8508c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_3WIRE_ADDR_LEN	0x400
8518c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_PARM2_ADDR_SHIFT	23
8528c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_PARM2_ADDR_MASK	0x7f800000	/* 0xff << 23 */
8538c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_PARM2_CCK_HIGH_PWR	BIT(9)
8548c2ecf20Sopenharmony_ci#define  FPGA0_HSSI_PARM2_EDGE_READ	BIT(31)
8558c2ecf20Sopenharmony_ci
8568c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_RATE18_06		0x0830
8578c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_RATE54_24		0x0834
8588c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_CCK1_55_MCS32	0x0838
8598c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_MCS03_MCS00	0x083c
8608c2ecf20Sopenharmony_ci
8618c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_LSSI_PARM		0x0840
8628c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_LSSI_PARM		0x0844
8638c2ecf20Sopenharmony_ci#define  FPGA0_LSSI_PARM_ADDR_SHIFT	20
8648c2ecf20Sopenharmony_ci#define  FPGA0_LSSI_PARM_ADDR_MASK	0x0ff00000
8658c2ecf20Sopenharmony_ci#define  FPGA0_LSSI_PARM_DATA_MASK	0x000fffff
8668c2ecf20Sopenharmony_ci
8678c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_MCS07_MCS04	0x0848
8688c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_MCS11_MCS08	0x084c
8698c2ecf20Sopenharmony_ci
8708c2ecf20Sopenharmony_ci#define REG_FPGA0_XCD_SWITCH_CTRL	0x085c
8718c2ecf20Sopenharmony_ci
8728c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_RF_INT_OE		0x0860	/* RF Channel switch */
8738c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_RF_INT_OE		0x0864
8748c2ecf20Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_AB_OPEN	0x000
8758c2ecf20Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_A		BIT(8)
8768c2ecf20Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_B		BIT(9)
8778c2ecf20Sopenharmony_ci#define  FPGA0_INT_OE_ANTENNA_MASK	(FPGA0_INT_OE_ANTENNA_A | \
8788c2ecf20Sopenharmony_ci					 FPGA0_INT_OE_ANTENNA_B)
8798c2ecf20Sopenharmony_ci
8808c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_MCS15_MCS12	0x0868
8818c2ecf20Sopenharmony_ci#define REG_TX_AGC_B_CCK11_A_CCK2_11	0x086c
8828c2ecf20Sopenharmony_ci
8838c2ecf20Sopenharmony_ci#define REG_FPGA0_XAB_RF_SW_CTRL	0x0870
8848c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_RF_SW_CTRL		0x0870	/* 16 bit */
8858c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_RF_SW_CTRL		0x0872	/* 16 bit */
8868c2ecf20Sopenharmony_ci#define REG_FPGA0_XCD_RF_SW_CTRL	0x0874
8878c2ecf20Sopenharmony_ci#define REG_FPGA0_XC_RF_SW_CTRL		0x0874	/* 16 bit */
8888c2ecf20Sopenharmony_ci#define REG_FPGA0_XD_RF_SW_CTRL		0x0876	/* 16 bit */
8898c2ecf20Sopenharmony_ci#define  FPGA0_RF_3WIRE_DATA		BIT(0)
8908c2ecf20Sopenharmony_ci#define  FPGA0_RF_3WIRE_CLOC		BIT(1)
8918c2ecf20Sopenharmony_ci#define  FPGA0_RF_3WIRE_LOAD		BIT(2)
8928c2ecf20Sopenharmony_ci#define  FPGA0_RF_3WIRE_RW		BIT(3)
8938c2ecf20Sopenharmony_ci#define  FPGA0_RF_3WIRE_MASK		0xf
8948c2ecf20Sopenharmony_ci#define  FPGA0_RF_RFENV			BIT(4)
8958c2ecf20Sopenharmony_ci#define  FPGA0_RF_TRSW			BIT(5)	/* Useless now */
8968c2ecf20Sopenharmony_ci#define  FPGA0_RF_TRSWB			BIT(6)
8978c2ecf20Sopenharmony_ci#define  FPGA0_RF_ANTSW			BIT(8)
8988c2ecf20Sopenharmony_ci#define  FPGA0_RF_ANTSWB		BIT(9)
8998c2ecf20Sopenharmony_ci#define  FPGA0_RF_PAPE			BIT(10)
9008c2ecf20Sopenharmony_ci#define  FPGA0_RF_PAPE5G		BIT(11)
9018c2ecf20Sopenharmony_ci#define  FPGA0_RF_BD_CTRL_SHIFT		16
9028c2ecf20Sopenharmony_ci
9038c2ecf20Sopenharmony_ci#define REG_FPGA0_XAB_RF_PARM		0x0878	/* Antenna select path in ODM */
9048c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_RF_PARM		0x0878	/* 16 bit */
9058c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_RF_PARM		0x087a	/* 16 bit */
9068c2ecf20Sopenharmony_ci#define REG_FPGA0_XCD_RF_PARM		0x087c
9078c2ecf20Sopenharmony_ci#define REG_FPGA0_XC_RF_PARM		0x087c	/* 16 bit */
9088c2ecf20Sopenharmony_ci#define REG_FPGA0_XD_RF_PARM		0x087e	/* 16 bit */
9098c2ecf20Sopenharmony_ci#define  FPGA0_RF_PARM_RFA_ENABLE	BIT(1)
9108c2ecf20Sopenharmony_ci#define  FPGA0_RF_PARM_RFB_ENABLE	BIT(17)
9118c2ecf20Sopenharmony_ci#define  FPGA0_RF_PARM_CLK_GATE		BIT(31)
9128c2ecf20Sopenharmony_ci
9138c2ecf20Sopenharmony_ci#define REG_FPGA0_ANALOG1		0x0880
9148c2ecf20Sopenharmony_ci#define REG_FPGA0_ANALOG2		0x0884
9158c2ecf20Sopenharmony_ci#define  FPGA0_ANALOG2_20MHZ		BIT(10)
9168c2ecf20Sopenharmony_ci#define REG_FPGA0_ANALOG3		0x0888
9178c2ecf20Sopenharmony_ci#define REG_FPGA0_ANALOG4		0x088c
9188c2ecf20Sopenharmony_ci
9198c2ecf20Sopenharmony_ci#define REG_NHM_TH9_TH10_8723B		0x0890
9208c2ecf20Sopenharmony_ci#define REG_NHM_TIMER_8723B		0x0894
9218c2ecf20Sopenharmony_ci#define REG_NHM_TH3_TO_TH0_8723B	0x0898
9228c2ecf20Sopenharmony_ci#define REG_NHM_TH7_TO_TH4_8723B	0x089c
9238c2ecf20Sopenharmony_ci
9248c2ecf20Sopenharmony_ci#define REG_FPGA0_XA_LSSI_READBACK	0x08a0	/* Tranceiver LSSI Readback */
9258c2ecf20Sopenharmony_ci#define REG_FPGA0_XB_LSSI_READBACK	0x08a4
9268c2ecf20Sopenharmony_ci#define REG_HSPI_XA_READBACK		0x08b8	/* Transceiver A HSPI read */
9278c2ecf20Sopenharmony_ci#define REG_HSPI_XB_READBACK		0x08bc	/* Transceiver B HSPI read */
9288c2ecf20Sopenharmony_ci
9298c2ecf20Sopenharmony_ci#define REG_FPGA1_RF_MODE		0x0900
9308c2ecf20Sopenharmony_ci
9318c2ecf20Sopenharmony_ci#define REG_FPGA1_TX_INFO		0x090c
9328c2ecf20Sopenharmony_ci#define REG_DPDT_CTRL			0x092c	/* 8723BU */
9338c2ecf20Sopenharmony_ci#define REG_RFE_CTRL_ANTA_SRC		0x0930	/* 8723BU */
9348c2ecf20Sopenharmony_ci#define REG_RFE_PATH_SELECT		0x0940	/* 8723BU */
9358c2ecf20Sopenharmony_ci#define REG_RFE_BUFFER			0x0944	/* 8723BU */
9368c2ecf20Sopenharmony_ci#define REG_S0S1_PATH_SWITCH		0x0948	/* 8723BU */
9378c2ecf20Sopenharmony_ci
9388c2ecf20Sopenharmony_ci#define REG_CCK0_SYSTEM			0x0a00
9398c2ecf20Sopenharmony_ci#define  CCK0_SIDEBAND			BIT(4)
9408c2ecf20Sopenharmony_ci
9418c2ecf20Sopenharmony_ci#define REG_CCK0_AFE_SETTING		0x0a04
9428c2ecf20Sopenharmony_ci#define  CCK0_AFE_RX_MASK		0x0f000000
9438c2ecf20Sopenharmony_ci#define  CCK0_AFE_RX_ANT_AB		BIT(24)
9448c2ecf20Sopenharmony_ci#define  CCK0_AFE_RX_ANT_A		0
9458c2ecf20Sopenharmony_ci#define  CCK0_AFE_RX_ANT_B		(BIT(24) | BIT(26))
9468c2ecf20Sopenharmony_ci
9478c2ecf20Sopenharmony_ci#define REG_CONFIG_ANT_A		0x0b68
9488c2ecf20Sopenharmony_ci#define REG_CONFIG_ANT_B		0x0b6c
9498c2ecf20Sopenharmony_ci
9508c2ecf20Sopenharmony_ci#define REG_OFDM0_TRX_PATH_ENABLE	0x0c04
9518c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_RX_MASK		0x0f
9528c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_RX_A		BIT(0)
9538c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_RX_B		BIT(1)
9548c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_RX_C		BIT(2)
9558c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_RX_D		BIT(3)
9568c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_TX_MASK		0xf0
9578c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_TX_A		BIT(4)
9588c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_TX_B		BIT(5)
9598c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_TX_C		BIT(6)
9608c2ecf20Sopenharmony_ci#define OFDM_RF_PATH_TX_D		BIT(7)
9618c2ecf20Sopenharmony_ci
9628c2ecf20Sopenharmony_ci#define REG_OFDM0_TR_MUX_PAR		0x0c08
9638c2ecf20Sopenharmony_ci
9648c2ecf20Sopenharmony_ci#define REG_OFDM0_FA_RSTC		0x0c0c
9658c2ecf20Sopenharmony_ci
9668c2ecf20Sopenharmony_ci#define REG_OFDM0_XA_RX_IQ_IMBALANCE	0x0c14
9678c2ecf20Sopenharmony_ci#define REG_OFDM0_XB_RX_IQ_IMBALANCE	0x0c1c
9688c2ecf20Sopenharmony_ci
9698c2ecf20Sopenharmony_ci#define REG_OFDM0_ENERGY_CCA_THRES	0x0c4c
9708c2ecf20Sopenharmony_ci
9718c2ecf20Sopenharmony_ci#define REG_OFDM0_RX_D_SYNC_PATH	0x0c40
9728c2ecf20Sopenharmony_ci#define  OFDM0_SYNC_PATH_NOTCH_FILTER	BIT(1)
9738c2ecf20Sopenharmony_ci
9748c2ecf20Sopenharmony_ci#define REG_OFDM0_XA_AGC_CORE1		0x0c50
9758c2ecf20Sopenharmony_ci#define REG_OFDM0_XA_AGC_CORE2		0x0c54
9768c2ecf20Sopenharmony_ci#define REG_OFDM0_XB_AGC_CORE1		0x0c58
9778c2ecf20Sopenharmony_ci#define REG_OFDM0_XB_AGC_CORE2		0x0c5c
9788c2ecf20Sopenharmony_ci#define REG_OFDM0_XC_AGC_CORE1		0x0c60
9798c2ecf20Sopenharmony_ci#define REG_OFDM0_XC_AGC_CORE2		0x0c64
9808c2ecf20Sopenharmony_ci#define REG_OFDM0_XD_AGC_CORE1		0x0c68
9818c2ecf20Sopenharmony_ci#define REG_OFDM0_XD_AGC_CORE2		0x0c6c
9828c2ecf20Sopenharmony_ci#define  OFDM0_X_AGC_CORE1_IGI_MASK	0x0000007F
9838c2ecf20Sopenharmony_ci
9848c2ecf20Sopenharmony_ci#define REG_OFDM0_AGC_PARM1		0x0c70
9858c2ecf20Sopenharmony_ci
9868c2ecf20Sopenharmony_ci#define REG_OFDM0_AGCR_SSI_TABLE	0x0c78
9878c2ecf20Sopenharmony_ci
9888c2ecf20Sopenharmony_ci#define REG_OFDM0_XA_TX_IQ_IMBALANCE	0x0c80
9898c2ecf20Sopenharmony_ci#define REG_OFDM0_XB_TX_IQ_IMBALANCE	0x0c88
9908c2ecf20Sopenharmony_ci#define REG_OFDM0_XC_TX_IQ_IMBALANCE	0x0c90
9918c2ecf20Sopenharmony_ci#define REG_OFDM0_XD_TX_IQ_IMBALANCE	0x0c98
9928c2ecf20Sopenharmony_ci
9938c2ecf20Sopenharmony_ci#define REG_OFDM0_XC_TX_AFE		0x0c94
9948c2ecf20Sopenharmony_ci#define REG_OFDM0_XD_TX_AFE		0x0c9c
9958c2ecf20Sopenharmony_ci
9968c2ecf20Sopenharmony_ci#define REG_OFDM0_RX_IQ_EXT_ANTA	0x0ca0
9978c2ecf20Sopenharmony_ci
9988c2ecf20Sopenharmony_ci/* 8723bu */
9998c2ecf20Sopenharmony_ci#define REG_OFDM0_TX_PSDO_NOISE_WEIGHT	0x0ce4
10008c2ecf20Sopenharmony_ci
10018c2ecf20Sopenharmony_ci#define REG_OFDM1_LSTF			0x0d00
10028c2ecf20Sopenharmony_ci#define  OFDM_LSTF_PRIME_CH_LOW		BIT(10)
10038c2ecf20Sopenharmony_ci#define  OFDM_LSTF_PRIME_CH_HIGH	BIT(11)
10048c2ecf20Sopenharmony_ci#define  OFDM_LSTF_PRIME_CH_MASK	(OFDM_LSTF_PRIME_CH_LOW | \
10058c2ecf20Sopenharmony_ci					 OFDM_LSTF_PRIME_CH_HIGH)
10068c2ecf20Sopenharmony_ci#define  OFDM_LSTF_CONTINUE_TX		BIT(28)
10078c2ecf20Sopenharmony_ci#define  OFDM_LSTF_SINGLE_CARRIER	BIT(29)
10088c2ecf20Sopenharmony_ci#define  OFDM_LSTF_SINGLE_TONE		BIT(30)
10098c2ecf20Sopenharmony_ci#define  OFDM_LSTF_MASK			0x70000000
10108c2ecf20Sopenharmony_ci
10118c2ecf20Sopenharmony_ci#define REG_OFDM1_TRX_PATH_ENABLE	0x0d04
10128c2ecf20Sopenharmony_ci
10138c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_RATE18_06		0x0e00
10148c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_RATE54_24		0x0e04
10158c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_CCK1_MCS32		0x0e08
10168c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_MCS03_MCS00	0x0e10
10178c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_MCS07_MCS04	0x0e14
10188c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_MCS11_MCS08	0x0e18
10198c2ecf20Sopenharmony_ci#define REG_TX_AGC_A_MCS15_MCS12	0x0e1c
10208c2ecf20Sopenharmony_ci
10218c2ecf20Sopenharmony_ci#define REG_FPGA0_IQK			0x0e28
10228c2ecf20Sopenharmony_ci
10238c2ecf20Sopenharmony_ci#define REG_TX_IQK_TONE_A		0x0e30
10248c2ecf20Sopenharmony_ci#define REG_RX_IQK_TONE_A		0x0e34
10258c2ecf20Sopenharmony_ci#define REG_TX_IQK_PI_A			0x0e38
10268c2ecf20Sopenharmony_ci#define REG_RX_IQK_PI_A			0x0e3c
10278c2ecf20Sopenharmony_ci
10288c2ecf20Sopenharmony_ci#define REG_TX_IQK			0x0e40
10298c2ecf20Sopenharmony_ci#define REG_RX_IQK			0x0e44
10308c2ecf20Sopenharmony_ci#define REG_IQK_AGC_PTS			0x0e48
10318c2ecf20Sopenharmony_ci#define REG_IQK_AGC_RSP			0x0e4c
10328c2ecf20Sopenharmony_ci#define REG_TX_IQK_TONE_B		0x0e50
10338c2ecf20Sopenharmony_ci#define REG_RX_IQK_TONE_B		0x0e54
10348c2ecf20Sopenharmony_ci#define REG_TX_IQK_PI_B			0x0e58
10358c2ecf20Sopenharmony_ci#define REG_RX_IQK_PI_B			0x0e5c
10368c2ecf20Sopenharmony_ci#define REG_IQK_AGC_CONT		0x0e60
10378c2ecf20Sopenharmony_ci
10388c2ecf20Sopenharmony_ci#define REG_BLUETOOTH			0x0e6c
10398c2ecf20Sopenharmony_ci#define REG_RX_WAIT_CCA			0x0e70
10408c2ecf20Sopenharmony_ci#define REG_TX_CCK_RFON			0x0e74
10418c2ecf20Sopenharmony_ci#define REG_TX_CCK_BBON			0x0e78
10428c2ecf20Sopenharmony_ci#define REG_TX_OFDM_RFON		0x0e7c
10438c2ecf20Sopenharmony_ci#define REG_TX_OFDM_BBON		0x0e80
10448c2ecf20Sopenharmony_ci#define REG_TX_TO_RX			0x0e84
10458c2ecf20Sopenharmony_ci#define REG_TX_TO_TX			0x0e88
10468c2ecf20Sopenharmony_ci#define REG_RX_CCK			0x0e8c
10478c2ecf20Sopenharmony_ci
10488c2ecf20Sopenharmony_ci#define REG_TX_POWER_BEFORE_IQK_A	0x0e94
10498c2ecf20Sopenharmony_ci#define REG_TX_POWER_AFTER_IQK_A	0x0e9c
10508c2ecf20Sopenharmony_ci
10518c2ecf20Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_A	0x0ea0
10528c2ecf20Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_A_2	0x0ea4
10538c2ecf20Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_A	0x0ea8
10548c2ecf20Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_A_2	0x0eac
10558c2ecf20Sopenharmony_ci
10568c2ecf20Sopenharmony_ci#define REG_TX_POWER_BEFORE_IQK_B	0x0eb4
10578c2ecf20Sopenharmony_ci#define REG_TX_POWER_AFTER_IQK_B	0x0ebc
10588c2ecf20Sopenharmony_ci
10598c2ecf20Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_B	0x0ec0
10608c2ecf20Sopenharmony_ci#define REG_RX_POWER_BEFORE_IQK_B_2	0x0ec4
10618c2ecf20Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_B	0x0ec8
10628c2ecf20Sopenharmony_ci#define REG_RX_POWER_AFTER_IQK_B_2	0x0ecc
10638c2ecf20Sopenharmony_ci
10648c2ecf20Sopenharmony_ci#define REG_RX_OFDM			0x0ed0
10658c2ecf20Sopenharmony_ci#define REG_RX_WAIT_RIFS		0x0ed4
10668c2ecf20Sopenharmony_ci#define REG_RX_TO_RX			0x0ed8
10678c2ecf20Sopenharmony_ci#define REG_STANDBY			0x0edc
10688c2ecf20Sopenharmony_ci#define REG_SLEEP			0x0ee0
10698c2ecf20Sopenharmony_ci#define REG_PMPD_ANAEN			0x0eec
10708c2ecf20Sopenharmony_ci
10718c2ecf20Sopenharmony_ci#define REG_FW_START_ADDRESS		0x1000
10728c2ecf20Sopenharmony_ci
10738c2ecf20Sopenharmony_ci#define REG_USB_INFO			0xfe17
10748c2ecf20Sopenharmony_ci#define REG_USB_HIMR			0xfe38
10758c2ecf20Sopenharmony_ci#define  USB_HIMR_TIMEOUT2		BIT(31)
10768c2ecf20Sopenharmony_ci#define  USB_HIMR_TIMEOUT1		BIT(30)
10778c2ecf20Sopenharmony_ci#define  USB_HIMR_PSTIMEOUT		BIT(29)
10788c2ecf20Sopenharmony_ci#define  USB_HIMR_GTINT4		BIT(28)
10798c2ecf20Sopenharmony_ci#define  USB_HIMR_GTINT3		BIT(27)
10808c2ecf20Sopenharmony_ci#define  USB_HIMR_TXBCNERR		BIT(26)
10818c2ecf20Sopenharmony_ci#define  USB_HIMR_TXBCNOK		BIT(25)
10828c2ecf20Sopenharmony_ci#define  USB_HIMR_TSF_BIT32_TOGGLE	BIT(24)
10838c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDMAINT3		BIT(23)
10848c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDMAINT2		BIT(22)
10858c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDMAINT1		BIT(21)
10868c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDMAINT0		BIT(20)
10878c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDOK3		BIT(19)
10888c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDOK2		BIT(18)
10898c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDOK1		BIT(17)
10908c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDOK0		BIT(16)
10918c2ecf20Sopenharmony_ci#define  USB_HIMR_HSISR_IND		BIT(15)
10928c2ecf20Sopenharmony_ci#define  USB_HIMR_BCNDMAINT_E		BIT(14)
10938c2ecf20Sopenharmony_ci/* RSVD	BIT(13) */
10948c2ecf20Sopenharmony_ci#define  USB_HIMR_CTW_END		BIT(12)
10958c2ecf20Sopenharmony_ci/* RSVD	BIT(11) */
10968c2ecf20Sopenharmony_ci#define  USB_HIMR_C2HCMD		BIT(10)
10978c2ecf20Sopenharmony_ci#define  USB_HIMR_CPWM2			BIT(9)
10988c2ecf20Sopenharmony_ci#define  USB_HIMR_CPWM			BIT(8)
10998c2ecf20Sopenharmony_ci#define  USB_HIMR_HIGHDOK		BIT(7)	/*  High Queue DMA OK
11008c2ecf20Sopenharmony_ci						    Interrupt */
11018c2ecf20Sopenharmony_ci#define  USB_HIMR_MGNTDOK		BIT(6)	/*  Management Queue DMA OK
11028c2ecf20Sopenharmony_ci						    Interrupt */
11038c2ecf20Sopenharmony_ci#define  USB_HIMR_BKDOK			BIT(5)	/*  AC_BK DMA OK Interrupt */
11048c2ecf20Sopenharmony_ci#define  USB_HIMR_BEDOK			BIT(4)	/*  AC_BE DMA OK Interrupt */
11058c2ecf20Sopenharmony_ci#define  USB_HIMR_VIDOK			BIT(3)	/*  AC_VI DMA OK Interrupt */
11068c2ecf20Sopenharmony_ci#define  USB_HIMR_VODOK			BIT(2)	/*  AC_VO DMA Interrupt */
11078c2ecf20Sopenharmony_ci#define  USB_HIMR_RDU			BIT(1)	/*  Receive Descriptor
11088c2ecf20Sopenharmony_ci						    Unavailable */
11098c2ecf20Sopenharmony_ci#define  USB_HIMR_ROK			BIT(0)	/*  Receive DMA OK Interrupt */
11108c2ecf20Sopenharmony_ci
11118c2ecf20Sopenharmony_ci#define REG_USB_SPECIAL_OPTION		0xfe55
11128c2ecf20Sopenharmony_ci#define  USB_SPEC_USB_AGG_ENABLE	BIT(3)	/* Enable USB aggregation */
11138c2ecf20Sopenharmony_ci#define  USB_SPEC_INT_BULK_SELECT	BIT(4)	/* Use interrupt endpoint to
11148c2ecf20Sopenharmony_ci						   deliver interrupt packet.
11158c2ecf20Sopenharmony_ci						   0: Use int, 1: use bulk */
11168c2ecf20Sopenharmony_ci#define REG_USB_HRPWM			0xfe58
11178c2ecf20Sopenharmony_ci#define REG_USB_DMA_AGG_TO		0xfe5b
11188c2ecf20Sopenharmony_ci#define REG_USB_AGG_TIMEOUT		0xfe5c
11198c2ecf20Sopenharmony_ci#define REG_USB_AGG_THRESH		0xfe5d
11208c2ecf20Sopenharmony_ci
11218c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_VID		0xfe60	/* 0xfe60 - 0xfe61 */
11228c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_PID		0xfe62	/* 0xfe62 - 0xfe63 */
11238c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_OPTIONAL		0xfe64
11248c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_EP		0xfe65	/* 0xfe65 - 0xfe67 */
11258c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_EP_TX		0xfe66
11268c2ecf20Sopenharmony_ci#define  NORMAL_SIE_EP_TX_HIGH_MASK	0x000f
11278c2ecf20Sopenharmony_ci#define  NORMAL_SIE_EP_TX_NORMAL_MASK	0x00f0
11288c2ecf20Sopenharmony_ci#define  NORMAL_SIE_EP_TX_LOW_MASK	0x0f00
11298c2ecf20Sopenharmony_ci
11308c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_PHY		0xfe68	/* 0xfe68 - 0xfe6b */
11318c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_OPTIONAL2	0xfe6c
11328c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_GPS_EP		0xfe6d	/* RTL8723 only */
11338c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_MAC_ADDR		0xfe70	/* 0xfe70 - 0xfe75 */
11348c2ecf20Sopenharmony_ci#define REG_NORMAL_SIE_STRING		0xfe80	/* 0xfe80 - 0xfedf */
11358c2ecf20Sopenharmony_ci
11368c2ecf20Sopenharmony_ci/* RF6052 registers */
11378c2ecf20Sopenharmony_ci#define RF6052_REG_AC			0x00
11388c2ecf20Sopenharmony_ci#define RF6052_REG_IQADJ_G1		0x01
11398c2ecf20Sopenharmony_ci#define RF6052_REG_IQADJ_G2		0x02
11408c2ecf20Sopenharmony_ci#define RF6052_REG_BS_PA_APSET_G1_G4	0x03
11418c2ecf20Sopenharmony_ci#define RF6052_REG_BS_PA_APSET_G5_G8	0x04
11428c2ecf20Sopenharmony_ci#define RF6052_REG_POW_TRSW		0x05
11438c2ecf20Sopenharmony_ci#define RF6052_REG_GAIN_RX		0x06
11448c2ecf20Sopenharmony_ci#define RF6052_REG_GAIN_TX		0x07
11458c2ecf20Sopenharmony_ci#define RF6052_REG_TXM_IDAC		0x08
11468c2ecf20Sopenharmony_ci#define RF6052_REG_IPA_G		0x09
11478c2ecf20Sopenharmony_ci#define RF6052_REG_TXBIAS_G		0x0a
11488c2ecf20Sopenharmony_ci#define RF6052_REG_TXPA_AG		0x0b
11498c2ecf20Sopenharmony_ci#define RF6052_REG_IPA_A		0x0c
11508c2ecf20Sopenharmony_ci#define RF6052_REG_TXBIAS_A		0x0d
11518c2ecf20Sopenharmony_ci#define RF6052_REG_BS_PA_APSET_G9_G11	0x0e
11528c2ecf20Sopenharmony_ci#define RF6052_REG_BS_IQGEN		0x0f
11538c2ecf20Sopenharmony_ci#define RF6052_REG_MODE1		0x10
11548c2ecf20Sopenharmony_ci#define RF6052_REG_MODE2		0x11
11558c2ecf20Sopenharmony_ci#define RF6052_REG_RX_AGC_HP		0x12
11568c2ecf20Sopenharmony_ci#define RF6052_REG_TX_AGC		0x13
11578c2ecf20Sopenharmony_ci#define RF6052_REG_BIAS			0x14
11588c2ecf20Sopenharmony_ci#define RF6052_REG_IPA			0x15
11598c2ecf20Sopenharmony_ci#define RF6052_REG_TXBIAS		0x16
11608c2ecf20Sopenharmony_ci#define RF6052_REG_POW_ABILITY		0x17
11618c2ecf20Sopenharmony_ci#define RF6052_REG_MODE_AG		0x18	/* RF channel and BW switch */
11628c2ecf20Sopenharmony_ci#define  MODE_AG_CHANNEL_MASK		0x3ff
11638c2ecf20Sopenharmony_ci#define  MODE_AG_CHANNEL_20MHZ		BIT(10)
11648c2ecf20Sopenharmony_ci#define  MODE_AG_BW_MASK		(BIT(10) | BIT(11))
11658c2ecf20Sopenharmony_ci#define  MODE_AG_BW_20MHZ_8723B		(BIT(10) | BIT(11))
11668c2ecf20Sopenharmony_ci#define  MODE_AG_BW_40MHZ_8723B		BIT(10)
11678c2ecf20Sopenharmony_ci#define  MODE_AG_BW_80MHZ_8723B		0
11688c2ecf20Sopenharmony_ci
11698c2ecf20Sopenharmony_ci#define RF6052_REG_TOP			0x19
11708c2ecf20Sopenharmony_ci#define RF6052_REG_RX_G1		0x1a
11718c2ecf20Sopenharmony_ci#define RF6052_REG_RX_G2		0x1b
11728c2ecf20Sopenharmony_ci#define RF6052_REG_RX_BB2		0x1c
11738c2ecf20Sopenharmony_ci#define RF6052_REG_RX_BB1		0x1d
11748c2ecf20Sopenharmony_ci#define RF6052_REG_RCK1			0x1e
11758c2ecf20Sopenharmony_ci#define RF6052_REG_RCK2			0x1f
11768c2ecf20Sopenharmony_ci#define RF6052_REG_TX_G1		0x20
11778c2ecf20Sopenharmony_ci#define RF6052_REG_TX_G2		0x21
11788c2ecf20Sopenharmony_ci#define RF6052_REG_TX_G3		0x22
11798c2ecf20Sopenharmony_ci#define RF6052_REG_TX_BB1		0x23
11808c2ecf20Sopenharmony_ci#define RF6052_REG_T_METER		0x24
11818c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G1		0x25	/* RF TX Power control */
11828c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G2		0x26	/* RF TX Power control */
11838c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G3		0x27	/* RF TX Power control */
11848c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G4		0x28	/* RF TX Power control */
11858c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G5		0x29	/* RF TX Power control */
11868c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G6		0x2a	/* RF TX Power control */
11878c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G7		0x2b	/* RF TX Power control */
11888c2ecf20Sopenharmony_ci#define RF6052_REG_SYN_G8		0x2c	/* RF TX Power control */
11898c2ecf20Sopenharmony_ci
11908c2ecf20Sopenharmony_ci#define RF6052_REG_RCK_OS		0x30	/* RF TX PA control */
11918c2ecf20Sopenharmony_ci
11928c2ecf20Sopenharmony_ci#define RF6052_REG_TXPA_G1		0x31	/* RF TX PA control */
11938c2ecf20Sopenharmony_ci#define RF6052_REG_TXPA_G2		0x32	/* RF TX PA control */
11948c2ecf20Sopenharmony_ci#define RF6052_REG_TXPA_G3		0x33	/* RF TX PA control */
11958c2ecf20Sopenharmony_ci
11968c2ecf20Sopenharmony_ci/*
11978c2ecf20Sopenharmony_ci * NextGen regs: 8723BU
11988c2ecf20Sopenharmony_ci */
11998c2ecf20Sopenharmony_ci#define RF6052_REG_T_METER_8723B	0x42
12008c2ecf20Sopenharmony_ci#define RF6052_REG_UNKNOWN_43		0x43
12018c2ecf20Sopenharmony_ci#define RF6052_REG_UNKNOWN_55		0x55
12028c2ecf20Sopenharmony_ci#define RF6052_REG_UNKNOWN_56		0x56
12038c2ecf20Sopenharmony_ci#define RF6052_REG_S0S1			0xb0
12048c2ecf20Sopenharmony_ci#define RF6052_REG_UNKNOWN_DF		0xdf
12058c2ecf20Sopenharmony_ci#define RF6052_REG_UNKNOWN_ED		0xed
12068c2ecf20Sopenharmony_ci#define RF6052_REG_WE_LUT		0xef
1207