summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
diff options
context:
space:
mode:
authorIgor Mitsyanko2018-09-25 00:15:14 +0200
committerKalle Valo2018-10-01 17:40:34 +0200
commit033a759921d1ae97437bcda44e7ac5a57c81e9c8 (patch)
treeb446752c02442313a726dc9ee1c5adaa494f503e /drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
parentqtnfmac: wait for FW load work to finish at PCIe remove (diff)
downloadkernel-qcow2-linux-033a759921d1ae97437bcda44e7ac5a57c81e9c8.tar.gz
kernel-qcow2-linux-033a759921d1ae97437bcda44e7ac5a57c81e9c8.tar.xz
kernel-qcow2-linux-033a759921d1ae97437bcda44e7ac5a57c81e9c8.zip
qtnfmac_pcie: check for correct CHIP ID at pcie probe
Make sure that wifi device is of supported variant by checking it's CHIP ID before completing a probe sequence. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h')
-rw-r--r--drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h b/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
index c4ad40d59085..1fe798a9a667 100644
--- a/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
+++ b/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h
@@ -25,8 +25,22 @@
#define PCIE_DEVICE_ID_QTN_PEARL (0x0008)
+#define QTN_REG_SYS_CTRL_CSR 0x14
+#define QTN_CHIP_ID_MASK 0xF0
+#define QTN_CHIP_ID_TOPAZ 0x40
+#define QTN_CHIP_ID_PEARL 0x50
+#define QTN_CHIP_ID_PEARL_B 0x60
+#define QTN_CHIP_ID_PEARL_C 0x70
+
/* FW names */
#define QTN_PCI_PEARL_FW_NAME "qtn/fmac_qsr10g.img"
+static inline unsigned int qtnf_chip_id_get(const void __iomem *regs_base)
+{
+ u32 board_rev = readl(regs_base + QTN_REG_SYS_CTRL_CSR);
+
+ return board_rev & QTN_CHIP_ID_MASK;
+}
+
#endif /* _QTN_HW_IDS_H_ */