3 /*----------------------------------------------------------------------------*/
4 /* Plug and Play header definitions */
5 /*----------------------------------------------------------------------------*/
7 /* Structure map for PnP on PowerPC Reference Platform */
8 /* See Plug and Play ISA Specification, Version 1.0, May 28, 1993. It */
9 /* (or later versions) is available on Compuserve in the PLUGPLAY area. */
10 /* This code has extensions to that specification, namely new short and */
11 /* long tag types for platform dependent information */
13 /* Warning: LE notation used throughout this file */
15 /* For enum's: if given in hex then they are bit significant, i.e. */
16 /* only one bit is on for each enum */
22 #define MAX_MEM_REGISTERS 9
23 #define MAX_IO_PORTS 20
25 /*#define MAX_DMA_CHANNELS 7*/
27 /* Interrupt controllers */
29 #define PNPinterrupt0 "PNP0000" /* AT Interrupt Controller */
30 #define PNPinterrupt1 "PNP0001" /* EISA Interrupt Controller */
31 #define PNPinterrupt2 "PNP0002" /* MCA Interrupt Controller */
32 #define PNPinterrupt3 "PNP0003" /* APIC */
33 #define PNPExtInt "IBM000D" /* PowerPC Extended Interrupt Controller */
37 #define PNPtimer0 "PNP0100" /* AT Timer */
38 #define PNPtimer1 "PNP0101" /* EISA Timer */
39 #define PNPtimer2 "PNP0102" /* MCA Timer */
43 #define PNPdma0 "PNP0200" /* AT DMA Controller */
44 #define PNPdma1 "PNP0201" /* EISA DMA Controller */
45 #define PNPdma2 "PNP0202" /* MCA DMA Controller */
47 /* start of August 15, 1994 additions */
49 #define PNPCMOS "IBM0009" /* CMOS */
52 #define PNPL2 "IBM0007" /* L2 Cache */
55 #define PNPNVRAM "IBM0008" /* NVRAM */
57 /* Power Management */
58 #define PNPPM "IBM0005" /* Power Management */
59 /* end of August 15, 1994 additions */
63 #define PNPkeyboard0 "PNP0300" /* IBM PC/XT KB Cntlr (83 key, no mouse) */
64 #define PNPkeyboard1 "PNP0301" /* Olivetti ICO (102 key) */
65 #define PNPkeyboard2 "PNP0302" /* IBM PC/AT KB Cntlr (84 key) */
66 #define PNPkeyboard3 "PNP0303" /* IBM Enhanced (101/2 key, PS/2 mouse) */
67 #define PNPkeyboard4 "PNP0304" /* Nokia 1050 KB Cntlr */
68 #define PNPkeyboard5 "PNP0305" /* Nokia 9140 KB Cntlr */
69 #define PNPkeyboard6 "PNP0306" /* Standard Japanese KB Cntlr */
70 #define PNPkeyboard7 "PNP0307" /* Microsoft Windows (R) KB Cntlr */
72 /* Parallel port controllers */
74 #define PNPparallel0 "PNP0400" /* Standard LPT Parallel Port */
75 #define PNPparallel1 "PNP0401" /* ECP Parallel Port */
76 #define PNPepp "IBM001C" /* EPP Parallel Port */
78 /* Serial port controllers */
80 #define PNPserial0 "PNP0500" /* Standard PC Serial port */
81 #define PNPSerial1 "PNP0501" /* 16550A Compatible Serial port */
83 /* Disk controllers */
85 #define PNPdisk0 "PNP0600" /* Generic ESDI/IDE/ATA Compat HD Cntlr */
86 #define PNPdisk1 "PNP0601" /* Plus Hardcard II */
87 #define PNPdisk2 "PNP0602" /* Plus Hardcard IIXL/EZ */
89 /* Diskette controllers */
91 #define PNPdiskette0 "PNP0700" /* PC Standard Floppy Disk Controller */
93 /* Display controllers */
95 #define PNPdisplay0 "PNP0900" /* VGA Compatible */
96 #define PNPdisplay1 "PNP0901" /* Video Seven VGA */
97 #define PNPdisplay2 "PNP0902" /* 8514/A Compatible */
98 #define PNPdisplay3 "PNP0903" /* Trident VGA */
99 #define PNPdisplay4 "PNP0904" /* Cirrus Logic Laptop VGA */
100 #define PNPdisplay5 "PNP0905" /* Cirrus Logic VGA */
101 #define PNPdisplay6 "PNP0906" /* Tseng ET4000 or ET4000/W32 */
102 #define PNPdisplay7 "PNP0907" /* Western Digital VGA */
103 #define PNPdisplay8 "PNP0908" /* Western Digital Laptop VGA */
104 #define PNPdisplay9 "PNP0909" /* S3 */
105 #define PNPdisplayA "PNP090A" /* ATI Ultra Pro/Plus (Mach 32) */
106 #define PNPdisplayB "PNP090B" /* ATI Ultra (Mach 8) */
107 #define PNPdisplayC "PNP090C" /* XGA Compatible */
108 #define PNPdisplayD "PNP090D" /* ATI VGA Wonder */
109 #define PNPdisplayE "PNP090E" /* Weitek P9000 Graphics Adapter */
110 #define PNPdisplayF "PNP090F" /* Oak Technology VGA */
112 /* Peripheral busses */
114 #define PNPbuses0 "PNP0A00" /* ISA Bus */
115 #define PNPbuses1 "PNP0A01" /* EISA Bus */
116 #define PNPbuses2 "PNP0A02" /* MCA Bus */
117 #define PNPbuses3 "PNP0A03" /* PCI Bus */
118 #define PNPbuses4 "PNP0A04" /* VESA/VL Bus */
120 /* RTC, BIOS, planar devices */
122 #define PNPspeaker0 "PNP0800" /* AT Style Speaker Sound */
123 #define PNPrtc0 "PNP0B00" /* AT RTC */
124 #define PNPpnpbios0 "PNP0C00" /* PNP BIOS (only created by root enum) */
125 #define PNPpnpbios1 "PNP0C01" /* System Board Memory Device */
126 #define PNPpnpbios2 "PNP0C02" /* Math Coprocessor */
127 #define PNPpnpbios3 "PNP0C03" /* PNP BIOS Event Notification Interrupt */
129 /* PCMCIA controller */
131 #define PNPpcmcia0 "PNP0E00" /* Intel 82365 Compatible PCMCIA Cntlr */
135 #define PNPmouse0 "PNP0F00" /* Microsoft Bus Mouse */
136 #define PNPmouse1 "PNP0F01" /* Microsoft Serial Mouse */
137 #define PNPmouse2 "PNP0F02" /* Microsoft Inport Mouse */
138 #define PNPmouse3 "PNP0F03" /* Microsoft PS/2 Mouse */
139 #define PNPmouse4 "PNP0F04" /* Mousesystems Mouse */
140 #define PNPmouse5 "PNP0F05" /* Mousesystems 3 Button Mouse - COM2 */
141 #define PNPmouse6 "PNP0F06" /* Genius Mouse - COM1 */
142 #define PNPmouse7 "PNP0F07" /* Genius Mouse - COM2 */
143 #define PNPmouse8 "PNP0F08" /* Logitech Serial Mouse */
144 #define PNPmouse9 "PNP0F09" /* Microsoft Ballpoint Serial Mouse */
145 #define PNPmouseA "PNP0F0A" /* Microsoft PNP Mouse */
146 #define PNPmouseB "PNP0F0B" /* Microsoft PNP Ballpoint Mouse */
150 #define PNPmodem0 "PNP9000" /* Specific IDs TBD */
152 /* Network controllers */
154 #define PNPnetworkC9 "PNP80C9" /* IBM Token Ring */
155 #define PNPnetworkCA "PNP80CA" /* IBM Token Ring II */
156 #define PNPnetworkCB "PNP80CB" /* IBM Token Ring II/Short */
157 #define PNPnetworkCC "PNP80CC" /* IBM Token Ring 4/16Mbs */
158 #define PNPnetwork27 "PNP8327" /* IBM Token Ring (All types) */
159 #define PNPnetworket "IBM0010" /* IBM Ethernet used by Power PC */
160 #define PNPneteisaet "IBM2001" /* IBM Ethernet EISA adapter */
161 #define PNPAMD79C970 "IBM0016" /* AMD 79C970 (PCI Ethernet) */
163 /* SCSI controllers */
165 #define PNPscsi0 "PNPA000" /* Adaptec 154x Compatible SCSI Cntlr */
166 #define PNPscsi1 "PNPA001" /* Adaptec 174x Compatible SCSI Cntlr */
167 #define PNPscsi2 "PNPA002" /* Future Domain 16-700 Compat SCSI Cntlr*/
168 #define PNPscsi3 "PNPA003" /* Panasonic CDROM Adapter (SBPro/SB16) */
169 #define PNPscsiF "IBM000F" /* NCR 810 SCSI Controller */
170 #define PNPscsi825 "IBM001B" /* NCR 825 SCSI Controller */
171 #define PNPscsi875 "IBM0018" /* NCR 875 SCSI Controller */
173 /* Sound/Video, Multimedia */
175 #define PNPmm0 "PNPB000" /* Sound Blaster Compatible Sound Device */
176 #define PNPmm1 "PNPB001" /* MS Windows Sound System Compat Device */
177 #define PNPmmF "IBM000E" /* Crystal CS4231 Audio Device */
178 #define PNPv7310 "IBM0015" /* ASCII V7310 Video Capture Device */
179 #define PNPmm4232 "IBM0017" /* Crystal CS4232 Audio Device */
180 #define PNPpmsyn "IBM001D" /* YMF 289B chip (Yamaha) */
181 #define PNPgp4232 "IBM0012" /* Crystal CS4232 Game Port */
182 #define PNPmidi4232 "IBM0013" /* Crystal CS4232 MIDI */
185 #define PNPopctl "IBM000B" /* Operator's panel */
187 /* Service Processor */
188 #define PNPsp "IBM0011" /* IBM Service Processor */
189 #define PNPLTsp "IBM001E" /* Lightning/Terlingua Support Processor */
190 #define PNPLTmsp "IBM001F" /* Lightning/Terlingua Mini-SP */
192 /* Memory Controller */
193 #define PNPmemctl "IBM000A" /* Memory controller */
195 /* Graphics Assist */
196 #define PNPg_assist "IBM0014" /* Graphics Assist */
198 /* Miscellaneous Device Controllers */
199 #define PNPtablet "IBM0019" /* IBM Tablet Controller */
201 /* PNP Packet Handles */
203 #define S1_Packet 0x0A /* Version resource */
204 #define S2_Packet 0x15 /* Logical DEVID (without flags) */
205 #define S2_Packet_flags 0x16 /* Logical DEVID (with flags) */
206 #define S3_Packet 0x1C /* Compatible device ID */
207 #define S4_Packet 0x22 /* IRQ resource (without flags) */
208 #define S4_Packet_flags 0x23 /* IRQ resource (with flags) */
209 #define S5_Packet 0x2A /* DMA resource */
210 #define S6_Packet 0x30 /* Depend funct start (w/o priority) */
211 #define S6_Packet_priority 0x31 /* Depend funct start (w/ priority) */
212 #define S7_Packet 0x38 /* Depend funct end */
213 #define S8_Packet 0x47 /* I/O port resource (w/o fixed loc) */
214 #define S9_Packet_fixed 0x4B /* I/O port resource (w/ fixed loc) */
215 #define S14_Packet 0x71 /* Vendor defined */
216 #define S15_Packet 0x78 /* End of resource (w/o checksum) */
217 #define S15_Packet_checksum 0x79 /* End of resource (w/ checksum) */
218 #define L1_Packet 0x81 /* Memory range */
219 #define L1_Shadow 0x20 /* Memory is shadowable */
220 #define L1_32bit_mem 0x18 /* 32-bit memory only */
221 #define L1_8_16bit_mem 0x10 /* 8- and 16-bit supported */
222 #define L1_Decode_Hi 0x04 /* decode supports high address */
223 #define L1_Cache 0x02 /* read cacheable, write-through */
224 #define L1_Writeable 0x01 /* Memory is writeable */
225 #define L2_Packet 0x82 /* ANSI ID string */
226 #define L3_Packet 0x83 /* Unicode ID string */
227 #define L4_Packet 0x84 /* Vendor defined */
228 #define L5_Packet 0x85 /* Large I/O */
229 #define L6_Packet 0x86 /* 32-bit Fixed Loc Mem Range Desc */
230 #define END_TAG 0x78 /* End of resource */
231 #define DF_START_TAG 0x30 /* Dependent function start */
232 #define DF_START_TAG_priority 0x31 /* Dependent function start */
233 #define DF_END_TAG 0x38 /* Dependent function end */
234 #define SUBOPTIMAL_CONFIGURATION 0x2 /* Priority byte sub optimal config */
236 /* Device Base Type Codes */
238 typedef enum _PnP_BASE_TYPE
{
240 MassStorageDevice
= 1,
241 NetworkInterfaceController
= 2,
242 DisplayController
= 3,
243 MultimediaController
= 4,
244 MemoryController
= 5,
245 BridgeController
= 6,
246 CommunicationsDevice
= 7,
247 SystemPeripheral
= 8,
249 ServiceProcessor
= 0x0A, /* 11/2/95 */
252 /* Device Sub Type Codes */
254 typedef enum _PnP_SUB_TYPE
{
257 FloppyController
= 2,
259 OtherMassStorageController
= 0x80,
261 EthernetController
= 0,
262 TokenRingController
= 1,
264 OtherNetworkController
= 0x80,
269 OtherDisplayController
= 0x80,
273 OtherMultimediaController
= 0x80,
277 OtherMemoryDevice
= 0x80,
279 HostProcessorBridge
= 0,
282 MicroChannelBridge
= 3,
286 OtherBridgeDevice
= 0x80,
289 ATCompatibleParallelPort
= 1,
290 OtherCommunicationsDevice
= 0x80,
292 ProgrammableInterruptController
= 0,
301 ServiceProcessorClass1
= 9,
302 ServiceProcessorClass2
= 0xA,
303 ServiceProcessorClass3
= 0xB,
305 SystemPlanar
= 0xF, /* 10/5/95 */
306 OtherSystemPeripheral
= 0x80,
308 KeyboardController
= 0,
311 TabletController
= 3, /* 10/27/95 */
312 OtherInputController
= 0x80,
314 GeneralMemoryController
= 0,
317 /* Device Interface Type Codes */
319 typedef enum _PnP_INTERFACE
{
327 NS398_Floppy
= 2, /* NS Super I/O wired to use index
328 register at port 398 and data
329 register at port 399 */
330 NS26E_Floppy
= 3, /* Ports 26E and 26F */
331 NS15C_Floppy
= 4, /* Ports 15C and 15D */
332 NS2E_Floppy
= 5, /* Ports 2E and 2F */
333 CHRP_Floppy
= 6, /* CHRP Floppy in PR*P system */
347 CS4232Audio
= 1, /* CS 4232 Plug 'n Play Configured */
351 PCIMemoryController
= 0, /* PCI Config Method */
352 RS6KMemoryController
= 1, /* RS6K Config Method */
354 GeneralHostBridge
= 0,
355 GeneralISABridge
= 0,
356 GeneralEISABridge
= 0,
357 GeneralMCABridge
= 0,
358 GeneralPCIBridge
= 0,
360 PCIBridgeIndirect
= 1,
362 GeneralPCMCIABridge
= 0,
363 GeneralVMEBridge
= 0,
369 NS398SerPort
= 4, /* NS Super I/O wired to use index
370 register at port 398 and data
371 register at port 399 */
372 NS26ESerPort
= 5, /* Ports 26E and 26F */
373 NS15CSerPort
= 6, /* Ports 15C and 15D */
374 NS2ESerPort
= 7, /* Ports 2E and 2F */
378 NS398ParPort
= 2, /* NS Super I/O wired to use index
379 register at port 398 and data
380 register at port 399 */
381 NS26EParPort
= 3, /* Ports 26E and 26F */
382 NS15CParPort
= 4, /* Ports 15C and 15D */
383 NS2EParPort
= 5, /* Ports 2E and 2F */
405 IndirectNVRAM
= 0, /* Indirectly addressed */
406 DirectNVRAM
= 1, /* Memory Mapped */
407 IndirectNVRAM24
= 2, /* Indirectly addressed - 24 bit */
409 GeneralPowerManagement
= 0,
410 EPOWPowerManagement
= 1,
411 PowerControl
= 2, // d1378
420 ANDisplay
= 5, /* AlphaNumeric Display */
421 SystemStatusLED
= 6, /* 3 digit 7 segment LED */
422 CHRP_SystemStatusLED
= 7, /* CHRP LEDs in PR*P system */
424 GeneralServiceProcessor
= 0,
430 GeneralSystemPlanar
= 0, /* 10/5/95 */
436 /* Compressed ASCII is 5 bits per char; 00001=A ... 11010=Z */
438 typedef struct _SERIAL_ID
{
439 unsigned char VendorID0
; /* Bit(7)=0 */
440 /* Bits(6:2)=1st character in */
441 /* compressed ASCII */
442 /* Bits(1:0)=2nd character in */
443 /* compressed ASCII bits(4:3) */
444 unsigned char VendorID1
; /* Bits(7:5)=2nd character in */
445 /* compressed ASCII bits(2:0) */
446 /* Bits(4:0)=3rd character in */
447 /* compressed ASCII */
448 unsigned char VendorID2
; /* Product number - vendor assigned */
449 unsigned char VendorID3
; /* Product number - vendor assigned */
451 /* Serial number is to provide uniqueness if more than one board of same */
452 /* type is in system. Must be "FFFFFFFF" if feature not supported. */
454 unsigned char Serial0
; /* Unique serial number bits (7:0) */
455 unsigned char Serial1
; /* Unique serial number bits (15:8) */
456 unsigned char Serial2
; /* Unique serial number bits (23:16) */
457 unsigned char Serial3
; /* Unique serial number bits (31:24) */
458 unsigned char Checksum
;
461 typedef enum _PnPItemName
{
465 CompatibleDevice
= 3,
475 SmallVendorItem
= 14,
479 UnicodeIdentifier
= 3,
482 MemoryRangeFixed32
= 6,
485 /* Define a bunch of access functions for the bits in the tag field */
487 /* Tag type - 0 = small; 1 = large */
488 #define tag_type(t) (((t) & 0x80)>>7)
489 #define set_tag_type(t,v) (t = (t & 0x7f) | ((v)<<7))
491 /* Small item name is 4 bits - one of PnPItemName enum above */
492 #define tag_small_item_name(t) (((t) & 0x78)>>3)
493 #define set_tag_small_item_name(t,v) (t = (t & 0x07) | ((v)<<3))
495 /* Small item count is 3 bits - count of further bytes in packet */
496 #define tag_small_count(t) ((t) & 0x07)
497 #define set_tag_count(t,v) (t = (t & 0x78) | (v))
499 /* Large item name is 7 bits - one of PnPItemName enum above */
500 #define tag_large_item_name(t) ((t) & 0x7f)
501 #define set_tag_large_item_name(t,v) (t = (t | 0x80) | (v))
503 /* a PnP resource is a bunch of contiguous TAG packets ending with an end tag */
505 typedef union _PnP_TAG_PACKET
{
506 struct _S1_Pack
{ /* VERSION PACKET */
507 unsigned char Tag
; /* small tag = 0x0a */
508 unsigned char Version
[2]; /* PnP version, Vendor version */
511 struct _S2_Pack
{ /* LOGICAL DEVICE ID PACKET */
512 unsigned char Tag
; /* small tag = 0x15 or 0x16 */
513 unsigned char DevId
[4]; /* Logical device id */
514 unsigned char Flags
[2]; /* bit(0) boot device; */
515 /* bit(7:1) cmd in range x31-x37 */
516 /* bit(7:0) cmd in range x28-x3f (opt)*/
519 struct _S3_Pack
{ /* COMPATIBLE DEVICE ID PACKET */
520 unsigned char Tag
; /* small tag = 0x1c */
521 unsigned char CompatId
[4]; /* Compatible device id */
524 struct _S4_Pack
{ /* IRQ PACKET */
525 unsigned char Tag
; /* small tag = 0x22 or 0x23 */
526 unsigned char IRQMask
[2]; /* bit(0) is IRQ0, ...; */
527 /* bit(0) is IRQ8 ... */
528 unsigned char IRQInfo
; /* optional; assume bit(0)=1; else */
529 /* bit(0) - high true edge sensitive */
530 /* bit(1) - low true edge sensitive */
531 /* bit(2) - high true level sensitive*/
532 /* bit(3) - low true level sensitive */
533 /* bit(7:4) - must be 0 */
536 struct _S5_Pack
{ /* DMA PACKET */
537 unsigned char Tag
; /* small tag = 0x2a */
538 unsigned char DMAMask
; /* bit(0) is channel 0 ... */
539 unsigned char DMAInfo
;
542 struct _S6_Pack
{ /* START DEPENDENT FUNCTION PACKET */
543 unsigned char Tag
; /* small tag = 0x30 or 0x31 */
544 unsigned char Priority
; /* Optional; if missing then x01; else*/
545 /* x00 = best possible */
546 /* x01 = acceptible */
547 /* x02 = sub-optimal but functional */
550 struct _S7_Pack
{ /* END DEPENDENT FUNCTION PACKET */
551 unsigned char Tag
; /* small tag = 0x38 */
554 struct _S8_Pack
{ /* VARIABLE I/O PORT PACKET */
555 unsigned char Tag
; /* small tag x47 */
556 unsigned char IOInfo
; /* x0 = decode only bits(9:0); */
557 #define ISAAddr16bit 0x01 /* x01 = decode bits(15:0) */
558 unsigned char RangeMin
[2]; /* Min base address */
559 unsigned char RangeMax
[2]; /* Max base address */
560 unsigned char IOAlign
; /* base alignmt, incr in 1B blocks */
561 unsigned char IONum
; /* number of contiguous I/O ports */
564 struct _S9_Pack
{ /* FIXED I/O PORT PACKET */
565 unsigned char Tag
; /* small tag = 0x4b */
566 unsigned char Range
[2]; /* base address 10 bits */
567 unsigned char IONum
; /* number of contiguous I/O ports */
570 struct _S14_Pack
{ /* VENDOR DEFINED PACKET */
571 unsigned char Tag
; /* small tag = 0x7m m = 1-7 */
573 unsigned char Data
[7]; /* Vendor defined */
574 struct _S14_PPCPack
{ /* Pr*p s14 pack */
575 unsigned char Type
; /* 00=non-IBM */
576 unsigned char PPCData
[6]; /* Vendor defined */
581 struct _S15_Pack
{ /* END PACKET */
582 unsigned char Tag
; /* small tag = 0x78 or 0x79 */
583 unsigned char Check
; /* optional - checksum */
586 struct _L1_Pack
{ /* MEMORY RANGE PACKET */
587 unsigned char Tag
; /* large tag = 0x81 */
588 unsigned char Count0
; /* x09 */
589 unsigned char Count1
; /* x00 */
590 unsigned char Data
[9]; /* a variable array of bytes, */
594 struct _L2_Pack
{ /* ANSI ID STRING PACKET */
595 unsigned char Tag
; /* large tag = 0x82 */
596 unsigned char Count0
; /* Length of string */
597 unsigned char Count1
;
598 unsigned char Identifier
[1]; /* a variable array of bytes, */
602 struct _L3_Pack
{ /* UNICODE ID STRING PACKET */
603 unsigned char Tag
; /* large tag = 0x83 */
604 unsigned char Count0
; /* Length + 2 of string */
605 unsigned char Count1
;
606 unsigned char Country0
; /* TBD */
607 unsigned char Country1
; /* TBD */
608 unsigned char Identifier
[1]; /* a variable array of bytes, */
612 struct _L4_Pack
{ /* VENDOR DEFINED PACKET */
613 unsigned char Tag
; /* large tag = 0x84 */
614 unsigned char Count0
;
615 unsigned char Count1
;
617 unsigned char Data
[1]; /* a variable array of bytes, */
619 struct _L4_PPCPack
{ /* Pr*p L4 packet */
620 unsigned char Type
; /* 00=non-IBM */
621 unsigned char PPCData
[1]; /* a variable array of bytes, */
628 unsigned char Tag
; /* large tag = 0x85 */
629 unsigned char Count0
; /* Count = 17 */
630 unsigned char Count1
;
631 unsigned char Data
[17];
635 unsigned char Tag
; /* large tag = 0x86 */
636 unsigned char Count0
; /* Count = 9 */
637 unsigned char Count1
;
638 unsigned char Data
[9];
643 #endif /* __ASSEMBLY__ */
644 #endif /* ndef _PNP_ */
645 #endif /* __KERNEL__ */