aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHariprasad Shenai <hariprasad@chelsio.com>2014-11-24 22:03:58 -0500
committerDavid S. Miller <davem@davemloft.net>2014-11-25 14:06:55 -0500
commit3fedeab10b3bb09744a6467fe7cd157f055137c3 (patch)
treebb392b357c5ce9cde45088ade9eb5aab7bd83bed
parent3a611e26e958b0372d2e7600b87bbb4a84c7704b (diff)
cxgb4/cxgb4vf/csiostor: Add T4/T5 PCI ID Table
Add a new file t4_pci_id_tbl.h that contains T4/T5 PCI ID Table so that for all drivers that uses T4/T5 PCI functions changes can be done in one place. checkpatch.pl script reports following error, which if tried to fix ends up in compilation error. ERROR: Macros with complex values should be enclosed in parentheses +#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \ + { 0, } \ + } WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? new file mode 100644 ERROR: Macros with complex values should be enclosed in parentheses +#define CH_PCI_ID_TABLE_FENTRY(devid) \ + CH_PCI_ID_TABLE_ENTRY((devid) | \ + ((CH_PCI_DEVICE_ID_FUNCTION) << 8)), \ + CH_PCI_ID_TABLE_ENTRY((devid) | \ + ((CH_PCI_DEVICE_ID_FUNCTION2) << 8)) ERROR: Macros with complex values should be enclosed in parentheses +#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END { 0, } } ERROR: Macros with complex values should be enclosed in parentheses +#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END { 0, } } Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c127
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h160
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c73
-rw-r--r--drivers/scsi/csiostor/csio_hw_chip.h49
-rw-r--r--drivers/scsi/csiostor/csio_init.c64
5 files changed, 210 insertions, 263 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index a576da1eedf4..3aea82bb9039 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -210,114 +210,25 @@ struct filter_entry {
210 NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP |\ 210 NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP |\
211 NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) 211 NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
212 212
213#define CH_DEVICE(devid, data) { PCI_VDEVICE(CHELSIO, devid), (data) } 213/* Macros needed to support the PCI Device ID Table ...
214 214 */
215static const struct pci_device_id cxgb4_pci_tbl[] = { 215#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
216 CH_DEVICE(0xa000, 0), /* PE10K */ 216 static struct pci_device_id cxgb4_pci_tbl[] = {
217 CH_DEVICE(0x4001, -1), 217#define CH_PCI_DEVICE_ID_FUNCTION 0x4
218 CH_DEVICE(0x4002, -1), 218
219 CH_DEVICE(0x4003, -1), 219/* Include PCI Device IDs for both PF4 and PF0-3 so our PCI probe() routine is
220 CH_DEVICE(0x4004, -1), 220 * called for both.
221 CH_DEVICE(0x4005, -1), 221 */
222 CH_DEVICE(0x4006, -1), 222#define CH_PCI_DEVICE_ID_FUNCTION2 0x0
223 CH_DEVICE(0x4007, -1), 223
224 CH_DEVICE(0x4008, -1), 224#define CH_PCI_ID_TABLE_ENTRY(devid) \
225 CH_DEVICE(0x4009, -1), 225 {PCI_VDEVICE(CHELSIO, (devid)), 4}
226 CH_DEVICE(0x400a, -1), 226
227 CH_DEVICE(0x400d, -1), 227#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \
228 CH_DEVICE(0x400e, -1), 228 { 0, } \
229 CH_DEVICE(0x4080, -1), 229 }
230 CH_DEVICE(0x4081, -1), 230
231 CH_DEVICE(0x4082, -1), 231#include "t4_pci_id_tbl.h"
232 CH_DEVICE(0x4083, -1),
233 CH_DEVICE(0x4084, -1),
234 CH_DEVICE(0x4085, -1),
235 CH_DEVICE(0x4086, -1),
236 CH_DEVICE(0x4087, -1),
237 CH_DEVICE(0x4088, -1),
238 CH_DEVICE(0x4401, 4),
239 CH_DEVICE(0x4402, 4),
240 CH_DEVICE(0x4403, 4),
241 CH_DEVICE(0x4404, 4),
242 CH_DEVICE(0x4405, 4),
243 CH_DEVICE(0x4406, 4),
244 CH_DEVICE(0x4407, 4),
245 CH_DEVICE(0x4408, 4),
246 CH_DEVICE(0x4409, 4),
247 CH_DEVICE(0x440a, 4),
248 CH_DEVICE(0x440d, 4),
249 CH_DEVICE(0x440e, 4),
250 CH_DEVICE(0x4480, 4),
251 CH_DEVICE(0x4481, 4),
252 CH_DEVICE(0x4482, 4),
253 CH_DEVICE(0x4483, 4),
254 CH_DEVICE(0x4484, 4),
255 CH_DEVICE(0x4485, 4),
256 CH_DEVICE(0x4486, 4),
257 CH_DEVICE(0x4487, 4),
258 CH_DEVICE(0x4488, 4),
259 CH_DEVICE(0x5001, 4),
260 CH_DEVICE(0x5002, 4),
261 CH_DEVICE(0x5003, 4),
262 CH_DEVICE(0x5004, 4),
263 CH_DEVICE(0x5005, 4),
264 CH_DEVICE(0x5006, 4),
265 CH_DEVICE(0x5007, 4),
266 CH_DEVICE(0x5008, 4),
267 CH_DEVICE(0x5009, 4),
268 CH_DEVICE(0x500A, 4),
269 CH_DEVICE(0x500B, 4),
270 CH_DEVICE(0x500C, 4),
271 CH_DEVICE(0x500D, 4),
272 CH_DEVICE(0x500E, 4),
273 CH_DEVICE(0x500F, 4),
274 CH_DEVICE(0x5010, 4),
275 CH_DEVICE(0x5011, 4),
276 CH_DEVICE(0x5012, 4),
277 CH_DEVICE(0x5013, 4),
278 CH_DEVICE(0x5014, 4),
279 CH_DEVICE(0x5015, 4),
280 CH_DEVICE(0x5080, 4),
281 CH_DEVICE(0x5081, 4),
282 CH_DEVICE(0x5082, 4),
283 CH_DEVICE(0x5083, 4),
284 CH_DEVICE(0x5084, 4),
285 CH_DEVICE(0x5085, 4),
286 CH_DEVICE(0x5086, 4),
287 CH_DEVICE(0x5087, 4),
288 CH_DEVICE(0x5088, 4),
289 CH_DEVICE(0x5401, 4),
290 CH_DEVICE(0x5402, 4),
291 CH_DEVICE(0x5403, 4),
292 CH_DEVICE(0x5404, 4),
293 CH_DEVICE(0x5405, 4),
294 CH_DEVICE(0x5406, 4),
295 CH_DEVICE(0x5407, 4),
296 CH_DEVICE(0x5408, 4),
297 CH_DEVICE(0x5409, 4),
298 CH_DEVICE(0x540A, 4),
299 CH_DEVICE(0x540B, 4),
300 CH_DEVICE(0x540C, 4),
301 CH_DEVICE(0x540D, 4),
302 CH_DEVICE(0x540E, 4),
303 CH_DEVICE(0x540F, 4),
304 CH_DEVICE(0x5410, 4),
305 CH_DEVICE(0x5411, 4),
306 CH_DEVICE(0x5412, 4),
307 CH_DEVICE(0x5413, 4),
308 CH_DEVICE(0x5414, 4),
309 CH_DEVICE(0x5415, 4),
310 CH_DEVICE(0x5480, 4),
311 CH_DEVICE(0x5481, 4),
312 CH_DEVICE(0x5482, 4),
313 CH_DEVICE(0x5483, 4),
314 CH_DEVICE(0x5484, 4),
315 CH_DEVICE(0x5485, 4),
316 CH_DEVICE(0x5486, 4),
317 CH_DEVICE(0x5487, 4),
318 CH_DEVICE(0x5488, 4),
319 { 0, }
320};
321 232
322#define FW4_FNAME "cxgb4/t4fw.bin" 233#define FW4_FNAME "cxgb4/t4fw.bin"
323#define FW5_FNAME "cxgb4/t5fw.bin" 234#define FW5_FNAME "cxgb4/t5fw.bin"
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h b/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h
new file mode 100644
index 000000000000..9e4f95a91fb4
--- /dev/null
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h
@@ -0,0 +1,160 @@
1/*
2 * This file is part of the Chelsio T4/T5 Ethernet driver for Linux.
3 *
4 * Copyright (c) 2003-2014 Chelsio Communications, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34#ifndef __T4_PCI_ID_TBL_H__
35#define __T4_PCI_ID_TBL_H__
36
37/* The code can defined cpp macros for creating a PCI Device ID Table. This is
38 * useful because it allows the PCI ID Table to be maintained in a single place.
39 *
40 * The macros are:
41 *
42 * CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN
43 * -- Used to start the definition of the PCI ID Table.
44 *
45 * CH_PCI_DEVICE_ID_FUNCTION
46 * -- The PCI Function Number to use in the PCI Device ID Table. "0"
47 * -- for drivers attaching to PF0-3, "4" for drivers attaching to PF4,
48 * -- "8" for drivers attaching to SR-IOV Virtual Functions, etc.
49 *
50 * CH_PCI_DEVICE_ID_FUNCTION2 [optional]
51 * -- If defined, create a PCI Device ID Table with both
52 * -- CH_PCI_DEVICE_ID_FUNCTION and CH_PCI_DEVICE_ID_FUNCTION2 populated.
53 *
54 * CH_PCI_ID_TABLE_ENTRY(DeviceID)
55 * -- Used for the individual PCI Device ID entries. Note that we will
56 * -- be adding a trailing comma (",") after all of the entries (and
57 * -- between the pairs of entries if CH_PCI_DEVICE_ID_FUNCTION2 is defined).
58 *
59 * CH_PCI_DEVICE_ID_TABLE_DEFINE_END
60 * -- Used to finish the definition of the PCI ID Table. Note that we
61 * -- will be adding a trailing semi-colon (";") here.
62 */
63#ifdef CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN
64
65#ifndef CH_PCI_DEVICE_ID_FUNCTION
66#error CH_PCI_DEVICE_ID_FUNCTION not defined!
67#endif
68#ifndef CH_PCI_ID_TABLE_ENTRY
69#error CH_PCI_ID_TABLE_ENTRY not defined!
70#endif
71#ifndef CH_PCI_DEVICE_ID_TABLE_DEFINE_END
72#error CH_PCI_DEVICE_ID_TABLE_DEFINE_END not defined!
73#endif
74
75/* T4 and later ASICs use a PCI Device ID scheme of 0xVFPP where:
76 *
77 * V = "4" for T4; "5" for T5, etc.
78 * F = "0" for PF 0..3; "4".."7" for PF4..7; and "8" for VFs
79 * PP = adapter product designation
80 *
81 * We use this consistency in order to create the proper PCI Device IDs
82 * for the specified CH_PCI_DEVICE_ID_FUNCTION.
83 */
84#ifndef CH_PCI_DEVICE_ID_FUNCTION2
85#define CH_PCI_ID_TABLE_FENTRY(devid) \
86 CH_PCI_ID_TABLE_ENTRY((devid) | \
87 ((CH_PCI_DEVICE_ID_FUNCTION) << 8))
88#else
89#define CH_PCI_ID_TABLE_FENTRY(devid) \
90 CH_PCI_ID_TABLE_ENTRY((devid) | \
91 ((CH_PCI_DEVICE_ID_FUNCTION) << 8)), \
92 CH_PCI_ID_TABLE_ENTRY((devid) | \
93 ((CH_PCI_DEVICE_ID_FUNCTION2) << 8))
94#endif
95
96CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN
97 /* T4 adapters:
98 */
99 CH_PCI_ID_TABLE_FENTRY(0x4000), /* T440-dbg */
100 CH_PCI_ID_TABLE_FENTRY(0x4001), /* T420-cr */
101 CH_PCI_ID_TABLE_FENTRY(0x4002), /* T422-cr */
102 CH_PCI_ID_TABLE_FENTRY(0x4003), /* T440-cr */
103 CH_PCI_ID_TABLE_FENTRY(0x4004), /* T420-bch */
104 CH_PCI_ID_TABLE_FENTRY(0x4005), /* T440-bch */
105 CH_PCI_ID_TABLE_FENTRY(0x4006), /* T440-ch */
106 CH_PCI_ID_TABLE_FENTRY(0x4007), /* T420-so */
107 CH_PCI_ID_TABLE_FENTRY(0x4008), /* T420-cx */
108 CH_PCI_ID_TABLE_FENTRY(0x4009), /* T420-bt */
109 CH_PCI_ID_TABLE_FENTRY(0x400a), /* T404-bt */
110 CH_PCI_ID_TABLE_FENTRY(0x400b), /* B420-sr */
111 CH_PCI_ID_TABLE_FENTRY(0x400c), /* B404-bt */
112 CH_PCI_ID_TABLE_FENTRY(0x400d), /* T480-cr */
113 CH_PCI_ID_TABLE_FENTRY(0x400e), /* T440-LP-cr */
114 CH_PCI_ID_TABLE_FENTRY(0x4080), /* Custom T480-cr */
115 CH_PCI_ID_TABLE_FENTRY(0x4081), /* Custom T440-cr */
116 CH_PCI_ID_TABLE_FENTRY(0x4082), /* Custom T420-cr */
117 CH_PCI_ID_TABLE_FENTRY(0x4083), /* Custom T420-xaui */
118 CH_PCI_ID_TABLE_FENTRY(0x4084), /* Custom T440-cr */
119 CH_PCI_ID_TABLE_FENTRY(0x4085), /* Custom T420-cr */
120 CH_PCI_ID_TABLE_FENTRY(0x4086), /* Custom T440-bt */
121 CH_PCI_ID_TABLE_FENTRY(0x4087), /* Custom T440-cr */
122 CH_PCI_ID_TABLE_FENTRY(0x4088), /* Custom T440 2-xaui, 2-xfi */
123
124 /* T5 adapters:
125 */
126 CH_PCI_ID_TABLE_FENTRY(0x5000), /* T580-dbg */
127 CH_PCI_ID_TABLE_FENTRY(0x5001), /* T520-cr */
128 CH_PCI_ID_TABLE_FENTRY(0x5002), /* T522-cr */
129 CH_PCI_ID_TABLE_FENTRY(0x5003), /* T540-cr */
130 CH_PCI_ID_TABLE_FENTRY(0x5004), /* T520-bch */
131 CH_PCI_ID_TABLE_FENTRY(0x5005), /* T540-bch */
132 CH_PCI_ID_TABLE_FENTRY(0x5006), /* T540-ch */
133 CH_PCI_ID_TABLE_FENTRY(0x5007), /* T520-so */
134 CH_PCI_ID_TABLE_FENTRY(0x5008), /* T520-cx */
135 CH_PCI_ID_TABLE_FENTRY(0x5009), /* T520-bt */
136 CH_PCI_ID_TABLE_FENTRY(0x500a), /* T504-bt */
137 CH_PCI_ID_TABLE_FENTRY(0x500b), /* B520-sr */
138 CH_PCI_ID_TABLE_FENTRY(0x500c), /* B504-bt */
139 CH_PCI_ID_TABLE_FENTRY(0x500d), /* T580-cr */
140 CH_PCI_ID_TABLE_FENTRY(0x500e), /* T540-LP-cr */
141 CH_PCI_ID_TABLE_FENTRY(0x5010), /* T580-LP-cr */
142 CH_PCI_ID_TABLE_FENTRY(0x5011), /* T520-LL-cr */
143 CH_PCI_ID_TABLE_FENTRY(0x5012), /* T560-cr */
144 CH_PCI_ID_TABLE_FENTRY(0x5013), /* T580-chr */
145 CH_PCI_ID_TABLE_FENTRY(0x5014), /* T580-so */
146 CH_PCI_ID_TABLE_FENTRY(0x5015), /* T502-bt */
147 CH_PCI_ID_TABLE_FENTRY(0x5080), /* Custom T540-cr */
148 CH_PCI_ID_TABLE_FENTRY(0x5081), /* Custom T540-LL-cr */
149 CH_PCI_ID_TABLE_FENTRY(0x5082), /* Custom T504-cr */
150 CH_PCI_ID_TABLE_FENTRY(0x5083), /* Custom T540-LP-CR */
151 CH_PCI_ID_TABLE_FENTRY(0x5084), /* Custom T580-cr */
152 CH_PCI_ID_TABLE_FENTRY(0x5085), /* Custom 3x T580-CR */
153 CH_PCI_ID_TABLE_FENTRY(0x5086), /* Custom 2x T580-CR */
154 CH_PCI_ID_TABLE_FENTRY(0x5087), /* Custom T580-CR */
155 CH_PCI_ID_TABLE_FENTRY(0x5088), /* Custom T570-CR */
156CH_PCI_DEVICE_ID_TABLE_DEFINE_END;
157
158#endif /* CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN */
159
160#endif /* __T4_PCI_ID_TBL_H__ */
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 099f7ce056f2..ad88246a428e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -2908,67 +2908,18 @@ static void cxgb4vf_pci_shutdown(struct pci_dev *pdev)
2908 pci_set_drvdata(pdev, NULL); 2908 pci_set_drvdata(pdev, NULL);
2909} 2909}
2910 2910
2911/* 2911/* Macros needed to support the PCI Device ID Table ...
2912 * PCI Device registration data structures. 2912 */
2913 */ 2913#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
2914#define CH_DEVICE(devid) \ 2914 static struct pci_device_id cxgb4vf_pci_tbl[] = {
2915 { PCI_VENDOR_ID_CHELSIO, devid, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 } 2915#define CH_PCI_DEVICE_ID_FUNCTION 0x8
2916 2916
2917static const struct pci_device_id cxgb4vf_pci_tbl[] = { 2917#define CH_PCI_ID_TABLE_ENTRY(devid) \
2918 CH_DEVICE(0xb000), /* PE10K FPGA */ 2918 { PCI_VDEVICE(CHELSIO, (devid)), 0 }
2919 CH_DEVICE(0x4801), /* T420-cr */ 2919
2920 CH_DEVICE(0x4802), /* T422-cr */ 2920#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END { 0, } }
2921 CH_DEVICE(0x4803), /* T440-cr */ 2921
2922 CH_DEVICE(0x4804), /* T420-bch */ 2922#include "../cxgb4/t4_pci_id_tbl.h"
2923 CH_DEVICE(0x4805), /* T440-bch */
2924 CH_DEVICE(0x4806), /* T460-ch */
2925 CH_DEVICE(0x4807), /* T420-so */
2926 CH_DEVICE(0x4808), /* T420-cx */
2927 CH_DEVICE(0x4809), /* T420-bt */
2928 CH_DEVICE(0x480a), /* T404-bt */
2929 CH_DEVICE(0x480d), /* T480-cr */
2930 CH_DEVICE(0x480e), /* T440-lp-cr */
2931 CH_DEVICE(0x4880),
2932 CH_DEVICE(0x4881),
2933 CH_DEVICE(0x4882),
2934 CH_DEVICE(0x4883),
2935 CH_DEVICE(0x4884),
2936 CH_DEVICE(0x4885),
2937 CH_DEVICE(0x4886),
2938 CH_DEVICE(0x4887),
2939 CH_DEVICE(0x4888),
2940 CH_DEVICE(0x5801), /* T520-cr */
2941 CH_DEVICE(0x5802), /* T522-cr */
2942 CH_DEVICE(0x5803), /* T540-cr */
2943 CH_DEVICE(0x5804), /* T520-bch */
2944 CH_DEVICE(0x5805), /* T540-bch */
2945 CH_DEVICE(0x5806), /* T540-ch */
2946 CH_DEVICE(0x5807), /* T520-so */
2947 CH_DEVICE(0x5808), /* T520-cx */
2948 CH_DEVICE(0x5809), /* T520-bt */
2949 CH_DEVICE(0x580a), /* T504-bt */
2950 CH_DEVICE(0x580b), /* T520-sr */
2951 CH_DEVICE(0x580c), /* T504-bt */
2952 CH_DEVICE(0x580d), /* T580-cr */
2953 CH_DEVICE(0x580e), /* T540-lp-cr */
2954 CH_DEVICE(0x580f), /* Amsterdam */
2955 CH_DEVICE(0x5810), /* T580-lp-cr */
2956 CH_DEVICE(0x5811), /* T520-lp-cr */
2957 CH_DEVICE(0x5812), /* T560-cr */
2958 CH_DEVICE(0x5813), /* T580-cr */
2959 CH_DEVICE(0x5814), /* T580-so-cr */
2960 CH_DEVICE(0x5815), /* T502-bt */
2961 CH_DEVICE(0x5880),
2962 CH_DEVICE(0x5881),
2963 CH_DEVICE(0x5882),
2964 CH_DEVICE(0x5883),
2965 CH_DEVICE(0x5884),
2966 CH_DEVICE(0x5885),
2967 CH_DEVICE(0x5886),
2968 CH_DEVICE(0x5887),
2969 CH_DEVICE(0x5888),
2970 { 0, }
2971};
2972 2923
2973MODULE_DESCRIPTION(DRV_DESC); 2924MODULE_DESCRIPTION(DRV_DESC);
2974MODULE_AUTHOR("Chelsio Communications"); 2925MODULE_AUTHOR("Chelsio Communications");
diff --git a/drivers/scsi/csiostor/csio_hw_chip.h b/drivers/scsi/csiostor/csio_hw_chip.h
index bca0de61ae80..4752fed476df 100644
--- a/drivers/scsi/csiostor/csio_hw_chip.h
+++ b/drivers/scsi/csiostor/csio_hw_chip.h
@@ -36,60 +36,13 @@
36 36
37#include "csio_defs.h" 37#include "csio_defs.h"
38 38
39/* FCoE device IDs for T4 */
40#define CSIO_DEVID_T440DBG_FCOE 0x4600
41#define CSIO_DEVID_T420CR_FCOE 0x4601
42#define CSIO_DEVID_T422CR_FCOE 0x4602
43#define CSIO_DEVID_T440CR_FCOE 0x4603
44#define CSIO_DEVID_T420BCH_FCOE 0x4604
45#define CSIO_DEVID_T440BCH_FCOE 0x4605
46#define CSIO_DEVID_T440CH_FCOE 0x4606
47#define CSIO_DEVID_T420SO_FCOE 0x4607
48#define CSIO_DEVID_T420CX_FCOE 0x4608
49#define CSIO_DEVID_T420BT_FCOE 0x4609
50#define CSIO_DEVID_T404BT_FCOE 0x460A
51#define CSIO_DEVID_B420_FCOE 0x460B
52#define CSIO_DEVID_B404_FCOE 0x460C
53#define CSIO_DEVID_T480CR_FCOE 0x460D
54#define CSIO_DEVID_T440LPCR_FCOE 0x460E
55#define CSIO_DEVID_AMSTERDAM_T4_FCOE 0x460F
56#define CSIO_DEVID_HUAWEI_T480_FCOE 0x4680
57#define CSIO_DEVID_HUAWEI_T440_FCOE 0x4681
58#define CSIO_DEVID_HUAWEI_STG310_FCOE 0x4682
59#define CSIO_DEVID_ACROMAG_XMC_XAUI 0x4683
60#define CSIO_DEVID_ACROMAG_XMC_SFP_FCOE 0x4684
61#define CSIO_DEVID_QUANTA_MEZZ_SFP_FCOE 0x4685
62#define CSIO_DEVID_HUAWEI_10GT_FCOE 0x4686
63#define CSIO_DEVID_HUAWEI_T440_TOE_FCOE 0x4687
64
65/* FCoE device IDs for T5 */
66#define CSIO_DEVID_T580DBG_FCOE 0x5600
67#define CSIO_DEVID_T520CR_FCOE 0x5601
68#define CSIO_DEVID_T522CR_FCOE 0x5602
69#define CSIO_DEVID_T540CR_FCOE 0x5603
70#define CSIO_DEVID_T520BCH_FCOE 0x5604
71#define CSIO_DEVID_T540BCH_FCOE 0x5605
72#define CSIO_DEVID_T540CH_FCOE 0x5606
73#define CSIO_DEVID_T520SO_FCOE 0x5607
74#define CSIO_DEVID_T520CX_FCOE 0x5608
75#define CSIO_DEVID_T520BT_FCOE 0x5609
76#define CSIO_DEVID_T504BT_FCOE 0x560A
77#define CSIO_DEVID_B520_FCOE 0x560B
78#define CSIO_DEVID_B504_FCOE 0x560C
79#define CSIO_DEVID_T580CR2_FCOE 0x560D
80#define CSIO_DEVID_T540LPCR_FCOE 0x560E
81#define CSIO_DEVID_AMSTERDAM_T5_FCOE 0x560F
82#define CSIO_DEVID_T580LPCR_FCOE 0x5610
83#define CSIO_DEVID_T520LLCR_FCOE 0x5611
84#define CSIO_DEVID_T560CR_FCOE 0x5612
85#define CSIO_DEVID_T580CR_FCOE 0x5613
86
87/* Define MACRO values */ 39/* Define MACRO values */
88#define CSIO_HW_T4 0x4000 40#define CSIO_HW_T4 0x4000
89#define CSIO_T4_FCOE_ASIC 0x4600 41#define CSIO_T4_FCOE_ASIC 0x4600
90#define CSIO_HW_T5 0x5000 42#define CSIO_HW_T5 0x5000
91#define CSIO_T5_FCOE_ASIC 0x5600 43#define CSIO_T5_FCOE_ASIC 0x5600
92#define CSIO_HW_CHIP_MASK 0xF000 44#define CSIO_HW_CHIP_MASK 0xF000
45
93#define T4_REGMAP_SIZE (160 * 1024) 46#define T4_REGMAP_SIZE (160 * 1024)
94#define T5_REGMAP_SIZE (332 * 1024) 47#define T5_REGMAP_SIZE (332 * 1024)
95#define FW_FNAME_T4 "cxgb4/t4fw.bin" 48#define FW_FNAME_T4 "cxgb4/t4fw.bin"
diff --git a/drivers/scsi/csiostor/csio_init.c b/drivers/scsi/csiostor/csio_init.c
index 1ed5b21c0dd8..34d20cc3e110 100644
--- a/drivers/scsi/csiostor/csio_init.c
+++ b/drivers/scsi/csiostor/csio_init.c
@@ -955,6 +955,10 @@ static int csio_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
955 struct csio_hw *hw; 955 struct csio_hw *hw;
956 struct csio_lnode *ln; 956 struct csio_lnode *ln;
957 957
958 /* probe only T5 cards */
959 if (!csio_is_t5((pdev->device & CSIO_HW_CHIP_MASK)))
960 return -ENODEV;
961
958 rv = csio_pci_init(pdev, &bars); 962 rv = csio_pci_init(pdev, &bars);
959 if (rv) 963 if (rv)
960 goto err; 964 goto err;
@@ -1167,53 +1171,21 @@ static struct pci_error_handlers csio_err_handler = {
1167 .resume = csio_pci_resume, 1171 .resume = csio_pci_resume,
1168}; 1172};
1169 1173
1170static const struct pci_device_id csio_pci_tbl[] = { 1174/*
1171 CSIO_DEVICE(CSIO_DEVID_T440DBG_FCOE, 0), /* T4 DEBUG FCOE */ 1175 * Macros needed to support the PCI Device ID Table ...
1172 CSIO_DEVICE(CSIO_DEVID_T420CR_FCOE, 0), /* T420CR FCOE */ 1176 */
1173 CSIO_DEVICE(CSIO_DEVID_T422CR_FCOE, 0), /* T422CR FCOE */ 1177#define CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN \
1174 CSIO_DEVICE(CSIO_DEVID_T440CR_FCOE, 0), /* T440CR FCOE */ 1178 static struct pci_device_id csio_pci_tbl[] = {
1175 CSIO_DEVICE(CSIO_DEVID_T420BCH_FCOE, 0), /* T420BCH FCOE */ 1179/* Define for iSCSI uses PF5, FCoE uses PF6 */
1176 CSIO_DEVICE(CSIO_DEVID_T440BCH_FCOE, 0), /* T440BCH FCOE */ 1180#define CH_PCI_DEVICE_ID_FUNCTION 0x5
1177 CSIO_DEVICE(CSIO_DEVID_T440CH_FCOE, 0), /* T440CH FCOE */ 1181#define CH_PCI_DEVICE_ID_FUNCTION2 0x6
1178 CSIO_DEVICE(CSIO_DEVID_T420SO_FCOE, 0), /* T420SO FCOE */ 1182
1179 CSIO_DEVICE(CSIO_DEVID_T420CX_FCOE, 0), /* T420CX FCOE */ 1183#define CH_PCI_ID_TABLE_ENTRY(devid) \
1180 CSIO_DEVICE(CSIO_DEVID_T420BT_FCOE, 0), /* T420BT FCOE */ 1184 { PCI_VDEVICE(CHELSIO, (devid)), 0 }
1181 CSIO_DEVICE(CSIO_DEVID_T404BT_FCOE, 0), /* T404BT FCOE */ 1185
1182 CSIO_DEVICE(CSIO_DEVID_B420_FCOE, 0), /* B420 FCOE */ 1186#define CH_PCI_DEVICE_ID_TABLE_DEFINE_END { 0, } }
1183 CSIO_DEVICE(CSIO_DEVID_B404_FCOE, 0), /* B404 FCOE */
1184 CSIO_DEVICE(CSIO_DEVID_T480CR_FCOE, 0), /* T480 CR FCOE */
1185 CSIO_DEVICE(CSIO_DEVID_T440LPCR_FCOE, 0), /* T440 LP-CR FCOE */
1186 CSIO_DEVICE(CSIO_DEVID_AMSTERDAM_T4_FCOE, 0), /* AMSTERDAM T4 FCOE */
1187 CSIO_DEVICE(CSIO_DEVID_HUAWEI_T480_FCOE, 0), /* HUAWEI T480 FCOE */
1188 CSIO_DEVICE(CSIO_DEVID_HUAWEI_T440_FCOE, 0), /* HUAWEI T440 FCOE */
1189 CSIO_DEVICE(CSIO_DEVID_HUAWEI_STG310_FCOE, 0), /* HUAWEI STG FCOE */
1190 CSIO_DEVICE(CSIO_DEVID_ACROMAG_XMC_XAUI, 0), /* ACROMAG XAUI FCOE */
1191 CSIO_DEVICE(CSIO_DEVID_QUANTA_MEZZ_SFP_FCOE, 0),/* QUANTA MEZZ FCOE */
1192 CSIO_DEVICE(CSIO_DEVID_HUAWEI_10GT_FCOE, 0), /* HUAWEI 10GT FCOE */
1193 CSIO_DEVICE(CSIO_DEVID_HUAWEI_T440_TOE_FCOE, 0),/* HUAWEI T4 TOE FCOE */
1194 CSIO_DEVICE(CSIO_DEVID_T580DBG_FCOE, 0), /* T5 DEBUG FCOE */
1195 CSIO_DEVICE(CSIO_DEVID_T520CR_FCOE, 0), /* T520CR FCOE */
1196 CSIO_DEVICE(CSIO_DEVID_T522CR_FCOE, 0), /* T522CR FCOE */
1197 CSIO_DEVICE(CSIO_DEVID_T540CR_FCOE, 0), /* T540CR FCOE */
1198 CSIO_DEVICE(CSIO_DEVID_T520BCH_FCOE, 0), /* T520BCH FCOE */
1199 CSIO_DEVICE(CSIO_DEVID_T540BCH_FCOE, 0), /* T540BCH FCOE */
1200 CSIO_DEVICE(CSIO_DEVID_T540CH_FCOE, 0), /* T540CH FCOE */
1201 CSIO_DEVICE(CSIO_DEVID_T520SO_FCOE, 0), /* T520SO FCOE */
1202 CSIO_DEVICE(CSIO_DEVID_T520CX_FCOE, 0), /* T520CX FCOE */
1203 CSIO_DEVICE(CSIO_DEVID_T520BT_FCOE, 0), /* T520BT FCOE */
1204 CSIO_DEVICE(CSIO_DEVID_T504BT_FCOE, 0), /* T504BT FCOE */
1205 CSIO_DEVICE(CSIO_DEVID_B520_FCOE, 0), /* B520 FCOE */
1206 CSIO_DEVICE(CSIO_DEVID_B504_FCOE, 0), /* B504 FCOE */
1207 CSIO_DEVICE(CSIO_DEVID_T580CR2_FCOE, 0), /* T580 CR FCOE */
1208 CSIO_DEVICE(CSIO_DEVID_T540LPCR_FCOE, 0), /* T540 LP-CR FCOE */
1209 CSIO_DEVICE(CSIO_DEVID_AMSTERDAM_T5_FCOE, 0), /* AMSTERDAM T5 FCOE */
1210 CSIO_DEVICE(CSIO_DEVID_T580LPCR_FCOE, 0), /* T580 LP-CR FCOE */
1211 CSIO_DEVICE(CSIO_DEVID_T520LLCR_FCOE, 0), /* T520 LL-CR FCOE */
1212 CSIO_DEVICE(CSIO_DEVID_T560CR_FCOE, 0), /* T560 CR FCOE */
1213 CSIO_DEVICE(CSIO_DEVID_T580CR_FCOE, 0), /* T580 CR FCOE */
1214 { 0, 0, 0, 0, 0, 0, 0 }
1215};
1216 1187
1188#include "t4_pci_id_tbl.h"
1217 1189
1218static struct pci_driver csio_pci_driver = { 1190static struct pci_driver csio_pci_driver = {
1219 .name = KBUILD_MODNAME, 1191 .name = KBUILD_MODNAME,