OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [pci/] [pci.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/*
2
 * drivers/pci/pci.c
3
 *
4
 * PCI services that are built on top of the BIOS32 service.
5
 *
6
 * Copyright 1993, 1994, 1995 Drew Eckhardt, Frederic Potter,
7
 *      David Mosberger-Tang
8
 *
9
 * Apr 12, 1998 : Fixed handling of alien header types. [mj]
10
 */
11
 
12
#include <linux/config.h>
13
#include <linux/ptrace.h>
14
#include <linux/types.h>
15
#include <linux/kernel.h>
16
#include <linux/bios32.h>
17
#include <linux/pci.h>
18
#include <linux/string.h>
19
 
20
#include <asm/page.h>
21
 
22
struct pci_bus pci_root;
23
struct pci_dev *pci_devices = 0;
24
 
25
 
26
/*
27
 * The bridge_id field is an offset of an item into the array
28
 * BRIDGE_MAPPING_TYPE. 0xff indicates that the device is not a PCI
29
 * bridge, or that we don't know for the moment how to configure it.
30
 * I'm trying to do my best so that the kernel stays small.  Different
31
 * chipset can have same optimization structure. i486 and pentium
32
 * chipsets from the same manufacturer usually have the same
33
 * structure.
34
 */
35
#define DEVICE(vid,did,name) \
36
  {PCI_VENDOR_ID_##vid, PCI_DEVICE_ID_##did, (name), 0xff}
37
 
38
#define BRIDGE(vid,did,name,bridge) \
39
  {PCI_VENDOR_ID_##vid, PCI_DEVICE_ID_##did, (name), (bridge)}
40
 
41
/*
42
 * Sorted in ascending order by vendor and device.
43
 * Use binary search for lookup. If you add a device make sure
44
 * it is sequential by both vendor and device id.
45
 */
46
struct pci_dev_info dev_info[] = {
47
#ifdef CONFIG_PCIDEVLIST
48
        DEVICE( COMPAQ,         COMPAQ_1280,    "QVision 1280/p"),
49
        DEVICE( COMPAQ,         COMPAQ_SMART2P, "Smart-2/P RAID Controller"),
50
        DEVICE( COMPAQ,         COMPAQ_NETEL100,"Netelligent 10/100"),
51
        DEVICE( COMPAQ,         COMPAQ_NETEL10, "Netelligent 10"),
52
        DEVICE( COMPAQ,         COMPAQ_NETFLEX3I,"NetFlex 3"),
53
        DEVICE( COMPAQ,         COMPAQ_NETEL100D,"Netelligent 10/100 Dual"),
54
        DEVICE( COMPAQ,         COMPAQ_NETEL100PI,"Netelligent 10/100 ProLiant"),
55
        DEVICE( COMPAQ,         COMPAQ_NETEL100I,"Netelligent 10/100 Integrated"),
56
        DEVICE( COMPAQ,         COMPAQ_THUNDER, "ThunderLAN"),
57
        DEVICE( COMPAQ,         COMPAQ_NETFLEX3B,"NetFlex 3 BNC"),
58
        DEVICE( NCR,            NCR_53C810,     "53c810"),
59
        DEVICE( NCR,            NCR_53C820,     "53c820"),
60
        DEVICE( NCR,            NCR_53C825,     "53c825"),
61
        DEVICE( NCR,            NCR_53C815,     "53c815"),
62
        DEVICE( NCR,            NCR_53C860,     "53c860"),
63
        DEVICE( NCR,            NCR_53C896,     "53c896"),
64
        DEVICE( NCR,            NCR_53C895,     "53c895"),
65
        DEVICE( NCR,            NCR_53C885,     "53c885"),
66
        DEVICE( NCR,            NCR_53C875,     "53c875"),
67
        DEVICE( NCR,            NCR_53C875J,    "53c875J"),
68
        DEVICE( ATI,            ATI_68800,      "68800AX"),
69
        DEVICE( ATI,            ATI_215CT222,   "215CT222"),
70
        DEVICE( ATI,            ATI_210888CX,   "210888CX"),
71
        DEVICE( ATI,            ATI_215GB,      "Mach64 GB"),
72
        DEVICE( ATI,            ATI_215GD,      "Mach64 GD (Rage Pro)"),
73
        DEVICE( ATI,            ATI_215GI,      "Mach64 GI (Rage Pro)"),
74
        DEVICE( ATI,            ATI_215GP,      "Mach64 GP (Rage Pro)"),
75
        DEVICE( ATI,            ATI_215GQ,      "Mach64 GQ (Rage Pro)"),
76
        DEVICE( ATI,            ATI_215GT,      "Mach64 GT (Rage II)"),
77
        DEVICE( ATI,            ATI_215GTB,     "Mach64 GT (Rage II)"),
78
        DEVICE( ATI,            ATI_210888GX,   "210888GX"),
79
        DEVICE( ATI,            ATI_215LG,      "Mach64 LG (3D Rage LT)"),
80
        DEVICE( ATI,            ATI_264LT,      "Mach64 LT"),
81
        DEVICE( ATI,            ATI_264VT,      "Mach64 VT"),
82
        DEVICE( VLSI,           VLSI_82C592,    "82C592-FC1"),
83
        DEVICE( VLSI,           VLSI_82C593,    "82C593-FC1"),
84
        DEVICE( VLSI,           VLSI_82C594,    "82C594-AFC2"),
85
        DEVICE( VLSI,           VLSI_82C597,    "82C597-AFC2"),
86
        DEVICE( VLSI,           VLSI_82C541,    "82C541 Lynx"),
87
        DEVICE( VLSI,           VLSI_82C543,    "82C543 Lynx ISA"),
88
        DEVICE( VLSI,           VLSI_82C532,    "82C532"),
89
        DEVICE( VLSI,           VLSI_82C534,    "82C534"),
90
        DEVICE( VLSI,           VLSI_82C535,    "82C535"),
91
        DEVICE( VLSI,           VLSI_82C147,    "82C147"),
92
        DEVICE( VLSI,           VLSI_VAS96011,  "VAS96011 (Golden Gate II)"),
93
        DEVICE( ADL,            ADL_2301,       "2301"),
94
        DEVICE( NS,             NS_87415,       "87415"),
95
        DEVICE( NS,             NS_87410,       "87410"),
96
        DEVICE( TSENG,          TSENG_W32P_2,   "ET4000W32P"),
97
        DEVICE( TSENG,          TSENG_W32P_b,   "ET4000W32P rev B"),
98
        DEVICE( TSENG,          TSENG_W32P_c,   "ET4000W32P rev C"),
99
        DEVICE( TSENG,          TSENG_W32P_d,   "ET4000W32P rev D"),
100
        DEVICE( TSENG,          TSENG_ET6000,   "ET6000"),
101
        DEVICE( WEITEK,         WEITEK_P9000,   "P9000"),
102
        DEVICE( WEITEK,         WEITEK_P9100,   "P9100"),
103
        BRIDGE( DEC,            DEC_BRD,        "DC21050",              0x00),
104
        DEVICE( DEC,            DEC_TULIP,      "DC21040"),
105
        DEVICE( DEC,            DEC_TGA,        "DC21030 (TGA)"),
106
        DEVICE( DEC,            DEC_TULIP_FAST, "DC21140"),
107
        DEVICE( DEC,            DEC_TGA2,       "TGA2"),
108
        DEVICE( DEC,            DEC_FDDI,       "DEFPA"),
109
        DEVICE( DEC,            DEC_TULIP_PLUS, "DC21041"),
110
        DEVICE( DEC,            DEC_21142,      "DC21142"),
111
        DEVICE( DEC,            DEC_21052,      "DC21052"),
112
        DEVICE( DEC,            DEC_21150,      "DC21150"),
113
        DEVICE( DEC,            DEC_21152,      "DC21152"),
114
        DEVICE( DEC,            DEC_21154,      "DC21154"),
115
        DEVICE( DEC,            DEC_21285,      "DC21285 Footbridge"),
116
        DEVICE( CIRRUS,         CIRRUS_7548,    "GD 7548"),
117
        DEVICE( CIRRUS,         CIRRUS_5430,    "GD 5430"),
118
        DEVICE( CIRRUS,         CIRRUS_5434_4,  "GD 5434"),
119
        DEVICE( CIRRUS,         CIRRUS_5434_8,  "GD 5434"),
120
        DEVICE( CIRRUS,         CIRRUS_5436,    "GD 5436"),
121
        DEVICE( CIRRUS,         CIRRUS_5446,    "GD 5446"),
122
        DEVICE( CIRRUS,         CIRRUS_5480,    "GD 5480"),
123
        DEVICE( CIRRUS,         CIRRUS_5464,    "GD 5464"),
124
        DEVICE( CIRRUS,         CIRRUS_5465,    "GD 5465"),
125
        DEVICE( CIRRUS,         CIRRUS_6729,    "CL 6729"),
126
        DEVICE( CIRRUS,         CIRRUS_6832,    "PD 6832"),
127
        DEVICE( CIRRUS,         CIRRUS_7542,    "CL 7542"),
128
        DEVICE( CIRRUS,         CIRRUS_7543,    "CL 7543"),
129
        DEVICE( CIRRUS,         CIRRUS_7541,    "CL 7541"),
130
        DEVICE( IBM,            IBM_FIRE_CORAL, "Fire Coral"),
131
        DEVICE( IBM,            IBM_TR,         "Token Ring"),
132
        DEVICE( IBM,            IBM_82G2675,    "82G2675"),
133
        DEVICE( IBM,            IBM_MCA,        "MicroChannel"),
134
        DEVICE( IBM,            IBM_82351,      "82351"),
135
        DEVICE( IBM,            IBM_SERVERAID,  "ServeRAID"),
136
        DEVICE( IBM,            IBM_TR_WAKE,    "Wake On LAN Token Ring"),
137
        DEVICE( IBM,            IBM_3780IDSP,   "MWave DSP"),
138
        DEVICE( WD,             WD_7197,        "WD 7197"),
139
        DEVICE( AMD,            AMD_LANCE,      "79C970"),
140
        DEVICE( AMD,            AMD_SCSI,       "53C974"),
141
        DEVICE( TRIDENT,        TRIDENT_9397,   "Cyber9397"),
142
        DEVICE( TRIDENT,        TRIDENT_9420,   "TG 9420"),
143
        DEVICE( TRIDENT,        TRIDENT_9440,   "TG 9440"),
144
        DEVICE( TRIDENT,        TRIDENT_9660,   "TG 9660 / Cyber9385"),
145
        DEVICE( TRIDENT,        TRIDENT_9750,   "Image 975"),
146
        DEVICE( AI,             AI_M1435,       "M1435"),
147
        DEVICE( MATROX,         MATROX_MGA_2,   "Atlas PX2085"),
148
        DEVICE( MATROX,         MATROX_MIL,     "Millennium"),
149
        DEVICE( MATROX,         MATROX_MYS,     "Mystique"),
150
        DEVICE( MATROX,         MATROX_MIL_2,   "Millennium II"),
151
        DEVICE( MATROX,         MATROX_MIL_2_AGP,"Millennium II AGP"),
152
        DEVICE( MATROX,         MATROX_G200_PCI,"Matrox G200 PCI"),
153
        DEVICE( MATROX,         MATROX_G200_AGP,"Matrox G200 AGP"),
154
        DEVICE( MATROX,         MATROX_MGA_IMP, "MGA Impression"),
155
        DEVICE( MATROX,         MATROX_G100_MM, "Matrox G100 multi monitor"),
156
        DEVICE( MATROX,         MATROX_G100_AGP,"Matrox G100 AGP"),
157
        DEVICE( CT,             CT_65545,       "65545"),
158
        DEVICE( CT,             CT_65548,       "65548"),
159
        DEVICE( CT,             CT_65550,       "65550"),
160
        DEVICE( CT,             CT_65554,       "65554"),
161
        DEVICE( CT,             CT_65555,       "65555"),
162
        DEVICE( MIRO,           MIRO_36050,     "ZR36050"),
163
        DEVICE( NEC,            NEC_PCX2,       "PowerVR PCX2"),
164
        DEVICE( FD,             FD_36C70,       "TMC-18C30"),
165
        DEVICE( SI,             SI_5591_AGP,    "5591/5592 AGP"),
166
        DEVICE( SI,             SI_6202,        "6202"),
167
        DEVICE( SI,             SI_503,         "85C503"),
168
        DEVICE( SI,             SI_ACPI,        "ACPI"),
169
        DEVICE( SI,             SI_5597_VGA,    "5597/5598 VGA"),
170
        DEVICE( SI,             SI_6205,        "6205"),
171
        DEVICE( SI,             SI_501,         "85C501"),
172
        DEVICE( SI,             SI_496,         "85C496"),
173
        DEVICE( SI,             SI_601,         "85C601"),
174
        DEVICE( SI,             SI_5107,        "5107"),
175
        DEVICE( SI,             SI_5511,                "85C5511"),
176
        DEVICE( SI,             SI_5513,                "85C5513"),
177
        DEVICE( SI,             SI_5571,        "5571"),
178
        DEVICE( SI,             SI_5591,        "5591/5592 Host"),
179
        DEVICE( SI,             SI_5597,        "5597/5598 Host"),
180
        DEVICE( SI,             SI_7001,        "7001 USB"),
181
        DEVICE( HP,             HP_J2585A,      "J2585A"),
182
        DEVICE( HP,             HP_J2585B,      "J2585B (Lassen)"),
183
        DEVICE( PCTECH,         PCTECH_RZ1000,  "RZ1000 (buggy)"),
184
        DEVICE( PCTECH,         PCTECH_RZ1001,  "RZ1001 (buggy?)"),
185
        DEVICE( PCTECH,         PCTECH_SAMURAI_0,"Samurai 0"),
186
        DEVICE( PCTECH,         PCTECH_SAMURAI_1,"Samurai 1"),
187
        DEVICE( PCTECH,         PCTECH_SAMURAI_IDE,"Samurai IDE"),
188
        DEVICE( DPT,            DPT,            "SmartCache/Raid"),
189
        DEVICE( OPTI,           OPTI_92C178,    "92C178"),
190
        DEVICE( OPTI,           OPTI_82C557,    "82C557 Viper-M"),
191
        DEVICE( OPTI,           OPTI_82C558,    "82C558 Viper-M ISA+IDE"),
192
        DEVICE( OPTI,           OPTI_82C621,    "82C621"),
193
        DEVICE( OPTI,           OPTI_82C700,    "82C700"),
194
        DEVICE( OPTI,           OPTI_82C701,    "82C701 FireStar Plus"),
195
        DEVICE( OPTI,           OPTI_82C814,    "82C814 Firebridge 1"),
196
        DEVICE( OPTI,           OPTI_82C822,    "82C822"),
197
        DEVICE( OPTI,           OPTI_82C825,    "82C825 Firebridge 2"),
198
        DEVICE( SGS,            SGS_2000,       "STG 2000X"),
199
        DEVICE( SGS,            SGS_1764,       "STG 1764X"),
200
        DEVICE( BUSLOGIC,       BUSLOGIC_MULTIMASTER_NC, "MultiMaster NC"),
201
        DEVICE( BUSLOGIC,       BUSLOGIC_MULTIMASTER,    "MultiMaster"),
202
        DEVICE( BUSLOGIC,       BUSLOGIC_FLASHPOINT,     "FlashPoint"),
203
        DEVICE( TI,             TI_TVP4010,     "TVP4010 Permedia"),
204
        DEVICE( TI,             TI_TVP4020,     "TVP4020 Permedia 2"),
205
        DEVICE( TI,             TI_PCI1130,     "PCI1130"),
206
        DEVICE( TI,             TI_PCI1131,     "PCI1131"),
207
        DEVICE( TI,             TI_PCI1250,     "PCI1250"),
208
        DEVICE( OAK,            OAK_OTI107,     "OTI107"),
209
        DEVICE( WINBOND2,       WINBOND2_89C940,"NE2000-PCI"),
210
        DEVICE( MOTOROLA,       MOTOROLA_MPC105,"MPC105 Eagle"),
211
        DEVICE( MOTOROLA,       MOTOROLA_MPC106,"MPC106 Grackle"),
212
        DEVICE( MOTOROLA,       MOTOROLA_RAVEN, "Raven"),
213
        DEVICE( PROMISE,        PROMISE_20246,  "IDE UltraDMA/33"),
214
        DEVICE( PROMISE,        PROMISE_5300,   "DC5030"),
215
        DEVICE( N9,             N9_I128,        "Imagine 128"),
216
        DEVICE( N9,             N9_I128_2,      "Imagine 128v2"),
217
        DEVICE( UMC,            UMC_UM8673F,    "UM8673F"),
218
        BRIDGE( UMC,            UMC_UM8891A,    "UM8891A",              0x01),
219
        DEVICE( UMC,            UMC_UM8886BF,   "UM8886BF"),
220
        DEVICE( UMC,            UMC_UM8886A,    "UM8886A"),
221
        BRIDGE( UMC,            UMC_UM8881F,    "UM8881F",              0x02),
222
        DEVICE( UMC,            UMC_UM8886F,    "UM8886F"),
223
        DEVICE( UMC,            UMC_UM9017F,    "UM9017F"),
224
        DEVICE( UMC,            UMC_UM8886N,    "UM8886N"),
225
        DEVICE( UMC,            UMC_UM8891N,    "UM8891N"),
226
        DEVICE( X,              X_AGX016,       "ITT AGX016"),
227
        DEVICE( PICOP,          PICOP_PT86C52X, "PT86C52x Vesuvius"),
228
        DEVICE( PICOP,          PICOP_PT80C524, "PT80C524 Nile"),
229
        DEVICE( MYLEX,          MYLEX_DAC960P_V2,"DAC960P V2"),
230
        DEVICE( MYLEX,          MYLEX_DAC960P_V3,"DAC960P V3"),
231
        DEVICE( MYLEX,          MYLEX_DAC960P_V4,"DAC960P V4"),
232
        DEVICE( APPLE,          APPLE_BANDIT,   "Bandit"),
233
        DEVICE( APPLE,          APPLE_GC,       "Grand Central"),
234
        DEVICE( APPLE,          APPLE_HYDRA,    "Hydra"),
235
        DEVICE( NEXGEN,         NEXGEN_82C501,  "82C501"),
236
        DEVICE( QLOGIC,         QLOGIC_ISP1020, "ISP1020"),
237
        DEVICE( QLOGIC,         QLOGIC_ISP1022, "ISP1022"),
238
        DEVICE( CYRIX,          CYRIX_5510,     "5510"),
239
        DEVICE( CYRIX,          CYRIX_PCI_MASTER,"PCI Master"),
240
        DEVICE( CYRIX,          CYRIX_5520,     "5520"),
241
        DEVICE( CYRIX,          CYRIX_5530_LEGACY,"5530 Kahlua Legacy"),
242
        DEVICE( CYRIX,          CYRIX_5530_SMI, "5530 Kahlua SMI"),
243
        DEVICE( CYRIX,          CYRIX_5530_IDE, "5530 Kahlua IDE"),
244
        DEVICE( CYRIX,          CYRIX_5530_AUDIO,"5530 Kahlua Audio"),
245
        DEVICE( CYRIX,          CYRIX_5530_VIDEO,"5530 Kahlua Video"),
246
        DEVICE( LEADTEK,        LEADTEK_805,    "S3 805"),
247
        DEVICE( CONTAQ,         CONTAQ_82C599,  "82C599"),
248
        DEVICE( CONTAQ,         CONTAQ_82C693,  "82C693"),
249
        DEVICE( OLICOM,         OLICOM_OC3136,  "OC-3136/3137"),
250
        DEVICE( OLICOM,         OLICOM_OC2315,  "OC-2315"),
251
        DEVICE( OLICOM,         OLICOM_OC2325,  "OC-2325"),
252
        DEVICE( OLICOM,         OLICOM_OC2183,  "OC-2183/2185"),
253
        DEVICE( OLICOM,         OLICOM_OC2326,  "OC-2326"),
254
        DEVICE( OLICOM,         OLICOM_OC6151,  "OC-6151/6152"),
255
        DEVICE( SUN,            SUN_EBUS,       "EBUS"),
256
        DEVICE( SUN,            SUN_HAPPYMEAL,  "Happy Meal Ethernet"),
257
        DEVICE( SUN,            SUN_SIMBA,      "Advanced PCI Bridge"),
258
        DEVICE( SUN,            SUN_PBM,        "PCI Bus Module"),
259
        DEVICE( SUN,            SUN_SABRE,      "Ultra IIi PCI"),
260
        DEVICE( CMD,            CMD_640,        "640 (buggy)"),
261
        DEVICE( CMD,            CMD_643,        "643"),
262
        DEVICE( CMD,            CMD_646,        "646"),
263
        DEVICE( CMD,            CMD_670,        "670"),
264
        DEVICE( VISION,         VISION_QD8500,  "QD-8500"),
265
        DEVICE( VISION,         VISION_QD8580,  "QD-8580"),
266
        DEVICE( BROOKTREE,      BROOKTREE_848,  "Bt848"),
267
        DEVICE( BROOKTREE,      BROOKTREE_849A, "Bt849"),
268
        DEVICE( BROOKTREE,      BROOKTREE_8474, "Bt8474"),
269
        DEVICE( SIERRA,         SIERRA_STB,     "STB Horizon 64"),
270
        DEVICE( ACC,            ACC_2056,       "2056"),
271
        DEVICE( WINBOND,        WINBOND_83769,  "W83769F"),
272
        DEVICE( WINBOND,        WINBOND_82C105, "SL82C105"),
273
        DEVICE( WINBOND,        WINBOND_83C553, "W83C553"),
274
        DEVICE( DATABOOK,       DATABOOK_87144, "DB87144"),
275
        DEVICE( PLX,        PLX_SPCOM200, "SPCom 200 PCI serial I/O"),
276
        DEVICE( PLX,        PLX_9050,   "PLX9050 PCI <-> IOBus Bridge"),
277
        DEVICE( PLX,            PLX_9080,       "PCI9080 I2O"),
278
        DEVICE( MADGE,          MADGE_MK2,      "Smart 16/4 BM Mk2 Ringnode"),
279
        DEVICE( 3COM,           3COM_3C339,     "3C339 TokenRing"),
280
        DEVICE( 3COM,           3COM_3C590,     "3C590 10bT"),
281
        DEVICE( 3COM,           3COM_3C595TX,   "3C595 100bTX"),
282
        DEVICE( 3COM,           3COM_3C595T4,   "3C595 100bT4"),
283
        DEVICE( 3COM,           3COM_3C595MII,  "3C595 100b-MII"),
284
        DEVICE( 3COM,           3COM_3C900TPO,  "3C900 10bTPO"),
285
        DEVICE( 3COM,           3COM_3C900COMBO,"3C900 10b Combo"),
286
        DEVICE( 3COM,           3COM_3C905TX,   "3C905 100bTX"),
287
        DEVICE( 3COM,           3COM_3C905T4,   "3C905 100bT4"),
288
        DEVICE( 3COM,           3COM_3C905B_TX, "3C905B 100bTX"),
289
        DEVICE( SMC,            SMC_EPIC100,    "9432 TX"),
290
        DEVICE( AL,             AL_M1445,       "M1445"),
291
        DEVICE( AL,             AL_M1449,       "M1449"),
292
        DEVICE( AL,             AL_M1451,       "M1451"),
293
        DEVICE( AL,             AL_M1461,       "M1461"),
294
        DEVICE( AL,             AL_M1489,       "M1489"),
295
        DEVICE( AL,             AL_M1511,       "M1511"),
296
        DEVICE( AL,             AL_M1513,       "M1513"),
297
        DEVICE( AL,             AL_M1521,       "M1521"),
298
        DEVICE( AL,             AL_M1523,       "M1523"),
299
        DEVICE( AL,             AL_M1531,       "M1531 Aladdin IV"),
300
        DEVICE( AL,             AL_M1533,       "M1533 Aladdin IV"),
301
        DEVICE( AL,             AL_M3307,       "M3307 MPEG-1 decoder"),
302
        DEVICE( AL,             AL_M4803,       "M4803"),
303
        DEVICE( AL,             AL_M5219,       "M5219"),
304
        DEVICE( AL,             AL_M5229,       "M5229 TXpro"),
305
        DEVICE( AL,             AL_M5237,       "M5237 USB"),
306
        DEVICE( SURECOM,        SURECOM_NE34,   "NE-34PCI LAN"),
307
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_NM2070,     "Magicgraph NM2070"),
308
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128V, "MagicGraph 128V"),
309
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_128ZV, "MagicGraph 128ZV"),
310
        DEVICE( NEOMAGIC,       NEOMAGIC_MAGICGRAPH_NM2160, "MagicGraph NM2160"),
311
        DEVICE( ASP,            ASP_ABP940,     "ABP940"),
312
        DEVICE( ASP,            ASP_ABP940U,    "ABP940U"),
313
        DEVICE( ASP,            ASP_ABP940UW,   "ABP940UW"),
314
        DEVICE( MACRONIX,       MACRONIX_MX98713,"MX98713"),
315
        DEVICE( MACRONIX,       MACRONIX_MX987x5,"MX98715 / MX98725"),
316
        DEVICE( CERN,           CERN_SPSB_PMC,  "STAR/RD24 SCI-PCI (PMC)"),
317
        DEVICE( CERN,           CERN_SPSB_PCI,  "STAR/RD24 SCI-PCI (PMC)"),
318
        DEVICE( CERN,           CERN_HIPPI_DST, "HIPPI destination"),
319
        DEVICE( CERN,           CERN_HIPPI_SRC, "HIPPI source"),
320
        DEVICE( IMS,            IMS_8849,       "8849"),
321
        DEVICE( TEKRAM2,        TEKRAM2_690c,   "DC690c"),
322
        DEVICE( TUNDRA,         TUNDRA_CA91C042,"CA91C042 Universe"),
323
        DEVICE( AMCC,           AMCC_MYRINET,   "Myrinet PCI (M2-PCI-32)"),
324
        DEVICE( AMCC,           AMCC_S5933,     "S5933"),
325
        DEVICE( AMCC,           AMCC_S5933_HEPC3,"S5933 Traquair HEPC3"),
326
        DEVICE( INTERG,         INTERG_1680,    "IGA-1680"),
327
        DEVICE( INTERG,         INTERG_1682,    "IGA-1682"),
328
        DEVICE( REALTEK,        REALTEK_8029,   "8029"),
329
        DEVICE( REALTEK,        REALTEK_8129,   "8129"),
330
        DEVICE( REALTEK,        REALTEK_8139,   "8139"),
331
        DEVICE( TRUEVISION,     TRUEVISION_T1000,"TARGA 1000"),
332
        DEVICE( INIT,           INIT_320P,      "320 P"),
333
        DEVICE( INIT,           INIT_360P,      "360 P"),
334
        DEVICE( TTI,            TTI_HPT343,     "HPT343"),
335
        DEVICE( VIA,            VIA_82C505,     "VT 82C505"),
336
        DEVICE( VIA,            VIA_82C561,     "VT 82C561"),
337
        DEVICE( VIA,            VIA_82C586_1,   "VT 82C586 Apollo IDE"),
338
        DEVICE( VIA,            VIA_82C576,     "VT 82C576 3V"),
339
        DEVICE( VIA,            VIA_82C585,     "VT 82C585 Apollo VP1/VPX"),
340
        DEVICE( VIA,            VIA_82C586_0,   "VT 82C586 Apollo ISA"),
341
        DEVICE( VIA,            VIA_82C595,     "VT 82C595 Apollo VP2"),
342
        DEVICE( VIA,            VIA_82C597_0,   "VT 82C597 Apollo VP3"),
343
        DEVICE( VIA,            VIA_82C598_0,   "VT 82C598 Apollo MVP3"),
344
        DEVICE( VIA,            VIA_82C926,     "VT 82C926 Amazon"),
345
        DEVICE( VIA,            VIA_82C416,     "VT 82C416MV"),
346
        DEVICE( VIA,            VIA_82C595_97,  "VT 82C595 Apollo VP2/97"),
347
        DEVICE( VIA,            VIA_82C586_2,   "VT 82C586 Apollo USB"),
348
        DEVICE( VIA,            VIA_82C586_3,   "VT 82C586B Apollo ACPI"),
349
        DEVICE( VIA,            VIA_86C100A,    "VT 86C100A"),
350
        DEVICE( VIA,            VIA_82C597_1,   "VT 82C597 Apollo VP3 AGP"),
351
        DEVICE( VIA,            VIA_82C598_1,   "VT 82C598 Apollo MVP3 AGP"),
352
        DEVICE( SMC2,           SMC2_1211TX,    "1211 TX"),
353
        DEVICE( VORTEX,         VORTEX_GDT60x0, "GDT 60x0"),
354
        DEVICE( VORTEX,         VORTEX_GDT6000B,"GDT 6000b"),
355
        DEVICE( VORTEX,         VORTEX_GDT6x10, "GDT 6110/6510"),
356
        DEVICE( VORTEX,         VORTEX_GDT6x20, "GDT 6120/6520"),
357
        DEVICE( VORTEX,         VORTEX_GDT6530, "GDT 6530"),
358
        DEVICE( VORTEX,         VORTEX_GDT6550, "GDT 6550"),
359
        DEVICE( VORTEX,         VORTEX_GDT6x17, "GDT 6117/6517"),
360
        DEVICE( VORTEX,         VORTEX_GDT6x27, "GDT 6127/6527"),
361
        DEVICE( VORTEX,         VORTEX_GDT6537, "GDT 6537"),
362
        DEVICE( VORTEX,         VORTEX_GDT6557, "GDT 6557"),
363
        DEVICE( VORTEX,         VORTEX_GDT6x15, "GDT 6115/6515"),
364
        DEVICE( VORTEX,         VORTEX_GDT6x25, "GDT 6125/6525"),
365
        DEVICE( VORTEX,         VORTEX_GDT6535, "GDT 6535"),
366
        DEVICE( VORTEX,         VORTEX_GDT6555, "GDT 6555"),
367
        DEVICE( VORTEX,         VORTEX_GDT6x17RP,"GDT 6117RP/6517RP"),
368
        DEVICE( VORTEX,         VORTEX_GDT6x27RP,"GDT 6127RP/6527RP"),
369
        DEVICE( VORTEX,         VORTEX_GDT6537RP,"GDT 6537RP"),
370
        DEVICE( VORTEX,         VORTEX_GDT6557RP,"GDT 6557RP"),
371
        DEVICE( VORTEX,         VORTEX_GDT6x11RP,"GDT 6111RP/6511RP"),
372
        DEVICE( VORTEX,         VORTEX_GDT6x21RP,"GDT 6121RP/6521RP"),
373
        DEVICE( VORTEX,         VORTEX_GDT6x17RP1,"GDT 6117RP1/6517RP1"),
374
        DEVICE( VORTEX,         VORTEX_GDT6x27RP1,"GDT 6127RP1/6527RP1"),
375
        DEVICE( VORTEX,         VORTEX_GDT6537RP1,"GDT 6537RP1"),
376
        DEVICE( VORTEX,         VORTEX_GDT6557RP1,"GDT 6557RP1"),
377
        DEVICE( VORTEX,         VORTEX_GDT6x11RP1,"GDT 6111RP1/6511RP1"),
378
        DEVICE( VORTEX,         VORTEX_GDT6x21RP1,"GDT 6121RP1/6521RP1"),
379
        DEVICE( VORTEX,         VORTEX_GDT6x17RP2,"GDT 6117RP2/6517RP2"),
380
        DEVICE( VORTEX,         VORTEX_GDT6x27RP2,"GDT 6127RP2/6527RP2"),
381
        DEVICE( VORTEX,         VORTEX_GDT6537RP2,"GDT 6537RP2"),
382
        DEVICE( VORTEX,         VORTEX_GDT6557RP2,"GDT 6557RP2"),
383
        DEVICE( VORTEX,         VORTEX_GDT6x11RP2,"GDT 6111RP2/6511RP2"),
384
        DEVICE( VORTEX,         VORTEX_GDT6x21RP2,"GDT 6121RP2/6521RP2"),
385
        DEVICE( EF,             EF_ATM_FPGA,            "155P-MF1 (FPGA)"),
386
        DEVICE( EF,             EF_ATM_ASIC,    "155P-MF1 (ASIC)"),
387
        DEVICE( FORE,           FORE_PCA200PC, "PCA-200PC"),
388
        DEVICE( FORE,           FORE_PCA200E,    "PCA-200E"),
389
        DEVICE( IMAGINGTECH,    IMAGINGTECH_ICPCI, "MVC IC-PCI"),
390
        DEVICE( PHILIPS,        PHILIPS_SAA7146,"SAA7146"),
391
        DEVICE( CYCLONE,        CYCLONE_SDK,    "SDK"),
392
        DEVICE( ALLIANCE,       ALLIANCE_PROMOTIO, "Promotion-6410"),
393
        DEVICE( ALLIANCE,       ALLIANCE_PROVIDEO, "Provideo"),
394
        DEVICE( ALLIANCE,       ALLIANCE_AT24,  "AT24"),
395
        DEVICE( ALLIANCE,       ALLIANCE_AT3D,  "AT3D"),
396
        DEVICE( VMIC,           VMIC_VME,       "VMIVME-7587"),
397
        DEVICE( DIGI,           DIGI_EPC,       "AccelPort EPC"),
398
        DEVICE( DIGI,           DIGI_RIGHTSWITCH, "RightSwitch SE-6"),
399
        DEVICE( DIGI,           DIGI_XEM,       "AccelPort Xem"),
400
        DEVICE( DIGI,           DIGI_XR,        "AccelPort Xr"),
401
        DEVICE( DIGI,           DIGI_CX,        "AccelPort C/X"),
402
        DEVICE( DIGI,           DIGI_XRJ,       "AccelPort Xr/J"),
403
        DEVICE( DIGI,           DIGI_EPCJ,      "AccelPort EPC/J"),
404
        DEVICE( DIGI,           DIGI_XR_920,    "AccelPort Xr 920"),
405
        DEVICE( MUTECH,         MUTECH_MV1000,  "MV-1000"),
406
        DEVICE( RENDITION,      RENDITION_VERITE,"Verite 1000"),
407
        DEVICE( RENDITION,      RENDITION_VERITE2100,"Verite 2100"),
408
        DEVICE( TOSHIBA,        TOSHIBA_601,    "Laptop"),
409
        DEVICE( TOSHIBA,        TOSHIBA_TOPIC95,"ToPIC95"),
410
        DEVICE( TOSHIBA,        TOSHIBA_TOPIC97,"ToPIC97"),
411
        DEVICE( RICOH,          RICOH_RL5C466,  "RL5C466"),
412
        DEVICE( ARTOP,          ARTOP_ATP850UF, "ATP850UF"),
413
        DEVICE( ZEITNET,        ZEITNET_1221,   "1221"),
414
        DEVICE( ZEITNET,        ZEITNET_1225,   "1225"),
415
        DEVICE( OMEGA,          OMEGA_82C092G,  "82C092G"),
416
        DEVICE( LITEON,         LITEON_LNE100TX,"LNE100TX"),
417
        DEVICE( NP,             NP_PCI_FDDI,    "NP-PCI"),
418
        DEVICE( ATT,            ATT_L56XMF,     "L56xMF"),
419
        DEVICE( SPECIALIX,      SPECIALIX_IO8,  "IO8+/PCI"),
420
        DEVICE( SPECIALIX,      SPECIALIX_XIO,  "XIO/SIO host"),
421
        DEVICE( SPECIALIX,      SPECIALIX_RIO,  "RIO host"),
422
        DEVICE( AURAVISION,     AURAVISION_VXP524,"VXP524"),
423
        DEVICE( IKON,           IKON_10115,     "10115 Greensheet"),
424
        DEVICE( IKON,           IKON_10117,     "10117 Greensheet"),
425
        DEVICE( ZORAN,          ZORAN_36057,    "ZR36057"),
426
        DEVICE( ZORAN,          ZORAN_36120,    "ZR36120"),
427
        DEVICE( KINETIC,        KINETIC_2915,   "2915 CAMAC"),
428
        DEVICE( COMPEX,         COMPEX_ENET100VG4, "Readylink ENET100-VG4"),
429
        DEVICE( COMPEX,         COMPEX_RL2000,  "ReadyLink 2000"),
430
        DEVICE( RP,             RP8OCTA,        "RocketPort 8 Oct"),
431
        DEVICE( RP,             RP8INTF,        "RocketPort 8 Intf"),
432
        DEVICE( RP,             RP16INTF,       "RocketPort 16 Intf"),
433
        DEVICE( RP,             RP32INTF,       "RocketPort 32 Intf"),
434
        DEVICE( CYCLADES,       CYCLOM_Y_Lo,    "Cyclom-Y below 1Mbyte"),
435
        DEVICE( CYCLADES,       CYCLOM_Y_Hi,    "Cyclom-Y above 1Mbyte"),
436
        DEVICE( CYCLADES,       CYCLOM_4Y_Lo,   "Cyclom-4Y below 1Mbyte"),
437
        DEVICE( CYCLADES,       CYCLOM_4Y_Hi,   "Cyclom-4Y above 1Mbyte"),
438
        DEVICE( CYCLADES,       CYCLOM_8Y_Lo,   "Cyclom-8Y below 1Mbyte"),
439
        DEVICE( CYCLADES,       CYCLOM_8Y_Hi,   "Cyclom-8Y above 1Mbyte"),
440
        DEVICE( CYCLADES,       CYCLOM_Z_Lo,    "Cyclades-Z below 1Mbyte"),
441
        DEVICE( CYCLADES,       CYCLOM_Z_Hi,    "Cyclades-Z above 1Mbyte"),
442
        DEVICE( ESSENTIAL,      ESSENTIAL_ROADRUNNER,"Roadrunner serial HIPPI"),
443
        DEVICE( O2,             O2_6832,        "6832"),
444
        DEVICE( 3DFX,           3DFX_VOODOO,    "Voodoo"),
445
        DEVICE( 3DFX,           3DFX_VOODOO2,   "Voodoo2"),
446
        DEVICE( SIGMADES,       SIGMADES_6425,  "REALmagic64/GX"),
447
        DEVICE( STALLION,       STALLION_ECHPCI832,"EasyConnection 8/32"),
448
        DEVICE( STALLION,       STALLION_ECHPCI864,"EasyConnection 8/64"),
449
        DEVICE( STALLION,       STALLION_EIOPCI,"EasyIO"),
450
        DEVICE( OPTIBASE,       OPTIBASE_FORGE, "MPEG Forge"),
451
        DEVICE( OPTIBASE,       OPTIBASE_FUSION,"MPEG Fusion"),
452
        DEVICE( OPTIBASE,       OPTIBASE_VPLEX, "VideoPlex"),
453
        DEVICE( OPTIBASE,       OPTIBASE_VPLEXCC,"VideoPlex CC"),
454
        DEVICE( OPTIBASE,       OPTIBASE_VQUEST,"VideoQuest"),
455
        DEVICE( ASIX,           ASIX_88140, "88140"),
456
        DEVICE( SATSAGEM,       SATSAGEM_PCR2101,"PCR2101 DVB receiver"),
457
        DEVICE( SATSAGEM,       SATSAGEM_TELSATTURBO,"Telsat Turbo DVB"),
458
        DEVICE( ENSONIQ,        ENSONIQ_AUDIOPCI,"AudioPCI"),
459
        DEVICE( PICTUREL,       PICTUREL_PCIVST,"PCIVST"),
460
        DEVICE( NVIDIA_SGS,     NVIDIA_SGS_RIVA128,     "Riva 128"),
461
        DEVICE( CBOARDS,        CBOARDS_DAS1602_16,"DAS1602/16"),
462
        DEVICE( SYMPHONY,       SYMPHONY_101,   "82C101"),
463
        DEVICE( TEKRAM,         TEKRAM_DC290,   "DC-290"),
464
        DEVICE( 3DLABS,         3DLABS_300SX,   "GLINT 300SX"),
465
        DEVICE( 3DLABS,         3DLABS_500TX,   "GLINT 500TX"),
466
        DEVICE( 3DLABS,         3DLABS_DELTA,   "GLINT Delta"),
467
        DEVICE( 3DLABS,         3DLABS_PERMEDIA,"PERMEDIA"),
468
        DEVICE( 3DLABS,         3DLABS_MX,      "GLINT MX"),
469
        DEVICE( AVANCE,         AVANCE_ALG2064, "ALG2064i"),
470
        DEVICE( AVANCE,         AVANCE_2302,    "ALG-2302"),
471
        DEVICE( NETVIN,         NETVIN_NV5000SC,"NV5000"),
472
        DEVICE( S3,             S3_PLATO_PXS,   "PLATO/PX (system)"),
473
        DEVICE( S3,             S3_ViRGE,       "ViRGE"),
474
        DEVICE( S3,             S3_TRIO,        "Trio32/Trio64"),
475
        DEVICE( S3,             S3_AURORA64VP,  "Aurora64V+"),
476
        DEVICE( S3,             S3_TRIO64UVP,   "Trio64UV+"),
477
        DEVICE( S3,             S3_ViRGE_VX,    "ViRGE/VX"),
478
        DEVICE( S3,             S3_868, "Vision 868"),
479
        DEVICE( S3,             S3_928,         "Vision 928-P"),
480
        DEVICE( S3,             S3_864_1,       "Vision 864-P"),
481
        DEVICE( S3,             S3_864_2,       "Vision 864-P"),
482
        DEVICE( S3,             S3_964_1,       "Vision 964-P"),
483
        DEVICE( S3,             S3_964_2,       "Vision 964-P"),
484
        DEVICE( S3,             S3_968,         "Vision 968"),
485
        DEVICE( S3,             S3_TRIO64V2,    "Trio64V2/DX or /GX"),
486
        DEVICE( S3,             S3_PLATO_PXG,   "PLATO/PX (graphics)"),
487
        DEVICE( S3,             S3_ViRGE_DXGX,  "ViRGE/DX or /GX"),
488
        DEVICE( S3,             S3_ViRGE_GX2,   "ViRGE/GX2"),
489
        DEVICE( S3,             S3_ViRGE_MX,    "ViRGE/MX"),
490
        DEVICE( S3,             S3_ViRGE_MXP,   "ViRGE/MX+"),
491
        DEVICE( S3,             S3_ViRGE_MXPMV, "ViRGE/MX+MV"),
492
        DEVICE( S3,             S3_SONICVIBES,  "SonicVibes"),
493
        DEVICE( DCI,    DCI_PCCOM4,     "PC COM PCI Bus 4 port serial Adapter"),
494
        DEVICE( INTEL,          INTEL_82375,    "82375EB"),
495
        BRIDGE( INTEL,          INTEL_82424,    "82424ZX Saturn",       0x00),
496
        DEVICE( INTEL,          INTEL_82378,    "82378IB"),
497
        DEVICE( INTEL,          INTEL_82430,    "82430ZX Aries"),
498
        BRIDGE( INTEL,          INTEL_82434,    "82434LX Mercury/Neptune", 0x00),
499
        BRIDGE( INTEL,          INTEL_I960,     "i960", 0x00),
500
        DEVICE( INTEL,          INTEL_82092AA_0,"82092AA PCMCIA bridge"),
501
        DEVICE( INTEL,          INTEL_82092AA_1,"82092AA EIDE"),
502
        DEVICE( INTEL,          INTEL_7116,     "SAA7116"),
503
        DEVICE( INTEL,          INTEL_82596,    "82596"),
504
        DEVICE( INTEL,          INTEL_82865,    "82865"),
505
        DEVICE( INTEL,          INTEL_82557,    "82557"),
506
        DEVICE( INTEL,          INTEL_82437,    "82437"),
507
        DEVICE( INTEL,          INTEL_82371_0,  "82371 Triton PIIX"),
508
        DEVICE( INTEL,          INTEL_82371_1,  "82371 Triton PIIX"),
509
        DEVICE( INTEL,          INTEL_82371MX,  "430MX - 82371MX MPIIX"),
510
        DEVICE( INTEL,          INTEL_82437MX,  "430MX - 82437MX MTSC"),
511
        DEVICE( INTEL,          INTEL_82441,    "82441FX Natoma"),
512
        DEVICE( INTEL,          INTEL_82380FB,  "82380FB Mobile"),
513
        DEVICE( INTEL,          INTEL_82439,    "82439HX Triton II"),
514
        DEVICE( INTEL,          INTEL_82371SB_0,"82371SB PIIX3 ISA"),
515
        DEVICE( INTEL,          INTEL_82371SB_1,"82371SB PIIX3 IDE"),
516
        DEVICE( INTEL,          INTEL_82371SB_2,"82371SB PIIX3 USB"),
517
        DEVICE( INTEL,          INTEL_82437VX,  "82437VX Triton II"),
518
        DEVICE( INTEL,          INTEL_82439TX,  "82439TX"),
519
        DEVICE( INTEL,          INTEL_82371AB_0,"82371AB PIIX4 ISA"),
520
        DEVICE( INTEL,          INTEL_82371AB,  "82371AB PIIX4 IDE"),
521
        DEVICE( INTEL,          INTEL_82371AB_2,"82371AB PIIX4 USB"),
522
        DEVICE( INTEL,          INTEL_82371AB_3,"82371AB PIIX4 ACPI"),
523
        DEVICE( INTEL,          INTEL_82443LX_0,"440LX - 82443LX PAC Host"),
524
        DEVICE( INTEL,          INTEL_82443LX_1,"440LX - 82443LX PAC AGP"),
525
        DEVICE( INTEL,          INTEL_82443BX_0,"440BX - 82443BX Host"),
526
        DEVICE( INTEL,          INTEL_82443BX_1,"440BX - 82443BX AGP"),
527
        DEVICE( INTEL,          INTEL_82443BX_2,"440BX - 82443BX Host (no AGP)"),
528
        DEVICE( INTEL,          INTEL_82443GX_0,"440GX - 82443GX Host"),
529
        DEVICE( INTEL,          INTEL_82443GX_1,"440GX - 82443GX AGP"),
530
        DEVICE( INTEL,          INTEL_82443GX_2,"440GX - 82443GX Host (no AGP)"),
531
        DEVICE( INTEL,          INTEL_P6,       "Orion P6"),
532
        DEVICE( INTEL,          INTEL_82450GX,  "82450GX Orion P6"),
533
        DEVICE( KTI,            KTI_ET32P2,     "ET32P2"),
534
        DEVICE( ADAPTEC,        ADAPTEC_7810,   "AIC-7810 RAID"),
535
        DEVICE( ADAPTEC,        ADAPTEC_7821,   "AIC-7860"),
536
        DEVICE( ADAPTEC,        ADAPTEC_7850,   "AIC-7850"),
537
        DEVICE( ADAPTEC,        ADAPTEC_7855,   "AIC-7855"),
538
        DEVICE( ADAPTEC,        ADAPTEC_3860,   "AIC-7860"),
539
        DEVICE( ADAPTEC,        ADAPTEC_5800,   "AIC-5800"),
540
        DEVICE( ADAPTEC,        ADAPTEC_1480A,  "AIC-1480A"),
541
        DEVICE( ADAPTEC,        ADAPTEC_7860,   "AIC-7860"),
542
        DEVICE( ADAPTEC,        ADAPTEC_7861,   "AIC-7861"),
543
        DEVICE( ADAPTEC,        ADAPTEC_7870,   "AIC-7870"),
544
        DEVICE( ADAPTEC,        ADAPTEC_7871,   "AIC-7871"),
545
        DEVICE( ADAPTEC,        ADAPTEC_7872,   "AIC-7872"),
546
        DEVICE( ADAPTEC,        ADAPTEC_7873,   "AIC-7873"),
547
        DEVICE( ADAPTEC,        ADAPTEC_7874,   "AIC-7874"),
548
        DEVICE( ADAPTEC,        ADAPTEC_7895,   "AIC-7895U"),
549
        DEVICE( ADAPTEC,        ADAPTEC_7880,   "AIC-7880U"),
550
        DEVICE( ADAPTEC,        ADAPTEC_7881,   "AIC-7881U"),
551
        DEVICE( ADAPTEC,        ADAPTEC_7882,   "AIC-7882U"),
552
        DEVICE( ADAPTEC,        ADAPTEC_7883,   "AIC-7883U"),
553
        DEVICE( ADAPTEC,        ADAPTEC_7884,   "AIC-7884U"),
554
        DEVICE( ADAPTEC,        ADAPTEC_7885,   "AIC-7885U"),
555
        DEVICE( ADAPTEC,        ADAPTEC_7886,   "AIC-7886U"),
556
        DEVICE( ADAPTEC,        ADAPTEC_7887,   "AIC-7887U"),
557
        DEVICE( ADAPTEC,        ADAPTEC_7888,   "AIC-7888U"),
558
        DEVICE( ADAPTEC,        ADAPTEC_1030,   "ABA-1030 DVB receiver"),
559
        DEVICE( ADAPTEC2,       ADAPTEC2_2940U2,"AHA-2940U2"),
560
        DEVICE( ADAPTEC2,       ADAPTEC2_2930U2,"AHA-2930U2"),
561
        DEVICE( ADAPTEC2,       ADAPTEC2_7890B, "AIC-7890/1"),
562
        DEVICE( ADAPTEC2,       ADAPTEC2_7890,  "AIC-7890/1"),
563
        DEVICE( ADAPTEC2,       ADAPTEC2_3940U2,"AHA-3940U2"),
564
        DEVICE( ADAPTEC2,       ADAPTEC2_3950U2D, "AHA-3950U2D"),
565
        DEVICE( ADAPTEC2,       ADAPTEC2_7896, "AIC-7896/7"),
566
        DEVICE( ADAPTEC2,       ADAPTEC2_7892A, "AIC-7892"),
567
        DEVICE( ADAPTEC2,       ADAPTEC2_7892B, "AIC-7892"),
568
        DEVICE( ADAPTEC2,       ADAPTEC2_7892D, "AIC-7892"),
569
        DEVICE( ADAPTEC2,       ADAPTEC2_7892P, "AIC-7892"),
570
        DEVICE( ADAPTEC2,       ADAPTEC2_7899A, "AIC-7899"),
571
        DEVICE( ADAPTEC2,       ADAPTEC2_7899B, "AIC-7899"),
572
        DEVICE( ADAPTEC2,       ADAPTEC2_7899D, "AIC-7899"),
573
        DEVICE( ADAPTEC2,       ADAPTEC2_7899P, "AIC-7899"),
574
        DEVICE( ATRONICS,       ATRONICS_2015,  "IDE-2015PL"),
575
        DEVICE( TIGERJET,       TIGERJET_300,   "Tiger300 ISDN"),
576
        DEVICE( ARK,            ARK_STING,      "Stingray"),
577
        DEVICE( ARK,            ARK_STINGARK,   "Stingray ARK 2000PV"),
578
        DEVICE( ARK,            ARK_2000MT,     "2000MT")
579
#endif /* CONFIG_PCIDEVLIST */
580
};
581
 
