TianoCore EDK2 master
Loading...
Searching...
No Matches
HardwareInfoPciHostBridgeLib.h File Reference

Go to the source code of this file.

Data Structures

struct  HOST_BRIDGE_INFO
 

Functions

EFI_STATUS HardwareInfoPciHostBridgeLastMmioAddress (IN CONST HOST_BRIDGE_INFO *HostBridge, IN UINTN DataSize, IN BOOLEAN HighMem, OUT UINT64 *LastMmioAddress)
 
EFI_STATUS HardwareInfoPciHostBridgeGetBusNrRange (IN CONST HOST_BRIDGE_INFO *HostBridge, IN UINTN DataSize, OUT UINTN *BusNrStart, OUT UINTN *BusNrLast)
 
EFI_STATUS HardwareInfoPciHostBridgeGetApertures (IN CONST HOST_BRIDGE_INFO *HostBridge, IN UINTN DataSize, OUT PCI_ROOT_BRIDGE_APERTURE *Io, OUT PCI_ROOT_BRIDGE_APERTURE *Mem, OUT PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, OUT PCI_ROOT_BRIDGE_APERTURE *PMem, OUT PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G, OUT PCI_ROOT_BRIDGE_APERTURE *PcieConfig)
 
EFI_STATUS HardwareInfoPciHostBridgeGetFlags (IN CONST HOST_BRIDGE_INFO *HostBridge, IN UINTN DataSize, OUT UINT64 *Attributes OPTIONAL, OUT BOOLEAN *DmaAbove4G OPTIONAL, OUT BOOLEAN *NoExtendedConfigSpace OPTIONAL, OUT BOOLEAN *CombineMemPMem OPTIONAL)
 
EFI_STATUS HardwareInfoPciHostBridgeGet (IN CONST HOST_BRIDGE_INFO *HostBridge, IN UINTN DataSize, OUT UINTN *BusNrStart, OUT UINTN *BusNrLast, OUT UINT64 *Attributes OPTIONAL, OUT BOOLEAN *DmaAbove4G OPTIONAL, OUT BOOLEAN *NoExtendedConfigSpace OPTIONAL, OUT BOOLEAN *CombineMemPMem OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *Io OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *Mem OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *MemAbove4G OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PMem OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G OPTIONAL, OUT PCI_ROOT_BRIDGE_APERTURE *PcieConfig OPTIONAL)
 

Detailed Description

Hardware info library with types and accessors to parse information about PCI host bridges.

Copyright 2021 - 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HardwareInfoPciHostBridgeLib.h.

Function Documentation

◆ HardwareInfoPciHostBridgeGet()

EFI_STATUS HardwareInfoPciHostBridgeGet ( IN CONST HOST_BRIDGE_INFO HostBridge,
IN UINTN  DataSize,
OUT UINTN BusNrStart,
OUT UINTN BusNrLast,
OUT UINT64 *Attributes  OPTIONAL,
OUT BOOLEAN *DmaAbove4G  OPTIONAL,
OUT BOOLEAN *NoExtendedConfigSpace  OPTIONAL,
OUT BOOLEAN *CombineMemPMem  OPTIONAL,
OUT PCI_ROOT_BRIDGE_APERTURE *Io  OPTIONAL,
OUT PCI_ROOT_BRIDGE_APERTURE *Mem  OPTIONAL,
OUT PCI_ROOT_BRIDGE_APERTURE *MemAbove4G  OPTIONAL,
OUT PCI_ROOT_BRIDGE_APERTURE *PMem  OPTIONAL,
OUT PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G  OPTIONAL,
OUT PCI_ROOT_BRIDGE_APERTURE *PcieConfig  OPTIONAL 
)

Getter that parses information from a HOST_BRIDGE_INFO object into smaller chunks of types handled by the PciHostBridgeLib.

Parameters
[in]HostBridgeHost bridge information object
[in]DataSizeSize in bytes of the actually filled data available in the HostBridge object
[out]BusNrStartPointer to the Bus Number range start
[out]BusNrLastPointer to the Bus Number range end
[out]AttributesPointer to the host bridge's attributes
[out]DmaAbove4GPointer to the DMA Above 4G flag
[out]NoExtendedConfigSpacePointer to the Extended Config Space flag
[out]CombineMemPMemPointer to the Combine Mem and PMem flag
[out]IoPointer to the PIO aperture object
[out]MemPointer to the 32-bit MMIO aperture object
[out]MemAbove4GPointer to the 64-bit MMIO aperture object
[out]PMemPointer to the 32-bit prefetchable MMIO aperture object
[out]PMemAbove4GPointer to the 64-bit prefetchable MMIO aperture object
[out]PcieConfigMMIO mapped PCIe config aperture (ECAM)
Return values
EFI_SUCCESSWhole operation succeeded
EFI_INVALID_PARAMETERHostBridge object and/or non-optional output parameters are invalid
EFI_INCOMPATIBLE_VERSIONHostBridge information provided belongs to and unsupported version
EFI_WARN_STALE_DATAOne or more apertures having valid ranges in the HostBridge info were ignored because the correspnding aperture pointer is NULL

Definition at line 453 of file HardwareInfoPciHostBridgeLib.c.

◆ HardwareInfoPciHostBridgeGetApertures()

