Lines Matching +full:device +full:- +full:tree

1 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
5 * libfdt - Flat Device Tree manipulation
27 /* FDT_ERR_NOSPACE: Operation needed to expand the device
28 * tree, but its buffer did not have sufficient space to
29 * contain the expanded tree. Use fdt_open_into() to move the
30 * device tree to a buffer with more space. */
35 * offset which is out-of-bounds, or which points to an
44 * length, or the phandle value was either 0 or -1, which are
47 /* FDT_ERR_BADSTATE: Function was passed an incomplete device
48 * tree created by the sequential-write functions, which is
51 /* Error codes: codes for bad device tree blobs */
53 /* FDT_ERR_TRUNCATED: FDT or a sub-block is improperly
57 /* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
58 * device tree at all - it is missing the flattened device
59 * tree magic number. */
61 /* FDT_ERR_BADVERSION: Given device tree has a version which
63 * read-write functions, this may mean that fdt_open_into() is
64 * required to convert the tree to the expected version. */
66 /* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
70 /* FDT_ERR_BADLAYOUT: For read-write functions, the given
71 * device tree has it's sub-blocks in an order that the
73 * then strings). Use fdt_open_into() to reorganize the tree
74 * into a form suitable for the read-write operations. */
82 /* Errors in device tree content */
84 /* FDT_ERR_BADNCELLS: Device tree has a #address-cells, #size-cells
88 /* FDT_ERR_BADVALUE: Device tree has a property with an unexpected
90 * is not NUL-terminated within the length of its value. */
93 /* FDT_ERR_BADOVERLAY: The device tree overlay, while
98 /* FDT_ERR_NOPHANDLES: The device tree doesn't have any
106 /* FDT_ERR_ALIGNMENT: The device tree base address is not 8-byte
113 /* Valid values for phandles range from 1 to 2^32-2. */
116 /* Low-level functions (you probably don't need these) */
130 * External helpers to access words from a device tree blob. They're built
196 * fdt_first_subnode() - get offset of first direct subnode
200 * Return: offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
205 * fdt_next_subnode() - get offset of next direct subnode
212 * Return: offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
218 * fdt_for_each_subnode - iterate over all subnodes of a parent
231 * if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
248 (fdt32_ld(&((const struct fdt_header *)(fdt))->field))
264 fdth->name = cpu_to_fdt32(val); \
279 * fdt_header_size - return the size of the tree's header
280 * @fdt: pointer to a flattened device tree
287 * fdt_header_size_ - internal function to get header size from a version number
295 * fdt_check_header - sanity check a device tree header
296 * @fdt: pointer to data which might be a flattened device tree
299 * appears to be a flattened device tree, and that the header contains
304 * 0, if the buffer appears to contain a valid device tree
305 * -FDT_ERR_BADMAGIC,
306 * -FDT_ERR_BADVERSION,
307 * -FDT_ERR_BADSTATE,
308 * -FDT_ERR_TRUNCATED, standard meanings, as above
313 * fdt_move - move a device tree around in memory
314 * @fdt: pointer to the device tree to move
315 * @buf: pointer to memory where the device is to be moved
318 * fdt_move() relocates, if possible, the device tree blob located at
320 * with the existing device tree blob at fdt. Therefore,
326 * -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
327 * -FDT_ERR_BADMAGIC,
328 * -FDT_ERR_BADVERSION,
329 * -FDT_ERR_BADSTATE, standard meanings
334 /* Read-only functions */
340 * fdt_get_string - retrieve a string from the strings block of a device tree
341 * @fdt: pointer to the device tree blob
346 * strings block of the device tree blob at fdt, and optionally also
356 * fdt_string - retrieve a string from the strings block of a device tree
357 * @fdt: pointer to the device tree blob
361 * strings block of the device tree blob at fdt.
370 * fdt_find_max_phandle - find and return the highest phandle in a tree
371 * @fdt: pointer to the device tree blob
372 * @phandle: return location for the highest phandle value found in the tree
374 * fdt_find_max_phandle() finds the highest phandle value in the given device
375 * tree. The value returned in @phandle is only valid if the function returns
384 * fdt_get_max_phandle - retrieves the highest phandle in a tree
385 * @fdt: pointer to the device tree blob
388 * device tree. This will ignore badly formatted phandles, or phandles
389 * with a value of 0 or -1.
395 * 0, if no phandle was found in the device tree
396 * -1, if an error occurred
405 return (uint32_t)-1; in fdt_get_max_phandle()
411 * fdt_generate_phandle - return a new, unused phandle for a device tree blob
412 * @fdt: pointer to the device tree blob
415 * Walks the device tree blob and looks for the highest phandle value. On
417 * highest phandle value in the device tree blob) will be returned in the
420 * Return: 0 on success or a negative error-code on failure
425 * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
426 * @fdt: pointer to the device tree blob
428 * Returns the number of entries in the device tree blob's memory
438 * fdt_get_mem_rsv - retrieve one memory reserve map entry
439 * @fdt: pointer to the device tree blob
441 * @address: pointer to 64-bit variable to hold the start address
442 * @size: pointer to 64-bit variable to hold the size of the entry
445 * the n-th reserve map entry from the device tree blob, in
446 * native-endian format.
450 * -FDT_ERR_BADMAGIC,
451 * -FDT_ERR_BADVERSION,
452 * -FDT_ERR_BADSTATE, standard meanings
457 * fdt_subnode_offset_namelen - find a subnode based on substring
458 * @fdt: pointer to the device tree blob
468 * Return: offset of the subnode or -FDT_ERR_NOTFOUND if name not found.
475 * fdt_subnode_offset - find a subnode of a given node
476 * @fdt: pointer to the device tree blob
489 * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
490 * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
492 * -FDT_ERR_BADMAGIC,
493 * -FDT_ERR_BADVERSION,
494 * -FDT_ERR_BADSTATE,
495 * -FDT_ERR_BADSTRUCTURE,
496 * -FDT_ERR_TRUNCATED, standard meanings.
501 * fdt_path_offset_namelen - find a tree node by its full path
502 * @fdt: pointer to the device tree blob
516 * fdt_path_offset - find a tree node by its full path
517 * @fdt: pointer to the device tree blob
520 * fdt_path_offset() finds a node of a given path in the device tree.
530 * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
531 * -FDT_ERR_NOTFOUND, if the requested node does not exist
532 * -FDT_ERR_BADMAGIC,
533 * -FDT_ERR_BADVERSION,
534 * -FDT_ERR_BADSTATE,
535 * -FDT_ERR_BADSTRUCTURE,
536 * -FDT_ERR_TRUNCATED, standard meanings.
541 * fdt_get_name - retrieve the name of a given node
542 * @fdt: pointer to the device tree blob
547 * device tree node at structure block offset nodeoffset. If lenp is
548 * non-NULL, the length of this name is also returned, in the integer
553 * If lenp is non-NULL, *lenp contains the length of that name
556 * if lenp is non-NULL *lenp contains an error code (<0):
557 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
559 * -FDT_ERR_BADMAGIC,
560 * -FDT_ERR_BADVERSION,
561 * -FDT_ERR_BADSTATE, standard meanings
566 * fdt_first_property_offset - find the offset of a node's first property
567 * @fdt: pointer to the device tree blob
575 * -FDT_ERR_NOTFOUND, if the requested node has no properties
576 * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
577 * -FDT_ERR_BADMAGIC,
578 * -FDT_ERR_BADVERSION,
579 * -FDT_ERR_BADSTATE,
580 * -FDT_ERR_BADSTRUCTURE,
581 * -FDT_ERR_TRUNCATED, standard meanings.
586 * fdt_next_property_offset - step through a node's properties
587 * @fdt: pointer to the device tree blob
596 * -FDT_ERR_NOTFOUND, if the given property is the last in its node
597 * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
598 * -FDT_ERR_BADMAGIC,
599 * -FDT_ERR_BADVERSION,
600 * -FDT_ERR_BADSTATE,
601 * -FDT_ERR_BADSTRUCTURE,
602 * -FDT_ERR_TRUNCATED, standard meanings.
607 * fdt_for_each_property_offset - iterate over all properties of a node
620 * if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) {
634 * fdt_get_property_by_offset - retrieve the property at a given offset
635 * @fdt: pointer to the device tree blob
640 * fdt_property structure within the device tree blob at the given
641 * offset. If lenp is non-NULL, the length of the property value is
644 * Note that this code only works on device tree versions >= 16. fdt_getprop()
649 * if lenp is non-NULL, *lenp contains the length of the property
652 * if lenp is non-NULL, *lenp contains an error code (<0):
653 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
654 * -FDT_ERR_BADMAGIC,
655 * -FDT_ERR_BADVERSION,
656 * -FDT_ERR_BADSTATE,
657 * -FDT_ERR_BADSTRUCTURE,
658 * -FDT_ERR_TRUNCATED, standard meanings
672 * fdt_get_property_namelen - find a property based on substring
673 * @fdt: pointer to the device tree blob
693 * fdt_get_property - find a given property in a given node
694 * @fdt: pointer to the device tree blob
700 * structure within the device tree blob corresponding to the property
702 * non-NULL, the length of the property value is also returned, in the
707 * if lenp is non-NULL, *lenp contains the length of the property
710 * if lenp is non-NULL, *lenp contains an error code (<0):
711 * -FDT_ERR_NOTFOUND, node does not have named property
712 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
714 * -FDT_ERR_BADMAGIC,
715 * -FDT_ERR_BADVERSION,
716 * -FDT_ERR_BADSTATE,
717 * -FDT_ERR_BADSTRUCTURE,
718 * -FDT_ERR_TRUNCATED, standard meanings
731 * fdt_getprop_by_offset - retrieve the value of a property at a given offset
732 * @fdt: pointer to the device tree blob
739 * to within the device blob itself, not a copy of the value). If
740 * lenp is non-NULL, the length of the property value is also
741 * returned, in the integer pointed to by lenp. If namep is non-NULL,
743 * by namep (this will be a pointer to within the device tree's string
748 * if lenp is non-NULL, *lenp contains the length of the property
750 * if namep is non-NULL *namep contiains a pointer to the property
753 * if lenp is non-NULL, *lenp contains an error code (<0):
754 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
755 * -FDT_ERR_BADMAGIC,
756 * -FDT_ERR_BADVERSION,
757 * -FDT_ERR_BADSTATE,
758 * -FDT_ERR_BADSTRUCTURE,
759 * -FDT_ERR_TRUNCATED, standard meanings
767 * fdt_getprop_namelen - get property value based on substring
768 * @fdt: pointer to the device tree blob
792 * fdt_getprop - retrieve the value of a given property
793 * @fdt: pointer to the device tree blob
800 * pointer to within the device blob itself, not a copy of the value).
801 * If @lenp is non-NULL, the length of the property value is also
806 * if lenp is non-NULL, *lenp contains the length of the property
809 * if lenp is non-NULL, *lenp contains an error code (<0):
810 * -FDT_ERR_NOTFOUND, node does not have named property
811 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
813 * -FDT_ERR_BADMAGIC,
814 * -FDT_ERR_BADVERSION,
815 * -FDT_ERR_BADSTATE,
816 * -FDT_ERR_BADSTRUCTURE,
817 * -FDT_ERR_TRUNCATED, standard meanings
828 * fdt_get_phandle - retrieve the phandle of a given node
829 * @fdt: pointer to the device tree blob
832 * fdt_get_phandle() retrieves the phandle of the device tree node at
836 * the phandle of the node at nodeoffset, on success (!= 0, != -1)
842 * fdt_get_alias_namelen - get alias based on substring
843 * @fdt: pointer to the device tree blob
859 * fdt_get_alias - retrieve the path referenced by a given alias
860 * @fdt: pointer to the device tree blob
873 * fdt_get_path - determine the full path of a node
874 * @fdt: pointer to the device tree blob
882 * NOTE: This function is expensive, as it must scan the device tree
888 * nodeoffset, as a NUL-terminated string.
889 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
890 * -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
892 * -FDT_ERR_BADMAGIC,
893 * -FDT_ERR_BADVERSION,
894 * -FDT_ERR_BADSTATE,
895 * -FDT_ERR_BADSTRUCTURE, standard meanings
900 * fdt_supernode_atdepth_offset - find a specific ancestor of a node
901 * @fdt: pointer to the device tree blob
915 * NOTE: This function is expensive, as it must scan the device tree
921 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
922 * -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of
924 * -FDT_ERR_BADMAGIC,
925 * -FDT_ERR_BADVERSION,
926 * -FDT_ERR_BADSTATE,
927 * -FDT_ERR_BADSTRUCTURE, standard meanings
933 * fdt_node_depth - find the depth of a given node
934 * @fdt: pointer to the device tree blob
940 * NOTE: This function is expensive, as it must scan the device tree
945 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
946 * -FDT_ERR_BADMAGIC,
947 * -FDT_ERR_BADVERSION,
948 * -FDT_ERR_BADSTATE,
949 * -FDT_ERR_BADSTRUCTURE, standard meanings
954 * fdt_parent_offset - find the parent of a given node
955 * @fdt: pointer to the device tree blob
962 * NOTE: This function is expensive, as it must scan the device tree
968 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
969 * -FDT_ERR_BADMAGIC,
970 * -FDT_ERR_BADVERSION,
971 * -FDT_ERR_BADSTATE,
972 * -FDT_ERR_BADSTRUCTURE, standard meanings
977 * fdt_node_offset_by_prop_value - find nodes with a given property value
978 * @fdt: pointer to the device tree blob
987 * startoffset is -1, the very first such node in the tree.
991 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
993 * while (offset != -FDT_ERR_NOTFOUND) {
999 * Note the -1 in the first call to the function, if 0 is used here
1006 * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
1007 * tree after startoffset
1008 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1009 * -FDT_ERR_BADMAGIC,
1010 * -FDT_ERR_BADVERSION,
1011 * -FDT_ERR_BADSTATE,
1012 * -FDT_ERR_BADSTRUCTURE, standard meanings
1019 * fdt_node_offset_by_phandle - find the node with a given phandle
1020 * @fdt: pointer to the device tree blob
1025 * in the tree with the given phandle (an invalid tree), results are
1030 * -FDT_ERR_NOTFOUND, no node with that phandle exists
1031 * -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
1032 * -FDT_ERR_BADMAGIC,
1033 * -FDT_ERR_BADVERSION,
1034 * -FDT_ERR_BADSTATE,
1035 * -FDT_ERR_BADSTRUCTURE, standard meanings
1040 * fdt_node_check_compatible - check a node's compatible property
1041 * @fdt: pointer to the device tree blob
1042 * @nodeoffset: offset of a tree node
1047 * it returns non-zero otherwise, or on error.
1053 * -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
1054 * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
1055 * -FDT_ERR_BADMAGIC,
1056 * -FDT_ERR_BADVERSION,
1057 * -FDT_ERR_BADSTATE,
1058 * -FDT_ERR_BADSTRUCTURE, standard meanings
1064 * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
1065 * @fdt: pointer to the device tree blob
1071 * lists the given compatible string; or if startoffset is -1, the
1072 * very first such node in the tree.
1076 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
1077 * while (offset != -FDT_ERR_NOTFOUND) {
1082 * Note the -1 in the first call to the function, if 0 is used here
1089 * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
1090 * tree after startoffset
1091 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1092 * -FDT_ERR_BADMAGIC,
1093 * -FDT_ERR_BADVERSION,
1094 * -FDT_ERR_BADSTATE,
1095 * -FDT_ERR_BADSTRUCTURE, standard meanings
1101 * fdt_stringlist_contains - check a string list property for a string
1107 * one or more strings, each terminated by \0, as is found in a device tree
1115 * fdt_stringlist_count - count the number of strings in a string list
1116 * @fdt: pointer to the device tree blob
1117 * @nodeoffset: offset of a tree node
1122 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1123 * -FDT_ERR_NOTFOUND if the property does not exist
1128 * fdt_stringlist_search - find a string in a string list and return its index
1129 * @fdt: pointer to the device tree blob
1130 * @nodeoffset: offset of a tree node
1135 * that are not NUL-terminated. That's because the function will stop after
1137 * small-valued cell properties, such as #address-cells, when searching for
1142 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1143 * -FDT_ERR_NOTFOUND if the property does not exist or does not contain
1150 * fdt_stringlist_get() - obtain the string at a given index in a string list
1151 * @fdt: pointer to the device tree blob
1152 * @nodeoffset: offset of a tree node
1158 * non-NUL-terminated values. For example on small-valued cell properties
1161 * If non-NULL, the length of the string (on success) or a negative error-code
1167 * location pointed to by the lenp parameter, if non-NULL. On failure one of
1169 * (if non-NULL):
1170 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1171 * -FDT_ERR_NOTFOUND if the property does not exist
1178 /* Read-only functions (addressing related) */
1182 * FDT_MAX_NCELLS - maximum value for #address-cells and #size-cells
1184 * This is the maximum value for #address-cells, #size-cells and
1193 * fdt_address_cells - retrieve address size for a bus represented in the tree
1194 * @fdt: pointer to the device tree blob
1197 * When the node has a valid #address-cells property, returns its value.
1201 * 2, if the node has no #address-cells property
1202 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1203 * #address-cells property
1204 * -FDT_ERR_BADMAGIC,
1205 * -FDT_ERR_BADVERSION,
1206 * -FDT_ERR_BADSTATE,
1207 * -FDT_ERR_BADSTRUCTURE,
1208 * -FDT_ERR_TRUNCATED, standard meanings
1213 * fdt_size_cells - retrieve address range size for a bus represented in the
1214 * tree
1215 * @fdt: pointer to the device tree blob
1218 * When the node has a valid #size-cells property, returns its value.
1222 * 1, if the node has no #size-cells property
1223 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1224 * #size-cells property
1225 * -FDT_ERR_BADMAGIC,
1226 * -FDT_ERR_BADVERSION,
1227 * -FDT_ERR_BADSTATE,
1228 * -FDT_ERR_BADSTRUCTURE,
1229 * -FDT_ERR_TRUNCATED, standard meanings
1235 /* Write-in-place functions */
1239 * fdt_setprop_inplace_namelen_partial - change a property's value,
1241 * @fdt: pointer to the device tree blob
1264 * fdt_setprop_inplace - change a property's value, but not its size
1265 * @fdt: pointer to the device tree blob
1278 * of the tree.
1282 * -FDT_ERR_NOSPACE, if len is not equal to the property's current length
1283 * -FDT_ERR_NOTFOUND, node does not have the named property
1284 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1285 * -FDT_ERR_BADMAGIC,
1286 * -FDT_ERR_BADVERSION,
1287 * -FDT_ERR_BADSTATE,
1288 * -FDT_ERR_BADSTRUCTURE,
1289 * -FDT_ERR_TRUNCATED, standard meanings
1297 * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
1298 * @fdt: pointer to the device tree blob
1301 * @val: 32-bit integer value to replace the property with
1304 * with the 32-bit integer value in val, converting val to big-endian
1311 * of the tree.
1315 * -FDT_ERR_NOSPACE, if the property's length is not equal to 4
1316 * -FDT_ERR_NOTFOUND, node does not have the named property
1317 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1318 * -FDT_ERR_BADMAGIC,
1319 * -FDT_ERR_BADVERSION,
1320 * -FDT_ERR_BADSTATE,
1321 * -FDT_ERR_BADSTRUCTURE,
1322 * -FDT_ERR_TRUNCATED, standard meanings
1332 * fdt_setprop_inplace_u64 - change the value of a 64-bit integer property
1333 * @fdt: pointer to the device tree blob
1336 * @val: 64-bit integer value to replace the property with
1339 * with the 64-bit integer value in val, converting val to big-endian
1346 * of the tree.
1350 * -FDT_ERR_NOSPACE, if the property's length is not equal to 8
1351 * -FDT_ERR_NOTFOUND, node does not have the named property
1352 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1353 * -FDT_ERR_BADMAGIC,
1354 * -FDT_ERR_BADVERSION,
1355 * -FDT_ERR_BADSTATE,
1356 * -FDT_ERR_BADSTRUCTURE,
1357 * -FDT_ERR_TRUNCATED, standard meanings
1367 * fdt_setprop_inplace_cell - change the value of a single-cell property
1368 * @fdt: pointer to the device tree blob
1371 * @val: new value of the 32-bit cell
1383 * fdt_nop_property - replace a property with nop tags
1384 * @fdt: pointer to the device tree blob
1390 * tree.
1394 * tree.
1398 * -FDT_ERR_NOTFOUND, node does not have the named property
1399 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1400 * -FDT_ERR_BADMAGIC,
1401 * -FDT_ERR_BADVERSION,
1402 * -FDT_ERR_BADSTATE,
1403 * -FDT_ERR_BADSTRUCTURE,
1404 * -FDT_ERR_TRUNCATED, standard meanings
1409 * fdt_nop_node - replace a node (subtree) with nop tags
1410 * @fdt: pointer to the device tree blob
1415 * effectively removing it from the tree.
1419 * move any other part of the tree.
1423 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1424 * -FDT_ERR_BADMAGIC,
1425 * -FDT_ERR_BADVERSION,
1426 * -FDT_ERR_BADSTATE,
1427 * -FDT_ERR_BADSTRUCTURE,
1428 * -FDT_ERR_TRUNCATED, standard meanings
1438 /* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property
1445 * fdt_create_with_flags - begin creation of a new fdt
1457 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1458 * -FDT_ERR_BADFLAGS, flags is not valid
1463 * fdt_create - begin creation of a new fdt
1471 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1499 * fdt_property_placeholder - add a new property and return a ptr to its value
1501 * @fdt: pointer to the device tree blob
1508 * -FDT_ERR_BADMAGIC,
1509 * -FDT_ERR_NOSPACE, standard meanings
1519 /* Read-write functions */
1527 * fdt_add_mem_rsv - add one memory reserve map entry
1528 * @fdt: pointer to the device tree blob
1529 * @address: 64-bit start address of the reserve map entry
1530 * @size: 64-bit size of the reserved region
1540 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1542 * -FDT_ERR_BADMAGIC,
1543 * -FDT_ERR_BADVERSION,
1544 * -FDT_ERR_BADSTATE,
1545 * -FDT_ERR_BADSTRUCTURE,
1546 * -FDT_ERR_BADLAYOUT,
1547 * -FDT_ERR_TRUNCATED, standard meanings
1552 * fdt_del_mem_rsv - remove a memory reserve map entry
1553 * @fdt: pointer to the device tree blob
1556 * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
1564 * -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
1566 * -FDT_ERR_BADMAGIC,
1567 * -FDT_ERR_BADVERSION,
1568 * -FDT_ERR_BADSTATE,
1569 * -FDT_ERR_BADSTRUCTURE,
1570 * -FDT_ERR_BADLAYOUT,
1571 * -FDT_ERR_TRUNCATED, standard meanings
1576 * fdt_set_name - change the name of a given node
1577 * @fdt: pointer to the device tree blob
1592 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob
1594 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1595 * -FDT_ERR_BADMAGIC,
1596 * -FDT_ERR_BADVERSION,
1597 * -FDT_ERR_BADSTATE, standard meanings
1602 * fdt_setprop - create or change a property
1603 * @fdt: pointer to the device tree blob
1618 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1620 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1621 * -FDT_ERR_BADLAYOUT,
1622 * -FDT_ERR_BADMAGIC,
1623 * -FDT_ERR_BADVERSION,
1624 * -FDT_ERR_BADSTATE,
1625 * -FDT_ERR_BADSTRUCTURE,
1626 * -FDT_ERR_BADLAYOUT,
1627 * -FDT_ERR_TRUNCATED, standard meanings
1633 * fdt_setprop_placeholder - allocate space for a property
1634 * @fdt: pointer to the device tree blob
1649 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1651 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1652 * -FDT_ERR_BADLAYOUT,
1653 * -FDT_ERR_BADMAGIC,
1654 * -FDT_ERR_BADVERSION,
1655 * -FDT_ERR_BADSTATE,
1656 * -FDT_ERR_BADSTRUCTURE,
1657 * -FDT_ERR_BADLAYOUT,
1658 * -FDT_ERR_TRUNCATED, standard meanings
1664 * fdt_setprop_u32 - set a property to a 32-bit integer
1665 * @fdt: pointer to the device tree blob
1668 * @val: 32-bit integer value for the property (native endian)
1671 * node to the given 32-bit integer value (converting to big-endian if
1680 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1682 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1683 * -FDT_ERR_BADLAYOUT,
1684 * -FDT_ERR_BADMAGIC,
1685 * -FDT_ERR_BADVERSION,
1686 * -FDT_ERR_BADSTATE,
1687 * -FDT_ERR_BADSTRUCTURE,
1688 * -FDT_ERR_BADLAYOUT,
1689 * -FDT_ERR_TRUNCATED, standard meanings
1699 * fdt_setprop_u64 - set a property to a 64-bit integer
1700 * @fdt: pointer to the device tree blob
1703 * @val: 64-bit integer value for the property (native endian)
1706 * node to the given 64-bit integer value (converting to big-endian if
1715 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1717 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1718 * -FDT_ERR_BADLAYOUT,
1719 * -FDT_ERR_BADMAGIC,
1720 * -FDT_ERR_BADVERSION,
1721 * -FDT_ERR_BADSTATE,
1722 * -FDT_ERR_BADSTRUCTURE,
1723 * -FDT_ERR_BADLAYOUT,
1724 * -FDT_ERR_TRUNCATED, standard meanings
1734 * fdt_setprop_cell - set a property to a single cell value
1735 * @fdt: pointer to the device tree blob
1738 * @val: 32-bit integer value for the property (native endian)
1751 * fdt_setprop_string - set a property to a string value
1752 * @fdt: pointer to the device tree blob
1767 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1769 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1770 * -FDT_ERR_BADLAYOUT,
1771 * -FDT_ERR_BADMAGIC,
1772 * -FDT_ERR_BADVERSION,
1773 * -FDT_ERR_BADSTATE,
1774 * -FDT_ERR_BADSTRUCTURE,
1775 * -FDT_ERR_BADLAYOUT,
1776 * -FDT_ERR_TRUNCATED, standard meanings
1783 * fdt_setprop_empty - set a property to an empty value
1784 * @fdt: pointer to the device tree blob
1797 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1799 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1800 * -FDT_ERR_BADLAYOUT,
1801 * -FDT_ERR_BADMAGIC,
1802 * -FDT_ERR_BADVERSION,
1803 * -FDT_ERR_BADSTATE,
1804 * -FDT_ERR_BADSTRUCTURE,
1805 * -FDT_ERR_BADLAYOUT,
1806 * -FDT_ERR_TRUNCATED, standard meanings
1812 * fdt_appendprop - append to or create a property
1813 * @fdt: pointer to the device tree blob
1827 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1829 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1830 * -FDT_ERR_BADLAYOUT,
1831 * -FDT_ERR_BADMAGIC,
1832 * -FDT_ERR_BADVERSION,
1833 * -FDT_ERR_BADSTATE,
1834 * -FDT_ERR_BADSTRUCTURE,
1835 * -FDT_ERR_BADLAYOUT,
1836 * -FDT_ERR_TRUNCATED, standard meanings
1842 * fdt_appendprop_u32 - append a 32-bit integer value to a property
1843 * @fdt: pointer to the device tree blob
1846 * @val: 32-bit integer value to append to the property (native endian)
1848 * fdt_appendprop_u32() appends the given 32-bit integer value
1849 * (converting to big-endian if necessary) to the value of the named
1858 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1860 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1861 * -FDT_ERR_BADLAYOUT,
1862 * -FDT_ERR_BADMAGIC,
1863 * -FDT_ERR_BADVERSION,
1864 * -FDT_ERR_BADSTATE,
1865 * -FDT_ERR_BADSTRUCTURE,
1866 * -FDT_ERR_BADLAYOUT,
1867 * -FDT_ERR_TRUNCATED, standard meanings
1877 * fdt_appendprop_u64 - append a 64-bit integer value to a property
1878 * @fdt: pointer to the device tree blob
1881 * @val: 64-bit integer value to append to the property (native endian)
1883 * fdt_appendprop_u64() appends the given 64-bit integer value
1884 * (converting to big-endian if necessary) to the value of the named
1893 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1895 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1896 * -FDT_ERR_BADLAYOUT,
1897 * -FDT_ERR_BADMAGIC,
1898 * -FDT_ERR_BADVERSION,
1899 * -FDT_ERR_BADSTATE,
1900 * -FDT_ERR_BADSTRUCTURE,
1901 * -FDT_ERR_BADLAYOUT,
1902 * -FDT_ERR_TRUNCATED, standard meanings
1912 * fdt_appendprop_cell - append a single cell value to a property
1913 * @fdt: pointer to the device tree blob
1916 * @val: 32-bit integer value to append to the property (native endian)
1929 * fdt_appendprop_string - append a string to a property
1930 * @fdt: pointer to the device tree blob
1944 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1946 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1947 * -FDT_ERR_BADLAYOUT,
1948 * -FDT_ERR_BADMAGIC,
1949 * -FDT_ERR_BADVERSION,
1950 * -FDT_ERR_BADSTATE,
1951 * -FDT_ERR_BADSTRUCTURE,
1952 * -FDT_ERR_BADLAYOUT,
1953 * -FDT_ERR_TRUNCATED, standard meanings
1959 * fdt_appendprop_addrrange - append a address range property
1960 * @fdt: pointer to the device tree blob
1972 * Cell sizes are determined by parent's #address-cells and #size-cells.
1979 * -FDT_ERR_BADLAYOUT,
1980 * -FDT_ERR_BADMAGIC,
1981 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1982 * #address-cells property
1983 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1984 * -FDT_ERR_BADSTATE,
1985 * -FDT_ERR_BADSTRUCTURE,
1986 * -FDT_ERR_BADVERSION,
1987 * -FDT_ERR_BADVALUE, addr or size doesn't fit to respective cells size
1988 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1990 * -FDT_ERR_TRUNCATED, standard meanings
1996 * fdt_delprop - delete a property
1997 * @fdt: pointer to the device tree blob
2008 * -FDT_ERR_NOTFOUND, node does not have the named property
2009 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2010 * -FDT_ERR_BADLAYOUT,
2011 * -FDT_ERR_BADMAGIC,
2012 * -FDT_ERR_BADVERSION,
2013 * -FDT_ERR_BADSTATE,
2014 * -FDT_ERR_BADSTRUCTURE,
2015 * -FDT_ERR_TRUNCATED, standard meanings
2020 * fdt_add_subnode_namelen - creates a new node based on substring
2021 * @fdt: pointer to the device tree blob
2040 * fdt_add_subnode - creates a new node
2041 * @fdt: pointer to the device tree blob
2055 * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
2056 * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
2058 * -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
2060 * -FDT_ERR_NOSPACE, if there is insufficient free space in the
2062 * -FDT_ERR_NOSPACE
2063 * -FDT_ERR_BADLAYOUT
2064 * -FDT_ERR_BADMAGIC,
2065 * -FDT_ERR_BADVERSION,
2066 * -FDT_ERR_BADSTATE,
2067 * -FDT_ERR_BADSTRUCTURE,
2068 * -FDT_ERR_TRUNCATED, standard meanings.
2073 * fdt_del_node - delete a node (subtree)
2074 * @fdt: pointer to the device tree blob
2085 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2086 * -FDT_ERR_BADLAYOUT,
2087 * -FDT_ERR_BADMAGIC,
2088 * -FDT_ERR_BADVERSION,
2089 * -FDT_ERR_BADSTATE,
2090 * -FDT_ERR_BADSTRUCTURE,
2091 * -FDT_ERR_TRUNCATED, standard meanings
2096 * fdt_overlay_apply - Applies a DT overlay on a base DT
2097 * @fdt: pointer to the base device tree blob
2098 * @fdto: pointer to the device tree overlay blob
2100 * fdt_overlay_apply() will apply the given device tree overlay on the
2101 * given base device tree.
2103 * Expect the base device tree to be modified, even if the function
2108 * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
2109 * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
2111 * -FDT_ERR_BADPHANDLE,
2112 * -FDT_ERR_BADOVERLAY,
2113 * -FDT_ERR_NOPHANDLES,
2114 * -FDT_ERR_INTERNAL,
2115 * -FDT_ERR_BADLAYOUT,
2116 * -FDT_ERR_BADMAGIC,
2117 * -FDT_ERR_BADOFFSET,
2118 * -FDT_ERR_BADPATH,
2119 * -FDT_ERR_BADVERSION,
2120 * -FDT_ERR_BADSTRUCTURE,
2121 * -FDT_ERR_BADSTATE,
2122 * -FDT_ERR_TRUNCATED, standard meanings
2127 * fdt_overlay_target_offset - retrieves the offset of a fragment's target
2128 * @fdt: Base device tree blob
2129 * @fdto: Device tree overlay blob
2134 * device tree of a fragment, no matter how the actual targeting is
2138 * the targeted node offset in the base device tree