582
 
583
#ifdef CONFIG_PCI_OPTIMIZE
584
 
585
/*
586
 * An item of this structure has the following meaning:
587
 * for each optimization, the register address, the mask
588
 * and value to write to turn it on.
589
 * There are 5 optimizations for the moment:
590
 * Cache L2 write back best than write through
591
 * Posted Write for CPU to PCI enable
592
 * Posted Write for CPU to MEMORY enable
593
 * Posted Write for PCI to MEMORY enable
594
 * PCI Burst enable
595
 *
596
 * Half of the bios I've meet don't allow you to turn that on, and you
597
 * can gain more than 15% on graphic accesses using those
598
 * optimizations...
599
 */
600
struct optimization_type {
601
        const char      *type;
602
        const char      *off;
603
        const char      *on;
604
} bridge_optimization[] = {
605
        {"Cache L2",                    "write through",        "write back"},
606
        {"CPU-PCI posted write",        "off",          "on"},
607
        {"CPU-Memory posted write",     "off",          "on"},
608
        {"PCI-Memory posted write",     "off",          "on"},
609
        {"PCI burst",                   "off",          "on"}
610
};
611
 
612
#define NUM_OPTIMIZATIONS \
613
        (sizeof(bridge_optimization) / sizeof(bridge_optimization[0]))
