wifi: mt76: mt792x: replace shared PCIe MAC macros with per-chip struct

Replace hardcoded MT_PCIE_MAC_INT_ENABLE and MT_PCIE_MAC_PM macros
with a per-chip mt792x_pcie_reg struct. Remove the shared macros
from mt792x_regs.h and update mt792x_wpdma_reinit_cond() to use
dev->pcie_reg.

This is a preparation patch before enabling MT7928 PCIe support.

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 5d3681c069
commit 610830a7da
3 changed files with 10 additions and 6 deletions
+6
View File
@@ -238,6 +238,11 @@ struct mt792x_hif_ops {
int (*fw_own)(struct mt792x_dev *dev);
};
struct mt792x_pcie_reg {
u32 imask;
u32 pm;
};
struct mt792x_dev {
union { /* must be first */
struct mt76_dev mt76;
@@ -273,6 +278,7 @@ struct mt792x_dev {
struct mt76_connac_coredump coredump;
const struct mt792x_hif_ops *hif_ops;
const struct mt792x_irq_map *irq_map;
const struct mt792x_pcie_reg *pcie_reg;
struct work_struct ipv6_ns_work;
struct delayed_work mlo_pm_work;
+4 -2
View File
@@ -345,7 +345,8 @@ int mt792x_wpdma_reinit_cond(struct mt792x_dev *dev)
if (mt792x_dma_need_reinit(dev)) {
/* disable interrutpts */
mt76_wr(dev, dev->irq_map->host_irq_enable, 0);
mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0x0);
if (dev->pcie_reg)
mt76_wr(dev, dev->pcie_reg->imask, 0x0);
err = mt792x_wpdma_reset(dev, false);
if (err) {
@@ -354,7 +355,8 @@ int mt792x_wpdma_reinit_cond(struct mt792x_dev *dev)
}
/* enable interrutpts */
mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0xff);
if (dev->pcie_reg)
mt76_wr(dev, dev->pcie_reg->imask, 0xff);
pm->stats.lp_wake++;
}
-4
View File
@@ -415,10 +415,6 @@
#define MT_HW_EMI_CTL 0x18011100
#define MT_HW_EMI_CTL_SLPPROT_EN BIT(1)
#define MT_PCIE_MAC_BASE 0x10000
#define MT_PCIE_MAC(ofs) (MT_PCIE_MAC_BASE + (ofs))
#define MT_PCIE_MAC_INT_ENABLE MT_PCIE_MAC(0x188)
#define MT_PCIE_MAC_PM MT_PCIE_MAC(0x194)
#define MT_PCIE_MAC_PM_L0S_DIS BIT(8)
#define MT_DMA_SHDL(ofs) (0x7c026000 + (ofs))