]>
Commit | Line | Data |
---|---|---|
79964ac8 | 1 | /** @file\r |
2 | This file declares Pci Host Bridge Resource Allocation Protocol\r | |
3 | \r | |
4 | Copyright (c) 2007, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | Module Name: PciHostBridgeResourceAllocation.h\r | |
14 | \r | |
15 | @par Revision Reference:\r | |
16 | This protocol is defined in Framework of EFI Pci Host Bridge Resource Allocation Protocol Spec\r | |
17 | Version 0.9\r | |
18 | \r | |
19 | **/\r | |
20 | \r | |
21 | #ifndef _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_\r | |
22 | #define _PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_H_\r | |
23 | \r | |
226b35a9 | 24 | #include <Protocol/PciRootBridgeIo.h>\r |
25 | \r | |
79964ac8 | 26 | #define EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GUID \\r |
27 | { 0xCF8034BE, 0x6768, 0x4d8b, {0xB7,0x39,0x7C,0xCE,0x68,0x3A,0x9F,0xBE }}\r | |
28 | \r | |
29 | \r | |
30 | typedef struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL;\r | |
31 | \r | |
32 | \r | |
33 | //\r | |
34 | // EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES\r | |
35 | //\r | |
36 | \r | |
37 | // If this bit is set, then the PCI Root Bridge does not\r | |
38 | // support separate windows for Non-prefetchable and Prefetchable\r | |
39 | // memory. A PCI bus driver needs to include requests for Prefetchable\r | |
40 | // memory in the Non-prefetchable memory pool.\r | |
41 | //\r | |
42 | #define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM 1\r | |
43 | \r | |
44 | //\r | |
45 | // If this bit is set, then the PCI Root Bridge supports\r | |
46 | // 64 bit memory windows. If this bit is not set,\r | |
47 | // the PCI bus driver needs to include requests for 64 bit\r | |
48 | // memory address in the corresponding 32 bit memory pool.\r | |
49 | //\r | |
50 | #define EFI_PCI_HOST_BRIDGE_MEM64_DECODE 2\r | |
51 | \r | |
52 | \r | |
53 | //\r | |
54 | // EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE\r | |
55 | //\r | |
56 | typedef enum {\r | |
57 | EfiPciHostBridgeBeginEnumeration,\r | |
58 | EfiPciHostBridgeBeginBusAllocation,\r | |
59 | EfiPciHostBridgeEndBusAllocation,\r | |
60 | EfiPciHostBridgeBeginResourceAllocation,\r | |
61 | EfiPciHostBridgeAllocateResources,\r | |
62 | EfiPciHostBridgeSetResources,\r | |
63 | EfiPciHostBridgeFreeResources,\r | |
64 | EfiPciHostBridgeEndResourceAllocation\r | |
65 | } EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;\r | |
66 | \r | |
67 | //\r | |
68 | // EfiPciHostBridgeBeginEnumeration\r | |
69 | // Reset the host bridge PCI apertures and internal data structures.\r | |
70 | // PCI enumerator should issue this notification before starting fresh\r | |
71 | // enumeration process. Enumeration cannot be restarted after sending\r | |
72 | // any other notification such as EfiPciHostBridgeBeginBusAllocation.\r | |
73 | //\r | |
74 | // EfiPciHostBridgeBeginBusAllocation\r | |
75 | // The bus allocation phase is about to begin. No specific action\r | |
76 | // is required here. This notification can be used to perform any\r | |
77 | // chipset specific programming.\r | |
78 | //\r | |
79 | // EfiPciHostBridgeEndBusAllocation\r | |
80 | // The bus allocation and bus programming phase is complete. No specific\r | |
81 | // action is required here. This notification can be used to perform any\r | |
82 | // chipset specific programming.\r | |
83 | //\r | |
84 | // EfiPciHostBridgeBeginResourceAllocation\r | |
85 | // The resource allocation phase is about to begin.No specific action is\r | |
86 | // required here. This notification can be used to perform any chipset specific programming.\r | |
87 | //\r | |
88 | // EfiPciHostBridgeAllocateResources\r | |
89 | // Allocate resources per previously submitted requests for all the PCI Root\r | |
90 | // Bridges. These resource settings are returned on the next call to\r | |
91 | // GetProposedResources().\r | |
92 | //\r | |
93 | // EfiPciHostBridgeSetResources\r | |
94 | // Program the Host Bridge hardware to decode previously allocated resources\r | |
95 | // (proposed resources) for all the PCI Root Bridges.\r | |
96 | //\r | |
97 | // EfiPciHostBridgeFreeResources\r | |
98 | // De-allocate previously allocated resources previously for all the PCI\r | |
99 | // Root Bridges and reset the I/O and memory apertures to initial state.\r | |
100 | //\r | |
101 | // EfiPciHostBridgeEndResourceAllocation\r | |
102 | // The resource allocation phase is completed. No specific action is required\r | |
103 | // here. This notification can be used to perform any chipset specific programming.\r | |
104 | \r | |
105 | \r | |
106 | \r | |
107 | //\r | |
108 | // EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE\r | |
109 | //\r | |
110 | typedef enum {\r | |
111 | EfiPciBeforeChildBusEnumeration,\r | |
112 | EfiPciBeforeResourceCollection\r | |
113 | } EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;\r | |
114 | \r | |
115 | //\r | |
116 | // EfiPciBeforeChildBusEnumeration\r | |
117 | // This notification is only applicable to PCI-PCI bridges and\r | |
118 | // indicates that the PCI enumerator is about to begin enumerating\r | |
119 | // the bus behind the PCI-PCI Bridge. This notification is sent after\r | |
120 | // the primary bus number, the secondary bus number and the subordinate\r | |
121 | // bus number registers in the PCI-PCI Bridge are programmed to valid\r | |
122 | // (not necessary final) values\r | |
123 | //\r | |
124 | // EfiPciBeforeResourceCollection\r | |
125 | // This notification is sent before the PCI enumerator probes BAR registers\r | |
126 | // for every valid PCI function.\r | |
127 | //\r | |
128 | \r | |
129 | \r | |
130 | /**\r | |
131 | Enter a certain phase of the PCI enumeration process\r | |
132 | \r | |
133 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance\r | |
134 | @param Phase The phase during enumeration\r | |
135 | \r | |
136 | @retval EFI_SUCCESS Success\r | |
137 | @retval EFI_OUT_OF_RESOURCES If SubmitResources ( ) could not allocate resources\r | |
138 | @retval EFI_NOT_READY This phase cannot be entered at this time\r | |
139 | @retval EFI_DEVICE_ERROR SetResources failed due to HW error.\r | |
140 | \r | |
141 | **/\r | |
142 | typedef\r | |
143 | EFI_STATUS\r | |
144 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE) (\r | |
145 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
146 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase\r | |
147 | );\r | |
148 | \r | |
149 | \r | |
150 | /**\r | |
151 | Return the device handle of the next PCI root bridge that is associated with\r | |
152 | this Host Bridge\r | |
153 | \r | |
154 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
155 | @param RootBridgeHandle Returns the device handle of the next PCI Root Bridge.\r | |
156 | On input, it holds the RootBridgeHandle returned by the most\r | |
157 | recent call to GetNextRootBridge().The handle for the first\r | |
158 | PCI Root Bridge is returned if RootBridgeHandle is NULL on input\r | |
159 | \r | |
160 | @retval EFI_SUCCESS Success\r | |
161 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
162 | \r | |
163 | **/\r | |
164 | typedef\r | |
165 | EFI_STATUS\r | |
166 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE) (\r | |
167 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
168 | IN OUT EFI_HANDLE *RootBridgeHandle\r | |
169 | );\r | |
170 | \r | |
171 | \r | |
172 | /**\r | |
173 | Returns the attributes of a PCI Root Bridge.\r | |
174 | \r | |
175 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
176 | @param RootBridgeHandle The device handle of the PCI Root Bridge\r | |
177 | that the caller is interested in\r | |
178 | @param Attribute The pointer to attributes of the PCI Root Bridge\r | |
179 | \r | |
180 | @retval EFI_SUCCESS Success\r | |
181 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
182 | @retval EFI_INVALID_PARAMETER Attributes is NULL\r | |
183 | \r | |
184 | **/\r | |
185 | typedef\r | |
186 | EFI_STATUS\r | |
187 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES) (\r | |
188 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
189 | IN EFI_HANDLE RootBridgeHandle,\r | |
190 | OUT UINT64 *Attributes\r | |
191 | );\r | |
192 | \r | |
193 | \r | |
194 | /**\r | |
195 | This is the request from the PCI enumerator to set up\r | |
196 | the specified PCI Root Bridge for bus enumeration process.\r | |
197 | \r | |
198 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
199 | @param RootBridgeHandle The PCI Root Bridge to be set up\r | |
200 | @param Configuration Pointer to the pointer to the PCI bus resource descriptor\r | |
201 | \r | |
202 | @retval EFI_SUCCESS Success\r | |
203 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
204 | @retval EFI_DEVICE_ERROR Request failed due to hardware error\r | |
205 | @retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r | |
206 | \r | |
207 | **/\r | |
208 | typedef\r | |
209 | EFI_STATUS\r | |
210 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION) (\r | |
211 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
212 | IN EFI_HANDLE RootBridgeHandle,\r | |
213 | OUT VOID **Configuration\r | |
214 | );\r | |
215 | \r | |
216 | \r | |
217 | /**\r | |
218 | This function programs the PCI Root Bridge hardware so that\r | |
219 | it decodes the specified PCI bus range\r | |
220 | \r | |
221 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
222 | @param RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed\r | |
223 | @param Configuration The pointer to the PCI bus resource descriptor\r | |
224 | \r | |
225 | @retval EFI_SUCCESS Success\r | |
226 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
227 | @retval EFI_INVALID_PARAMETER Configuration is NULL\r | |
228 | @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r | |
229 | @retval EFI_INVALID_PARAMETER Configuration contains one or more memory or IO ACPI resource descriptor\r | |
230 | @retval EFI_INVALID_PARAMETER Address Range Minimum or Address Range Length fields in Configuration\r | |
231 | are invalid for this Root Bridge.\r | |
232 | @retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptor\r | |
233 | @retval EFI_DEVICE_ERROR Request failed due to hardware error\r | |
234 | @retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r | |
235 | \r | |
236 | **/\r | |
237 | typedef\r | |
238 | EFI_STATUS\r | |
239 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS) (\r | |
240 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
241 | IN EFI_HANDLE RootBridgeHandle,\r | |
242 | IN VOID *Configuration\r | |
243 | );\r | |
244 | \r | |
245 | \r | |
246 | /**\r | |
247 | Submits the I/O and memory resource requirements for the specified PCI Root Bridge\r | |
248 | \r | |
249 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
250 | @param RootBridgeHandle The PCI Root Bridge whose I/O and memory resource requirements\r | |
251 | are being submitted\r | |
252 | @param Configuration The pointer to the PCI I/O and PCI memory resource descriptor\r | |
253 | \r | |
254 | @retval EFI_SUCCESS Success\r | |
255 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
256 | @retval EFI_INVALID_PARAMETER Configuration is NULL\r | |
257 | @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r | |
258 | @retval EFI_INVALID_PARAMETER Configuration includes a resource descriptor of unsupported type\r | |
259 | \r | |
260 | **/\r | |
261 | typedef\r | |
262 | EFI_STATUS\r | |
263 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES) (\r | |
264 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
265 | IN EFI_HANDLE RootBridgeHandle,\r | |
266 | IN VOID *Configuration\r | |
267 | );\r | |
268 | \r | |
269 | \r | |
270 | /**\r | |
271 | This function returns the proposed resource settings for the specified\r | |
272 | PCI Root Bridge\r | |
273 | \r | |
274 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
275 | @param RootBridgeHandle The PCI Root Bridge handle\r | |
276 | @param Configuration The pointer to the pointer to the PCI I/O\r | |
277 | and memory resource descriptor\r | |
278 | \r | |
279 | @retval EFI_SUCCESS Success\r | |
280 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
281 | @retval EFI_DEVICE_ERROR Request failed due to hardware error\r | |
282 | @retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r | |
283 | \r | |
284 | **/\r | |
285 | typedef\r | |
286 | EFI_STATUS\r | |
287 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES) (\r | |
288 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
289 | IN EFI_HANDLE RootBridgeHandle,\r | |
290 | OUT VOID **Configuration\r | |
291 | );\r | |
292 | \r | |
293 | \r | |
294 | \r | |
295 | /**\r | |
296 | This function is called for all the PCI controllers that the PCI\r | |
297 | bus driver finds. Can be used to Preprogram the controller.\r | |
298 | \r | |
299 | @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r | |
300 | @param RootBridgeHandle The PCI Root Bridge handle\r | |
301 | @param PciBusAddress Address of the controller on the PCI bus\r | |
302 | @param Phase The Phase during resource allocation\r | |
303 | \r | |
304 | @retval EFI_SUCCESS Success\r | |
305 | @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r | |
306 | @retval EFI_DEVICE_ERROR Device pre-initialization failed due to hardware error.\r | |
307 | \r | |
308 | **/\r | |
309 | typedef\r | |
310 | EFI_STATUS\r | |
311 | (EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER) (\r | |
312 | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r | |
313 | IN EFI_HANDLE RootBridgeHandle,\r | |
314 | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,\r | |
315 | IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase\r | |
316 | );\r | |
317 | \r | |
318 | /**\r | |
319 | @par Protocol Description:\r | |
320 | Provides the basic interfaces to abstract a PCI host bridge resource allocation.\r | |
321 | \r | |
322 | @param NotifyPhase\r | |
323 | The notification from the PCI bus enumerator that it is about to enter\r | |
324 | a certain phase during the enumeration process.\r | |
325 | \r | |
326 | @param GetNextRootBridge\r | |
327 | Retrieves the device handle for the next PCI root bridge that is produced by the\r | |
328 | host bridge to which this instance of the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is attached.\r | |
329 | \r | |
330 | @param GetAllocAttributes\r | |
331 | Retrieves the allocation-related attributes of a PCI root bridge.\r | |
332 | \r | |
333 | @param StartBusEnumeration\r | |
334 | Sets up a PCI root bridge for bus enumeration.\r | |
335 | \r | |
336 | @param SetBusNumbers\r | |
337 | Sets up the PCI root bridge so that it decodes a specific range of bus numbers.\r | |
338 | \r | |
339 | @param SubmitResources\r | |
340 | Submits the resource requirements for the specified PCI root bridge.\r | |
341 | \r | |
342 | @param GetProposedResources\r | |
343 | Returns the proposed resource assignment for the specified PCI root bridges.\r | |
344 | \r | |
345 | @param PreprocessController\r | |
346 | Provides hooks from the PCI bus driver to every PCI controller\r | |
347 | (device/function) at various stages of the PCI enumeration process that\r | |
348 | allow the host bridge driver to preinitialize individual PCI controllers\r | |
349 | before enumeration.\r | |
350 | \r | |
351 | **/\r | |
352 | struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {\r | |
353 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE NotifyPhase;\r | |
354 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE GetNextRootBridge;\r | |
355 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES GetAllocAttributes;\r | |
356 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION StartBusEnumeration;\r | |
357 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS SetBusNumbers;\r | |
358 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES SubmitResources;\r | |
359 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;\r | |
360 | EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController;\r | |
361 | };\r | |
362 | \r | |
363 | extern EFI_GUID gEfiPciHostBridgeResourceAllocationProtocolGuid;\r | |
364 | \r | |
365 | #endif\r |