614
 
615
struct bridge_mapping_type {
616
        unsigned char   addr;   /* config space address */
617
        unsigned char   mask;
618
        unsigned char   value;
619
} bridge_mapping[] = {
620
        /*
621
         * Intel Neptune/Mercury/Saturn:
622
         *      If the internal cache is write back,
623
         *      the L2 cache must be write through!
624
         *      I've to check out how to control that
625
         *      for the moment, we won't touch the cache
626
         */
627
        {0x0    ,0x02   ,0x02   },
628
        {0x53   ,0x02   ,0x02   },
629
        {0x53   ,0x01   ,0x01   },
630
        {0x54   ,0x01   ,0x01   },
631
        {0x54   ,0x02   ,0x02   },
632
 
633
        /*
634
         * UMC 8891A Pentium chipset:
635
         *      Why did you think UMC was cheaper ??
636
         */
637
        {0x50   ,0x10   ,0x00   },
638
        {0x51   ,0x40   ,0x40   },
639
        {0x0    ,0x0    ,0x0    },
640
        {0x0    ,0x0    ,0x0    },
641
        {0x0    ,0x0    ,0x0    },
642
 
643
        /*
644
         * UMC UM8881F
645
         *      This is a dummy entry for my tests.
646
         *      I have this chipset and no docs....
647
         */
648
        {0x0    ,0x1    ,0x1    },
649
        {0x0    ,0x2    ,0x0    },
650
        {0x0    ,0x0    ,0x0    },
651
        {0x0    ,0x0    ,0x0    },
652
        {0x0    ,0x0    ,0x0    }
653
};
654
 
