[PATCH v4 05/12] mt76: mt7915: add firmware support for mt7916
Ben Greear
greearb at candelatech.com
Thu Jan 20 13:29:36 PST 2022
On 12/19/21 6:17 PM, Bo Jiao wrote:
> From: Bo Jiao <Bo.Jiao at mediatek.com>
>
> Update firmware initialization for mt7916.
> This is an intermediate patch to add mt7916 support.
>
> Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
> Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
> Co-developed-by: Ryder Lee <ryder.lee at mediatek.com>
> Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
> Signed-off-by: Bo Jiao <Bo.Jiao at mediatek.com>
> ---
> v3:
> - modify the function mt7915_wfsys_reset to support mt7916
> ---
> .../net/wireless/mediatek/mt76/mt7915/init.c | 75 ++++++++---------
> .../net/wireless/mediatek/mt76/mt7915/mcu.c | 81 +++++++++++++++----
> .../wireless/mediatek/mt76/mt7915/mt7915.h | 4 +
> .../net/wireless/mediatek/mt76/mt7915/pci.c | 3 +
> .../net/wireless/mediatek/mt76/mt7915/regs.h | 6 +-
> 5 files changed, 115 insertions(+), 54 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> index 2da342d..edf0d7e 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> @@ -511,41 +511,53 @@ static void mt7915_init_work(struct work_struct *work)
>
> static void mt7915_wfsys_reset(struct mt7915_dev *dev)
> {
> - u32 val = MT_TOP_PWR_KEY | MT_TOP_PWR_SW_PWR_ON | MT_TOP_PWR_PWR_ON;
> + u32 val;
>
> #define MT_MCU_DUMMY_RANDOM GENMASK(15, 0)
> #define MT_MCU_DUMMY_DEFAULT GENMASK(31, 16)
> + if (is_mt7915(&dev->mt76)) {
> + mt76_wr(dev, MT_MCU_WFDMA0_DUMMY_CR, MT_MCU_DUMMY_RANDOM);
> +
> + /* change to software control */
> + val |= MT_TOP_PWR_SW_RST;
> + mt76_wr(dev, MT_TOP_PWR_CTRL, val);
val is not properly initialized in this path. I also notice this is not the version of the patch
that was applied to nbd's tree. The 'else nic is 7916' clause that this patch creates is also different
in nbd's tree vs this patch.
I'm not sure what is correct, I've been testing with the 'v3' series and have not gotten
7916 to work yet...
Thanks,
Ben
--
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc http://www.candelatech.com
More information about the Linux-mediatek
mailing list