EFI_STATUS HardwareInfoPciHostBridgeGetApertures ( IN CONST HOST_BRIDGE_INFO HostBridge,
IN UINTN  DataSize,
OUT PCI_ROOT_BRIDGE_APERTURE Io,
OUT PCI_ROOT_BRIDGE_APERTURE Mem,
OUT PCI_ROOT_BRIDGE_APERTURE MemAbove4G,
OUT PCI_ROOT_BRIDGE_APERTURE PMem,
OUT PCI_ROOT_BRIDGE_APERTURE PMemAbove4G,
OUT PCI_ROOT_BRIDGE_APERTURE PcieConfig 
)

Interpret the MMIO resources in HostBridge and set the apertures in 32-bit space (Mem), 64-bit space (MemAbove4G), PIO (IO) and ECAM (PcieConfig) accordingly.

The 2 types of apertures in each MMIO space (prefetchable and non-prefetchable) may be merged into a single window, hence if both types of apertures are defined while the CombineMemPMem flag is set, the ranges must be contiguous.

Parameters
[in]HostBridgeRoot bridge's resources specification
[in]DataSizeSize in bytes of the actually filled data available in the HostBridge object
[out]MemPointer to 32-bit MMIO aperture
[out]MemAbove4GPointer to 64-bit MMIO aperture
[out]PMemPointer to the 32-bit prefetchable MMIO aperture
[out]PMemAbove4GPointer to the 64-bit prefetchable MMIO aperture
[out]PcieConfigPointer to MMIO mapped PCIe config aperture (ECAM)
Return values
EFI_INVALID_PARAMETERHostBridge object is invalid
EFI_INCOMPATIBLE_VERSIONHostBridge information belongs to an unsupported version
EFI_WARN_STALE_DATAOne or more valid aperture in the HostBridge's resources were ignored because corresponding aperture pointer is NULL.
EFI_SUCCESSOperation executed cleanly, all valid ranges were parsed into the corresponding aperture object.

Definition at line 297 of file HardwareInfoPciHostBridgeLib.c.

◆ HardwareInfoPciHostBridgeGetBusNrRange()

EFI_STATUS HardwareInfoPciHostBridgeGetBusNrRange ( IN CONST HOST_BRIDGE_INFO HostBridge,
IN UINTN  DataSize,
OUT UINTN BusNrStart,
OUT UINTN BusNrLast 
)

Interpret the HostBridge resources and extact the bus number range.

Parameters
[in]HostBridgeRoot bridge's resources specification
[in]DataSizeSize in bytes of the actually filled data available in the HostBridge object
[out]BusNrStartPointer to the Bus Number range start
[out]BusNrLastPointer to the Bus Number range end
Return values
EFI_SUCCESSRetrieved the bus number range without any issues.
EFI_INVALID_PARAMETEROne of the parameters is invalid, either NULL pointer or size 0
EFI_INCOMPATIBLE_VERSIONHostBridge data of unsupported version

Definition at line 270 of file HardwareInfoPciHostBridgeLib.c.

◆ HardwareInfoPciHostBridgeGetFlags()

EFI_STATUS HardwareInfoPciHostBridgeGetFlags ( IN CONST HOST_BRIDGE_INFO HostBridge,
IN UINTN  DataSize,
OUT UINT64 *Attributes  OPTIONAL,
OUT BOOLEAN *DmaAbove4G  OPTIONAL,
OUT BOOLEAN *NoExtendedConfigSpace  OPTIONAL,
OUT BOOLEAN *CombineMemPMem  OPTIONAL 
)

Retrieve all flags and attributes of a host bridge describing the resources and capabilities.

Parameters
[in]HostBridgeHost bridge information object
[in]DataSizeSize in bytes of the actually filled data available in the HostBridge object
[out]AttributesPointer to the host bridge's attributes
[out]DmaAbove4GPointer to the DMA Above 4G flag
[out]NoExtendedConfigSpacePointer to the Extended Config Space flag
[out]CombineMemPMemPointer to the Combine Mem and PMem flag
Return values
EFI_INVALID_PARAMETERHostBridge object is invalid
EFI_INCOMPATIBLE_VERSIONHostBridge information belongs to an unsupported version
EFI_SUCCESSOperation executed cleanly

Definition at line 413 of file HardwareInfoPciHostBridgeLib.c.

◆ HardwareInfoPciHostBridgeLastMmioAddress()

EFI_STATUS HardwareInfoPciHostBridgeLastMmioAddress ( IN CONST HOST_BRIDGE_INFO HostBridge,
IN UINTN  DataSize,
IN BOOLEAN  HighMem,
OUT UINT64 *  LastMmioAddress 
)

Extract the last MMIO address, either from high (64-bit) or low (32-bit) memory used by the HostBridge's apertures.

Parameters
[in]HostBridgeRoot bridge's resources specification
[in]DataSizeSize in bytes of the actually filled data available in the HostBridge object
[in]HighMem64-bit (true) or 32-bit (false) MMIO address
[out]LastMmioAddressPointer to last MMIO address
Return values
EFI_SUCCESSOperation succeeded
EFI_INVALID_PARAMETEROne or more pointer parameters are invalid
EFI_INCOMPATIBLE_VERSIONHostBridge information belongs to an unsupported version

Definition at line 61 of file HardwareInfoPciHostBridgeLib.c.