655
#endif /* CONFIG_PCI_OPTIMIZE */
656
 
657
 
658
/*
659
 * device_info[] is sorted so we can use binary search
660
 */
661
struct pci_dev_info *pci_lookup_dev(unsigned int vendor, unsigned int dev)
662
{
663
        int min = 0,
664
            max = sizeof(dev_info)/sizeof(dev_info[0]) - 1;
665
 
666
        for ( ; ; )
667
        {
668
            int i = (min + max) >> 1;
669
            long order;
670
 
671
            order = dev_info[i].vendor - (long) vendor;
672
            if (!order)
673
                order = dev_info[i].device - (long) dev;
674
 
675
            if (order < 0)
676
            {
677
                    min = i + 1;
678
                    if ( min > max )
679
                       return 0;
680
                    continue;
681
            }
682
 
683
            if (order > 0)
684
            {
685
                    max = i - 1;
686
                    if ( min > max )
687
                       return 0;
688
                    continue;
689
            }
690
 
691
            return & dev_info[ i ];
692
        }
693
}
694
 
695
const char *pci_strclass (unsigned int class)
696
{
697
        switch (class >> 8) {
698
              case PCI_CLASS_NOT_DEFINED:               return "Non-VGA device";
699
              case PCI_CLASS_NOT_DEFINED_VGA:           return "VGA compatible device";
700
 
701
              case PCI_CLASS_STORAGE_SCSI:              return "SCSI storage controller";
702
              case PCI_CLASS_STORAGE_IDE:               return "IDE interface";
703
              case PCI_CLASS_STORAGE_FLOPPY:            return "Floppy disk controller";
704
              case PCI_CLASS_STORAGE_IPI:               return "IPI storage controller";
705
              case PCI_CLASS_STORAGE_RAID:              return "RAID storage controller";
706
              case PCI_CLASS_STORAGE_OTHER:             return "Unknown mass storage controller";
707
 
708
              case PCI_CLASS_NETWORK_ETHERNET:          return "Ethernet controller";
709
              case PCI_CLASS_NETWORK_TOKEN_RING:        return "Token ring network controller";
710
              case PCI_CLASS_NETWORK_FDDI:              return "FDDI network controller";
711
              case PCI_CLASS_NETWORK_ATM:               return "ATM network controller";
712
              case PCI_CLASS_NETWORK_OTHER:             return "Network controller";
713
 
714
              case PCI_CLASS_DISPLAY_VGA:               return "VGA compatible controller";
715
              case PCI_CLASS_DISPLAY_XGA:               return "XGA compatible controller";
716
              case PCI_CLASS_DISPLAY_OTHER:             return "Display controller";
717
 
718
              case PCI_CLASS_MULTIMEDIA_VIDEO:          return "Multimedia video controller";
719
              case PCI_CLASS_MULTIMEDIA_AUDIO:          return "Multimedia audio controller";
720
              case PCI_CLASS_MULTIMEDIA_OTHER:          return "Multimedia controller";
721
 
722
              case PCI_CLASS_MEMORY_RAM:                return "RAM memory";
723
              case PCI_CLASS_MEMORY_FLASH:              return "FLASH memory";
724
              case PCI_CLASS_MEMORY_OTHER:              return "Memory";
725
 
726
              case PCI_CLASS_BRIDGE_HOST:               return "Host bridge";
727
              case PCI_CLASS_BRIDGE_ISA:                return "ISA bridge";
728
              case PCI_CLASS_BRIDGE_EISA:               return "EISA bridge";
729
              case PCI_CLASS_BRIDGE_MC:                 return "MicroChannel bridge";
730
              case PCI_CLASS_BRIDGE_PCI:                return "PCI bridge";
731
              case PCI_CLASS_BRIDGE_PCMCIA:             return "PCMCIA bridge";
732
              case PCI_CLASS_BRIDGE_NUBUS:              return "NuBus bridge";
733
              case PCI_CLASS_BRIDGE_CARDBUS:            return "CardBus bridge";
734
              case PCI_CLASS_BRIDGE_OTHER:              return "Bridge";
735
 
736
              case PCI_CLASS_COMMUNICATION_SERIAL:      return "Serial controller";
737
              case PCI_CLASS_COMMUNICATION_PARALLEL:    return "Parallel controller";
738
              case PCI_CLASS_COMMUNICATION_OTHER:       return "Communication controller";
739
 
740
              case PCI_CLASS_SYSTEM_PIC:                return "PIC";
741
              case PCI_CLASS_SYSTEM_DMA:                return "DMA controller";
742
              case PCI_CLASS_SYSTEM_TIMER:              return "Timer";
743
              case PCI_CLASS_SYSTEM_RTC:                return "RTC";
744
              case PCI_CLASS_SYSTEM_OTHER:              return "System peripheral";
745
 
746
              case PCI_CLASS_INPUT_KEYBOARD:            return "Keyboard controller";
747
              case PCI_CLASS_INPUT_PEN:                 return "Digitizer Pen";
748
              case PCI_CLASS_INPUT_MOUSE:               return "Mouse controller";
749
              case PCI_CLASS_INPUT_OTHER:               return "Input device controller";
750
 
751
              case PCI_CLASS_DOCKING_GENERIC:           return "Generic Docking Station";
752
              case PCI_CLASS_DOCKING_OTHER:             return "Docking Station";
753
 
754
              case PCI_CLASS_PROCESSOR_386:             return "386";
755
              case PCI_CLASS_PROCESSOR_486:             return "486";
756
              case PCI_CLASS_PROCESSOR_PENTIUM:         return "Pentium";
757
              case PCI_CLASS_PROCESSOR_ALPHA:           return "Alpha";
758
              case PCI_CLASS_PROCESSOR_POWERPC:         return "Power PC";
759
              case PCI_CLASS_PROCESSOR_CO:              return "Co-processor";
760
 
761
              case PCI_CLASS_SERIAL_FIREWIRE:           return "FireWire (IEEE 1394)";
762
              case PCI_CLASS_SERIAL_ACCESS:             return "ACCESS Bus";
763
              case PCI_CLASS_SERIAL_SSA:                return "SSA";
764
              case PCI_CLASS_SERIAL_USB:                return "USB Controller";
765
              case PCI_CLASS_SERIAL_FIBER:              return "Fiber Channel";
766
 
767
              default:                                  return "Unknown class";
768
        }
769
}
770
 
