mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mcu: skip ROM patch check/locking on mt7612, always apply patch
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -120,11 +120,12 @@ mt76pci_load_rom_patch(struct mt76_dev *dev)
|
|||||||
{
|
{
|
||||||
const struct firmware *fw = NULL;
|
const struct firmware *fw = NULL;
|
||||||
struct mt76_patch_header *hdr;
|
struct mt76_patch_header *hdr;
|
||||||
|
bool rom_protect = !is_mt7612(dev);
|
||||||
int len, ret = 0;
|
int len, ret = 0;
|
||||||
__le32 *cur;
|
__le32 *cur;
|
||||||
u32 patch_mask, patch_reg;
|
u32 patch_mask, patch_reg;
|
||||||
|
|
||||||
if (!mt76_poll(dev, MT_MCU_SEMAPHORE_03, 1, 1, 600)) {
|
if (rom_protect && !mt76_poll(dev, MT_MCU_SEMAPHORE_03, 1, 1, 600)) {
|
||||||
printk("Could not get hardware semaphore for ROM PATCH\n");
|
printk("Could not get hardware semaphore for ROM PATCH\n");
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
@@ -137,7 +138,7 @@ mt76pci_load_rom_patch(struct mt76_dev *dev)
|
|||||||
patch_reg = MT_MCU_COM_REG0;
|
patch_reg = MT_MCU_COM_REG0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mt76_rr(dev, patch_reg) & patch_mask) {
|
if (rom_protect && (mt76_rr(dev, patch_reg) & patch_mask)) {
|
||||||
printk("ROM patch already applied\n");
|
printk("ROM patch already applied\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@@ -173,7 +174,8 @@ mt76pci_load_rom_patch(struct mt76_dev *dev)
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
/* release semaphore */
|
/* release semaphore */
|
||||||
mt76_wr(dev, MT_MCU_SEMAPHORE_03, 1);
|
if (rom_protect)
|
||||||
|
mt76_wr(dev, MT_MCU_SEMAPHORE_03, 1);
|
||||||
release_firmware(fw);
|
release_firmware(fw);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user