linux/drivers/net/wireless/mediatek/mt76/mt792x_regs.h

/* SPDX-License-Identifier: ISC */
/* Copyright (C) 2023 MediaTek Inc. */

#ifndef __MT792X_REGS_H
#define __MT792X_REGS_H

/* MCU WFDMA1 */
#define MT_MCU_WFDMA1_BASE
#define MT_MCU_WFDMA1(ofs)

#define MT_MCU_INT_EVENT
#define MT_MCU_INT_EVENT_DMA_STOPPED
#define MT_MCU_INT_EVENT_DMA_INIT
#define MT_MCU_INT_EVENT_SER_TRIGGER
#define MT_MCU_INT_EVENT_RESET_DONE

#define MT_PLE_BASE
#define MT_PLE(ofs)

#define MT_PLE_FL_Q0_CTRL
#define MT_PLE_FL_Q1_CTRL
#define MT_PLE_FL_Q2_CTRL
#define MT_PLE_FL_Q3_CTRL

#define MT_PLE_AC_QEMPTY(_n)
#define MT_PLE_AMSDU_PACK_MSDU_CNT(n)

/* TMAC: band 0(0x21000), band 1(0xa1000) */
#define MT_WF_TMAC_BASE(_band)
#define MT_WF_TMAC(_band, ofs)

#define MT_TMAC_TCR0(_band)
#define MT_TMAC_TCR0_TBTT_STOP_CTRL

#define MT_TMAC_CDTR(_band)
#define MT_TMAC_ODTR(_band)
#define MT_TIMEOUT_VAL_PLCP
#define MT_TIMEOUT_VAL_CCA

#define MT_TMAC_ICR0(_band)
#define MT_IFS_EIFS
#define MT_IFS_RIFS
#define MT_IFS_SIFS
#define MT_IFS_SLOT

#define MT_TMAC_CTCR0(_band)
#define MT_TMAC_CTCR0_INS_DDLMT_REFTIME
#define MT_TMAC_CTCR0_INS_DDLMT_EN
#define MT_TMAC_CTCR0_INS_DDLMT_VHT_SMPDU_EN

#define MT_TMAC_TRCR0(_band)
#define MT_TMAC_TFCR0(_band)

#define MT_WF_DMA_BASE(_band)
#define MT_WF_DMA(_band, ofs)

#define MT_DMA_DCR0(_band)
#define MT_DMA_DCR0_MAX_RX_LEN
#define MT_DMA_DCR0_RXD_G5_EN

/* WTBLOFF TOP: band 0(0x820e9000),band 1(0x820f9000) */
#define MT_WTBLOFF_TOP_BASE(_band)
#define MT_WTBLOFF_TOP(_band, ofs)

#define MT_WTBLOFF_TOP_RSCR(_band)
#define MT_WTBLOFF_TOP_RSCR_RCPI_MODE
#define MT_WTBLOFF_TOP_RSCR_RCPI_PARAM

/* LPON: band 0(0x24200), band 1(0xa4200) */
#define MT_WF_LPON_BASE(_band)
#define MT_WF_LPON(_band, ofs)

#define MT_LPON_UTTR0(_band)
#define MT_LPON_UTTR1(_band)

#define MT_LPON_TCR(_band, n)
#define MT_LPON_TCR_SW_MODE
#define MT_LPON_TCR_SW_WRITE

/* ETBF: band 0(0x24000), band 1(0xa4000) */
#define MT_WF_ETBF_BASE(_band)
#define MT_WF_ETBF(_band, ofs)

#define MT_ETBF_TX_APP_CNT(_band)
#define MT_ETBF_TX_IBF_CNT
#define MT_ETBF_TX_EBF_CNT

#define MT_ETBF_RX_FB_CNT(_band)
#define MT_ETBF_RX_FB_ALL
#define MT_ETBF_RX_FB_HE
#define MT_ETBF_RX_FB_VHT
#define MT_ETBF_RX_FB_HT

/* MIB: band 0(0x24800), band 1(0xa4800) */
#define MT_WF_MIB_BASE(_band)
#define MT_WF_MIB(_band, ofs)

#define MT_MIB_SCR1(_band)
#define MT_MIB_TXDUR_EN
#define MT_MIB_RXDUR_EN

#define MT_MIB_SDR3(_band)
#define MT_MIB_SDR3_FCS_ERR_MASK

#define MT_MIB_SDR5(_band)

#define MT_MIB_SDR9(_band)
#define MT_MIB_SDR9_BUSY_MASK

#define MT_MIB_SDR12(_band)
#define MT_MIB_SDR14(_band)
#define MT_MIB_SDR15(_band)

#define MT_MIB_SDR16(_band)
#define MT_MIB_SDR16_BUSY_MASK

#define MT_MIB_SDR22(_band)
#define MT_MIB_SDR23(_band)
#define MT_MIB_SDR31(_band)

#define MT_MIB_SDR32(_band)
#define MT_MIB_SDR9_IBF_CNT_MASK
#define MT_MIB_SDR9_EBF_CNT_MASK

#define MT_MIB_SDR34(_band)
#define MT_MIB_MU_BF_TX_CNT

#define MT_MIB_SDR36(_band)
#define MT_MIB_SDR36_TXTIME_MASK
#define MT_MIB_SDR37(_band)
#define MT_MIB_SDR37_RXTIME_MASK

#define MT_MIB_DR8(_band)
#define MT_MIB_DR9(_band)
#define MT_MIB_DR11(_band)

#define MT_MIB_MB_SDR0(_band, n)
#define MT_MIB_RTS_RETRIES_COUNT_MASK

#define MT_MIB_MB_BSDR0(_band)
#define MT_MIB_RTS_COUNT_MASK
#define MT_MIB_MB_BSDR1(_band)
#define MT_MIB_RTS_FAIL_COUNT_MASK
#define MT_MIB_MB_BSDR2(_band)
#define MT_MIB_BA_FAIL_COUNT_MASK
#define MT_MIB_MB_BSDR3(_band)
#define MT_MIB_ACK_FAIL_COUNT_MASK

#define MT_MIB_MB_SDR2(_band, n)
#define MT_MIB_FRAME_RETRIES_COUNT_MASK

#define MT_TX_AGG_CNT(_band, n)
#define MT_TX_AGG_CNT2(_band, n)
#define MT_MIB_ARNG(_band, n)
#define MT_MIB_ARNCR_RANGE(val, n)

#define MT_WTBLON_TOP_BASE
#define MT_WTBLON_TOP(ofs)

#define MT_WTBL_UPDATE_BUSY

#define MT_WTBL_ITCR
#define MT_WTBL_ITCR_WR
#define MT_WTBL_ITCR_EXEC
#define MT_WTBL_ITDR0
#define MT_WTBL_ITDR1
#define MT_WTBL_SPE_IDX_SEL

#define MT_WTBL_BASE
#define MT_WTBL_LMAC_ID
#define MT_WTBL_LMAC_DW
#define MT_WTBL_LMAC_OFFS(_id, _dw)

/* AGG: band 0(0x20800), band 1(0xa0800) */
#define MT_WF_AGG_BASE(_band)
#define MT_WF_AGG(_band, ofs)

#define MT_AGG_AWSCR0(_band, _n)
#define MT_AGG_PCR0(_band, _n)
#define MT_AGG_PCR0_MM_PROT
#define MT_AGG_PCR0_GF_PROT
#define MT_AGG_PCR0_BW20_PROT
#define MT_AGG_PCR0_BW40_PROT
#define MT_AGG_PCR0_BW80_PROT
#define MT_AGG_PCR0_ERP_PROT
#define MT_AGG_PCR0_VHT_PROT
#define MT_AGG_PCR0_PTA_WIN_DIS

#define MT_AGG_PCR1_RTS0_NUM_THRES
#define MT_AGG_PCR1_RTS0_LEN_THRES

#define MT_AGG_ACR0(_band)
#define MT_AGG_ACR_CFEND_RATE
#define MT_AGG_ACR_BAR_RATE

#define MT_AGG_MRCR(_band)
#define MT_AGG_MRCR_BAR_CNT_LIMIT
#define MT_AGG_MRCR_LAST_RTS_CTS_RN
#define MT_AGG_MRCR_RTS_FAIL_LIMIT
#define MT_AGG_MRCR_TXCMD_RTS_FAIL_LIMIT

#define MT_AGG_ATCR1(_band)
#define MT_AGG_ATCR3(_band)

/* ARB: band 0(0x20c00), band 1(0xa0c00) */
#define MT_WF_ARB_BASE(_band)
#define MT_WF_ARB(_band, ofs)

#define MT_ARB_SCR(_band)
#define MT_ARB_SCR_TX_DISABLE
#define MT_ARB_SCR_RX_DISABLE