771
 
772
const char *pci_strvendor(unsigned int vendor)
773
{
774
        switch (vendor) {
775
#ifdef CONFIG_PCIDEVLIST
776
              case PCI_VENDOR_ID_COMPAQ:        return "Compaq";
777
              case PCI_VENDOR_ID_NCR:           return "NCR";
778
              case PCI_VENDOR_ID_ATI:           return "ATI";
779
              case PCI_VENDOR_ID_VLSI:          return "VLSI";
780
              case PCI_VENDOR_ID_ADL:           return "Advance Logic";
781
              case PCI_VENDOR_ID_NS:            return "NS";
782
              case PCI_VENDOR_ID_TSENG:         return "Tseng'Lab";
783
              case PCI_VENDOR_ID_WEITEK:        return "Weitek";
784
              case PCI_VENDOR_ID_DEC:           return "DEC";
785
              case PCI_VENDOR_ID_CIRRUS:        return "Cirrus Logic";
786
              case PCI_VENDOR_ID_IBM:           return "IBM";
787
              case PCI_VENDOR_ID_WD:            return "Western Digital";
788
              case PCI_VENDOR_ID_AMD:           return "AMD";
789
              case PCI_VENDOR_ID_TRIDENT:       return "Trident";
790
              case PCI_VENDOR_ID_AI:            return "Acer Incorporated";
791
              case PCI_VENDOR_ID_MATROX:        return "Matrox";
792
              case PCI_VENDOR_ID_CT:            return "Chips & Technologies";
793
              case PCI_VENDOR_ID_MIRO:          return "Miro";
794
              case PCI_VENDOR_ID_NEC:           return "NEC";
795
              case PCI_VENDOR_ID_FD:            return "Future Domain";
796
              case PCI_VENDOR_ID_SI:            return "Silicon Integrated Systems";
797
              case PCI_VENDOR_ID_HP:            return "Hewlett Packard";
798
              case PCI_VENDOR_ID_PCTECH:        return "PCTECH";
799
              case PCI_VENDOR_ID_DPT:           return "DPT";
800
              case PCI_VENDOR_ID_OPTI:          return "OPTi";
801
              case PCI_VENDOR_ID_SGS:           return "SGS Thomson";
802
              case PCI_VENDOR_ID_BUSLOGIC:      return "BusLogic";
803
              case PCI_VENDOR_ID_TI:            return "Texas Instruments";
804
              case PCI_VENDOR_ID_OAK:           return "OAK";
805
              case PCI_VENDOR_ID_WINBOND2:      return "Winbond";
806
              case PCI_VENDOR_ID_MOTOROLA:      return "Motorola";
807
              case PCI_VENDOR_ID_PROMISE:       return "Promise Technology";
808
              case PCI_VENDOR_ID_APPLE:         return "Apple";
809
              case PCI_VENDOR_ID_N9:            return "Number Nine";
810
              case PCI_VENDOR_ID_UMC:           return "UMC";
811
              case PCI_VENDOR_ID_X:             return "X TECHNOLOGY";
812
              case PCI_VENDOR_ID_MYLEX:         return "Mylex";
813
              case PCI_VENDOR_ID_NEXGEN:        return "Nexgen";
814
              case PCI_VENDOR_ID_QLOGIC:        return "Q Logic";
815
              case PCI_VENDOR_ID_LEADTEK:       return "Leadtek Research";
816
              case PCI_VENDOR_ID_CONTAQ:        return "Contaq";
817
              case PCI_VENDOR_ID_FOREX:         return "Forex";
818
              case PCI_VENDOR_ID_OLICOM:        return "Olicom";
819
              case PCI_VENDOR_ID_CMD:           return "CMD";
820
              case PCI_VENDOR_ID_VISION:        return "Vision";
821
              case PCI_VENDOR_ID_BROOKTREE:     return "Brooktree";
822
              case PCI_VENDOR_ID_SIERRA:        return "Sierra";
823
              case PCI_VENDOR_ID_ACC:           return "ACC MICROELECTRONICS";
824
              case PCI_VENDOR_ID_WINBOND:       return "Winbond";
825
              case PCI_VENDOR_ID_DATABOOK:      return "Databook";
826
              case PCI_VENDOR_ID_3COM:          return "3Com";
827
              case PCI_VENDOR_ID_SMC:           return "SMC";
828
              case PCI_VENDOR_ID_AL:            return "Acer Labs";
829
              case PCI_VENDOR_ID_MITSUBISHI:    return "Mitsubishi";
830
              case PCI_VENDOR_ID_NEOMAGIC:      return "Neomagic";
831
              case PCI_VENDOR_ID_ASP:           return "Advanced System Products";
832
              case PCI_VENDOR_ID_CERN:          return "CERN";
833
              case PCI_VENDOR_ID_IMS:           return "IMS";
834
              case PCI_VENDOR_ID_TEKRAM2:       return "Tekram";
835
              case PCI_VENDOR_ID_TUNDRA:        return "Tundra";
836
              case PCI_VENDOR_ID_AMCC:          return "AMCC";
837
              case PCI_VENDOR_ID_INTERG:        return "Intergraphics";
838
              case PCI_VENDOR_ID_REALTEK:       return "Realtek";
839
              case PCI_VENDOR_ID_TRUEVISION:    return "Truevision";
840
              case PCI_VENDOR_ID_INIT:          return "Initio Corp";
841
              case PCI_VENDOR_ID_TTI:           return "Triones Technologies, Inc.";
842
              case PCI_VENDOR_ID_VIA:           return "VIA Technologies";
843
              case PCI_VENDOR_ID_SMC2:          return "SMC";
844
              case PCI_VENDOR_ID_VORTEX:        return "VORTEX";
845
              case PCI_VENDOR_ID_EF:            return "Efficient Networks";
846
              case PCI_VENDOR_ID_FORE:          return "Fore Systems";
847
              case PCI_VENDOR_ID_IMAGINGTECH:   return "Imaging Technology";
848
              case PCI_VENDOR_ID_PHILIPS:       return "Philips";
849
              case PCI_VENDOR_ID_PLX:           return "PLX";
850
              case PCI_VENDOR_ID_ALLIANCE:      return "Alliance";
851
              case PCI_VENDOR_ID_VMIC:          return "VMIC";
852
              case PCI_VENDOR_ID_DIGI:          return "Digi Intl.";
853
              case PCI_VENDOR_ID_MUTECH:        return "Mutech";
854
              case PCI_VENDOR_ID_RENDITION:     return "Rendition";
855
              case PCI_VENDOR_ID_TOSHIBA:       return "Toshiba";
856
              case PCI_VENDOR_ID_RICOH:         return "Ricoh";
857
              case PCI_VENDOR_ID_ARTOP: return "Artop Electronics";
858
              case PCI_VENDOR_ID_ZEITNET:       return "ZeitNet";
859
              case PCI_VENDOR_ID_OMEGA:         return "Omega Micro";
860
              case PCI_VENDOR_ID_NP:            return "Network Peripherals";
861
              case PCI_VENDOR_ID_SPECIALIX:     return "Specialix";
862
              case PCI_VENDOR_ID_IKON:          return "Ikon";
863
              case PCI_VENDOR_ID_ZORAN:         return "Zoran";
864
              case PCI_VENDOR_ID_COMPEX:        return "Compex";
865
              case PCI_VENDOR_ID_RP:            return "Comtrol";
866
              case PCI_VENDOR_ID_CYCLADES:      return "Cyclades";
867
              case PCI_VENDOR_ID_3DFX:          return "3Dfx";
868
              case PCI_VENDOR_ID_SIGMADES:      return "Sigma Designs";
869
              case PCI_VENDOR_ID_OPTIBASE:      return "Optibase";
870
              case PCI_VENDOR_ID_NVIDIA_SGS:    return "NVidia/SGS Thomson";
871
              case PCI_VENDOR_ID_ENSONIQ:       return "Ensoniq";
872
              case PCI_VENDOR_ID_SYMPHONY:      return "Symphony";
873
              case PCI_VENDOR_ID_TEKRAM:        return "Tekram";
874
              case PCI_VENDOR_ID_3DLABS:        return "3Dlabs";
875
              case PCI_VENDOR_ID_AVANCE:        return "Avance";
876
              case PCI_VENDOR_ID_NETVIN:        return "NetVin";
877
              case PCI_VENDOR_ID_S3:            return "S3 Inc.";
878
              case PCI_VENDOR_ID_DCI:       return "Decision Computer Int.";
879
              case PCI_VENDOR_ID_INTEL:         return "Intel";
880
              case PCI_VENDOR_ID_KTI:           return "KTI";
881
              case PCI_VENDOR_ID_ADAPTEC:       return "Adaptec";
882
              case PCI_VENDOR_ID_ADAPTEC2:      return "Adaptec";
883
              case PCI_VENDOR_ID_ATRONICS:      return "Atronics";
884
              case PCI_VENDOR_ID_ARK:           return "ARK Logic";
885
              case PCI_VENDOR_ID_ASIX:          return "ASIX";
886
              case PCI_VENDOR_ID_LITEON:        return "Lite-on";
887
#endif /* CONFIG_PCIDEVLIST */
888
              default:                          return "Unknown vendor";
889
        }
890
}
891
 
