Lines Matching +full:in +full:- +full:tree

1 /* SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause) */
5 * libfdt - Flat Device Tree manipulation
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
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. */
76 /* "Can't happen" error indicating a bug in libfdt */
79 * Should never be returned, if it is, it indicates a bug in
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) */
119 #ifndef SWIG /* This function is not useful in Python */
130 * External helpers to access words from a device tree blob. They're built
189 * fdt_first_subnode() - get offset of first direct subnode
193 * Return: offset of first subnode, or -FDT_ERR_NOTFOUND if there is none
198 * fdt_next_subnode() - get offset of next direct subnode
205 * Return: offset of next subnode, or -FDT_ERR_NOTFOUND if there are no more
211 * fdt_for_each_subnode - iterate over all subnodes of a parent
224 * if ((node < 0) && (node != -FDT_ERR_NOTFOUND)) {
229 * iterator in the loop. The parent variable be constant or even a
241 (fdt32_ld(&((const struct fdt_header *)(fdt))->field))
257 fdth->name = cpu_to_fdt32(val); \
272 * fdt_header_size - return the size of the tree's header
273 * @fdt: pointer to a flattened device tree
275 * Return: size of DTB header in bytes
280 * fdt_header_size_ - internal function to get header size from a version number
283 * Return: size of DTB header in bytes
288 * fdt_check_header - sanity check a device tree header
289 * @fdt: pointer to data which might be a flattened device tree
292 * appears to be a flattened device tree, and that the header contains
297 * 0, if the buffer appears to contain a valid device tree
298 * -FDT_ERR_BADMAGIC,
299 * -FDT_ERR_BADVERSION,
300 * -FDT_ERR_BADSTATE,
301 * -FDT_ERR_TRUNCATED, standard meanings, as above
306 * fdt_move - move a device tree around in memory
307 * @fdt: pointer to the device tree to move
311 * fdt_move() relocates, if possible, the device tree blob located at
313 * with the existing device tree blob at fdt. Therefore,
319 * -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
320 * -FDT_ERR_BADMAGIC,
321 * -FDT_ERR_BADVERSION,
322 * -FDT_ERR_BADSTATE, standard meanings
327 /* Read-only functions */
333 * fdt_get_string - retrieve a string from the strings block of a device tree
334 * @fdt: pointer to the device tree blob
339 * strings block of the device tree blob at fdt, and optionally also
340 * returns the string's length in *lenp.
349 * fdt_string - retrieve a string from the strings block of a device tree
350 * @fdt: pointer to the device tree blob
354 * strings block of the device tree blob at fdt.
363 * fdt_find_max_phandle - find and return the highest phandle in a tree
364 * @fdt: pointer to the device tree blob
365 * @phandle: return location for the highest phandle value found in the tree
367 * fdt_find_max_phandle() finds the highest phandle value in the given device
368 * tree. The value returned in @phandle is only valid if the function returns
377 * fdt_get_max_phandle - retrieves the highest phandle in a tree
378 * @fdt: pointer to the device tree blob
380 * fdt_get_max_phandle retrieves the highest phandle in the given
381 * device tree. This will ignore badly formatted phandles, or phandles
382 * with a value of 0 or -1.
384 * This function is deprecated in favour of fdt_find_max_phandle().
388 * 0, if no phandle was found in the device tree
389 * -1, if an error occurred
398 return (uint32_t)-1; in fdt_get_max_phandle()
404 * fdt_generate_phandle - return a new, unused phandle for a device tree blob
405 * @fdt: pointer to the device tree blob
408 * Walks the device tree blob and looks for the highest phandle value. On
410 * highest phandle value in the device tree blob) will be returned in the
413 * Return: 0 on success or a negative error-code on failure
418 * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
419 * @fdt: pointer to the device tree blob
421 * Returns the number of entries in the device tree blob's memory
431 * fdt_get_mem_rsv - retrieve one memory reserve map entry
432 * @fdt: pointer to the device tree blob
434 * @address: pointer to 64-bit variable to hold the start address
435 * @size: pointer to 64-bit variable to hold the size of the entry
438 * the n-th reserve map entry from the device tree blob, in
439 * native-endian format.
443 * -FDT_ERR_BADMAGIC,
444 * -FDT_ERR_BADVERSION,
445 * -FDT_ERR_BADSTATE, standard meanings
450 * fdt_subnode_offset_namelen - find a subnode based on substring
451 * @fdt: pointer to the device tree blob
461 * Return: offset of the subnode or -FDT_ERR_NOTFOUND if name not found.
463 #ifndef SWIG /* Not available in Python */
468 * fdt_subnode_offset - find a subnode of a given node
469 * @fdt: pointer to the device tree blob
475 * address, in which case fdt_subnode_offset() will find the subnode
476 * with that unit address, or the unit address may be omitted, in
482 * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
483 * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
485 * -FDT_ERR_BADMAGIC,
486 * -FDT_ERR_BADVERSION,
487 * -FDT_ERR_BADSTATE,
488 * -FDT_ERR_BADSTRUCTURE,
489 * -FDT_ERR_TRUNCATED, standard meanings.
494 * fdt_path_offset_namelen - find a tree node by its full path
495 * @fdt: pointer to the device tree blob
504 #ifndef SWIG /* Not available in Python */
509 * fdt_path_offset - find a tree node by its full path
510 * @fdt: pointer to the device tree blob
513 * fdt_path_offset() finds a node of a given path in the device tree.
523 * -FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
524 * -FDT_ERR_NOTFOUND, if the requested node does not exist
525 * -FDT_ERR_BADMAGIC,
526 * -FDT_ERR_BADVERSION,
527 * -FDT_ERR_BADSTATE,
528 * -FDT_ERR_BADSTRUCTURE,
529 * -FDT_ERR_TRUNCATED, standard meanings.
534 * fdt_get_name - retrieve the name of a given node
535 * @fdt: pointer to the device tree blob
540 * device tree node at structure block offset nodeoffset. If lenp is
541 * non-NULL, the length of this name is also returned, in the integer
546 * If lenp is non-NULL, *lenp contains the length of that name
549 * if lenp is non-NULL *lenp contains an error code (<0):
550 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
552 * -FDT_ERR_BADMAGIC,
553 * -FDT_ERR_BADVERSION,
554 * -FDT_ERR_BADSTATE, standard meanings
559 * fdt_first_property_offset - find the offset of a node's first property
560 * @fdt: pointer to the device tree blob
568 * -FDT_ERR_NOTFOUND, if the requested node has no properties
569 * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
570 * -FDT_ERR_BADMAGIC,
571 * -FDT_ERR_BADVERSION,
572 * -FDT_ERR_BADSTATE,
573 * -FDT_ERR_BADSTRUCTURE,
574 * -FDT_ERR_TRUNCATED, standard meanings.
579 * fdt_next_property_offset - step through a node's properties
580 * @fdt: pointer to the device tree blob
589 * -FDT_ERR_NOTFOUND, if the given property is the last in its node
590 * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
591 * -FDT_ERR_BADMAGIC,
592 * -FDT_ERR_BADVERSION,
593 * -FDT_ERR_BADSTATE,
594 * -FDT_ERR_BADSTRUCTURE,
595 * -FDT_ERR_TRUNCATED, standard meanings.
600 * fdt_for_each_property_offset - iterate over all properties of a node
613 * if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) {
618 * iterator in the loop. The node variable can be constant or even a
627 * fdt_get_property_by_offset - retrieve the property at a given offset
628 * @fdt: pointer to the device tree blob
633 * fdt_property structure within the device tree blob at the given
634 * offset. If lenp is non-NULL, the length of the property value is
635 * also returned, in the integer pointed to by lenp.
637 * Note that this code only works on device tree versions >= 16. fdt_getprop()
642 * if lenp is non-NULL, *lenp contains the length of the property
645 * if lenp is non-NULL, *lenp contains an error code (<0):
646 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
647 * -FDT_ERR_BADMAGIC,
648 * -FDT_ERR_BADVERSION,
649 * -FDT_ERR_BADSTATE,
650 * -FDT_ERR_BADSTRUCTURE,
651 * -FDT_ERR_TRUNCATED, standard meanings
658 * fdt_get_property_namelen - find a property based on substring
659 * @fdt: pointer to the device tree blob
671 #ifndef SWIG /* Not available in Python */
679 * fdt_get_property - find a given property in a given node
680 * @fdt: pointer to the device tree blob
686 * structure within the device tree blob corresponding to the property
688 * non-NULL, the length of the property value is also returned, in the
693 * if lenp is non-NULL, *lenp contains the length of the property
696 * if lenp is non-NULL, *lenp contains an error code (<0):
697 * -FDT_ERR_NOTFOUND, node does not have named property
698 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
700 * -FDT_ERR_BADMAGIC,
701 * -FDT_ERR_BADVERSION,
702 * -FDT_ERR_BADSTATE,
703 * -FDT_ERR_BADSTRUCTURE,
704 * -FDT_ERR_TRUNCATED, standard meanings
717 * fdt_getprop_by_offset - retrieve the value of a property at a given offset
718 * @fdt: pointer to the device tree blob
726 * lenp is non-NULL, the length of the property value is also
727 * returned, in the integer pointed to by lenp. If namep is non-NULL,
728 * the property's namne will also be returned in the char * pointed to
729 * by namep (this will be a pointer to within the device tree's string
734 * if lenp is non-NULL, *lenp contains the length of the property
736 * if namep is non-NULL *namep contiains a pointer to the property
739 * if lenp is non-NULL, *lenp contains an error code (<0):
740 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
741 * -FDT_ERR_BADMAGIC,
742 * -FDT_ERR_BADVERSION,
743 * -FDT_ERR_BADSTATE,
744 * -FDT_ERR_BADSTRUCTURE,
745 * -FDT_ERR_TRUNCATED, standard meanings
747 #ifndef SWIG /* This function is not useful in Python */
753 * fdt_getprop_namelen - get property value based on substring
754 * @fdt: pointer to the device tree blob
765 #ifndef SWIG /* Not available in Python */
778 * fdt_getprop - retrieve the value of a given property
779 * @fdt: pointer to the device tree blob
787 * If @lenp is non-NULL, the length of the property value is also
788 * returned, in the integer pointed to by @lenp.
792 * if lenp is non-NULL, *lenp contains the length of the property
795 * if lenp is non-NULL, *lenp contains an error code (<0):
796 * -FDT_ERR_NOTFOUND, node does not have named property
797 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
799 * -FDT_ERR_BADMAGIC,
800 * -FDT_ERR_BADVERSION,
801 * -FDT_ERR_BADSTATE,
802 * -FDT_ERR_BADSTRUCTURE,
803 * -FDT_ERR_TRUNCATED, standard meanings
814 * fdt_get_phandle - retrieve the phandle of a given node
815 * @fdt: pointer to the device tree blob
818 * fdt_get_phandle() retrieves the phandle of the device tree node at
822 * the phandle of the node at nodeoffset, on success (!= 0, != -1)
828 * fdt_get_alias_namelen - get alias based on substring
829 * @fdt: pointer to the device tree blob
839 #ifndef SWIG /* Not available in Python */
845 * fdt_get_alias - retrieve the path referenced by a given alias
846 * @fdt: pointer to the device tree blob
850 * value of the property named @name in the node /aliases.
859 * fdt_get_path - determine the full path of a node
860 * @fdt: pointer to the device tree blob
866 * nodeoffset, and records that path in the buffer at buf.
868 * NOTE: This function is expensive, as it must scan the device tree
874 * nodeoffset, as a NUL-terminated string.
875 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
876 * -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
877 * characters and will not fit in the given buffer.
878 * -FDT_ERR_BADMAGIC,
879 * -FDT_ERR_BADVERSION,
880 * -FDT_ERR_BADSTATE,
881 * -FDT_ERR_BADSTRUCTURE, standard meanings
886 * fdt_supernode_atdepth_offset - find a specific ancestor of a node
887 * @fdt: pointer to the device tree blob
901 * NOTE: This function is expensive, as it must scan the device tree
907 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
908 * -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of
910 * -FDT_ERR_BADMAGIC,
911 * -FDT_ERR_BADVERSION,
912 * -FDT_ERR_BADSTATE,
913 * -FDT_ERR_BADSTRUCTURE, standard meanings
919 * fdt_node_depth - find the depth of a given node
920 * @fdt: pointer to the device tree blob
926 * NOTE: This function is expensive, as it must scan the device tree
931 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
932 * -FDT_ERR_BADMAGIC,
933 * -FDT_ERR_BADVERSION,
934 * -FDT_ERR_BADSTATE,
935 * -FDT_ERR_BADSTRUCTURE, standard meanings
940 * fdt_parent_offset - find the parent of a given node
941 * @fdt: pointer to the device tree blob
948 * NOTE: This function is expensive, as it must scan the device tree
954 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
955 * -FDT_ERR_BADMAGIC,
956 * -FDT_ERR_BADVERSION,
957 * -FDT_ERR_BADSTATE,
958 * -FDT_ERR_BADSTRUCTURE, standard meanings
963 * fdt_node_offset_by_prop_value - find nodes with a given property value
964 * @fdt: pointer to the device tree blob
968 * @proplen: length of the value in propval
973 * startoffset is -1, the very first such node in the tree.
977 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
979 * while (offset != -FDT_ERR_NOTFOUND) {
985 * Note the -1 in the first call to the function, if 0 is used here
992 * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
993 * tree after startoffset
994 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
995 * -FDT_ERR_BADMAGIC,
996 * -FDT_ERR_BADVERSION,
997 * -FDT_ERR_BADSTATE,
998 * -FDT_ERR_BADSTRUCTURE, standard meanings
1005 * fdt_node_offset_by_phandle - find the node with a given phandle
1006 * @fdt: pointer to the device tree blob
1011 * in the tree with the given phandle (an invalid tree), results are
1016 * -FDT_ERR_NOTFOUND, no node with that phandle exists
1017 * -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
1018 * -FDT_ERR_BADMAGIC,
1019 * -FDT_ERR_BADVERSION,
1020 * -FDT_ERR_BADSTATE,
1021 * -FDT_ERR_BADSTRUCTURE, standard meanings
1026 * fdt_node_check_compatible - check a node's compatible property
1027 * @fdt: pointer to the device tree blob
1028 * @nodeoffset: offset of a tree node
1033 * it returns non-zero otherwise, or on error.
1039 * -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
1040 * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
1041 * -FDT_ERR_BADMAGIC,
1042 * -FDT_ERR_BADVERSION,
1043 * -FDT_ERR_BADSTATE,
1044 * -FDT_ERR_BADSTRUCTURE, standard meanings
1050 * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
1051 * @fdt: pointer to the device tree blob
1057 * lists the given compatible string; or if startoffset is -1, the
1058 * very first such node in the tree.
1062 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
1063 * while (offset != -FDT_ERR_NOTFOUND) {
1068 * Note the -1 in the first call to the function, if 0 is used here
1075 * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
1076 * tree after startoffset
1077 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1078 * -FDT_ERR_BADMAGIC,
1079 * -FDT_ERR_BADVERSION,
1080 * -FDT_ERR_BADSTATE,
1081 * -FDT_ERR_BADSTRUCTURE, standard meanings
1087 * fdt_stringlist_contains - check a string list property for a string
1093 * one or more strings, each terminated by \0, as is found in a device tree
1096 * Return: 1 if the string is found in the list, 0 not found, or invalid list
1101 * fdt_stringlist_count - count the number of strings in a string list
1102 * @fdt: pointer to the device tree blob
1103 * @nodeoffset: offset of a tree node
1107 * the number of strings in the given property
1108 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1109 * -FDT_ERR_NOTFOUND if the property does not exist
1114 * fdt_stringlist_search - find a string in a string list and return its index
1115 * @fdt: pointer to the device tree blob
1116 * @nodeoffset: offset of a tree node
1118 * @string: string to look up in the string list
1121 * that are not NUL-terminated. That's because the function will stop after
1123 * small-valued cell properties, such as #address-cells, when searching for
1127 * the index of the string in the list of strings
1128 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1129 * -FDT_ERR_NOTFOUND if the property does not exist or does not contain
1136 * fdt_stringlist_get() - obtain the string at a given index in a string list
1137 * @fdt: pointer to the device tree blob
1138 * @nodeoffset: offset of a tree node
1144 * non-NUL-terminated values. For example on small-valued cell properties
1147 * If non-NULL, the length of the string (on success) or a negative error-code
1148 * (on failure) will be stored in the integer pointer to by lenp.
1151 * A pointer to the string at the given index in the string list or NULL on
1152 * failure. On success the length of the string will be stored in the memory
1153 * location pointed to by the lenp parameter, if non-NULL. On failure one of
1154 * the following negative error codes will be returned in the lenp parameter
1155 * (if non-NULL):
1156 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1157 * -FDT_ERR_NOTFOUND if the property does not exist
1164 /* Read-only functions (addressing related) */
1168 * FDT_MAX_NCELLS - maximum value for #address-cells and #size-cells
1170 * This is the maximum value for #address-cells, #size-cells and
1173 * Implementations may support larger values, but in practice higher
1179 * fdt_address_cells - retrieve address size for a bus represented in the tree
1180 * @fdt: pointer to the device tree blob
1183 * When the node has a valid #address-cells property, returns its value.
1187 * 2, if the node has no #address-cells property
1188 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1189 * #address-cells property
1190 * -FDT_ERR_BADMAGIC,
1191 * -FDT_ERR_BADVERSION,
1192 * -FDT_ERR_BADSTATE,
1193 * -FDT_ERR_BADSTRUCTURE,
1194 * -FDT_ERR_TRUNCATED, standard meanings
1199 * fdt_size_cells - retrieve address range size for a bus represented in the
1200 * tree
1201 * @fdt: pointer to the device tree blob
1204 * When the node has a valid #size-cells property, returns its value.
1208 * 1, if the node has no #size-cells property
1209 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1210 * #size-cells property
1211 * -FDT_ERR_BADMAGIC,
1212 * -FDT_ERR_BADVERSION,
1213 * -FDT_ERR_BADSTATE,
1214 * -FDT_ERR_BADSTRUCTURE,
1215 * -FDT_ERR_TRUNCATED, standard meanings
1221 /* Write-in-place functions */
1225 * fdt_setprop_inplace_namelen_partial - change a property's value,
1227 * @fdt: pointer to the device tree blob
1231 * @idx: index of the property to change in the array
1242 #ifndef SWIG /* Not available in Python */
1250 * fdt_setprop_inplace - change a property's value, but not its size
1251 * @fdt: pointer to the device tree blob
1258 * the data in val, of length len. This function cannot change the
1262 * This function will alter only the bytes in the blob which contain
1264 * of the tree.
1268 * -FDT_ERR_NOSPACE, if len is not equal to the property's current length
1269 * -FDT_ERR_NOTFOUND, node does not have the named property
1270 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1271 * -FDT_ERR_BADMAGIC,
1272 * -FDT_ERR_BADVERSION,
1273 * -FDT_ERR_BADSTATE,
1274 * -FDT_ERR_BADSTRUCTURE,
1275 * -FDT_ERR_TRUNCATED, standard meanings
1277 #ifndef SWIG /* Not available in Python */
1283 * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
1284 * @fdt: pointer to the device tree blob
1287 * @val: 32-bit integer value to replace the property with
1290 * with the 32-bit integer value in val, converting val to big-endian
1295 * This function will alter only the bytes in the blob which contain
1297 * of the tree.
1301 * -FDT_ERR_NOSPACE, if the property's length is not equal to 4
1302 * -FDT_ERR_NOTFOUND, node does not have the named property
1303 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1304 * -FDT_ERR_BADMAGIC,
1305 * -FDT_ERR_BADVERSION,
1306 * -FDT_ERR_BADSTATE,
1307 * -FDT_ERR_BADSTRUCTURE,
1308 * -FDT_ERR_TRUNCATED, standard meanings
1318 * fdt_setprop_inplace_u64 - change the value of a 64-bit integer property
1319 * @fdt: pointer to the device tree blob
1322 * @val: 64-bit integer value to replace the property with
1325 * with the 64-bit integer value in val, converting val to big-endian
1330 * This function will alter only the bytes in the blob which contain
1332 * of the tree.
1336 * -FDT_ERR_NOSPACE, if the property's length is not equal to 8
1337 * -FDT_ERR_NOTFOUND, node does not have the named property
1338 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1339 * -FDT_ERR_BADMAGIC,
1340 * -FDT_ERR_BADVERSION,
1341 * -FDT_ERR_BADSTATE,
1342 * -FDT_ERR_BADSTRUCTURE,
1343 * -FDT_ERR_TRUNCATED, standard meanings
1353 * fdt_setprop_inplace_cell - change the value of a single-cell property
1354 * @fdt: pointer to the device tree blob
1357 * @val: new value of the 32-bit cell
1369 * fdt_nop_property - replace a property with nop tags
1370 * @fdt: pointer to the device tree blob
1375 * in the blob with FDT_NOP tags, effectively removing it from the
1376 * tree.
1378 * This function will alter only the bytes in the blob which contain
1380 * tree.
1384 * -FDT_ERR_NOTFOUND, node does not have the named property
1385 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1386 * -FDT_ERR_BADMAGIC,
1387 * -FDT_ERR_BADVERSION,
1388 * -FDT_ERR_BADSTATE,
1389 * -FDT_ERR_BADSTRUCTURE,
1390 * -FDT_ERR_TRUNCATED, standard meanings
1395 * fdt_nop_node - replace a node (subtree) with nop tags
1396 * @fdt: pointer to the device tree blob
1399 * fdt_nop_node() will replace a given node's representation in the
1401 * effectively removing it from the tree.
1403 * This function will alter only the bytes in the blob which contain
1405 * move any other part of the tree.
1409 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1410 * -FDT_ERR_BADMAGIC,
1411 * -FDT_ERR_BADVERSION,
1412 * -FDT_ERR_BADSTATE,
1413 * -FDT_ERR_BADSTRUCTURE,
1414 * -FDT_ERR_TRUNCATED, standard meanings
1424 /* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property
1425 * names in the fdt. This can result in faster creation times, but
1431 * fdt_create_with_flags - begin creation of a new fdt
1443 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1444 * -FDT_ERR_BADFLAGS, flags is not valid
1449 * fdt_create - begin creation of a new fdt
1457 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1477 #ifndef SWIG /* Not available in Python */
1485 * fdt_property_placeholder - add a new property and return a ptr to its value
1487 * @fdt: pointer to the device tree blob
1489 * @len: length of property value in bytes
1494 * -FDT_ERR_BADMAGIC,
1495 * -FDT_ERR_NOSPACE, standard meanings
1505 /* Read-write functions */
1513 * fdt_add_mem_rsv - add one memory reserve map entry
1514 * @fdt: pointer to the device tree blob
1515 * @address: 64-bit start address of the reserve map entry
1516 * @size: 64-bit size of the reserved region
1522 * therefore change the indexes of some entries in the table.
1526 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1528 * -FDT_ERR_BADMAGIC,
1529 * -FDT_ERR_BADVERSION,
1530 * -FDT_ERR_BADSTATE,
1531 * -FDT_ERR_BADSTRUCTURE,
1532 * -FDT_ERR_BADLAYOUT,
1533 * -FDT_ERR_TRUNCATED, standard meanings
1538 * fdt_del_mem_rsv - remove a memory reserve map entry
1539 * @fdt: pointer to the device tree blob
1542 * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
1546 * therefore change the indexes of some entries in the table.
1550 * -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
1552 * -FDT_ERR_BADMAGIC,
1553 * -FDT_ERR_BADVERSION,
1554 * -FDT_ERR_BADSTATE,
1555 * -FDT_ERR_BADSTRUCTURE,
1556 * -FDT_ERR_BADLAYOUT,
1557 * -FDT_ERR_TRUNCATED, standard meanings
1562 * fdt_set_name - change the name of a given node
1563 * @fdt: pointer to the device tree blob
1578 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob
1580 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1581 * -FDT_ERR_BADMAGIC,
1582 * -FDT_ERR_BADVERSION,
1583 * -FDT_ERR_BADSTATE, standard meanings
1588 * fdt_setprop - create or change a property
1589 * @fdt: pointer to the device tree blob
1595 * fdt_setprop() sets the value of the named property in the given
1604 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1606 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1607 * -FDT_ERR_BADLAYOUT,
1608 * -FDT_ERR_BADMAGIC,
1609 * -FDT_ERR_BADVERSION,
1610 * -FDT_ERR_BADSTATE,
1611 * -FDT_ERR_BADSTRUCTURE,
1612 * -FDT_ERR_BADLAYOUT,
1613 * -FDT_ERR_TRUNCATED, standard meanings
1619 * fdt_setprop_placeholder - allocate space for a property
1620 * @fdt: pointer to the device tree blob
1626 * fdt_setprop_placeholer() allocates the named property in the given node.
1627 * If the property exists it is resized. In either case a pointer to the
1635 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1637 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1638 * -FDT_ERR_BADLAYOUT,
1639 * -FDT_ERR_BADMAGIC,
1640 * -FDT_ERR_BADVERSION,
1641 * -FDT_ERR_BADSTATE,
1642 * -FDT_ERR_BADSTRUCTURE,
1643 * -FDT_ERR_BADLAYOUT,
1644 * -FDT_ERR_TRUNCATED, standard meanings
1650 * fdt_setprop_u32 - set a property to a 32-bit integer
1651 * @fdt: pointer to the device tree blob
1654 * @val: 32-bit integer value for the property (native endian)
1656 * fdt_setprop_u32() sets the value of the named property in the given
1657 * node to the given 32-bit integer value (converting to big-endian if
1666 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1668 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1669 * -FDT_ERR_BADLAYOUT,
1670 * -FDT_ERR_BADMAGIC,
1671 * -FDT_ERR_BADVERSION,
1672 * -FDT_ERR_BADSTATE,
1673 * -FDT_ERR_BADSTRUCTURE,
1674 * -FDT_ERR_BADLAYOUT,
1675 * -FDT_ERR_TRUNCATED, standard meanings
1685 * fdt_setprop_u64 - set a property to a 64-bit integer
1686 * @fdt: pointer to the device tree blob
1689 * @val: 64-bit integer value for the property (native endian)
1691 * fdt_setprop_u64() sets the value of the named property in the given
1692 * node to the given 64-bit integer value (converting to big-endian if
1701 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1703 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1704 * -FDT_ERR_BADLAYOUT,
1705 * -FDT_ERR_BADMAGIC,
1706 * -FDT_ERR_BADVERSION,
1707 * -FDT_ERR_BADSTATE,
1708 * -FDT_ERR_BADSTRUCTURE,
1709 * -FDT_ERR_BADLAYOUT,
1710 * -FDT_ERR_TRUNCATED, standard meanings
1720 * fdt_setprop_cell - set a property to a single cell value
1721 * @fdt: pointer to the device tree blob
1724 * @val: 32-bit integer value for the property (native endian)
1737 * fdt_setprop_string - set a property to a string value
1738 * @fdt: pointer to the device tree blob
1743 * fdt_setprop_string() sets the value of the named property in the
1753 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1755 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1756 * -FDT_ERR_BADLAYOUT,
1757 * -FDT_ERR_BADMAGIC,
1758 * -FDT_ERR_BADVERSION,
1759 * -FDT_ERR_BADSTATE,
1760 * -FDT_ERR_BADSTRUCTURE,
1761 * -FDT_ERR_BADLAYOUT,
1762 * -FDT_ERR_TRUNCATED, standard meanings
1769 * fdt_setprop_empty - set a property to an empty value
1770 * @fdt: pointer to the device tree blob
1774 * fdt_setprop_empty() sets the value of the named property in the
1783 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1785 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1786 * -FDT_ERR_BADLAYOUT,
1787 * -FDT_ERR_BADMAGIC,
1788 * -FDT_ERR_BADVERSION,
1789 * -FDT_ERR_BADSTATE,
1790 * -FDT_ERR_BADSTRUCTURE,
1791 * -FDT_ERR_BADLAYOUT,
1792 * -FDT_ERR_TRUNCATED, standard meanings
1798 * fdt_appendprop - append to or create a property
1799 * @fdt: pointer to the device tree blob
1805 * fdt_appendprop() appends the value to the named property in the
1813 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1815 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1816 * -FDT_ERR_BADLAYOUT,
1817 * -FDT_ERR_BADMAGIC,
1818 * -FDT_ERR_BADVERSION,
1819 * -FDT_ERR_BADSTATE,
1820 * -FDT_ERR_BADSTRUCTURE,
1821 * -FDT_ERR_BADLAYOUT,
1822 * -FDT_ERR_TRUNCATED, standard meanings
1828 * fdt_appendprop_u32 - append a 32-bit integer value to a property
1829 * @fdt: pointer to the device tree blob
1832 * @val: 32-bit integer value to append to the property (native endian)
1834 * fdt_appendprop_u32() appends the given 32-bit integer value
1835 * (converting to big-endian if necessary) to the value of the named
1836 * property in the given node, or creates a new property with that
1844 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1846 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1847 * -FDT_ERR_BADLAYOUT,
1848 * -FDT_ERR_BADMAGIC,
1849 * -FDT_ERR_BADVERSION,
1850 * -FDT_ERR_BADSTATE,
1851 * -FDT_ERR_BADSTRUCTURE,
1852 * -FDT_ERR_BADLAYOUT,
1853 * -FDT_ERR_TRUNCATED, standard meanings
1863 * fdt_appendprop_u64 - append a 64-bit integer value to a property
1864 * @fdt: pointer to the device tree blob
1867 * @val: 64-bit integer value to append to the property (native endian)
1869 * fdt_appendprop_u64() appends the given 64-bit integer value
1870 * (converting to big-endian if necessary) to the value of the named
1871 * property in the given node, or creates a new property with that
1879 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1881 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1882 * -FDT_ERR_BADLAYOUT,
1883 * -FDT_ERR_BADMAGIC,
1884 * -FDT_ERR_BADVERSION,
1885 * -FDT_ERR_BADSTATE,
1886 * -FDT_ERR_BADSTRUCTURE,
1887 * -FDT_ERR_BADLAYOUT,
1888 * -FDT_ERR_TRUNCATED, standard meanings
1898 * fdt_appendprop_cell - append a single cell value to a property
1899 * @fdt: pointer to the device tree blob
1902 * @val: 32-bit integer value to append to the property (native endian)
1915 * fdt_appendprop_string - append a string to a property
1916 * @fdt: pointer to the device tree blob
1922 * the named property in the given node, or creates a new property
1930 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1932 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1933 * -FDT_ERR_BADLAYOUT,
1934 * -FDT_ERR_BADMAGIC,
1935 * -FDT_ERR_BADVERSION,
1936 * -FDT_ERR_BADSTATE,
1937 * -FDT_ERR_BADSTRUCTURE,
1938 * -FDT_ERR_BADLAYOUT,
1939 * -FDT_ERR_TRUNCATED, standard meanings
1945 * fdt_appendprop_addrrange - append a address range property
1946 * @fdt: pointer to the device tree blob
1954 * address and size) to the value of the named property in the given
1958 * Cell sizes are determined by parent's #address-cells and #size-cells.
1965 * -FDT_ERR_BADLAYOUT,
1966 * -FDT_ERR_BADMAGIC,
1967 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1968 * #address-cells property
1969 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1970 * -FDT_ERR_BADSTATE,
1971 * -FDT_ERR_BADSTRUCTURE,
1972 * -FDT_ERR_BADVERSION,
1973 * -FDT_ERR_BADVALUE, addr or size doesn't fit to respective cells size
1974 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1976 * -FDT_ERR_TRUNCATED, standard meanings
1982 * fdt_delprop - delete a property
1983 * @fdt: pointer to the device tree blob
1994 * -FDT_ERR_NOTFOUND, node does not have the named property
1995 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1996 * -FDT_ERR_BADLAYOUT,
1997 * -FDT_ERR_BADMAGIC,
1998 * -FDT_ERR_BADVERSION,
1999 * -FDT_ERR_BADSTATE,
2000 * -FDT_ERR_BADSTRUCTURE,
2001 * -FDT_ERR_TRUNCATED, standard meanings
2006 * fdt_add_subnode_namelen - creates a new node based on substring
2007 * @fdt: pointer to the device tree blob
2020 #ifndef SWIG /* Not available in Python */
2026 * fdt_add_subnode - creates a new node
2027 * @fdt: pointer to the device tree blob
2041 * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
2042 * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
2044 * -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
2046 * -FDT_ERR_NOSPACE, if there is insufficient free space in the
2048 * -FDT_ERR_NOSPACE
2049 * -FDT_ERR_BADLAYOUT
2050 * -FDT_ERR_BADMAGIC,
2051 * -FDT_ERR_BADVERSION,
2052 * -FDT_ERR_BADSTATE,
2053 * -FDT_ERR_BADSTRUCTURE,
2054 * -FDT_ERR_TRUNCATED, standard meanings.
2059 * fdt_del_node - delete a node (subtree)
2060 * @fdt: pointer to the device tree blob
2071 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2072 * -FDT_ERR_BADLAYOUT,
2073 * -FDT_ERR_BADMAGIC,
2074 * -FDT_ERR_BADVERSION,
2075 * -FDT_ERR_BADSTATE,
2076 * -FDT_ERR_BADSTRUCTURE,
2077 * -FDT_ERR_TRUNCATED, standard meanings
2082 * fdt_overlay_apply - Applies a DT overlay on a base DT
2083 * @fdt: pointer to the base device tree blob
2084 * @fdto: pointer to the device tree overlay blob
2086 * fdt_overlay_apply() will apply the given device tree overlay on the
2087 * given base device tree.
2089 * Expect the base device tree to be modified, even if the function
2094 * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
2095 * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
2096 * properties in the base DT
2097 * -FDT_ERR_BADPHANDLE,
2098 * -FDT_ERR_BADOVERLAY,
2099 * -FDT_ERR_NOPHANDLES,
2100 * -FDT_ERR_INTERNAL,
2101 * -FDT_ERR_BADLAYOUT,
2102 * -FDT_ERR_BADMAGIC,
2103 * -FDT_ERR_BADOFFSET,
2104 * -FDT_ERR_BADPATH,
2105 * -FDT_ERR_BADVERSION,
2106 * -FDT_ERR_BADSTRUCTURE,
2107 * -FDT_ERR_BADSTATE,
2108 * -FDT_ERR_TRUNCATED, standard meanings