[PATCH v2 04/11] mt76: mt7915: add firmware support for mt7916

Ben Greear greearb at candelatech.com
Fri Nov 12 14:30:58 PST 2021


On 11/5/21 3:02 AM, 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>
> ---
>   .../net/wireless/mediatek/mt76/mt7915/init.c  |  6 --
>   .../net/wireless/mediatek/mt76/mt7915/mcu.c   | 78 +++++++++++++++----
>   .../wireless/mediatek/mt76/mt7915/mt7915.h    |  4 +
>   .../net/wireless/mediatek/mt76/mt7915/pci.c   |  3 +
>   .../net/wireless/mediatek/mt76/mt7915/regs.h  |  5 +-
>   5 files changed, 72 insertions(+), 24 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> index f455c12..a4e2d85 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
> @@ -567,12 +567,6 @@ static int mt7915_init_hardware(struct mt7915_dev *dev)
>   
>   	set_bit(MT76_STATE_INITIALIZED, &dev->mphy.state);
>   
> -	/*
> -	 * force firmware operation mode into normal state,
> -	 * which should be set before firmware download stage.
> -	 */
> -	mt76_wr(dev, MT_SWDEF_MODE, MT_SWDEF_NORMAL_MODE);
> -
>   	ret = mt7915_mcu_init(dev);
>   	if (ret) {
>   		/* Reset and try again */
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> index ee9952d..43ddbc1 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> @@ -2713,16 +2713,20 @@ static int mt7915_mcu_start_patch(struct mt7915_dev *dev)
>   				 sizeof(req), true);
>   }
>   
> -static int mt7915_driver_own(struct mt7915_dev *dev)
> +static int mt7915_driver_own(struct mt7915_dev *dev, u8 band)
>   {
> -	mt76_wr(dev, MT_TOP_LPCR_HOST_BAND0, MT_TOP_LPCR_HOST_DRV_OWN);
> -	if (!mt76_poll_msec(dev, MT_TOP_LPCR_HOST_BAND0,
> +	mt76_wr(dev, MT_TOP_LPCR_HOST_BAND(band), MT_TOP_LPCR_HOST_DRV_OWN);
> +	if (!mt76_poll_msec(dev, MT_TOP_LPCR_HOST_BAND(band),
>   			    MT_TOP_LPCR_HOST_FW_OWN_STAT,

I think that MT_TOP_LPCR_HOST_FW_OWN_STAT is not defined in the upstream kernel...

Maybe a patch from owrt was not added to upstream yet?

Thanks,
Ben



-- 
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc  http://www.candelatech.com




More information about the Linux-mediatek mailing list