TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | PCI_RESOURCE_NODE |
Macros | |
#define | PCI_RESOURCE_SIGNATURE SIGNATURE_32 ('p', 'c', 'r', 'c') |
#define | RESOURCE_NODE_FROM_LINK(a) CR (a, PCI_RESOURCE_NODE, Link, PCI_RESOURCE_SIGNATURE) |
Enumerations | |
enum | PCI_RESOURCE_USAGE { PciResUsageTypical , PciResUsagePadding } |
PCI resources support functions declaration for PCI Bus module.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PciResourceSupport.h.
#define PCI_RESOURCE_SIGNATURE SIGNATURE_32 ('p', 'c', 'r', 'c') |
Definition at line 17 of file PciResourceSupport.h.
#define RESOURCE_NODE_FROM_LINK | ( | a | ) | CR (a, PCI_RESOURCE_NODE, Link, PCI_RESOURCE_SIGNATURE) |
Definition at line 34 of file PciResourceSupport.h.
enum PCI_RESOURCE_USAGE |
Definition at line 12 of file PciResourceSupport.h.
VOID ApplyResourcePadding | ( | IN PCI_IO_DEVICE * | PciDev, |
IN PCI_RESOURCE_NODE * | IoNode, | ||
IN PCI_RESOURCE_NODE * | Mem32Node, | ||
IN PCI_RESOURCE_NODE * | PMem32Node, | ||
IN PCI_RESOURCE_NODE * | Mem64Node, | ||
IN PCI_RESOURCE_NODE * | PMem64Node | ||
) |
Create padding resource node.
PciDev | Pci device instance. |
IoNode | Resource info node for IO. |
Mem32Node | Resource info node for 32-bit memory. |
PMem32Node | Resource info node for 32-bit Prefetchable Memory. |
Mem64Node | Resource info node for 64-bit memory. |
PMem64Node | Resource info node for 64-bit Prefetchable Memory. |
Definition at line 2118 of file PciResourceSupport.c.
BOOLEAN BridgeSupportResourceDecode | ( | IN PCI_IO_DEVICE * | Bridge, |
IN UINT32 | Decode | ||
) |
Test whether bridge device support decode resource.
Bridge | Bridge device instance. |
Decode | Decode type according to resource type. |
Definition at line 1174 of file PciResourceSupport.c.
VOID CalculateApertureIo16 | ( | IN PCI_RESOURCE_NODE * | Bridge | ) |
This function is used to calculate the IO16 aperture for a bridge.
Bridge | PCI resource node for bridge. |
Definition at line 181 of file PciResourceSupport.c.
VOID CalculateResourceAperture | ( | IN PCI_RESOURCE_NODE * | Bridge | ) |
This function is used to calculate the resource aperture for a given bridge device.
Bridge | PCI resource node for given bridge device. |
Definition at line 335 of file PciResourceSupport.c.
VOID CreateResourceMap | ( | IN PCI_IO_DEVICE * | Bridge, |
IN OUT PCI_RESOURCE_NODE * | IoNode, | ||
IN OUT PCI_RESOURCE_NODE * | Mem32Node, | ||
IN OUT PCI_RESOURCE_NODE * | PMem32Node, | ||
IN OUT PCI_RESOURCE_NODE * | Mem64Node, | ||
IN OUT PCI_RESOURCE_NODE * | PMem64Node | ||
) |
This function is used to extract resource request from device node list.
Bridge | Pci device instance. |
IoNode | Resource info node for IO. |
Mem32Node | Resource info node for 32-bit memory. |
PMem32Node | Resource info node for 32-bit Prefetchable Memory. |
Mem64Node | Resource info node for 64-bit memory. |
PMem64Node | Resource info node for 64-bit Prefetchable Memory. |
Definition at line 735 of file PciResourceSupport.c.
PCI_RESOURCE_NODE * CreateResourceNode | ( | IN PCI_IO_DEVICE * | PciDev, |
IN UINT64 | Length, | ||
IN UINT64 | Alignment, | ||
IN UINT8 | Bar, | ||
IN PCI_BAR_TYPE | ResType, | ||
IN PCI_RESOURCE_USAGE | ResUsage | ||
) |
This function is used to create a resource node.
PciDev | Pci device instance. |
Length | Length of Io/Memory resource. |
Alignment | Alignment of resource. |
Bar | Bar index. |
ResType | Type of resource: IO/Memory. |
ResUsage | Resource usage. |
Definition at line 654 of file PciResourceSupport.c.
PCI_RESOURCE_NODE * CreateVfResourceNode | ( | IN PCI_IO_DEVICE * | PciDev, |
IN UINT64 | Length, | ||
IN UINT64 | Alignment, | ||
IN UINT8 | Bar, | ||
IN PCI_BAR_TYPE | ResType, | ||
IN PCI_RESOURCE_USAGE | ResUsage | ||
) |
This function is used to create a IOV VF resource node.
PciDev | Pci device instance. |
Length | Length of Io/Memory resource. |
Alignment | Alignment of resource. |
Bar | Bar index. |
ResType | Type of resource: IO/Memory. |
ResUsage | Resource usage. |
Definition at line 701 of file PciResourceSupport.c.
VOID DegradeResource | ( | IN PCI_IO_DEVICE * | Bridge, |
IN PCI_RESOURCE_NODE * | Mem32Node, | ||
IN PCI_RESOURCE_NODE * | PMem32Node, | ||
IN PCI_RESOURCE_NODE * | Mem64Node, | ||
IN PCI_RESOURCE_NODE * | PMem64Node | ||
) |
This function is used to degrade resource if the upstream bridge doesn't support certain resource. Degradation path is PMEM64 -> MEM64 -> MEM32 PMEM64 -> PMEM32 -> MEM32 IO32 -> IO16.
Bridge | Pci device instance. |
Mem32Node | Resource info node for 32-bit memory. |
PMem32Node | Resource info node for 32-bit Prefetchable Memory. |
Mem64Node | Resource info node for 64-bit memory. |
PMem64Node | Resource info node for 64-bit Prefetchable Memory. |
Definition at line 1011 of file PciResourceSupport.c.
VOID DestroyResourceTree | ( | IN PCI_RESOURCE_NODE * | Bridge | ) |
Destroy given resource tree.
Bridge | PCI resource root node of resource tree. |
Definition at line 1756 of file PciResourceSupport.c.
VOID GetResourceFromDevice | ( | IN PCI_IO_DEVICE * | PciDev, |
IN OUT PCI_RESOURCE_NODE * | IoNode, | ||
IN OUT PCI_RESOURCE_NODE * | Mem32Node, | ||
IN OUT PCI_RESOURCE_NODE * | PMem32Node, | ||
IN OUT PCI_RESOURCE_NODE * | Mem64Node, | ||
IN OUT PCI_RESOURCE_NODE * | PMem64Node | ||
) |
Get IO/Memory resource info for given PCI device.
PciDev | Pci device instance. |
IoNode | Resource info node for IO . |
Mem32Node | Resource info node for 32-bit memory. |
PMem32Node | Resource info node for 32-bit Prefetchable Memory. |
Mem64Node | Resource info node for 64-bit memory. |
PMem64Node | Resource info node for 64-bit Prefetchable Memory. |
Definition at line 422 of file PciResourceSupport.c.
VOID GetResourcePaddingPpb | ( | IN PCI_IO_DEVICE * | PciIoDevice | ) |
Get padding resource for PCI-PCI bridge.
PciIoDevice | PCI-PCI bridge device instance. |
Definition at line 2266 of file PciResourceSupport.c.
VOID InitializeResourcePool | ( | IN OUT PCI_RESOURCE_NODE * | ResourcePool, |
IN PCI_BAR_TYPE | ResourceType | ||
) |
Initialize resource pool structure.
ResourcePool | Point to resource pool structure. This pool is reset to all zero when returned. |
ResourceType | Type of resource. |
Definition at line 1738 of file PciResourceSupport.c.
VOID InsertResourceNode | ( | IN OUT PCI_RESOURCE_NODE * | Bridge, |
IN PCI_RESOURCE_NODE * | ResNode | ||
) |
This function inserts a resource node into the resource list. The resource list is sorted in descend order.
Bridge | PCI resource node for bridge. |
ResNode | Resource node want to be inserted. |
Definition at line 93 of file PciResourceSupport.c.
VOID MergeResourceTree | ( | IN PCI_RESOURCE_NODE * | Dst, |
IN PCI_RESOURCE_NODE * | Res, | ||
IN BOOLEAN | TypeMerge | ||
) |
This routine is used to merge two different resource trees in need of resource degradation.
For example, if an upstream PPB doesn't support, prefetchable memory decoding, the PCI bus driver will choose to call this function to merge prefetchable memory resource list into normal memory list.
If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource type. If Dst is NULL or Res is NULL, ASSERT ().
Dst | Point to destination resource tree. |
Res | Point to source resource tree. |
TypeMerge | If the TypeMerge is TRUE, Res resource type is changed to the type of destination resource type. |
Definition at line 147 of file PciResourceSupport.c.
VOID ProgramBar | ( | IN UINT64 | Base, |
IN PCI_RESOURCE_NODE * | Node | ||
) |
Program Bar register for PCI device.
Base | Base address for PCI device resource to be programmed. |
Node | Point to resource node structure. |
Definition at line 1255 of file PciResourceSupport.c.
VOID ProgramP2C | ( | IN UINT64 | Base, |
IN PCI_RESOURCE_NODE * | Node | ||
) |
Program PCI Card device register for given resource node.
Base | Base address of PCI Card device to be programmed. |
Node | Given resource node. |
Definition at line 1885 of file PciResourceSupport.c.
VOID ProgramPpbApperture | ( | IN UINT64 | Base, |
IN PCI_RESOURCE_NODE * | Node | ||
) |
Program PCI-PCI bridge aperture.
Base | Base address for resource. |
Node | Point to resource node structure. |
Definition at line 1436 of file PciResourceSupport.c.
EFI_STATUS ProgramResource | ( | IN UINT64 | Base, |
IN PCI_RESOURCE_NODE * | Bridge | ||
) |
This function is used to program the resource allocated for each resource node under specified bridge.
Base | Base address of resource to be programmed. |
Bridge | PCI resource node for the bridge device. |
EFI_SUCCESS | Successfully to program all resources on given PCI bridge device. |
EFI_OUT_OF_RESOURCES | Base is all one. |
Definition at line 1199 of file PciResourceSupport.c.
VOID ProgramUpstreamBridgeForRom | ( | IN PCI_IO_DEVICE * | PciDevice, |
IN UINT32 | OptionRomBase, | ||
IN BOOLEAN | Enable | ||
) |
Program parent bridge for Option Rom.
PciDevice | Pci device instance. |
OptionRomBase | Base address for Option Rom. |
Enable | Enable or disable PCI memory. |
Definition at line 1645 of file PciResourceSupport.c.
EFI_STATUS ProgramVfBar | ( | IN UINT64 | Base, |
IN PCI_RESOURCE_NODE * | Node | ||
) |
Program IOV VF Bar register for PCI device.
Base | Base address for PCI device resource to be programmed. |
Node | Point to resource node structure. |
Definition at line 1351 of file PciResourceSupport.c.
VOID ResourcePaddingForCardBusBridge | ( | IN PCI_IO_DEVICE * | PciDev, |
IN PCI_RESOURCE_NODE * | IoNode, | ||
IN PCI_RESOURCE_NODE * | Mem32Node, | ||
IN PCI_RESOURCE_NODE * | PMem32Node, | ||
IN PCI_RESOURCE_NODE * | Mem64Node, | ||
IN PCI_RESOURCE_NODE * | PMem64Node | ||
) |
Insert resource padding for P2C.
PciDev | Pci device instance. |
IoNode | Resource info node for IO. |
Mem32Node | Resource info node for 32-bit memory. |
PMem32Node | Resource info node for 32-bit Prefetchable Memory. |
Mem64Node | Resource info node for 64-bit memory. |
PMem64Node | Resource info node for 64-bit Prefetchable Memory. |
Definition at line 1791 of file PciResourceSupport.c.
VOID ResourcePaddingPolicy | ( | IN PCI_IO_DEVICE * | PciDev, |
IN PCI_RESOURCE_NODE * | IoNode, | ||
IN PCI_RESOURCE_NODE * | Mem32Node, | ||
IN PCI_RESOURCE_NODE * | PMem32Node, | ||
IN PCI_RESOURCE_NODE * | Mem64Node, | ||
IN PCI_RESOURCE_NODE * | PMem64Node | ||
) |
This function is used to do the resource padding for a specific platform.
PciDev | Pci device instance. |
IoNode | Resource info node for IO. |
Mem32Node | Resource info node for 32-bit memory. |
PMem32Node | Resource info node for 32-bit Prefetchable Memory. |
Mem64Node | Resource info node for 64-bit memory. |
PMem64Node | Resource info node for 64-bit Prefetchable Memory. |
Definition at line 972 of file PciResourceSupport.c.
BOOLEAN ResourceRequestExisted | ( | IN PCI_RESOURCE_NODE * | Bridge | ) |
Test whether resource exists for a bridge.
Bridge | Point to resource node for a bridge. |
TRUE | There is resource on the given bridge. |
FALSE | There isn't resource on the given bridge. |
Definition at line 1716 of file PciResourceSupport.c.
This function is used to skip ISA aliasing aperture.
Start | Returned start address including ISA aliasing aperture. |
Length | The length of ISA aliasing aperture. |
Definition at line 58 of file PciResourceSupport.c.
The function is used to skip VGA range.
Start | Returned start address including VGA range. |
Length | The length of VGA range. |
Definition at line 26 of file PciResourceSupport.c.