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