wifi: mt76: mt7925: add MT7928 irq_map with chip-specific rx masks

MT7928 uses different RX interrupt bit assignments (RX_DONE_DATA on
ENA0, RX_DONE_WM on ENA3). Add MT7928-specific irq_map and select
it at probe time based on PCI device ID.

Signed-off-by: FC Wei <[email protected]>
Signed-off-by: Emery Hsin <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Emery Hsin
2026-07-20 14:01:46 +02:00
committed by Felix Fietkau
parent 65bfecfbdb
commit cb4df96e13
2 changed files with 30 additions and 3 deletions
+24 -3
View File
@@ -331,6 +331,20 @@ static const struct mt792x_irq_map mt7927_irq_map = {
}, },
}; };
static const struct mt792x_irq_map mt7928_irq_map = {
.host_irq_enable = MT_WFDMA0_HOST_INT_ENA,
.tx = {
.all_complete_mask = MT_INT_TX_DONE_ALL,
.mcu_complete_mask = MT_INT_TX_DONE_MCU,
},
.rx = {
.all_complete_mask = MT7928_INT_RX_DONE_ALL,
.data_complete_mask = MT7928_INT_RX_DONE_DATA,
.wm_complete_mask = MT7928_INT_RX_DONE_WM,
.wm2_complete_mask = MT_INT_RX_DONE_WM2,
},
};
static int mt7925_pci_probe(struct pci_dev *pdev, static int mt7925_pci_probe(struct pci_dev *pdev,
const struct pci_device_id *id) const struct pci_device_id *id)
{ {
@@ -360,11 +374,11 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
.drv_own = mt792xe_mcu_drv_pmctrl, .drv_own = mt792xe_mcu_drv_pmctrl,
.fw_own = mt792xe_mcu_fw_pmctrl, .fw_own = mt792xe_mcu_fw_pmctrl,
}; };
struct ieee80211_ops *ops; bool is_mt7927_hw, is_mt7928_hw;
struct mt76_bus_ops *bus_ops; struct mt76_bus_ops *bus_ops;
struct ieee80211_ops *ops;
struct mt792x_dev *dev; struct mt792x_dev *dev;
struct mt76_dev *mdev; struct mt76_dev *mdev;
bool is_mt7927_hw;
u8 features; u8 features;
int ret; int ret;
u16 cmd; u16 cmd;
@@ -394,6 +408,7 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
is_mt7927_hw = (pdev->device == 0x6639 || pdev->device == 0x7927 || is_mt7927_hw = (pdev->device == 0x6639 || pdev->device == 0x7927 ||
pdev->device == 0x0738); pdev->device == 0x0738);
is_mt7928_hw = (pdev->device == 0x7928 || pdev->device == 0x7935);
/* MT7927: ASPM L1 causes unreliable WFDMA register access */ /* MT7927: ASPM L1 causes unreliable WFDMA register access */
if (mt7925_disable_aspm || is_mt7927_hw) if (mt7925_disable_aspm || is_mt7927_hw)
@@ -417,9 +432,15 @@ static int mt7925_pci_probe(struct pci_dev *pdev,
dev = container_of(mdev, struct mt792x_dev, mt76); dev = container_of(mdev, struct mt792x_dev, mt76);
dev->fw_features = features; dev->fw_features = features;
dev->hif_ops = &mt7925_pcie_ops; dev->hif_ops = &mt7925_pcie_ops;
dev->irq_map = is_mt7927_hw ? &mt7927_irq_map : &mt7925_irq_map;
dev->pcie_reg = &mt7925_pcie_reg; dev->pcie_reg = &mt7925_pcie_reg;
if (is_mt7928_hw)
dev->irq_map = &mt7928_irq_map;
else if (is_mt7927_hw)
dev->irq_map = &mt7927_irq_map;
else
dev->irq_map = &mt7925_irq_map;
mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]); mt76_mmio_init(&dev->mt76, pcim_iomap_table(pdev)[0]);
tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev); tasklet_init(&mdev->irq_tasklet, mt792x_irq_tasklet, (unsigned long)dev);
+6
View File
@@ -58,6 +58,12 @@
MT7927_INT_RX_DONE_WM | \ MT7927_INT_RX_DONE_WM | \
MT7927_INT_RX_DONE_WM2) MT7927_INT_RX_DONE_WM2)
#define MT7928_INT_RX_DONE_DATA HOST_RX_DONE_INT_ENA0
#define MT7928_INT_RX_DONE_WM HOST_RX_DONE_INT_ENA3
#define MT7928_INT_RX_DONE_ALL (MT7928_INT_RX_DONE_DATA | \
MT7928_INT_RX_DONE_WM | \
MT_INT_RX_DONE_WM2)
#define MT_INT_TX_DONE_MCU_WM (HOST_TX_DONE_INT_ENA15 | \ #define MT_INT_TX_DONE_MCU_WM (HOST_TX_DONE_INT_ENA15 | \
HOST_TX_DONE_INT_ENA17) HOST_TX_DONE_INT_ENA17)