2 Provides the basic interfaces to abstract a PCI Host Bridge Resource Allocation
4 Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved. <BR>
5 This program and the accompanying materials are
6 licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #include "PciHostBridge.h"
18 // Support 64 K IO space
20 #define RES_IO_BASE 0x1000
21 #define RES_IO_LIMIT 0xFFFF
23 // Support 4G address space
25 #define RES_MEM_BASE_1 0xF8000000
26 #define RES_MEM_LIMIT_1 (0xFEC00000 - 1)
29 // Hard code: Root Bridge Number within the host bridge
30 // Root Bridge's attribute
31 // Root Bridge's device path
32 // Root Bridge's resource appeture
34 UINTN RootBridgeNumber
[1] = { 1 };
36 UINT64 RootBridgeAttribute
[1][1] = { EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM
};
38 EFI_PCI_ROOT_BRIDGE_DEVICE_PATH mEfiPciRootBridgeDevicePath
[1][1] = {
42 (UINT8
) (sizeof(ACPI_HID_DEVICE_PATH
)),
43 (UINT8
) ((sizeof(ACPI_HID_DEVICE_PATH
)) >> 8),
47 END_ENTIRE_DEVICE_PATH_SUBTYPE
,
48 END_DEVICE_PATH_LENGTH
,
53 PCI_ROOT_BRIDGE_RESOURCE_APPETURE mResAppeture
[1][1] = {
54 {0, 0, 0, 0xffffffff, 0, 1 << 16}
57 EFI_HANDLE mDriverImageHandle
;
59 PCI_HOST_BRIDGE_INSTANCE mPciHostBridgeInstanceTemplate
= {
60 PCI_HOST_BRIDGE_SIGNATURE
, // Signature
61 NULL
, // HostBridgeHandle
62 0, // RootBridgeNumber
64 FALSE
, // ResourceSubiteed
82 Entry point of this driver
84 @param ImageHandle Handle of driver image
85 @param SystemTable Point to EFI_SYSTEM_TABLE
87 @retval EFI_OUT_OF_RESOURCES Can not allocate memory resource
88 @retval EFI_DEVICE_ERROR Can not install the protocol instance
89 @retval EFI_SUCCESS Success to initialize the Pci host bridge.
93 InitializePciHostBridge (
94 IN EFI_HANDLE ImageHandle
,
95 IN EFI_SYSTEM_TABLE
*SystemTable
101 PCI_HOST_BRIDGE_INSTANCE
*HostBridge
;
102 PCI_ROOT_BRIDGE_INSTANCE
*PrivateData
;
103 IN EFI_PHYSICAL_ADDRESS BaseAddress
;
106 mDriverImageHandle
= ImageHandle
;
109 // Create Host Bridge Device Handle
111 for (Loop1
= 0; Loop1
< HOST_BRIDGE_NUMBER
; Loop1
++) {
112 HostBridge
= AllocateCopyPool (sizeof(PCI_HOST_BRIDGE_INSTANCE
), &mPciHostBridgeInstanceTemplate
);
113 if (HostBridge
== NULL
) {
114 return EFI_OUT_OF_RESOURCES
;
117 HostBridge
->RootBridgeNumber
= RootBridgeNumber
[Loop1
];
118 InitializeListHead (&HostBridge
->Head
);
120 Status
= gBS
->InstallMultipleProtocolInterfaces (
121 &HostBridge
->HostBridgeHandle
,
122 &gEfiPciHostBridgeResourceAllocationProtocolGuid
, &HostBridge
->ResAlloc
,
125 if (EFI_ERROR (Status
)) {
126 FreePool (HostBridge
);
127 return EFI_DEVICE_ERROR
;
131 // Create Root Bridge Device Handle in this Host Bridge
134 for (Loop2
= 0; Loop2
< HostBridge
->RootBridgeNumber
; Loop2
++) {
135 PrivateData
= AllocateZeroPool (sizeof(PCI_ROOT_BRIDGE_INSTANCE
));
136 if (PrivateData
== NULL
) {
137 return EFI_OUT_OF_RESOURCES
;
140 PrivateData
->Signature
= PCI_ROOT_BRIDGE_SIGNATURE
;
141 PrivateData
->DevicePath
= (EFI_DEVICE_PATH_PROTOCOL
*)&mEfiPciRootBridgeDevicePath
[Loop1
][Loop2
];
143 RootBridgeConstructor (
145 HostBridge
->HostBridgeHandle
,
146 RootBridgeAttribute
[Loop1
][Loop2
],
147 &mResAppeture
[Loop1
][Loop2
]
150 Status
= gBS
->InstallMultipleProtocolInterfaces(
151 &PrivateData
->Handle
,
152 &gEfiDevicePathProtocolGuid
, PrivateData
->DevicePath
,
153 &gEfiPciRootBridgeIoProtocolGuid
, &PrivateData
->Io
,
156 if (EFI_ERROR (Status
)) {
157 FreePool(PrivateData
);
158 return EFI_DEVICE_ERROR
;
161 InsertTailList (&HostBridge
->Head
, &PrivateData
->Link
);
165 Status
= gDS
->AddIoSpace (
168 RES_IO_LIMIT
- RES_IO_BASE
+ 1
171 // PCI memory space from 3.75Gbytes->(4GBytes - BIOSFWH local APIC etc)
172 Status
= gDS
->AddMemorySpace (
173 EfiGcdMemoryTypeMemoryMappedIo
,
175 (RES_MEM_LIMIT_1
- RES_MEM_BASE_1
+ 1),
179 BaseAddress
= 0x80000000;
180 Length
= RES_MEM_BASE_1
- BaseAddress
;
181 Status
= gDS
->AddMemorySpace (
182 EfiGcdMemoryTypeMemoryMappedIo
,
193 These are the notifications from the PCI bus driver that it is about to enter a certain
194 phase of the PCI enumeration process.
196 This member function can be used to notify the host bridge driver to perform specific actions,
197 including any chipset-specific initialization, so that the chipset is ready to enter the next phase.
198 Eight notification points are defined at this time. See belows:
199 EfiPciHostBridgeBeginEnumeration Resets the host bridge PCI apertures and internal data
200 structures. The PCI enumerator should issue this notification
201 before starting a fresh enumeration process. Enumeration cannot
202 be restarted after sending any other notification such as
203 EfiPciHostBridgeBeginBusAllocation.
204 EfiPciHostBridgeBeginBusAllocation The bus allocation phase is about to begin. No specific action is
205 required here. This notification can be used to perform any
206 chipset-specific programming.
207 EfiPciHostBridgeEndBusAllocation The bus allocation and bus programming phase is complete. No
208 specific action is required here. This notification can be used to
209 perform any chipset-specific programming.
210 EfiPciHostBridgeBeginResourceAllocation
211 The resource allocation phase is about to begin. No specific
212 action is required here. This notification can be used to perform
213 any chipset-specific programming.
214 EfiPciHostBridgeAllocateResources Allocates resources per previously submitted requests for all the PCI
215 root bridges. These resource settings are returned on the next call to
216 GetProposedResources(). Before calling NotifyPhase() with a Phase of
217 EfiPciHostBridgeAllocateResource, the PCI bus enumerator is responsible
218 for gathering I/O and memory requests for
219 all the PCI root bridges and submitting these requests using
220 SubmitResources(). This function pads the resource amount
221 to suit the root bridge hardware, takes care of dependencies between
222 the PCI root bridges, and calls the Global Coherency Domain (GCD)
223 with the allocation request. In the case of padding, the allocated range
224 could be bigger than what was requested.
225 EfiPciHostBridgeSetResources Programs the host bridge hardware to decode previously allocated
226 resources (proposed resources) for all the PCI root bridges. After the
227 hardware is programmed, reassigning resources will not be supported.
228 The bus settings are not affected.
229 EfiPciHostBridgeFreeResources Deallocates resources that were previously allocated for all the PCI
230 root bridges and resets the I/O and memory apertures to their initial
231 state. The bus settings are not affected. If the request to allocate
232 resources fails, the PCI enumerator can use this notification to
233 deallocate previous resources, adjust the requests, and retry
235 EfiPciHostBridgeEndResourceAllocation The resource allocation phase is completed. No specific action is
236 required here. This notification can be used to perform any chipsetspecific
239 @param[in] PciResAlloc The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
240 @param[in] Phase The phase during enumeration
242 @retval EFI_NOT_READY This phase cannot be entered at this time. For example, this error
243 is valid for a Phase of EfiPciHostBridgeAllocateResources if
244 SubmitResources() has not been called for one or more
245 PCI root bridges before this call
246 @retval EFI_DEVICE_ERROR Programming failed due to a hardware error. This error is valid
247 for a Phase of EfiPciHostBridgeSetResources.
248 @retval EFI_INVALID_PARAMETER Invalid phase parameter
249 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
250 This error is valid for a Phase of EfiPciHostBridgeAllocateResources if the
251 previously submitted resource requests cannot be fulfilled or
252 were only partially fulfilled.
253 @retval EFI_SUCCESS The notification was accepted without any errors.
259 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
260 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase
263 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
264 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
265 PCI_RESOURCE_TYPE Index
;
267 EFI_PHYSICAL_ADDRESS BaseAddress
;
269 UINTN BitsOfAlignment
;
271 EFI_STATUS ReturnStatus
;
273 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
277 case EfiPciHostBridgeBeginEnumeration
:
278 if (HostBridgeInstance
->CanRestarted
) {
280 // Reset the Each Root Bridge
282 List
= HostBridgeInstance
->Head
.ForwardLink
;
284 while (List
!= &HostBridgeInstance
->Head
) {
285 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
286 for (Index
= TypeIo
; Index
< TypeMax
; Index
++) {
287 RootBridgeInstance
->ResAllocNode
[Index
].Type
= Index
;
288 RootBridgeInstance
->ResAllocNode
[Index
].Base
= 0;
289 RootBridgeInstance
->ResAllocNode
[Index
].Length
= 0;
290 RootBridgeInstance
->ResAllocNode
[Index
].Status
= ResNone
;
293 List
= List
->ForwardLink
;
296 HostBridgeInstance
->ResourceSubmited
= FALSE
;
297 HostBridgeInstance
->CanRestarted
= TRUE
;
302 return EFI_NOT_READY
;
306 case EfiPciHostBridgeBeginBusAllocation
:
308 // No specific action is required here, can perform any chipset specific programing
310 HostBridgeInstance
->CanRestarted
= FALSE
;
314 case EfiPciHostBridgeEndBusAllocation
:
316 // No specific action is required here, can perform any chipset specific programing
318 //HostBridgeInstance->CanRestarted = FALSE;
322 case EfiPciHostBridgeBeginResourceAllocation
:
324 // No specific action is required here, can perform any chipset specific programing
326 //HostBridgeInstance->CanRestarted = FALSE;
330 case EfiPciHostBridgeAllocateResources
:
331 ReturnStatus
= EFI_SUCCESS
;
332 if (HostBridgeInstance
->ResourceSubmited
) {
334 // Take care of the resource dependencies between the root bridges
336 List
= HostBridgeInstance
->Head
.ForwardLink
;
338 while (List
!= &HostBridgeInstance
->Head
) {
339 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
340 for (Index
= TypeIo
; Index
< TypeBus
; Index
++) {
341 if (RootBridgeInstance
->ResAllocNode
[Index
].Status
!= ResNone
) {
343 AddrLen
= RootBridgeInstance
->ResAllocNode
[Index
].Length
;
346 // Get the number of '1' in Alignment.
348 BitsOfAlignment
= HighBitSet64 (RootBridgeInstance
->ResAllocNode
[Index
].Alignment
) + 1;
354 // It is impossible for this chipset to align 0xFFFF for IO16
357 if (BitsOfAlignment
>= 16) {
361 Status
= gDS
->AllocateIoSpace (
362 EfiGcdAllocateAnySearchBottomUp
,
371 if (!EFI_ERROR (Status
)) {
372 RootBridgeInstance
->ResAllocNode
[Index
].Base
= (UINTN
)BaseAddress
;
373 RootBridgeInstance
->ResAllocNode
[Index
].Status
= ResAllocated
;
375 ReturnStatus
= Status
;
376 if (Status
!= EFI_OUT_OF_RESOURCES
) {
377 RootBridgeInstance
->ResAllocNode
[Index
].Length
= 0;
386 // It is impossible for this chipset to align 0xFFFFFFFF for Mem32
390 if (BitsOfAlignment
>= 32) {
394 Status
= gDS
->AllocateMemorySpace (
395 EfiGcdAllocateAnySearchBottomUp
,
396 EfiGcdMemoryTypeMemoryMappedIo
,
404 if (!EFI_ERROR (Status
)) {
405 // We were able to allocate the PCI memory
406 RootBridgeInstance
->ResAllocNode
[Index
].Base
= (UINTN
)BaseAddress
;
407 RootBridgeInstance
->ResAllocNode
[Index
].Status
= ResAllocated
;
410 // Not able to allocate enough PCI memory
411 ReturnStatus
= Status
;
413 if (Status
!= EFI_OUT_OF_RESOURCES
) {
414 RootBridgeInstance
->ResAllocNode
[Index
].Length
= 0;
423 ReturnStatus
= EFI_ABORTED
;
432 List
= List
->ForwardLink
;
438 return EFI_NOT_READY
;
442 case EfiPciHostBridgeSetResources
:
445 case EfiPciHostBridgeFreeResources
:
446 ReturnStatus
= EFI_SUCCESS
;
447 List
= HostBridgeInstance
->Head
.ForwardLink
;
448 while (List
!= &HostBridgeInstance
->Head
) {
449 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
450 for (Index
= TypeIo
; Index
< TypeBus
; Index
++) {
451 if (RootBridgeInstance
->ResAllocNode
[Index
].Status
== ResAllocated
) {
452 AddrLen
= RootBridgeInstance
->ResAllocNode
[Index
].Length
;
453 BaseAddress
= RootBridgeInstance
->ResAllocNode
[Index
].Base
;
457 Status
= gDS
->FreeIoSpace (BaseAddress
, AddrLen
);
458 if (EFI_ERROR (Status
)) {
459 ReturnStatus
= Status
;
464 Status
= gDS
->FreeMemorySpace (BaseAddress
, AddrLen
);
465 if (EFI_ERROR (Status
)) {
466 ReturnStatus
= Status
;
484 RootBridgeInstance
->ResAllocNode
[Index
].Type
= Index
;
485 RootBridgeInstance
->ResAllocNode
[Index
].Base
= 0;
486 RootBridgeInstance
->ResAllocNode
[Index
].Length
= 0;
487 RootBridgeInstance
->ResAllocNode
[Index
].Status
= ResNone
;
491 List
= List
->ForwardLink
;
494 HostBridgeInstance
->ResourceSubmited
= FALSE
;
495 HostBridgeInstance
->CanRestarted
= TRUE
;
499 case EfiPciHostBridgeEndResourceAllocation
:
500 HostBridgeInstance
->CanRestarted
= FALSE
;
504 return EFI_INVALID_PARAMETER
;
511 Return the device handle of the next PCI root bridge that is associated with this Host Bridge.
513 This function is called multiple times to retrieve the device handles of all the PCI root bridges that
514 are associated with this PCI host bridge. Each PCI host bridge is associated with one or more PCI
515 root bridges. On each call, the handle that was returned by the previous call is passed into the
516 interface, and on output the interface returns the device handle of the next PCI root bridge. The
517 caller can use the handle to obtain the instance of the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL
518 for that root bridge. When there are no more PCI root bridges to report, the interface returns
519 EFI_NOT_FOUND. A PCI enumerator must enumerate the PCI root bridges in the order that they
520 are returned by this function.
521 For D945 implementation, there is only one root bridge in PCI host bridge.
523 @param[in] This The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
524 @param[in][out] RootBridgeHandle Returns the device handle of the next PCI root bridge.
526 @retval EFI_SUCCESS If parameter RootBridgeHandle = NULL, then return the first Rootbridge handle of the
527 specific Host bridge and return EFI_SUCCESS.
528 @retval EFI_NOT_FOUND Can not find the any more root bridge in specific host bridge.
529 @retval EFI_INVALID_PARAMETER RootBridgeHandle is not an EFI_HANDLE that was
530 returned on a previous call to GetNextRootBridge().
535 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
536 IN OUT EFI_HANDLE
*RootBridgeHandle
539 BOOLEAN NoRootBridge
;
541 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
542 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
545 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
546 List
= HostBridgeInstance
->Head
.ForwardLink
;
549 while (List
!= &HostBridgeInstance
->Head
) {
550 NoRootBridge
= FALSE
;
551 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
552 if (*RootBridgeHandle
== NULL
) {
554 // Return the first Root Bridge Handle of the Host Bridge
556 *RootBridgeHandle
= RootBridgeInstance
->Handle
;
559 if (*RootBridgeHandle
== RootBridgeInstance
->Handle
) {
563 List
= List
->ForwardLink
;
564 if (List
!=&HostBridgeInstance
->Head
) {
565 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
566 *RootBridgeHandle
= RootBridgeInstance
->Handle
;
569 return EFI_NOT_FOUND
;
574 List
= List
->ForwardLink
;
578 return EFI_NOT_FOUND
;
580 return EFI_INVALID_PARAMETER
;
585 Returns the allocation attributes of a PCI root bridge.
587 The function returns the allocation attributes of a specific PCI root bridge. The attributes can vary
588 from one PCI root bridge to another. These attributes are different from the decode-related
589 attributes that are returned by the EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL.GetAttributes() member function. The
590 RootBridgeHandle parameter is used to specify the instance of the PCI root bridge. The device
591 handles of all the root bridges that are associated with this host bridge must be obtained by calling
592 GetNextRootBridge(). The attributes are static in the sense that they do not change during or
593 after the enumeration process. The hardware may provide mechanisms to change the attributes on
594 the fly, but such changes must be completed before EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL is
595 installed. The permitted values of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ATTRIBUTES are defined in
596 "Related Definitions" below. The caller uses these attributes to combine multiple resource requests.
597 For example, if the flag EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM is set, the PCI bus enumerator needs to
598 include requests for the prefetchable memory in the nonprefetchable memory pool and not request any
600 Attribute Description
601 ------------------------------------ ----------------------------------------------------------------------
602 EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM If this bit is set, then the PCI root bridge does not support separate
603 windows for nonprefetchable and prefetchable memory. A PCI bus
604 driver needs to include requests for prefetchable memory in the
605 nonprefetchable memory pool.
607 EFI_PCI_HOST_BRIDGE_MEM64_DECODE If this bit is set, then the PCI root bridge supports 64-bit memory
608 windows. If this bit is not set, the PCI bus driver needs to include
609 requests for a 64-bit memory address in the corresponding 32-bit
612 @param[in] This The instance pointer of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
613 @param[in] RootBridgeHandle The device handle of the PCI root bridge in which the caller is interested. Type
614 EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
615 @param[out] Attributes The pointer to attribte of root bridge, it is output parameter
617 @retval EFI_INVALID_PARAMETER Attribute pointer is NULL
618 @retval EFI_INVALID_PARAMETER RootBridgehandle is invalid.
619 @retval EFI_SUCCESS Success to get attribute of interested root bridge.
625 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
626 IN EFI_HANDLE RootBridgeHandle
,
627 OUT UINT64
*Attributes
631 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
632 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
634 if (Attributes
== NULL
) {
635 return EFI_INVALID_PARAMETER
;
638 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
639 List
= HostBridgeInstance
->Head
.ForwardLink
;
641 while (List
!= &HostBridgeInstance
->Head
) {
642 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
643 if (RootBridgeHandle
== RootBridgeInstance
->Handle
) {
644 *Attributes
= RootBridgeInstance
->RootBridgeAttrib
;
647 List
= List
->ForwardLink
;
651 // RootBridgeHandle is not an EFI_HANDLE
652 // that was returned on a previous call to GetNextRootBridge()
654 return EFI_INVALID_PARAMETER
;
658 Sets up the specified PCI root bridge for the bus enumeration process.
660 This member function sets up the root bridge for bus enumeration and returns the PCI bus range
661 over which the search should be performed in ACPI 2.0 resource descriptor format.
663 @param[in] This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance.
664 @param[in] RootBridgeHandle The PCI Root Bridge to be set up.
665 @param[out] Configuration Pointer to the pointer to the PCI bus resource descriptor.
667 @retval EFI_INVALID_PARAMETER Invalid Root bridge's handle
668 @retval EFI_OUT_OF_RESOURCES Fail to allocate ACPI resource descriptor tag.
669 @retval EFI_SUCCESS Sucess to allocate ACPI resource descriptor.
675 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
676 IN EFI_HANDLE RootBridgeHandle
,
677 OUT VOID
**Configuration
681 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
682 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
688 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
689 List
= HostBridgeInstance
->Head
.ForwardLink
;
691 while (List
!= &HostBridgeInstance
->Head
) {
692 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
693 if (RootBridgeHandle
== RootBridgeInstance
->Handle
) {
695 // Set up the Root Bridge for Bus Enumeration
697 BusStart
= RootBridgeInstance
->BusBase
;
698 BusEnd
= RootBridgeInstance
->BusLimit
;
700 // Program the Hardware(if needed) if error return EFI_DEVICE_ERROR
703 Buffer
= AllocatePool (sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
) + sizeof(EFI_ACPI_END_TAG_DESCRIPTOR
));
704 if (Buffer
== NULL
) {
705 return EFI_OUT_OF_RESOURCES
;
708 Temp
= (UINT8
*)Buffer
;
710 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->Desc
= 0x8A;
711 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->Len
= 0x2B;
712 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->ResType
= 2;
713 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->GenFlag
= 0;
714 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->SpecificFlag
= 0;
715 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->AddrSpaceGranularity
= 0;
716 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->AddrRangeMin
= BusStart
;
717 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->AddrRangeMax
= 0;
718 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->AddrTranslationOffset
= 0;
719 ((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Temp
)->AddrLen
= BusEnd
- BusStart
+ 1;
721 Temp
= Temp
+ sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
);
722 ((EFI_ACPI_END_TAG_DESCRIPTOR
*)Temp
)->Desc
= 0x79;
723 ((EFI_ACPI_END_TAG_DESCRIPTOR
*)Temp
)->Checksum
= 0x0;
725 *Configuration
= Buffer
;
728 List
= List
->ForwardLink
;
731 return EFI_INVALID_PARAMETER
;
735 Programs the PCI root bridge hardware so that it decodes the specified PCI bus range.
737 This member function programs the specified PCI root bridge to decode the bus range that is
738 specified by the input parameter Configuration.
739 The bus range information is specified in terms of the ACPI 2.0 resource descriptor format.
741 @param[in] This The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance
742 @param[in] RootBridgeHandle The PCI Root Bridge whose bus range is to be programmed
743 @param[in] Configuration The pointer to the PCI bus resource descriptor
745 @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
746 @retval EFI_INVALID_PARAMETER Configuration is NULL.
747 @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI 2.0 resource descriptor.
748 @retval EFI_INVALID_PARAMETER Configuration does not include a valid ACPI 2.0 bus resource descriptor.
749 @retval EFI_INVALID_PARAMETER Configuration includes valid ACPI 2.0 resource descriptors other than
751 @retval EFI_INVALID_PARAMETER Configuration contains one or more invalid ACPI resource descriptors.
752 @retval EFI_INVALID_PARAMETER "Address Range Minimum" is invalid for this root bridge.
753 @retval EFI_INVALID_PARAMETER "Address Range Length" is invalid for this root bridge.
754 @retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
755 @retval EFI_SUCCESS The bus range for the PCI root bridge was programmed.
761 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
762 IN EFI_HANDLE RootBridgeHandle
,
763 IN VOID
*Configuration
767 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
768 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
774 if (Configuration
== NULL
) {
775 return EFI_INVALID_PARAMETER
;
781 // Check the Configuration is valid
783 if(*Ptr
!= ACPI_ADDRESS_SPACE_DESCRIPTOR
) {
784 return EFI_INVALID_PARAMETER
;
787 if (((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Ptr
)->ResType
!= 2) {
788 return EFI_INVALID_PARAMETER
;
791 Ptr
+= sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
);
792 if (*Ptr
!= ACPI_END_TAG_DESCRIPTOR
) {
793 return EFI_INVALID_PARAMETER
;
796 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
797 List
= HostBridgeInstance
->Head
.ForwardLink
;
801 while (List
!= &HostBridgeInstance
->Head
) {
802 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
803 if (RootBridgeHandle
== RootBridgeInstance
->Handle
) {
804 BusStart
= (UINTN
)((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Ptr
)->AddrRangeMin
;
805 BusLen
= (UINTN
)((EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*)Ptr
)->AddrLen
;
806 BusEnd
= BusStart
+ BusLen
- 1;
808 if (BusStart
> BusEnd
) {
809 return EFI_INVALID_PARAMETER
;
812 if ((BusStart
< RootBridgeInstance
->BusBase
) || (BusEnd
> RootBridgeInstance
->BusLimit
)) {
813 return EFI_INVALID_PARAMETER
;
817 // Update the Bus Range
819 RootBridgeInstance
->ResAllocNode
[TypeBus
].Base
= BusStart
;
820 RootBridgeInstance
->ResAllocNode
[TypeBus
].Length
= BusLen
;
821 RootBridgeInstance
->ResAllocNode
[TypeBus
].Status
= ResAllocated
;
824 // Program the Root Bridge Hardware
830 List
= List
->ForwardLink
;
833 return EFI_INVALID_PARAMETER
;
838 Submits the I/O and memory resource requirements for the specified PCI root bridge.
840 This function is used to submit all the I/O and memory resources that are required by the specified
841 PCI root bridge. The input parameter Configuration is used to specify the following:
842 - The various types of resources that are required
843 - The associated lengths in terms of ACPI 2.0 resource descriptor format
845 @param[in] This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
846 @param[in] RootBridgeHandle The PCI root bridge whose I/O and memory resource requirements are being submitted.
847 @param[in] Configuration The pointer to the PCI I/O and PCI memory resource descriptor.
849 @retval EFI_SUCCESS The I/O and memory resource requests for a PCI root bridge were accepted.
850 @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
851 @retval EFI_INVALID_PARAMETER Configuration is NULL.
852 @retval EFI_INVALID_PARAMETER Configuration does not point to a valid ACPI 2.0 resource descriptor.
853 @retval EFI_INVALID_PARAMETER Configuration includes requests for one or more resource types that are
854 not supported by this PCI root bridge. This error will happen if the caller
855 did not combine resources according to Attributes that were returned by
856 GetAllocAttributes().
857 @retval EFI_INVALID_PARAMETER Address Range Maximum" is invalid.
858 @retval EFI_INVALID_PARAMETER "Address Range Length" is invalid for this PCI root bridge.
859 @retval EFI_INVALID_PARAMETER "Address Space Granularity" is invalid for this PCI root bridge.
865 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
866 IN EFI_HANDLE RootBridgeHandle
,
867 IN VOID
*Configuration
871 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
872 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
874 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*ptr
;
879 // Check the input parameter: Configuration
881 if (Configuration
== NULL
) {
882 return EFI_INVALID_PARAMETER
;
885 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
886 List
= HostBridgeInstance
->Head
.ForwardLink
;
888 Temp
= (UINT8
*)Configuration
;
889 while ( *Temp
== 0x8A) {
890 Temp
+= sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
) ;
893 return EFI_INVALID_PARAMETER
;
896 Temp
= (UINT8
*)Configuration
;
897 while (List
!= &HostBridgeInstance
->Head
) {
898 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
899 if (RootBridgeHandle
== RootBridgeInstance
->Handle
) {
900 while ( *Temp
== 0x8A) {
901 ptr
= (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*) Temp
;
904 // Check Address Length
906 if (ptr
->AddrLen
> 0xffffffff) {
907 return EFI_INVALID_PARAMETER
;
911 // Check address range alignment
913 if (ptr
->AddrRangeMax
>= 0xffffffff || ptr
->AddrRangeMax
!= (GetPowerOfTwo64 (ptr
->AddrRangeMax
+ 1) - 1)) {
914 return EFI_INVALID_PARAMETER
;
917 switch (ptr
->ResType
) {
922 // Check invalid Address Sapce Granularity
924 if (ptr
->AddrSpaceGranularity
!= 32) {
925 return EFI_INVALID_PARAMETER
;
929 // check the memory resource request is supported by PCI root bridge
931 if (RootBridgeInstance
->RootBridgeAttrib
== EFI_PCI_HOST_BRIDGE_COMBINE_MEM_PMEM
&&
932 ptr
->SpecificFlag
== 0x06) {
933 return EFI_INVALID_PARAMETER
;
936 AddrLen
= ptr
->AddrLen
;
937 Alignment
= ptr
->AddrRangeMax
;
938 if (ptr
->AddrSpaceGranularity
== 32) {
939 if (ptr
->SpecificFlag
== 0x06) {
943 RootBridgeInstance
->ResAllocNode
[TypePMem32
].Status
= ResSubmitted
;
945 RootBridgeInstance
->ResAllocNode
[TypeMem32
].Length
= AddrLen
;
946 RootBridgeInstance
->ResAllocNode
[TypeMem32
].Alignment
= Alignment
;
947 RootBridgeInstance
->ResAllocNode
[TypeMem32
].Status
= ResRequested
;
948 HostBridgeInstance
->ResourceSubmited
= TRUE
;
952 if (ptr
->AddrSpaceGranularity
== 64) {
953 if (ptr
->SpecificFlag
== 0x06) {
954 RootBridgeInstance
->ResAllocNode
[TypePMem64
].Status
= ResSubmitted
;
956 RootBridgeInstance
->ResAllocNode
[TypeMem64
].Status
= ResSubmitted
;
962 AddrLen
= (UINTN
)ptr
->AddrLen
;
963 Alignment
= (UINTN
)ptr
->AddrRangeMax
;
964 RootBridgeInstance
->ResAllocNode
[TypeIo
].Length
= AddrLen
;
965 RootBridgeInstance
->ResAllocNode
[TypeIo
].Alignment
= Alignment
;
966 RootBridgeInstance
->ResAllocNode
[TypeIo
].Status
= ResRequested
;
967 HostBridgeInstance
->ResourceSubmited
= TRUE
;
974 Temp
+= sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
) ;
980 List
= List
->ForwardLink
;
983 return EFI_INVALID_PARAMETER
;
987 Returns the proposed resource settings for the specified PCI root bridge.
989 This member function returns the proposed resource settings for the specified PCI root bridge. The
990 proposed resource settings are prepared when NotifyPhase() is called with a Phase of
991 EfiPciHostBridgeAllocateResources. The output parameter Configuration
992 specifies the following:
993 - The various types of resources, excluding bus resources, that are allocated
994 - The associated lengths in terms of ACPI 2.0 resource descriptor format
996 @param[in] This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
997 @param[in] RootBridgeHandle The PCI root bridge handle. Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI 2.0 Specification.
998 @param[out] Configuration The pointer to the pointer to the PCI I/O and memory resource descriptor.
1000 @retval EFI_SUCCESS The requested parameters were returned.
1001 @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
1002 @retval EFI_DEVICE_ERROR Programming failed due to a hardware error.
1003 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
1008 GetProposedResources(
1009 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
1010 IN EFI_HANDLE RootBridgeHandle
,
1011 OUT VOID
**Configuration
1015 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
1016 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
1021 EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*ptr
;
1027 // Get the Host Bridge Instance from the resource allocation protocol
1029 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
1030 List
= HostBridgeInstance
->Head
.ForwardLink
;
1033 // Enumerate the root bridges in this host bridge
1035 while (List
!= &HostBridgeInstance
->Head
) {
1036 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
1037 if (RootBridgeHandle
== RootBridgeInstance
->Handle
) {
1038 for (Index
= 0; Index
< TypeBus
; Index
++) {
1039 if (RootBridgeInstance
->ResAllocNode
[Index
].Status
!= ResNone
) {
1045 return EFI_INVALID_PARAMETER
;
1048 Buffer
= AllocateZeroPool (Number
* sizeof(EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
) + sizeof(EFI_ACPI_END_TAG_DESCRIPTOR
));
1049 if (Buffer
== NULL
) {
1050 return EFI_OUT_OF_RESOURCES
;
1054 for (Index
= 0; Index
< TypeBus
; Index
++) {
1055 if (RootBridgeInstance
->ResAllocNode
[Index
].Status
!= ResNone
) {
1056 ptr
= (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
*) Temp
;
1057 ResStatus
= RootBridgeInstance
->ResAllocNode
[Index
].Status
;
1069 ptr
->SpecificFlag
= 0;
1070 ptr
->AddrRangeMin
= RootBridgeInstance
->ResAllocNode
[Index
].Base
;
1071 ptr
->AddrRangeMax
= 0;
1072 ptr
->AddrTranslationOffset
= \
1073 (ResStatus
== ResAllocated
) ? EFI_RESOURCE_SATISFIED
: EFI_RESOURCE_LESS
;
1074 ptr
->AddrLen
= RootBridgeInstance
->ResAllocNode
[Index
].Length
;
1085 ptr
->SpecificFlag
= 0;
1086 ptr
->AddrSpaceGranularity
= 32;
1087 ptr
->AddrRangeMin
= RootBridgeInstance
->ResAllocNode
[Index
].Base
;
1088 ptr
->AddrRangeMax
= 0;
1089 ptr
->AddrTranslationOffset
= \
1090 (ResStatus
== ResAllocated
) ? EFI_RESOURCE_SATISFIED
: EFI_RESOURCE_LESS
;
1091 ptr
->AddrLen
= RootBridgeInstance
->ResAllocNode
[Index
].Length
;
1096 // Prefetch memory 32
1102 ptr
->SpecificFlag
= 6;
1103 ptr
->AddrSpaceGranularity
= 32;
1104 ptr
->AddrRangeMin
= 0;
1105 ptr
->AddrRangeMax
= 0;
1106 ptr
->AddrTranslationOffset
= EFI_RESOURCE_NONEXISTENT
;
1118 ptr
->SpecificFlag
= 0;
1119 ptr
->AddrSpaceGranularity
= 64;
1120 ptr
->AddrRangeMin
= 0;
1121 ptr
->AddrRangeMax
= 0;
1122 ptr
->AddrTranslationOffset
= EFI_RESOURCE_NONEXISTENT
;
1128 // Prefetch memory 64
1134 ptr
->SpecificFlag
= 6;
1135 ptr
->AddrSpaceGranularity
= 64;
1136 ptr
->AddrRangeMin
= 0;
1137 ptr
->AddrRangeMax
= 0;
1138 ptr
->AddrTranslationOffset
= EFI_RESOURCE_NONEXISTENT
;
1143 Temp
+= sizeof (EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR
);
1147 ((EFI_ACPI_END_TAG_DESCRIPTOR
*)Temp
)->Desc
= 0x79;
1148 ((EFI_ACPI_END_TAG_DESCRIPTOR
*)Temp
)->Checksum
= 0x0;
1150 *Configuration
= Buffer
;
1155 List
= List
->ForwardLink
;
1158 return EFI_INVALID_PARAMETER
;
1162 Update attribute for PCI root bridge for specifc device.
1164 @param RootBridge Point to PCI root bridge.
1165 @param PciAddress The specific device PCI address
1169 UpdateRootBridgeAttributes (
1170 IN PCI_ROOT_BRIDGE_INSTANCE
*RootBridge
,
1171 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress
1175 PCI_TYPE01 PciConfigurationHeader
;
1179 // Read the PCI Configuration Header for the device
1181 Status
= RootBridge
->Io
.Pci
.Read (
1187 PciAddress
.Function
,
1190 sizeof (PciConfigurationHeader
) / sizeof (UINT16
),
1191 &PciConfigurationHeader
1193 if (EFI_ERROR (Status
)) {
1197 Attributes
= RootBridge
->Attributes
;
1200 // Look for devices with the VGA Palette Snoop enabled in the COMMAND register of the PCI Config Header
1202 if (PciConfigurationHeader
.Hdr
.Command
& 0x20) {
1203 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO
;
1207 // If the device is a PCI-PCI Bridge, then look at the Subordinate Bus Number
1209 if (IS_PCI_BRIDGE(&PciConfigurationHeader
)) {
1211 // Look at the PPB Configuration for legacy decoding attributes
1213 if (PciConfigurationHeader
.Bridge
.BridgeControl
& 0x04) {
1214 Attributes
|= EFI_PCI_ATTRIBUTE_ISA_IO
;
1215 Attributes
|= EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO
;
1217 if (PciConfigurationHeader
.Bridge
.BridgeControl
& 0x08) {
1218 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO
;
1219 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_MEMORY
;
1220 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_IO
;
1224 // See if the PCI device is an IDE controller
1226 if (PciConfigurationHeader
.Hdr
.ClassCode
[2] == 0x01 &&
1227 PciConfigurationHeader
.Hdr
.ClassCode
[1] == 0x01 ) {
1228 if (PciConfigurationHeader
.Hdr
.ClassCode
[0] & 0x80) {
1229 Attributes
|= EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO
;
1230 Attributes
|= EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO
;
1232 if (PciConfigurationHeader
.Hdr
.ClassCode
[0] & 0x01) {
1233 Attributes
|= EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO
;
1235 if (PciConfigurationHeader
.Hdr
.ClassCode
[0] & 0x04) {
1236 Attributes
|= EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO
;
1241 // See if the PCI device is a legacy VGA controller
1243 if (PciConfigurationHeader
.Hdr
.ClassCode
[2] == 0x00 &&
1244 PciConfigurationHeader
.Hdr
.ClassCode
[1] == 0x01 ) {
1245 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO
;
1246 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_MEMORY
;
1247 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_IO
;
1251 // See if the PCI device is a standard VGA controller
1253 if (PciConfigurationHeader
.Hdr
.ClassCode
[2] == 0x03 &&
1254 PciConfigurationHeader
.Hdr
.ClassCode
[1] == 0x00 ) {
1255 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO
;
1256 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_MEMORY
;
1257 Attributes
|= EFI_PCI_ATTRIBUTE_VGA_IO
;
1261 RootBridge
->Attributes
= Attributes
;
1262 RootBridge
->Supports
= Attributes
;
1266 Provides the hooks from the PCI bus driver to every PCI controller (device/function) at various
1267 stages of the PCI enumeration process that allow the host bridge driver to preinitialize individual
1268 PCI controllers before enumeration.
1270 This function is called during the PCI enumeration process. No specific action is expected from this
1271 member function. It allows the host bridge driver to preinitialize individual PCI controllers before
1274 @param This Pointer to the EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance.
1275 @param RootBridgeHandle The associated PCI root bridge handle. Type EFI_HANDLE is defined in
1276 InstallProtocolInterface() in the UEFI 2.0 Specification.
1277 @param PciAddress The address of the PCI device on the PCI bus. This address can be passed to the
1278 EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL member functions to access the PCI
1279 configuration space of the device. See Table 12-1 in the UEFI 2.0 Specification for
1280 the definition of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS.
1281 @param Phase The phase of the PCI device enumeration.
1283 @retval EFI_SUCCESS The requested parameters were returned.
1284 @retval EFI_INVALID_PARAMETER RootBridgeHandle is not a valid root bridge handle.
1285 @retval EFI_INVALID_PARAMETER Phase is not a valid phase that is defined in
1286 EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE.
1287 @retval EFI_DEVICE_ERROR Programming failed due to a hardware error. The PCI enumerator should
1288 not enumerate this device, including its child devices if it is a PCI-to-PCI
1294 PreprocessController (
1295 IN
struct _EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*This
,
1296 IN EFI_HANDLE RootBridgeHandle
,
1297 IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress
,
1298 IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase
1301 PCI_HOST_BRIDGE_INSTANCE
*HostBridgeInstance
;
1302 PCI_ROOT_BRIDGE_INSTANCE
*RootBridgeInstance
;
1305 HostBridgeInstance
= INSTANCE_FROM_RESOURCE_ALLOCATION_THIS (This
);
1306 List
= HostBridgeInstance
->Head
.ForwardLink
;
1309 // Enumerate the root bridges in this host bridge
1311 while (List
!= &HostBridgeInstance
->Head
) {
1312 RootBridgeInstance
= DRIVER_INSTANCE_FROM_LIST_ENTRY (List
);
1313 if (RootBridgeHandle
== RootBridgeInstance
->Handle
) {
1314 UpdateRootBridgeAttributes (
1320 List
= List
->ForwardLink
;
1323 return EFI_INVALID_PARAMETER
;