Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1029 | serge | 1 | |
2 | |||
3 | int devtype; |
||
4 | int devRev; |
||
5 | int subsysVendor; |
||
6 | int subsysCard; |
||
7 | int bus; |
||
8 | int devfn; |
||
9 | // int func; |
||
10 | int class; |
||
11 | int subclass; |
||
12 | int interface; |
||
13 | memType memBase[6]; |
||
14 | memType ioBase[6]; |
||
15 | int size[6]; |
||
16 | unsigned char type[6]; |
||
17 | memType biosBase; |
||
18 | int biosSize; |
||
19 | // pointer thisCard; |
||
20 | Bool validSize; |
||
21 | // Bool validate; |
||
22 | // CARD32 listed_class; |
||
23 | } pciVideoRec, *pciVideoPtr; |
||
24 | |||
25 | #define PCI_CLASS_DISPLAY_VGA 0x0300 |
||
26 | |||
27 | * Under PCI, each device has 256 bytes of configuration address space, |
||
28 | * of which the first 64 bytes are standardized as follows: |
||
29 | */ |
||
30 | #define PCI_VENDOR_ID 0x000 /* 16 bits */ |
||
31 | #define PCI_DEVICE_ID 0x002 /* 16 bits */ |
||
32 | #define PCI_COMMAND 0x004 /* 16 bits */ |
||
33 | #define PCI_COMMAND_IO 0x001 /* Enable response in I/O space */ |
||
34 | #define PCI_COMMAND_MEMORY 0x002 /* Enable response in Memory space */ |
||
35 | #define PCI_COMMAND_MASTER 0x004 /* Enable bus mastering */ |
||
36 | #define PCI_COMMAND_SPECIAL 0x008 /* Enable response to special cycles */ |
||
37 | #define PCI_COMMAND_INVALIDATE 0x010 /* Use memory write and invalidate */ |
||
38 | #define PCI_COMMAND_VGA_PALETTE 0x020 /* Enable palette snooping */ |
||
39 | #define PCI_COMMAND_PARITY 0x040 /* Enable parity checking */ |
||
40 | #define PCI_COMMAND_WAIT 0x080 /* Enable address/data stepping */ |
||
41 | #define PCI_COMMAND_SERR 0x100 /* Enable SERR */ |
||
42 | #define PCI_COMMAND_FAST_BACK 0x200 /* Enable back-to-back writes */ |
||
43 | #define PCI_COMMAND_INTX_DISABLE 0x400 /* INTx Emulation Disable */ |
||
44 | |||
45 | #define PCI_STATUS 0x006 /* 16 bits */ |
||
46 | |||
47 | #define PCI_STATUS_66MHZ 0x020 /* Support 66 Mhz PCI 2.1 bus */ |
||
48 | #define PCI_STATUS_UDF 0x040 /* Support User Definable Features [obsolete] */ |
||
49 | #define PCI_STATUS_FAST_BACK 0x080 /* Accept fast-back to back */ |
||
50 | #define PCI_STATUS_PARITY 0x100 /* Detected parity error */ |
||
51 | #define PCI_STATUS_DEVSEL_MASK 0x600 /* DEVSEL timing */ |
||
52 | #define PCI_STATUS_DEVSEL_FAST 0x000 |
||
53 | #define PCI_STATUS_DEVSEL_MEDIUM 0x200 |
||
54 | #define PCI_STATUS_DEVSEL_SLOW 0x400 |
||
55 | #define PCI_STATUS_SIG_TARGET_ABORT 0x800 /* Set on target abort */ |
||
56 | #define PCI_STATUS_REC_TARGET_ABORT 0x1000 /* Master ack of " */ |
||
57 | #define PCI_STATUS_REC_MASTER_ABORT 0x2000 /* Set on master abort */ |
||
58 | #define PCI_STATUS_SIG_SYSTEM_ERROR 0x4000 /* Set when we drive SERR */ |
||
59 | #define PCI_STATUS_DETECTED_PARITY 0x8000 /* Set on parity error */ |
||
60 | |||
61 | #define PCI_CLASS_REVISION 0x08 /* High 24 bits are class, low 8 revision */ |
||
62 | |||
63 | #define PCI_CLASS_PROG 0x09 /* Reg. Level Programming Interface */ |
||
64 | #define PCI_CLASS_DEVICE 0x0a /* Device class */ |
||
65 | |||
66 | #define PCI_CACHE_LINE_SIZE 0x0c /* 8 bits */ |
||
67 | |||
68 | #define PCI_HEADER_TYPE 0x0e /* 8 bits */ |
||
69 | #define PCI_HEADER_TYPE_NORMAL 0 |
||
70 | #define PCI_HEADER_TYPE_BRIDGE 1 |
||
71 | #define PCI_HEADER_TYPE_CARDBUS 2 |
||
72 | |||
73 | #define PCI_BIST 0x0f /* 8 bits */ |
||
74 | |||
75 | #define PCI_BIST_START 0x40 /* 1 to start BIST, 2 secs or less */ |
||
76 | #define PCI_BIST_CAPABLE 0x80 /* 1 if BIST capable */ |
||
77 | |||
78 | #define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ |
||
79 | |||
80 | /* Capability lists */ |
||
81 | |||
82 | #define PCI_CAP_LIST_ID 0 /* Capability ID */ |
||
83 | |||
84 | #define PCI_CAP_ID_AGP 0x02 /* Accelerated Graphics Port */ |
||
85 | #define PCI_CAP_ID_VPD 0x03 /* Vital Product Data */ |
||
86 | #define PCI_CAP_ID_SLOTID 0x04 /* Slot Identification */ |
||
87 | #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ |
||
88 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
||
89 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
||
90 | #define PCI_CAP_ID_HT 0x08 /* HyperTransport */ |
||
91 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ |
||
92 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ |
||
93 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
||
94 | #define PCI_CAP_ID_MSIX 0x11 /* MSI-X */ |
||
95 | #define PCI_CAP_LIST_NEXT 1 /* Next capability in the list */ |
||
96 | #define PCI_CAP_FLAGS 2 /* Capability defined flags (16 bits) */ |
||
97 | #define PCI_CAP_SIZEOF 4 |
||
98 | |||
99 | |||
100 | |||
101 | |||
102 | #define PCI_AGP_VERSION 2 /* BCD version number */ |
||
103 | |||
104 | #define PCI_AGP_STATUS 4 /* Status register */ |
||
105 | #define PCI_AGP_STATUS_RQ_MASK 0xff000000 /* Maximum number of requests - 1 */ |
||
106 | #define PCI_AGP_STATUS_SBA 0x0200 /* Sideband addressing supported */ |
||
107 | #define PCI_AGP_STATUS_64BIT 0x0020 /* 64-bit addressing supported */ |
||
108 | #define PCI_AGP_STATUS_FW 0x0010 /* FW transfers supported */ |
||
109 | #define PCI_AGP_STATUS_RATE4 0x0004 /* 4x transfer rate supported */ |
||
110 | #define PCI_AGP_STATUS_RATE2 0x0002 /* 2x transfer rate supported */ |
||
111 | #define PCI_AGP_STATUS_RATE1 0x0001 /* 1x transfer rate supported */ |
||
112 | #define PCI_AGP_COMMAND 8 /* Control register */ |
||
113 | #define PCI_AGP_COMMAND_RQ_MASK 0xff000000 /* Master: Maximum number of requests */ |
||
114 | #define PCI_AGP_COMMAND_SBA 0x0200 /* Sideband addressing enabled */ |
||
115 | #define PCI_AGP_COMMAND_AGP 0x0100 /* Allow processing of AGP transactions */ |
||
116 | #define PCI_AGP_COMMAND_64BIT 0x0020 /* Allow processing of 64-bit addresses */ |
||
117 | #define PCI_AGP_COMMAND_FW 0x0010 /* Force FW transfers */ |
||
118 | #define PCI_AGP_COMMAND_RATE4 0x0004 /* Use 4x rate */ |
||
119 | #define PCI_AGP_COMMAND_RATE2 0x0002 /* Use 2x rate */ |
||
120 | #define PCI_AGP_COMMAND_RATE1 0x0001 /* Use 1x rate */ |
||
121 | #define PCI_AGP_SIZEOF 12 |
||
122 | |||
123 | |||
124 | |||
125 | |||
126 | #define PCI_MAP_ROM_REG 0x30 |
||
127 | |||
128 | #define PCI_MAP_MEMORY 0x00000000 |
||
129 | |||
130 | |||
131 | #define PCI_MAP_MEMORY_TYPE 0x00000007 |
||
132 | |||
133 | |||
134 | #define PCI_MAP_MEMORY_TYPE_32BIT 0x00000000 |
||
135 | |||
136 | #define PCI_MAP_MEMORY_TYPE_64BIT 0x00000004 |
||
137 | #define PCI_MAP_MEMORY_TYPE_MASK 0x00000006 |
||
138 | #define PCI_MAP_MEMORY_CACHABLE 0x00000008 |
||
139 | #define PCI_MAP_MEMORY_ATTR_MASK 0x0000000e |
||
140 | #define PCI_MAP_MEMORY_ADDRESS_MASK 0xfffffff0 |
||
141 | |||
142 | #define PCI_MAP_IO_ATTR_MASK 0x00000003 |
||
143 | |||
144 | #define PCI_MAP_IS_IO(b) ((b) & PCI_MAP_IO) |
||
145 | |||
146 | |||
147 | #define PCI_MAP_IS64BITMEM(b) \ |
||
148 | |||
149 | |||
150 | #define PCIGETMEMORY(b) ((b) & PCI_MAP_MEMORY_ADDRESS_MASK) |
||
151 | |||
152 | #define PCIGETMEMORY64(b) \ |
||
153 | (PCIGETMEMORY(b) | ((CARD64)PCIGETMEMORY64HIGH(b) << 32)) |
||
154 | |||
155 | #define PCI_MAP_IO_ADDRESS_MASK 0xfffffffc |
||
156 | |||
157 | #define PCIGETIO(b) ((b) & PCI_MAP_IO_ADDRESS_MASK) |
||
158 | |||
159 | #define PCI_MAP_ROM_DECODE_ENABLE 0x00000001 |
||
160 | |||
161 | |||
162 | #define PCIGETROM(b) ((b) & PCI_MAP_ROM_ADDRESS_MASK) |
||
163 | |||
164 | int pciGetBaseSize(int bus, int devfn, int index, Bool destructive, Bool *min); |
||
165 | |||
166 | |||
167 | |||
168 | |||
169 | |||
170 | |||
171 | #endif |
||
172 | #define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu) |
||
173 | |||
174 | #define PCI_MAKE_TAG(b,d,f) ((((b) & (PCI_DOMBUS_MASK)) << 16) | \ |
||
175 | |||
176 | (((f) & 0x000007u) << 8)) |
||
177 | |||
178 | #define PCI_BUS_FROM_TAG(tag) (((tag) >> 16) & (PCI_DOMBUS_MASK)) |
||
179 | |||
180 | #define PCI_FUNC_FROM_TAG(tag) (((tag) & 0x00000700u) >> 8) |
||
181 | #define PCI_DFN_FROM_TAG(tag) (((tag) & 0x0000ff00u) >> 8) |
||
182 | |||
183 | |||
184 | |||
185 | |||
186 | |||
187 | |||
188 | |||
189 | extern inline PCITAG |
||
190 | |||
191 | { |
||
192 | return(PCI_MAKE_TAG(busnum,devnum,funcnum)); |
||
193 | }><>><>><>><>><> |
||
194 |