36 CONST CHAR8 *NodeName;
50 NodeName = fdt_offset_ptr (Fdt, Node + FDT_TAGSIZE, Length + 1);
51 if (NodeName ==
NULL) {
66 if ((NodeName[Length] ==
'\0') ||
67 (NodeName[Length] ==
'@'))
103 (CompatInfo ==
NULL))
113 Prop = fdt_getprop (Fdt, Node,
"compatible", &PropLen);
114 if ((Prop ==
NULL) || (PropLen < 0)) {
118 for (Index = 0; Index < Count; Index++) {
119 if (fdt_stringlist_contains (
154 (PropertyName ==
NULL))
160 Prop = fdt_getprop (Fdt, Node, PropertyName, &Size);
161 if ((Prop ==
NULL) || (Size < 0)) {
213 (NodeChecker ==
NULL))
216 return EFI_INVALID_PARAMETER;
221 CurrNode = fdt_next_node (Fdt, CurrNode, Depth);
222 if ((CurrNode == -FDT_ERR_NOTFOUND) ||
226 return EFI_NOT_FOUND;
227 }
else if (CurrNode < 0) {
232 }
while (!NodeChecker (Fdt, CurrNode, Context));
283 (NodeChecker ==
NULL))
286 return EFI_INVALID_PARAMETER;
289 CurrNode = FdtBranch;
294 if (CurrNode != *Node) {
295 for (CurrNode = fdt_next_node (Fdt, CurrNode, &Depth);
296 (CurrNode >= 0) && (Depth > 0);
297 CurrNode = fdt_next_node (Fdt, CurrNode, &Depth))
299 if (CurrNode == *Node) {
305 if ((CurrNode < 0) || (Depth <= 0)) {
308 return EFI_INVALID_PARAMETER;
321 if (EFI_ERROR (Status)) {
322 ASSERT (Status == EFI_NOT_FOUND);
328 return EFI_NOT_FOUND;
409 (
CONST VOID *)CompatNamesInfo,
449 (
CONST VOID *)PropName,
482 OUT UINT32 *NodeCount
489 (NodeChecker ==
NULL) ||
493 return EFI_INVALID_PARAMETER;
497 CurrNode = FdtBranch;
506 if (EFI_ERROR (Status) &&
507 (Status != EFI_NOT_FOUND))
511 }
else if (Status == EFI_NOT_FOUND) {
542 OUT UINT32 *NodeCount
577 OUT UINT32 *NodeCount
610 OUT UINT32 *NodeCount
656 CONST UINT32 *PHandle;
664 return EFI_INVALID_PARAMETER;
669 Prop = fdt_getprop (Fdt, Node,
"interrupt-controller", &Size);
670 if ((Prop !=
NULL) && (Size >= 0)) {
676 PHandle = fdt_getprop (Fdt, Node,
"interrupt-parent", &Size);
677 if ((PHandle !=
NULL) && (Size ==
sizeof (UINT32))) {
680 Node = fdt_node_offset_by_phandle (Fdt, fdt32_to_cpu (*PHandle));
688 }
else if (Size != -FDT_ERR_NOTFOUND) {
696 return EFI_NOT_FOUND;
700 Node = fdt_parent_offset (Fdt, Node);
739 return EFI_INVALID_PARAMETER;
742 Data = fdt_getprop (Fdt, IntcNode,
"#interrupt-cells", &Size);
743 if ((Data ==
NULL) || (Size !=
sizeof (UINT32))) {
749 *IntCells = fdt32_to_cpu (*Data);
781 OUT INT32 *AddressCells, OPTIONAL
782 OUT INT32 *SizeCells OPTIONAL
787 return EFI_INVALID_PARAMETER;
790 if (AddressCells !=
NULL) {
791 *AddressCells = fdt_address_cells (Fdt, Node);
792 if (*AddressCells < 0) {
798 if (SizeCells !=
NULL) {
799 *SizeCells = fdt_size_cells (Fdt, Node);
800 if (*SizeCells < 0) {
836 OUT INT32 *AddressCells, OPTIONAL
837 OUT INT32 *SizeCells OPTIONAL
842 return EFI_INVALID_PARAMETER;
845 Node = fdt_parent_offset (Fdt, Node);
UINTN EFIAPI AsciiStrLen(IN CONST CHAR8 *String)
INTN EFIAPI AsciiStrnCmp(IN CONST CHAR8 *FirstString, IN CONST CHAR8 *SecondString, IN UINTN Length)
EFI_STATUS EFIAPI FdtGetNextPropNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *PropName, IN OUT INT32 *Node)
EFI_STATUS EFIAPI FdtCountPropNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *PropName, OUT UINT32 *NodeCount)
STATIC EFI_STATUS EFIAPI FdtGetNextCondNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN NODE_CHECKER_FUNC NodeChecker, IN CONST VOID *Context, IN OUT INT32 *Node)
EFI_STATUS EFIAPI FdtGetNextCompatNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST COMPATIBILITY_INFO *CompatNamesInfo, IN OUT INT32 *Node)
BOOLEAN EFIAPI FdtNodeIsCompatible(IN CONST VOID *Fdt, IN INT32 Node, IN CONST VOID *CompatInfo)
STATIC EFI_STATUS EFIAPI FdtGetNextCondNode(IN CONST VOID *Fdt, IN OUT INT32 *Node, IN OUT INT32 *Depth, IN NODE_CHECKER_FUNC NodeChecker, IN CONST VOID *Context)
EFI_STATUS EFIAPI FdtGetParentAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
EFI_STATUS EFIAPI FdtCountCompatNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST COMPATIBILITY_INFO *CompatNamesInfo, OUT UINT32 *NodeCount)
EFI_STATUS EFIAPI FdtGetIntcParentNode(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *IntcNode)
STATIC BOOLEAN EFIAPI FdtNodeHasName(IN CONST VOID *Fdt, IN INT32 Node, IN CONST VOID *SearchName)
EFI_STATUS EFIAPI FdtGetAddressInfo(IN CONST VOID *Fdt, IN INT32 Node, OUT INT32 *AddressCells, OPTIONAL OUT INT32 *SizeCells OPTIONAL)
STATIC EFI_STATUS EFIAPI FdtCountCondNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN NODE_CHECKER_FUNC NodeChecker, IN CONST VOID *Context, OUT UINT32 *NodeCount)
EFI_STATUS EFIAPI FdtGetInterruptCellsInfo(IN CONST VOID *Fdt, IN INT32 IntcNode, OUT INT32 *IntCells)
EFI_STATUS EFIAPI FdtGetNextNamedNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *NodeName, IN OUT INT32 *Node)
EFI_STATUS EFIAPI FdtCountNamedNodeInBranch(IN CONST VOID *Fdt, IN INT32 FdtBranch, IN CONST CHAR8 *NodeName, OUT UINT32 *NodeCount)
BOOLEAN EFIAPI FdtNodeHasProperty(IN CONST VOID *Fdt, IN INT32 Node, IN CONST VOID *PropertyName)
BOOLEAN(EFIAPI * NODE_CHECKER_FUNC)(IN CONST VOID *Fdt, IN INT32 NodeOffset, IN CONST VOID *Context)