TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
struct | PciParserTable |
Macros | |
#define | READ_BITS(ADDR, OFF, LEN) (((ADDR) >> (OFF)) & ((1<<(LEN))-1)) |
#define | READ_PCI_N(ADDR) READ_BITS((ADDR), 31, 1) |
0 if relocatable. | |
#define | READ_PCI_P(ADDR) READ_BITS((ADDR), 30, 1) |
1 if prefetchable. | |
#define | READ_PCI_T(ADDR) READ_BITS((ADDR), 29, 1) |
1 if aliased. | |
#define | READ_PCI_SS(ADDR) READ_BITS((ADDR), 24, 2) |
#define | READ_PCI_BBBBBBBB(ADDR) READ_BITS((ADDR), 16, 8) |
Bus number. | |
#define | READ_PCI_DDDDD(ADDR) READ_BITS((ADDR), 11, 5) |
Device number. | |
#define | PCI_ADDRESS_CELLS 3U |
#define | PCI_SIZE_CELLS 2U |
#define | PCI_INTERRUPTS_CELLS 1U |
#define | DT_PCI_IRQ_FLAGS(x) (((x) & 0xF) == BIT0) |
Typedefs | |
typedef enum PciMappingTable | PCI_MAPPING_TABLE |
typedef struct PciParserTable | PCI_PARSER_TABLE |
Enumerations | |
enum | PciMappingTable { PciMappingTableAddress , PciMappingTableInterrupt , PciMappingTableMax } |
Functions | |
EFI_STATUS EFIAPI | PciConfigInfoParser (IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch) |
PCI Configuration Space Parser.
Copyright (c) 2021, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file PciConfigSpaceParser.h.
#define DT_PCI_IRQ_FLAGS | ( | x | ) | (((x) & 0xF) == BIT0) |
PCI interrupt flags for device-tree.
Local Bus Specification Revision 3.0, s2.2.6., Interrupt Pins:
Definition at line 65 of file PciConfigSpaceParser.h.
#define PCI_ADDRESS_CELLS 3U |
Number of device-tree cells used for PCI nodes properties.
Values are well defined, except the "#interrupt-cells" which is assumed to be 1.
Definition at line 55 of file PciConfigSpaceParser.h.
#define PCI_INTERRUPTS_CELLS 1U |
Definition at line 57 of file PciConfigSpaceParser.h.
#define PCI_SIZE_CELLS 2U |
Definition at line 56 of file PciConfigSpaceParser.h.
#define READ_BITS | ( | ADDR, | |
OFF, | |||
LEN | |||
) | (((ADDR) >> (OFF)) & ((1<<(LEN))-1)) |
Read LEN bits at OFF offsets bits of the ADDR.
[in] | ADDR | Address to read the bits from. |
[in] | OFF | Offset of the bits to read. |
[in] | LEN | Number of bits to read. |
Definition at line 26 of file PciConfigSpaceParser.h.
#define READ_PCI_BBBBBBBB | ( | ADDR | ) | READ_BITS((ADDR), 16, 8) |
Bus number.
Definition at line 46 of file PciConfigSpaceParser.h.
#define READ_PCI_DDDDD | ( | ADDR | ) | READ_BITS((ADDR), 11, 5) |
Device number.
Definition at line 48 of file PciConfigSpaceParser.h.
#define READ_PCI_N | ( | ADDR | ) | READ_BITS((ADDR), 31, 1) |
0 if relocatable.
Definition at line 31 of file PciConfigSpaceParser.h.
#define READ_PCI_P | ( | ADDR | ) | READ_BITS((ADDR), 30, 1) |
1 if prefetchable.
Definition at line 33 of file PciConfigSpaceParser.h.
#define READ_PCI_SS | ( | ADDR | ) | READ_BITS((ADDR), 24, 2) |
Space code.
00: Configuration Space 01: I/O Space 10: 32-bit-address Memory Space 11: 64-bit-address Memory Space
Definition at line 44 of file PciConfigSpaceParser.h.
#define READ_PCI_T | ( | ADDR | ) | READ_BITS((ADDR), 29, 1) |
1 if aliased.
Definition at line 35 of file PciConfigSpaceParser.h.
typedef enum PciMappingTable PCI_MAPPING_TABLE |
Indexes in the mapping table.
typedef struct PciParserTable PCI_PARSER_TABLE |
PCI parser table
Multiple address-map and interrupt map can correspond to one host-pci device. This structure allows to temporarily store the CmObjects created and generate tokens once the whole device tree is parsed.
enum PciMappingTable |
Indexes in the mapping table.
Enumerator | |
---|---|
PciMappingTableAddress | 0 - Address mapping |
PciMappingTableInterrupt | 1 - Interrupt mapping |
PciMappingTableMax | 2 - Max |
Definition at line 69 of file PciConfigSpaceParser.h.
EFI_STATUS EFIAPI PciConfigInfoParser | ( | IN CONST FDT_HW_INFO_PARSER_HANDLE | FdtParserHandle, |
IN INT32 | FdtBranch | ||
) |
CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO parser function.
The following structure is populated: typedef struct CmArchCommonPciConfigSpaceInfo { UINT64 BaseAddress; // {Populated} UINT16 PciSegmentGroupNumber; // {Populated} UINT8 StartBusNumber; // {Populated} UINT8 EndBusNumber; // {Populated} } CM_ARCH_COMMON_PCI_CONFIG_SPACE_INFO;
typedef struct CmArchCommonPciAddressMapInfo { UINT8 SpaceCode; // {Populated} UINT64 PciAddress; // {Populated} UINT64 CpuAddress; // {Populated} UINT64 AddressSize; // {Populated} } CM_ARCH_COMMON_PCI_ADDRESS_MAP_INFO;
typedef struct CmArchCommonPciInterruptMapInfo { UINT8 PciBus; // {Populated} UINT8 PciDevice; // {Populated} UINT8 PciInterrupt; // {Populated} CM_ARCH_COMMON_GENERIC_INTERRUPT IntcInterrupt; // {Populated} } CM_ARCH_COMMON_PCI_INTERRUPT_MAP_INFO;
A parser parses a Device Tree to populate a specific CmObj type. None, one or many CmObj can be created by the parser. The created CmObj are then handed to the parser's caller through the HW_INFO_ADD_OBJECT interface. This can also be a dispatcher. I.e. a function that not parsing a Device Tree but calling other parsers.
[in] | FdtParserHandle | A handle to the parser instance. |
[in] | FdtBranch | When searching for DT node name, restrict the search to this Device Tree branch. |
EFI_SUCCESS | The function completed successfully. |
EFI_ABORTED | An error occurred. |
EFI_INVALID_PARAMETER | Invalid parameter. |
EFI_NOT_FOUND | Not found. |
EFI_UNSUPPORTED | Unsupported. |
Definition at line 722 of file PciConfigSpaceParser.c.