Commit 03a25c01 authored by Ryder Lee's avatar Ryder Lee Committed by Felix Fietkau

mt76: mt7615: apply cached RF data for DBDC

Band0 and band1 share the same hardware, so band0 will stop Tx/Rx when
band1 performs Rx calibration. cal_cache is introduced to solve such
corner cases by moving necessary datas from channel_switch to bootup.
Co-developed-by: default avatarPeter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: default avatarPeter Chiu <chui-hao.chiu@mediatek.com>
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 753453af
...@@ -1698,6 +1698,19 @@ int mt7615_mcu_fw_log_2_host(struct mt7615_dev *dev, u8 ctrl) ...@@ -1698,6 +1698,19 @@ int mt7615_mcu_fw_log_2_host(struct mt7615_dev *dev, u8 ctrl)
sizeof(data), true); sizeof(data), true);
} }
static int mt7615_mcu_cal_cache_apply(struct mt7615_dev *dev)
{
struct {
bool cache_enable;
u8 pad[3];
} data = {
.cache_enable = true
};
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_CAL_CACHE, &data,
sizeof(data), false);
}
static int mt7663_load_n9(struct mt7615_dev *dev, const char *name) static int mt7663_load_n9(struct mt7615_dev *dev, const char *name)
{ {
u32 offset = 0, override_addr = 0, flag = FW_START_DLYCAL; u32 offset = 0, override_addr = 0, flag = FW_START_DLYCAL;
...@@ -1906,9 +1919,14 @@ int mt7615_mcu_init(struct mt7615_dev *dev) ...@@ -1906,9 +1919,14 @@ int mt7615_mcu_init(struct mt7615_dev *dev)
mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_FWDL], false); mt76_queue_tx_cleanup(dev, dev->mt76.q_mcu[MT_MCUQ_FWDL], false);
dev_dbg(dev->mt76.dev, "Firmware init done\n"); dev_dbg(dev->mt76.dev, "Firmware init done\n");
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state); set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
mt7615_mcu_fw_log_2_host(dev, 0);
return 0; if (dev->dbdc_support) {
ret = mt7615_mcu_cal_cache_apply(dev);
if (ret)
return ret;
}
return mt7615_mcu_fw_log_2_host(dev, 0);
} }
EXPORT_SYMBOL_GPL(mt7615_mcu_init); EXPORT_SYMBOL_GPL(mt7615_mcu_init);
......
...@@ -531,6 +531,7 @@ enum { ...@@ -531,6 +531,7 @@ enum {
MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58, MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58,
MCU_EXT_CMD_RXDCOC_CAL = 0x59, MCU_EXT_CMD_RXDCOC_CAL = 0x59,
MCU_EXT_CMD_TXDPD_CAL = 0x60, MCU_EXT_CMD_TXDPD_CAL = 0x60,
MCU_EXT_CMD_CAL_CACHE = 0x67,
MCU_EXT_CMD_SET_RDD_TH = 0x7c, MCU_EXT_CMD_SET_RDD_TH = 0x7c,
MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d, MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d,
}; };
......
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