#define MT_ARB_DRNGR0(_band, _n)

/* RMAC: band 0(0x21400), band 1(0xa1400) */
#define MT_WF_RMAC_BASE(_band)
#define MT_WF_RMAC(_band, ofs)

#define MT_WF_RFCR(_band)
#define MT_WF_RFCR_DROP_STBC_MULTI
#define MT_WF_RFCR_DROP_FCSFAIL
#define MT_WF_RFCR_DROP_VERSION
#define MT_WF_RFCR_DROP_PROBEREQ
#define MT_WF_RFCR_DROP_MCAST
#define MT_WF_RFCR_DROP_BCAST
#define MT_WF_RFCR_DROP_MCAST_FILTERED
#define MT_WF_RFCR_DROP_A3_MAC
#define MT_WF_RFCR_DROP_A3_BSSID
#define MT_WF_RFCR_DROP_A2_BSSID
#define MT_WF_RFCR_DROP_OTHER_BEACON
#define MT_WF_RFCR_DROP_FRAME_REPORT
#define MT_WF_RFCR_DROP_CTL_RSV
#define MT_WF_RFCR_DROP_CTS
#define MT_WF_RFCR_DROP_RTS
#define MT_WF_RFCR_DROP_DUPLICATE
#define MT_WF_RFCR_DROP_OTHER_BSS
#define MT_WF_RFCR_DROP_OTHER_UC
#define MT_WF_RFCR_DROP_OTHER_TIM
#define MT_WF_RFCR_DROP_NDPA
#define MT_WF_RFCR_DROP_UNWANTED_CTL

#define MT_WF_RFCR1(_band)
#define MT_WF_RFCR1_DROP_ACK
#define MT_WF_RFCR1_DROP_BF_POLL
#define MT_WF_RFCR1_DROP_BA
#define MT_WF_RFCR1_DROP_CFEND
#define MT_WF_RFCR1_DROP_CFACK

#define MT_WF_RMAC_MIB_TIME0(_band)
#define MT_WF_RMAC_MIB_RXTIME_CLR
#define MT_WF_RMAC_MIB_RXTIME_EN

#define MT_WF_RMAC_MIB_AIRTIME14(_band)
#define MT_MIB_OBSSTIME_MASK
#define MT_WF_RMAC_MIB_AIRTIME0(_band)

/* WFDMA0 */
#define MT_WFDMA0_BASE
#define MT_WFDMA0(ofs)

#define MT_WFDMA0_RST
#define MT_WFDMA0_RST_LOGIC_RST
#define MT_WFDMA0_RST_DMASHDL_ALL_RST

#define MT_WFDMA0_BUSY_ENA
#define MT_WFDMA0_BUSY_ENA_TX_FIFO0
#define MT_WFDMA0_BUSY_ENA_TX_FIFO1
#define MT_WFDMA0_BUSY_ENA_RX_FIFO

#define MT_MCU_CMD
#define MT_MCU_CMD_WAKE_RX_PCIE
#define MT_MCU_CMD_STOP_DMA_FW_RELOAD
#define MT_MCU_CMD_STOP_DMA
#define MT_MCU_CMD_RESET_DONE
#define MT_MCU_CMD_RECOVERY_DONE
#define MT_MCU_CMD_NORMAL_STATE
#define MT_MCU_CMD_ERROR_MASK

#define MT_MCU2HOST_SW_INT_ENA

#define MT_WFDMA0_HOST_INT_STA
#define HOST_RX_DONE_INT_STS0
#define HOST_RX_DONE_INT_STS2
#define HOST_RX_DONE_INT_STS4
#define HOST_TX_DONE_INT_STS16
#define HOST_TX_DONE_INT_STS17

#define MT_WFDMA0_GLO_CFG
#define MT_WFDMA0_GLO_CFG_TX_DMA_EN
#define MT_WFDMA0_GLO_CFG_TX_DMA_BUSY
#define MT_WFDMA0_GLO_CFG_RX_DMA_EN
#define MT_WFDMA0_GLO_CFG_RX_DMA_BUSY
#define MT_WFDMA0_GLO_CFG_DMA_SIZE
#define MT_WFDMA0_GLO_CFG_TX_WB_DDONE
#define MT_WFDMA0_GLO_CFG_FW_DWLD_BYPASS_DMASHDL
#define MT_WFDMA0_GLO_CFG_FIFO_DIS_CHECK
#define MT_WFDMA0_GLO_CFG_FIFO_LITTLE_ENDIAN
#define MT_WFDMA0_GLO_CFG_RX_WB_DDONE
#define MT_WFDMA0_GLO_CFG_CSR_DISP_BASE_PTR_CHAIN_EN
#define MT_WFDMA0_GLO_CFG_OMIT_RX_INFO_PFET2
#define MT_WFDMA0_GLO_CFG_OMIT_RX_INFO
#define MT_WFDMA0_GLO_CFG_OMIT_TX_INFO
#define MT_WFDMA0_GLO_CFG_CLK_GAT_DIS

