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