]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/PciHostBridgeResourceAllocation.h
add some definitions about HII
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / PciHostBridgeResourceAllocation.h
CommitLineData
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
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
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
43#define EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM 1\r
44\r
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
51#define EFI_PCI_HOST_BRIDGE_MEM64_DECODE 2\r
52\r
53\r
54//\r
55// EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE\r
56//\r
57typedef enum {\r
58 EfiPciHostBridgeBeginEnumeration,\r
59 EfiPciHostBridgeBeginBusAllocation,\r
60 EfiPciHostBridgeEndBusAllocation,\r
61 EfiPciHostBridgeBeginResourceAllocation,\r
62 EfiPciHostBridgeAllocateResources,\r
63 EfiPciHostBridgeSetResources,\r
64 EfiPciHostBridgeFreeResources,\r
65 EfiPciHostBridgeEndResourceAllocation\r
66} EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE;\r
67\r
68//\r
69// EfiPciHostBridgeBeginEnumeration\r
70// Reset the host bridge PCI apertures and internal data structures.\r
71// PCI enumerator should issue this notification before starting fresh\r
72// enumeration process. Enumeration cannot be restarted after sending\r
73// any other notification such as EfiPciHostBridgeBeginBusAllocation.\r
74//\r
75// EfiPciHostBridgeBeginBusAllocation\r
76// The bus allocation phase is about to begin. No specific action\r
77// is required here. This notification can be used to perform any\r
78// chipset specific programming.\r
79//\r
80// EfiPciHostBridgeEndBusAllocation\r
81// The bus allocation and bus programming phase is complete. No specific\r
82// action is required here. This notification can be used to perform any\r
83// chipset specific programming.\r
84//\r
85// EfiPciHostBridgeBeginResourceAllocation\r
86// The resource allocation phase is about to begin.No specific action is\r
87// required here. This notification can be used to perform any chipset specific programming.\r
88//\r
89// EfiPciHostBridgeAllocateResources\r
90// Allocate resources per previously submitted requests for all the PCI Root\r
91// Bridges. These resource settings are returned on the next call to\r
92// GetProposedResources().\r
93//\r
94// EfiPciHostBridgeSetResources\r
95// Program the Host Bridge hardware to decode previously allocated resources\r
96// (proposed resources) for all the PCI Root Bridges.\r
97//\r
98// EfiPciHostBridgeFreeResources\r
99// De-allocate previously allocated resources previously for all the PCI\r
100// Root Bridges and reset the I/O and memory apertures to initial state.\r
101//\r
102// EfiPciHostBridgeEndResourceAllocation\r
103// The resource allocation phase is completed. No specific action is required\r
104// here. This notification can be used to perform any chipset specific programming.\r
105\r
106\r
107\r
108//\r
109// EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE\r
110//\r
111typedef enum {\r
112 EfiPciBeforeChildBusEnumeration,\r
113 EfiPciBeforeResourceCollection\r
114} EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE;\r
115\r
116//\r
117// EfiPciBeforeChildBusEnumeration\r
118// This notification is only applicable to PCI-PCI bridges and\r
119// indicates that the PCI enumerator is about to begin enumerating\r
120// the bus behind the PCI-PCI Bridge. This notification is sent after\r
121// the primary bus number, the secondary bus number and the subordinate\r
122// bus number registers in the PCI-PCI Bridge are programmed to valid\r
123// (not necessary final) values\r
124//\r
125// EfiPciBeforeResourceCollection\r
126// This notification is sent before the PCI enumerator probes BAR registers\r
127// for every valid PCI function.\r
128//\r
129\r
130\r
131/**\r
132 Enter a certain phase of the PCI enumeration process\r
133\r
134 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance\r
135 @param Phase The phase during enumeration\r
136\r
137 @retval EFI_SUCCESS Success\r
138 @retval EFI_OUT_OF_RESOURCES If SubmitResources ( ) could not allocate resources\r
139 @retval EFI_NOT_READY This phase cannot be entered at this time\r
140 @retval EFI_DEVICE_ERROR SetResources failed due to HW error.\r
141\r
142**/\r
143typedef\r
144EFI_STATUS\r
145(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE) (\r
146 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
147 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase\r
148 );\r
149\r
150\r
151/**\r
152 Return the device handle of the next PCI root bridge that is associated with\r
153 this Host Bridge\r
154\r
155 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
156 @param RootBridgeHandle Returns the device handle of the next PCI Root Bridge.\r
157 On input, it holds the RootBridgeHandle returned by the most\r
158 recent call to GetNextRootBridge().The handle for the first\r
159 PCI Root Bridge is returned if RootBridgeHandle is NULL on input\r
160\r
161 @retval EFI_SUCCESS Success\r
162 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
163\r
164**/\r
165typedef\r
166EFI_STATUS\r
167(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE) (\r
168 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
169 IN OUT EFI_HANDLE *RootBridgeHandle\r
170 );\r
171\r
172\r
173/**\r
174 Returns the attributes of a PCI Root Bridge.\r
175\r
176 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
177 @param RootBridgeHandle The device handle of the PCI Root Bridge\r
178 that the caller is interested in\r
179 @param Attribute The pointer to attributes of the PCI Root Bridge\r
180\r
181 @retval EFI_SUCCESS Success\r
182 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
183 @retval EFI_INVALID_PARAMETER Attributes is NULL\r
184\r
185**/\r
186typedef\r
187EFI_STATUS\r
188(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES) (\r
189 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
190 IN EFI_HANDLE RootBridgeHandle,\r
191 OUT UINT64 *Attributes\r
192 );\r
193\r
194\r
195/**\r
196 This is the request from the PCI enumerator to set up\r
197 the specified PCI Root Bridge for bus enumeration process.\r
198\r
199 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
200 @param RootBridgeHandle The PCI Root Bridge to be set up\r
201 @param Configuration Pointer to the pointer to the PCI bus resource descriptor\r
202\r
203 @retval EFI_SUCCESS Success\r
204 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
205 @retval EFI_DEVICE_ERROR Request failed due to hardware error\r
206 @retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r
207\r
208**/\r
209typedef\r
210EFI_STATUS\r
211(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION) (\r
212 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
213 IN EFI_HANDLE RootBridgeHandle,\r
214 OUT VOID **Configuration\r
215 );\r
216\r
217\r
218/**\r
219 This function programs the PCI Root Bridge hardware so that\r
220 it decodes the specified PCI bus range\r
221\r
222 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
223 @param RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed\r
224 @param Configuration The pointer to the PCI bus resource descriptor\r
225\r
226 @retval EFI_SUCCESS Success\r
227 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
228 @retval EFI_INVALID_PARAMETER Configuration is NULL\r
229 @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r
230 @retval EFI_INVALID_PARAMETER Configuration contains one or more memory or IO ACPI resource descriptor\r
231 @retval EFI_INVALID_PARAMETER Address Range Minimum or Address Range Length fields in Configuration\r
232 are invalid for this Root Bridge.\r
233 @retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptor\r
234 @retval EFI_DEVICE_ERROR Request failed due to hardware error\r
235 @retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r
236\r
237**/\r
238typedef\r
239EFI_STATUS\r
240(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS) (\r
241 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
242 IN EFI_HANDLE RootBridgeHandle,\r
243 IN VOID *Configuration\r
244 );\r
245\r
246\r
247/**\r
248 Submits the I/O and memory resource requirements for the specified PCI Root Bridge\r
249\r
250 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
251 @param RootBridgeHandle The PCI Root Bridge whose I/O and memory resource requirements\r
252 are being submitted\r
253 @param Configuration The pointer to the PCI I/O and PCI memory resource descriptor\r
254\r
255 @retval EFI_SUCCESS Success\r
256 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
257 @retval EFI_INVALID_PARAMETER Configuration is NULL\r
258 @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI resource descriptor\r
259 @retval EFI_INVALID_PARAMETER Configuration includes a resource descriptor of unsupported type\r
260\r
261**/\r
262typedef\r
263EFI_STATUS\r
264(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES) (\r
265 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
266 IN EFI_HANDLE RootBridgeHandle,\r
267 IN VOID *Configuration\r
268 );\r
269\r
270\r
271/**\r
272 This function returns the proposed resource settings for the specified\r
273 PCI Root Bridge\r
274\r
275 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
276 @param RootBridgeHandle The PCI Root Bridge handle\r
277 @param Configuration The pointer to the pointer to the PCI I/O\r
278 and memory resource descriptor\r
279\r
280 @retval EFI_SUCCESS Success\r
281 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
282 @retval EFI_DEVICE_ERROR Request failed due to hardware error\r
283 @retval EFI_OUT_OF_RESOURCES Request failed due to lack of resources\r
284\r
285**/\r
286typedef\r
287EFI_STATUS\r
288(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES) (\r
289 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
290 IN EFI_HANDLE RootBridgeHandle,\r
291 OUT VOID **Configuration\r
292 );\r
293\r
294\r
295\r
296/**\r
297 This function is called for all the PCI controllers that the PCI\r
298 bus driver finds. Can be used to Preprogram the controller.\r
299\r
300 @param This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance\r
301 @param RootBridgeHandle The PCI Root Bridge handle\r
302 @param PciBusAddress Address of the controller on the PCI bus\r
303 @param Phase The Phase during resource allocation\r
304\r
305 @retval EFI_SUCCESS Success\r
306 @retval EFI_INVALID_PARAMETER RootBridgeHandle is invalid\r
307 @retval EFI_DEVICE_ERROR Device pre-initialization failed due to hardware error.\r
308\r
309**/\r
310typedef\r
311EFI_STATUS\r
312(EFIAPI *EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER) (\r
313 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL *This,\r
314 IN EFI_HANDLE RootBridgeHandle,\r
315 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress,\r
316 IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase\r
317 );\r
318\r
319/**\r
320 @par Protocol Description:\r
321 Provides the basic interfaces to abstract a PCI host bridge resource allocation.\r
322\r
323 @param NotifyPhase\r
324 The notification from the PCI bus enumerator that it is about to enter\r
325 a certain phase during the enumeration process.\r
326\r
327 @param GetNextRootBridge\r
328 Retrieves the device handle for the next PCI root bridge that is produced by the\r
329 host bridge to which this instance of the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is attached.\r
330\r
331 @param GetAllocAttributes\r
332 Retrieves the allocation-related attributes of a PCI root bridge.\r
333\r
334 @param StartBusEnumeration\r
335 Sets up a PCI root bridge for bus enumeration.\r
336\r
337 @param SetBusNumbers\r
338 Sets up the PCI root bridge so that it decodes a specific range of bus numbers.\r
339\r
340 @param SubmitResources\r
341 Submits the resource requirements for the specified PCI root bridge.\r
342\r
343 @param GetProposedResources\r
344 Returns the proposed resource assignment for the specified PCI root bridges.\r
345\r
346 @param PreprocessController\r
347 Provides hooks from the PCI bus driver to every PCI controller\r
348 (device/function) at various stages of the PCI enumeration process that\r
349 allow the host bridge driver to preinitialize individual PCI controllers\r
350 before enumeration.\r
351\r
352**/\r
353struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL {\r
354 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_NOTIFY_PHASE NotifyPhase;\r
355 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_NEXT_ROOT_BRIDGE GetNextRootBridge;\r
356 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_ATTRIBUTES GetAllocAttributes;\r
357 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_START_BUS_ENUMERATION StartBusEnumeration;\r
358 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SET_BUS_NUMBERS SetBusNumbers;\r
359 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_SUBMIT_RESOURCES SubmitResources;\r
360 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_GET_PROPOSED_RESOURCES GetProposedResources;\r
361 EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL_PREPROCESS_CONTROLLER PreprocessController;\r
362};\r
363\r
364extern EFI_GUID gEfiPciHostBridgeResourceAllocationProtocolGuid;\r
365\r
366#endif\r