18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: ISC */ 28c2ecf20Sopenharmony_ci 38c2ecf20Sopenharmony_ci#ifndef __MT7603_REGS_H 48c2ecf20Sopenharmony_ci#define __MT7603_REGS_H 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#define MT_HW_REV 0x1000 78c2ecf20Sopenharmony_ci#define MT_HW_CHIPID 0x1008 88c2ecf20Sopenharmony_ci#define MT_TOP_MISC2 0x1134 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ci#define MT_MCU_BASE 0x2000 118c2ecf20Sopenharmony_ci#define MT_MCU(ofs) (MT_MCU_BASE + (ofs)) 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci#define MT_MCU_PCIE_REMAP_1 MT_MCU(0x500) 148c2ecf20Sopenharmony_ci#define MT_MCU_PCIE_REMAP_1_OFFSET GENMASK(17, 0) 158c2ecf20Sopenharmony_ci#define MT_MCU_PCIE_REMAP_1_BASE GENMASK(31, 18) 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci#define MT_MCU_PCIE_REMAP_2 MT_MCU(0x504) 188c2ecf20Sopenharmony_ci#define MT_MCU_PCIE_REMAP_2_OFFSET GENMASK(18, 0) 198c2ecf20Sopenharmony_ci#define MT_MCU_PCIE_REMAP_2_BASE GENMASK(31, 19) 208c2ecf20Sopenharmony_ci 218c2ecf20Sopenharmony_ci#define MT_HIF_BASE 0x4000 228c2ecf20Sopenharmony_ci#define MT_HIF(ofs) (MT_HIF_BASE + (ofs)) 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci#define MT_INT_SOURCE_CSR MT_HIF(0x200) 258c2ecf20Sopenharmony_ci#define MT_INT_MASK_CSR MT_HIF(0x204) 268c2ecf20Sopenharmony_ci#define MT_DELAY_INT_CFG MT_HIF(0x210) 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci#define MT_INT_RX_DONE(_n) BIT(_n) 298c2ecf20Sopenharmony_ci#define MT_INT_RX_DONE_ALL GENMASK(1, 0) 308c2ecf20Sopenharmony_ci#define MT_INT_TX_DONE_ALL GENMASK(19, 4) 318c2ecf20Sopenharmony_ci#define MT_INT_TX_DONE(_n) BIT((_n) + 4) 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci#define MT_INT_RX_COHERENT BIT(20) 348c2ecf20Sopenharmony_ci#define MT_INT_TX_COHERENT BIT(21) 358c2ecf20Sopenharmony_ci#define MT_INT_MAC_IRQ3 BIT(27) 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#define MT_INT_MCU_CMD BIT(30) 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG MT_HIF(0x208) 408c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_TX_DMA_EN BIT(0) 418c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_TX_DMA_BUSY BIT(1) 428c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_RX_DMA_EN BIT(2) 438c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_RX_DMA_BUSY BIT(3) 448c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_DMA_BURST_SIZE GENMASK(5, 4) 458c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_TX_WRITEBACK_DONE BIT(6) 468c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_BIG_ENDIAN BIT(7) 478c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_HDR_SEG_LEN GENMASK(15, 8) 488c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_SW_RESET BIT(24) 498c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_FORCE_TX_EOF BIT(25) 508c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_CLK_GATE_DIS BIT(30) 518c2ecf20Sopenharmony_ci#define MT_WPDMA_GLO_CFG_RX_2B_OFFSET BIT(31) 528c2ecf20Sopenharmony_ci 538c2ecf20Sopenharmony_ci#define MT_WPDMA_RST_IDX MT_HIF(0x20c) 548c2ecf20Sopenharmony_ci 558c2ecf20Sopenharmony_ci#define MT_WPDMA_DEBUG MT_HIF(0x244) 568c2ecf20Sopenharmony_ci#define MT_WPDMA_DEBUG_VALUE GENMASK(17, 0) 578c2ecf20Sopenharmony_ci#define MT_WPDMA_DEBUG_SEL BIT(27) 588c2ecf20Sopenharmony_ci#define MT_WPDMA_DEBUG_IDX GENMASK(31, 28) 598c2ecf20Sopenharmony_ci 608c2ecf20Sopenharmony_ci#define MT_TX_RING_BASE MT_HIF(0x300) 618c2ecf20Sopenharmony_ci#define MT_RX_RING_BASE MT_HIF(0x400) 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#define MT_TXTIME_THRESH_BASE MT_HIF(0x500) 648c2ecf20Sopenharmony_ci#define MT_TXTIME_THRESH(n) (MT_TXTIME_THRESH_BASE + ((n) * 4)) 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci#define MT_PAGE_COUNT_BASE MT_HIF(0x540) 678c2ecf20Sopenharmony_ci#define MT_PAGE_COUNT(n) (MT_PAGE_COUNT_BASE + ((n) * 4)) 688c2ecf20Sopenharmony_ci 698c2ecf20Sopenharmony_ci#define MT_SCH_1 MT_HIF(0x588) 708c2ecf20Sopenharmony_ci#define MT_SCH_2 MT_HIF(0x58c) 718c2ecf20Sopenharmony_ci#define MT_SCH_3 MT_HIF(0x590) 728c2ecf20Sopenharmony_ci 738c2ecf20Sopenharmony_ci#define MT_SCH_4 MT_HIF(0x594) 748c2ecf20Sopenharmony_ci#define MT_SCH_4_FORCE_QID GENMASK(4, 0) 758c2ecf20Sopenharmony_ci#define MT_SCH_4_BYPASS BIT(5) 768c2ecf20Sopenharmony_ci#define MT_SCH_4_RESET BIT(8) 778c2ecf20Sopenharmony_ci 788c2ecf20Sopenharmony_ci#define MT_GROUP_THRESH_BASE MT_HIF(0x598) 798c2ecf20Sopenharmony_ci#define MT_GROUP_THRESH(n) (MT_GROUP_THRESH_BASE + ((n) * 4)) 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ci#define MT_QUEUE_PRIORITY_1 MT_HIF(0x580) 828c2ecf20Sopenharmony_ci#define MT_QUEUE_PRIORITY_2 MT_HIF(0x584) 838c2ecf20Sopenharmony_ci 848c2ecf20Sopenharmony_ci#define MT_BMAP_0 MT_HIF(0x5b0) 858c2ecf20Sopenharmony_ci#define MT_BMAP_1 MT_HIF(0x5b4) 868c2ecf20Sopenharmony_ci#define MT_BMAP_2 MT_HIF(0x5b8) 878c2ecf20Sopenharmony_ci 888c2ecf20Sopenharmony_ci#define MT_HIGH_PRIORITY_1 MT_HIF(0x5bc) 898c2ecf20Sopenharmony_ci#define MT_HIGH_PRIORITY_2 MT_HIF(0x5c0) 908c2ecf20Sopenharmony_ci 918c2ecf20Sopenharmony_ci#define MT_PRIORITY_MASK MT_HIF(0x5c4) 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci#define MT_RSV_MAX_THRESH MT_HIF(0x5c8) 948c2ecf20Sopenharmony_ci 958c2ecf20Sopenharmony_ci#define MT_PSE_BASE 0x8000 968c2ecf20Sopenharmony_ci#define MT_PSE(ofs) (MT_PSE_BASE + (ofs)) 978c2ecf20Sopenharmony_ci 988c2ecf20Sopenharmony_ci#define MT_MCU_DEBUG_RESET MT_PSE(0x16c) 998c2ecf20Sopenharmony_ci#define MT_MCU_DEBUG_RESET_PSE BIT(0) 1008c2ecf20Sopenharmony_ci#define MT_MCU_DEBUG_RESET_PSE_S BIT(1) 1018c2ecf20Sopenharmony_ci#define MT_MCU_DEBUG_RESET_QUEUES GENMASK(6, 2) 1028c2ecf20Sopenharmony_ci 1038c2ecf20Sopenharmony_ci#define MT_PSE_FC_P0 MT_PSE(0x120) 1048c2ecf20Sopenharmony_ci#define MT_PSE_FC_P0_MIN_RESERVE GENMASK(11, 0) 1058c2ecf20Sopenharmony_ci#define MT_PSE_FC_P0_MAX_QUOTA GENMASK(27, 16) 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci#define MT_PSE_FRP MT_PSE(0x138) 1088c2ecf20Sopenharmony_ci#define MT_PSE_FRP_P0 GENMASK(2, 0) 1098c2ecf20Sopenharmony_ci#define MT_PSE_FRP_P1 GENMASK(5, 3) 1108c2ecf20Sopenharmony_ci#define MT_PSE_FRP_P2_RQ0 GENMASK(8, 6) 1118c2ecf20Sopenharmony_ci#define MT_PSE_FRP_P2_RQ1 GENMASK(11, 9) 1128c2ecf20Sopenharmony_ci#define MT_PSE_FRP_P2_RQ2 GENMASK(14, 12) 1138c2ecf20Sopenharmony_ci 1148c2ecf20Sopenharmony_ci#define MT_FC_RSV_COUNT_0 MT_PSE(0x13c) 1158c2ecf20Sopenharmony_ci#define MT_FC_RSV_COUNT_0_P0 GENMASK(11, 0) 1168c2ecf20Sopenharmony_ci#define MT_FC_RSV_COUNT_0_P1 GENMASK(27, 16) 1178c2ecf20Sopenharmony_ci 1188c2ecf20Sopenharmony_ci#define MT_FC_SP2_Q0Q1 MT_PSE(0x14c) 1198c2ecf20Sopenharmony_ci#define MT_FC_SP2_Q0Q1_SRC_COUNT_Q0 GENMASK(11, 0) 1208c2ecf20Sopenharmony_ci#define MT_FC_SP2_Q0Q1_SRC_COUNT_Q1 GENMASK(27, 16) 1218c2ecf20Sopenharmony_ci 1228c2ecf20Sopenharmony_ci#define MT_PSE_FW_SHARED MT_PSE(0x17c) 1238c2ecf20Sopenharmony_ci 1248c2ecf20Sopenharmony_ci#define MT_PSE_RTA MT_PSE(0x194) 1258c2ecf20Sopenharmony_ci#define MT_PSE_RTA_QUEUE_ID GENMASK(4, 0) 1268c2ecf20Sopenharmony_ci#define MT_PSE_RTA_PORT_ID GENMASK(6, 5) 1278c2ecf20Sopenharmony_ci#define MT_PSE_RTA_REDIRECT_EN BIT(7) 1288c2ecf20Sopenharmony_ci#define MT_PSE_RTA_TAG_ID GENMASK(15, 8) 1298c2ecf20Sopenharmony_ci#define MT_PSE_RTA_WRITE BIT(16) 1308c2ecf20Sopenharmony_ci#define MT_PSE_RTA_BUSY BIT(31) 1318c2ecf20Sopenharmony_ci 1328c2ecf20Sopenharmony_ci#define MT_WF_PHY_BASE 0x10000 1338c2ecf20Sopenharmony_ci#define MT_WF_PHY_OFFSET 0x1000 1348c2ecf20Sopenharmony_ci#define MT_WF_PHY(ofs) (MT_WF_PHY_BASE + (ofs)) 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci#define MT_AGC_BASE MT_WF_PHY(0x500) 1378c2ecf20Sopenharmony_ci#define MT_AGC(n) (MT_AGC_BASE + ((n) * 4)) 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ci#define MT_AGC1_BASE MT_WF_PHY(0x1500) 1408c2ecf20Sopenharmony_ci#define MT_AGC1(n) (MT_AGC1_BASE + ((n) * 4)) 1418c2ecf20Sopenharmony_ci 1428c2ecf20Sopenharmony_ci#define MT_AGC_41_RSSI_0 GENMASK(23, 16) 1438c2ecf20Sopenharmony_ci#define MT_AGC_41_RSSI_1 GENMASK(7, 0) 1448c2ecf20Sopenharmony_ci 1458c2ecf20Sopenharmony_ci#define MT_RXTD_BASE MT_WF_PHY(0x600) 1468c2ecf20Sopenharmony_ci#define MT_RXTD(n) (MT_RXTD_BASE + ((n) * 4)) 1478c2ecf20Sopenharmony_ci 1488c2ecf20Sopenharmony_ci#define MT_RXTD_6_ACI_TH GENMASK(4, 0) 1498c2ecf20Sopenharmony_ci#define MT_RXTD_6_CCAED_TH GENMASK(14, 8) 1508c2ecf20Sopenharmony_ci 1518c2ecf20Sopenharmony_ci#define MT_RXTD_8_LOWER_SIGNAL GENMASK(5, 0) 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci#define MT_RXTD_13_ACI_TH_EN BIT(0) 1548c2ecf20Sopenharmony_ci 1558c2ecf20Sopenharmony_ci#define MT_WF_PHY_CR_TSSI_BASE MT_WF_PHY(0xd00) 1568c2ecf20Sopenharmony_ci#define MT_WF_PHY_CR_TSSI(phy, n) (MT_WF_PHY_CR_TSSI_BASE + \ 1578c2ecf20Sopenharmony_ci ((phy) * MT_WF_PHY_OFFSET) + \ 1588c2ecf20Sopenharmony_ci ((n) * 4)) 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci#define MT_PHYCTRL_BASE MT_WF_PHY(0x4100) 1618c2ecf20Sopenharmony_ci#define MT_PHYCTRL(n) (MT_PHYCTRL_BASE + ((n) * 4)) 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ci#define MT_PHYCTRL_2_STATUS_RESET BIT(6) 1648c2ecf20Sopenharmony_ci#define MT_PHYCTRL_2_STATUS_EN BIT(7) 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ci#define MT_PHYCTRL_STAT_PD MT_PHYCTRL(3) 1678c2ecf20Sopenharmony_ci#define MT_PHYCTRL_STAT_PD_OFDM GENMASK(31, 16) 1688c2ecf20Sopenharmony_ci#define MT_PHYCTRL_STAT_PD_CCK GENMASK(15, 0) 1698c2ecf20Sopenharmony_ci 1708c2ecf20Sopenharmony_ci#define MT_PHYCTRL_STAT_MDRDY MT_PHYCTRL(8) 1718c2ecf20Sopenharmony_ci#define MT_PHYCTRL_STAT_MDRDY_OFDM GENMASK(31, 16) 1728c2ecf20Sopenharmony_ci#define MT_PHYCTRL_STAT_MDRDY_CCK GENMASK(15, 0) 1738c2ecf20Sopenharmony_ci 1748c2ecf20Sopenharmony_ci#define MT_WF_AGG_BASE 0x21200 1758c2ecf20Sopenharmony_ci#define MT_WF_AGG(ofs) (MT_WF_AGG_BASE + (ofs)) 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci#define MT_AGG_ARCR MT_WF_AGG(0x010) 1788c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_INIT_RATE1 BIT(0) 1798c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_FB_SGI_DISABLE BIT(1) 1808c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_RATE8_DOWN_WRAP BIT(2) 1818c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_RTS_RATE_THR GENMASK(12, 8) 1828c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_RATE_DOWN_RATIO GENMASK(17, 16) 1838c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_RATE_DOWN_RATIO_EN BIT(19) 1848c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_RATE_UP_EXTRA_TH GENMASK(22, 20) 1858c2ecf20Sopenharmony_ci#define MT_AGG_ARCR_SPE_DIS_TH GENMASK(27, 24) 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ci#define MT_AGG_ARUCR MT_WF_AGG(0x014) 1888c2ecf20Sopenharmony_ci#define MT_AGG_ARDCR MT_WF_AGG(0x018) 1898c2ecf20Sopenharmony_ci#define MT_AGG_ARxCR_LIMIT_SHIFT(_n) (4 * (_n)) 1908c2ecf20Sopenharmony_ci#define MT_AGG_ARxCR_LIMIT(_n) GENMASK(2 + \ 1918c2ecf20Sopenharmony_ci MT_AGG_ARxCR_LIMIT_SHIFT(_n), \ 1928c2ecf20Sopenharmony_ci MT_AGG_ARxCR_LIMIT_SHIFT(_n)) 1938c2ecf20Sopenharmony_ci 1948c2ecf20Sopenharmony_ci#define MT_AGG_LIMIT MT_WF_AGG(0x040) 1958c2ecf20Sopenharmony_ci#define MT_AGG_LIMIT_1 MT_WF_AGG(0x044) 1968c2ecf20Sopenharmony_ci#define MT_AGG_LIMIT_AC(_n) GENMASK(((_n) + 1) * 8 - 1, (_n) * 8) 1978c2ecf20Sopenharmony_ci 1988c2ecf20Sopenharmony_ci#define MT_AGG_BA_SIZE_LIMIT_0 MT_WF_AGG(0x048) 1998c2ecf20Sopenharmony_ci#define MT_AGG_BA_SIZE_LIMIT_1 MT_WF_AGG(0x04c) 2008c2ecf20Sopenharmony_ci#define MT_AGG_BA_SIZE_LIMIT_SHIFT 8 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ci#define MT_AGG_PCR MT_WF_AGG(0x050) 2038c2ecf20Sopenharmony_ci#define MT_AGG_PCR_MM BIT(16) 2048c2ecf20Sopenharmony_ci#define MT_AGG_PCR_GF BIT(17) 2058c2ecf20Sopenharmony_ci#define MT_AGG_PCR_BW40 BIT(18) 2068c2ecf20Sopenharmony_ci#define MT_AGG_PCR_RIFS BIT(19) 2078c2ecf20Sopenharmony_ci#define MT_AGG_PCR_BW80 BIT(20) 2088c2ecf20Sopenharmony_ci#define MT_AGG_PCR_BW160 BIT(21) 2098c2ecf20Sopenharmony_ci#define MT_AGG_PCR_ERP BIT(22) 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci#define MT_AGG_PCR_RTS MT_WF_AGG(0x054) 2128c2ecf20Sopenharmony_ci#define MT_AGG_PCR_RTS_THR GENMASK(19, 0) 2138c2ecf20Sopenharmony_ci#define MT_AGG_PCR_RTS_PKT_THR GENMASK(31, 25) 2148c2ecf20Sopenharmony_ci 2158c2ecf20Sopenharmony_ci#define MT_AGG_ASRCR MT_WF_AGG(0x060) 2168c2ecf20Sopenharmony_ci#define MT_AGG_ASRCR_RANGE(val, n) (((val) >> ((n) << 3)) & GENMASK(5, 0)) 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL MT_WF_AGG(0x070) 2198c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL_NO_BA_RULE BIT(0) 2208c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL_NO_BA_AR_RULE BIT(1) 2218c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL_CFEND_SPE_EN BIT(3) 2228c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL_CFEND_RATE GENMASK(15, 4) 2238c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL_BAR_SPE_EN BIT(19) 2248c2ecf20Sopenharmony_ci#define MT_AGG_CONTROL_BAR_RATE GENMASK(31, 20) 2258c2ecf20Sopenharmony_ci 2268c2ecf20Sopenharmony_ci#define MT_AGG_TMP MT_WF_AGG(0x0d8) 2278c2ecf20Sopenharmony_ci 2288c2ecf20Sopenharmony_ci#define MT_AGG_BWCR MT_WF_AGG(0x0ec) 2298c2ecf20Sopenharmony_ci#define MT_AGG_BWCR_BW GENMASK(3, 2) 2308c2ecf20Sopenharmony_ci 2318c2ecf20Sopenharmony_ci#define MT_AGG_RETRY_CONTROL MT_WF_AGG(0x0f4) 2328c2ecf20Sopenharmony_ci#define MT_AGG_RETRY_CONTROL_RTS_LIMIT GENMASK(11, 7) 2338c2ecf20Sopenharmony_ci#define MT_AGG_RETRY_CONTROL_BAR_LIMIT GENMASK(15, 12) 2348c2ecf20Sopenharmony_ci 2358c2ecf20Sopenharmony_ci#define MT_WF_DMA_BASE 0x21c00 2368c2ecf20Sopenharmony_ci#define MT_WF_DMA(ofs) (MT_WF_DMA_BASE + (ofs)) 2378c2ecf20Sopenharmony_ci 2388c2ecf20Sopenharmony_ci#define MT_DMA_DCR0 MT_WF_DMA(0x000) 2398c2ecf20Sopenharmony_ci#define MT_DMA_DCR0_MAX_RX_LEN GENMASK(15, 0) 2408c2ecf20Sopenharmony_ci#define MT_DMA_DCR0_DAMSDU BIT(16) 2418c2ecf20Sopenharmony_ci#define MT_DMA_DCR0_RX_VEC_DROP BIT(17) 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci#define MT_DMA_DCR1 MT_WF_DMA(0x004) 2448c2ecf20Sopenharmony_ci 2458c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0 MT_WF_DMA(0x008) 2468c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_TARGET_WCID GENMASK(7, 0) 2478c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_TARGET_BSS GENMASK(13, 8) 2488c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_TARGET_QID GENMASK(20, 16) 2498c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_DEST_PORT_ID GENMASK(23, 22) 2508c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_DEST_QUEUE_ID GENMASK(28, 24) 2518c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_MODE BIT(29) 2528c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_STATUS BIT(30) 2538c2ecf20Sopenharmony_ci#define MT_DMA_FQCR0_BUSY BIT(31) 2548c2ecf20Sopenharmony_ci 2558c2ecf20Sopenharmony_ci#define MT_DMA_RCFR0 MT_WF_DMA(0x070) 2568c2ecf20Sopenharmony_ci#define MT_DMA_VCFR0 MT_WF_DMA(0x07c) 2578c2ecf20Sopenharmony_ci 2588c2ecf20Sopenharmony_ci#define MT_DMA_TCFR0 MT_WF_DMA(0x080) 2598c2ecf20Sopenharmony_ci#define MT_DMA_TCFR1 MT_WF_DMA(0x084) 2608c2ecf20Sopenharmony_ci#define MT_DMA_TCFR_TXS_AGGR_TIMEOUT GENMASK(27, 16) 2618c2ecf20Sopenharmony_ci#define MT_DMA_TCFR_TXS_QUEUE BIT(14) 2628c2ecf20Sopenharmony_ci#define MT_DMA_TCFR_TXS_AGGR_COUNT GENMASK(12, 8) 2638c2ecf20Sopenharmony_ci#define MT_DMA_TCFR_TXS_BIT_MAP GENMASK(6, 0) 2648c2ecf20Sopenharmony_ci 2658c2ecf20Sopenharmony_ci#define MT_DMA_TMCFR0 MT_WF_DMA(0x088) 2668c2ecf20Sopenharmony_ci 2678c2ecf20Sopenharmony_ci#define MT_WF_ARB_BASE 0x21400 2688c2ecf20Sopenharmony_ci#define MT_WF_ARB(ofs) (MT_WF_ARB_BASE + (ofs)) 2698c2ecf20Sopenharmony_ci 2708c2ecf20Sopenharmony_ci#define MT_WMM_AIFSN MT_WF_ARB(0x020) 2718c2ecf20Sopenharmony_ci#define MT_WMM_AIFSN_MASK GENMASK(3, 0) 2728c2ecf20Sopenharmony_ci#define MT_WMM_AIFSN_SHIFT(_n) ((_n) * 4) 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_ci#define MT_WMM_CWMAX_BASE MT_WF_ARB(0x028) 2758c2ecf20Sopenharmony_ci#define MT_WMM_CWMAX(_n) (MT_WMM_CWMAX_BASE + (((_n) / 2) << 2)) 2768c2ecf20Sopenharmony_ci#define MT_WMM_CWMAX_SHIFT(_n) (((_n) & 1) * 16) 2778c2ecf20Sopenharmony_ci#define MT_WMM_CWMAX_MASK GENMASK(15, 0) 2788c2ecf20Sopenharmony_ci 2798c2ecf20Sopenharmony_ci#define MT_WMM_CWMIN MT_WF_ARB(0x040) 2808c2ecf20Sopenharmony_ci#define MT_WMM_CWMIN_MASK GENMASK(7, 0) 2818c2ecf20Sopenharmony_ci#define MT_WMM_CWMIN_SHIFT(_n) ((_n) * 8) 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_ci#define MT_WF_ARB_RQCR MT_WF_ARB(0x070) 2848c2ecf20Sopenharmony_ci#define MT_WF_ARB_RQCR_RX_START BIT(0) 2858c2ecf20Sopenharmony_ci#define MT_WF_ARB_RQCR_RXV_START BIT(4) 2868c2ecf20Sopenharmony_ci#define MT_WF_ARB_RQCR_RXV_R_EN BIT(7) 2878c2ecf20Sopenharmony_ci#define MT_WF_ARB_RQCR_RXV_T_EN BIT(8) 2888c2ecf20Sopenharmony_ci 2898c2ecf20Sopenharmony_ci#define MT_ARB_SCR MT_WF_ARB(0x080) 2908c2ecf20Sopenharmony_ci#define MT_ARB_SCR_BCNQ_OPMODE_MASK GENMASK(1, 0) 2918c2ecf20Sopenharmony_ci#define MT_ARB_SCR_BCNQ_OPMODE_SHIFT(n) ((n) * 2) 2928c2ecf20Sopenharmony_ci#define MT_ARB_SCR_TX_DISABLE BIT(8) 2938c2ecf20Sopenharmony_ci#define MT_ARB_SCR_RX_DISABLE BIT(9) 2948c2ecf20Sopenharmony_ci#define MT_ARB_SCR_BCNQ_EMPTY_SKIP BIT(28) 2958c2ecf20Sopenharmony_ci#define MT_ARB_SCR_TTTT_BTIM_PRIO BIT(29) 2968c2ecf20Sopenharmony_ci#define MT_ARB_SCR_TBTT_BCN_PRIO BIT(30) 2978c2ecf20Sopenharmony_ci#define MT_ARB_SCR_TBTT_BCAST_PRIO BIT(31) 2988c2ecf20Sopenharmony_ci 2998c2ecf20Sopenharmony_cienum { 3008c2ecf20Sopenharmony_ci MT_BCNQ_OPMODE_STA = 0, 3018c2ecf20Sopenharmony_ci MT_BCNQ_OPMODE_AP = 1, 3028c2ecf20Sopenharmony_ci MT_BCNQ_OPMODE_ADHOC = 2, 3038c2ecf20Sopenharmony_ci}; 3048c2ecf20Sopenharmony_ci 3058c2ecf20Sopenharmony_ci#define MT_WF_ARB_TX_START_0 MT_WF_ARB(0x100) 3068c2ecf20Sopenharmony_ci#define MT_WF_ARB_TX_START_1 MT_WF_ARB(0x104) 3078c2ecf20Sopenharmony_ci#define MT_WF_ARB_TX_FLUSH_0 MT_WF_ARB(0x108) 3088c2ecf20Sopenharmony_ci#define MT_WF_ARB_TX_FLUSH_1 MT_WF_ARB(0x10c) 3098c2ecf20Sopenharmony_ci#define MT_WF_ARB_TX_STOP_0 MT_WF_ARB(0x110) 3108c2ecf20Sopenharmony_ci#define MT_WF_ARB_TX_STOP_1 MT_WF_ARB(0x114) 3118c2ecf20Sopenharmony_ci 3128c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START MT_WF_ARB(0x118) 3138c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_BSSn(n) BIT(0 + (n)) 3148c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_T_PRE_TTTT BIT(10) 3158c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_T_TTTT BIT(11) 3168c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_T_PRE_TBTT BIT(12) 3178c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_T_TBTT BIT(13) 3188c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_T_SLOT_IDLE BIT(14) 3198c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_T_TX_START BIT(15) 3208c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_START_BSS0n(n) BIT((n) ? 16 + ((n) - 1) : 0) 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_FLUSH MT_WF_ARB(0x11c) 3238c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_FLUSH_BSSn(n) BIT(0 + (n)) 3248c2ecf20Sopenharmony_ci#define MT_WF_ARB_BCN_FLUSH_BSS0n(n) BIT((n) ? 16 + ((n) - 1) : 0) 3258c2ecf20Sopenharmony_ci 3268c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_START MT_WF_ARB(0x120) 3278c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_START_BSSn(n) BIT(0 + (n)) 3288c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_START_BSS0n(n) BIT((n) ? 16 + ((n) - 1) : 0) 3298c2ecf20Sopenharmony_ci 3308c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_FLUSH MT_WF_ARB(0x124) 3318c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_FLUSH_BSSn(n) BIT(0 + (n)) 3328c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_FLUSH_BSS0n(n) BIT((n) ? 16 + ((n) - 1) : 0) 3338c2ecf20Sopenharmony_ci 3348c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_COUNT(n) MT_WF_ARB(0x128 + (n) * 4) 3358c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_COUNT_SHIFT 4 3368c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_COUNT_MASK GENMASK(3, 0) 3378c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_COUNT_B0_REG(n) MT_WF_ARB_CAB_COUNT(((n) > 12 ? 2 : \ 3388c2ecf20Sopenharmony_ci ((n) > 4 ? 1 : 0))) 3398c2ecf20Sopenharmony_ci#define MT_WF_ARB_CAB_COUNT_B0_SHIFT(n) (((n) > 12 ? (n) - 12 : \ 3408c2ecf20Sopenharmony_ci ((n) > 4 ? (n) - 4 : \ 3418c2ecf20Sopenharmony_ci (n) ? (n) + 3 : 0)) * 4) 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci#define MT_TX_ABORT MT_WF_ARB(0x134) 3448c2ecf20Sopenharmony_ci#define MT_TX_ABORT_EN BIT(0) 3458c2ecf20Sopenharmony_ci#define MT_TX_ABORT_WCID GENMASK(15, 8) 3468c2ecf20Sopenharmony_ci 3478c2ecf20Sopenharmony_ci#define MT_WF_TMAC_BASE 0x21600 3488c2ecf20Sopenharmony_ci#define MT_WF_TMAC(ofs) (MT_WF_TMAC_BASE + (ofs)) 3498c2ecf20Sopenharmony_ci 3508c2ecf20Sopenharmony_ci#define MT_TMAC_TCR MT_WF_TMAC(0x000) 3518c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_BLINK_SEL GENMASK(7, 6) 3528c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_PRE_RTS_GUARD GENMASK(11, 8) 3538c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_PRE_RTS_SEC_IDLE GENMASK(13, 12) 3548c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_RTS_SIGTA BIT(14) 3558c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_LDPC_OFS BIT(15) 3568c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_TX_STREAMS GENMASK(17, 16) 3578c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_SCH_IDLE_SEL GENMASK(19, 18) 3588c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_SCH_DET_PER_IOD BIT(20) 3598c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_DCH_DET_DISABLE BIT(21) 3608c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_TX_RIFS BIT(22) 3618c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_RX_RIFS_MODE BIT(23) 3628c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_TXOP_TBTT_CTL BIT(24) 3638c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_TBTT_TX_STOP_CTL BIT(25) 3648c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_TXOP_BURST_STOP BIT(26) 3658c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_RDG_RA_MODE BIT(27) 3668c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_RDG_RESP BIT(29) 3678c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_RDG_NO_PENDING BIT(30) 3688c2ecf20Sopenharmony_ci#define MT_TMAC_TCR_SMOOTHING BIT(31) 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_ci#define MT_WMM_TXOP_BASE MT_WF_TMAC(0x010) 3718c2ecf20Sopenharmony_ci#define MT_WMM_TXOP(_n) (MT_WMM_TXOP_BASE + \ 3728c2ecf20Sopenharmony_ci ((((_n) / 2) ^ 0x1) << 2)) 3738c2ecf20Sopenharmony_ci#define MT_WMM_TXOP_SHIFT(_n) (((_n) & 1) * 16) 3748c2ecf20Sopenharmony_ci#define MT_WMM_TXOP_MASK GENMASK(15, 0) 3758c2ecf20Sopenharmony_ci 3768c2ecf20Sopenharmony_ci#define MT_TIMEOUT_CCK MT_WF_TMAC(0x090) 3778c2ecf20Sopenharmony_ci#define MT_TIMEOUT_OFDM MT_WF_TMAC(0x094) 3788c2ecf20Sopenharmony_ci#define MT_TIMEOUT_VAL_PLCP GENMASK(15, 0) 3798c2ecf20Sopenharmony_ci#define MT_TIMEOUT_VAL_CCA GENMASK(31, 16) 3808c2ecf20Sopenharmony_ci 3818c2ecf20Sopenharmony_ci#define MT_TXREQ MT_WF_TMAC(0x09c) 3828c2ecf20Sopenharmony_ci#define MT_TXREQ_CCA_SRC_SEL GENMASK(31, 30) 3838c2ecf20Sopenharmony_ci 3848c2ecf20Sopenharmony_ci#define MT_RXREQ MT_WF_TMAC(0x0a0) 3858c2ecf20Sopenharmony_ci#define MT_RXREQ_DELAY GENMASK(8, 0) 3868c2ecf20Sopenharmony_ci 3878c2ecf20Sopenharmony_ci#define MT_IFS MT_WF_TMAC(0x0a4) 3888c2ecf20Sopenharmony_ci#define MT_IFS_EIFS GENMASK(8, 0) 3898c2ecf20Sopenharmony_ci#define MT_IFS_RIFS GENMASK(14, 10) 3908c2ecf20Sopenharmony_ci#define MT_IFS_SIFS GENMASK(22, 16) 3918c2ecf20Sopenharmony_ci#define MT_IFS_SLOT GENMASK(30, 24) 3928c2ecf20Sopenharmony_ci 3938c2ecf20Sopenharmony_ci#define MT_TMAC_PCR MT_WF_TMAC(0x0b4) 3948c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_RATE GENMASK(8, 0) 3958c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_RATE_FIXED BIT(15) 3968c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_ANT_ID GENMASK(21, 16) 3978c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_ANT_ID_SEL BIT(22) 3988c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_SPE_EN BIT(23) 3998c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_ANT_PRI GENMASK(26, 24) 4008c2ecf20Sopenharmony_ci#define MT_TMAC_PCR_ANT_PRI_SEL GENMASK(27) 4018c2ecf20Sopenharmony_ci 4028c2ecf20Sopenharmony_ci#define MT_WF_RMAC_BASE 0x21800 4038c2ecf20Sopenharmony_ci#define MT_WF_RMAC(ofs) (MT_WF_RMAC_BASE + (ofs)) 4048c2ecf20Sopenharmony_ci 4058c2ecf20Sopenharmony_ci#define MT_WF_RFCR MT_WF_RMAC(0x000) 4068c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_STBC_MULTI BIT(0) 4078c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_FCSFAIL BIT(1) 4088c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_VERSION BIT(3) 4098c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_PROBEREQ BIT(4) 4108c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_MCAST BIT(5) 4118c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_BCAST BIT(6) 4128c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_MCAST_FILTERED BIT(7) 4138c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_A3_MAC BIT(8) 4148c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_A3_BSSID BIT(9) 4158c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_A2_BSSID BIT(10) 4168c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_OTHER_BEACON BIT(11) 4178c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_FRAME_REPORT BIT(12) 4188c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_CTL_RSV BIT(13) 4198c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_CTS BIT(14) 4208c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_RTS BIT(15) 4218c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_DUPLICATE BIT(16) 4228c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_OTHER_BSS BIT(17) 4238c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_OTHER_UC BIT(18) 4248c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_OTHER_TIM BIT(19) 4258c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_NDPA BIT(20) 4268c2ecf20Sopenharmony_ci#define MT_WF_RFCR_DROP_UNWANTED_CTL BIT(21) 4278c2ecf20Sopenharmony_ci 4288c2ecf20Sopenharmony_ci#define MT_BSSID0(idx) MT_WF_RMAC(0x004 + (idx) * 8) 4298c2ecf20Sopenharmony_ci#define MT_BSSID1(idx) MT_WF_RMAC(0x008 + (idx) * 8) 4308c2ecf20Sopenharmony_ci#define MT_BSSID1_VALID BIT(16) 4318c2ecf20Sopenharmony_ci 4328c2ecf20Sopenharmony_ci#define MT_MAC_ADDR0(idx) MT_WF_RMAC(0x024 + (idx) * 8) 4338c2ecf20Sopenharmony_ci#define MT_MAC_ADDR1(idx) MT_WF_RMAC(0x028 + (idx) * 8) 4348c2ecf20Sopenharmony_ci#define MT_MAC_ADDR1_ADDR GENMASK(15, 0) 4358c2ecf20Sopenharmony_ci#define MT_MAC_ADDR1_VALID BIT(16) 4368c2ecf20Sopenharmony_ci 4378c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_0 MT_WF_RMAC(0x068) 4388c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_1 MT_WF_RMAC(0x06c) 4398c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_1_ADDR GENMASK(15, 0) 4408c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_1_TID GENMASK(19, 16) 4418c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_1_IGNORE_TID BIT(20) 4428c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_1_IGNORE_ALL BIT(21) 4438c2ecf20Sopenharmony_ci#define MT_BA_CONTROL_1_RESET BIT(22) 4448c2ecf20Sopenharmony_ci 4458c2ecf20Sopenharmony_ci#define MT_WF_RMACDR MT_WF_RMAC(0x078) 4468c2ecf20Sopenharmony_ci#define MT_WF_RMACDR_TSF_PROBERSP_DIS BIT(0) 4478c2ecf20Sopenharmony_ci#define MT_WF_RMACDR_TSF_TIM BIT(4) 4488c2ecf20Sopenharmony_ci#define MT_WF_RMACDR_MBSSID_MASK GENMASK(25, 24) 4498c2ecf20Sopenharmony_ci#define MT_WF_RMACDR_CHECK_HTC_BY_RATE BIT(26) 4508c2ecf20Sopenharmony_ci#define MT_WF_RMACDR_MAXLEN_20BIT BIT(30) 4518c2ecf20Sopenharmony_ci 4528c2ecf20Sopenharmony_ci#define MT_WF_RMAC_RMCR MT_WF_RMAC(0x080) 4538c2ecf20Sopenharmony_ci#define MT_WF_RMAC_RMCR_SMPS_MODE GENMASK(21, 20) 4548c2ecf20Sopenharmony_ci#define MT_WF_RMAC_RMCR_RX_STREAMS GENMASK(24, 22) 4558c2ecf20Sopenharmony_ci#define MT_WF_RMAC_RMCR_SMPS_RTS BIT(25) 4568c2ecf20Sopenharmony_ci 4578c2ecf20Sopenharmony_ci#define MT_WF_RMAC_CH_FREQ MT_WF_RMAC(0x090) 4588c2ecf20Sopenharmony_ci#define MT_WF_RMAC_MAXMINLEN MT_WF_RMAC(0x098) 4598c2ecf20Sopenharmony_ci#define MT_WF_RFCR1 MT_WF_RMAC(0x0a4) 4608c2ecf20Sopenharmony_ci#define MT_WF_RMAC_TMR_PA MT_WF_RMAC(0x0e0) 4618c2ecf20Sopenharmony_ci 4628c2ecf20Sopenharmony_ci#define MT_WF_SEC_BASE 0x21a00 4638c2ecf20Sopenharmony_ci#define MT_WF_SEC(ofs) (MT_WF_SEC_BASE + (ofs)) 4648c2ecf20Sopenharmony_ci 4658c2ecf20Sopenharmony_ci#define MT_SEC_SCR MT_WF_SEC(0x004) 4668c2ecf20Sopenharmony_ci#define MT_SEC_SCR_MASK_ORDER GENMASK(1, 0) 4678c2ecf20Sopenharmony_ci 4688c2ecf20Sopenharmony_ci#define MT_WTBL_OFF_BASE 0x23000 4698c2ecf20Sopenharmony_ci#define MT_WTBL_OFF(n) (MT_WTBL_OFF_BASE + (n)) 4708c2ecf20Sopenharmony_ci 4718c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE MT_WTBL_OFF(0x000) 4728c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_WLAN_IDX GENMASK(7, 0) 4738c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_WTBL2 BIT(11) 4748c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_ADM_COUNT_CLEAR BIT(12) 4758c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_RATE_UPDATE BIT(13) 4768c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_TX_COUNT_CLEAR BIT(14) 4778c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_RX_COUNT_CLEAR BIT(15) 4788c2ecf20Sopenharmony_ci#define MT_WTBL_UPDATE_BUSY BIT(16) 4798c2ecf20Sopenharmony_ci 4808c2ecf20Sopenharmony_ci#define MT_WTBL_RMVTCR MT_WTBL_OFF(0x008) 4818c2ecf20Sopenharmony_ci#define MT_WTBL_RMVTCR_RX_MV_MODE BIT(23) 4828c2ecf20Sopenharmony_ci 4838c2ecf20Sopenharmony_ci#define MT_LPON_BASE 0x24000 4848c2ecf20Sopenharmony_ci#define MT_LPON(n) (MT_LPON_BASE + (n)) 4858c2ecf20Sopenharmony_ci 4868c2ecf20Sopenharmony_ci#define MT_LPON_T0CR MT_LPON(0x010) 4878c2ecf20Sopenharmony_ci#define MT_LPON_T0CR_MODE GENMASK(1, 0) 4888c2ecf20Sopenharmony_ci 4898c2ecf20Sopenharmony_ci#define MT_LPON_UTTR0 MT_LPON(0x018) 4908c2ecf20Sopenharmony_ci#define MT_LPON_UTTR1 MT_LPON(0x01c) 4918c2ecf20Sopenharmony_ci 4928c2ecf20Sopenharmony_ci#define MT_LPON_BTEIR MT_LPON(0x020) 4938c2ecf20Sopenharmony_ci#define MT_LPON_BTEIR_MBSS_MODE GENMASK(31, 29) 4948c2ecf20Sopenharmony_ci 4958c2ecf20Sopenharmony_ci#define MT_PRE_TBTT MT_LPON(0x030) 4968c2ecf20Sopenharmony_ci#define MT_PRE_TBTT_MASK GENMASK(7, 0) 4978c2ecf20Sopenharmony_ci#define MT_PRE_TBTT_SHIFT 8 4988c2ecf20Sopenharmony_ci 4998c2ecf20Sopenharmony_ci#define MT_TBTT MT_LPON(0x034) 5008c2ecf20Sopenharmony_ci#define MT_TBTT_PERIOD GENMASK(15, 0) 5018c2ecf20Sopenharmony_ci#define MT_TBTT_DTIM_PERIOD GENMASK(23, 16) 5028c2ecf20Sopenharmony_ci#define MT_TBTT_TBTT_WAKE_PERIOD GENMASK(27, 24) 5038c2ecf20Sopenharmony_ci#define MT_TBTT_DTIM_WAKE_PERIOD GENMASK(30, 28) 5048c2ecf20Sopenharmony_ci#define MT_TBTT_CAL_ENABLE BIT(31) 5058c2ecf20Sopenharmony_ci 5068c2ecf20Sopenharmony_ci#define MT_TBTT_TIMER_CFG MT_LPON(0x05c) 5078c2ecf20Sopenharmony_ci 5088c2ecf20Sopenharmony_ci#define MT_LPON_SBTOR(n) MT_LPON(0x0a0) 5098c2ecf20Sopenharmony_ci#define MT_LPON_SBTOR_SUB_BSS_EN BIT(29) 5108c2ecf20Sopenharmony_ci#define MT_LPON_SBTOR_TIME_OFFSET GENMASK(19, 0) 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_ci#define MT_INT_WAKEUP_BASE 0x24400 5138c2ecf20Sopenharmony_ci#define MT_INT_WAKEUP(n) (MT_INT_WAKEUP_BASE + (n)) 5148c2ecf20Sopenharmony_ci 5158c2ecf20Sopenharmony_ci#define MT_HW_INT_STATUS(n) MT_INT_WAKEUP(0x3c + (n) * 8) 5168c2ecf20Sopenharmony_ci#define MT_HW_INT_MASK(n) MT_INT_WAKEUP(0x40 + (n) * 8) 5178c2ecf20Sopenharmony_ci 5188c2ecf20Sopenharmony_ci#define MT_HW_INT3_TBTT0 BIT(15) 5198c2ecf20Sopenharmony_ci#define MT_HW_INT3_PRE_TBTT0 BIT(31) 5208c2ecf20Sopenharmony_ci 5218c2ecf20Sopenharmony_ci#define MT_WTBL1_BASE 0x28000 5228c2ecf20Sopenharmony_ci 5238c2ecf20Sopenharmony_ci#define MT_WTBL_ON_BASE (MT_WTBL1_BASE + 0x2000) 5248c2ecf20Sopenharmony_ci#define MT_WTBL_ON(_n) (MT_WTBL_ON_BASE + (_n)) 5258c2ecf20Sopenharmony_ci 5268c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR0 MT_WTBL_ON(0x200) 5278c2ecf20Sopenharmony_ci 5288c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR1 MT_WTBL_ON(0x204) 5298c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR1_RATE0 GENMASK(11, 0) 5308c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR1_RATE1 GENMASK(23, 12) 5318c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR1_RATE2_LO GENMASK(31, 24) 5328c2ecf20Sopenharmony_ci 5338c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR2 MT_WTBL_ON(0x208) 5348c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR2_RATE2_HI GENMASK(3, 0) 5358c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR2_RATE3 GENMASK(15, 4) 5368c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR2_RATE4 GENMASK(27, 16) 5378c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR2_RATE5_LO GENMASK(31, 28) 5388c2ecf20Sopenharmony_ci 5398c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR3 MT_WTBL_ON(0x20c) 5408c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR3_RATE5_HI GENMASK(7, 0) 5418c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR3_RATE6 GENMASK(19, 8) 5428c2ecf20Sopenharmony_ci#define MT_WTBL_RIUCR3_RATE7 GENMASK(31, 20) 5438c2ecf20Sopenharmony_ci 5448c2ecf20Sopenharmony_ci#define MT_MIB_BASE 0x2c000 5458c2ecf20Sopenharmony_ci#define MT_MIB(_n) (MT_MIB_BASE + (_n)) 5468c2ecf20Sopenharmony_ci 5478c2ecf20Sopenharmony_ci#define MT_MIB_CTL MT_MIB(0x00) 5488c2ecf20Sopenharmony_ci#define MT_MIB_CTL_PSCCA_TIME GENMASK(13, 11) 5498c2ecf20Sopenharmony_ci#define MT_MIB_CTL_CCA_NAV_TX GENMASK(16, 14) 5508c2ecf20Sopenharmony_ci#define MT_MIB_CTL_ED_TIME GENMASK(30, 28) 5518c2ecf20Sopenharmony_ci#define MT_MIB_CTL_READ_CLR_DIS BIT(31) 5528c2ecf20Sopenharmony_ci 5538c2ecf20Sopenharmony_ci#define MT_MIB_STAT(_n) MT_MIB(0x08 + (_n) * 4) 5548c2ecf20Sopenharmony_ci 5558c2ecf20Sopenharmony_ci#define MT_MIB_STAT_CCA MT_MIB_STAT(9) 5568c2ecf20Sopenharmony_ci#define MT_MIB_STAT_CCA_MASK GENMASK(23, 0) 5578c2ecf20Sopenharmony_ci 5588c2ecf20Sopenharmony_ci#define MT_MIB_STAT_PSCCA MT_MIB_STAT(16) 5598c2ecf20Sopenharmony_ci#define MT_MIB_STAT_PSCCA_MASK GENMASK(23, 0) 5608c2ecf20Sopenharmony_ci 5618c2ecf20Sopenharmony_ci#define MT_TX_AGG_CNT(n) MT_MIB(0xa8 + ((n) << 2)) 5628c2ecf20Sopenharmony_ci 5638c2ecf20Sopenharmony_ci#define MT_MIB_STAT_ED MT_MIB_STAT(18) 5648c2ecf20Sopenharmony_ci#define MT_MIB_STAT_ED_MASK GENMASK(23, 0) 5658c2ecf20Sopenharmony_ci 5668c2ecf20Sopenharmony_ci#define MT_PCIE_REMAP_BASE_1 0x40000 5678c2ecf20Sopenharmony_ci#define MT_PCIE_REMAP_BASE_2 0x80000 5688c2ecf20Sopenharmony_ci 5698c2ecf20Sopenharmony_ci#define MT_TX_HW_QUEUE_MGMT 4 5708c2ecf20Sopenharmony_ci#define MT_TX_HW_QUEUE_MCU 5 5718c2ecf20Sopenharmony_ci#define MT_TX_HW_QUEUE_BCN 7 5728c2ecf20Sopenharmony_ci#define MT_TX_HW_QUEUE_BMC 8 5738c2ecf20Sopenharmony_ci 5748c2ecf20Sopenharmony_ci#define MT_LED_BASE_PHYS 0x80024000 5758c2ecf20Sopenharmony_ci#define MT_LED_PHYS(_n) (MT_LED_BASE_PHYS + (_n)) 5768c2ecf20Sopenharmony_ci 5778c2ecf20Sopenharmony_ci#define MT_LED_CTRL MT_LED_PHYS(0x00) 5788c2ecf20Sopenharmony_ci 5798c2ecf20Sopenharmony_ci#define MT_LED_CTRL_REPLAY(_n) BIT(0 + (8 * (_n))) 5808c2ecf20Sopenharmony_ci#define MT_LED_CTRL_POLARITY(_n) BIT(1 + (8 * (_n))) 5818c2ecf20Sopenharmony_ci#define MT_LED_CTRL_TX_BLINK_MODE(_n) BIT(2 + (8 * (_n))) 5828c2ecf20Sopenharmony_ci#define MT_LED_CTRL_TX_MANUAL_BLINK(_n) BIT(3 + (8 * (_n))) 5838c2ecf20Sopenharmony_ci#define MT_LED_CTRL_TX_OVER_BLINK(_n) BIT(5 + (8 * (_n))) 5848c2ecf20Sopenharmony_ci#define MT_LED_CTRL_KICK(_n) BIT(7 + (8 * (_n))) 5858c2ecf20Sopenharmony_ci 5868c2ecf20Sopenharmony_ci#define MT_LED_STATUS_0(_n) MT_LED_PHYS(0x10 + ((_n) * 8)) 5878c2ecf20Sopenharmony_ci#define MT_LED_STATUS_1(_n) MT_LED_PHYS(0x14 + ((_n) * 8)) 5888c2ecf20Sopenharmony_ci#define MT_LED_STATUS_OFF GENMASK(31, 24) 5898c2ecf20Sopenharmony_ci#define MT_LED_STATUS_ON GENMASK(23, 16) 5908c2ecf20Sopenharmony_ci#define MT_LED_STATUS_DURATION GENMASK(15, 0) 5918c2ecf20Sopenharmony_ci 5928c2ecf20Sopenharmony_ci#define MT_CLIENT_BASE_PHYS_ADDR 0x800c0000 5938c2ecf20Sopenharmony_ci 5948c2ecf20Sopenharmony_ci#define MT_CLIENT_TMAC_INFO_TEMPLATE 0x040 5958c2ecf20Sopenharmony_ci 5968c2ecf20Sopenharmony_ci#define MT_CLIENT_STATUS 0x06c 5978c2ecf20Sopenharmony_ci 5988c2ecf20Sopenharmony_ci#define MT_CLIENT_RESET_TX 0x070 5998c2ecf20Sopenharmony_ci#define MT_CLIENT_RESET_TX_R_E_1 BIT(16) 6008c2ecf20Sopenharmony_ci#define MT_CLIENT_RESET_TX_R_E_2 BIT(17) 6018c2ecf20Sopenharmony_ci#define MT_CLIENT_RESET_TX_R_E_1_S BIT(20) 6028c2ecf20Sopenharmony_ci#define MT_CLIENT_RESET_TX_R_E_2_S BIT(21) 6038c2ecf20Sopenharmony_ci 6048c2ecf20Sopenharmony_ci#define MT_EFUSE_BASE 0x81070000 6058c2ecf20Sopenharmony_ci 6068c2ecf20Sopenharmony_ci#define MT_EFUSE_BASE_CTRL 0x000 6078c2ecf20Sopenharmony_ci#define MT_EFUSE_BASE_CTRL_EMPTY BIT(30) 6088c2ecf20Sopenharmony_ci 6098c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL 0x008 6108c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_AOUT GENMASK(5, 0) 6118c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_MODE GENMASK(7, 6) 6128c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_LDO_OFF_TIME GENMASK(13, 8) 6138c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_LDO_ON_TIME GENMASK(15, 14) 6148c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_AIN GENMASK(25, 16) 6158c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_VALID BIT(29) 6168c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_KICK BIT(30) 6178c2ecf20Sopenharmony_ci#define MT_EFUSE_CTRL_SEL BIT(31) 6188c2ecf20Sopenharmony_ci 6198c2ecf20Sopenharmony_ci#define MT_EFUSE_WDATA(_i) (0x010 + ((_i) * 4)) 6208c2ecf20Sopenharmony_ci#define MT_EFUSE_RDATA(_i) (0x030 + ((_i) * 4)) 6218c2ecf20Sopenharmony_ci 6228c2ecf20Sopenharmony_ci#define MT_CLIENT_RXINF 0x068 6238c2ecf20Sopenharmony_ci#define MT_CLIENT_RXINF_RXSH_GROUPS GENMASK(2, 0) 6248c2ecf20Sopenharmony_ci 6258c2ecf20Sopenharmony_ci#define MT_PSE_BASE_PHYS_ADDR 0xa0000000 6268c2ecf20Sopenharmony_ci 6278c2ecf20Sopenharmony_ci#define MT_PSE_WTBL_2_PHYS_ADDR 0xa5000000 6288c2ecf20Sopenharmony_ci 6298c2ecf20Sopenharmony_ci#define MT_WTBL1_SIZE (8 * 4) 6308c2ecf20Sopenharmony_ci#define MT_WTBL2_SIZE (16 * 4) 6318c2ecf20Sopenharmony_ci#define MT_WTBL3_OFFSET (MT7603_WTBL_SIZE * MT_WTBL2_SIZE) 6328c2ecf20Sopenharmony_ci#define MT_WTBL3_SIZE (16 * 4) 6338c2ecf20Sopenharmony_ci#define MT_WTBL4_OFFSET (MT7603_WTBL_SIZE * MT_WTBL3_SIZE + \ 6348c2ecf20Sopenharmony_ci MT_WTBL3_OFFSET) 6358c2ecf20Sopenharmony_ci#define MT_WTBL4_SIZE (8 * 4) 6368c2ecf20Sopenharmony_ci 6378c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_ADDR_HI GENMASK(15, 0) 6388c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_MUAR_IDX GENMASK(21, 16) 6398c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_CHECK_A1 BIT(22) 6408c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_KEY_IDX GENMASK(24, 23) 6418c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_CHECK_KEY_IDX BIT(25) 6428c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_KEY_VALID BIT(26) 6438c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_IK_VALID BIT(27) 6448c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_VALID BIT(28) 6458c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_CHECK_A2 BIT(29) 6468c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_RX_DATA_VALID BIT(30) 6478c2ecf20Sopenharmony_ci#define MT_WTBL1_W0_WRITE_BURST BIT(31) 6488c2ecf20Sopenharmony_ci 6498c2ecf20Sopenharmony_ci#define MT_WTBL1_W1_ADDR_LO GENMASK(31, 0) 6508c2ecf20Sopenharmony_ci 6518c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_MPDU_DENSITY GENMASK(2, 0) 6528c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_KEY_TYPE GENMASK(6, 3) 6538c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_EVEN_PN BIT(7) 6548c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_TO_DS BIT(8) 6558c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_FROM_DS BIT(9) 6568c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_HEADER_TRANS BIT(10) 6578c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_AMPDU_FACTOR GENMASK(13, 11) 6588c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_PWR_MGMT BIT(14) 6598c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_RDG BIT(15) 6608c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_RTS BIT(16) 6618c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_CFACK BIT(17) 6628c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_RDG_BA BIT(18) 6638c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_SMPS BIT(19) 6648c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_TXS_BAF_REPORT BIT(20) 6658c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_DYN_BW BIT(21) 6668c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_LDPC BIT(22) 6678c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_ITXBF BIT(23) 6688c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_ETXBF BIT(24) 6698c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_TXOP_PS BIT(25) 6708c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_MESH BIT(26) 6718c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_QOS BIT(27) 6728c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_HT BIT(28) 6738c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_VHT BIT(29) 6748c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_ADMISSION_CONTROL BIT(30) 6758c2ecf20Sopenharmony_ci#define MT_WTBL1_W2_GROUP_ID BIT(31) 6768c2ecf20Sopenharmony_ci 6778c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_WTBL2_FRAME_ID GENMASK(10, 0) 6788c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_WTBL2_ENTRY_ID GENMASK(15, 11) 6798c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_WTBL4_FRAME_ID GENMASK(26, 16) 6808c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_CHECK_PER BIT(27) 6818c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_KEEP_I_PSM BIT(28) 6828c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_I_PSM BIT(29) 6838c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_POWER_SAVE BIT(30) 6848c2ecf20Sopenharmony_ci#define MT_WTBL1_W3_SKIP_TX BIT(31) 6858c2ecf20Sopenharmony_ci 6868c2ecf20Sopenharmony_ci#define MT_WTBL1_W4_WTBL3_FRAME_ID GENMASK(10, 0) 6878c2ecf20Sopenharmony_ci#define MT_WTBL1_W4_WTBL3_ENTRY_ID GENMASK(16, 11) 6888c2ecf20Sopenharmony_ci#define MT_WTBL1_W4_WTBL4_ENTRY_ID GENMASK(22, 17) 6898c2ecf20Sopenharmony_ci#define MT_WTBL1_W4_PARTIAL_AID GENMASK(31, 23) 6908c2ecf20Sopenharmony_ci 6918c2ecf20Sopenharmony_ci#define MT_WTBL2_W0_PN_LO GENMASK(31, 0) 6928c2ecf20Sopenharmony_ci 6938c2ecf20Sopenharmony_ci#define MT_WTBL2_W1_PN_HI GENMASK(15, 0) 6948c2ecf20Sopenharmony_ci#define MT_WTBL2_W1_NON_QOS_SEQNO GENMASK(27, 16) 6958c2ecf20Sopenharmony_ci 6968c2ecf20Sopenharmony_ci#define MT_WTBL2_W2_TID0_SN GENMASK(11, 0) 6978c2ecf20Sopenharmony_ci#define MT_WTBL2_W2_TID1_SN GENMASK(23, 12) 6988c2ecf20Sopenharmony_ci#define MT_WTBL2_W2_TID2_SN_LO GENMASK(31, 24) 6998c2ecf20Sopenharmony_ci 7008c2ecf20Sopenharmony_ci#define MT_WTBL2_W3_TID2_SN_HI GENMASK(3, 0) 7018c2ecf20Sopenharmony_ci#define MT_WTBL2_W3_TID3_SN GENMASK(15, 4) 7028c2ecf20Sopenharmony_ci#define MT_WTBL2_W3_TID4_SN GENMASK(27, 16) 7038c2ecf20Sopenharmony_ci#define MT_WTBL2_W3_TID5_SN_LO GENMASK(31, 28) 7048c2ecf20Sopenharmony_ci 7058c2ecf20Sopenharmony_ci#define MT_WTBL2_W4_TID5_SN_HI GENMASK(7, 0) 7068c2ecf20Sopenharmony_ci#define MT_WTBL2_W4_TID6_SN GENMASK(19, 8) 7078c2ecf20Sopenharmony_ci#define MT_WTBL2_W4_TID7_SN GENMASK(31, 20) 7088c2ecf20Sopenharmony_ci 7098c2ecf20Sopenharmony_ci#define MT_WTBL2_W5_TX_COUNT_RATE1 GENMASK(15, 0) 7108c2ecf20Sopenharmony_ci#define MT_WTBL2_W5_FAIL_COUNT_RATE1 GENAMSK(31, 16) 7118c2ecf20Sopenharmony_ci 7128c2ecf20Sopenharmony_ci#define MT_WTBL2_W6_TX_COUNT_RATE2 GENMASK(7, 0) 7138c2ecf20Sopenharmony_ci#define MT_WTBL2_W6_TX_COUNT_RATE3 GENMASK(15, 8) 7148c2ecf20Sopenharmony_ci#define MT_WTBL2_W6_TX_COUNT_RATE4 GENMASK(23, 16) 7158c2ecf20Sopenharmony_ci#define MT_WTBL2_W6_TX_COUNT_RATE5 GENMASK(31, 24) 7168c2ecf20Sopenharmony_ci 7178c2ecf20Sopenharmony_ci#define MT_WTBL2_W7_TX_COUNT_CUR_BW GENMASK(15, 0) 7188c2ecf20Sopenharmony_ci#define MT_WTBL2_W7_FAIL_COUNT_CUR_BW GENMASK(31, 16) 7198c2ecf20Sopenharmony_ci 7208c2ecf20Sopenharmony_ci#define MT_WTBL2_W8_TX_COUNT_OTHER_BW GENMASK(15, 0) 7218c2ecf20Sopenharmony_ci#define MT_WTBL2_W8_FAIL_COUNT_OTHER_BW GENMASK(31, 16) 7228c2ecf20Sopenharmony_ci 7238c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_POWER_OFFSET GENMASK(4, 0) 7248c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_SPATIAL_EXT BIT(5) 7258c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_ANT_PRIORITY GENMASK(8, 6) 7268c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_CC_BW_SEL GENMASK(10, 9) 7278c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_CHANGE_BW_RATE GENMASK(13, 11) 7288c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_BW_CAP GENMASK(15, 14) 7298c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_SHORT_GI_20 BIT(16) 7308c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_SHORT_GI_40 BIT(17) 7318c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_SHORT_GI_80 BIT(18) 7328c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_SHORT_GI_160 BIT(19) 7338c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_MPDU_FAIL_COUNT GENMASK(25, 23) 7348c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_MPDU_OK_COUNT GENMASK(28, 26) 7358c2ecf20Sopenharmony_ci#define MT_WTBL2_W9_RATE_IDX GENMASK(31, 29) 7368c2ecf20Sopenharmony_ci 7378c2ecf20Sopenharmony_ci#define MT_WTBL2_W10_RATE1 GENMASK(11, 0) 7388c2ecf20Sopenharmony_ci#define MT_WTBL2_W10_RATE2 GENMASK(23, 12) 7398c2ecf20Sopenharmony_ci#define MT_WTBL2_W10_RATE3_LO GENMASK(31, 24) 7408c2ecf20Sopenharmony_ci 7418c2ecf20Sopenharmony_ci#define MT_WTBL2_W11_RATE3_HI GENMASK(3, 0) 7428c2ecf20Sopenharmony_ci#define MT_WTBL2_W11_RATE4 GENMASK(15, 4) 7438c2ecf20Sopenharmony_ci#define MT_WTBL2_W11_RATE5 GENMASK(27, 16) 7448c2ecf20Sopenharmony_ci#define MT_WTBL2_W11_RATE6_LO GENMASK(31, 28) 7458c2ecf20Sopenharmony_ci 7468c2ecf20Sopenharmony_ci#define MT_WTBL2_W12_RATE6_HI GENMASK(7, 0) 7478c2ecf20Sopenharmony_ci#define MT_WTBL2_W12_RATE7 GENMASK(19, 8) 7488c2ecf20Sopenharmony_ci#define MT_WTBL2_W12_RATE8 GENMASK(31, 20) 7498c2ecf20Sopenharmony_ci 7508c2ecf20Sopenharmony_ci#define MT_WTBL2_W13_AVG_RCPI0 GENMASK(7, 0) 7518c2ecf20Sopenharmony_ci#define MT_WTBL2_W13_AVG_RCPI1 GENMASK(15, 8) 7528c2ecf20Sopenharmony_ci#define MT_WTBL2_W13_AVG_RCPI2 GENAMSK(23, 16) 7538c2ecf20Sopenharmony_ci 7548c2ecf20Sopenharmony_ci#define MT_WTBL2_W14_CC_NOISE_1S GENMASK(6, 0) 7558c2ecf20Sopenharmony_ci#define MT_WTBL2_W14_CC_NOISE_2S GENMASK(13, 7) 7568c2ecf20Sopenharmony_ci#define MT_WTBL2_W14_CC_NOISE_3S GENMASK(20, 14) 7578c2ecf20Sopenharmony_ci#define MT_WTBL2_W14_CHAN_EST_RMS GENMASK(24, 21) 7588c2ecf20Sopenharmony_ci#define MT_WTBL2_W14_CC_NOISE_SEL BIT(15) 7598c2ecf20Sopenharmony_ci#define MT_WTBL2_W14_ANT_SEL GENMASK(31, 26) 7608c2ecf20Sopenharmony_ci 7618c2ecf20Sopenharmony_ci#define MT_WTBL2_W15_BA_WIN_SIZE GENMASK(2, 0) 7628c2ecf20Sopenharmony_ci#define MT_WTBL2_W15_BA_WIN_SIZE_SHIFT 3 7638c2ecf20Sopenharmony_ci#define MT_WTBL2_W15_BA_EN_TIDS GENMASK(31, 24) 7648c2ecf20Sopenharmony_ci 7658c2ecf20Sopenharmony_ci#define MT_WTBL1_OR (MT_WTBL1_BASE + 0x2300) 7668c2ecf20Sopenharmony_ci#define MT_WTBL1_OR_PSM_WRITE BIT(31) 7678c2ecf20Sopenharmony_ci 7688c2ecf20Sopenharmony_cienum mt7603_cipher_type { 7698c2ecf20Sopenharmony_ci MT_CIPHER_NONE, 7708c2ecf20Sopenharmony_ci MT_CIPHER_WEP40, 7718c2ecf20Sopenharmony_ci MT_CIPHER_TKIP, 7728c2ecf20Sopenharmony_ci MT_CIPHER_TKIP_NO_MIC, 7738c2ecf20Sopenharmony_ci MT_CIPHER_AES_CCMP, 7748c2ecf20Sopenharmony_ci MT_CIPHER_WEP104, 7758c2ecf20Sopenharmony_ci MT_CIPHER_BIP_CMAC_128, 7768c2ecf20Sopenharmony_ci MT_CIPHER_WEP128, 7778c2ecf20Sopenharmony_ci MT_CIPHER_WAPI, 7788c2ecf20Sopenharmony_ci}; 7798c2ecf20Sopenharmony_ci 7808c2ecf20Sopenharmony_ci#endif 781