892
 
893
const char *pci_strdev(unsigned int vendor, unsigned int device)
894
{
895
        struct pci_dev_info *info;
896
 
897
        info =  pci_lookup_dev(vendor, device);
898
        return info ? info->name : "Unknown device";
899
}
900
 
901
 
902
 
903
/*
904
 * Turn on/off PCI bridge optimization. This should allow benchmarking.
905
 */
906
static void burst_bridge(unsigned char bus, unsigned char devfn,
907
                         unsigned char pos, int turn_on)
908
{
909
#ifdef CONFIG_PCI_OPTIMIZE
910
        struct bridge_mapping_type *bmap;
911
        unsigned char val;
912
        int i;
913
 
914
        pos *= NUM_OPTIMIZATIONS;
915
        printk("PCI bridge optimization.\n");
916
        for (i = 0; i < NUM_OPTIMIZATIONS; i++) {
917
                printk("    %s: ", bridge_optimization[i].type);
918
                bmap = &bridge_mapping[pos + i];
919
                if (!bmap->addr) {
920
                        printk("Not supported.");
921
                } else {
922
                        pcibios_read_config_byte(bus, devfn, bmap->addr, &val);
923
                        if ((val & bmap->mask) == bmap->value) {
924
                                printk("%s.", bridge_optimization[i].on);
925
                                if (!turn_on) {
926
                                        pcibios_write_config_byte(bus, devfn,
927
                                                                  bmap->addr,
928
                                                                  (val | bmap->mask)
929
                                                                  - bmap->value);
930
                                        printk("Changed!  Now %s.", bridge_optimization[i].off);
931
                                }
932
                        } else {
933
                                printk("%s.", bridge_optimization[i].off);
934
                                if (turn_on) {
935
                                        pcibios_write_config_byte(bus, devfn,
936
                                                                  bmap->addr,
937
                                                                  (val & (0xff - bmap->mask))
938
                                                                  + bmap->value);
939
                                        printk("Changed!  Now %s.", bridge_optimization[i].on);
940
                                }
941
                        }
942
                }
943
                printk("\n");
944
        }
945
#endif /* CONFIG_PCI_OPTIMIZE */
946
}
947
 
