162306a36Sopenharmony_ci/* SPDX-License-Identifier: ISC */
262306a36Sopenharmony_ci/* Copyright (C) 2020 MediaTek Inc. */
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#ifndef __MT7921_REGS_H
562306a36Sopenharmony_ci#define __MT7921_REGS_H
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#include "../mt792x_regs.h"
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#define MT_MDP_BASE			0x820cd000
1062306a36Sopenharmony_ci#define MT_MDP(ofs)			(MT_MDP_BASE + (ofs))
1162306a36Sopenharmony_ci
1262306a36Sopenharmony_ci#define MT_MDP_DCR0			MT_MDP(0x000)
1362306a36Sopenharmony_ci#define MT_MDP_DCR0_DAMSDU_EN		BIT(15)
1462306a36Sopenharmony_ci#define MT_MDP_DCR0_RX_HDR_TRANS_EN	BIT(19)
1562306a36Sopenharmony_ci
1662306a36Sopenharmony_ci#define MT_MDP_DCR1			MT_MDP(0x004)
1762306a36Sopenharmony_ci#define MT_MDP_DCR1_MAX_RX_LEN		GENMASK(15, 3)
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define MT_MDP_BNRCFR0(_band)		MT_MDP(0x070 + ((_band) << 8))
2062306a36Sopenharmony_ci#define MT_MDP_RCFR0_MCU_RX_MGMT	GENMASK(5, 4)
2162306a36Sopenharmony_ci#define MT_MDP_RCFR0_MCU_RX_CTL_NON_BAR	GENMASK(7, 6)
2262306a36Sopenharmony_ci#define MT_MDP_RCFR0_MCU_RX_CTL_BAR	GENMASK(9, 8)
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#define MT_MDP_BNRCFR1(_band)		MT_MDP(0x074 + ((_band) << 8))
2562306a36Sopenharmony_ci#define MT_MDP_RCFR1_MCU_RX_BYPASS	GENMASK(23, 22)
2662306a36Sopenharmony_ci#define MT_MDP_RCFR1_RX_DROPPED_UCAST	GENMASK(28, 27)
2762306a36Sopenharmony_ci#define MT_MDP_RCFR1_RX_DROPPED_MCAST	GENMASK(30, 29)
2862306a36Sopenharmony_ci#define MT_MDP_TO_HIF			0
2962306a36Sopenharmony_ci#define MT_MDP_TO_WM			1
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define MT_WFDMA0_HOST_INT_ENA		MT_WFDMA0(0x204)
3262306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA8		BIT(12)
3362306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA9		BIT(13)
3462306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA10		BIT(14)
3562306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA11		BIT(15)
3662306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA12		BIT(16)
3762306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA13		BIT(17)
3862306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA14		BIT(18)
3962306a36Sopenharmony_ci#define HOST_RX_DONE_INT_ENA4		BIT(22)
4062306a36Sopenharmony_ci#define HOST_RX_DONE_INT_ENA5		BIT(23)
4162306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA16		BIT(26)
4262306a36Sopenharmony_ci#define HOST_TX_DONE_INT_ENA17		BIT(27)
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci/* WFDMA interrupt */
4562306a36Sopenharmony_ci#define MT_INT_RX_DONE_DATA		HOST_RX_DONE_INT_ENA2
4662306a36Sopenharmony_ci#define MT_INT_RX_DONE_WM		HOST_RX_DONE_INT_ENA0
4762306a36Sopenharmony_ci#define MT_INT_RX_DONE_WM2		HOST_RX_DONE_INT_ENA4
4862306a36Sopenharmony_ci#define MT_INT_RX_DONE_ALL		(MT_INT_RX_DONE_DATA | \
4962306a36Sopenharmony_ci					 MT_INT_RX_DONE_WM | \
5062306a36Sopenharmony_ci					 MT_INT_RX_DONE_WM2)
5162306a36Sopenharmony_ci#define MT_INT_TX_DONE_MCU_WM		HOST_TX_DONE_INT_ENA17
5262306a36Sopenharmony_ci#define MT_INT_TX_DONE_FWDL		HOST_TX_DONE_INT_ENA16
5362306a36Sopenharmony_ci#define MT_INT_TX_DONE_BAND0		HOST_TX_DONE_INT_ENA0
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci#define MT_INT_TX_DONE_MCU		(MT_INT_TX_DONE_MCU_WM |	\
5662306a36Sopenharmony_ci					 MT_INT_TX_DONE_FWDL)
5762306a36Sopenharmony_ci#define MT_INT_TX_DONE_ALL		(MT_INT_TX_DONE_MCU_WM |	\
5862306a36Sopenharmony_ci					 MT_INT_TX_DONE_BAND0 |	\
5962306a36Sopenharmony_ci					GENMASK(18, 4))
6062306a36Sopenharmony_ci
6162306a36Sopenharmony_ci#define MT_RX_DATA_RING_BASE		MT_WFDMA0(0x520)
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#define MT_INFRA_CFG_BASE		0xfe000
6462306a36Sopenharmony_ci#define MT_INFRA(ofs)			(MT_INFRA_CFG_BASE + (ofs))
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define MT_HIF_REMAP_L1			MT_INFRA(0x24c)
6762306a36Sopenharmony_ci#define MT_HIF_REMAP_L1_MASK		GENMASK(15, 0)
6862306a36Sopenharmony_ci#define MT_HIF_REMAP_L1_OFFSET		GENMASK(15, 0)
6962306a36Sopenharmony_ci#define MT_HIF_REMAP_L1_BASE		GENMASK(31, 16)
7062306a36Sopenharmony_ci#define MT_HIF_REMAP_BASE_L1		0x40000
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#define MT_WFSYS_SW_RST_B		0x18000140
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#define MT_WTBLON_TOP_WDUCR		MT_WTBLON_TOP(0x200)
7562306a36Sopenharmony_ci#define MT_WTBLON_TOP_WDUCR_GROUP	GENMASK(2, 0)
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define MT_WTBL_UPDATE			MT_WTBLON_TOP(0x230)
7862306a36Sopenharmony_ci#define MT_WTBL_UPDATE_WLAN_IDX		GENMASK(9, 0)
7962306a36Sopenharmony_ci#define MT_WTBL_UPDATE_ADM_COUNT_CLEAR	BIT(12)
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ci#endif
82