Commit e5a9f383 authored by Shayne Chen's avatar Shayne Chen Committed by Felix Fietkau

mt76: mt7915: set muru platform type

Set muru platform type by mcu cmd to notify fw to init corresponding
algorithm.
Suggested-by: default avatarMoney Wang <money.wang@mediatek.com>
Reviewed-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarShayne Chen <shayne.chen@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent f9372753
...@@ -2906,6 +2906,21 @@ static int mt7915_mcu_set_mwds(struct mt7915_dev *dev, bool enabled) ...@@ -2906,6 +2906,21 @@ static int mt7915_mcu_set_mwds(struct mt7915_dev *dev, bool enabled)
sizeof(req), false); sizeof(req), false);
} }
int mt7915_mcu_set_muru_ctrl(struct mt7915_dev *dev, u32 cmd, u32 val)
{
struct {
__le32 cmd;
u8 val[4];
} __packed req = {
.cmd = cpu_to_le32(cmd),
};
put_unaligned_le32(val, req.val);
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL), &req,
sizeof(req), false);
}
int mt7915_mcu_init(struct mt7915_dev *dev) int mt7915_mcu_init(struct mt7915_dev *dev)
{ {
static const struct mt76_mcu_ops mt7915_mcu_ops = { static const struct mt76_mcu_ops mt7915_mcu_ops = {
...@@ -2935,6 +2950,11 @@ int mt7915_mcu_init(struct mt7915_dev *dev) ...@@ -2935,6 +2950,11 @@ int mt7915_mcu_init(struct mt7915_dev *dev)
if (ret) if (ret)
return ret; return ret;
ret = mt7915_mcu_set_muru_ctrl(dev, MURU_SET_PLATFORM_TYPE,
MURU_PLATFORM_TYPE_PERF_LEVEL_2);
if (ret)
return ret;
return mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(SET), return mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(SET),
MCU_WA_PARAM_RED, 0, 0); MCU_WA_PARAM_RED, 0, 0);
} }
......
...@@ -1092,6 +1092,16 @@ enum { ...@@ -1092,6 +1092,16 @@ enum {
MT_BF_MODULE_UPDATE = 25 MT_BF_MODULE_UPDATE = 25
}; };
enum {
MURU_SET_ARB_OP_MODE = 14,
MURU_SET_PLATFORM_TYPE = 25,
};
enum {
MURU_PLATFORM_TYPE_PERF_LEVEL_1 = 1,
MURU_PLATFORM_TYPE_PERF_LEVEL_2,
};
#define MT7915_WTBL_UPDATE_MAX_SIZE (sizeof(struct wtbl_req_hdr) + \ #define MT7915_WTBL_UPDATE_MAX_SIZE (sizeof(struct wtbl_req_hdr) + \
sizeof(struct wtbl_generic) + \ sizeof(struct wtbl_generic) + \
sizeof(struct wtbl_rx) + \ sizeof(struct wtbl_rx) + \
......
...@@ -443,6 +443,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev, ...@@ -443,6 +443,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
const struct mt7915_dfs_pulse *pulse); const struct mt7915_dfs_pulse *pulse);
int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index, int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index,
const struct mt7915_dfs_pattern *pattern); const struct mt7915_dfs_pattern *pattern);
int mt7915_mcu_set_muru_ctrl(struct mt7915_dev *dev, u32 cmd, u32 val);
int mt7915_mcu_apply_group_cal(struct mt7915_dev *dev); int mt7915_mcu_apply_group_cal(struct mt7915_dev *dev);
int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy); int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy);
int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch); int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch);
......
...@@ -169,22 +169,16 @@ static int ...@@ -169,22 +169,16 @@ static int
mt7915_tm_set_tam_arb(struct mt7915_phy *phy, bool enable, bool mu) mt7915_tm_set_tam_arb(struct mt7915_phy *phy, bool enable, bool mu)
{ {
struct mt7915_dev *dev = phy->dev; struct mt7915_dev *dev = phy->dev;
struct { u32 op_mode;
__le32 cmd;
u8 op_mode;
} __packed req = {
.cmd = cpu_to_le32(MURU_SET_ARB_OP_MODE),
};
if (!enable) if (!enable)
req.op_mode = TAM_ARB_OP_MODE_NORMAL; op_mode = TAM_ARB_OP_MODE_NORMAL;
else if (mu) else if (mu)
req.op_mode = TAM_ARB_OP_MODE_TEST; op_mode = TAM_ARB_OP_MODE_TEST;
else else
req.op_mode = TAM_ARB_OP_MODE_FORCE_SU; op_mode = TAM_ARB_OP_MODE_FORCE_SU;
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MURU_CTRL), &req, return mt7915_mcu_set_muru_ctrl(dev, MURU_SET_ARB_OP_MODE, op_mode);
sizeof(req), false);
} }
static int static int
......
...@@ -102,8 +102,4 @@ enum { ...@@ -102,8 +102,4 @@ enum {
TAM_ARB_OP_MODE_FORCE_SU = 5, TAM_ARB_OP_MODE_FORCE_SU = 5,
}; };
enum {
MURU_SET_ARB_OP_MODE = 14,
};
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment