[PATCH v2 02/11] mt76: mt7915: refine register definition

bo.jiao bo.jiao at mediatek.com
Sun Nov 14 18:22:25 PST 2021


On Fri, 2021-11-12 at 12:05 -0800, Ben Greear wrote:
> On 11/5/21 3:02 AM, Bo Jiao wrote:
> > From: Bo Jiao <Bo.Jiao at mediatek.com>
> > 
> > Add mt7915_reg_desc to differentiate chip generations.
> > This is an intermediate patch to introduce mt7916 support.
> 
> While merging this into my patched tree, I noticed this discrepency,
> it seems this patch is changing the value for SDR32/33 and/or
> confusing
> SDR32 with SDR33.
> 
> Is this on purpose?
> 
> [greearb at ben-dt4 linux-5.16.dev.y]$ git am --show-current-patch|grep
> 088
> +	[MIB_SDR32]		= { INVALID_BASE, 0x088 },
> -#define MT_MIB_SDR32(_band)		MT_WF_MIB(_band, 0x088)
> +#define MT_MIB_SDR33(_band)		MT_WF_MIB(_band, 0x088)
> [greearb at ben-dt4 linux-5.16.dev.y]$ git am --show-current-patch|grep
> SDR32
>   	cnt = mt76_rr(dev, MT_MIB_SDR32(ext_phy));
>   	mib->tx_pkt_ebf_cnt +=
> FIELD_GET(MT_MIB_SDR32_TX_PKT_EBF_CNT_MASK, cnt);
> +	[MIB_SDR32]		= { INVALID_BASE, 0x088 },
> +	[MIB_SDR32]		= { INVALID_BASE, 0x7a8 },
> +	MIB_SDR32,
> -#define MT_MIB_SDR32(_band)		MT_WF_MIB(_band, 0x088)
> +#define MT_MIB_SDR32(_band)		MT_WF_MIB(_band,
> __REG_OFFS(dev, MIB_SDR32))
>   #define MT_MIB_SDR32_TX_PKT_EBF_CNT_MASK	GENMASK(15, 0)
> +#define MT_MIB_SDR32_TX_PKT_IBF_CNT_MASK	__MASK(dev,
> MIB_BF_TX_CNT)
> [greearb at ben-dt4 linux-5.16.dev.y]$ git am --show-current-patch|grep
> SDR33
> -	cnt = mt76_rr(dev, MT_MIB_SDR33(ext_phy));
> -	mib->tx_pkt_ibf_cnt +=
> FIELD_GET(MT_MIB_SDR33_TX_PKT_IBF_CNT_MASK, cnt);
> +		cnt = mt76_rr(dev, MT_MIB_SDR33(ext_phy));
> -#define MT_MIB_SDR33(_band)		MT_WF_MIB(_band, 0x08c)
> -#define MT_MIB_SDR33_TX_PKT_IBF_CNT_MASK	GENMASK(15, 0)
> +#define MT_MIB_SDR33(_band)		MT_WF_MIB(_band, 0x088)
> 
> Thanks,
> Ben
> 
> 
for mt7915, MT_MIB_SDR33's mask(15,0) is tx_pkt_ibf_cnt,
for mt7916, MT_MIB_SDR32's mask(15,0) is tx_pkt_ebf_cnt and mask(31,16)
is tx_pkt_ibf_cnt.

Thanks,
Bo Jiao


More information about the Linux-mediatek mailing list