948
 
949
/*
950
 * Convert some of the configuration space registers of the device at
951
 * address (bus,devfn) into a string (possibly several lines each).
952
 * The configuration string is stored starting at buf[len].  If the
953
 * string would exceed the size of the buffer (SIZE), 0 is returned.
954
 */
955
static int sprint_dev_config(struct pci_dev *dev, char *buf, int size)
956
{
957
        unsigned long base;
958
        unsigned int l, class_rev, bus, devfn, last_reg;
959
        unsigned short vendor, device, status;
960
        unsigned char bist, latency, min_gnt, max_lat, hdr_type;
961
        int reg, len = 0;
962
        const char *str;
963
 
964
        bus   = dev->bus->number;
965
        devfn = dev->devfn;
966
 
967
        pcibios_read_config_byte (bus, devfn, PCI_HEADER_TYPE, &hdr_type);
968
        pcibios_read_config_dword(bus, devfn, PCI_CLASS_REVISION, &class_rev);
969
        pcibios_read_config_word (bus, devfn, PCI_VENDOR_ID, &vendor);
970
        pcibios_read_config_word (bus, devfn, PCI_DEVICE_ID, &device);
971
        pcibios_read_config_word (bus, devfn, PCI_STATUS, &status);
972
        pcibios_read_config_byte (bus, devfn, PCI_BIST, &bist);
973
        pcibios_read_config_byte (bus, devfn, PCI_LATENCY_TIMER, &latency);
974
        pcibios_read_config_byte (bus, devfn, PCI_MIN_GNT, &min_gnt);
975
        pcibios_read_config_byte (bus, devfn, PCI_MAX_LAT, &max_lat);
976
        if (len + 80 > size) {
977
                return -1;
978
        }
979
        len += sprintf(buf + len, "  Bus %2d, device %3d, function %2d:\n",
980
                       bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
981
 
982
        if (len + 80 > size) {
983
                return -1;
984
        }
985
        len += sprintf(buf + len, "    %s: %s %s (rev %d).\n      ",
986
                       pci_strclass(class_rev >> 8), pci_strvendor(vendor),
987
                       pci_strdev(vendor, device), class_rev & 0xff);
988
 
989
        if (!pci_lookup_dev(vendor, device)) {
990
                len += sprintf(buf + len,
991
                               "Vendor id=%x. Device id=%x.\n      ",
992
                               vendor, device);
993
        }
994
 
995
        str = 0; /* to keep gcc shut... */
996
        switch (status & PCI_STATUS_DEVSEL_MASK) {
997
              case PCI_STATUS_DEVSEL_FAST:   str = "Fast devsel.  "; break;
998
              case PCI_STATUS_DEVSEL_MEDIUM: str = "Medium devsel.  "; break;
999
              case PCI_STATUS_DEVSEL_SLOW:   str = "Slow devsel.  "; break;
1000
        }
1001
        if (len + strlen(str) > size) {
1002
                return -1;
1003
        }
1004
        len += sprintf(buf + len, str);
1005
 
1006
        if (status & PCI_STATUS_FAST_BACK) {
1007
#               define fast_b2b_capable "Fast back-to-back capable.  "
1008
                if (len + strlen(fast_b2b_capable) > size) {
1009
                        return -1;
1010
                }
1011
                len += sprintf(buf + len, fast_b2b_capable);
1012
#               undef fast_b2b_capable
1013
        }
1014
 
1015
        if (bist & PCI_BIST_CAPABLE) {
1016
#               define BIST_capable     "BIST capable.  "
1017
                if (len + strlen(BIST_capable) > size) {
1018
                        return -1;
1019
                }
1020
                len += sprintf(buf + len, BIST_capable);
1021
#               undef BIST_capable
1022
        }
1023
 
1024
        if (dev->irq) {
1025
                if (len + 40 > size) {
1026
                        return -1;
1027
                }
1028
                len += sprintf(buf + len, "IRQ %d.  ", dev->irq);
1029
        }
1030
 
1031
        if (dev->master) {
1032
                if (len + 80 > size) {
1033
                        return -1;
1034
                }
1035
                len += sprintf(buf + len, "Master Capable.  ");
1036
                if (latency)
1037
                  len += sprintf(buf + len, "Latency=%d.  ", latency);
1038
                else
1039
                  len += sprintf(buf + len, "No bursts.  ");
1040
                if (min_gnt)
1041
                  len += sprintf(buf + len, "Min Gnt=%d.", min_gnt);
1042
                if (max_lat)
1043
                  len += sprintf(buf + len, "Max Lat=%d.", max_lat);
1044
        }
1045
 
1046
        switch (hdr_type & 0x7f) {
1047
                case 0:
1048
                        last_reg = PCI_BASE_ADDRESS_5;
1049
                        break;
1050
                case 1:
1051
                        last_reg = PCI_BASE_ADDRESS_1;
1052
                        break;
1053
                default:
1054
                        last_reg = 0;
1055
        }
1056
        for (reg = PCI_BASE_ADDRESS_0; reg <= last_reg; reg += 4) {
1057
                if (len + 40 > size) {
1058
                        return -1;
1059
                }
1060
                pcibios_read_config_dword(bus, devfn, reg, &l);
1061
                base = l;
1062
                if (!base) {
1063
                        continue;
1064
                }
1065
 
1066
                if (base & PCI_BASE_ADDRESS_SPACE_IO) {
1067
                        len += sprintf(buf + len,
1068
                                       "\n      I/O at 0x%lx.",
1069
                                       base & PCI_BASE_ADDRESS_IO_MASK);
1070
                } else {
1071
                        const char *pref, *type = "unknown";
1072
 
1073
                        if (base & PCI_BASE_ADDRESS_MEM_PREFETCH) {
1074
                                pref = "P";
1075
                        } else {
1076
                                pref = "Non-p";
1077
                        }
1078
                        switch (base & PCI_BASE_ADDRESS_MEM_TYPE_MASK) {
1079
                              case PCI_BASE_ADDRESS_MEM_TYPE_32:
1080
                                type = "32 bit"; break;
1081
                              case PCI_BASE_ADDRESS_MEM_TYPE_1M:
1082
                                type = "20 bit"; break;
1083
                              case PCI_BASE_ADDRESS_MEM_TYPE_64:
1084
                                type = "64 bit";
1085
                                /* read top 32 bit address of base addr: */
1086
                                reg += 4;
1087
                                pcibios_read_config_dword(bus, devfn, reg, &l);
1088
                                base |= ((u64) l) << 32;
1089
                                break;
1090
                        }
1091
                        len += sprintf(buf + len,
1092
                                       "\n      %srefetchable %s memory at "
1093
                                       "0x%lx.", pref, type,
1094
                                       base & PCI_BASE_ADDRESS_MEM_MASK);
1095
                }
1096
        }
1097
 
1098
        len += sprintf(buf + len, "\n");
1099
        return len;
1100
}
1101
 
1102
 
1103
/*
1104
 * Return list of PCI devices as a character string for /proc/pci.
1105
 * BUF is a buffer that is PAGE_SIZE bytes long.
1106
 */
1107
int get_pci_list(char *buf)
1108
{
1109
        int nprinted, len, size;
1110
        struct pci_dev *dev;
1111
#       define MSG "\nwarning: page-size limit reached!\n"
1112
 
1113
        /* reserve same for truncation warning message: */
1114
        size  = PAGE_SIZE - (strlen(MSG) + 1);
1115
        len   = sprintf(buf, "PCI devices found:\n");
1116
 
1117
        for (dev = pci_devices; dev; dev = dev->next) {
1118
                nprinted = sprint_dev_config(dev, buf + len, size - len);
1119
                if (nprinted < 0) {
1120
                        return len + sprintf(buf + len, MSG);
1121
                }
1122
                len += nprinted;
1123
        }
1124
        return len;
1125
}
1126
 
1127
 
1128
/*
1129
 * pci_malloc() returns initialized memory of size SIZE.  Can be
1130
 * used only while pci_init() is active.
1131
 */
1132
static void *pci_malloc(long size, unsigned long *mem_startp)
1133
{
1134
        void *mem;
1135
 
1136
#ifdef DEBUG
1137
        printk("...pci_malloc(size=%ld,mem=%p)", size, *mem_startp);
1138
#endif
1139
        mem = (void*) *mem_startp;
1140
        *mem_startp += (size + sizeof(void*) - 1) & ~(sizeof(void*) - 1);
1141
        memset(mem, 0, size);
1142
        return mem;
1143
}
1144
 
1145
 
1146
static unsigned int scan_bus(struct pci_bus *bus, unsigned long *mem_startp)
1147
{
1148
        unsigned int devfn, l, max;
1149
        unsigned char cmd, tmp, hdr_type, ht, is_multi = 0;
1150
        struct pci_dev_info *info;
1151
        struct pci_dev *dev;
1152
        struct pci_bus *child;
1153
 
1154
#ifdef DEBUG
1155
        printk("...scan_bus(busno=%d,mem=%p)\n", bus->number, *mem_startp);
1156
#endif
1157
 
1158
        max = bus->secondary;
1159
        for (devfn = 0; devfn < 0xff; ++devfn) {
1160
                if (PCI_FUNC(devfn) && !is_multi) {
1161
                        /* Not a multi-function device */
1162
                        continue;
1163
                }
1164
                pcibios_read_config_byte(bus->number, devfn, PCI_HEADER_TYPE, &hdr_type);
1165
                if (!PCI_FUNC(devfn))
1166
                        is_multi = hdr_type & 0x80;
1167
 
1168
                pcibios_read_config_dword(bus->number, devfn, PCI_VENDOR_ID, &l);
1169
                /* some broken boards return 0 if a slot is empty: */
1170
                if (l == 0xffffffff || l == 0x00000000) {
1171
                        is_multi = 0;
1172
                        continue;
1173
                }
1174
 
1175
                dev = pci_malloc(sizeof(*dev), mem_startp);
1176
                dev->bus = bus;
1177
                dev->devfn  = devfn;
1178
                dev->vendor = l & 0xffff;
1179
                dev->device = (l >> 16) & 0xffff;
1180
 
1181
                /*
1182
                 * Check to see if we know about this device and report
1183
                 * a message at boot time.  This is the only way to
1184
                 * learn about new hardware...
1185
                 */
1186
                info = pci_lookup_dev(dev->vendor, dev->device);
1187
                if (!info) {
1188
#if 0
1189
                        printk("Warning : Unknown PCI device (%x:%x).  Please read include/linux/pci.h\n",
1190
                                dev->vendor, dev->device);
1191
#endif
1192
                } else {
1193
                        /* Some BIOS' are lazy. Let's do their job: */
1194
                        if (info->bridge_type != 0xff) {
1195
                                burst_bridge(bus->number, devfn,
1196
                                             info->bridge_type, 1);
1197
                        }
1198
                }
1199
 
1200
                /* non-destructively determine if device can be a master: */
1201
                pcibios_read_config_byte(bus->number, devfn, PCI_COMMAND,
1202
                                         &cmd);
1203
                pcibios_write_config_byte(bus->number, devfn, PCI_COMMAND,
1204
                                          cmd | PCI_COMMAND_MASTER);
1205
                pcibios_read_config_byte(bus->number, devfn, PCI_COMMAND,
1206
                                         &tmp);
1207
                dev->master = ((tmp & PCI_COMMAND_MASTER) != 0);
1208
                pcibios_write_config_byte(bus->number, devfn, PCI_COMMAND,
1209
                                          cmd);
1210
 
1211
                /* read irq level (may be changed during pcibios_fixup()): */
1212
                pcibios_read_config_byte(bus->number, devfn,
1213
                                         PCI_INTERRUPT_LINE, &dev->irq);
1214
 
1215
                /* check to see if this device is a PCI-PCI bridge: */
1216
                pcibios_read_config_dword(bus->number, devfn,
1217
                                          PCI_CLASS_REVISION, &l);
1218
                l = l >> 8;                     /* upper 3 bytes */
1219
                dev->class = l;
1220
 
1221
                /*
1222
                 * Check if the header type is known and consistent with
1223
                 * device type. PCI-to-PCI Bridges should have hdr_type 1,
1224
                 * CardBus Bridges 2, all other devices 0.
1225
                 */
1226
                switch (dev->class >> 8) {
1227
                        case PCI_CLASS_BRIDGE_PCI:
1228
                                ht = 1;
1229
                                break;
1230
                        case PCI_CLASS_BRIDGE_CARDBUS:
1231
                                ht = 2;
1232
                                break;
1233
                        default:
1234
                                ht = 0;
1235
                }
1236
                if (ht != (hdr_type & 0x7f)) {
1237
                        printk(KERN_WARNING "PCI: %02x:%02x [%04x/%04x/%06x] has unknown header type %02x, ignoring.\n",
1238
                                bus->number, dev->devfn, dev->vendor, dev->device, dev->class, hdr_type);
1239
                        continue;
1240
                }
1241
 
1242
                /*
1243
                 * Put it into the simple chain of all PCI devices.
1244
                 * It is used to find devices once everything is set up.
1245
                 */
1246
                dev->next = pci_devices;
1247
                pci_devices = dev;
1248
 
1249
                /*
1250
                 * Now insert it into the list of devices held
1251
                 * by the parent bus.
1252
                 */
1253
                dev->sibling = bus->devices;
1254
                bus->devices = dev;
1255
 
1256
                if (dev->class >> 8 == PCI_CLASS_BRIDGE_PCI) {
1257
                        unsigned int buses;
1258
                        unsigned short cr;
1259
 
1260
                        /*
1261
                         * Insert it into the tree of buses.
1262
                         */
1263
                        child = pci_malloc(sizeof(*child), mem_startp);
1264
                        child->next   = bus->children;
1265
                        bus->children = child;
1266
                        child->self = dev;
1267
                        child->parent = bus;
1268
 
1269
                        /*
1270
                         * Set up the primary, secondary and subordinate
1271
                         * bus numbers.
1272
                         */
1273
                        child->number = child->secondary = ++max;
1274
                        child->primary = bus->secondary;
1275
                        child->subordinate = 0xff;
1276
                        /*
1277
                         * Clear all status bits and turn off memory,
1278
                         * I/O and master enables.
1279
                         */
1280
                        pcibios_read_config_word(bus->number, devfn,
1281
                                                  PCI_COMMAND, &cr);
1282
                        pcibios_write_config_word(bus->number, devfn,
1283
                                                  PCI_COMMAND, 0x0000);
1284
                        pcibios_write_config_word(bus->number, devfn,
1285
                                                  PCI_STATUS, 0xffff);
1286
                        /*
1287
                         * Read the existing primary/secondary/subordinate bus
1288
                         * number configuration to determine if the PCI bridge
1289
                         * has already been configured by the system.  If so,
1290
                         * do not modify the configuration, merely note it.
1291
                         */
1292
                        pcibios_read_config_dword(bus->number, devfn, 0x18,
1293
                                                  &buses);
1294
                        if ((buses & 0xFFFFFF) != 0)
1295
                          {
1296
                            child->primary = buses & 0xFF;
1297
                            child->secondary = (buses >> 8) & 0xFF;
1298
                            child->subordinate = (buses >> 16) & 0xFF;
1299
                            child->number = child->secondary;
1300
                            max = scan_bus(child, mem_startp);
1301
                          }
1302
                        else
1303
                          {
1304
                            /*
1305
                             * Configure the bus numbers for this bridge:
1306
                             */
1307
                            buses &= 0xff000000;
1308
                            buses |=
1309
                              (((unsigned int)(child->primary)     <<  0) |
1310
                               ((unsigned int)(child->secondary)   <<  8) |
1311
                               ((unsigned int)(child->subordinate) << 16));
1312
                            pcibios_write_config_dword(bus->number, devfn, 0x18,
1313
                                                       buses);
1314
                            /*
1315
                             * Now we can scan all subordinate buses:
1316
                             */
1317
                            max = scan_bus(child, mem_startp);
1318
                            /*
1319
                             * Set the subordinate bus number to its real
1320
                             * value:
1321
                             */
1322
                            child->subordinate = max;
1323
                            buses = (buses & 0xff00ffff)
1324
                              | ((unsigned int)(child->subordinate) << 16);
1325
                            pcibios_write_config_dword(bus->number, devfn, 0x18,
1326
                                                       buses);
1327
                          }
1328
                        pcibios_write_config_word(bus->number, devfn,
1329
                                                  PCI_COMMAND, cr);
1330
                }
1331
        }
1332
        /*
1333
         * We've scanned the bus and so we know all about what's on
1334
         * the other side of any bridges that may be on this bus plus
1335
         * any devices.
1336
         *
1337
         * Return how far we've got finding sub-buses.
1338
         */
1339
        return max;
1340
}
1341
 
1342
 
1343
unsigned long pci_init (unsigned long mem_start, unsigned long mem_end)
1344
{
1345
        mem_start = pcibios_init(mem_start, mem_end);
1346
 
1347
        if (!pcibios_present()) {
1348
                printk("pci_init: no BIOS32 detected\n");
1349
                return mem_start;
1350
        }
1351
 
1352
        printk("Probing PCI hardware.\n");
1353
 
1354
        memset(&pci_root, 0, sizeof(pci_root));
1355
        pci_root.subordinate = scan_bus(&pci_root, &mem_start);
1356
 
1357
        /* give BIOS a chance to apply platform specific fixes: */
1358
        mem_start = pcibios_fixup(mem_start, mem_end);
1359
 
1360
#ifdef DEBUG
1361
        {
1362
                int len = get_pci_list((char*)mem_start);
1363
                if (len) {
1364
                        ((char *) mem_start)[len] = '\0';
1365
                        printk("%s\n", (char *) mem_start);
1366
                }
1367
        }
1368
#endif
1369
        return mem_start;
1370
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.