TianoCore EDK2 master
Loading...
Searching...
No Matches
FdtUtility.h
Go to the documentation of this file.
1
13#ifndef FDT_UTILITY_H_
14#define FDT_UTILITY_H_
15
31#define GET_DT_REG_ADDRESS_OFFSET(Index, AddrCells, SizeCells) ( \
32 (Index) * ((AddrCells) + (SizeCells)) \
33 )
34
50#define GET_DT_REG_SIZE_OFFSET(Index, AddrCells, SizeCells) ( \
51 GET_DT_REG_ADDRESS_OFFSET ((Index), (AddrCells), (SizeCells)) + \
52 (SizeCells) \
53 )
54
56#define COMPATIBLE_STR_LEN (32U)
57
59#define PPI_OFFSET (16U)
60#define SPI_OFFSET (32U)
61#define DT_PPI_IRQ (1U)
62#define DT_SPI_IRQ (0U)
63#define DT_IRQ_IS_EDGE_TRIGGERED(x) ((((x) & (BIT0 | BIT1)) != 0))
64#define DT_IRQ_IS_ACTIVE_LOW(x) ((((x) & (BIT1 | BIT3)) != 0))
65#define IRQ_TYPE_OFFSET (0U)
66#define IRQ_NUMBER_OFFSET (1U)
67#define IRQ_FLAGS_OFFSET (2U)
68
79UINT32
80EFIAPI
82 UINT32 CONST *Data
83 );
84
94UINT32
95EFIAPI
97 UINT32 CONST *Data
98 );
99
102typedef struct CompatStr {
105
108typedef struct CompatibilityInfo {
110 UINT32 Count;
111
115
125typedef
126BOOLEAN
127(EFIAPI *NODE_CHECKER_FUNC)(
128 IN CONST VOID *Fdt,
129 IN INT32 NodeOffset,
130 IN CONST VOID *Context
131 );
132
146BOOLEAN
147EFIAPI
149 IN CONST VOID *Fdt,
150 IN INT32 Node,
151 IN CONST VOID *CompatInfo
152 );
153
164BOOLEAN
165EFIAPI
167 IN CONST VOID *Fdt,
168 IN INT32 Node,
169 IN CONST VOID *PropertyName
170 );
171
195EFIAPI
197 IN CONST VOID *Fdt,
198 IN INT32 FdtBranch,
199 IN CONST CHAR8 *NodeName,
200 IN OUT INT32 *Node
201 );
202
226EFIAPI
228 IN CONST VOID *Fdt,
229 IN INT32 FdtBranch,
230 IN CONST COMPATIBILITY_INFO *CompatNamesInfo,
231 IN OUT INT32 *Node
232 );
233
257EFIAPI
259 IN CONST VOID *Fdt,
260 IN INT32 FdtBranch,
261 IN CONST CHAR8 *PropName,
262 IN OUT INT32 *Node
263 );
264
281EFIAPI
283 IN CONST VOID *Fdt,
284 IN INT32 FdtBranch,
285 IN CONST CHAR8 *NodeName,
286 OUT UINT32 *NodeCount
287 );
288
307EFIAPI
309 IN CONST VOID *Fdt,
310 IN INT32 FdtBranch,
311 IN CONST COMPATIBILITY_INFO *CompatNamesInfo,
312 OUT UINT32 *NodeCount
313 );
314
331EFIAPI
333 IN CONST VOID *Fdt,
334 IN INT32 FdtBranch,
335 IN CONST CHAR8 *PropName,
336 OUT UINT32 *NodeCount
337 );
338
366EFIAPI
368 IN CONST VOID *Fdt,
369 IN INT32 Node,
370 OUT INT32 *IntcNode
371 );
372
389EFIAPI
391 IN CONST VOID *Fdt,
392 IN INT32 IntcNode,
393 OUT INT32 *InterruptCells
394 );
395
419EFIAPI
421 IN CONST VOID *Fdt,
422 IN INT32 Node,
423 OUT INT32 *AddressCells, OPTIONAL
424 OUT INT32 *SizeCells OPTIONAL
425 );
426
450EFIAPI
452 IN CONST VOID *Fdt,
453 IN INT32 Node,
454 OUT INT32 *AddressCells, OPTIONAL
455 OUT INT32 *SizeCells OPTIONAL
456 );
457
480EFIAPI
482 IN CONST VOID *Fdt,
483 IN INT32 Node,
484 OUT INT32 *AddressCells, OPTIONAL
485 OUT INT32 *SizeCells OPTIONAL
486 );
487
488#endif // FDT_UTILITY_H_
struct CompatibilityInfo COMPATIBILITY_INFO
EFI_STATUS EFIAPI FdtGetNextPropNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *PropName, IN OUT INT32 *Node)
Definition: FdtUtility.c:438
EFI_STATUS EFIAPI FdtGetInterruptCellsInfo(IN CONST VOID *Fdt, IN INT32 IntcNode, OUT INT32 *InterruptCells)
Definition: FdtUtility.c:726
EFI_STATUS EFIAPI FdtCountPropNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *PropName, OUT UINT32 *NodeCount)
Definition: FdtUtility.c:606
EFI_STATUS EFIAPI FdtGetNextCompatNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST COMPATIBILITY_INFO *CompatNamesInfo, IN OUT INT32 *Node)
Definition: FdtUtility.c:398
struct CompatStr COMPATIBILITY_STR
BOOLEAN EFIAPI FdtNodeIsCompatible(IN CONST VOID *Fdt, IN INT32 Node, IN CONST VOID *CompatInfo)
Definition: FdtUtility.c:90
UINT32 EFIAPI FdtGetInterruptId(UINT32 CONST *Data)
BOOLEAN(EFIAPI * NODE_CHECKER_FUNC)(IN CONST VOID *Fdt, IN INT32 NodeOffset, IN CONST VOID *Context)
Definition: FdtUtility.h:127
EFI_STATUS EFIAPI FdtGetParentAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
Definition: FdtUtility.c:833
EFI_STATUS EFIAPI FdtCountCompatNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST COMPATIBILITY_INFO *CompatNamesInfo, OUT UINT32 *NodeCount)
Definition: FdtUtility.c:573
EFI_STATUS EFIAPI FdtGetIntcParentNode(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *IntcNode)
Definition: FdtUtility.c:650
EFI_STATUS EFIAPI FdtGetAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
Definition: FdtUtility.c:778
#define COMPATIBLE_STR_LEN
Maximum string length for compatible names.
Definition: FdtUtility.h:56
EFI_STATUS EFIAPI FdtGetNextNamedNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *NodeName, IN OUT INT32 *Node)
Definition: FdtUtility.c:358
EFI_STATUS EFIAPI FdtGetIntcAddressCells(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
UINT32 EFIAPI FdtGetInterruptFlags(UINT32 CONST *Data)
EFI_STATUS EFIAPI FdtCountNamedNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *NodeName, OUT UINT32 *NodeCount)
Definition: FdtUtility.c:538
BOOLEAN EFIAPI FdtNodeHasProperty(IN CONST VOID *Fdt, IN INT32 Node, IN CONST VOID *PropertyName)
Definition: FdtUtility.c:144
#define CONST
Definition: Base.h:259
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
CONST COMPATIBILITY_STR * CompatTable
Pointer to a table storing the names.
Definition: FdtUtility.h:113
UINT32 Count
Count of entries in the NAME_TABLE.
Definition: FdtUtility.h:110