|
TianoCore EDK2 master
|
Go to the source code of this file.
Data Structures | |
| struct | FDT_HEADER |
| struct | FDT_RESERVE_ENTRY |
| struct | FDT_NODE_HEADER |
| struct | FDT_PROPERTY |
Macros | |
| #define | FDT_ERR_NOTFOUND 1 |
| #define | FDT_ERR_EXISTS 2 |
| #define | FDT_ERR_NOSPACE 3 |
| #define | FDT_ERR_BADOFFSET 4 |
| #define | FDT_ERR_BADPATH 5 |
| #define | FDT_ERR_BADPHANDLE 6 |
| #define | FDT_ERR_BADSTATE 7 |
| #define | FDT_ERR_TRUNCATED 8 |
| #define | FDT_ERR_BADMAGIC 9 |
| #define | FDT_ERR_BADVERSION 10 |
| #define | FDT_ERR_BADSTRUCTURE 11 |
| #define | FDT_ERR_BADLAYOUT 12 |
| #define | FDT_ERR_INTERNAL 13 |
| #define | FDT_ERR_BADNCELLS 14 |
| #define | FDT_ERR_BADVALUE 15 |
| #define | FDT_ERR_BADOVERLAY 16 |
| #define | FDT_ERR_NOPHANDLES 17 |
| #define | FDT_ERR_BADFLAGS 18 |
| #define | FDT_ERR_ALIGNMENT 19 |
| #define | FDT_ERR_MAX 19 |
| #define | FDT_TAGSIZE sizeof(UINT32) |
| #define | FDT_MAX_NCELLS 4 |
| #define | FdtGetHeader(Fdt, Field) (Fdt32ToCpu (((const FDT_HEADER *)(Fdt))->Field)) |
| #define | FdtTotalSize(Fdt) (FdtGetHeader ((Fdt), TotalSize)) |
| #define | FdtForEachSubnode(Node, Fdt, Parent) |
Functions | |
| UINT16 EFIAPI | Fdt16ToCpu (IN UINT16 Value) |
| UINT16 EFIAPI | CpuToFdt16 (IN UINT16 Value) |
| UINT32 EFIAPI | Fdt32ToCpu (IN UINT32 Value) |
| UINT32 EFIAPI | CpuToFdt32 (IN UINT32 Value) |
| UINT64 EFIAPI | Fdt64ToCpu (IN UINT64 Value) |
| UINT64 EFIAPI | CpuToFdt64 (IN UINT64 Value) |
| INT32 EFIAPI | FdtCheckHeader (IN CONST VOID *Fdt) |
| INT32 EFIAPI | FdtOpenInto (IN CONST VOID *Fdt, OUT VOID *Buffer, IN INT32 BufferSize) |
| INT32 EFIAPI | FdtPack (IN OUT VOID *Fdt) |
| INT32 EFIAPI | FdtCreateEmptyTree (IN VOID *Buffer, IN UINT32 BufferSize) |
| CONST VOID *EFIAPI | FdtOffsetPointer (IN CONST VOID *Fdt, IN INT32 Offset, IN UINT32 Length) |
| INT32 EFIAPI | FdtNextNode (IN CONST VOID *Fdt, IN INT32 Offset, IN INT32 *Depth) |
| INT32 EFIAPI | FdtFirstSubnode (IN CONST VOID *Fdt, IN INT32 Offset) |
| INT32 EFIAPI | FdtNextSubnode (IN CONST VOID *Fdt, IN INT32 Offset) |
| INT32 EFIAPI | FdtSubnodeOffsetNameLen (IN CONST VOID *Fdt, IN INT32 ParentOffset, IN CONST CHAR8 *Name, IN INT32 NameLength) |
| INTN EFIAPI | FdtGetNumberOfReserveMapEntries (IN CONST VOID *Fdt) |
| INTN EFIAPI | FdtGetReserveMapEntry (IN CONST VOID *Fdt, IN INTN Index, OUT UINT64 *Addr, OUT UINT64 *Size) |
| INT32 EFIAPI | FdtParentOffset (IN CONST VOID *Fdt, IN INT32 NodeOffset) |
| INT32 EFIAPI | FdtNodeOffsetByPropertyValue (IN CONST VOID *Fdt, IN INT32 StartOffset, IN CONST CHAR8 *PropertyName, IN CONST VOID *PropertyValue, IN INT32 PropertyLength) |
| INT32 EFIAPI | FdtNodeOffsetByPhandle (IN CONST VOID *Fdt, IN UINT32 Phandle) |
| INT32 EFIAPI | FdtStringListContains (IN CONST CHAR8 *StringList, IN INT32 ListLength, IN CONST CHAR8 *String) |
| CONST FDT_PROPERTY *EFIAPI | FdtGetProperty (IN CONST VOID *Fdt, IN INT32 NodeOffset, IN CONST CHAR8 *Name, IN INT32 *Length) |
| CONST CHAR8 *EFIAPI | FdtGetAliasNameLen (IN CONST VOID *Fdt, IN CONST CHAR8 *Name, IN INT32 Length) |
| INT32 EFIAPI | FdtFirstPropertyOffset (IN CONST VOID *Fdt, IN INT32 NodeOffset) |
| INT32 EFIAPI | FdtNextPropertyOffset (IN CONST VOID *Fdt, IN INT32 Offset) |
| CONST FDT_PROPERTY *EFIAPI | FdtGetPropertyByOffset (IN CONST VOID *Fdt, IN INT32 Offset, IN INT32 *Length) |
| CONST CHAR8 *EFIAPI | FdtGetString (IN CONST VOID *Fdt, IN INT32 StrOffset, IN INT32 *Length OPTIONAL) |
| INT32 EFIAPI | FdtAddSubnode (IN VOID *Fdt, IN INT32 ParentOffset, IN CONST CHAR8 *Name) |
| INT32 EFIAPI | FdtSetProperty (IN VOID *Fdt, IN INT32 NodeOffset, IN CONST CHAR8 *Name, IN CONST VOID *Value, IN UINT32 Length) |
| INT32 EFIAPI | FdtSetPropU64 (IN VOID *Fdt, IN INT32 NodeOffset, IN CONST CHAR8 *Name, IN UINT64 Value) |
| INT32 EFIAPI | FdtAppendProp (IN VOID *Fdt, IN INT32 NodeOffset, IN CONST CHAR8 *Name, IN CONST VOID *Value, IN UINT32 Length) |
| INT32 | FdtDelProp (IN OUT VOID *Fdt, IN INT32 NodeOffset, IN CONST CHAR8 *Name) |
| INT32 EFIAPI | FdtPathOffsetNameLen (IN CONST VOID *Fdt, IN CONST CHAR8 *Path, IN INT32 NameLength) |
| INT32 EFIAPI | FdtPathOffset (IN CONST VOID *Fdt, IN CONST CHAR8 *Path) |
| CONST CHAR8 *EFIAPI | FdtGetName (IN VOID *Fdt, IN INT32 NodeOffset, IN INT32 *Length) |
| INT32 EFIAPI | FdtNodeDepth (IN CONST VOID *Fdt, IN INT32 NodeOffset) |
| INT32 EFIAPI | FdtNodeOffsetByCompatible (IN CONST VOID *Fdt, IN INT32 StartOffset, IN CONST CHAR8 *Compatible) |
| INT32 EFIAPI | FdtAddressCells (IN CONST VOID *Fdt, IN INT32 NodeOffset) |
| INT32 EFIAPI | FdtSizeCells (IN CONST VOID *Fdt, IN INT32 NodeOffset) |
| CONST CHAR8 * | FdtStrerror (IN INT32 ErrVal) |
Flattened Device Tree Library.
All structure data are in big-endian format. Functions are provided for converting data between little-endian and big-endian. For example: Pushing data to FDT blob needs to convert data to big-endian by CpuToFdt*(). Retrieving data from FDT blob needs to convert data to little-endian by Fdt*ToCpu(). Refer to FDT specification: https://www.devicetree.org/specifications/
Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FdtLib.h.
| #define FdtForEachSubnode | ( | Node, | |
| Fdt, | |||
| Parent | |||
| ) |
| #define FdtGetHeader | ( | Fdt, | |
| Field | |||
| ) | (Fdt32ToCpu (((const FDT_HEADER *)(Fdt))->Field)) |
| #define FdtTotalSize | ( | Fdt | ) | (FdtGetHeader ((Fdt), TotalSize)) |
| UINT16 EFIAPI CpuToFdt16 | ( | IN UINT16 | Value | ) |
| UINT32 EFIAPI CpuToFdt32 | ( | IN UINT32 | Value | ) |
| UINT64 EFIAPI CpuToFdt64 | ( | IN UINT64 | Value | ) |
| UINT16 EFIAPI Fdt16ToCpu | ( | IN UINT16 | Value | ) |
| UINT32 EFIAPI Fdt32ToCpu | ( | IN UINT32 | Value | ) |
| UINT64 EFIAPI Fdt64ToCpu | ( | IN UINT64 | Value | ) |
| INT32 EFIAPI FdtAppendProp | ( | IN VOID * | Fdt, |
| IN INT32 | NodeOffset, | ||
| IN CONST CHAR8 * | Name, | ||
| IN CONST VOID * | Value, | ||
| IN UINT32 | Length | ||
| ) |
Append or create a property in the given node.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | The offset to the node offset which want to add in. |
| [in] | Name | The name to name the property. |
| [in] | Value | The value (big-endian) to the property value. |
| [in] | Length | The length to the size of the property. |
Delete a property.
This function will delete data from the blob, and will therefore change the offsets of some existing nodes.
| [in] |
out] Fdt Pointer to the device tree blob.
| [in] | NodeOffset | Offset of the node whose property to nop. |
| [in] | Name | Name of the property to nop. |
| CONST CHAR8 *EFIAPI FdtGetAliasNameLen | ( | IN CONST VOID * | Fdt, |
| IN CONST CHAR8 * | Name, | ||
| IN INT32 | Length | ||
| ) |
Returns a pointer to a node mapped to an alias matching a substring.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | Name | The alias name string. |
| [in] | Length | The length to the size of the property found. |
Returns the name of a given node.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffse | Offset of node to check. |
| [in] | Length | The pointer to an integer variable (will be overwritten) or NULL. |
Returns the name of a given node.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | Offset of node to check. |
| [in] | Length | The pointer to an integer variable (will be overwritten) or NULL. |
| CONST FDT_PROPERTY *EFIAPI FdtGetProperty | ( | IN CONST VOID * | Fdt, |
| IN INT32 | NodeOffset, | ||
| IN CONST CHAR8 * | Name, | ||
| IN INT32 * | Length | ||
| ) |
Returns a property with the given name from the given node.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | The offset to the given node. |
| [in] | Name | The name to the property which need be searched |
| [in] | Length | The length to the size of the property found. |
| CONST FDT_PROPERTY *EFIAPI FdtGetPropertyByOffset | ( | IN CONST VOID * | Fdt, |
| IN INT32 | Offset, | ||
| IN INT32 * | Length | ||
| ) |
Returns a property from the given offset of the property.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | Offset | The offset to the given offset of the property. |
| [in] | Length | The length to the size of the property found. |
| INTN EFIAPI FdtGetReserveMapEntry | ( | IN CONST VOID * | Fdt, |
| IN INTN | Index, | ||
| OUT EFI_PHYSICAL_ADDRESS * | Addr, | ||
| OUT UINT64 * | Size | ||
| ) |
Returns a memory reserve map entry.
| [in] | *Fdt | The pointer to FDT blob. |
| [in] | Index | Index of reserve map entry. |
| [out] | Addr | Pointer to 64-bit variable to hold the start address |
| [out] | *Size | Pointer to 64-bit variable to hold size of reservation |
| CONST CHAR8 *EFIAPI FdtGetString | ( | IN CONST VOID * | Fdt, |
| IN INT32 | StrOffset, | ||
| IN INT32 *Length | OPTIONAL | ||
| ) |
Returns a string by the given string offset.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | StrOffset | The offset to the location in the strings block of FDT. |
| [in] | Length | The length to the size of string which need be retrieved. |
FdtNodeDepth() finds the depth of a given node. The root node has depth 0, its immediate subnodes depth 1 and so forth.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | Offset of node to check. |
FdtNodeDepth() finds the depth of a given node. The root node has depth 0, its immediate subnodes depth 1 and so forth.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | Offset of node to check. |
| INT32 EFIAPI FdtNodeOffsetByPropertyValue | ( | IN CONST VOID * | Fdt, |
| IN INT32 | StartOffset, | ||
| IN CONST CHAR8 * | PropertyName, | ||
| IN CONST VOID * | PropertyValue, | ||
| IN INT32 | PropertyLength | ||
| ) |
Returns a offset of first node which includes the given property name and value.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | StartOffset | The offset to the starting node to find. |
| [in] | PropertyName | The property name to search the node including the named property. |
| [in] | PropertyValue | The property value (big-endian) to check the same property value. |
| [in] | PropertyLength | The length of the value in PropertValue. |
| INT32 EFIAPI FdtSetProperty | ( | IN VOID * | Fdt, |
| IN INT32 | NodeOffset, | ||
| IN CONST CHAR8 * | Name, | ||
| IN CONST VOID * | Value, | ||
| IN UINT32 | Length | ||
| ) |
Add or modify a property in the given node.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | The offset to the node offset which want to add in. |
| [in] | Name | The name to name the property. |
| [in] | Value | The value (big-endian) to the property value. |
| [in] | Length | The length to the size of the property. |
| INT32 EFIAPI FdtSetPropU64 | ( | IN VOID * | Fdt, |
| IN INT32 | NodeOffset, | ||
| IN CONST CHAR8 * | Name, | ||
| IN UINT64 | Value | ||
| ) |
Set a property to a 64-bit integer.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | NodeOffset | The offset to the node offset which want to add in. |
| [in] | Name | The name to name the property. |
| [in] | Value | The value (big-endian) to the property value. |
| INT32 EFIAPI FdtSubnodeOffsetNameLen | ( | IN CONST VOID * | Fdt, |
| IN INT32 | ParentOffset, | ||
| IN CONST CHAR8 * | Name, | ||
| IN INT32 | NameLength | ||
| ) |
Returns a offset of first node which includes the given name.
| [in] | Fdt | The pointer to FDT blob. |
| [in] | ParentOffset | The offset to the node which start find under. |
| [in] | Name | The name to search the node with the name. |
| [in] | NameLength | The length of the name to check only. |