TianoCore EDK2 master
|
#include <IndustryStandard/Acpi10.h>
#include <IndustryStandard/Pci.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/DevicePathLib.h>
#include <Library/HardwareInfoLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PciHostBridgeUtilityLib.h>
#include <Library/PciLib.h>
#include <Library/QemuFwCfgLib.h>
#include <Protocol/PciHostBridgeResourceAllocation.h>
Go to the source code of this file.
Data Structures | |
struct | OVMF_PCI_ROOT_BRIDGE_DEVICE_PATH |
Variables | |
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 * | mPciHostBridgeUtilityLibAcpiAddressSpaceTypeStr [] |
STATIC CONST OVMF_PCI_ROOT_BRIDGE_DEVICE_PATH | mRootBridgeDevicePathTemplate |
Provide common utility functions to PciHostBridgeLib instances in ArmVirtPkg and OvmfPkg.
Copyright (C) 2016, Red Hat, Inc. Copyright (c) 2016, Intel Corporation. All rights reserved.
Copyright (c) 2020, Huawei Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PciHostBridgeUtilityLib.c.
VOID EFIAPI PciHostBridgeUtilityFreeRootBridges | ( | IN PCI_ROOT_BRIDGE * | Bridges, |
IN UINTN | Count | ||
) |
Utility function to free root bridge instances array from PciHostBridgeUtilityGetRootBridges().
[in] | Bridges | The root bridge instances array. |
[in] | Count | The count of the array. |
Definition at line 737 of file PciHostBridgeUtilityLib.c.
PCI_ROOT_BRIDGE *EFIAPI PciHostBridgeUtilityGetRootBridges | ( | OUT UINTN * | Count, |
IN UINT64 | Attributes, | ||
IN UINT64 | AllocationAttributes, | ||
IN BOOLEAN | DmaAbove4G, | ||
IN BOOLEAN | NoExtendedConfigSpace, | ||
IN UINTN | BusMin, | ||
IN UINTN | BusMax, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Io, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Mem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | MemAbove4G, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMemAbove4G | ||
) |
Utility function to return all the root bridge instances in an array.
[out] | Count | The number of root bridge instances. |
[in] | Attributes | Initial attributes. |
[in] | AllocAttributes | Allocation attributes. |
[in] | DmaAbove4G | DMA above 4GB memory. |
[in] | NoExtendedConfigSpace | No Extended Config Space. |
[in] | BusMin | Minimum Bus number, inclusive. |
[in] | BusMax | Maximum Bus number, inclusive. |
[in] | Io | IO aperture. |
[in] | Mem | MMIO aperture. |
[in] | MemAbove4G | MMIO aperture above 4G. |
[in] | PMem | Prefetchable MMIO aperture. |
[in] | PMemAbove4G | Prefetchable MMIO aperture above 4G. |
Definition at line 679 of file PciHostBridgeUtilityLib.c.
STATIC PCI_ROOT_BRIDGE * PciHostBridgeUtilityGetRootBridgesBusScan | ( | OUT UINTN * | Count, |
IN UINT64 | Attributes, | ||
IN UINT64 | AllocationAttributes, | ||
IN BOOLEAN | DmaAbove4G, | ||
IN BOOLEAN | NoExtendedConfigSpace, | ||
IN UINTN | BusMin, | ||
IN UINTN | BusMax, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Io, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Mem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | MemAbove4G, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMemAbove4G | ||
) |
Utility function to scan PCI root bridges and create instances for those that are found not empty. Populate their resources from the default provided parameters and return all the root bridge instances in an array.
[out] | Count | The number of root bridge instances. |
[in] | Attributes | Initial attributes. |
[in] | AllocAttributes | Allocation attributes. |
[in] | DmaAbove4G | DMA above 4GB memory. |
[in] | NoExtendedConfigSpace | No Extended Config Space. |
[in] | BusMin | Minimum Bus number, inclusive. |
[in] | BusMax | Maximum Bus number, inclusive. |
[in] | Io | IO aperture. |
[in] | Mem | MMIO aperture. |
[in] | MemAbove4G | MMIO aperture above 4G. |
[in] | PMem | Prefetchable MMIO aperture. |
[in] | PMemAbove4G | Prefetchable MMIO aperture above 4G. |
Definition at line 227 of file PciHostBridgeUtilityLib.c.
STATIC PCI_ROOT_BRIDGE * PciHostBridgeUtilityGetRootBridgesHostProvided | ( | OUT UINTN * | Count | ) |
Utility function to read root bridges information from host-provided fw-cfg file and return them in an array.
[out] | Count | The number of root bridge instances. |
Definition at line 420 of file PciHostBridgeUtilityLib.c.
EFI_STATUS EFIAPI PciHostBridgeUtilityInitRootBridge | ( | IN UINT64 | Supports, |
IN UINT64 | Attributes, | ||
IN UINT64 | AllocAttributes, | ||
IN BOOLEAN | DmaAbove4G, | ||
IN BOOLEAN | NoExtendedConfigSpace, | ||
IN UINT8 | RootBusNumber, | ||
IN UINT8 | MaxSubBusNumber, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Io, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | Mem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | MemAbove4G, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMem, | ||
IN PCI_ROOT_BRIDGE_APERTURE * | PMemAbove4G, | ||
OUT PCI_ROOT_BRIDGE * | RootBus | ||
) |
Utility function to initialize a PCI_ROOT_BRIDGE structure.
[in] | Supports | Supported attributes. |
[in] | Attributes | Initial attributes. |
[in] | AllocAttributes | Allocation attributes. |
[in] | DmaAbove4G | DMA above 4GB memory. |
[in] | NoExtendedConfigSpace | No Extended Config Space. |
[in] | RootBusNumber | The bus number to store in RootBus. |
[in] | MaxSubBusNumber | The inclusive maximum bus number that can be assigned to any subordinate bus found behind any PCI bridge hanging off this root bus. |
The caller is repsonsible for ensuring that RootBusNumber <= MaxSubBusNumber. If RootBusNumber equals MaxSubBusNumber, then the root bus has no room for subordinate buses.
[in] | Io | IO aperture. |
[in] | Mem | MMIO aperture. |
[in] | MemAbove4G | MMIO aperture above 4G. |
[in] | PMem | Prefetchable MMIO aperture. |
[in] | PMemAbove4G | Prefetchable MMIO aperture above 4G. |
[out] | RootBus | The PCI_ROOT_BRIDGE structure (allocated by the caller) that should be filled in by this function. |
EFI_SUCCESS | Initialization successful. A device path consisting of an ACPI device path node, with UID = RootBusNumber, has been allocated and linked into RootBus. |
EFI_OUT_OF_RESOURCES | Memory allocation failed. |
Definition at line 113 of file PciHostBridgeUtilityLib.c.
VOID EFIAPI PciHostBridgeUtilityResourceConflict | ( | IN VOID * | Configuration | ) |
Utility function to inform the platform that the resource conflict happens.
[in] | Configuration | Pointer to PCI I/O and PCI memory resource descriptors. The Configuration contains the resources for all the root bridges. The resource for each root bridge is terminated with END descriptor and an additional END is appended indicating the end of the entire resources. The resource descriptor field values follow the description in EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL .SubmitResources(). |
Definition at line 772 of file PciHostBridgeUtilityLib.c.
VOID EFIAPI PciHostBridgeUtilityUninitRootBridge | ( | IN PCI_ROOT_BRIDGE * | RootBus | ) |
Utility function to uninitialize a PCI_ROOT_BRIDGE structure set up with PciHostBridgeUtilityInitRootBridge().
[in] | RootBus | The PCI_ROOT_BRIDGE structure, allocated by the caller and initialized with PciHostBridgeUtilityInitRootBridge(), that should be uninitialized. This function doesn't free RootBus. |
Definition at line 187 of file PciHostBridgeUtilityLib.c.
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16* mPciHostBridgeUtilityLibAcpiAddressSpaceTypeStr[] |
Definition at line 34 of file PciHostBridgeUtilityLib.c.
STATIC CONST OVMF_PCI_ROOT_BRIDGE_DEVICE_PATH mRootBridgeDevicePathTemplate |
Definition at line 40 of file PciHostBridgeUtilityLib.c.