198686cd2SShayne Chen /* SPDX-License-Identifier: ISC */ 298686cd2SShayne Chen /* 398686cd2SShayne Chen * Copyright (C) 2022 MediaTek Inc. 498686cd2SShayne Chen */ 598686cd2SShayne Chen 698686cd2SShayne Chen #ifndef __MT7996_REGS_H 798686cd2SShayne Chen #define __MT7996_REGS_H 898686cd2SShayne Chen 998686cd2SShayne Chen struct __map { 1098686cd2SShayne Chen u32 phys; 1198686cd2SShayne Chen u32 mapped; 1298686cd2SShayne Chen u32 size; 1398686cd2SShayne Chen }; 1498686cd2SShayne Chen 1598686cd2SShayne Chen struct __base { 1698686cd2SShayne Chen u32 band_base[__MT_MAX_BAND]; 1798686cd2SShayne Chen }; 1898686cd2SShayne Chen 1998686cd2SShayne Chen /* used to differentiate between generations */ 2098686cd2SShayne Chen struct mt7996_reg_desc { 2198686cd2SShayne Chen const struct __base *base; 2298686cd2SShayne Chen const struct __map *map; 2398686cd2SShayne Chen u32 map_size; 2498686cd2SShayne Chen }; 2598686cd2SShayne Chen 2698686cd2SShayne Chen enum base_rev { 2798686cd2SShayne Chen WF_AGG_BASE, 28ea5d99d0SRyder Lee WF_ARB_BASE, 2998686cd2SShayne Chen WF_TMAC_BASE, 3098686cd2SShayne Chen WF_RMAC_BASE, 3198686cd2SShayne Chen WF_DMA_BASE, 32ea5d99d0SRyder Lee WF_WTBLOFF_BASE, 33ea5d99d0SRyder Lee WF_ETBF_BASE, 34ea5d99d0SRyder Lee WF_LPON_BASE, 35ea5d99d0SRyder Lee WF_MIB_BASE, 36793445cfSShayne Chen WF_RATE_BASE, 3798686cd2SShayne Chen __MT_REG_BASE_MAX, 3898686cd2SShayne Chen }; 3998686cd2SShayne Chen 4098686cd2SShayne Chen #define __BASE(_id, _band) (dev->reg.base[(_id)].band_base[(_band)]) 4198686cd2SShayne Chen 4298686cd2SShayne Chen #define MT_MCU_INT_EVENT 0x2108 4398686cd2SShayne Chen #define MT_MCU_INT_EVENT_DMA_STOPPED BIT(0) 4498686cd2SShayne Chen #define MT_MCU_INT_EVENT_DMA_INIT BIT(1) 4598686cd2SShayne Chen #define MT_MCU_INT_EVENT_RESET_DONE BIT(3) 4698686cd2SShayne Chen 4798686cd2SShayne Chen /* PLE */ 4898686cd2SShayne Chen #define MT_PLE_BASE 0x820c0000 4998686cd2SShayne Chen #define MT_PLE(ofs) (MT_PLE_BASE + (ofs)) 5098686cd2SShayne Chen 5198686cd2SShayne Chen #define MT_FL_Q_EMPTY MT_PLE(0x360) 5298686cd2SShayne Chen #define MT_FL_Q0_CTRL MT_PLE(0x3e0) 5398686cd2SShayne Chen #define MT_FL_Q2_CTRL MT_PLE(0x3e8) 5498686cd2SShayne Chen #define MT_FL_Q3_CTRL MT_PLE(0x3ec) 5598686cd2SShayne Chen 5698686cd2SShayne Chen #define MT_PLE_FREEPG_CNT MT_PLE(0x380) 5798686cd2SShayne Chen #define MT_PLE_FREEPG_HEAD_TAIL MT_PLE(0x384) 5898686cd2SShayne Chen #define MT_PLE_PG_HIF_GROUP MT_PLE(0x00c) 5998686cd2SShayne Chen #define MT_PLE_HIF_PG_INFO MT_PLE(0x388) 6098686cd2SShayne Chen 6198686cd2SShayne Chen #define MT_PLE_AC_QEMPTY(ac, n) MT_PLE(0x600 + 0x80 * (ac) + ((n) << 2)) 6298686cd2SShayne Chen #define MT_PLE_AMSDU_PACK_MSDU_CNT(n) MT_PLE(0x10e0 + ((n) << 2)) 6398686cd2SShayne Chen 6498686cd2SShayne Chen /* WF MDP TOP */ 6598686cd2SShayne Chen #define MT_MDP_BASE 0x820cc000 6698686cd2SShayne Chen #define MT_MDP(ofs) (MT_MDP_BASE + (ofs)) 6798686cd2SShayne Chen 6898686cd2SShayne Chen #define MT_MDP_DCR2 MT_MDP(0x8e8) 6998686cd2SShayne Chen #define MT_MDP_DCR2_RX_TRANS_SHORT BIT(2) 7098686cd2SShayne Chen 7198686cd2SShayne Chen /* TMAC: band 0(0x820e4000), band 1(0x820f4000), band 2(0x830e4000) */ 7298686cd2SShayne Chen #define MT_WF_TMAC_BASE(_band) __BASE(WF_TMAC_BASE, (_band)) 7398686cd2SShayne Chen #define MT_WF_TMAC(_band, ofs) (MT_WF_TMAC_BASE(_band) + (ofs)) 7498686cd2SShayne Chen 7598686cd2SShayne Chen #define MT_TMAC_TCR0(_band) MT_WF_TMAC(_band, 0) 7698686cd2SShayne Chen #define MT_TMAC_TCR0_TX_BLINK GENMASK(7, 6) 7798686cd2SShayne Chen 7898686cd2SShayne Chen #define MT_TMAC_CDTR(_band) MT_WF_TMAC(_band, 0x0c8) 7998686cd2SShayne Chen #define MT_TMAC_ODTR(_band) MT_WF_TMAC(_band, 0x0cc) 8098686cd2SShayne Chen #define MT_TIMEOUT_VAL_PLCP GENMASK(15, 0) 8198686cd2SShayne Chen #define MT_TIMEOUT_VAL_CCA GENMASK(31, 16) 8298686cd2SShayne Chen 8398686cd2SShayne Chen #define MT_TMAC_ICR0(_band) MT_WF_TMAC(_band, 0x014) 8498686cd2SShayne Chen #define MT_IFS_EIFS_OFDM GENMASK(8, 0) 8598686cd2SShayne Chen #define MT_IFS_RIFS GENMASK(14, 10) 8698686cd2SShayne Chen #define MT_IFS_SIFS GENMASK(22, 16) 8798686cd2SShayne Chen #define MT_IFS_SLOT GENMASK(30, 24) 8898686cd2SShayne Chen 8998686cd2SShayne Chen #define MT_TMAC_ICR1(_band) MT_WF_TMAC(_band, 0x018) 9098686cd2SShayne Chen #define MT_IFS_EIFS_CCK GENMASK(8, 0) 9198686cd2SShayne Chen 9298686cd2SShayne Chen /* WF DMA TOP: band 0(0x820e7000), band 1(0x820f7000), band 2(0x830e7000) */ 9398686cd2SShayne Chen #define MT_WF_DMA_BASE(_band) __BASE(WF_DMA_BASE, (_band)) 9498686cd2SShayne Chen #define MT_WF_DMA(_band, ofs) (MT_WF_DMA_BASE(_band) + (ofs)) 9598686cd2SShayne Chen 9698686cd2SShayne Chen #define MT_DMA_DCR0(_band) MT_WF_DMA(_band, 0x000) 9798686cd2SShayne Chen #define MT_DMA_DCR0_RXD_G5_EN BIT(23) 9898686cd2SShayne Chen 9998686cd2SShayne Chen #define MT_DMA_TCRF1(_band) MT_WF_DMA(_band, 0x054) 10098686cd2SShayne Chen #define MT_DMA_TCRF1_QIDX GENMASK(15, 13) 10198686cd2SShayne Chen 102ea5d99d0SRyder Lee /* WTBLOFF TOP: band 0(0x820e9000), band 1(0x820f9000), band 2(0x830e9000) */ 103ea5d99d0SRyder Lee #define MT_WTBLOFF_BASE(_band) __BASE(WF_WTBLOFF_BASE, (_band)) 104ea5d99d0SRyder Lee #define MT_WTBLOFF(_band, ofs) (MT_WTBLOFF_BASE(_band) + (ofs)) 105ea5d99d0SRyder Lee 106ea5d99d0SRyder Lee #define MT_WTBLOFF_RSCR(_band) MT_WTBLOFF(_band, 0x008) 107ea5d99d0SRyder Lee #define MT_WTBLOFF_RSCR_RCPI_MODE GENMASK(31, 30) 108ea5d99d0SRyder Lee #define MT_WTBLOFF_RSCR_RCPI_PARAM GENMASK(25, 24) 109ea5d99d0SRyder Lee 11098686cd2SShayne Chen /* ETBF: band 0(0x820ea000), band 1(0x820fa000), band 2(0x830ea000) */ 11198686cd2SShayne Chen #define MT_WF_ETBF_BASE(_band) __BASE(WF_ETBF_BASE, (_band)) 11298686cd2SShayne Chen #define MT_WF_ETBF(_band, ofs) (MT_WF_ETBF_BASE(_band) + (ofs)) 11398686cd2SShayne Chen 11498686cd2SShayne Chen #define MT_ETBF_RX_FB_CONT(_band) MT_WF_ETBF(_band, 0x100) 11598686cd2SShayne Chen #define MT_ETBF_RX_FB_BW GENMASK(10, 8) 11698686cd2SShayne Chen #define MT_ETBF_RX_FB_NC GENMASK(7, 4) 11798686cd2SShayne Chen #define MT_ETBF_RX_FB_NR GENMASK(3, 0) 11898686cd2SShayne Chen 11998686cd2SShayne Chen /* LPON: band 0(0x820eb000), band 1(0x820fb000), band 2(0x830eb000) */ 12098686cd2SShayne Chen #define MT_WF_LPON_BASE(_band) __BASE(WF_LPON_BASE, (_band)) 12198686cd2SShayne Chen #define MT_WF_LPON(_band, ofs) (MT_WF_LPON_BASE(_band) + (ofs)) 12298686cd2SShayne Chen 12398686cd2SShayne Chen #define MT_LPON_UTTR0(_band) MT_WF_LPON(_band, 0x360) 12498686cd2SShayne Chen #define MT_LPON_UTTR1(_band) MT_WF_LPON(_band, 0x364) 12598686cd2SShayne Chen #define MT_LPON_FRCR(_band) MT_WF_LPON(_band, 0x37c) 12698686cd2SShayne Chen 12798686cd2SShayne Chen #define MT_LPON_TCR(_band, n) MT_WF_LPON(_band, 0x0a8 + (((n) * 4) << 4)) 12898686cd2SShayne Chen #define MT_LPON_TCR_SW_MODE GENMASK(1, 0) 12998686cd2SShayne Chen #define MT_LPON_TCR_SW_WRITE BIT(0) 13098686cd2SShayne Chen #define MT_LPON_TCR_SW_ADJUST BIT(1) 13198686cd2SShayne Chen #define MT_LPON_TCR_SW_READ GENMASK(1, 0) 13298686cd2SShayne Chen 13398686cd2SShayne Chen /* MIB: band 0(0x820ed000), band 1(0x820fd000), band 2(0x830ed000)*/ 13498686cd2SShayne Chen /* These counters are (mostly?) clear-on-read. So, some should not 13598686cd2SShayne Chen * be read at all in case firmware is already reading them. These 13698686cd2SShayne Chen * are commented with 'DNR' below. The DNR stats will be read by querying 13798686cd2SShayne Chen * the firmware API for the appropriate message. For counters the driver 13898686cd2SShayne Chen * does read, the driver should accumulate the counters. 13998686cd2SShayne Chen */ 14098686cd2SShayne Chen #define MT_WF_MIB_BASE(_band) __BASE(WF_MIB_BASE, (_band)) 14198686cd2SShayne Chen #define MT_WF_MIB(_band, ofs) (MT_WF_MIB_BASE(_band) + (ofs)) 14298686cd2SShayne Chen 14398686cd2SShayne Chen #define MT_MIB_BSCR0(_band) MT_WF_MIB(_band, 0x9cc) 14498686cd2SShayne Chen #define MT_MIB_BSCR1(_band) MT_WF_MIB(_band, 0x9d0) 14598686cd2SShayne Chen #define MT_MIB_BSCR2(_band) MT_WF_MIB(_band, 0x9d4) 14698686cd2SShayne Chen #define MT_MIB_BSCR3(_band) MT_WF_MIB(_band, 0x9d8) 14798686cd2SShayne Chen #define MT_MIB_BSCR4(_band) MT_WF_MIB(_band, 0x9dc) 14898686cd2SShayne Chen #define MT_MIB_BSCR5(_band) MT_WF_MIB(_band, 0x9e0) 14998686cd2SShayne Chen #define MT_MIB_BSCR6(_band) MT_WF_MIB(_band, 0x9e4) 15098686cd2SShayne Chen #define MT_MIB_BSCR7(_band) MT_WF_MIB(_band, 0x9e8) 15198686cd2SShayne Chen #define MT_MIB_BSCR17(_band) MT_WF_MIB(_band, 0xa10) 15298686cd2SShayne Chen 15398686cd2SShayne Chen #define MT_MIB_TSCR5(_band) MT_WF_MIB(_band, 0x6c4) 15498686cd2SShayne Chen #define MT_MIB_TSCR6(_band) MT_WF_MIB(_band, 0x6c8) 15598686cd2SShayne Chen #define MT_MIB_TSCR7(_band) MT_WF_MIB(_band, 0x6d0) 15698686cd2SShayne Chen 15798686cd2SShayne Chen #define MT_MIB_RSCR1(_band) MT_WF_MIB(_band, 0x7ac) 15898686cd2SShayne Chen /* rx mpdu counter, full 32 bits */ 15998686cd2SShayne Chen #define MT_MIB_RSCR31(_band) MT_WF_MIB(_band, 0x964) 16098686cd2SShayne Chen #define MT_MIB_RSCR33(_band) MT_WF_MIB(_band, 0x96c) 16198686cd2SShayne Chen 16298686cd2SShayne Chen #define MT_MIB_SDR6(_band) MT_WF_MIB(_band, 0x020) 16398686cd2SShayne Chen #define MT_MIB_SDR6_CHANNEL_IDL_CNT_MASK GENMASK(15, 0) 16498686cd2SShayne Chen 16598686cd2SShayne Chen #define MT_MIB_RVSR0(_band) MT_WF_MIB(_band, 0x720) 16698686cd2SShayne Chen 16798686cd2SShayne Chen #define MT_MIB_RSCR35(_band) MT_WF_MIB(_band, 0x974) 16898686cd2SShayne Chen #define MT_MIB_RSCR36(_band) MT_WF_MIB(_band, 0x978) 16998686cd2SShayne Chen 17098686cd2SShayne Chen /* tx ampdu cnt, full 32 bits */ 17198686cd2SShayne Chen #define MT_MIB_TSCR0(_band) MT_WF_MIB(_band, 0x6b0) 17298686cd2SShayne Chen #define MT_MIB_TSCR2(_band) MT_WF_MIB(_band, 0x6b8) 17398686cd2SShayne Chen 17498686cd2SShayne Chen /* counts all mpdus in ampdu, regardless of success */ 17598686cd2SShayne Chen #define MT_MIB_TSCR3(_band) MT_WF_MIB(_band, 0x6bc) 17698686cd2SShayne Chen 17798686cd2SShayne Chen /* counts all successfully tx'd mpdus in ampdu */ 17898686cd2SShayne Chen #define MT_MIB_TSCR4(_band) MT_WF_MIB(_band, 0x6c0) 17998686cd2SShayne Chen 18098686cd2SShayne Chen /* rx ampdu count, 32-bit */ 18198686cd2SShayne Chen #define MT_MIB_RSCR27(_band) MT_WF_MIB(_band, 0x954) 18298686cd2SShayne Chen 18398686cd2SShayne Chen /* rx ampdu bytes count, 32-bit */ 18498686cd2SShayne Chen #define MT_MIB_RSCR28(_band) MT_WF_MIB(_band, 0x958) 18598686cd2SShayne Chen 18698686cd2SShayne Chen /* rx ampdu valid subframe count */ 18798686cd2SShayne Chen #define MT_MIB_RSCR29(_band) MT_WF_MIB(_band, 0x95c) 18898686cd2SShayne Chen 18998686cd2SShayne Chen /* rx ampdu valid subframe bytes count, 32bits */ 19098686cd2SShayne Chen #define MT_MIB_RSCR30(_band) MT_WF_MIB(_band, 0x960) 19198686cd2SShayne Chen 19298686cd2SShayne Chen /* remaining windows protected stats */ 19398686cd2SShayne Chen #define MT_MIB_SDR27(_band) MT_WF_MIB(_band, 0x080) 19498686cd2SShayne Chen #define MT_MIB_SDR27_TX_RWP_FAIL_CNT GENMASK(15, 0) 19598686cd2SShayne Chen 19698686cd2SShayne Chen #define MT_MIB_SDR28(_band) MT_WF_MIB(_band, 0x084) 19798686cd2SShayne Chen #define MT_MIB_SDR28_TX_RWP_NEED_CNT GENMASK(15, 0) 19898686cd2SShayne Chen 19998686cd2SShayne Chen #define MT_MIB_RVSR1(_band) MT_WF_MIB(_band, 0x724) 20098686cd2SShayne Chen 20198686cd2SShayne Chen /* rx blockack count, 32 bits */ 20298686cd2SShayne Chen #define MT_MIB_TSCR1(_band) MT_WF_MIB(_band, 0x6b4) 20398686cd2SShayne Chen 20498686cd2SShayne Chen #define MT_MIB_BTSCR0(_band) MT_WF_MIB(_band, 0x5e0) 20598686cd2SShayne Chen #define MT_MIB_BTSCR5(_band) MT_WF_MIB(_band, 0x788) 20698686cd2SShayne Chen #define MT_MIB_BTSCR6(_band) MT_WF_MIB(_band, 0x798) 20798686cd2SShayne Chen 20898686cd2SShayne Chen #define MT_MIB_BFTFCR(_band) MT_WF_MIB(_band, 0x5d0) 20998686cd2SShayne Chen 21098686cd2SShayne Chen #define MT_TX_AGG_CNT(_band, n) MT_WF_MIB(_band, 0xa28 + ((n) << 2)) 21198686cd2SShayne Chen #define MT_MIB_ARNG(_band, n) MT_WF_MIB(_band, 0x0b0 + ((n) << 2)) 21298686cd2SShayne Chen #define MT_MIB_ARNCR_RANGE(val, n) (((val) >> ((n) << 4)) & GENMASK(9, 0)) 21398686cd2SShayne Chen 21498686cd2SShayne Chen /* UMIB */ 21598686cd2SShayne Chen #define MT_WF_UMIB_BASE 0x820cd000 21698686cd2SShayne Chen #define MT_WF_UMIB(ofs) (MT_WF_UMIB_BASE + (ofs)) 21798686cd2SShayne Chen 21898686cd2SShayne Chen #define MT_UMIB_RPDCR(_band) (MT_WF_UMIB(0x594) + (_band) * 0x164) 21998686cd2SShayne Chen 22098686cd2SShayne Chen /* WTBLON TOP */ 22198686cd2SShayne Chen #define MT_WTBLON_TOP_BASE 0x820d4000 22298686cd2SShayne Chen #define MT_WTBLON_TOP(ofs) (MT_WTBLON_TOP_BASE + (ofs)) 22398686cd2SShayne Chen #define MT_WTBLON_TOP_WDUCR MT_WTBLON_TOP(0x370) 22498686cd2SShayne Chen #define MT_WTBLON_TOP_WDUCR_GROUP GENMASK(4, 0) 22598686cd2SShayne Chen 22698686cd2SShayne Chen #define MT_WTBL_UPDATE MT_WTBLON_TOP(0x380) 22798686cd2SShayne Chen #define MT_WTBL_UPDATE_WLAN_IDX GENMASK(11, 0) 22898686cd2SShayne Chen #define MT_WTBL_UPDATE_ADM_COUNT_CLEAR BIT(14) 22998686cd2SShayne Chen #define MT_WTBL_UPDATE_BUSY BIT(31) 23098686cd2SShayne Chen 23115ee62e7SRyder Lee #define MT_WTBL_ITCR MT_WTBLON_TOP(0x3b0) 23215ee62e7SRyder Lee #define MT_WTBL_ITCR_WR BIT(16) 23315ee62e7SRyder Lee #define MT_WTBL_ITCR_EXEC BIT(31) 23415ee62e7SRyder Lee #define MT_WTBL_ITDR0 MT_WTBLON_TOP(0x3b8) 23515ee62e7SRyder Lee #define MT_WTBL_ITDR1 MT_WTBLON_TOP(0x3bc) 23615ee62e7SRyder Lee #define MT_WTBL_SPE_IDX_SEL BIT(6) 23715ee62e7SRyder Lee 23898686cd2SShayne Chen /* WTBL */ 23998686cd2SShayne Chen #define MT_WTBL_BASE 0x820d8000 24098686cd2SShayne Chen #define MT_WTBL_LMAC_ID GENMASK(14, 8) 24198686cd2SShayne Chen #define MT_WTBL_LMAC_DW GENMASK(7, 2) 24298686cd2SShayne Chen #define MT_WTBL_LMAC_OFFS(_id, _dw) (MT_WTBL_BASE | \ 24398686cd2SShayne Chen FIELD_PREP(MT_WTBL_LMAC_ID, _id) | \ 24498686cd2SShayne Chen FIELD_PREP(MT_WTBL_LMAC_DW, _dw)) 24598686cd2SShayne Chen 24698686cd2SShayne Chen /* ARB: band 0(0x820e3000), band 1(0x820f3000), band 2(0x830e3000) */ 24798686cd2SShayne Chen #define MT_WF_ARB_BASE(_band) __BASE(WF_ARB_BASE, (_band)) 24898686cd2SShayne Chen #define MT_WF_ARB(_band, ofs) (MT_WF_ARB_BASE(_band) + (ofs)) 24998686cd2SShayne Chen 25098686cd2SShayne Chen #define MT_ARB_SCR(_band) MT_WF_ARB(_band, 0x000) 25198686cd2SShayne Chen #define MT_ARB_SCR_TX_DISABLE BIT(8) 25298686cd2SShayne Chen #define MT_ARB_SCR_RX_DISABLE BIT(9) 25398686cd2SShayne Chen 25498686cd2SShayne Chen /* RMAC: band 0(0x820e5000), band 1(0x820f5000), band 2(0x830e5000), */ 25598686cd2SShayne Chen #define MT_WF_RMAC_BASE(_band) __BASE(WF_RMAC_BASE, (_band)) 25698686cd2SShayne Chen #define MT_WF_RMAC(_band, ofs) (MT_WF_RMAC_BASE(_band) + (ofs)) 25798686cd2SShayne Chen 25898686cd2SShayne Chen #define MT_WF_RFCR(_band) MT_WF_RMAC(_band, 0x000) 25998686cd2SShayne Chen #define MT_WF_RFCR_DROP_STBC_MULTI BIT(0) 26098686cd2SShayne Chen #define MT_WF_RFCR_DROP_FCSFAIL BIT(1) 26198686cd2SShayne Chen #define MT_WF_RFCR_DROP_PROBEREQ BIT(4) 26298686cd2SShayne Chen #define MT_WF_RFCR_DROP_MCAST BIT(5) 26398686cd2SShayne Chen #define MT_WF_RFCR_DROP_BCAST BIT(6) 26498686cd2SShayne Chen #define MT_WF_RFCR_DROP_MCAST_FILTERED BIT(7) 26598686cd2SShayne Chen #define MT_WF_RFCR_DROP_A3_MAC BIT(8) 26698686cd2SShayne Chen #define MT_WF_RFCR_DROP_A3_BSSID BIT(9) 26798686cd2SShayne Chen #define MT_WF_RFCR_DROP_A2_BSSID BIT(10) 26898686cd2SShayne Chen #define MT_WF_RFCR_DROP_OTHER_BEACON BIT(11) 26998686cd2SShayne Chen #define MT_WF_RFCR_DROP_FRAME_REPORT BIT(12) 27098686cd2SShayne Chen #define MT_WF_RFCR_DROP_CTL_RSV BIT(13) 27198686cd2SShayne Chen #define MT_WF_RFCR_DROP_CTS BIT(14) 27298686cd2SShayne Chen #define MT_WF_RFCR_DROP_RTS BIT(15) 27398686cd2SShayne Chen #define MT_WF_RFCR_DROP_DUPLICATE BIT(16) 27498686cd2SShayne Chen #define MT_WF_RFCR_DROP_OTHER_BSS BIT(17) 27598686cd2SShayne Chen #define MT_WF_RFCR_DROP_OTHER_UC BIT(18) 27698686cd2SShayne Chen #define MT_WF_RFCR_DROP_OTHER_TIM BIT(19) 27798686cd2SShayne Chen #define MT_WF_RFCR_DROP_NDPA BIT(20) 27898686cd2SShayne Chen #define MT_WF_RFCR_DROP_UNWANTED_CTL BIT(21) 27998686cd2SShayne Chen 28098686cd2SShayne Chen #define MT_WF_RFCR1(_band) MT_WF_RMAC(_band, 0x004) 28198686cd2SShayne Chen #define MT_WF_RFCR1_DROP_ACK BIT(4) 28298686cd2SShayne Chen #define MT_WF_RFCR1_DROP_BF_POLL BIT(5) 28398686cd2SShayne Chen #define MT_WF_RFCR1_DROP_BA BIT(6) 28498686cd2SShayne Chen #define MT_WF_RFCR1_DROP_CFEND BIT(7) 28598686cd2SShayne Chen #define MT_WF_RFCR1_DROP_CFACK BIT(8) 28698686cd2SShayne Chen 28798686cd2SShayne Chen #define MT_WF_RMAC_MIB_AIRTIME0(_band) MT_WF_RMAC(_band, 0x0380) 28898686cd2SShayne Chen #define MT_WF_RMAC_MIB_RXTIME_CLR BIT(31) 28998686cd2SShayne Chen #define MT_WF_RMAC_MIB_ED_OFFSET GENMASK(20, 16) 29098686cd2SShayne Chen #define MT_WF_RMAC_MIB_OBSS_BACKOFF GENMASK(15, 0) 29198686cd2SShayne Chen 29298686cd2SShayne Chen #define MT_WF_RMAC_MIB_AIRTIME1(_band) MT_WF_RMAC(_band, 0x0384) 29398686cd2SShayne Chen #define MT_WF_RMAC_MIB_NONQOSD_BACKOFF GENMASK(31, 16) 29498686cd2SShayne Chen 29598686cd2SShayne Chen #define MT_WF_RMAC_MIB_AIRTIME3(_band) MT_WF_RMAC(_band, 0x038c) 29698686cd2SShayne Chen #define MT_WF_RMAC_MIB_QOS01_BACKOFF GENMASK(31, 0) 29798686cd2SShayne Chen 29898686cd2SShayne Chen #define MT_WF_RMAC_MIB_AIRTIME4(_band) MT_WF_RMAC(_band, 0x0390) 29998686cd2SShayne Chen #define MT_WF_RMAC_MIB_QOS23_BACKOFF GENMASK(31, 0) 30098686cd2SShayne Chen 30198686cd2SShayne Chen #define MT_WF_RMAC_RSVD0(_band) MT_WF_RMAC(_band, 0x03e0) 30298686cd2SShayne Chen #define MT_WF_RMAC_RSVD0_EIFS_CLR BIT(21) 30398686cd2SShayne Chen 304793445cfSShayne Chen /* RATE: band 0(0x820ee000), band 1(0x820fe000), band 2(0x830ee000) */ 305793445cfSShayne Chen #define MT_WF_RATE_BASE(_band) __BASE(WF_RATE_BASE, (_band)) 306793445cfSShayne Chen #define MT_WF_RATE(_band, ofs) (MT_WF_RATE_BASE(_band) + (ofs)) 307793445cfSShayne Chen 308793445cfSShayne Chen #define MT_RATE_HRCR0(_band) MT_WF_RATE(_band, 0x050) 309793445cfSShayne Chen #define MT_RATE_HRCR0_CFEND_RATE GENMASK(14, 0) 310793445cfSShayne Chen 31198686cd2SShayne Chen /* WFDMA0 */ 31298686cd2SShayne Chen #define MT_WFDMA0_BASE 0xd4000 31398686cd2SShayne Chen #define MT_WFDMA0(ofs) (MT_WFDMA0_BASE + (ofs)) 31498686cd2SShayne Chen 31598686cd2SShayne Chen #define MT_WFDMA0_RST MT_WFDMA0(0x100) 31698686cd2SShayne Chen #define MT_WFDMA0_RST_LOGIC_RST BIT(4) 31798686cd2SShayne Chen #define MT_WFDMA0_RST_DMASHDL_ALL_RST BIT(5) 31898686cd2SShayne Chen 31998686cd2SShayne Chen #define MT_WFDMA0_BUSY_ENA MT_WFDMA0(0x13c) 32098686cd2SShayne Chen #define MT_WFDMA0_BUSY_ENA_TX_FIFO0 BIT(0) 32198686cd2SShayne Chen #define MT_WFDMA0_BUSY_ENA_TX_FIFO1 BIT(1) 32298686cd2SShayne Chen #define MT_WFDMA0_BUSY_ENA_RX_FIFO BIT(2) 32398686cd2SShayne Chen 32498686cd2SShayne Chen #define MT_WFDMA0_RX_INT_PCIE_SEL MT_WFDMA0(0x154) 32598686cd2SShayne Chen #define MT_WFDMA0_RX_INT_SEL_RING3 BIT(3) 32698686cd2SShayne Chen 32727015b6fSBo Jiao #define MT_WFDMA0_MCU_HOST_INT_ENA MT_WFDMA0(0x1f4) 32827015b6fSBo Jiao 32998686cd2SShayne Chen #define MT_WFDMA0_GLO_CFG MT_WFDMA0(0x208) 33098686cd2SShayne Chen #define MT_WFDMA0_GLO_CFG_TX_DMA_EN BIT(0) 33198686cd2SShayne Chen #define MT_WFDMA0_GLO_CFG_RX_DMA_EN BIT(2) 33298686cd2SShayne Chen #define MT_WFDMA0_GLO_CFG_OMIT_TX_INFO BIT(28) 33398686cd2SShayne Chen #define MT_WFDMA0_GLO_CFG_OMIT_RX_INFO BIT(27) 33498686cd2SShayne Chen #define MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2 BIT(21) 33598686cd2SShayne Chen 33698686cd2SShayne Chen #define WF_WFDMA0_GLO_CFG_EXT0 MT_WFDMA0(0x2b0) 33798686cd2SShayne Chen #define WF_WFDMA0_GLO_CFG_EXT0_RX_WB_RXD BIT(18) 33898686cd2SShayne Chen #define WF_WFDMA0_GLO_CFG_EXT0_WED_MERGE_MODE BIT(14) 33998686cd2SShayne Chen 34098686cd2SShayne Chen #define WF_WFDMA0_GLO_CFG_EXT1 MT_WFDMA0(0x2b4) 34198686cd2SShayne Chen #define WF_WFDMA0_GLO_CFG_EXT1_CALC_MODE BIT(31) 34298686cd2SShayne Chen #define WF_WFDMA0_GLO_CFG_EXT1_TX_FCTRL_MODE BIT(28) 34398686cd2SShayne Chen 34498686cd2SShayne Chen #define MT_WFDMA0_RST_DTX_PTR MT_WFDMA0(0x20c) 34598686cd2SShayne Chen #define MT_WFDMA0_PRI_DLY_INT_CFG0 MT_WFDMA0(0x2f0) 34698686cd2SShayne Chen #define MT_WFDMA0_PRI_DLY_INT_CFG1 MT_WFDMA0(0x2f4) 34798686cd2SShayne Chen #define MT_WFDMA0_PRI_DLY_INT_CFG2 MT_WFDMA0(0x2f8) 34898686cd2SShayne Chen 34998686cd2SShayne Chen /* WFDMA1 */ 35098686cd2SShayne Chen #define MT_WFDMA1_BASE 0xd5000 35198686cd2SShayne Chen 35298686cd2SShayne Chen /* WFDMA CSR */ 35398686cd2SShayne Chen #define MT_WFDMA_EXT_CSR_BASE 0xd7000 35498686cd2SShayne Chen #define MT_WFDMA_EXT_CSR(ofs) (MT_WFDMA_EXT_CSR_BASE + (ofs)) 35598686cd2SShayne Chen 35698686cd2SShayne Chen #define MT_WFDMA_HOST_CONFIG MT_WFDMA_EXT_CSR(0x30) 35798686cd2SShayne Chen #define MT_WFDMA_HOST_CONFIG_PDMA_BAND BIT(0) 35898686cd2SShayne Chen 35998686cd2SShayne Chen #define MT_WFDMA_EXT_CSR_HIF_MISC MT_WFDMA_EXT_CSR(0x44) 36098686cd2SShayne Chen #define MT_WFDMA_EXT_CSR_HIF_MISC_BUSY BIT(0) 36198686cd2SShayne Chen 36298686cd2SShayne Chen #define MT_PCIE_RECOG_ID 0xd7090 36398686cd2SShayne Chen #define MT_PCIE_RECOG_ID_MASK GENMASK(30, 0) 36498686cd2SShayne Chen #define MT_PCIE_RECOG_ID_SEM BIT(31) 36598686cd2SShayne Chen 36698686cd2SShayne Chen /* WFDMA0 PCIE1 */ 36798686cd2SShayne Chen #define MT_WFDMA0_PCIE1_BASE 0xd8000 36898686cd2SShayne Chen #define MT_WFDMA0_PCIE1(ofs) (MT_WFDMA0_PCIE1_BASE + (ofs)) 36998686cd2SShayne Chen 37098686cd2SShayne Chen #define MT_WFDMA0_PCIE1_BUSY_ENA MT_WFDMA0_PCIE1(0x13c) 37198686cd2SShayne Chen #define MT_WFDMA0_PCIE1_BUSY_ENA_TX_FIFO0 BIT(0) 37298686cd2SShayne Chen #define MT_WFDMA0_PCIE1_BUSY_ENA_TX_FIFO1 BIT(1) 37398686cd2SShayne Chen #define MT_WFDMA0_PCIE1_BUSY_ENA_RX_FIFO BIT(2) 37498686cd2SShayne Chen 37598686cd2SShayne Chen /* WFDMA COMMON */ 37698686cd2SShayne Chen #define __RXQ(q) ((q) + __MT_MCUQ_MAX) 37798686cd2SShayne Chen #define __TXQ(q) (__RXQ(q) + __MT_RXQ_MAX) 37898686cd2SShayne Chen 37998686cd2SShayne Chen #define MT_Q_ID(q) (dev->q_id[(q)]) 38098686cd2SShayne Chen #define MT_Q_BASE(q) ((dev->q_wfdma_mask >> (q)) & 0x1 ? \ 38198686cd2SShayne Chen MT_WFDMA1_BASE : MT_WFDMA0_BASE) 38298686cd2SShayne Chen 38398686cd2SShayne Chen #define MT_MCUQ_ID(q) MT_Q_ID(q) 38498686cd2SShayne Chen #define MT_TXQ_ID(q) MT_Q_ID(__TXQ(q)) 38598686cd2SShayne Chen #define MT_RXQ_ID(q) MT_Q_ID(__RXQ(q)) 38698686cd2SShayne Chen 38798686cd2SShayne Chen #define MT_MCUQ_RING_BASE(q) (MT_Q_BASE(q) + 0x300) 38898686cd2SShayne Chen #define MT_TXQ_RING_BASE(q) (MT_Q_BASE(__TXQ(q)) + 0x300) 38998686cd2SShayne Chen #define MT_RXQ_RING_BASE(q) (MT_Q_BASE(__RXQ(q)) + 0x500) 39098686cd2SShayne Chen 39198686cd2SShayne Chen #define MT_MCUQ_EXT_CTRL(q) (MT_Q_BASE(q) + 0x600 + \ 39298686cd2SShayne Chen MT_MCUQ_ID(q) * 0x4) 39398686cd2SShayne Chen #define MT_RXQ_BAND1_CTRL(q) (MT_Q_BASE(__RXQ(q)) + 0x680 + \ 39498686cd2SShayne Chen MT_RXQ_ID(q) * 0x4) 39598686cd2SShayne Chen #define MT_TXQ_EXT_CTRL(q) (MT_Q_BASE(__TXQ(q)) + 0x600 + \ 39698686cd2SShayne Chen MT_TXQ_ID(q) * 0x4) 39798686cd2SShayne Chen 39898686cd2SShayne Chen #define MT_INT_SOURCE_CSR MT_WFDMA0(0x200) 39998686cd2SShayne Chen #define MT_INT_MASK_CSR MT_WFDMA0(0x204) 40098686cd2SShayne Chen 40198686cd2SShayne Chen #define MT_INT1_SOURCE_CSR MT_WFDMA0_PCIE1(0x200) 40298686cd2SShayne Chen #define MT_INT1_MASK_CSR MT_WFDMA0_PCIE1(0x204) 40398686cd2SShayne Chen 40498686cd2SShayne Chen #define MT_INT_RX_DONE_BAND0 BIT(12) 40598686cd2SShayne Chen #define MT_INT_RX_DONE_BAND1 BIT(12) 40698686cd2SShayne Chen #define MT_INT_RX_DONE_BAND2 BIT(13) 40798686cd2SShayne Chen #define MT_INT_RX_DONE_WM BIT(0) 40898686cd2SShayne Chen #define MT_INT_RX_DONE_WA BIT(1) 40998686cd2SShayne Chen #define MT_INT_RX_DONE_WA_MAIN BIT(2) 41098686cd2SShayne Chen #define MT_INT_RX_DONE_WA_EXT BIT(2) 41198686cd2SShayne Chen #define MT_INT_RX_DONE_WA_TRI BIT(3) 41298686cd2SShayne Chen #define MT_INT_RX_TXFREE_MAIN BIT(17) 41398686cd2SShayne Chen #define MT_INT_RX_TXFREE_TRI BIT(15) 41498686cd2SShayne Chen #define MT_INT_MCU_CMD BIT(29) 41598686cd2SShayne Chen 41698686cd2SShayne Chen #define MT_INT_RX(q) (dev->q_int_mask[__RXQ(q)]) 41798686cd2SShayne Chen #define MT_INT_TX_MCU(q) (dev->q_int_mask[(q)]) 41898686cd2SShayne Chen 41998686cd2SShayne Chen #define MT_INT_RX_DONE_MCU (MT_INT_RX(MT_RXQ_MCU) | \ 42098686cd2SShayne Chen MT_INT_RX(MT_RXQ_MCU_WA)) 42198686cd2SShayne Chen 42298686cd2SShayne Chen #define MT_INT_BAND0_RX_DONE (MT_INT_RX(MT_RXQ_MAIN) | \ 42398686cd2SShayne Chen MT_INT_RX(MT_RXQ_MAIN_WA)) 42498686cd2SShayne Chen 42598686cd2SShayne Chen #define MT_INT_BAND1_RX_DONE (MT_INT_RX(MT_RXQ_BAND1) | \ 42698686cd2SShayne Chen MT_INT_RX(MT_RXQ_BAND1_WA) | \ 42798686cd2SShayne Chen MT_INT_RX(MT_RXQ_MAIN_WA)) 42898686cd2SShayne Chen 42998686cd2SShayne Chen #define MT_INT_BAND2_RX_DONE (MT_INT_RX(MT_RXQ_BAND2) | \ 43098686cd2SShayne Chen MT_INT_RX(MT_RXQ_BAND2_WA) | \ 43198686cd2SShayne Chen MT_INT_RX(MT_RXQ_MAIN_WA)) 43298686cd2SShayne Chen 43398686cd2SShayne Chen #define MT_INT_RX_DONE_ALL (MT_INT_RX_DONE_MCU | \ 43498686cd2SShayne Chen MT_INT_BAND0_RX_DONE | \ 43598686cd2SShayne Chen MT_INT_BAND1_RX_DONE | \ 43698686cd2SShayne Chen MT_INT_BAND2_RX_DONE) 43798686cd2SShayne Chen 43898686cd2SShayne Chen #define MT_INT_TX_DONE_FWDL BIT(26) 43998686cd2SShayne Chen #define MT_INT_TX_DONE_MCU_WM BIT(27) 44098686cd2SShayne Chen #define MT_INT_TX_DONE_MCU_WA BIT(22) 44198686cd2SShayne Chen #define MT_INT_TX_DONE_BAND0 BIT(30) 44298686cd2SShayne Chen #define MT_INT_TX_DONE_BAND1 BIT(31) 44398686cd2SShayne Chen #define MT_INT_TX_DONE_BAND2 BIT(15) 44498686cd2SShayne Chen 44598686cd2SShayne Chen #define MT_INT_TX_DONE_MCU (MT_INT_TX_MCU(MT_MCUQ_WA) | \ 44698686cd2SShayne Chen MT_INT_TX_MCU(MT_MCUQ_WM) | \ 44798686cd2SShayne Chen MT_INT_TX_MCU(MT_MCUQ_FWDL)) 44898686cd2SShayne Chen 44998686cd2SShayne Chen #define MT_MCU_CMD MT_WFDMA0(0x1f0) 45098686cd2SShayne Chen #define MT_MCU_CMD_STOP_DMA BIT(2) 45198686cd2SShayne Chen #define MT_MCU_CMD_RESET_DONE BIT(3) 45298686cd2SShayne Chen #define MT_MCU_CMD_RECOVERY_DONE BIT(4) 45398686cd2SShayne Chen #define MT_MCU_CMD_NORMAL_STATE BIT(5) 45498686cd2SShayne Chen #define MT_MCU_CMD_ERROR_MASK GENMASK(5, 1) 45598686cd2SShayne Chen 45627015b6fSBo Jiao #define MT_MCU_CMD_WA_WDT BIT(31) 45727015b6fSBo Jiao #define MT_MCU_CMD_WM_WDT BIT(30) 45827015b6fSBo Jiao #define MT_MCU_CMD_WDT_MASK GENMASK(31, 30) 45927015b6fSBo Jiao 46098686cd2SShayne Chen /* l1/l2 remap */ 46198686cd2SShayne Chen #define MT_HIF_REMAP_L1 0x155024 46298686cd2SShayne Chen #define MT_HIF_REMAP_L1_MASK GENMASK(31, 16) 46398686cd2SShayne Chen #define MT_HIF_REMAP_L1_OFFSET GENMASK(15, 0) 46498686cd2SShayne Chen #define MT_HIF_REMAP_L1_BASE GENMASK(31, 16) 46598686cd2SShayne Chen #define MT_HIF_REMAP_BASE_L1 0x130000 46698686cd2SShayne Chen 46798686cd2SShayne Chen #define MT_HIF_REMAP_L2 0x1b4 46898686cd2SShayne Chen #define MT_HIF_REMAP_L2_MASK GENMASK(19, 0) 46998686cd2SShayne Chen #define MT_HIF_REMAP_L2_OFFSET GENMASK(11, 0) 47098686cd2SShayne Chen #define MT_HIF_REMAP_L2_BASE GENMASK(31, 12) 47198686cd2SShayne Chen #define MT_HIF_REMAP_BASE_L2 0x1000 47298686cd2SShayne Chen 47398686cd2SShayne Chen #define MT_INFRA_BASE 0x18000000 47498686cd2SShayne Chen #define MT_WFSYS0_PHY_START 0x18400000 47598686cd2SShayne Chen #define MT_WFSYS1_PHY_START 0x18800000 47698686cd2SShayne Chen #define MT_WFSYS1_PHY_END 0x18bfffff 47798686cd2SShayne Chen #define MT_CBTOP1_PHY_START 0x70000000 47898686cd2SShayne Chen #define MT_CBTOP1_PHY_END 0x77ffffff 47998686cd2SShayne Chen #define MT_CBTOP2_PHY_START 0xf0000000 48098686cd2SShayne Chen #define MT_INFRA_MCU_START 0x7c000000 48198686cd2SShayne Chen #define MT_INFRA_MCU_END 0x7c3fffff 48298686cd2SShayne Chen 48398686cd2SShayne Chen /* FW MODE SYNC */ 484878161d5SRyder Lee #define MT_FW_ASSERT_CNT 0x02208274 485878161d5SRyder Lee #define MT_FW_DUMP_STATE 0x02209e90 486878161d5SRyder Lee 48727015b6fSBo Jiao #define MT_SWDEF_BASE 0x00401400 48827015b6fSBo Jiao 48927015b6fSBo Jiao #define MT_SWDEF(ofs) (MT_SWDEF_BASE + (ofs)) 49027015b6fSBo Jiao #define MT_SWDEF_MODE MT_SWDEF(0x3c) 49198686cd2SShayne Chen #define MT_SWDEF_NORMAL_MODE 0 49298686cd2SShayne Chen 493672662f0SRyder Lee #define MT_SWDEF_SER_STATS MT_SWDEF(0x040) 494672662f0SRyder Lee #define MT_SWDEF_PLE_STATS MT_SWDEF(0x044) 495672662f0SRyder Lee #define MT_SWDEF_PLE1_STATS MT_SWDEF(0x048) 496672662f0SRyder Lee #define MT_SWDEF_PLE_AMSDU_STATS MT_SWDEF(0x04c) 497672662f0SRyder Lee #define MT_SWDEF_PSE_STATS MT_SWDEF(0x050) 498672662f0SRyder Lee #define MT_SWDEF_PSE1_STATS MT_SWDEF(0x054) 499672662f0SRyder Lee #define MT_SWDEF_LAMC_WISR6_BN0_STATS MT_SWDEF(0x058) 500672662f0SRyder Lee #define MT_SWDEF_LAMC_WISR6_BN1_STATS MT_SWDEF(0x05c) 501672662f0SRyder Lee #define MT_SWDEF_LAMC_WISR6_BN2_STATS MT_SWDEF(0x060) 502672662f0SRyder Lee #define MT_SWDEF_LAMC_WISR7_BN0_STATS MT_SWDEF(0x064) 503672662f0SRyder Lee #define MT_SWDEF_LAMC_WISR7_BN1_STATS MT_SWDEF(0x068) 504672662f0SRyder Lee #define MT_SWDEF_LAMC_WISR7_BN2_STATS MT_SWDEF(0x06c) 505672662f0SRyder Lee 50698686cd2SShayne Chen /* LED */ 50798686cd2SShayne Chen #define MT_LED_TOP_BASE 0x18013000 50898686cd2SShayne Chen #define MT_LED_PHYS(_n) (MT_LED_TOP_BASE + (_n)) 50998686cd2SShayne Chen 51098686cd2SShayne Chen #define MT_LED_CTRL(_n) MT_LED_PHYS(0x00 + ((_n) * 4)) 51198686cd2SShayne Chen #define MT_LED_CTRL_KICK BIT(7) 51298686cd2SShayne Chen #define MT_LED_CTRL_BLINK_MODE BIT(2) 51398686cd2SShayne Chen #define MT_LED_CTRL_POLARITY BIT(1) 51498686cd2SShayne Chen 51598686cd2SShayne Chen #define MT_LED_TX_BLINK(_n) MT_LED_PHYS(0x10 + ((_n) * 4)) 51698686cd2SShayne Chen #define MT_LED_TX_BLINK_ON_MASK GENMASK(7, 0) 51798686cd2SShayne Chen #define MT_LED_TX_BLINK_OFF_MASK GENMASK(15, 8) 51898686cd2SShayne Chen 51998686cd2SShayne Chen #define MT_LED_EN(_n) MT_LED_PHYS(0x40 + ((_n) * 4)) 52098686cd2SShayne Chen 521878161d5SRyder Lee /* CONN DBG */ 522878161d5SRyder Lee #define MT_CONN_DBG_CTL_BASE 0x18023000 523878161d5SRyder Lee #define MT_CONN_DBG_CTL(ofs) (MT_CONN_DBG_CTL_BASE + (ofs)) 524878161d5SRyder Lee #define MT_CONN_DBG_CTL_OUT_SEL MT_CONN_DBG_CTL(0x604) 525878161d5SRyder Lee #define MT_CONN_DBG_CTL_PC_LOG_SEL MT_CONN_DBG_CTL(0x60c) 526878161d5SRyder Lee #define MT_CONN_DBG_CTL_PC_LOG MT_CONN_DBG_CTL(0x610) 527878161d5SRyder Lee 52898686cd2SShayne Chen #define MT_LED_GPIO_MUX2 0x70005058 /* GPIO 18 */ 52998686cd2SShayne Chen #define MT_LED_GPIO_MUX3 0x7000505C /* GPIO 26 */ 53098686cd2SShayne Chen #define MT_LED_GPIO_SEL_MASK GENMASK(11, 8) 53198686cd2SShayne Chen 53298686cd2SShayne Chen /* MT TOP */ 53398686cd2SShayne Chen #define MT_TOP_BASE 0xe0000 53498686cd2SShayne Chen #define MT_TOP(ofs) (MT_TOP_BASE + (ofs)) 53598686cd2SShayne Chen 53698686cd2SShayne Chen #define MT_TOP_LPCR_HOST_BAND(_band) MT_TOP(0x10 + ((_band) * 0x10)) 53798686cd2SShayne Chen #define MT_TOP_LPCR_HOST_FW_OWN BIT(0) 53898686cd2SShayne Chen #define MT_TOP_LPCR_HOST_DRV_OWN BIT(1) 53998686cd2SShayne Chen #define MT_TOP_LPCR_HOST_FW_OWN_STAT BIT(2) 54098686cd2SShayne Chen 54198686cd2SShayne Chen #define MT_TOP_LPCR_HOST_BAND_IRQ_STAT(_band) MT_TOP(0x14 + ((_band) * 0x10)) 54298686cd2SShayne Chen #define MT_TOP_LPCR_HOST_BAND_STAT BIT(0) 54398686cd2SShayne Chen 54498686cd2SShayne Chen #define MT_TOP_MISC MT_TOP(0xf0) 54598686cd2SShayne Chen #define MT_TOP_MISC_FW_STATE GENMASK(2, 0) 54698686cd2SShayne Chen 54798686cd2SShayne Chen #define MT_HW_REV 0x70010204 54827015b6fSBo Jiao #define MT_WF_SUBSYS_RST 0x70028600 54998686cd2SShayne Chen 55098686cd2SShayne Chen /* PCIE MAC */ 55198686cd2SShayne Chen #define MT_PCIE_MAC_BASE 0x74030000 55298686cd2SShayne Chen #define MT_PCIE_MAC(ofs) (MT_PCIE_MAC_BASE + (ofs)) 55398686cd2SShayne Chen #define MT_PCIE_MAC_INT_ENABLE MT_PCIE_MAC(0x188) 55498686cd2SShayne Chen 55598686cd2SShayne Chen #define MT_PCIE1_MAC_BASE 0x74090000 55698686cd2SShayne Chen #define MT_PCIE1_MAC(ofs) (MT_PCIE1_MAC_BASE + (ofs)) 55798686cd2SShayne Chen 55898686cd2SShayne Chen #define MT_PCIE1_MAC_INT_ENABLE MT_PCIE1_MAC(0x188) 55998686cd2SShayne Chen 56098686cd2SShayne Chen /* PHYRX CSD */ 56198686cd2SShayne Chen #define MT_WF_PHYRX_CSD_BASE 0x83000000 56298686cd2SShayne Chen #define MT_WF_PHYRX_CSD(_band, _wf, ofs) (MT_WF_PHYRX_CSD_BASE + \ 56398686cd2SShayne Chen ((_band) << 20) + \ 56498686cd2SShayne Chen ((_wf) << 16) + (ofs)) 56598686cd2SShayne Chen #define MT_WF_PHYRX_CSD_IRPI(_band, _wf) MT_WF_PHYRX_CSD(_band, _wf, 0x1000) 56698686cd2SShayne Chen 567*68f1c3eaSRyder Lee /* PHYRX CTRL */ 568*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_BASE 0x83080000 569*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND(_band, ofs) (MT_WF_PHYRX_BAND_BASE + \ 570*68f1c3eaSRyder Lee ((_band) << 20) + (ofs)) 571*68f1c3eaSRyder Lee 572*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_GID_TAB_VLD0(_band) MT_WF_PHYRX_BAND(_band, 0x1054) 573*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_GID_TAB_VLD1(_band) MT_WF_PHYRX_BAND(_band, 0x1058) 574*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_GID_TAB_POS0(_band) MT_WF_PHYRX_BAND(_band, 0x105c) 575*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_GID_TAB_POS1(_band) MT_WF_PHYRX_BAND(_band, 0x1060) 576*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_GID_TAB_POS2(_band) MT_WF_PHYRX_BAND(_band, 0x1064) 577*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_GID_TAB_POS3(_band) MT_WF_PHYRX_BAND(_band, 0x1068) 578*68f1c3eaSRyder Lee 579*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_RX_CTRL1(_band) MT_WF_PHYRX_BAND(_band, 0x2004) 580*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_RX_CTRL1_IPI_EN GENMASK(2, 0) 581*68f1c3eaSRyder Lee #define MT_WF_PHYRX_BAND_RX_CTRL1_STSCNT_EN GENMASK(11, 9) 582*68f1c3eaSRyder Lee 58398686cd2SShayne Chen /* PHYRX CSD BAND */ 58498686cd2SShayne Chen #define MT_WF_PHYRX_CSD_BAND_RXTD12(_band) MT_WF_PHYRX_BAND(_band, 0x8230) 58598686cd2SShayne Chen #define MT_WF_PHYRX_CSD_BAND_RXTD12_IRPI_SW_CLR_ONLY BIT(18) 58698686cd2SShayne Chen #define MT_WF_PHYRX_CSD_BAND_RXTD12_IRPI_SW_CLR BIT(29) 58798686cd2SShayne Chen 588878161d5SRyder Lee /* CONN MCU EXCP CON */ 589878161d5SRyder Lee #define MT_MCU_WM_EXCP_BASE 0x89050000 590878161d5SRyder Lee #define MT_MCU_WM_EXCP(ofs) (MT_MCU_WM_EXCP_BASE + (ofs)) 591878161d5SRyder Lee #define MT_MCU_WM_EXCP_PC_CTRL MT_MCU_WM_EXCP(0x100) 592878161d5SRyder Lee #define MT_MCU_WM_EXCP_PC_LOG MT_MCU_WM_EXCP(0x104) 593878161d5SRyder Lee #define MT_MCU_WM_EXCP_LR_CTRL MT_MCU_WM_EXCP(0x200) 594878161d5SRyder Lee #define MT_MCU_WM_EXCP_LR_LOG MT_MCU_WM_EXCP(0x204) 595878161d5SRyder Lee 59698686cd2SShayne Chen #endif 597