blob: d3c12af696c12d4d04b329fe27c8defab3026720 [file] [log] [blame]
developer7e2761e2023-10-12 08:11:13 +08001From 140d3c7139e37efcdc097b1b23be635da683e773 Mon Sep 17 00:00:00 2001
2From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3Date: Mon, 22 May 2023 09:30:28 +0800
4Subject: [PATCH 24/98] wifi: mt76: mt7996: add kite pci support
5
6Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
7---
8 mt76_connac.h | 5 +++++
9 mt7996/mmio.c | 1 +
10 mt7996/pci.c | 8 ++++++--
11 3 files changed, 12 insertions(+), 2 deletions(-)
12
13diff --git a/mt76_connac.h b/mt76_connac.h
14index c6726ab..b1ec8d4 100644
15--- a/mt76_connac.h
16+++ b/mt76_connac.h
17@@ -222,6 +222,11 @@ static inline bool is_mt7996(struct mt76_dev *dev)
18 return mt76_chip(dev) == 0x7990;
19 }
20
21+static inline bool is_mt7992(struct mt76_dev *dev)
22+{
23+ return mt76_chip(dev) == 0x7992;
24+}
25+
26 static inline bool is_mt7622(struct mt76_dev *dev)
27 {
28 if (!IS_ENABLED(CONFIG_MT7622_WMAC))
29diff --git a/mt7996/mmio.c b/mt7996/mmio.c
30index ab088a2..567f930 100644
31--- a/mt7996/mmio.c
32+++ b/mt7996/mmio.c
33@@ -369,6 +369,7 @@ static int mt7996_mmio_init(struct mt76_dev *mdev,
34
35 switch (device_id) {
36 case 0x7990:
37+ case 0x7992:
38 dev->reg.base = mt7996_reg_base;
39 dev->reg.map = mt7996_reg_map;
40 dev->reg.map_size = ARRAY_SIZE(mt7996_reg_map);
41diff --git a/mt7996/pci.c b/mt7996/pci.c
42index 92869ca..e8edf77 100644
43--- a/mt7996/pci.c
44+++ b/mt7996/pci.c
45@@ -17,11 +17,13 @@ static u32 hif_idx;
46
47 static const struct pci_device_id mt7996_pci_device_table[] = {
48 { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7990) },
49+ { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7992) },
50 { },
51 };
52
53 static const struct pci_device_id mt7996_hif_device_table[] = {
54 { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7991) },
55+ { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x799a) },
56 { },
57 };
58
59@@ -60,7 +62,9 @@ static void mt7996_put_hif2(struct mt7996_hif *hif)
60 static struct mt7996_hif *mt7996_pci_init_hif2(struct pci_dev *pdev)
61 {
62 hif_idx++;
63- if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7991, NULL))
64+
65+ if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7991, NULL) &&
66+ !pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x799a, NULL))
67 return NULL;
68
69 writel(hif_idx | MT_PCIE_RECOG_ID_SEM,
70@@ -113,7 +117,7 @@ static int mt7996_pci_probe(struct pci_dev *pdev,
71
72 mt76_pci_disable_aspm(pdev);
73
74- if (id->device == 0x7991)
75+ if (id->device == 0x7991 || id->device == 0x799a)
76 return mt7996_pci_hif2_probe(pdev);
77
78 dev = mt7996_mmio_probe(&pdev->dev, pcim_iomap_table(pdev)[0],
79--
802.18.0
81