#define HOST_RX_DONE_INT_ENA0
#define HOST_RX_DONE_INT_ENA1
#define HOST_RX_DONE_INT_ENA2
#define HOST_RX_DONE_INT_ENA3
#define HOST_TX_DONE_INT_ENA0
#define HOST_TX_DONE_INT_ENA1
#define HOST_TX_DONE_INT_ENA2
#define HOST_TX_DONE_INT_ENA3
#define HOST_TX_DONE_INT_ENA4
#define HOST_TX_DONE_INT_ENA5
#define HOST_TX_DONE_INT_ENA6
#define HOST_TX_DONE_INT_ENA7
#define HOST_RX_COHERENT_EN
#define HOST_TX_COHERENT_EN
#define MCU2HOST_SW_INT_ENA
#define HOST_TX_DONE_INT_ENA18

#define MT_INT_MCU_CMD

#define MT_WFDMA0_RST_DTX_PTR
#define MT_WFDMA0_RST_DRX_PTR
#define MT_WFDMA0_INT_RX_PRI
#define MT_WFDMA0_INT_TX_PRI
#define MT_WFDMA0_GLO_CFG_EXT0
#define MT_WFDMA0_CSR_TX_DMASHDL_ENABLE
#define MT_WFDMA0_PRI_DLY_INT_CFG0

#define MT_WFDMA0_TX_RING0_EXT_CTRL
#define MT_WFDMA0_TX_RING1_EXT_CTRL
#define MT_WFDMA0_TX_RING2_EXT_CTRL
#define MT_WFDMA0_TX_RING3_EXT_CTRL
#define MT_WFDMA0_TX_RING4_EXT_CTRL
#define MT_WFDMA0_TX_RING5_EXT_CTRL
#define MT_WFDMA0_TX_RING6_EXT_CTRL
#define MT_WFDMA0_TX_RING15_EXT_CTRL
#define MT_WFDMA0_TX_RING16_EXT_CTRL
#define MT_WFDMA0_TX_RING17_EXT_CTRL

#define MT_WPDMA0_MAX_CNT_MASK
#define MT_WPDMA0_BASE_PTR_MASK

#define MT_WFDMA0_RX_RING0_EXT_CTRL
#define MT_WFDMA0_RX_RING1_EXT_CTRL
#define MT_WFDMA0_RX_RING2_EXT_CTRL
#define MT_WFDMA0_RX_RING3_EXT_CTRL
#define MT_WFDMA0_RX_RING4_EXT_CTRL
#define MT_WFDMA0_RX_RING5_EXT_CTRL
#define MT_WFDMA0_RX_RING6_EXT_CTRL
#define MT_WFDMA0_RX_RING7_EXT_CTRL

#define MT_TX_RING_BASE
#define MT_RX_EVENT_RING_BASE

/* WFDMA CSR */
#define MT_WFDMA_EXT_CSR_BASE
#define MT_WFDMA_EXT_CSR(ofs)
#define MT_WFDMA_EXT_CSR_HIF_MISC
#define MT_WFDMA_EXT_CSR_HIF_MISC_BUSY

#define MT_SWDEF_BASE
#define MT_SWDEF(ofs)
#define MT_SWDEF_MODE
#define MT_SWDEF_NORMAL_MODE
#define MT_SWDEF_ICAP_MODE
#define MT_SWDEF_SPECTRUM_MODE

#define MT_TOP_BASE
#define MT_TOP(ofs)

#define MT_TOP_LPCR_HOST_BAND0
#define MT_TOP_LPCR_HOST_FW_OWN
#define MT_TOP_LPCR_HOST_DRV_OWN

#define MT_TOP_MISC
#define MT_TOP_MISC_FW_STATE

#define MT_MCU_WPDMA0_BASE
#define MT_MCU_WPDMA0(ofs)

