162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 262306a36Sopenharmony_ci/* Copyright(c) 2018-2019 Realtek Corporation 362306a36Sopenharmony_ci */ 462306a36Sopenharmony_ci 562306a36Sopenharmony_ci#ifndef __RTW_REG_DEF_H__ 662306a36Sopenharmony_ci#define __RTW_REG_DEF_H__ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#define REG_SYS_FUNC_EN 0x0002 962306a36Sopenharmony_ci#define BIT_FEN_EN_25_1 BIT(13) 1062306a36Sopenharmony_ci#define BIT_FEN_ELDR BIT(12) 1162306a36Sopenharmony_ci#define BIT_FEN_CPUEN BIT(2) 1262306a36Sopenharmony_ci#define BIT_FEN_BB_GLB_RST BIT(1) 1362306a36Sopenharmony_ci#define BIT_FEN_BB_RSTB BIT(0) 1462306a36Sopenharmony_ci#define BIT_R_DIS_PRST BIT(6) 1562306a36Sopenharmony_ci#define BIT_WLOCK_1C_B6 BIT(5) 1662306a36Sopenharmony_ci#define REG_SYS_PW_CTRL 0x0004 1762306a36Sopenharmony_ci#define BIT_PFM_WOWL BIT(3) 1862306a36Sopenharmony_ci#define REG_SYS_CLK_CTRL 0x0008 1962306a36Sopenharmony_ci#define BIT_CPU_CLK_EN BIT(14) 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci#define REG_SYS_CLKR 0x0008 2262306a36Sopenharmony_ci#define BIT_ANA8M BIT(1) 2362306a36Sopenharmony_ci#define BIT_WAKEPAD_EN BIT(3) 2462306a36Sopenharmony_ci#define BIT_LOADER_CLK_EN BIT(5) 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci#define REG_RSV_CTRL 0x001C 2762306a36Sopenharmony_ci#define DISABLE_PI 0x3 2862306a36Sopenharmony_ci#define ENABLE_PI 0x2 2962306a36Sopenharmony_ci#define BITS_RFC_DIRECT (BIT(31) | BIT(30)) 3062306a36Sopenharmony_ci#define BIT_WLMCU_IOIF BIT(0) 3162306a36Sopenharmony_ci#define REG_RF_CTRL 0x001F 3262306a36Sopenharmony_ci#define BIT_RF_SDM_RSTB BIT(2) 3362306a36Sopenharmony_ci#define BIT_RF_RSTB BIT(1) 3462306a36Sopenharmony_ci#define BIT_RF_EN BIT(0) 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci#define REG_AFE_CTRL1 0x0024 3762306a36Sopenharmony_ci#define BIT_MAC_CLK_SEL (BIT(20) | BIT(21)) 3862306a36Sopenharmony_ci#define REG_EFUSE_CTRL 0x0030 3962306a36Sopenharmony_ci#define BIT_EF_FLAG BIT(31) 4062306a36Sopenharmony_ci#define BIT_SHIFT_EF_ADDR 8 4162306a36Sopenharmony_ci#define BIT_MASK_EF_ADDR 0x3ff 4262306a36Sopenharmony_ci#define BIT_MASK_EF_DATA 0xff 4362306a36Sopenharmony_ci#define BITS_EF_ADDR (BIT_MASK_EF_ADDR << BIT_SHIFT_EF_ADDR) 4462306a36Sopenharmony_ci#define BITS_PLL 0xf0 4562306a36Sopenharmony_ci 4662306a36Sopenharmony_ci#define REG_AFE_XTAL_CTRL 0x24 4762306a36Sopenharmony_ci#define REG_AFE_PLL_CTRL 0x28 4862306a36Sopenharmony_ci#define REG_AFE_CTRL3 0x2c 4962306a36Sopenharmony_ci#define BIT_MASK_XTAL 0x00FFF000 5062306a36Sopenharmony_ci#define BIT_XTAL_GMP_BIT4 BIT(28) 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci#define REG_LDO_EFUSE_CTRL 0x0034 5362306a36Sopenharmony_ci#define BIT_MASK_EFUSE_BANK_SEL (BIT(8) | BIT(9)) 5462306a36Sopenharmony_ci 5562306a36Sopenharmony_ci#define BIT_LDO25_VOLTAGE_V25 0x03 5662306a36Sopenharmony_ci#define BIT_MASK_LDO25_VOLTAGE GENMASK(6, 4) 5762306a36Sopenharmony_ci#define BIT_SHIFT_LDO25_VOLTAGE 4 5862306a36Sopenharmony_ci#define BIT_LDO25_EN BIT(7) 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci#define REG_GPIO_MUXCFG 0x0040 6162306a36Sopenharmony_ci#define BIT_FSPI_EN BIT(19) 6262306a36Sopenharmony_ci#define BIT_EN_SIC BIT(12) 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci#define BIT_PO_BT_PTA_PINS BIT(9) 6562306a36Sopenharmony_ci#define BIT_BT_PTA_EN BIT(5) 6662306a36Sopenharmony_ci#define BIT_WLRFE_4_5_EN BIT(2) 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_ci#define REG_LED_CFG 0x004C 6962306a36Sopenharmony_ci#define BIT_LNAON_SEL_EN BIT(26) 7062306a36Sopenharmony_ci#define BIT_PAPE_SEL_EN BIT(25) 7162306a36Sopenharmony_ci#define BIT_DPDT_WL_SEL BIT(24) 7262306a36Sopenharmony_ci#define BIT_DPDT_SEL_EN BIT(23) 7362306a36Sopenharmony_ci#define REG_LEDCFG2 0x004E 7462306a36Sopenharmony_ci#define REG_PAD_CTRL1 0x0064 7562306a36Sopenharmony_ci#define BIT_BT_BTG_SEL BIT(31) 7662306a36Sopenharmony_ci#define BIT_PAPE_WLBT_SEL BIT(29) 7762306a36Sopenharmony_ci#define BIT_LNAON_WLBT_SEL BIT(28) 7862306a36Sopenharmony_ci#define BIT_BTGP_JTAG_EN BIT(24) 7962306a36Sopenharmony_ci#define BIT_BTGP_SPI_EN BIT(20) 8062306a36Sopenharmony_ci#define BIT_LED1DIS BIT(15) 8162306a36Sopenharmony_ci#define BIT_SW_DPDT_SEL_DATA BIT(0) 8262306a36Sopenharmony_ci#define REG_WL_BT_PWR_CTRL 0x0068 8362306a36Sopenharmony_ci#define BIT_BT_FUNC_EN BIT(18) 8462306a36Sopenharmony_ci#define BIT_BT_DIG_CLK_EN BIT(8) 8562306a36Sopenharmony_ci#define REG_SYS_SDIO_CTRL 0x0070 8662306a36Sopenharmony_ci#define BIT_DBG_GNT_WL_BT BIT(27) 8762306a36Sopenharmony_ci#define BIT_LTE_MUX_CTRL_PATH BIT(26) 8862306a36Sopenharmony_ci#define REG_HCI_OPT_CTRL 0x0074 8962306a36Sopenharmony_ci#define BIT_USB_SUS_DIS BIT(8) 9062306a36Sopenharmony_ci#define BIT_SDIO_PAD_E5 BIT(18) 9162306a36Sopenharmony_ci 9262306a36Sopenharmony_ci#define REG_AFE_CTRL_4 0x0078 9362306a36Sopenharmony_ci#define BIT_CK320M_AFE_EN BIT(4) 9462306a36Sopenharmony_ci#define BIT_EN_SYN BIT(15) 9562306a36Sopenharmony_ci 9662306a36Sopenharmony_ci#define REG_LDO_SWR_CTRL 0x007C 9762306a36Sopenharmony_ci#define LDO_SEL 0xC3 9862306a36Sopenharmony_ci#define SPS_SEL 0x83 9962306a36Sopenharmony_ci#define BIT_XTA1 BIT(29) 10062306a36Sopenharmony_ci#define BIT_XTA0 BIT(28) 10162306a36Sopenharmony_ci 10262306a36Sopenharmony_ci#define REG_MCUFW_CTRL 0x0080 10362306a36Sopenharmony_ci#define BIT_ANA_PORT_EN BIT(22) 10462306a36Sopenharmony_ci#define BIT_MAC_PORT_EN BIT(21) 10562306a36Sopenharmony_ci#define BIT_BOOT_FSPI_EN BIT(20) 10662306a36Sopenharmony_ci#define BIT_ROM_DLEN BIT(19) 10762306a36Sopenharmony_ci#define BIT_ROM_PGE GENMASK(18, 16) /* legacy only */ 10862306a36Sopenharmony_ci#define BIT_SHIFT_ROM_PGE 16 10962306a36Sopenharmony_ci#define BIT_FW_INIT_RDY BIT(15) 11062306a36Sopenharmony_ci#define BIT_FW_DW_RDY BIT(14) 11162306a36Sopenharmony_ci#define BIT_RPWM_TOGGLE BIT(7) 11262306a36Sopenharmony_ci#define BIT_RAM_DL_SEL BIT(7) /* legacy only */ 11362306a36Sopenharmony_ci#define BIT_DMEM_CHKSUM_OK BIT(6) 11462306a36Sopenharmony_ci#define BIT_WINTINI_RDY BIT(6) /* legacy only */ 11562306a36Sopenharmony_ci#define BIT_DMEM_DW_OK BIT(5) 11662306a36Sopenharmony_ci#define BIT_IMEM_CHKSUM_OK BIT(4) 11762306a36Sopenharmony_ci#define BIT_IMEM_DW_OK BIT(3) 11862306a36Sopenharmony_ci#define BIT_IMEM_BOOT_LOAD_CHECKSUM_OK BIT(2) 11962306a36Sopenharmony_ci#define BIT_FWDL_CHK_RPT BIT(2) /* legacy only */ 12062306a36Sopenharmony_ci#define BIT_MCUFWDL_RDY BIT(1) /* legacy only */ 12162306a36Sopenharmony_ci#define BIT_MCUFWDL_EN BIT(0) 12262306a36Sopenharmony_ci#define BIT_CHECK_SUM_OK (BIT(4) | BIT(6)) 12362306a36Sopenharmony_ci#define FW_READY (BIT_FW_INIT_RDY | BIT_FW_DW_RDY | \ 12462306a36Sopenharmony_ci BIT_IMEM_DW_OK | BIT_DMEM_DW_OK | \ 12562306a36Sopenharmony_ci BIT_CHECK_SUM_OK) 12662306a36Sopenharmony_ci#define FW_READY_LEGACY (BIT_MCUFWDL_RDY | BIT_FWDL_CHK_RPT | \ 12762306a36Sopenharmony_ci BIT_WINTINI_RDY | BIT_RAM_DL_SEL) 12862306a36Sopenharmony_ci#define FW_READY_MASK 0xffff 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci#define REG_MCU_TST_CFG 0x84 13162306a36Sopenharmony_ci#define VAL_FW_TRIGGER 0x1 13262306a36Sopenharmony_ci 13362306a36Sopenharmony_ci#define REG_PMC_DBG_CTRL1 0xa8 13462306a36Sopenharmony_ci#define BITS_PMC_BT_IQK_STS GENMASK(22, 21) 13562306a36Sopenharmony_ci 13662306a36Sopenharmony_ci#define REG_EFUSE_ACCESS 0x00CF 13762306a36Sopenharmony_ci#define EFUSE_ACCESS_ON 0x69 13862306a36Sopenharmony_ci#define EFUSE_ACCESS_OFF 0x00 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define REG_WLRF1 0x00EC 14162306a36Sopenharmony_ci#define REG_WIFI_BT_INFO 0x00AA 14262306a36Sopenharmony_ci#define BIT_BT_INT_EN BIT(15) 14362306a36Sopenharmony_ci#define REG_SYS_CFG1 0x00F0 14462306a36Sopenharmony_ci#define BIT_RTL_ID BIT(23) 14562306a36Sopenharmony_ci#define BIT_LDO BIT(24) 14662306a36Sopenharmony_ci#define BIT_RF_TYPE_ID BIT(27) 14762306a36Sopenharmony_ci#define BIT_SHIFT_VENDOR_ID 16 14862306a36Sopenharmony_ci#define BIT_MASK_VENDOR_ID 0xf 14962306a36Sopenharmony_ci#define BIT_VENDOR_ID(x) (((x) & BIT_MASK_VENDOR_ID) << BIT_SHIFT_VENDOR_ID) 15062306a36Sopenharmony_ci#define BITS_VENDOR_ID (BIT_MASK_VENDOR_ID << BIT_SHIFT_VENDOR_ID) 15162306a36Sopenharmony_ci#define BIT_CLEAR_VENDOR_ID(x) ((x) & (~BITS_VENDOR_ID)) 15262306a36Sopenharmony_ci#define BIT_GET_VENDOR_ID(x) (((x) >> BIT_SHIFT_VENDOR_ID) & BIT_MASK_VENDOR_ID) 15362306a36Sopenharmony_ci#define BIT_SHIFT_CHIP_VER 12 15462306a36Sopenharmony_ci#define BIT_MASK_CHIP_VER 0xf 15562306a36Sopenharmony_ci#define BIT_CHIP_VER(x) (((x) & BIT_MASK_CHIP_VER) << BIT_SHIFT_CHIP_VER) 15662306a36Sopenharmony_ci#define BITS_CHIP_VER (BIT_MASK_CHIP_VER << BIT_SHIFT_CHIP_VER) 15762306a36Sopenharmony_ci#define BIT_CLEAR_CHIP_VER(x) ((x) & (~BITS_CHIP_VER)) 15862306a36Sopenharmony_ci#define BIT_GET_CHIP_VER(x) (((x) >> BIT_SHIFT_CHIP_VER) & BIT_MASK_CHIP_VER) 15962306a36Sopenharmony_ci#define REG_SYS_STATUS1 0x00F4 16062306a36Sopenharmony_ci#define REG_SYS_STATUS2 0x00F8 16162306a36Sopenharmony_ci#define REG_SYS_CFG2 0x00FC 16262306a36Sopenharmony_ci#define REG_WLRF1 0x00EC 16362306a36Sopenharmony_ci#define BIT_WLRF1_BBRF_EN (BIT(24) | BIT(25) | BIT(26)) 16462306a36Sopenharmony_ci#define REG_CR 0x0100 16562306a36Sopenharmony_ci#define BIT_32K_CAL_TMR_EN BIT(10) 16662306a36Sopenharmony_ci#define BIT_MAC_SEC_EN BIT(9) 16762306a36Sopenharmony_ci#define BIT_ENSWBCN BIT(8) 16862306a36Sopenharmony_ci#define BIT_MACRXEN BIT(7) 16962306a36Sopenharmony_ci#define BIT_MACTXEN BIT(6) 17062306a36Sopenharmony_ci#define BIT_SCHEDULE_EN BIT(5) 17162306a36Sopenharmony_ci#define BIT_PROTOCOL_EN BIT(4) 17262306a36Sopenharmony_ci#define BIT_RXDMA_EN BIT(3) 17362306a36Sopenharmony_ci#define BIT_TXDMA_EN BIT(2) 17462306a36Sopenharmony_ci#define BIT_HCI_RXDMA_EN BIT(1) 17562306a36Sopenharmony_ci#define BIT_HCI_TXDMA_EN BIT(0) 17662306a36Sopenharmony_ci#define MAC_TRX_ENABLE (BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \ 17762306a36Sopenharmony_ci BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \ 17862306a36Sopenharmony_ci BIT_MACTXEN | BIT_MACRXEN) 17962306a36Sopenharmony_ci#define BIT_SHIFT_TXDMA_VOQ_MAP 4 18062306a36Sopenharmony_ci#define BIT_MASK_TXDMA_VOQ_MAP 0x3 18162306a36Sopenharmony_ci#define BIT_TXDMA_VOQ_MAP(x) \ 18262306a36Sopenharmony_ci (((x) & BIT_MASK_TXDMA_VOQ_MAP) << BIT_SHIFT_TXDMA_VOQ_MAP) 18362306a36Sopenharmony_ci#define BIT_SHIFT_TXDMA_VIQ_MAP 6 18462306a36Sopenharmony_ci#define BIT_MASK_TXDMA_VIQ_MAP 0x3 18562306a36Sopenharmony_ci#define BIT_TXDMA_VIQ_MAP(x) \ 18662306a36Sopenharmony_ci (((x) & BIT_MASK_TXDMA_VIQ_MAP) << BIT_SHIFT_TXDMA_VIQ_MAP) 18762306a36Sopenharmony_ci#define REG_TXDMA_PQ_MAP 0x010C 18862306a36Sopenharmony_ci#define BIT_RXDMA_ARBBW_EN BIT(0) 18962306a36Sopenharmony_ci#define BIT_RXSHFT_EN BIT(1) 19062306a36Sopenharmony_ci#define BIT_RXDMA_AGG_EN BIT(2) 19162306a36Sopenharmony_ci#define BIT_TXDMA_BW_EN BIT(3) 19262306a36Sopenharmony_ci#define BIT_SHIFT_TXDMA_BEQ_MAP 8 19362306a36Sopenharmony_ci#define BIT_MASK_TXDMA_BEQ_MAP 0x3 19462306a36Sopenharmony_ci#define BIT_TXDMA_BEQ_MAP(x) \ 19562306a36Sopenharmony_ci (((x) & BIT_MASK_TXDMA_BEQ_MAP) << BIT_SHIFT_TXDMA_BEQ_MAP) 19662306a36Sopenharmony_ci#define BIT_SHIFT_TXDMA_BKQ_MAP 10 19762306a36Sopenharmony_ci#define BIT_MASK_TXDMA_BKQ_MAP 0x3 19862306a36Sopenharmony_ci#define BIT_TXDMA_BKQ_MAP(x) \ 19962306a36Sopenharmony_ci (((x) & BIT_MASK_TXDMA_BKQ_MAP) << BIT_SHIFT_TXDMA_BKQ_MAP) 20062306a36Sopenharmony_ci#define BIT_SHIFT_TXDMA_MGQ_MAP 12 20162306a36Sopenharmony_ci#define BIT_MASK_TXDMA_MGQ_MAP 0x3 20262306a36Sopenharmony_ci#define BIT_TXDMA_MGQ_MAP(x) \ 20362306a36Sopenharmony_ci (((x) & BIT_MASK_TXDMA_MGQ_MAP) << BIT_SHIFT_TXDMA_MGQ_MAP) 20462306a36Sopenharmony_ci#define BIT_SHIFT_TXDMA_HIQ_MAP 14 20562306a36Sopenharmony_ci#define BIT_MASK_TXDMA_HIQ_MAP 0x3 20662306a36Sopenharmony_ci#define BIT_TXDMA_HIQ_MAP(x) \ 20762306a36Sopenharmony_ci (((x) & BIT_MASK_TXDMA_HIQ_MAP) << BIT_SHIFT_TXDMA_HIQ_MAP) 20862306a36Sopenharmony_ci#define BIT_SHIFT_TXSC_40M 4 20962306a36Sopenharmony_ci#define BIT_MASK_TXSC_40M 0xf 21062306a36Sopenharmony_ci#define BIT_TXSC_40M(x) \ 21162306a36Sopenharmony_ci (((x) & BIT_MASK_TXSC_40M) << BIT_SHIFT_TXSC_40M) 21262306a36Sopenharmony_ci#define BIT_SHIFT_TXSC_20M 0 21362306a36Sopenharmony_ci#define BIT_MASK_TXSC_20M 0xf 21462306a36Sopenharmony_ci#define BIT_TXSC_20M(x) \ 21562306a36Sopenharmony_ci (((x) & BIT_MASK_TXSC_20M) << BIT_SHIFT_TXSC_20M) 21662306a36Sopenharmony_ci#define BIT_SHIFT_MAC_CLK_SEL 20 21762306a36Sopenharmony_ci#define MAC_CLK_HW_DEF_80M 0 21862306a36Sopenharmony_ci#define MAC_CLK_HW_DEF_40M 1 21962306a36Sopenharmony_ci#define MAC_CLK_HW_DEF_20M 2 22062306a36Sopenharmony_ci#define MAC_CLK_SPEED 80 22162306a36Sopenharmony_ci 22262306a36Sopenharmony_ci#define REG_CR 0x0100 22362306a36Sopenharmony_ci#define REG_TRXFF_BNDY 0x0114 22462306a36Sopenharmony_ci#define REG_RXFF_BNDY 0x011C 22562306a36Sopenharmony_ci#define REG_FE1IMR 0x0120 22662306a36Sopenharmony_ci#define BIT_FS_RXDONE BIT(16) 22762306a36Sopenharmony_ci#define REG_PKTBUF_DBG_CTRL 0x0140 22862306a36Sopenharmony_ci#define REG_C2HEVT 0x01A0 22962306a36Sopenharmony_ci#define REG_MCUTST_1 0x01C0 23062306a36Sopenharmony_ci#define REG_MCUTST_II 0x01C4 23162306a36Sopenharmony_ci#define REG_WOWLAN_WAKE_REASON 0x01C7 23262306a36Sopenharmony_ci#define REG_HMETFR 0x01CC 23362306a36Sopenharmony_ci#define REG_HMEBOX0 0x01D0 23462306a36Sopenharmony_ci#define REG_HMEBOX1 0x01D4 23562306a36Sopenharmony_ci#define REG_HMEBOX2 0x01D8 23662306a36Sopenharmony_ci#define REG_HMEBOX3 0x01DC 23762306a36Sopenharmony_ci#define REG_HMEBOX0_EX 0x01F0 23862306a36Sopenharmony_ci#define REG_HMEBOX1_EX 0x01F4 23962306a36Sopenharmony_ci#define REG_HMEBOX2_EX 0x01F8 24062306a36Sopenharmony_ci#define REG_HMEBOX3_EX 0x01FC 24162306a36Sopenharmony_ci 24262306a36Sopenharmony_ci#define REG_RQPN 0x0200 24362306a36Sopenharmony_ci#define BIT_MASK_HPQ 0xff 24462306a36Sopenharmony_ci#define BIT_SHIFT_HPQ 0 24562306a36Sopenharmony_ci#define BIT_RQPN_HPQ(x) (((x) & BIT_MASK_HPQ) << BIT_SHIFT_HPQ) 24662306a36Sopenharmony_ci#define BIT_MASK_LPQ 0xff 24762306a36Sopenharmony_ci#define BIT_SHIFT_LPQ 8 24862306a36Sopenharmony_ci#define BIT_RQPN_LPQ(x) (((x) & BIT_MASK_LPQ) << BIT_SHIFT_LPQ) 24962306a36Sopenharmony_ci#define BIT_MASK_PUBQ 0xff 25062306a36Sopenharmony_ci#define BIT_SHIFT_PUBQ 16 25162306a36Sopenharmony_ci#define BIT_RQPN_PUBQ(x) (((x) & BIT_MASK_PUBQ) << BIT_SHIFT_PUBQ) 25262306a36Sopenharmony_ci#define BIT_RQPN_HLP(h, l, p) (BIT_LD_RQPN | BIT_RQPN_HPQ(h) | \ 25362306a36Sopenharmony_ci BIT_RQPN_LPQ(l) | BIT_RQPN_PUBQ(p)) 25462306a36Sopenharmony_ci 25562306a36Sopenharmony_ci#define REG_FIFOPAGE_CTRL_2 0x0204 25662306a36Sopenharmony_ci#define BIT_BCN_VALID_V1 BIT(15) 25762306a36Sopenharmony_ci#define BIT_MASK_BCN_HEAD_1_V1 0xfff 25862306a36Sopenharmony_ci#define REG_AUTO_LLT_V1 0x0208 25962306a36Sopenharmony_ci#define BIT_AUTO_INIT_LLT_V1 BIT(0) 26062306a36Sopenharmony_ci#define REG_DWBCN0_CTRL 0x0208 26162306a36Sopenharmony_ci#define BIT_BCN_VALID BIT(16) 26262306a36Sopenharmony_ci#define REG_TXDMA_OFFSET_CHK 0x020C 26362306a36Sopenharmony_ci#define BIT_DROP_DATA_EN BIT(9) 26462306a36Sopenharmony_ci#define REG_TXDMA_STATUS 0x0210 26562306a36Sopenharmony_ci#define BTI_PAGE_OVF BIT(2) 26662306a36Sopenharmony_ci 26762306a36Sopenharmony_ci#define REG_RQPN_NPQ 0x0214 26862306a36Sopenharmony_ci#define BIT_MASK_NPQ 0xff 26962306a36Sopenharmony_ci#define BIT_SHIFT_NPQ 0 27062306a36Sopenharmony_ci#define BIT_MASK_EPQ 0xff 27162306a36Sopenharmony_ci#define BIT_SHIFT_EPQ 16 27262306a36Sopenharmony_ci#define BIT_RQPN_NPQ(x) (((x) & BIT_MASK_NPQ) << BIT_SHIFT_NPQ) 27362306a36Sopenharmony_ci#define BIT_RQPN_EPQ(x) (((x) & BIT_MASK_EPQ) << BIT_SHIFT_EPQ) 27462306a36Sopenharmony_ci#define BIT_RQPN_NE(n, e) (BIT_RQPN_NPQ(n) | BIT_RQPN_EPQ(e)) 27562306a36Sopenharmony_ci 27662306a36Sopenharmony_ci#define REG_AUTO_LLT 0x0224 27762306a36Sopenharmony_ci#define BIT_AUTO_INIT_LLT BIT(16) 27862306a36Sopenharmony_ci#define REG_RQPN_CTRL_1 0x0228 27962306a36Sopenharmony_ci#define REG_RQPN_CTRL_2 0x022C 28062306a36Sopenharmony_ci#define BIT_LD_RQPN BIT(31) 28162306a36Sopenharmony_ci#define REG_FIFOPAGE_INFO_1 0x0230 28262306a36Sopenharmony_ci#define REG_FIFOPAGE_INFO_2 0x0234 28362306a36Sopenharmony_ci#define REG_FIFOPAGE_INFO_3 0x0238 28462306a36Sopenharmony_ci#define REG_FIFOPAGE_INFO_4 0x023C 28562306a36Sopenharmony_ci#define REG_FIFOPAGE_INFO_5 0x0240 28662306a36Sopenharmony_ci#define REG_H2C_HEAD 0x0244 28762306a36Sopenharmony_ci#define REG_H2C_TAIL 0x0248 28862306a36Sopenharmony_ci#define REG_H2C_READ_ADDR 0x024C 28962306a36Sopenharmony_ci#define REG_H2C_INFO 0x0254 29062306a36Sopenharmony_ci#define REG_RXDMA_AGG_PG_TH 0x0280 29162306a36Sopenharmony_ci#define BIT_RXDMA_AGG_PG_TH GENMASK(7, 0) 29262306a36Sopenharmony_ci#define BIT_DMA_AGG_TO_V1 GENMASK(15, 8) 29362306a36Sopenharmony_ci#define BIT_EN_PRE_CALC BIT(29) 29462306a36Sopenharmony_ci#define REG_RXPKT_NUM 0x0284 29562306a36Sopenharmony_ci#define BIT_RXDMA_REQ BIT(19) 29662306a36Sopenharmony_ci#define BIT_RW_RELEASE BIT(18) 29762306a36Sopenharmony_ci#define BIT_RXDMA_IDLE BIT(17) 29862306a36Sopenharmony_ci#define REG_RXDMA_STATUS 0x0288 29962306a36Sopenharmony_ci#define REG_RXDMA_DPR 0x028C 30062306a36Sopenharmony_ci#define REG_RXDMA_MODE 0x0290 30162306a36Sopenharmony_ci#define BIT_DMA_MODE BIT(1) 30262306a36Sopenharmony_ci#define REG_RXPKTNUM 0x02B0 30362306a36Sopenharmony_ci 30462306a36Sopenharmony_ci#define REG_INT_MIG 0x0304 30562306a36Sopenharmony_ci#define REG_HCI_MIX_CFG 0x03FC 30662306a36Sopenharmony_ci#define BIT_PCIE_EMAC_PDN_AUX_TO_FAST_CLK BIT(26) 30762306a36Sopenharmony_ci 30862306a36Sopenharmony_ci#define REG_BCNQ_INFO 0x0418 30962306a36Sopenharmony_ci#define BIT_MGQ_CPU_EMPTY BIT(24) 31062306a36Sopenharmony_ci#define REG_FWHW_TXQ_CTRL 0x0420 31162306a36Sopenharmony_ci#define BIT_EN_BCNQ_DL BIT(22) 31262306a36Sopenharmony_ci#define BIT_EN_WR_FREE_TAIL BIT(20) 31362306a36Sopenharmony_ci#define REG_HWSEQ_CTRL 0x0423 31462306a36Sopenharmony_ci 31562306a36Sopenharmony_ci#define REG_BCNQ_BDNY_V1 0x0424 31662306a36Sopenharmony_ci#define REG_BCNQ_BDNY 0x0424 31762306a36Sopenharmony_ci#define REG_MGQ_BDNY 0x0425 31862306a36Sopenharmony_ci#define REG_LIFETIME_EN 0x0426 31962306a36Sopenharmony_ci#define BIT_BA_PARSER_EN BIT(5) 32062306a36Sopenharmony_ci#define REG_SPEC_SIFS 0x0428 32162306a36Sopenharmony_ci#define REG_RETRY_LIMIT 0x042a 32262306a36Sopenharmony_ci#define REG_DARFRC 0x0430 32362306a36Sopenharmony_ci#define REG_DARFRCH 0x0434 32462306a36Sopenharmony_ci#define REG_RARFRCH 0x043C 32562306a36Sopenharmony_ci#define REG_RRSR 0x0440 32662306a36Sopenharmony_ci#define BITS_RRSR_RSC GENMASK(22, 21) 32762306a36Sopenharmony_ci#define REG_ARFR0 0x0444 32862306a36Sopenharmony_ci#define REG_ARFRH0 0x0448 32962306a36Sopenharmony_ci#define REG_ARFR1_V1 0x044C 33062306a36Sopenharmony_ci#define REG_ARFRH1_V1 0x0450 33162306a36Sopenharmony_ci#define REG_CCK_CHECK 0x0454 33262306a36Sopenharmony_ci#define BIT_CHECK_CCK_EN BIT(7) 33362306a36Sopenharmony_ci#define REG_AMPDU_MAX_TIME_V1 0x0455 33462306a36Sopenharmony_ci#define REG_BCNQ1_BDNY_V1 0x0456 33562306a36Sopenharmony_ci#define REG_AMPDU_MAX_TIME 0x0456 33662306a36Sopenharmony_ci#define REG_WMAC_LBK_BF_HD 0x045D 33762306a36Sopenharmony_ci#define REG_TX_HANG_CTRL 0x045E 33862306a36Sopenharmony_ci#define BIT_EN_GNT_BT_AWAKE BIT(3) 33962306a36Sopenharmony_ci#define BIT_EN_EOF_V1 BIT(2) 34062306a36Sopenharmony_ci#define REG_DATA_SC 0x0483 34162306a36Sopenharmony_ci#define REG_ARFR4 0x049C 34262306a36Sopenharmony_ci#define BIT_WL_RFK BIT(0) 34362306a36Sopenharmony_ci#define REG_ARFRH4 0x04A0 34462306a36Sopenharmony_ci#define REG_ARFR5 0x04A4 34562306a36Sopenharmony_ci#define REG_ARFRH5 0x04A8 34662306a36Sopenharmony_ci#define REG_SW_AMPDU_BURST_MODE_CTRL 0x04BC 34762306a36Sopenharmony_ci#define BIT_PRE_TX_CMD BIT(6) 34862306a36Sopenharmony_ci#define REG_QUEUE_CTRL 0x04C6 34962306a36Sopenharmony_ci#define BIT_PTA_WL_TX_EN BIT(4) 35062306a36Sopenharmony_ci#define BIT_PTA_EDCCA_EN BIT(5) 35162306a36Sopenharmony_ci#define REG_SINGLE_AMPDU_CTRL 0x04C7 35262306a36Sopenharmony_ci#define BIT_EN_SINGLE_APMDU BIT(7) 35362306a36Sopenharmony_ci#define REG_PROT_MODE_CTRL 0x04C8 35462306a36Sopenharmony_ci#define REG_MAX_AGGR_NUM 0x04CA 35562306a36Sopenharmony_ci#define REG_BAR_MODE_CTRL 0x04CC 35662306a36Sopenharmony_ci#define REG_PRECNT_CTRL 0x04E5 35762306a36Sopenharmony_ci#define BIT_BTCCA_CTRL (BIT(0) | BIT(1)) 35862306a36Sopenharmony_ci#define BIT_EN_PRECNT BIT(11) 35962306a36Sopenharmony_ci#define REG_DUMMY_PAGE4_V1 0x04FC 36062306a36Sopenharmony_ci 36162306a36Sopenharmony_ci#define REG_EDCA_VO_PARAM 0x0500 36262306a36Sopenharmony_ci#define REG_EDCA_VI_PARAM 0x0504 36362306a36Sopenharmony_ci#define REG_EDCA_BE_PARAM 0x0508 36462306a36Sopenharmony_ci#define REG_EDCA_BK_PARAM 0x050C 36562306a36Sopenharmony_ci#define BIT_MASK_TXOP_LMT GENMASK(26, 16) 36662306a36Sopenharmony_ci#define BIT_MASK_CWMAX GENMASK(15, 12) 36762306a36Sopenharmony_ci#define BIT_MASK_CWMIN GENMASK(11, 8) 36862306a36Sopenharmony_ci#define BIT_MASK_AIFS GENMASK(7, 0) 36962306a36Sopenharmony_ci#define REG_PIFS 0x0512 37062306a36Sopenharmony_ci#define REG_SIFS 0x0514 37162306a36Sopenharmony_ci#define BIT_SHIFT_SIFS_OFDM_CTX 8 37262306a36Sopenharmony_ci#define BIT_SHIFT_SIFS_CCK_TRX 16 37362306a36Sopenharmony_ci#define BIT_SHIFT_SIFS_OFDM_TRX 24 37462306a36Sopenharmony_ci#define REG_AGGR_BREAK_TIME 0x051A 37562306a36Sopenharmony_ci#define REG_SLOT 0x051B 37662306a36Sopenharmony_ci#define REG_TX_PTCL_CTRL 0x0520 37762306a36Sopenharmony_ci#define BIT_DIS_EDCCA BIT(15) 37862306a36Sopenharmony_ci#define BIT_SIFS_BK_EN BIT(12) 37962306a36Sopenharmony_ci#define REG_TXPAUSE 0x0522 38062306a36Sopenharmony_ci#define BIT_AC_QUEUE GENMASK(7, 0) 38162306a36Sopenharmony_ci#define BIT_HIGH_QUEUE BIT(5) 38262306a36Sopenharmony_ci#define REG_RD_CTRL 0x0524 38362306a36Sopenharmony_ci#define BIT_EDCCA_MSK_CNTDOWN_EN BIT(11) 38462306a36Sopenharmony_ci#define BIT_DIS_TXOP_CFE BIT(10) 38562306a36Sopenharmony_ci#define BIT_DIS_LSIG_CFE BIT(9) 38662306a36Sopenharmony_ci#define BIT_DIS_STBC_CFE BIT(8) 38762306a36Sopenharmony_ci#define REG_TBTT_PROHIBIT 0x0540 38862306a36Sopenharmony_ci#define BIT_SHIFT_TBTT_HOLD_TIME_AP 8 38962306a36Sopenharmony_ci#define REG_RD_NAV_NXT 0x0544 39062306a36Sopenharmony_ci#define REG_NAV_PROT_LEN 0x0546 39162306a36Sopenharmony_ci#define REG_BCN_CTRL 0x0550 39262306a36Sopenharmony_ci#define BIT_DIS_TSF_UDT BIT(4) 39362306a36Sopenharmony_ci#define BIT_EN_BCN_FUNCTION BIT(3) 39462306a36Sopenharmony_ci#define BIT_EN_TXBCN_RPT BIT(2) 39562306a36Sopenharmony_ci#define REG_BCN_CTRL_CLINT0 0x0551 39662306a36Sopenharmony_ci#define REG_DRVERLYINT 0x0558 39762306a36Sopenharmony_ci#define REG_BCNDMATIM 0x0559 39862306a36Sopenharmony_ci#define REG_ATIMWND 0x055A 39962306a36Sopenharmony_ci#define REG_USTIME_TSF 0x055C 40062306a36Sopenharmony_ci#define REG_BCN_MAX_ERR 0x055D 40162306a36Sopenharmony_ci#define REG_RXTSF_OFFSET_CCK 0x055E 40262306a36Sopenharmony_ci#define REG_MISC_CTRL 0x0577 40362306a36Sopenharmony_ci#define BIT_EN_FREE_CNT BIT(3) 40462306a36Sopenharmony_ci#define BIT_DIS_SECOND_CCA (BIT(0) | BIT(1)) 40562306a36Sopenharmony_ci#define REG_HIQ_NO_LMT_EN 0x5A7 40662306a36Sopenharmony_ci#define REG_DTIM_COUNTER_ROOT 0x5A8 40762306a36Sopenharmony_ci#define BIT_HIQ_NO_LMT_EN_ROOT BIT(0) 40862306a36Sopenharmony_ci#define REG_TIMER0_SRC_SEL 0x05B4 40962306a36Sopenharmony_ci#define BIT_TSFT_SEL_TIMER0 (BIT(4) | BIT(5) | BIT(6)) 41062306a36Sopenharmony_ci 41162306a36Sopenharmony_ci#define REG_TCR 0x0604 41262306a36Sopenharmony_ci#define BIT_PWRMGT_HWDATA_EN BIT(7) 41362306a36Sopenharmony_ci#define BIT_TCR_UPDATE_TIMIE BIT(5) 41462306a36Sopenharmony_ci#define BIT_TCR_UPDATE_HGQMD BIT(4) 41562306a36Sopenharmony_ci#define REG_RCR 0x0608 41662306a36Sopenharmony_ci#define BIT_APP_FCS BIT(31) 41762306a36Sopenharmony_ci#define BIT_APP_MIC BIT(30) 41862306a36Sopenharmony_ci#define BIT_APP_ICV BIT(29) 41962306a36Sopenharmony_ci#define BIT_APP_PHYSTS BIT(28) 42062306a36Sopenharmony_ci#define BIT_APP_BASSN BIT(27) 42162306a36Sopenharmony_ci#define BIT_VHT_DACK BIT(26) 42262306a36Sopenharmony_ci#define BIT_TCPOFLD_EN BIT(25) 42362306a36Sopenharmony_ci#define BIT_ENMBID BIT(24) 42462306a36Sopenharmony_ci#define BIT_LSIGEN BIT(23) 42562306a36Sopenharmony_ci#define BIT_MFBEN BIT(22) 42662306a36Sopenharmony_ci#define BIT_DISCHKPPDLLEN BIT(21) 42762306a36Sopenharmony_ci#define BIT_PKTCTL_DLEN BIT(20) 42862306a36Sopenharmony_ci#define BIT_DISGCLK BIT(19) 42962306a36Sopenharmony_ci#define BIT_TIM_PARSER_EN BIT(18) 43062306a36Sopenharmony_ci#define BIT_BC_MD_EN BIT(17) 43162306a36Sopenharmony_ci#define BIT_UC_MD_EN BIT(16) 43262306a36Sopenharmony_ci#define BIT_RXSK_PERPKT BIT(15) 43362306a36Sopenharmony_ci#define BIT_HTC_LOC_CTRL BIT(14) 43462306a36Sopenharmony_ci#define BIT_RPFM_CAM_ENABLE BIT(12) 43562306a36Sopenharmony_ci#define BIT_TA_BCN BIT(11) 43662306a36Sopenharmony_ci#define BIT_RCR_ADF BIT(11) 43762306a36Sopenharmony_ci#define BIT_DISDECMYPKT BIT(10) 43862306a36Sopenharmony_ci#define BIT_AICV BIT(9) 43962306a36Sopenharmony_ci#define BIT_ACRC32 BIT(8) 44062306a36Sopenharmony_ci#define BIT_CBSSID_BCN BIT(7) 44162306a36Sopenharmony_ci#define BIT_CBSSID_DATA BIT(6) 44262306a36Sopenharmony_ci#define BIT_APWRMGT BIT(5) 44362306a36Sopenharmony_ci#define BIT_ADD3 BIT(4) 44462306a36Sopenharmony_ci#define BIT_AB BIT(3) 44562306a36Sopenharmony_ci#define BIT_AM BIT(2) 44662306a36Sopenharmony_ci#define BIT_APM BIT(1) 44762306a36Sopenharmony_ci#define BIT_AAP BIT(0) 44862306a36Sopenharmony_ci#define REG_RX_PKT_LIMIT 0x060C 44962306a36Sopenharmony_ci#define REG_RX_DRVINFO_SZ 0x060F 45062306a36Sopenharmony_ci#define BIT_APP_PHYSTS BIT(28) 45162306a36Sopenharmony_ci#define REG_MAR 0x0620 45262306a36Sopenharmony_ci#define REG_USTIME_EDCA 0x0638 45362306a36Sopenharmony_ci#define REG_ACKTO_CCK 0x0639 45462306a36Sopenharmony_ci#define REG_MAC_SPEC_SIFS 0x063A 45562306a36Sopenharmony_ci#define REG_RESP_SIFS_CCK 0x063C 45662306a36Sopenharmony_ci#define REG_RESP_SIFS_OFDM 0x063E 45762306a36Sopenharmony_ci#define REG_ACKTO 0x0640 45862306a36Sopenharmony_ci#define REG_EIFS 0x0642 45962306a36Sopenharmony_ci#define REG_NAV_CTRL 0x0650 46062306a36Sopenharmony_ci#define REG_WMAC_TRXPTCL_CTL 0x0668 46162306a36Sopenharmony_ci#define BIT_RFMOD (BIT(7) | BIT(8)) 46262306a36Sopenharmony_ci#define BIT_RFMOD_80M BIT(8) 46362306a36Sopenharmony_ci#define BIT_RFMOD_40M BIT(7) 46462306a36Sopenharmony_ci#define REG_WMAC_TRXPTCL_CTL_H 0x066C 46562306a36Sopenharmony_ci#define REG_WKFMCAM_CMD 0x0698 46662306a36Sopenharmony_ci#define BIT_WKFCAM_POLLING_V1 BIT(31) 46762306a36Sopenharmony_ci#define BIT_WKFCAM_CLR_V1 BIT(30) 46862306a36Sopenharmony_ci#define BIT_WKFCAM_WE BIT(16) 46962306a36Sopenharmony_ci#define BIT_SHIFT_WKFCAM_ADDR_V2 8 47062306a36Sopenharmony_ci#define BIT_MASK_WKFCAM_ADDR_V2 0xff 47162306a36Sopenharmony_ci#define BIT_WKFCAM_ADDR_V2(x) \ 47262306a36Sopenharmony_ci (((x) & BIT_MASK_WKFCAM_ADDR_V2) << BIT_SHIFT_WKFCAM_ADDR_V2) 47362306a36Sopenharmony_ci#define REG_WKFMCAM_RWD 0x069C 47462306a36Sopenharmony_ci#define BIT_WKFMCAM_VALID BIT(31) 47562306a36Sopenharmony_ci#define BIT_WKFMCAM_BC BIT(26) 47662306a36Sopenharmony_ci#define BIT_WKFMCAM_MC BIT(25) 47762306a36Sopenharmony_ci#define BIT_WKFMCAM_UC BIT(24) 47862306a36Sopenharmony_ci 47962306a36Sopenharmony_ci#define REG_RXFLTMAP0 0x06A0 48062306a36Sopenharmony_ci#define REG_RXFLTMAP1 0x06A2 48162306a36Sopenharmony_ci#define REG_RXFLTMAP2 0x06A4 48262306a36Sopenharmony_ci#define REG_RXFLTMAP4 0x068A 48362306a36Sopenharmony_ci#define REG_BT_COEX_TABLE0 0x06C0 48462306a36Sopenharmony_ci#define REG_BT_COEX_TABLE1 0x06C4 48562306a36Sopenharmony_ci#define REG_BT_COEX_BRK_TABLE 0x06C8 48662306a36Sopenharmony_ci#define REG_BT_COEX_TABLE_H 0x06CC 48762306a36Sopenharmony_ci#define REG_BT_COEX_TABLE_H1 0x06CD 48862306a36Sopenharmony_ci#define REG_BT_COEX_TABLE_H2 0x06CE 48962306a36Sopenharmony_ci#define REG_BT_COEX_TABLE_H3 0x06CF 49062306a36Sopenharmony_ci#define REG_BBPSF_CTRL 0x06DC 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci#define REG_BT_COEX_V2 0x0762 49362306a36Sopenharmony_ci#define BIT_GNT_BT_POLARITY BIT(12) 49462306a36Sopenharmony_ci#define BIT_LTE_COEX_EN BIT(7) 49562306a36Sopenharmony_ci#define REG_BT_COEX_ENH_INTR_CTRL 0x76E 49662306a36Sopenharmony_ci#define BIT_R_GRANTALL_WLMASK BIT(3) 49762306a36Sopenharmony_ci#define BIT_STATIS_BT_EN BIT(2) 49862306a36Sopenharmony_ci#define REG_BT_ACT_STATISTICS 0x0770 49962306a36Sopenharmony_ci#define REG_BT_ACT_STATISTICS_1 0x0774 50062306a36Sopenharmony_ci#define REG_BT_STAT_CTRL 0x0778 50162306a36Sopenharmony_ci#define REG_BT_TDMA_TIME 0x0790 50262306a36Sopenharmony_ci#define BIT_MASK_SAMPLE_RATE GENMASK(5, 0) 50362306a36Sopenharmony_ci#define REG_LTR_IDLE_LATENCY 0x0798 50462306a36Sopenharmony_ci#define REG_LTR_ACTIVE_LATENCY 0x079C 50562306a36Sopenharmony_ci#define REG_LTR_CTRL_BASIC 0x07A4 50662306a36Sopenharmony_ci#define REG_WMAC_OPTION_FUNCTION 0x07D0 50762306a36Sopenharmony_ci#define REG_WMAC_OPTION_FUNCTION_1 0x07D4 50862306a36Sopenharmony_ci 50962306a36Sopenharmony_ci#define REG_FPGA0_RFMOD 0x0800 51062306a36Sopenharmony_ci#define BIT_CCKEN BIT(24) 51162306a36Sopenharmony_ci#define BIT_OFDMEN BIT(25) 51262306a36Sopenharmony_ci#define REG_RX_GAIN_EN 0x081c 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_ci#define REG_RFE_CTRL_E 0x0974 51562306a36Sopenharmony_ci#define REG_2ND_CCA_CTRL 0x0976 51662306a36Sopenharmony_ci 51762306a36Sopenharmony_ci#define REG_CCK0_FAREPORT 0xa2c 51862306a36Sopenharmony_ci#define BIT_CCK0_2RX BIT(18) 51962306a36Sopenharmony_ci#define BIT_CCK0_MRC BIT(22) 52062306a36Sopenharmony_ci 52162306a36Sopenharmony_ci#define REG_DIS_DPD 0x0a70 52262306a36Sopenharmony_ci#define DIS_DPD_MASK GENMASK(9, 0) 52362306a36Sopenharmony_ci#define DIS_DPD_RATE6M BIT(0) 52462306a36Sopenharmony_ci#define DIS_DPD_RATE9M BIT(1) 52562306a36Sopenharmony_ci#define DIS_DPD_RATEMCS0 BIT(2) 52662306a36Sopenharmony_ci#define DIS_DPD_RATEMCS1 BIT(3) 52762306a36Sopenharmony_ci#define DIS_DPD_RATEMCS8 BIT(4) 52862306a36Sopenharmony_ci#define DIS_DPD_RATEMCS9 BIT(5) 52962306a36Sopenharmony_ci#define DIS_DPD_RATEVHT1SS_MCS0 BIT(6) 53062306a36Sopenharmony_ci#define DIS_DPD_RATEVHT1SS_MCS1 BIT(7) 53162306a36Sopenharmony_ci#define DIS_DPD_RATEVHT2SS_MCS0 BIT(8) 53262306a36Sopenharmony_ci#define DIS_DPD_RATEVHT2SS_MCS1 BIT(9) 53362306a36Sopenharmony_ci#define DIS_DPD_RATEALL GENMASK(9, 0) 53462306a36Sopenharmony_ci 53562306a36Sopenharmony_ci#define REG_RFE_CTRL8 0x0cb4 53662306a36Sopenharmony_ci#define BIT_MASK_RFE_SEL89 GENMASK(7, 0) 53762306a36Sopenharmony_ci#define REG_RFE_INV8 0x0cbd 53862306a36Sopenharmony_ci#define BIT_MASK_RFE_INV89 GENMASK(1, 0) 53962306a36Sopenharmony_ci#define REG_RFE_INV16 0x0cbe 54062306a36Sopenharmony_ci#define BIT_RFE_BUF_EN BIT(3) 54162306a36Sopenharmony_ci 54262306a36Sopenharmony_ci#define REG_ANAPAR_XTAL_0 0x1040 54362306a36Sopenharmony_ci#define BIT_XCAP_0 GENMASK(23, 10) 54462306a36Sopenharmony_ci#define REG_CPU_DMEM_CON 0x1080 54562306a36Sopenharmony_ci#define BIT_WL_PLATFORM_RST BIT(16) 54662306a36Sopenharmony_ci#define BIT_WL_SECURITY_CLK BIT(15) 54762306a36Sopenharmony_ci#define BIT_DDMA_EN BIT(8) 54862306a36Sopenharmony_ci 54962306a36Sopenharmony_ci#define REG_H2C_PKT_READADDR 0x10D0 55062306a36Sopenharmony_ci#define REG_H2C_PKT_WRITEADDR 0x10D4 55162306a36Sopenharmony_ci#define REG_FW_DBG7 0x10FC 55262306a36Sopenharmony_ci#define FW_KEY_MASK 0xffffff00 55362306a36Sopenharmony_ci 55462306a36Sopenharmony_ci#define REG_CR_EXT 0x1100 55562306a36Sopenharmony_ci 55662306a36Sopenharmony_ci#define REG_DDMA_CH0SA 0x1200 55762306a36Sopenharmony_ci#define REG_DDMA_CH0DA 0x1204 55862306a36Sopenharmony_ci#define REG_DDMA_CH0CTRL 0x1208 55962306a36Sopenharmony_ci#define BIT_DDMACH0_OWN BIT(31) 56062306a36Sopenharmony_ci#define BIT_DDMACH0_CHKSUM_EN BIT(29) 56162306a36Sopenharmony_ci#define BIT_DDMACH0_CHKSUM_STS BIT(27) 56262306a36Sopenharmony_ci#define BIT_DDMACH0_DDMA_MODE BIT(26) 56362306a36Sopenharmony_ci#define BIT_DDMACH0_RESET_CHKSUM_STS BIT(25) 56462306a36Sopenharmony_ci#define BIT_DDMACH0_CHKSUM_CONT BIT(24) 56562306a36Sopenharmony_ci#define BIT_MASK_DDMACH0_DLEN 0x3ffff 56662306a36Sopenharmony_ci 56762306a36Sopenharmony_ci#define REG_H2CQ_CSR 0x1330 56862306a36Sopenharmony_ci#define BIT_H2CQ_FULL BIT(31) 56962306a36Sopenharmony_ci#define REG_FAST_EDCA_VOVI_SETTING 0x1448 57062306a36Sopenharmony_ci#define REG_FAST_EDCA_BEBK_SETTING 0x144C 57162306a36Sopenharmony_ci 57262306a36Sopenharmony_ci#define REG_RXPSF_CTRL 0x1610 57362306a36Sopenharmony_ci#define BIT_RXGCK_FIFOTHR_EN BIT(28) 57462306a36Sopenharmony_ci 57562306a36Sopenharmony_ci#define BIT_SHIFT_RXGCK_VHT_FIFOTHR 26 57662306a36Sopenharmony_ci#define BIT_MASK_RXGCK_VHT_FIFOTHR 0x3 57762306a36Sopenharmony_ci#define BIT_RXGCK_VHT_FIFOTHR(x) \ 57862306a36Sopenharmony_ci (((x) & BIT_MASK_RXGCK_VHT_FIFOTHR) << BIT_SHIFT_RXGCK_VHT_FIFOTHR) 57962306a36Sopenharmony_ci#define BITS_RXGCK_VHT_FIFOTHR \ 58062306a36Sopenharmony_ci (BIT_MASK_RXGCK_VHT_FIFOTHR << BIT_SHIFT_RXGCK_VHT_FIFOTHR) 58162306a36Sopenharmony_ci 58262306a36Sopenharmony_ci#define BIT_SHIFT_RXGCK_HT_FIFOTHR 24 58362306a36Sopenharmony_ci#define BIT_MASK_RXGCK_HT_FIFOTHR 0x3 58462306a36Sopenharmony_ci#define BIT_RXGCK_HT_FIFOTHR(x) \ 58562306a36Sopenharmony_ci (((x) & BIT_MASK_RXGCK_HT_FIFOTHR) << BIT_SHIFT_RXGCK_HT_FIFOTHR) 58662306a36Sopenharmony_ci#define BITS_RXGCK_HT_FIFOTHR \ 58762306a36Sopenharmony_ci (BIT_MASK_RXGCK_HT_FIFOTHR << BIT_SHIFT_RXGCK_HT_FIFOTHR) 58862306a36Sopenharmony_ci 58962306a36Sopenharmony_ci#define BIT_SHIFT_RXGCK_OFDM_FIFOTHR 22 59062306a36Sopenharmony_ci#define BIT_MASK_RXGCK_OFDM_FIFOTHR 0x3 59162306a36Sopenharmony_ci#define BIT_RXGCK_OFDM_FIFOTHR(x) \ 59262306a36Sopenharmony_ci (((x) & BIT_MASK_RXGCK_OFDM_FIFOTHR) << BIT_SHIFT_RXGCK_OFDM_FIFOTHR) 59362306a36Sopenharmony_ci#define BITS_RXGCK_OFDM_FIFOTHR \ 59462306a36Sopenharmony_ci (BIT_MASK_RXGCK_OFDM_FIFOTHR << BIT_SHIFT_RXGCK_OFDM_FIFOTHR) 59562306a36Sopenharmony_ci 59662306a36Sopenharmony_ci#define BIT_SHIFT_RXGCK_CCK_FIFOTHR 20 59762306a36Sopenharmony_ci#define BIT_MASK_RXGCK_CCK_FIFOTHR 0x3 59862306a36Sopenharmony_ci#define BIT_RXGCK_CCK_FIFOTHR(x) \ 59962306a36Sopenharmony_ci (((x) & BIT_MASK_RXGCK_CCK_FIFOTHR) << BIT_SHIFT_RXGCK_CCK_FIFOTHR) 60062306a36Sopenharmony_ci#define BITS_RXGCK_CCK_FIFOTHR \ 60162306a36Sopenharmony_ci (BIT_MASK_RXGCK_CCK_FIFOTHR << BIT_SHIFT_RXGCK_CCK_FIFOTHR) 60262306a36Sopenharmony_ci 60362306a36Sopenharmony_ci#define BIT_RXGCK_OFDMCCA_EN BIT(16) 60462306a36Sopenharmony_ci 60562306a36Sopenharmony_ci#define BIT_SHIFT_RXPSF_PKTLENTHR 13 60662306a36Sopenharmony_ci#define BIT_MASK_RXPSF_PKTLENTHR 0x7 60762306a36Sopenharmony_ci#define BIT_RXPSF_PKTLENTHR(x) \ 60862306a36Sopenharmony_ci (((x) & BIT_MASK_RXPSF_PKTLENTHR) << BIT_SHIFT_RXPSF_PKTLENTHR) 60962306a36Sopenharmony_ci#define BITS_RXPSF_PKTLENTHR \ 61062306a36Sopenharmony_ci (BIT_MASK_RXPSF_PKTLENTHR << BIT_SHIFT_RXPSF_PKTLENTHR) 61162306a36Sopenharmony_ci#define BIT_CLEAR_RXPSF_PKTLENTHR(x) ((x) & (~BITS_RXPSF_PKTLENTHR)) 61262306a36Sopenharmony_ci#define BIT_SET_RXPSF_PKTLENTHR(x, v) \ 61362306a36Sopenharmony_ci (BIT_CLEAR_RXPSF_PKTLENTHR(x) | BIT_RXPSF_PKTLENTHR(v)) 61462306a36Sopenharmony_ci 61562306a36Sopenharmony_ci#define BIT_RXPSF_CTRLEN BIT(12) 61662306a36Sopenharmony_ci#define BIT_RXPSF_VHTCHKEN BIT(11) 61762306a36Sopenharmony_ci#define BIT_RXPSF_HTCHKEN BIT(10) 61862306a36Sopenharmony_ci#define BIT_RXPSF_OFDMCHKEN BIT(9) 61962306a36Sopenharmony_ci#define BIT_RXPSF_CCKCHKEN BIT(8) 62062306a36Sopenharmony_ci#define BIT_RXPSF_OFDMRST BIT(7) 62162306a36Sopenharmony_ci#define BIT_RXPSF_CCKRST BIT(6) 62262306a36Sopenharmony_ci#define BIT_RXPSF_MHCHKEN BIT(5) 62362306a36Sopenharmony_ci#define BIT_RXPSF_CONT_ERRCHKEN BIT(4) 62462306a36Sopenharmony_ci#define BIT_RXPSF_ALL_ERRCHKEN BIT(3) 62562306a36Sopenharmony_ci 62662306a36Sopenharmony_ci#define BIT_SHIFT_RXPSF_ERRTHR 0 62762306a36Sopenharmony_ci#define BIT_MASK_RXPSF_ERRTHR 0x7 62862306a36Sopenharmony_ci#define BIT_RXPSF_ERRTHR(x) \ 62962306a36Sopenharmony_ci (((x) & BIT_MASK_RXPSF_ERRTHR) << BIT_SHIFT_RXPSF_ERRTHR) 63062306a36Sopenharmony_ci#define BITS_RXPSF_ERRTHR (BIT_MASK_RXPSF_ERRTHR << BIT_SHIFT_RXPSF_ERRTHR) 63162306a36Sopenharmony_ci#define BIT_CLEAR_RXPSF_ERRTHR(x) ((x) & (~BITS_RXPSF_ERRTHR)) 63262306a36Sopenharmony_ci#define BIT_GET_RXPSF_ERRTHR(x) \ 63362306a36Sopenharmony_ci (((x) >> BIT_SHIFT_RXPSF_ERRTHR) & BIT_MASK_RXPSF_ERRTHR) 63462306a36Sopenharmony_ci#define BIT_SET_RXPSF_ERRTHR(x, v) \ 63562306a36Sopenharmony_ci (BIT_CLEAR_RXPSF_ERRTHR(x) | BIT_RXPSF_ERRTHR(v)) 63662306a36Sopenharmony_ci 63762306a36Sopenharmony_ci#define REG_RXPSF_TYPE_CTRL 0x1614 63862306a36Sopenharmony_ci#define REG_GENERAL_OPTION 0x1664 63962306a36Sopenharmony_ci#define BIT_DUMMY_FCS_READY_MASK_EN BIT(9) 64062306a36Sopenharmony_ci 64162306a36Sopenharmony_ci#define REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1 0x1700 64262306a36Sopenharmony_ci#define REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1 0x1704 64362306a36Sopenharmony_ci#define REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1 0x1708 64462306a36Sopenharmony_ci#define LTECOEX_READY BIT(29) 64562306a36Sopenharmony_ci#define LTECOEX_ACCESS_CTRL REG_WL2LTECOEX_INDIRECT_ACCESS_CTRL_V1 64662306a36Sopenharmony_ci#define LTECOEX_WRITE_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_WRITE_DATA_V1 64762306a36Sopenharmony_ci#define LTECOEX_READ_DATA REG_WL2LTECOEX_INDIRECT_ACCESS_READ_DATA_V1 64862306a36Sopenharmony_ci 64962306a36Sopenharmony_ci#define REG_IGN_GNT_BT1 0x1860 65062306a36Sopenharmony_ci 65162306a36Sopenharmony_ci#define REG_RFESEL_CTRL 0x1990 65262306a36Sopenharmony_ci 65362306a36Sopenharmony_ci#define REG_NOMASK_TXBT 0x1ca7 65462306a36Sopenharmony_ci#define REG_ANAPAR 0x1c30 65562306a36Sopenharmony_ci#define BIT_ANAPAR_BTPS BIT(22) 65662306a36Sopenharmony_ci#define REG_RSTB_SEL 0x1c38 65762306a36Sopenharmony_ci#define BIT_DAC_OFF_ENABLE BIT(4) 65862306a36Sopenharmony_ci#define BIT_PI_IGNORE_GNT_BT BIT(3) 65962306a36Sopenharmony_ci#define BIT_NOMASK_TXBT_ENABLE BIT(3) 66062306a36Sopenharmony_ci 66162306a36Sopenharmony_ci#define REG_HRCV_MSG 0x1cf 66262306a36Sopenharmony_ci 66362306a36Sopenharmony_ci#define REG_EDCCA_REPORT 0x2d38 66462306a36Sopenharmony_ci#define BIT_EDCCA_FLAG BIT(24) 66562306a36Sopenharmony_ci 66662306a36Sopenharmony_ci#define REG_IGN_GNTBT4 0x4160 66762306a36Sopenharmony_ci 66862306a36Sopenharmony_ci#define RF_MODE 0x00 66962306a36Sopenharmony_ci#define RF_MODOPT 0x01 67062306a36Sopenharmony_ci#define RF_WLINT 0x01 67162306a36Sopenharmony_ci#define RF_WLSEL 0x02 67262306a36Sopenharmony_ci#define RF_DTXLOK 0x08 67362306a36Sopenharmony_ci#define RF_CFGCH 0x18 67462306a36Sopenharmony_ci#define BIT_BAND GENMASK(18, 16) 67562306a36Sopenharmony_ci#define RF_RCK 0x1d 67662306a36Sopenharmony_ci#define RF_LUTWA 0x33 67762306a36Sopenharmony_ci#define RF_LUTWD1 0x3e 67862306a36Sopenharmony_ci#define RF_LUTWD0 0x3f 67962306a36Sopenharmony_ci#define BIT_GAIN_EXT BIT(12) 68062306a36Sopenharmony_ci#define BIT_DATA_L GENMASK(11, 0) 68162306a36Sopenharmony_ci#define RF_T_METER 0x42 68262306a36Sopenharmony_ci#define RF_BSPAD 0x54 68362306a36Sopenharmony_ci#define RF_GAINTX 0x56 68462306a36Sopenharmony_ci#define RF_TXATANK 0x64 68562306a36Sopenharmony_ci#define RF_TRXIQ 0x66 68662306a36Sopenharmony_ci#define RF_RXIQGEN 0x8d 68762306a36Sopenharmony_ci#define RF_SYN_PFD 0xb0 68862306a36Sopenharmony_ci#define RF_XTALX2 0xb8 68962306a36Sopenharmony_ci#define RF_SYN_CTRL 0xbb 69062306a36Sopenharmony_ci#define RF_MALSEL 0xbe 69162306a36Sopenharmony_ci#define RF_SYN_AAC 0xc9 69262306a36Sopenharmony_ci#define RF_AAC_CTRL 0xca 69362306a36Sopenharmony_ci#define RF_FAST_LCK 0xcc 69462306a36Sopenharmony_ci#define RF_RCKD 0xde 69562306a36Sopenharmony_ci#define RF_TXADBG 0xde 69662306a36Sopenharmony_ci#define RF_LUTDBG 0xdf 69762306a36Sopenharmony_ci#define BIT_TXA_TANK BIT(4) 69862306a36Sopenharmony_ci#define RF_LUTWE2 0xee 69962306a36Sopenharmony_ci#define RF_LUTWE 0xef 70062306a36Sopenharmony_ci 70162306a36Sopenharmony_ci#define LTE_COEX_CTRL 0x38 70262306a36Sopenharmony_ci#define LTE_WL_TRX_CTRL 0xa0 70362306a36Sopenharmony_ci#define LTE_BT_TRX_CTRL 0xa4 70462306a36Sopenharmony_ci 70562306a36Sopenharmony_ci#endif 706