TianoCore EDK2 master
|
Go to the source code of this file.
Functions | |
EFI_STATUS | PciDevicePresent (IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *PciRootBridgeIo, OUT PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func) |
EFI_STATUS | PciPciDeviceInfoCollector (IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber) |
EFI_STATUS | PciSearchDevice (IN PCI_IO_DEVICE *Bridge, IN PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func, OUT PCI_IO_DEVICE **PciDevice) |
PCI_IO_DEVICE * | GatherDeviceInfo (IN PCI_IO_DEVICE *Bridge, IN PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func) |
PCI_IO_DEVICE * | GatherPpbInfo (IN PCI_IO_DEVICE *Bridge, IN PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func) |
PCI_IO_DEVICE * | GatherP2CInfo (IN PCI_IO_DEVICE *Bridge, IN PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func) |
EFI_DEVICE_PATH_PROTOCOL * | CreatePciDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, IN PCI_IO_DEVICE *PciIoDevice) |
EFI_STATUS | VfBarExisted (IN PCI_IO_DEVICE *PciIoDevice, IN UINTN Offset, OUT UINT32 *BarLengthValue, OUT UINT32 *OriginalBarValue) |
EFI_STATUS | BarExisted (IN PCI_IO_DEVICE *PciIoDevice, IN UINTN Offset, OUT UINT32 *BarLengthValue, OUT UINT32 *OriginalBarValue) |
VOID | PciTestSupportedAttribute (IN PCI_IO_DEVICE *PciIoDevice, IN OUT UINT16 *Command, IN OUT UINT16 *BridgeControl, OUT UINT16 *OldCommand, OUT UINT16 *OldBridgeControl) |
VOID | PciSetDeviceAttribute (IN PCI_IO_DEVICE *PciIoDevice, IN UINT16 Command, IN UINT16 BridgeControl, IN UINTN Option) |
EFI_STATUS | GetFastBackToBackSupport (IN PCI_IO_DEVICE *PciIoDevice, IN UINT8 StatusIndex) |
EFI_STATUS | DetermineDeviceAttribute (IN PCI_IO_DEVICE *PciIoDevice) |
EFI_STATUS | UpdatePciInfo (IN OUT PCI_IO_DEVICE *PciIoDevice, OUT BOOLEAN *IgnoreOptionRom) |
VOID | SetNewAlign (IN OUT UINT64 *Alignment, IN UINT64 NewAlignment) |
UINTN | PciParseBar (IN PCI_IO_DEVICE *PciIoDevice, IN UINTN Offset, IN UINTN BarIndex) |
UINTN | PciIovParseVfBar (IN PCI_IO_DEVICE *PciIoDevice, IN UINTN Offset, IN UINTN BarIndex) |
VOID | InitializePciDevice (IN PCI_IO_DEVICE *PciIoDevice) |
VOID | InitializePpb (IN PCI_IO_DEVICE *PciIoDevice) |
VOID | InitializeP2C (IN PCI_IO_DEVICE *PciIoDevice) |
PCI_IO_DEVICE * | CreatePciIoDevice (IN PCI_IO_DEVICE *Bridge, IN PCI_TYPE00 *Pci, IN UINT8 Bus, IN UINT8 Device, IN UINT8 Func) |
EFI_STATUS | PciEnumeratorLight (IN EFI_HANDLE Controller) |
EFI_STATUS | PciGetBusRange (IN EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors, OUT UINT16 *MinBus, OUT UINT16 *MaxBus, OUT UINT16 *BusRange) |
EFI_STATUS | StartManagingRootBridge (IN PCI_IO_DEVICE *RootBridgeDev) |
BOOLEAN | IsPciDeviceRejected (IN PCI_IO_DEVICE *PciIoDevice) |
VOID | ResetAllPpbBusNumber (IN PCI_IO_DEVICE *Bridge, IN UINT8 StartBusNumber) |
VOID | DumpPpbPaddingResource (IN PCI_IO_DEVICE *PciIoDevice, IN PCI_BAR_TYPE ResourceType) |
VOID | DumpPciBars (IN PCI_IO_DEVICE *PciIoDevice) |
PCI enumeration support functions declaration for PCI Bus module.
Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PciEnumeratorSupport.h.
EFI_STATUS BarExisted | ( | IN PCI_IO_DEVICE * | PciIoDevice, |
IN UINTN | Offset, | ||
OUT UINT32 * | BarLengthValue, | ||
OUT UINT32 * | OriginalBarValue | ||
) |
Check whether the bar is existed or not.
PciIoDevice | A pointer to the PCI_IO_DEVICE. |
Offset | The offset. |
BarLengthValue | The bar length value returned. |
OriginalBarValue | The original bar value returned. |
EFI_NOT_FOUND | The bar doesn't exist. |
EFI_SUCCESS | The bar exist. |
Definition at line 859 of file PciEnumeratorSupport.c.
EFI_DEVICE_PATH_PROTOCOL * CreatePciDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | ParentDevicePath, |
IN PCI_IO_DEVICE * | PciIoDevice | ||
) |
Create device path for pci device.
ParentDevicePath | Parent bridge's path. |
PciIoDevice | Pci device instance. |
Definition at line 751 of file PciEnumeratorSupport.c.
PCI_IO_DEVICE * CreatePciIoDevice | ( | IN PCI_IO_DEVICE * | Bridge, |
IN PCI_TYPE00 * | Pci, | ||
IN UINT8 | Bus, | ||
IN UINT8 | Device, | ||
IN UINT8 | Func | ||
) |
Create and initialize general PCI I/O device instance for PCI device/bridge device/hotplug bridge device.
Bridge | Parent bridge instance. |
Pci | Input Pci information block. |
Bus | Device Bus NO. |
Device | Device device NO. |
Func | Device func NO. |
Definition at line 2171 of file PciEnumeratorSupport.c.
EFI_STATUS DetermineDeviceAttribute | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
Determine the related attributes of all devices under a Root Bridge.
PciIoDevice | PCI device instance. |
Definition at line 1179 of file PciEnumeratorSupport.c.
VOID DumpPciBars | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
Dump the PCI BAR information.
PciIoDevice | PCI IO instance. |
Definition at line 406 of file PciEnumeratorSupport.c.
VOID DumpPpbPaddingResource | ( | IN PCI_IO_DEVICE * | PciIoDevice, |
IN PCI_BAR_TYPE | ResourceType | ||
) |
Dump the PPB padding resource information.
PciIoDevice | PCI IO instance. |
ResourceType | The desired resource type to dump. PciBarTypeUnknown means to dump all types of resources. |
Definition at line 334 of file PciEnumeratorSupport.c.
PCI_IO_DEVICE * GatherDeviceInfo | ( | IN PCI_IO_DEVICE * | Bridge, |
IN PCI_TYPE00 * | Pci, | ||
IN UINT8 | Bus, | ||
IN UINT8 | Device, | ||
IN UINT8 | Func | ||
) |
Create PCI device instance for PCI device.
Bridge | Parent bridge instance. |
Pci | Input PCI device information block. |
Bus | PCI device Bus NO. |
Device | PCI device Device NO. |
Func | PCI device's func NO. |
Definition at line 460 of file PciEnumeratorSupport.c.
PCI_IO_DEVICE * GatherP2CInfo | ( | IN PCI_IO_DEVICE * | Bridge, |
IN PCI_TYPE00 * | Pci, | ||
IN UINT8 | Bus, | ||
IN UINT8 | Device, | ||
IN UINT8 | Func | ||
) |
Create PCI device instance for PCI Card bridge device.
Bridge | Parent bridge instance. |
Pci | Input PCI device information block. |
Bus | PCI device Bus NO. |
Device | PCI device Device NO. |
Func | PCI device's func NO. |
Definition at line 690 of file PciEnumeratorSupport.c.
PCI_IO_DEVICE * GatherPpbInfo | ( | IN PCI_IO_DEVICE * | Bridge, |
IN PCI_TYPE00 * | Pci, | ||
IN UINT8 | Bus, | ||
IN UINT8 | Device, | ||
IN UINT8 | Func | ||
) |
Create PCI device instance for PCI-PCI bridge.
Bridge | Parent bridge instance. |
Pci | Input PCI device information block. |
Bus | PCI device Bus NO. |
Device | PCI device Device NO. |
Func | PCI device's func NO. |
Definition at line 530 of file PciEnumeratorSupport.c.
EFI_STATUS GetFastBackToBackSupport | ( | IN PCI_IO_DEVICE * | PciIoDevice, |
IN UINT8 | StatusIndex | ||
) |
Determine if the device can support Fast Back to Back attribute.
PciIoDevice | Pci device instance. |
StatusIndex | Status register value. |
EFI_SUCCESS | This device support Fast Back to Back attribute. |
EFI_UNSUPPORTED | This device doesn't support Fast Back to Back attribute. |
Definition at line 1112 of file PciEnumeratorSupport.c.
VOID InitializeP2C | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
This routine is used to initialize the bar of a PCI Card Bridge device.
PciIoDevice | PCI Card bridge device. |
Definition at line 2044 of file PciEnumeratorSupport.c.
VOID InitializePciDevice | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
This routine is used to initialize the bar of a PCI device.
PciIoDevice | Pci device instance. |
Definition at line 1974 of file PciEnumeratorSupport.c.
VOID InitializePpb | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
This routine is used to initialize the bar of a PCI-PCI Bridge device.
PciIoDevice | PCI-PCI bridge device instance. |
Definition at line 2000 of file PciEnumeratorSupport.c.
BOOLEAN IsPciDeviceRejected | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
This routine can be used to check whether a PCI device should be rejected when light enumeration.
PciIoDevice | Pci device instance. |
TRUE | This device should be rejected. |
FALSE | This device shouldn't be rejected. |
Definition at line 2718 of file PciEnumeratorSupport.c.
EFI_STATUS PciDevicePresent | ( | IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * | PciRootBridgeIo, |
OUT PCI_TYPE00 * | Pci, | ||
IN UINT8 | Bus, | ||
IN UINT8 | Device, | ||
IN UINT8 | Func | ||
) |
This routine is used to check whether the pci device is present.
PciRootBridgeIo | Pointer to instance of EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL. |
Pci | Output buffer for PCI device configuration space. |
Bus | PCI bus NO. |
Device | PCI device NO. |
Func | PCI Func NO. |
EFI_NOT_FOUND | PCI device not present. |
EFI_SUCCESS | PCI device is found. |
Definition at line 35 of file PciEnumeratorSupport.c.
EFI_STATUS PciEnumeratorLight | ( | IN EFI_HANDLE | Controller | ) |
This routine is used to enumerate entire pci bus system in a given platform.
It is only called on the second start on the same Root Bridge.
Controller | Parent bridge handler. |
EFI_SUCCESS | PCI enumeration finished successfully. |
other | Some error occurred when enumerating the pci bus system. |
Definition at line 2520 of file PciEnumeratorSupport.c.
EFI_STATUS PciGetBusRange | ( | IN EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR ** | Descriptors, |
OUT UINT16 * | MinBus, | ||
OUT UINT16 * | MaxBus, | ||
OUT UINT16 * | BusRange | ||
) |
Get bus range from PCI resource descriptor list.
Descriptors | A pointer to the address space descriptor. |
MinBus | The min bus returned. |
MaxBus | The max bus returned. |
BusRange | The bus range returned. |
EFI_SUCCESS | Successfully got bus range. |
EFI_NOT_FOUND | Can not find the specific bus. |
Definition at line 2630 of file PciEnumeratorSupport.c.
Parse PCI IOV VF bar information and fill them into PCI device instance.
PciIoDevice | Pci device instance. |
Offset | Bar offset. |
BarIndex | Bar index. |
Definition at line 1574 of file PciEnumeratorSupport.c.
Parse PCI bar information and fill them into PCI device instance.
PciIoDevice | Pci device instance. |
Offset | Bar offset. |
BarIndex | Bar index. |
Definition at line 1764 of file PciEnumeratorSupport.c.
EFI_STATUS PciPciDeviceInfoCollector | ( | IN PCI_IO_DEVICE * | Bridge, |
IN UINT8 | StartBusNumber | ||
) |
Collect all the resource information under this root bridge.
A database that records all the information about pci device subject to this root bridge will then be created.
Bridge | Parent bridge instance. |
StartBusNumber | Bus number of beginning. |
EFI_SUCCESS | PCI device is found. |
other | Some error occurred when reading PCI bridge information. |
Definition at line 94 of file PciEnumeratorSupport.c.
EFI_STATUS PciSearchDevice | ( | IN PCI_IO_DEVICE * | Bridge, |
IN PCI_TYPE00 * | Pci, | ||
IN UINT8 | Bus, | ||
IN UINT8 | Device, | ||
IN UINT8 | Func, | ||
OUT PCI_IO_DEVICE ** | PciDevice | ||
) |
Search required device and create PCI device instance.
Bridge | Parent bridge instance. |
Pci | Input PCI device information block. |
Bus | PCI bus NO. |
Device | PCI device NO. |
Func | PCI func NO. |
PciDevice | Output of searched PCI device instance. |
EFI_SUCCESS | Successfully created PCI device instance. |
EFI_OUT_OF_RESOURCES | Cannot get PCI device information. |
Definition at line 214 of file PciEnumeratorSupport.c.
VOID PciSetDeviceAttribute | ( | IN PCI_IO_DEVICE * | PciIoDevice, |
IN UINT16 | Command, | ||
IN UINT16 | BridgeControl, | ||
IN UINTN | Option | ||
) |
Set the supported or current attributes of a PCI device.
PciIoDevice | Structure pointer for PCI device. |
Command | Command register value. |
BridgeControl | Bridge control value for PPB or P2C. |
Option | Make a choice of EFI_SET_SUPPORTS or EFI_SET_ATTRIBUTES. |
Definition at line 999 of file PciEnumeratorSupport.c.
VOID PciTestSupportedAttribute | ( | IN PCI_IO_DEVICE * | PciIoDevice, |
IN OUT UINT16 * | Command, | ||
IN OUT UINT16 * | BridgeControl, | ||
OUT UINT16 * | OldCommand, | ||
OUT UINT16 * | OldBridgeControl | ||
) |
Test whether the device can support given attributes.
PciIoDevice | Pci device instance. |
Command | Input command register value, and returned supported register value. |
BridgeControl | Input bridge control value for PPB or P2C, and returned supported bridge control value. |
OldCommand | Returned and stored old command register offset. |
OldBridgeControl | Returned and stored old Bridge control value for PPB or P2C. |
Definition at line 924 of file PciEnumeratorSupport.c.
VOID ResetAllPpbBusNumber | ( | IN PCI_IO_DEVICE * | Bridge, |
IN UINT8 | StartBusNumber | ||
) |
Reset all bus number from specific bridge.
Bridge | Parent specific bridge. |
StartBusNumber | Start bus number. |
Definition at line 2819 of file PciEnumeratorSupport.c.
This routine will update the alignment with the new alignment.
Alignment | Input Old alignment. Output updated alignment. |
NewAlignment | New alignment. |
This routine will update the alignment with the new alignment. Compare with OLD_ALIGN/EVEN_ALIGN/SQUAD_ALIGN/DQUAD_ALIGN is to keep backward compatibility.
Alignment | Input Old alignment. Output updated alignment. |
NewAlignment | New alignment. |
Definition at line 1499 of file PciEnumeratorSupport.c.
EFI_STATUS StartManagingRootBridge | ( | IN PCI_IO_DEVICE * | RootBridgeDev | ) |
This routine can be used to start the root bridge.
RootBridgeDev | Pci device instance. |
EFI_SUCCESS | This device started. |
other | Failed to get PCI Root Bridge I/O protocol. |
Definition at line 2670 of file PciEnumeratorSupport.c.
EFI_STATUS UpdatePciInfo | ( | IN OUT PCI_IO_DEVICE * | PciIoDevice, |
OUT BOOLEAN * | IgnoreOptionRom | ||
) |
This routine is used to update the bar information for those incompatible PCI device.
PciIoDevice | Input Pci device instance. Output Pci device instance with updated Bar information. |
IgnoreOptionRom | Output If the option rom of incompatible device need to be ignored. |
EFI_SUCCESS | Successfully updated bar information. |
EFI_UNSUPPORTED | Given PCI device doesn't belong to incompatible PCI device list. |
Definition at line 1325 of file PciEnumeratorSupport.c.
EFI_STATUS VfBarExisted | ( | IN PCI_IO_DEVICE * | PciIoDevice, |
IN UINTN | Offset, | ||
OUT UINT32 * | BarLengthValue, | ||
OUT UINT32 * | OriginalBarValue | ||
) |
Check whether the PCI IOV VF bar is existed or not.
PciIoDevice | A pointer to the PCI_IO_DEVICE. |
Offset | The offset. |
BarLengthValue | The bar length value returned. |
OriginalBarValue | The original bar value returned. |
EFI_NOT_FOUND | The bar doesn't exist. |
EFI_SUCCESS | The bar exist. |
Definition at line 785 of file PciEnumeratorSupport.c.