Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[platform/kernel/linux-starfive.git] / drivers / net / wireless / quantenna / qtnfmac / qtn_hw_ids.h
1 /*
2  * Copyright (c) 2015-2016 Quantenna Communications, Inc.
3  * All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  */
16
17 #ifndef _QTN_HW_IDS_H_
18 #define _QTN_HW_IDS_H_
19
20 #include <linux/pci_ids.h>
21
22 #define PCIE_VENDOR_ID_QUANTENNA        (0x1bb5)
23
24 /* PCIE Device IDs */
25
26 #define PCIE_DEVICE_ID_QSR              (0x0008)
27
28 #define QTN_REG_SYS_CTRL_CSR            0x14
29 #define QTN_CHIP_ID_MASK                0xF0
30 #define QTN_CHIP_ID_TOPAZ               0x40
31 #define QTN_CHIP_ID_PEARL               0x50
32 #define QTN_CHIP_ID_PEARL_B             0x60
33 #define QTN_CHIP_ID_PEARL_C             0x70
34
35 /* FW names */
36
37 #define QTN_PCI_PEARL_FW_NAME           "qtn/fmac_qsr10g.img"
38 #define QTN_PCI_TOPAZ_FW_NAME           "qtn/fmac_qsr1000.img"
39 #define QTN_PCI_TOPAZ_BOOTLD_NAME       "qtn/uboot_qsr1000.img"
40
41 static inline unsigned int qtnf_chip_id_get(const void __iomem *regs_base)
42 {
43         u32 board_rev = readl(regs_base + QTN_REG_SYS_CTRL_CSR);
44
45         return board_rev & QTN_CHIP_ID_MASK;
46 }
47
48 #endif  /* _QTN_HW_IDS_H_ */