[PATCH v2 8/8] mt76: mt7915: set muru platform type

Ryder Lee ryder.lee at mediatek.com
Mon Sep 6 11:46:12 PDT 2021


On Mon, 2021-09-06 at 19:44 +0800, Shayne Chen wrote:
> Notify fw to init corresponding muru algorithm.
> 
> Suggested-by: Money Wang <money.wang at mediatek.com>
> Signed-off-by: Shayne Chen <shayne.chen at mediatek.com>
> ---
>  drivers/net/wireless/mediatek/mt76/mt7915/mcu.c  | 16
> ++++++++++++++++
>  drivers/net/wireless/mediatek/mt76/mt7915/mcu.h  |  5 +++++
>  .../net/wireless/mediatek/mt76/mt7915/testmode.h |  4 ----
>  3 files changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> index 229ba3c469d1..6242d5e11107 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
> @@ -2949,6 +2949,21 @@ static int mt7915_mcu_set_mwds(struct
> mt7915_dev *dev, bool enabled)
>                                  sizeof(req), false);
>  }
> 
> +static int mt7915_mcu_set_muru_ptype(struct mt7915_dev *dev)
> +{
> +       struct {
> +               __le32 cmd;
> +               u8 ptype;
> +               u8 _rsv[3];
> +       } __packed req = {
> +               .cmd = MURU_SET_PLATFORM_TYPE,

cpu_to_le32

> +               .ptype = 2,
> +       };
> +
> +       return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL),
> &req,
> +                                sizeof(req), false);
> +}
> +
>  int mt7915_mcu_init(struct mt7915_dev *dev)
>  {
>         static const struct mt76_mcu_ops mt7915_mcu_ops = {
> @@ -2973,6 +2988,7 @@ int mt7915_mcu_init(struct mt7915_dev *dev)
>         mt7915_mcu_fw_log_2_host(dev, 0);
>         mt7915_mcu_set_mwds(dev, 1);
>         mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(SET),
> MCU_WA_PARAM_RED, 0, 0);
> +       mt7915_mcu_set_muru_ptype(dev);
> 
>         return 0;
>  }
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
> b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
> index 6344faf3f394..57be9262ec2a 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
> @@ -1086,6 +1086,11 @@ enum {
>         MT_BF_MODULE_UPDATE = 25
>  };
> 
> +enum {
> +       MURU_SET_ARB_OP_MODE = 14,
> +       MURU_SET_PLATFORM_TYPE = 25,
> +};
> 

I think it's better to use mt7915_mcu_set_muru_cmd(phy, cmd, opcode) in
the long run to avoid adding duplicated muru_ctrl for future UL
support.





More information about the Linux-mediatek mailing list