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