TianoCore EDK2 master
|
#include <PiPei.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
#include <Library/PcdLib.h>
#include <Library/IoLib.h>
#include <Guid/MemoryAllocationHob.h>
#include <Guid/DebugPrintErrorLevel.h>
#include <Guid/SerialPortInfoGuid.h>
#include <Guid/MemoryMapInfoGuid.h>
#include <Guid/AcpiBoardInfoGuid.h>
#include <Guid/GraphicsInfoHob.h>
#include <Guid/UniversalPayloadBase.h>
#include <UniversalPayload/SmbiosTable.h>
#include <UniversalPayload/AcpiTable.h>
#include <UniversalPayload/UniversalPayload.h>
#include <UniversalPayload/ExtraData.h>
#include <UniversalPayload/SerialPortInfo.h>
#include <UniversalPayload/DeviceTree.h>
#include <UniversalPayload/PciRootBridges.h>
#include <IndustryStandard/SmBios.h>
#include <Library/PrintLib.h>
#include <Library/FdtLib.h>
#include <Protocol/PciHostBridgeResourceAllocation.h>
#include <Protocol/PciIo.h>
#include <Guid/PciSegmentInfoGuid.h>
Go to the source code of this file.
Macros | |
#define | MEMORY_ATTRIBUTE_DEFAULT |
#define | ROOT_BRIDGE_SUPPORTS_DEFAULT |
Enumerations | |
enum | FDT_NODE_TYPE { ReservedMemory = 1 , Memory , FrameBuffer , PciRootBridge , Options , DoNothing } |
Functions | |
EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI | HobConstructor (IN VOID *EfiMemoryBottom, IN VOID *EfiMemoryTop, IN VOID *EfiFreeMemoryBottom, IN VOID *EfiFreeMemoryTop) |
VOID | RecordMemoryNode (INT32 Node) |
BOOLEAN | CheckMemoryNodeIfInit (INT32 Node) |
FDT_NODE_TYPE | CheckNodeType (CHAR8 *NodeString, INT32 Depth) |
VOID | ParseMemory (IN VOID *Fdt, IN INT32 Node) |
VOID | ParseReservedMemory (IN VOID *Fdt, IN INT32 Node) |
CHAR8 * | ParseFrameBuffer (IN VOID *Fdt, IN INT32 Node) |
VOID | ParseOptions (IN VOID *Fdt, IN INT32 Node, OUT UINT8 *PciEnumDone, OUT EFI_BOOT_MODE *BootMode) |
VOID | ParsegraphicNode (IN VOID *Fdt, IN INT32 SubNode) |
VOID | ParseSerialPort (IN VOID *Fdt, IN INT32 SubNode) |
VOID | ParsePciRootBridge (IN VOID *Fdt, IN INT32 Node, IN UINT8 RootBridgeCount, IN CHAR8 *GmaStr, IN UINT8 *index) |
UINTN EFIAPI | ParseDtb (IN VOID *FdtBase) |
UINTN EFIAPI | FdtNodeParser (IN VOID *FdtBase) |
UINTN EFIAPI | UplInitHob (IN VOID *FdtBase) |
Variables | |
VOID * | mHobList |
UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES * | mPciRootBridgeInfo = NULL |
INT32 | mNode [0x500] = { 0 } |
UINT32 | mNodeIndex = 0 |
UPL_PCI_SEGMENT_INFO_HOB * | mUplPciSegmentInfoHob |
Copyright (c) 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FdtParserLib.c.
#define MEMORY_ATTRIBUTE_DEFAULT |
Definition at line 44 of file FdtParserLib.c.
#define ROOT_BRIDGE_SUPPORTS_DEFAULT |
Definition at line 52 of file FdtParserLib.c.
enum FDT_NODE_TYPE |
Definition at line 35 of file FdtParserLib.c.
BOOLEAN CheckMemoryNodeIfInit | ( | INT32 | Node | ) |
Check the memory node if initialized.
[in] | Node | memory node is going to parsing.. |
Definition at line 116 of file FdtParserLib.c.
FDT_NODE_TYPE CheckNodeType | ( | CHAR8 * | NodeString, |
INT32 | Depth | ||
) |
It will check device node from FDT.
[in] | NodeString | Device node name string. |
[in] | Depth | Check layer of Device node , only parse the 1st layer |
Definition at line 140 of file FdtParserLib.c.
It will Parse FDT -node based on information from bootloaders.
[in] | FdtBase | The starting memory address of FdtBase |
HobList | The base address of Hoblist. |
Definition at line 1002 of file FdtParserLib.c.
EFI_HOB_HANDOFF_INFO_TABLE *EFIAPI HobConstructor | ( | IN VOID * | EfiMemoryBottom, |
IN VOID * | EfiMemoryTop, | ||
IN VOID * | EfiFreeMemoryBottom, | ||
IN VOID * | EfiFreeMemoryTop | ||
) |
Build a Handoff Information Table HOB
This function initialize a HOB region from EfiMemoryBegin to EfiMemoryTop. And EfiFreeMemoryBottom and EfiFreeMemoryTop should be inside the HOB region.
[in] | EfiMemoryBottom | Total memory start address |
[in] | EfiMemoryTop | Total memory end address. |
[in] | EfiFreeMemoryBottom | Free memory start address |
[in] | EfiFreeMemoryTop | Free memory end address. |
It will parse FDT based on DTB from bootloaders.
[in] | FdtBase | Address of the Fdt data. |
Definition at line 792 of file FdtParserLib.c.
It will ParseFrameBuffer node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | SubNode | first Sub node of the PCI root bridge node. |
Definition at line 322 of file FdtParserLib.c.
It will Parsegraphic node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | SubNode | first Sub node of the PCI root bridge node. |
Definition at line 488 of file FdtParserLib.c.
It will ParseMemory node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | SubNode | first node of the PCI root bridge node. |
Definition at line 168 of file FdtParserLib.c.
VOID ParseOptions | ( | IN VOID * | Fdt, |
IN INT32 | Node, | ||
OUT UINT8 * | PciEnumDone, | ||
OUT EFI_BOOT_MODE * | BootMode | ||
) |
It will ParseOptions node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | SubNode | first Sub node of the PCI root bridge node. |
[out] | PciEnumDone | Init ParsePciRootBridge node for ParsePciRootBridge. |
[out] | BootMode | Init the system boot mode |
Definition at line 392 of file FdtParserLib.c.
VOID ParsePciRootBridge | ( | IN VOID * | Fdt, |
IN INT32 | Node, | ||
IN UINT8 | RootBridgeCount, | ||
IN CHAR8 * | GmaStr, | ||
IN UINT8 * | index | ||
) |
It will ParsePciRootBridge node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | Node | first node of the Fdt data. |
[in] | PciEnumDone | To use ParsePciRootBridge node. |
[in] | RootBridgeCount | Number of pci RootBridge. |
[in] | GmaStr | Graphic device node name string. |
[in] | index | Index of ParsePciRootBridge node. |
Definition at line 641 of file FdtParserLib.c.
It will ParseReservedMemory node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | SubNode | first node of the PCI root bridge node. |
Definition at line 226 of file FdtParserLib.c.
It will ParseSerialPort node from FDT.
[in] | Fdt | Address of the Fdt data. |
[in] | SubNode | first Sub node of the PCI root bridge node. |
Definition at line 569 of file FdtParserLib.c.
VOID RecordMemoryNode | ( | INT32 | Node | ) |
It will record the memory node initialized.
[in] | Node | memory node is going to parsing.. |
Definition at line 98 of file FdtParserLib.c.
It will initialize HOBs for UPL.
[in] | FdtBase | Address of the Fdt data. |
EFI_SUCCESS | If it completed successfully. |
Others | If it failed to initialize HOBs. |
Definition at line 1019 of file FdtParserLib.c.
INT32 mNode[0x500] = { 0 } |
Definition at line 64 of file FdtParserLib.c.
UINT32 mNodeIndex = 0 |
Definition at line 65 of file FdtParserLib.c.
UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES* mPciRootBridgeInfo = NULL |
Definition at line 63 of file FdtParserLib.c.
UPL_PCI_SEGMENT_INFO_HOB* mUplPciSegmentInfoHob |
Definition at line 66 of file FdtParserLib.c.