]>
Commit | Line | Data |
---|---|---|
4a50cf4e RN |
1 | /** @file\r |
2 | \r | |
3 | The PCI Root Bridge header file.\r | |
4 | \r | |
5 | Copyright (c) 1999 - 2016, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _PCI_ROOT_BRIDGE_H_\r | |
17 | #define _PCI_ROOT_BRIDGE_H_\r | |
18 | \r | |
19 | #include <PiDxe.h>\r | |
20 | #include <IndustryStandard/Acpi.h>\r | |
21 | #include <IndustryStandard/Pci.h>\r | |
22 | \r | |
23 | //\r | |
24 | // Driver Consumed Protocol Prototypes\r | |
25 | //\r | |
26 | #include <Protocol/Metronome.h>\r | |
27 | #include <Protocol/CpuIo2.h>\r | |
28 | #include <Protocol/DevicePath.h>\r | |
29 | #include <Protocol/PciRootBridgeIo.h>\r | |
30 | #include <Library/DebugLib.h>\r | |
31 | #include <Library/DevicePathLib.h>\r | |
32 | #include <Library/BaseMemoryLib.h>\r | |
33 | #include <Library/DxeServicesTableLib.h>\r | |
34 | #include <Library/UefiBootServicesTableLib.h>\r | |
35 | #include <Library/BaseLib.h>\r | |
36 | #include <Library/PciSegmentLib.h>\r | |
37 | #include "PciHostResource.h"\r | |
38 | \r | |
39 | \r | |
40 | typedef enum {\r | |
41 | IoOperation,\r | |
42 | MemOperation,\r | |
43 | PciOperation\r | |
44 | } OPERATION_TYPE;\r | |
45 | \r | |
46 | #define MAP_INFO_SIGNATURE SIGNATURE_32 ('_', 'm', 'a', 'p')\r | |
47 | typedef struct {\r | |
48 | UINT32 Signature;\r | |
49 | LIST_ENTRY Link;\r | |
50 | EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation;\r | |
51 | UINTN NumberOfBytes;\r | |
52 | UINTN NumberOfPages;\r | |
53 | EFI_PHYSICAL_ADDRESS HostAddress;\r | |
54 | EFI_PHYSICAL_ADDRESS MappedHostAddress;\r | |
55 | } MAP_INFO;\r | |
56 | #define MAP_INFO_FROM_LINK(a) CR (a, MAP_INFO, Link, MAP_INFO_SIGNATURE)\r | |
57 | \r | |
58 | #define PCI_ROOT_BRIDGE_SIGNATURE SIGNATURE_32 ('_', 'p', 'r', 'b')\r | |
59 | \r | |
60 | typedef struct {\r | |
61 | UINT32 Signature;\r | |
62 | LIST_ENTRY Link;\r | |
63 | EFI_HANDLE Handle;\r | |
64 | UINT64 AllocationAttributes;\r | |
65 | UINT64 Attributes;\r | |
66 | UINT64 Supports;\r | |
67 | PCI_RES_NODE ResAllocNode[TypeMax];\r | |
68 | PCI_ROOT_BRIDGE_APERTURE Bus;\r | |
69 | PCI_ROOT_BRIDGE_APERTURE Io;\r | |
70 | PCI_ROOT_BRIDGE_APERTURE Mem;\r | |
71 | PCI_ROOT_BRIDGE_APERTURE PMem;\r | |
72 | PCI_ROOT_BRIDGE_APERTURE MemAbove4G;\r | |
73 | PCI_ROOT_BRIDGE_APERTURE PMemAbove4G;\r | |
74 | BOOLEAN DmaAbove4G;\r | |
014b4720 | 75 | BOOLEAN NoExtendedConfigSpace;\r |
4a50cf4e RN |
76 | VOID *ConfigBuffer;\r |
77 | EFI_DEVICE_PATH_PROTOCOL *DevicePath;\r | |
78 | CHAR16 *DevicePathStr;\r | |
79 | EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL RootBridgeIo;\r | |
80 | \r | |
81 | BOOLEAN ResourceSubmitted;\r | |
82 | LIST_ENTRY Maps;\r | |
83 | } PCI_ROOT_BRIDGE_INSTANCE;\r | |
84 | \r | |
85 | #define ROOT_BRIDGE_FROM_THIS(a) CR (a, PCI_ROOT_BRIDGE_INSTANCE, RootBridgeIo, PCI_ROOT_BRIDGE_SIGNATURE)\r | |
86 | \r | |
87 | #define ROOT_BRIDGE_FROM_LINK(a) CR (a, PCI_ROOT_BRIDGE_INSTANCE, Link, PCI_ROOT_BRIDGE_SIGNATURE)\r | |
88 | \r | |
89 | /**\r | |
63b90643 | 90 | Construct the Pci Root Bridge instance.\r |
4a50cf4e | 91 | \r |
63b90643 | 92 | @param Bridge The root bridge instance.\r |
4a50cf4e | 93 | \r |
63b90643 RN |
94 | @return The pointer to PCI_ROOT_BRIDGE_INSTANCE just created\r |
95 | or NULL if creation fails.\r | |
4a50cf4e RN |
96 | **/\r |
97 | PCI_ROOT_BRIDGE_INSTANCE *\r | |
98 | CreateRootBridge (\r | |
401f8cd1 | 99 | IN PCI_ROOT_BRIDGE *Bridge\r |
4a50cf4e RN |
100 | );\r |
101 | \r | |
102 | //\r | |
103 | // Protocol Member Function Prototypes\r | |
104 | //\r | |
105 | /**\r | |
106 | \r | |
107 | Poll an address in memory mapped space until an exit condition is met\r | |
108 | or a timeout occurs.\r | |
109 | \r | |
110 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
111 | @param Width - Width of the memory operation.\r | |
112 | @param Address - The base address of the memory operation.\r | |
113 | @param Mask - Mask used for polling criteria.\r | |
114 | @param Value - Comparison value used for polling exit criteria.\r | |
115 | @param Delay - Number of 100ns units to poll.\r | |
116 | @param Result - Pointer to the last value read from memory location.\r | |
117 | \r | |
118 | @retval EFI_SUCCESS - Success.\r | |
119 | @retval EFI_INVALID_PARAMETER - Invalid parameter found.\r | |
120 | @retval EFI_TIMEOUT - Delay expired before a match occurred.\r | |
121 | @retval EFI_OUT_OF_RESOURCES - Fail due to lack of resources.\r | |
122 | \r | |
123 | **/\r | |
124 | EFI_STATUS\r | |
125 | EFIAPI\r | |
126 | RootBridgeIoPollMem (\r | |
127 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
128 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
129 | IN UINT64 Address,\r | |
130 | IN UINT64 Mask,\r | |
131 | IN UINT64 Value,\r | |
132 | IN UINT64 Delay,\r | |
133 | OUT UINT64 *Result\r | |
134 | )\r | |
135 | ;\r | |
136 | \r | |
137 | /**\r | |
138 | \r | |
139 | Poll an address in I/O space until an exit condition is met\r | |
140 | or a timeout occurs.\r | |
141 | \r | |
142 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
143 | @param Width - Width of I/O operation.\r | |
144 | @param Address - The base address of the I/O operation.\r | |
145 | @param Mask - Mask used for polling criteria.\r | |
146 | @param Value - Comparison value used for polling exit criteria.\r | |
147 | @param Delay - Number of 100ns units to poll.\r | |
148 | @param Result - Pointer to the last value read from memory location.\r | |
149 | \r | |
150 | @retval EFI_SUCCESS - Success.\r | |
151 | @retval EFI_INVALID_PARAMETER - Invalid parameter found.\r | |
152 | @retval EFI_TIMEOUT - Delay expired before a match occurred.\r | |
153 | @retval EFI_OUT_OF_RESOURCES - Fail due to lack of resources.\r | |
154 | \r | |
155 | **/\r | |
156 | EFI_STATUS\r | |
157 | EFIAPI\r | |
158 | RootBridgeIoPollIo (\r | |
159 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
160 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
161 | IN UINT64 Address,\r | |
162 | IN UINT64 Mask,\r | |
163 | IN UINT64 Value,\r | |
164 | IN UINT64 Delay,\r | |
165 | OUT UINT64 *Result\r | |
166 | )\r | |
167 | ;\r | |
168 | \r | |
169 | /**\r | |
170 | \r | |
171 | Allow read from memory mapped I/O space.\r | |
172 | \r | |
173 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
174 | @param Width - The width of memory operation.\r | |
175 | @param Address - Base address of the memory operation.\r | |
176 | @param Count - Number of memory opeartion to perform.\r | |
177 | @param Buffer - The destination buffer to store data.\r | |
178 | \r | |
179 | @retval EFI_SUCCESS - Success.\r | |
180 | @retval EFI_INVALID_PARAMETER - Invalid parameter found.\r | |
181 | @retval EFI_OUT_OF_RESOURCES - Fail due to lack of resources.\r | |
182 | \r | |
183 | **/\r | |
184 | EFI_STATUS\r | |
185 | EFIAPI\r | |
186 | RootBridgeIoMemRead (\r | |
187 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
188 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
189 | IN UINT64 Address,\r | |
190 | IN UINTN Count,\r | |
191 | IN OUT VOID *Buffer\r | |
192 | )\r | |
193 | ;\r | |
194 | \r | |
195 | /**\r | |
196 | \r | |
197 | Allow write to memory mapped I/O space.\r | |
198 | \r | |
199 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
200 | @param Width - The width of memory operation.\r | |
201 | @param Address - Base address of the memory operation.\r | |
202 | @param Count - Number of memory opeartion to perform.\r | |
203 | @param Buffer - The source buffer to write data from.\r | |
204 | \r | |
205 | @retval EFI_SUCCESS - Success.\r | |
206 | @retval EFI_INVALID_PARAMETER - Invalid parameter found.\r | |
207 | @retval EFI_OUT_OF_RESOURCES - Fail due to lack of resources.\r | |
208 | \r | |
209 | **/\r | |
210 | EFI_STATUS\r | |
211 | EFIAPI\r | |
212 | RootBridgeIoMemWrite (\r | |
213 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
214 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
215 | IN UINT64 Address,\r | |
216 | IN UINTN Count,\r | |
217 | IN OUT VOID *Buffer\r | |
218 | )\r | |
219 | ;\r | |
220 | \r | |
221 | /**\r | |
222 | \r | |
223 | Enable a PCI driver to read PCI controller registers in the\r | |
224 | PCI root bridge I/O space.\r | |
225 | \r | |
226 | @param This - A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r | |
227 | @param Width - Signifies the width of the memory operation.\r | |
228 | @param UserAddress - The base address of the I/O operation.\r | |
229 | @param Count - The number of I/O operations to perform.\r | |
230 | @param UserBuffer - The destination buffer to store the results.\r | |
231 | \r | |
232 | @retval EFI_SUCCESS - The data was read from the PCI root bridge.\r | |
233 | @retval EFI_INVALID_PARAMETER - Invalid parameters found.\r | |
234 | @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of\r | |
235 | @retval resources.\r | |
236 | **/\r | |
237 | EFI_STATUS\r | |
238 | EFIAPI\r | |
239 | RootBridgeIoIoRead (\r | |
240 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
241 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
242 | IN UINT64 UserAddress,\r | |
243 | IN UINTN Count,\r | |
244 | IN OUT VOID *UserBuffer\r | |
245 | )\r | |
246 | ;\r | |
247 | \r | |
248 | /**\r | |
249 | \r | |
250 | Enable a PCI driver to write to PCI controller registers in the\r | |
251 | PCI root bridge I/O space.\r | |
252 | \r | |
253 | @param This - A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r | |
254 | @param Width - Signifies the width of the memory operation.\r | |
255 | @param UserAddress - The base address of the I/O operation.\r | |
256 | @param Count - The number of I/O operations to perform.\r | |
257 | @param UserBuffer - The source buffer to write data from.\r | |
258 | \r | |
259 | @retval EFI_SUCCESS - The data was written to the PCI root bridge.\r | |
260 | @retval EFI_INVALID_PARAMETER - Invalid parameters found.\r | |
261 | @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of\r | |
262 | @retval resources.\r | |
263 | **/\r | |
264 | EFI_STATUS\r | |
265 | EFIAPI\r | |
266 | RootBridgeIoIoWrite (\r | |
267 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
268 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
269 | IN UINT64 UserAddress,\r | |
270 | IN UINTN Count,\r | |
271 | IN OUT VOID *UserBuffer\r | |
272 | )\r | |
273 | ;\r | |
274 | \r | |
275 | /**\r | |
276 | \r | |
277 | Copy one region of PCI root bridge memory space to be copied to\r | |
278 | another region of PCI root bridge memory space.\r | |
279 | \r | |
280 | @param This - A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
281 | @param Width - Signifies the width of the memory operation.\r | |
282 | @param DestAddress - Destination address of the memory operation.\r | |
283 | @param SrcAddress - Source address of the memory operation.\r | |
284 | @param Count - Number of memory operations to perform.\r | |
285 | \r | |
286 | @retval EFI_SUCCESS - The data was copied successfully.\r | |
287 | @retval EFI_INVALID_PARAMETER - Invalid parameters found.\r | |
288 | @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of\r | |
289 | @retval resources.\r | |
290 | **/\r | |
291 | EFI_STATUS\r | |
292 | EFIAPI\r | |
293 | RootBridgeIoCopyMem (\r | |
294 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
295 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
296 | IN UINT64 DestAddress,\r | |
297 | IN UINT64 SrcAddress,\r | |
298 | IN UINTN Count\r | |
299 | )\r | |
300 | ;\r | |
301 | \r | |
302 | /**\r | |
303 | \r | |
304 | Allows read from PCI configuration space.\r | |
305 | \r | |
306 | @param This - A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r | |
307 | @param Width - Signifies the width of the memory operation.\r | |
308 | @param Address - The address within the PCI configuration space\r | |
309 | for the PCI controller.\r | |
310 | @param Count - The number of PCI configuration operations\r | |
311 | to perform.\r | |
312 | @param Buffer - The destination buffer to store the results.\r | |
313 | \r | |
314 | @retval EFI_SUCCESS - The data was read from the PCI root bridge.\r | |
315 | @retval EFI_INVALID_PARAMETER - Invalid parameters found.\r | |
316 | @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of\r | |
317 | @retval resources.\r | |
318 | **/\r | |
319 | EFI_STATUS\r | |
320 | EFIAPI\r | |
321 | RootBridgeIoPciRead (\r | |
322 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
323 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
324 | IN UINT64 Address,\r | |
325 | IN UINTN Count,\r | |
326 | IN OUT VOID *Buffer\r | |
327 | )\r | |
328 | ;\r | |
329 | \r | |
330 | /**\r | |
331 | \r | |
332 | Allows write to PCI configuration space.\r | |
333 | \r | |
334 | @param This - A pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r | |
335 | @param Width - Signifies the width of the memory operation.\r | |
336 | @param Address - The address within the PCI configuration space\r | |
337 | for the PCI controller.\r | |
338 | @param Count - The number of PCI configuration operations\r | |
339 | to perform.\r | |
340 | @param Buffer - The source buffer to get the results.\r | |
341 | \r | |
342 | @retval EFI_SUCCESS - The data was written to the PCI root bridge.\r | |
343 | @retval EFI_INVALID_PARAMETER - Invalid parameters found.\r | |
344 | @retval EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of\r | |
345 | @retval resources.\r | |
346 | **/\r | |
347 | EFI_STATUS\r | |
348 | EFIAPI\r | |
349 | RootBridgeIoPciWrite (\r | |
350 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
351 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,\r | |
352 | IN UINT64 Address,\r | |
353 | IN UINTN Count,\r | |
354 | IN OUT VOID *Buffer\r | |
355 | )\r | |
356 | ;\r | |
357 | \r | |
358 | /**\r | |
4a50cf4e RN |
359 | Provides the PCI controller-specific address needed to access\r |
360 | system memory for DMA.\r | |
361 | \r | |
63b90643 RN |
362 | @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r |
363 | @param Operation Indicate if the bus master is going to read or write\r | |
364 | to system memory.\r | |
365 | @param HostAddress The system memory address to map on the PCI controller.\r | |
366 | @param NumberOfBytes On input the number of bytes to map.\r | |
367 | On output the number of bytes that were mapped.\r | |
368 | @param DeviceAddress The resulting map address for the bus master PCI\r | |
369 | controller to use to access the system memory's HostAddress.\r | |
370 | @param Mapping The value to pass to Unmap() when the bus master DMA\r | |
371 | operation is complete.\r | |
372 | \r | |
373 | @retval EFI_SUCCESS Success.\r | |
374 | @retval EFI_INVALID_PARAMETER Invalid parameters found.\r | |
375 | @retval EFI_UNSUPPORTED The HostAddress cannot be mapped as a common buffer.\r | |
376 | @retval EFI_DEVICE_ERROR The System hardware could not map the requested address.\r | |
377 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to lack of resources.\r | |
4a50cf4e RN |
378 | **/\r |
379 | EFI_STATUS\r | |
380 | EFIAPI\r | |
381 | RootBridgeIoMap (\r | |
382 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
383 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation,\r | |
384 | IN VOID *HostAddress,\r | |
385 | IN OUT UINTN *NumberOfBytes,\r | |
386 | OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,\r | |
387 | OUT VOID **Mapping\r | |
388 | )\r | |
389 | ;\r | |
390 | \r | |
391 | /**\r | |
4a50cf4e RN |
392 | Completes the Map() operation and releases any corresponding resources.\r |
393 | \r | |
63b90643 RN |
394 | The Unmap() function completes the Map() operation and releases any\r |
395 | corresponding resources.\r | |
396 | If the operation was an EfiPciOperationBusMasterWrite or\r | |
397 | EfiPciOperationBusMasterWrite64, the data is committed to the target system\r | |
398 | memory.\r | |
399 | Any resources used for the mapping are freed.\r | |
4a50cf4e | 400 | \r |
63b90643 RN |
401 | @param[in] This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r |
402 | @param[in] Mapping The mapping value returned from Map().\r | |
4a50cf4e | 403 | \r |
63b90643 RN |
404 | @retval EFI_SUCCESS The range was unmapped.\r |
405 | @retval EFI_INVALID_PARAMETER Mapping is not a value that was returned by Map().\r | |
406 | @retval EFI_DEVICE_ERROR The data was not committed to the target system memory.\r | |
4a50cf4e RN |
407 | **/\r |
408 | EFI_STATUS\r | |
409 | EFIAPI\r | |
410 | RootBridgeIoUnmap (\r | |
411 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
412 | IN VOID *Mapping\r | |
413 | )\r | |
414 | ;\r | |
415 | \r | |
416 | /**\r | |
63b90643 RN |
417 | Allocates pages that are suitable for an EfiPciOperationBusMasterCommonBuffer\r |
418 | or EfiPciOperationBusMasterCommonBuffer64 mapping.\r | |
419 | \r | |
420 | @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r | |
421 | @param Type This parameter is not used and must be ignored.\r | |
422 | @param MemoryType The type of memory to allocate, EfiBootServicesData or\r | |
423 | EfiRuntimeServicesData.\r | |
424 | @param Pages The number of pages to allocate.\r | |
425 | @param HostAddress A pointer to store the base system memory address of the\r | |
426 | allocated range.\r | |
427 | @param Attributes The requested bit mask of attributes for the allocated\r | |
428 | range. Only the attributes\r | |
429 | EFI_PCI_ATTRIBUTE_MEMORY_WRITE_COMBINE,\r | |
430 | EFI_PCI_ATTRIBUTE_MEMORY_CACHED, and\r | |
431 | EFI_PCI_ATTRIBUTE_DUAL_ADDRESS_CYCLE may be used with this\r | |
432 | function.\r | |
433 | \r | |
434 | @retval EFI_SUCCESS The requested memory pages were allocated.\r | |
435 | @retval EFI_INVALID_PARAMETER MemoryType is invalid.\r | |
436 | @retval EFI_INVALID_PARAMETER HostAddress is NULL.\r | |
437 | @retval EFI_UNSUPPORTED Attributes is unsupported. The only legal\r | |
438 | attribute bits are MEMORY_WRITE_COMBINE,\r | |
439 | MEMORY_CACHED, and DUAL_ADDRESS_CYCLE.\r | |
440 | @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.\r | |
4a50cf4e RN |
441 | **/\r |
442 | EFI_STATUS\r | |
443 | EFIAPI\r | |
444 | RootBridgeIoAllocateBuffer (\r | |
445 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
446 | IN EFI_ALLOCATE_TYPE Type,\r | |
447 | IN EFI_MEMORY_TYPE MemoryType,\r | |
448 | IN UINTN Pages,\r | |
449 | OUT VOID **HostAddress,\r | |
450 | IN UINT64 Attributes\r | |
451 | )\r | |
452 | ;\r | |
453 | \r | |
454 | /**\r | |
455 | \r | |
456 | Free memory allocated in AllocateBuffer.\r | |
457 | \r | |
458 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL\r | |
459 | instance.\r | |
460 | @param Pages - Number of pages to free.\r | |
461 | @param HostAddress - The base system memory address of the\r | |
462 | allocated range.\r | |
463 | \r | |
464 | @retval EFI_SUCCESS - Requested memory pages were freed.\r | |
465 | @retval EFI_INVALID_PARAMETER - Invalid parameter found.\r | |
466 | \r | |
467 | **/\r | |
468 | EFI_STATUS\r | |
469 | EFIAPI\r | |
470 | RootBridgeIoFreeBuffer (\r | |
471 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
472 | IN UINTN Pages,\r | |
473 | OUT VOID *HostAddress\r | |
474 | )\r | |
475 | ;\r | |
476 | \r | |
477 | /**\r | |
478 | \r | |
479 | Flushes all PCI posted write transactions from a PCI host\r | |
480 | bridge to system memory.\r | |
481 | \r | |
482 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
483 | \r | |
484 | @retval EFI_SUCCESS - PCI posted write transactions were flushed\r | |
485 | @retval from PCI host bridge to system memory.\r | |
486 | @retval EFI_DEVICE_ERROR - Fail due to hardware error.\r | |
487 | \r | |
488 | **/\r | |
489 | EFI_STATUS\r | |
490 | EFIAPI\r | |
491 | RootBridgeIoFlush (\r | |
492 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This\r | |
493 | )\r | |
494 | ;\r | |
495 | \r | |
496 | /**\r | |
63b90643 RN |
497 | Gets the attributes that a PCI root bridge supports setting with\r |
498 | SetAttributes(), and the attributes that a PCI root bridge is currently\r | |
499 | using.\r | |
500 | \r | |
501 | The GetAttributes() function returns the mask of attributes that this PCI\r | |
502 | root bridge supports and the mask of attributes that the PCI root bridge is\r | |
503 | currently using.\r | |
504 | \r | |
505 | @param This A pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.\r | |
506 | @param Supported A pointer to the mask of attributes that this PCI root\r | |
507 | bridge supports setting with SetAttributes().\r | |
508 | @param Attributes A pointer to the mask of attributes that this PCI root\r | |
509 | bridge is currently using.\r | |
510 | \r | |
511 | @retval EFI_SUCCESS If Supports is not NULL, then the attributes\r | |
512 | that the PCI root bridge supports is returned\r | |
513 | in Supports. If Attributes is not NULL, then\r | |
514 | the attributes that the PCI root bridge is\r | |
515 | currently using is returned in Attributes.\r | |
516 | @retval EFI_INVALID_PARAMETER Both Supports and Attributes are NULL.\r | |
4a50cf4e RN |
517 | **/\r |
518 | EFI_STATUS\r | |
519 | EFIAPI\r | |
520 | RootBridgeIoGetAttributes (\r | |
521 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
522 | OUT UINT64 *Supported,\r | |
523 | OUT UINT64 *Attributes\r | |
524 | )\r | |
525 | ;\r | |
526 | \r | |
527 | /**\r | |
528 | \r | |
529 | Sets the attributes for a resource range on a PCI root bridge.\r | |
530 | \r | |
531 | @param This - Pointer to EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
532 | @param Attributes - The mask of attributes to set.\r | |
533 | @param ResourceBase - Pointer to the base address of the resource range\r | |
534 | to be modified by the attributes specified by Attributes.\r | |
535 | @param ResourceLength - Pointer to the length of the resource range to be modified.\r | |
536 | \r | |
537 | @retval EFI_SUCCESS - Success.\r | |
538 | @retval EFI_INVALID_PARAMETER - Invalid parameter found.\r | |
539 | @retval EFI_OUT_OF_RESOURCES - Not enough resources to set the attributes upon.\r | |
540 | \r | |
541 | **/\r | |
542 | EFI_STATUS\r | |
543 | EFIAPI\r | |
544 | RootBridgeIoSetAttributes (\r | |
545 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
546 | IN UINT64 Attributes,\r | |
547 | IN OUT UINT64 *ResourceBase,\r | |
548 | IN OUT UINT64 *ResourceLength\r | |
549 | )\r | |
550 | ;\r | |
551 | \r | |
552 | /**\r | |
553 | \r | |
554 | Retrieves the current resource settings of this PCI root bridge\r | |
555 | in the form of a set of ACPI 2.0 resource descriptor.\r | |
556 | \r | |
557 | @param This - Pointer to the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL instance.\r | |
558 | @param Resources - Pointer to the ACPI 2.0 resource descriptor that\r | |
559 | describe the current configuration of this PCI root\r | |
560 | bridge.\r | |
561 | \r | |
562 | @retval EFI_SUCCESS - Success.\r | |
563 | @retval EFI_UNSUPPORTED - Current configuration of the PCI root bridge\r | |
564 | @retval could not be retrieved.\r | |
565 | \r | |
566 | **/\r | |
567 | EFI_STATUS\r | |
568 | EFIAPI\r | |
569 | RootBridgeIoConfiguration (\r | |
570 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This,\r | |
571 | OUT VOID **Resources\r | |
572 | )\r | |
573 | ;\r | |
574 | \r | |
575 | \r | |
576 | extern EFI_METRONOME_ARCH_PROTOCOL *mMetronome;\r | |
577 | extern EFI_CPU_IO2_PROTOCOL *mCpuIo;\r | |
578 | #endif\r |