#define MT_WFDMA_DUMMY_CR
#define MT_WFDMA_NEED_REINIT

#define MT_CBTOP_RGU(ofs)
#define MT_CBTOP_RGU_WF_SUBSYS_RST
#define MT_CBTOP_RGU_WF_SUBSYS_RST_WF_WHOLE_PATH

#define MT_HW_BOUND
#define MT_HW_CHIPID
#define MT_HW_REV

#define MT_HW_EMI_CTL
#define MT_HW_EMI_CTL_SLPPROT_EN

#define MT_PCIE_MAC_BASE
#define MT_PCIE_MAC(ofs)
#define MT_PCIE_MAC_INT_ENABLE
#define MT_PCIE_MAC_PM
#define MT_PCIE_MAC_PM_L0S_DIS

#define MT_DMA_SHDL(ofs)
#define MT_DMASHDL_SW_CONTROL
#define MT_DMASHDL_DMASHDL_BYPASS
#define MT_DMASHDL_OPTIONAL
#define MT_DMASHDL_PAGE
#define MT_DMASHDL_GROUP_SEQ_ORDER
#define MT_DMASHDL_REFILL
#define MT_DMASHDL_REFILL_MASK
#define MT_DMASHDL_PKT_MAX_SIZE
#define MT_DMASHDL_PKT_MAX_SIZE_PLE
#define MT_DMASHDL_PKT_MAX_SIZE_PSE

#define MT_DMASHDL_GROUP_QUOTA(_n)
#define MT_DMASHDL_GROUP_QUOTA_MIN
#define MT_DMASHDL_GROUP_QUOTA_MAX

#define MT_DMASHDL_Q_MAP(_n)
#define MT_DMASHDL_Q_MAP_MASK
#define MT_DMASHDL_Q_MAP_SHIFT(_n)

#define MT_DMASHDL_SCHED_SET(_n)

#define MT_WFDMA_HOST_CONFIG
#define MT_WFDMA_HOST_CONFIG_USB_RXEVT_EP4_EN

#define MT_UMAC(ofs)
#define MT_UDMA_TX_QSEL
#define MT_FW_DL_EN

#define MT_UDMA_WLCFG_1
#define MT_WL_RX_AGG_PKT_LMT
#define MT_WL_TX_TMOUT_LMT

#define MT_UDMA_WLCFG_0
#define MT_WL_RX_AGG_TO
#define MT_WL_RX_AGG_LMT
#define MT_WL_TX_TMOUT_FUNC_EN
#define MT_WL_TX_DPH_CHK_EN
#define MT_WL_RX_MPSZ_PAD0
#define MT_WL_RX_FLUSH
#define MT_TICK_1US_EN
#define MT_WL_RX_AGG_EN
#define MT_WL_RX_EN
#define MT_WL_TX_EN
#define MT_WL_RX_BUSY
#define MT_WL_TX_BUSY

#define MT_UDMA_CONN_INFRA_STATUS
#define MT_UDMA_CONN_WFSYS_INIT_DONE
#define MT_UDMA_CONN_INFRA_STATUS_SEL

#define MT_SSUSB_EPCTL_CSR(ofs)
#define MT_SSUSB_EPCTL_CSR_EP_RST_OPT

#define MT_UWFDMA0(ofs)
#define MT_UWFDMA0_GLO_CFG
#define MT_UWFDMA0_GLO_CFG_EXT0
#define MT_UWFDMA0_GLO_CFG_EXT1
#define MT_UWFDMA0_TX_RING_EXT_CTRL(_n)

#define MT_CONN_STATUS
#define MT_WIFI_PATCH_DL_STATE

#define MT_CONN_ON_LPCTL
#define PCIE_LPCR_HOST_SET_OWN
#define PCIE_LPCR_HOST_CLR_OWN
#define PCIE_LPCR_HOST_OWN_SYNC

#define MT_CONN_ON_MISC
#define MT_TOP_MISC2_FW_PWR_ON
#define MT_TOP_MISC2_FW_N9_ON
#define MT_TOP_MISC2_FW_N9_RDY

#define MT_WF_SW_DEF_CR(ofs)
#define MT_WF_SW_DEF_CR_USB_MCU_EVENT
#define MT_WF_SW_SER_TRIGGER_SUSPEND
#define MT_WF_SW_SER_DONE_SUSPEND

#define WFSYS_SW_RST_B
#define WFSYS_SW_INIT_DONE

#endif /* __MT792X_REGS_H */