2 Internal library declaration for PCI Bus module.
4 Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _EFI_PCI_LIB_H_
10 #define _EFI_PCI_LIB_H_
14 } EFI_DEVICE_HANDLE_EXTENDED_DATA_PAYLOAD
;
18 UINT16 DevicePathSize
;
24 } EFI_RESOURCE_ALLOC_FAILURE_ERROR_DATA_PAYLOAD
;
27 PciResizableBarMin
= 0x00,
28 PciResizableBarMax
= 0xFF
29 } PCI_RESIZABLE_BAR_OPERATION
;
32 Retrieve the PCI Card device BAR information via PciIo interface.
34 @param PciIoDevice PCI Card device instance.
39 IN PCI_IO_DEVICE
*PciIoDevice
43 Remove rejected pci device from specific root bridge
46 @param RootBridgeHandle Specific parent root bridge handle.
47 @param Bridge Bridge device instance.
51 RemoveRejectedPciDevices (
52 IN EFI_HANDLE RootBridgeHandle
,
53 IN PCI_IO_DEVICE
*Bridge
57 Submits the I/O and memory resource requirements for the specified PCI Host Bridge.
59 @param PciResAlloc Point to protocol instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
61 @retval EFI_SUCCESS Successfully finished resource allocation.
62 @retval EFI_NOT_FOUND Cannot get root bridge instance.
63 @retval EFI_OUT_OF_RESOURCES Platform failed to program the resources if no hot plug supported.
64 @retval other Some error occurred when allocating resources for the PCI Host Bridge.
66 @note Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug.
70 PciHostBridgeResourceAllocator (
71 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
75 Allocate NumberOfBuses buses and return the next available PCI bus number.
77 @param Bridge Bridge device instance.
78 @param StartBusNumber Current available PCI bus number.
79 @param NumberOfBuses Number of buses enumerated below the StartBusNumber.
80 @param NextBusNumber Next available PCI bus number.
82 @retval EFI_SUCCESS Available bus number resource is enough. Next available PCI bus number
83 is returned in NextBusNumber.
84 @retval EFI_OUT_OF_RESOURCES Available bus number resource is not enough for allocation.
88 PciAllocateBusNumber (
89 IN PCI_IO_DEVICE
*Bridge
,
90 IN UINT8 StartBusNumber
,
91 IN UINT8 NumberOfBuses
,
92 OUT UINT8
*NextBusNumber
96 Scan pci bus and assign bus number to the given PCI bus system.
98 @param Bridge Bridge device instance.
99 @param StartBusNumber start point.
100 @param SubBusNumber Point to sub bus number.
101 @param PaddedBusRange Customized bus number.
103 @retval EFI_SUCCESS Successfully scanned and assigned bus number.
104 @retval other Some error occurred when scanning pci bus.
106 @note Feature flag PcdPciBusHotplugDeviceSupport determine whether need support hotplug.
111 IN PCI_IO_DEVICE
*Bridge
,
112 IN UINT8 StartBusNumber
,
113 OUT UINT8
*SubBusNumber
,
114 OUT UINT8
*PaddedBusRange
118 Process Option Rom on the specified root bridge.
120 @param Bridge Pci root bridge device instance.
122 @retval EFI_SUCCESS Success process.
123 @retval other Some error occurred when processing Option Rom on the root bridge.
127 PciRootBridgeP2CProcess (
128 IN PCI_IO_DEVICE
*Bridge
132 Process Option Rom on the specified host bridge.
134 @param PciResAlloc Pointer to instance of EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL.
136 @retval EFI_SUCCESS Success process.
137 @retval EFI_NOT_FOUND Can not find the root bridge instance.
138 @retval other Some error occurred when processing Option Rom on the host bridge.
142 PciHostBridgeP2CProcess (
143 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
147 This function is used to enumerate the entire host bridge
150 @param PciResAlloc A pointer to the PCI Host Resource Allocation protocol.
152 @retval EFI_SUCCESS Successfully enumerated the host bridge.
153 @retval EFI_OUT_OF_RESOURCES No enough memory available.
154 @retval other Some error occurred when enumerating the host bridge.
158 PciHostBridgeEnumerator (
159 IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL
*PciResAlloc
163 This function is used to program the Resizable BAR Register.
165 @param PciIoDevice A pointer to the PCI_IO_DEVICE.
166 @param ResizableBarOp PciResizableBarMax: Set BAR to max size
167 PciResizableBarMin: set BAR to min size.
169 @retval EFI_SUCCESS Successfully enumerated the host bridge.
170 @retval other Some error occurred when enumerating the host bridge.
174 PciProgramResizableBar (
175 IN PCI_IO_DEVICE
*PciIoDevice
,
176 IN PCI_RESIZABLE_BAR_OPERATION ResizableBarOp