xref: /linux/drivers/net/wireless/quantenna/qtnfmac/qtn_hw_ids.h (revision e401fa25cfa23df8b17960a656ff11f49facae84)
198f44cb0SIgor Mitsyanko /*
298f44cb0SIgor Mitsyanko  * Copyright (c) 2015-2016 Quantenna Communications, Inc.
398f44cb0SIgor Mitsyanko  * All rights reserved.
498f44cb0SIgor Mitsyanko  *
598f44cb0SIgor Mitsyanko  * This program is free software; you can redistribute it and/or
698f44cb0SIgor Mitsyanko  * modify it under the terms of the GNU General Public License
798f44cb0SIgor Mitsyanko  * as published by the Free Software Foundation; either version 2
898f44cb0SIgor Mitsyanko  * of the License, or (at your option) any later version.
998f44cb0SIgor Mitsyanko  *
1098f44cb0SIgor Mitsyanko  * This program is distributed in the hope that it will be useful,
1198f44cb0SIgor Mitsyanko  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1298f44cb0SIgor Mitsyanko  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1398f44cb0SIgor Mitsyanko  * GNU General Public License for more details.
1498f44cb0SIgor Mitsyanko  *
1598f44cb0SIgor Mitsyanko  */
1698f44cb0SIgor Mitsyanko 
1798f44cb0SIgor Mitsyanko #ifndef	_QTN_HW_IDS_H_
1898f44cb0SIgor Mitsyanko #define	_QTN_HW_IDS_H_
1998f44cb0SIgor Mitsyanko 
2098f44cb0SIgor Mitsyanko #include <linux/pci_ids.h>
2198f44cb0SIgor Mitsyanko 
2298f44cb0SIgor Mitsyanko #define PCIE_VENDOR_ID_QUANTENNA	(0x1bb5)
2398f44cb0SIgor Mitsyanko 
2498f44cb0SIgor Mitsyanko /* PCIE Device IDs */
2598f44cb0SIgor Mitsyanko 
26*e401fa25SSergey Matyukevich #define	PCIE_DEVICE_ID_QSR		(0x0008)
2798f44cb0SIgor Mitsyanko 
28033a7599SIgor Mitsyanko #define QTN_REG_SYS_CTRL_CSR		0x14
29033a7599SIgor Mitsyanko #define QTN_CHIP_ID_MASK		0xF0
30033a7599SIgor Mitsyanko #define QTN_CHIP_ID_TOPAZ		0x40
31033a7599SIgor Mitsyanko #define QTN_CHIP_ID_PEARL		0x50
32033a7599SIgor Mitsyanko #define QTN_CHIP_ID_PEARL_B		0x60
33033a7599SIgor Mitsyanko #define QTN_CHIP_ID_PEARL_C		0x70
34033a7599SIgor Mitsyanko 
3598f44cb0SIgor Mitsyanko /* FW names */
3698f44cb0SIgor Mitsyanko 
3798f44cb0SIgor Mitsyanko #define QTN_PCI_PEARL_FW_NAME		"qtn/fmac_qsr10g.img"
38*e401fa25SSergey Matyukevich #define QTN_PCI_TOPAZ_FW_NAME		"qtn/fmac_qsr1000.img"
39*e401fa25SSergey Matyukevich #define QTN_PCI_TOPAZ_BOOTLD_NAME	"qtn/uboot_qsr1000.img"
4098f44cb0SIgor Mitsyanko 
41033a7599SIgor Mitsyanko static inline unsigned int qtnf_chip_id_get(const void __iomem *regs_base)
42033a7599SIgor Mitsyanko {
43033a7599SIgor Mitsyanko 	u32 board_rev = readl(regs_base + QTN_REG_SYS_CTRL_CSR);
44033a7599SIgor Mitsyanko 
45033a7599SIgor Mitsyanko 	return board_rev & QTN_CHIP_ID_MASK;
46033a7599SIgor Mitsyanko }
47033a7599SIgor Mitsyanko 
4898f44cb0SIgor Mitsyanko #endif	/* _QTN_HW_IDS_H_ */
49