TianoCore EDK2 master
|
Go to the source code of this file.
Variables | |
EFI_CPU_IO2_PROTOCOL * | mCpuIo |
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 * | mAcpiAddressSpaceTypeStr [] |
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 * | mPciResourceTypeStr [] |
EDKII_IOMMU_PROTOCOL * | mIoMmu |
EFI_EVENT | mIoMmuEvent |
VOID * | mIoMmuRegistration |
Provides the basic interfaces to abstract a PCI Host Bridge Resource Allocation.
Copyright (c) 1999 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PciHostBridge.c.
EFI_STATUS AddIoSpace | ( | IN UINT64 | Base, |
IN UINT64 | Length | ||
) |
Add IO space to GCD. The routine checks the GCD database and only adds those which are not added in the specified range to GCD.
Base | Base address of the IO space. |
Length | Length of the IO space. |
EFI_SUCCES | The IO space was added successfully. |
Definition at line 165 of file PciHostBridge.c.
EFI_STATUS AddMemoryMappedIoSpace | ( | IN UINT64 | Base, |
IN UINT64 | Length, | ||
IN UINT64 | Capabilities | ||
) |
Add MMIO space to GCD. The routine checks the GCD database and only adds those which are not added in the specified range to GCD.
Base | Base address of the MMIO space. |
Length | Length of the MMIO space. |
Capabilities | Capabilities of the MMIO space. |
EFI_SUCCES | The MMIO space was added successfully. |
Definition at line 339 of file PciHostBridge.c.
UINT64 AllocateResource | ( | BOOLEAN | Mmio, |
UINT64 | Length, | ||
UINTN | BitsOfAlignment, | ||
UINT64 | BaseAddress, | ||
UINT64 | Limit | ||
) |
Allocate Length of MMIO or IO resource with alignment BitsOfAlignment from GCD range [BaseAddress, Limit).
Mmio | TRUE for MMIO and FALSE for IO. |
Length | Length of the resource to allocate. |
BitsOfAlignment | Alignment of the resource to allocate. |
BaseAddress | The starting address the allocation is from. |
Limit | The ending address the allocation is to. |
The | base address of the allocated resource or MAX_UINT64 if allocation fails. |
Definition at line 753 of file PciHostBridge.c.
EFI_STATUS EFIAPI GetAttributes | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_HANDLE | RootBridgeHandle, | ||
OUT UINT64 * | Attributes | ||
) |
Returns the attributes of a PCI Root Bridge.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | The device handle of the PCI Root Bridge that the caller is interested in. |
Attributes | The pointer to attributes of the PCI Root Bridge. |
EFI_SUCCESS | Succeed. |
EFI_INVALID_PARAMETER | Attributes parameter passed in is NULL or RootBridgeHandle is not an EFI_HANDLE that was returned on a previous call to GetNextRootBridge(). |
Definition at line 1271 of file PciHostBridge.c.
EFI_STATUS EFIAPI GetNextRootBridge | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN OUT EFI_HANDLE * | RootBridgeHandle | ||
) |
Return the device handle of the next PCI root bridge that is associated with this Host Bridge.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | Returns the device handle of the next PCI Root Bridge. On input, it holds the RootBridgeHandle returned by the most recent call to GetNextRootBridge().The handle for the first PCI Root Bridge is returned if RootBridgeHandle is NULL on input. |
EFI_SUCCESS | Succeed. |
EFI_NOT_FOUND | Next PCI root bridge not found. |
EFI_INVALID_PARAMETER | Wrong parameter passed in. |
Definition at line 1214 of file PciHostBridge.c.
EFI_STATUS EFIAPI GetProposedResources | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_HANDLE | RootBridgeHandle, | ||
OUT VOID ** | Configuration | ||
) |
This function returns the proposed resource settings for the specified PCI Root Bridge.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | The PCI Root Bridge handle. |
Configuration | The pointer to the pointer to the PCI I/O and memory resource descriptor. |
EFI_SUCCESS | Succeed. |
EFI_OUT_OF_RESOURCES | Not enough pool to be allocated. |
EFI_INVALID_PARAMETER | RootBridgeHandle is not a valid handle. |
Definition at line 1599 of file PciHostBridge.c.
UINT64 GetTranslationByResourceType | ( | IN PCI_ROOT_BRIDGE_INSTANCE * | RootBridge, |
IN PCI_RESOURCE_TYPE | ResourceType | ||
) |
This routine gets translation offset from a root bridge instance by resource type.
RootBridge | The Root Bridge Instance for the resources. |
ResourceType | The Resource Type of the translation offset. |
The | Translation Offset of the specified resource. |
Definition at line 36 of file PciHostBridge.c.
EFI_STATUS EFIAPI InitializePciHostBridge | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Entry point of this driver.
ImageHandle | Image handle of this driver. |
SystemTable | Pointer to standard EFI system table. |
EFI_SUCCESS | Succeed. |
EFI_DEVICE_ERROR | Fail to install PCI_ROOT_BRIDGE_IO protocol. |
Definition at line 437 of file PciHostBridge.c.
EFI_STATUS IntersectIoDescriptor | ( | IN UINT64 | Base, |
IN UINT64 | Length, | ||
IN CONST EFI_GCD_IO_SPACE_DESCRIPTOR * | Descriptor | ||
) |
Ensure the compatibility of an IO space descriptor with the IO aperture.
The IO space descriptor can come from the GCD IO space map, or it can represent a gap between two neighboring IO space descriptors. In the latter case, the GcdIoType field is expected to be EfiGcdIoTypeNonExistent.
If the IO space descriptor already has type EfiGcdIoTypeIo, then no action is taken – it is by definition compatible with the aperture.
Otherwise, the intersection of the IO space descriptor is calculated with the aperture. If the intersection is the empty set (no overlap), no action is taken; the IO space descriptor is compatible with the aperture.
Otherwise, the type of the descriptor is investigated again. If the type is EfiGcdIoTypeNonExistent (representing a gap, or a genuine descriptor with such a type), then an attempt is made to add the intersection as IO space to the GCD IO space map. This ensures continuity for the aperture, and the descriptor is deemed compatible with the aperture.
Otherwise, the IO space descriptor is incompatible with the IO aperture.
[in] | Base | Base address of the aperture. |
[in] | Length | Length of the aperture. |
[in] | Descriptor | The descriptor to ensure compatibility with the aperture for. |
EFI_SUCCESS | The descriptor is compatible. The GCD IO space map may have been updated, for continuity within the aperture. |
EFI_INVALID_PARAMETER | The descriptor is incompatible. |
Definition at line 94 of file PciHostBridge.c.
EFI_STATUS IntersectMemoryDescriptor | ( | IN UINT64 | Base, |
IN UINT64 | Length, | ||
IN UINT64 | Capabilities, | ||
IN CONST EFI_GCD_MEMORY_SPACE_DESCRIPTOR * | Descriptor | ||
) |
Ensure the compatibility of a memory space descriptor with the MMIO aperture.
The memory space descriptor can come from the GCD memory space map, or it can represent a gap between two neighboring memory space descriptors. In the latter case, the GcdMemoryType field is expected to be EfiGcdMemoryTypeNonExistent.
If the memory space descriptor already has type EfiGcdMemoryTypeMemoryMappedIo, and its capabilities are a superset of the required capabilities, then no action is taken – it is by definition compatible with the aperture.
Otherwise, the intersection of the memory space descriptor is calculated with the aperture. If the intersection is the empty set (no overlap), no action is taken; the memory space descriptor is compatible with the aperture.
Otherwise, the type of the descriptor is investigated again. If the type is EfiGcdMemoryTypeNonExistent (representing a gap, or a genuine descriptor with such a type), then an attempt is made to add the intersection as MMIO space to the GCD memory space map, with the specified capabilities. This ensures continuity for the aperture, and the descriptor is deemed compatible with the aperture.
Otherwise, the memory space descriptor is incompatible with the MMIO aperture.
[in] | Base | Base address of the aperture. |
[in] | Length | Length of the aperture. |
[in] | Capabilities | Capabilities required by the aperture. |
[in] | Descriptor | The descriptor to ensure compatibility with the aperture for. |
EFI_SUCCESS | The descriptor is compatible. The GCD memory space map may have been updated, for continuity within the aperture. |
EFI_INVALID_PARAMETER | The descriptor is incompatible. |
Definition at line 261 of file PciHostBridge.c.
Event notification that is fired when IOMMU protocol is installed.
Event | The Event that is being processed. |
Context | Event Context. |
Definition at line 411 of file PciHostBridge.c.
EFI_STATUS EFIAPI NotifyPhase | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE | Phase | ||
) |
Enter a certain phase of the PCI enumeration process.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL instance. |
Phase | The phase during enumeration. |
EFI_SUCCESS | Succeed. |
EFI_INVALID_PARAMETER | Wrong phase parameter passed in. |
EFI_NOT_READY | Resources have not been submitted yet. |
Definition at line 822 of file PciHostBridge.c.
EFI_STATUS EFIAPI PreprocessController | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_HANDLE | RootBridgeHandle, | ||
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS | PciAddress, | ||
IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE | Phase | ||
) |
This function is called for all the PCI controllers that the PCI bus driver finds. Can be used to Preprogram the controller.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | The PCI Root Bridge handle. |
PciAddress | Address of the controller on the PCI bus. |
Phase | The Phase during resource allocation. |
EFI_SUCCESS | Succeed. |
EFI_INVALID_PARAMETER | RootBridgeHandle is not a valid handle. |
Definition at line 1708 of file PciHostBridge.c.
VOID ResourceConflict | ( | IN PCI_HOST_BRIDGE_INSTANCE * | HostBridge | ) |
This routine constructs the resource descriptors for all root bridges and call PciHostBridgeResourceConflict().
HostBridge | The Host Bridge Instance where the resource adjustment happens. |
Definition at line 644 of file PciHostBridge.c.
EFI_STATUS EFIAPI SetBusNumbers | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_HANDLE | RootBridgeHandle, | ||
IN VOID * | Configuration | ||
) |
This function programs the PCI Root Bridge hardware so that it decodes the specified PCI bus range.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | The PCI Root Bridge whose bus range is to be programmed. |
Configuration | The pointer to the PCI bus resource descriptor. |
EFI_SUCCESS | Succeed. |
EFI_INVALID_PARAMETER | Wrong parameters passed in. |
Definition at line 1384 of file PciHostBridge.c.
EFI_STATUS EFIAPI StartBusEnumeration | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_HANDLE | RootBridgeHandle, | ||
OUT VOID ** | Configuration | ||
) |
This is the request from the PCI enumerator to set up the specified PCI Root Bridge for bus enumeration process.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | The PCI Root Bridge to be set up. |
Configuration | Pointer to the pointer to the PCI bus resource descriptor. |
EFI_SUCCESS | Succeed. |
EFI_OUT_OF_RESOURCES | Not enough pool to be allocated. |
EFI_INVALID_PARAMETER | RootBridgeHandle is not a valid handle. |
Definition at line 1317 of file PciHostBridge.c.
EFI_STATUS EFIAPI SubmitResources | ( | IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL * | This, |
IN EFI_HANDLE | RootBridgeHandle, | ||
IN VOID * | Configuration | ||
) |
Submits the I/O and memory resource requirements for the specified PCI Root Bridge.
This | The EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_ PROTOCOL instance. |
RootBridgeHandle | The PCI Root Bridge whose I/O and memory resource requirements. are being submitted. |
Configuration | The pointer to the PCI I/O and PCI memory resource descriptor. |
EFI_SUCCESS | Succeed. |
EFI_INVALID_PARAMETER | Wrong parameters passed in. |
Definition at line 1460 of file PciHostBridge.c.
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16* mAcpiAddressSpaceTypeStr[] |
Definition at line 16 of file PciHostBridge.c.
EFI_CPU_IO2_PROTOCOL* mCpuIo |
Definition at line 14 of file PciHostBridge.c.
EDKII_IOMMU_PROTOCOL* mIoMmu |
Definition at line 23 of file PciHostBridge.c.
EFI_EVENT mIoMmuEvent |
Definition at line 24 of file PciHostBridge.c.
VOID* mIoMmuRegistration |
Definition at line 25 of file PciHostBridge.c.
GLOBAL_REMOVE_IF_UNREFERENCED CHAR16* mPciResourceTypeStr[] |
Definition at line 19 of file PciHostBridge.c.