From 2d6e90555497ed106daeb83273a2d16e040d58d1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 7 Dec 2015 16:46:56 +0100 Subject: [PATCH] mt7603: fix hw revision processing --- mt7603_pci.c | 5 +++-- mt7603_regs.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mt7603_pci.c b/mt7603_pci.c index f07e169c..a6813479 100644 --- a/mt7603_pci.c +++ b/mt7603_pci.c @@ -50,8 +50,9 @@ mt76pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) pci_set_drvdata(pdev, dev); - dev->rev = mt76_rr(dev, MT_ASIC_VERSION); - dev_printk(KERN_INFO, dev->mt76.dev, "ASIC revision: %08x\n", dev->rev); + dev->rev = (mt76_rr(dev, MT_HW_CHIPID) << 16) | + (mt76_rr(dev, MT_HW_REV) & 0xff); + dev_printk(KERN_INFO, dev->mt76.dev, "ASIC revision: %04x\n", dev->rev); ret = devm_request_irq(dev->mt76.dev, pdev->irq, mt7603_irq_handler, IRQF_SHARED, KBUILD_MODNAME, dev); diff --git a/mt7603_regs.h b/mt7603_regs.h index be268d3e..d933ae40 100644 --- a/mt7603_regs.h +++ b/mt7603_regs.h @@ -14,6 +14,8 @@ #ifndef __MT7603_REGS_H #define __MT7603_REGS_H +#define MT_HW_REV 0x1000 +#define MT_HW_CHIPID 0x1008 #define MT_TOP_MISC2 0x1134 #define MT_MCU_BASE 0x2000 @@ -30,8 +32,6 @@ #define MT_HIF_BASE 0x4000 #define MT_HIF(ofs) (MT_HIF_BASE + (ofs)) -#define MT_ASIC_VERSION MT_HIF(0x000) - #define MT_INT_SOURCE_CSR MT_HIF(0x200) #define MT_INT_MASK_CSR MT_HIF(0x204) #define MT_DELAY_INT_CFG MT_HIF(0x204)