Commit 2e30db0d authored by Bo Jiao's avatar Bo Jiao Committed by Felix Fietkau

mt76: mt7915: add device id for mt7916

Add pci_device_id to enable mt7916. Note that MT_HW_CHIPID is no
longer used for further chips, so drop it accordingly.
Co-developed-by: default avatarSujuan Chen <sujuan.chen@mediatek.com>
Signed-off-by: default avatarSujuan Chen <sujuan.chen@mediatek.com>
Co-developed-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarRyder Lee <ryder.lee@mediatek.com>
Signed-off-by: default avatarBo Jiao <Bo.Jiao@mediatek.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent cb143967
...@@ -406,7 +406,7 @@ static int mt7915_mmio_init(struct mt76_dev *mdev, ...@@ -406,7 +406,7 @@ static int mt7915_mmio_init(struct mt76_dev *mdev,
bus_ops->rmw = mt7915_rmw; bus_ops->rmw = mt7915_rmw;
dev->mt76.bus = bus_ops; dev->mt76.bus = bus_ops;
mdev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) | mdev->rev = (device_id << 16) |
(mt76_rr(dev, MT_HW_REV) & 0xff); (mt76_rr(dev, MT_HW_REV) & 0xff);
dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev); dev_dbg(mdev->dev, "ASIC revision: %04x\n", mdev->rev);
......
...@@ -18,11 +18,13 @@ static u32 hif_idx; ...@@ -18,11 +18,13 @@ static u32 hif_idx;
static const struct pci_device_id mt7915_pci_device_table[] = { static const struct pci_device_id mt7915_pci_device_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7915) }, { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7915) },
{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7906) },
{ }, { },
}; };
static const struct pci_device_id mt7915_hif_device_table[] = { static const struct pci_device_id mt7915_hif_device_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7916) }, { PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x7916) },
{ PCI_DEVICE(PCI_VENDOR_ID_MEDIATEK, 0x790a) },
{ }, { },
}; };
...@@ -61,7 +63,8 @@ static void mt7915_put_hif2(struct mt7915_hif *hif) ...@@ -61,7 +63,8 @@ static void mt7915_put_hif2(struct mt7915_hif *hif)
static struct mt7915_hif *mt7915_pci_init_hif2(struct pci_dev *pdev) static struct mt7915_hif *mt7915_pci_init_hif2(struct pci_dev *pdev)
{ {
hif_idx++; hif_idx++;
if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7916, NULL)) if (!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x7916, NULL) &&
!pci_get_device(PCI_VENDOR_ID_MEDIATEK, 0x790a, NULL))
return NULL; return NULL;
writel(hif_idx | MT_PCIE_RECOG_ID_SEM, writel(hif_idx | MT_PCIE_RECOG_ID_SEM,
...@@ -111,7 +114,7 @@ static int mt7915_pci_probe(struct pci_dev *pdev, ...@@ -111,7 +114,7 @@ static int mt7915_pci_probe(struct pci_dev *pdev,
mt76_pci_disable_aspm(pdev); mt76_pci_disable_aspm(pdev);
if (id->device == 0x7916) if (id->device == 0x7916 || id->device == 0x790a)
return mt7915_pci_hif2_probe(pdev); return mt7915_pci_hif2_probe(pdev);
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
......
...@@ -741,7 +741,6 @@ enum offs_rev { ...@@ -741,7 +741,6 @@ enum offs_rev {
#define MT_TOP_MISC_FW_STATE GENMASK(2, 0) #define MT_TOP_MISC_FW_STATE GENMASK(2, 0)
#define MT_HW_BOUND 0x70010020 #define MT_HW_BOUND 0x70010020
#define MT_HW_CHIPID 0x70010200
#define MT_HW_REV 0x70010204 #define MT_HW_REV 0x70010204
#define MT_WF_SUBSYS_RST 0x70002600 #define MT_WF_SUBSYS_RST 0x70002600
......
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