Re: [PATCH v2 02/11] mt76: mt7915: refine register definition
From: bo.jiao <hidden>
Date: 2021-11-15 02:22:45
On Fri, 2021-11-12 at 12:05 -0800, Ben Greear wrote:
On 11/5/21 3:02 AM, Bo Jiao wrote:quoted
From: Bo Jiao <redacted> 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@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@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@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 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek