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
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)) {
236 * iterator in the loop. The parent variable be constant or even a
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
282 * Return: size of DTB header in bytes
287 * fdt_header_size_ - internal function to get header size from a version number
290 * Return: size of DTB header in bytes
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
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
347 * returns the string's length in *lenp.
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
387 * fdt_get_max_phandle retrieves the highest phandle in the given
388 * device tree. This will ignore badly formatted phandles, or phandles
389 * with a value of 0 or -1.
391 * This function is deprecated in favour of fdt_find_max_phandle().
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.
470 #ifndef SWIG /* Not available in Python */
475 * fdt_subnode_offset - find a subnode of a given node
476 * @fdt: pointer to the device tree blob
482 * address, in which case fdt_subnode_offset() will find the subnode
483 * with that unit address, or the unit address may be omitted, in
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
511 #ifndef SWIG /* Not available in Python */
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.
529 * that name is looked up in the /aliases node, and the value of that
530 * property used in place of that first component.
554 * -FDT_ERR_BADPATH, given path does not begin with '/' and the first
556 * -FDT_ERR_NOTFOUND, if the requested node does not exist
557 * -FDT_ERR_BADMAGIC,
558 * -FDT_ERR_BADVERSION,
559 * -FDT_ERR_BADSTATE,
560 * -FDT_ERR_BADSTRUCTURE,
561 * -FDT_ERR_TRUNCATED, standard meanings.
566 * fdt_get_name - retrieve the name of a given node
567 * @fdt: pointer to the device tree blob
572 * device tree node at structure block offset nodeoffset. If lenp is
573 * non-NULL, the length of this name is also returned, in the integer
578 * If lenp is non-NULL, *lenp contains the length of that name
581 * if lenp is non-NULL *lenp contains an error code (<0):
582 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
584 * -FDT_ERR_BADMAGIC,
585 * -FDT_ERR_BADVERSION,
586 * -FDT_ERR_BADSTATE, standard meanings
591 * fdt_first_property_offset - find the offset of a node's first property
592 * @fdt: pointer to the device tree blob
600 * -FDT_ERR_NOTFOUND, if the requested node has no properties
601 * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
602 * -FDT_ERR_BADMAGIC,
603 * -FDT_ERR_BADVERSION,
604 * -FDT_ERR_BADSTATE,
605 * -FDT_ERR_BADSTRUCTURE,
606 * -FDT_ERR_TRUNCATED, standard meanings.
611 * fdt_next_property_offset - step through a node's properties
612 * @fdt: pointer to the device tree blob
621 * -FDT_ERR_NOTFOUND, if the given property is the last in its node
622 * -FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
623 * -FDT_ERR_BADMAGIC,
624 * -FDT_ERR_BADVERSION,
625 * -FDT_ERR_BADSTATE,
626 * -FDT_ERR_BADSTRUCTURE,
627 * -FDT_ERR_TRUNCATED, standard meanings.
632 * fdt_for_each_property_offset - iterate over all properties of a node
645 * if ((property < 0) && (property != -FDT_ERR_NOTFOUND)) {
650 * iterator in the loop. The node variable can be constant or even a
659 * fdt_get_property_by_offset - retrieve the property at a given offset
660 * @fdt: pointer to the device tree blob
665 * fdt_property structure within the device tree blob at the given
666 * offset. If lenp is non-NULL, the length of the property value is
667 * also returned, in the integer pointed to by lenp.
669 * Note that this code only works on device tree versions >= 16. fdt_getprop()
674 * if lenp is non-NULL, *lenp contains the length of the property
677 * if lenp is non-NULL, *lenp contains an error code (<0):
678 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
679 * -FDT_ERR_BADMAGIC,
680 * -FDT_ERR_BADVERSION,
681 * -FDT_ERR_BADSTATE,
682 * -FDT_ERR_BADSTRUCTURE,
683 * -FDT_ERR_TRUNCATED, standard meanings
697 * fdt_get_property_namelen - find a property based on substring
698 * @fdt: pointer to the device tree blob
710 #ifndef SWIG /* Not available in Python */
718 * fdt_get_property - find a given property in a given node
719 * @fdt: pointer to the device tree blob
725 * structure within the device tree blob corresponding to the property
727 * non-NULL, the length of the property value is also returned, in the
732 * if lenp is non-NULL, *lenp contains the length of the property
735 * if lenp is non-NULL, *lenp contains an error code (<0):
736 * -FDT_ERR_NOTFOUND, node does not have named property
737 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
739 * -FDT_ERR_BADMAGIC,
740 * -FDT_ERR_BADVERSION,
741 * -FDT_ERR_BADSTATE,
742 * -FDT_ERR_BADSTRUCTURE,
743 * -FDT_ERR_TRUNCATED, standard meanings
756 * fdt_getprop_by_offset - retrieve the value of a property at a given offset
757 * @fdt: pointer to the device tree blob
765 * lenp is non-NULL, the length of the property value is also
766 * returned, in the integer pointed to by lenp. If namep is non-NULL,
767 * the property's namne will also be returned in the char * pointed to
768 * by namep (this will be a pointer to within the device tree's string
773 * if lenp is non-NULL, *lenp contains the length of the property
775 * if namep is non-NULL *namep contiains a pointer to the property
778 * if lenp is non-NULL, *lenp contains an error code (<0):
779 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
780 * -FDT_ERR_BADMAGIC,
781 * -FDT_ERR_BADVERSION,
782 * -FDT_ERR_BADSTATE,
783 * -FDT_ERR_BADSTRUCTURE,
784 * -FDT_ERR_TRUNCATED, standard meanings
786 #ifndef SWIG /* This function is not useful in Python */
792 * fdt_getprop_namelen - get property value based on substring
793 * @fdt: pointer to the device tree blob
804 #ifndef SWIG /* Not available in Python */
817 * fdt_getprop - retrieve the value of a given property
818 * @fdt: pointer to the device tree blob
826 * If @lenp is non-NULL, the length of the property value is also
827 * returned, in the integer pointed to by @lenp.
831 * if lenp is non-NULL, *lenp contains the length of the property
834 * if lenp is non-NULL, *lenp contains an error code (<0):
835 * -FDT_ERR_NOTFOUND, node does not have named property
836 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE
838 * -FDT_ERR_BADMAGIC,
839 * -FDT_ERR_BADVERSION,
840 * -FDT_ERR_BADSTATE,
841 * -FDT_ERR_BADSTRUCTURE,
842 * -FDT_ERR_TRUNCATED, standard meanings
853 * fdt_get_phandle - retrieve the phandle of a given node
854 * @fdt: pointer to the device tree blob
857 * fdt_get_phandle() retrieves the phandle of the device tree node at
861 * the phandle of the node at nodeoffset, on success (!= 0, != -1)
867 * fdt_get_alias_namelen - get alias based on substring
868 * @fdt: pointer to the device tree blob
878 #ifndef SWIG /* Not available in Python */
884 * fdt_get_alias - retrieve the path referenced by a given alias
885 * @fdt: pointer to the device tree blob
889 * value of the property named @name in the node /aliases.
898 * fdt_get_symbol_namelen - get symbol based on substring
899 * @fdt: pointer to the device tree blob
909 #ifndef SWIG /* Not available in Python */
915 * fdt_get_symbol - retrieve the path referenced by a given symbol
916 * @fdt: pointer to the device tree blob
920 * the value of the property named @name in the node
921 * /__symbols__. Such a node exists only for a device tree blob that
922 * has been compiled with the -@ dtc option. Each property corresponds
923 * to a label appearing in the device tree source, with the name of
934 * fdt_get_path - determine the full path of a node
935 * @fdt: pointer to the device tree blob
941 * nodeoffset, and records that path in the buffer at buf.
943 * NOTE: This function is expensive, as it must scan the device tree
949 * nodeoffset, as a NUL-terminated string.
950 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
951 * -FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
952 * characters and will not fit in the given buffer.
953 * -FDT_ERR_BADMAGIC,
954 * -FDT_ERR_BADVERSION,
955 * -FDT_ERR_BADSTATE,
956 * -FDT_ERR_BADSTRUCTURE, standard meanings
961 * fdt_supernode_atdepth_offset - find a specific ancestor of a node
962 * @fdt: pointer to the device tree blob
976 * NOTE: This function is expensive, as it must scan the device tree
982 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
983 * -FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of
985 * -FDT_ERR_BADMAGIC,
986 * -FDT_ERR_BADVERSION,
987 * -FDT_ERR_BADSTATE,
988 * -FDT_ERR_BADSTRUCTURE, standard meanings
994 * fdt_node_depth - find the depth of a given node
995 * @fdt: pointer to the device tree blob
1001 * NOTE: This function is expensive, as it must scan the device tree
1006 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1007 * -FDT_ERR_BADMAGIC,
1008 * -FDT_ERR_BADVERSION,
1009 * -FDT_ERR_BADSTATE,
1010 * -FDT_ERR_BADSTRUCTURE, standard meanings
1015 * fdt_parent_offset - find the parent of a given node
1016 * @fdt: pointer to the device tree blob
1023 * NOTE: This function is expensive, as it must scan the device tree
1029 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1030 * -FDT_ERR_BADMAGIC,
1031 * -FDT_ERR_BADVERSION,
1032 * -FDT_ERR_BADSTATE,
1033 * -FDT_ERR_BADSTRUCTURE, standard meanings
1038 * fdt_node_offset_by_prop_value - find nodes with a given property value
1039 * @fdt: pointer to the device tree blob
1043 * @proplen: length of the value in propval
1048 * startoffset is -1, the very first such node in the tree.
1052 * offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
1054 * while (offset != -FDT_ERR_NOTFOUND) {
1060 * Note the -1 in the first call to the function, if 0 is used here
1067 * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
1068 * tree after startoffset
1069 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1070 * -FDT_ERR_BADMAGIC,
1071 * -FDT_ERR_BADVERSION,
1072 * -FDT_ERR_BADSTATE,
1073 * -FDT_ERR_BADSTRUCTURE, standard meanings
1080 * fdt_node_offset_by_phandle - find the node with a given phandle
1081 * @fdt: pointer to the device tree blob
1086 * in the tree with the given phandle (an invalid tree), results are
1091 * -FDT_ERR_NOTFOUND, no node with that phandle exists
1092 * -FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
1093 * -FDT_ERR_BADMAGIC,
1094 * -FDT_ERR_BADVERSION,
1095 * -FDT_ERR_BADSTATE,
1096 * -FDT_ERR_BADSTRUCTURE, standard meanings
1101 * fdt_node_check_compatible - check a node's compatible property
1102 * @fdt: pointer to the device tree blob
1103 * @nodeoffset: offset of a tree node
1108 * it returns non-zero otherwise, or on error.
1114 * -FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
1115 * -FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
1116 * -FDT_ERR_BADMAGIC,
1117 * -FDT_ERR_BADVERSION,
1118 * -FDT_ERR_BADSTATE,
1119 * -FDT_ERR_BADSTRUCTURE, standard meanings
1125 * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
1126 * @fdt: pointer to the device tree blob
1132 * lists the given compatible string; or if startoffset is -1, the
1133 * very first such node in the tree.
1137 * offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
1138 * while (offset != -FDT_ERR_NOTFOUND) {
1143 * Note the -1 in the first call to the function, if 0 is used here
1150 * -FDT_ERR_NOTFOUND, no node matching the criterion exists in the
1151 * tree after startoffset
1152 * -FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
1153 * -FDT_ERR_BADMAGIC,
1154 * -FDT_ERR_BADVERSION,
1155 * -FDT_ERR_BADSTATE,
1156 * -FDT_ERR_BADSTRUCTURE, standard meanings
1162 * fdt_stringlist_contains - check a string list property for a string
1168 * one or more strings, each terminated by \0, as is found in a device tree
1171 * Return: 1 if the string is found in the list, 0 not found, or invalid list
1176 * fdt_stringlist_count - count the number of strings in a string list
1177 * @fdt: pointer to the device tree blob
1178 * @nodeoffset: offset of a tree node
1182 * the number of strings in the given property
1183 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1184 * -FDT_ERR_NOTFOUND if the property does not exist
1189 * fdt_stringlist_search - find a string in a string list and return its index
1190 * @fdt: pointer to the device tree blob
1191 * @nodeoffset: offset of a tree node
1193 * @string: string to look up in the string list
1196 * that are not NUL-terminated. That's because the function will stop after
1198 * small-valued cell properties, such as #address-cells, when searching for
1202 * the index of the string in the list of strings
1203 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1204 * -FDT_ERR_NOTFOUND if the property does not exist or does not contain
1211 * fdt_stringlist_get() - obtain the string at a given index in a string list
1212 * @fdt: pointer to the device tree blob
1213 * @nodeoffset: offset of a tree node
1219 * non-NUL-terminated values. For example on small-valued cell properties
1222 * If non-NULL, the length of the string (on success) or a negative error-code
1223 * (on failure) will be stored in the integer pointer to by lenp.
1226 * A pointer to the string at the given index in the string list or NULL on
1227 * failure. On success the length of the string will be stored in the memory
1228 * location pointed to by the lenp parameter, if non-NULL. On failure one of
1229 * the following negative error codes will be returned in the lenp parameter
1230 * (if non-NULL):
1231 * -FDT_ERR_BADVALUE if the property value is not NUL-terminated
1232 * -FDT_ERR_NOTFOUND if the property does not exist
1239 /* Read-only functions (addressing related) */
1243 * FDT_MAX_NCELLS - maximum value for #address-cells and #size-cells
1245 * This is the maximum value for #address-cells, #size-cells and
1248 * Implementations may support larger values, but in practice higher
1254 * fdt_address_cells - retrieve address size for a bus represented in the tree
1255 * @fdt: pointer to the device tree blob
1258 * When the node has a valid #address-cells property, returns its value.
1262 * 2, if the node has no #address-cells property
1263 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1264 * #address-cells property
1265 * -FDT_ERR_BADMAGIC,
1266 * -FDT_ERR_BADVERSION,
1267 * -FDT_ERR_BADSTATE,
1268 * -FDT_ERR_BADSTRUCTURE,
1269 * -FDT_ERR_TRUNCATED, standard meanings
1274 * fdt_size_cells - retrieve address range size for a bus represented in the
1275 * tree
1276 * @fdt: pointer to the device tree blob
1279 * When the node has a valid #size-cells property, returns its value.
1283 * 1, if the node has no #size-cells property
1284 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
1285 * #size-cells property
1286 * -FDT_ERR_BADMAGIC,
1287 * -FDT_ERR_BADVERSION,
1288 * -FDT_ERR_BADSTATE,
1289 * -FDT_ERR_BADSTRUCTURE,
1290 * -FDT_ERR_TRUNCATED, standard meanings
1296 /* Write-in-place functions */
1300 * fdt_setprop_inplace_namelen_partial - change a property's value,
1302 * @fdt: pointer to the device tree blob
1306 * @idx: index of the property to change in the array
1317 #ifndef SWIG /* Not available in Python */
1325 * fdt_setprop_inplace - change a property's value, but not its size
1326 * @fdt: pointer to the device tree blob
1333 * the data in val, of length len. This function cannot change the
1337 * This function will alter only the bytes in the blob which contain
1339 * of the tree.
1343 * -FDT_ERR_NOSPACE, if len is not equal to the property's current length
1344 * -FDT_ERR_NOTFOUND, node does not have the named property
1345 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1346 * -FDT_ERR_BADMAGIC,
1347 * -FDT_ERR_BADVERSION,
1348 * -FDT_ERR_BADSTATE,
1349 * -FDT_ERR_BADSTRUCTURE,
1350 * -FDT_ERR_TRUNCATED, standard meanings
1352 #ifndef SWIG /* Not available in Python */
1358 * fdt_setprop_inplace_u32 - change the value of a 32-bit integer property
1359 * @fdt: pointer to the device tree blob
1362 * @val: 32-bit integer value to replace the property with
1365 * with the 32-bit integer value in val, converting val to big-endian
1370 * This function will alter only the bytes in the blob which contain
1372 * of the tree.
1376 * -FDT_ERR_NOSPACE, if the property's length is not equal to 4
1377 * -FDT_ERR_NOTFOUND, node does not have the named property
1378 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1379 * -FDT_ERR_BADMAGIC,
1380 * -FDT_ERR_BADVERSION,
1381 * -FDT_ERR_BADSTATE,
1382 * -FDT_ERR_BADSTRUCTURE,
1383 * -FDT_ERR_TRUNCATED, standard meanings
1393 * fdt_setprop_inplace_u64 - change the value of a 64-bit integer property
1394 * @fdt: pointer to the device tree blob
1397 * @val: 64-bit integer value to replace the property with
1400 * with the 64-bit integer value in val, converting val to big-endian
1405 * This function will alter only the bytes in the blob which contain
1407 * of the tree.
1411 * -FDT_ERR_NOSPACE, if the property's length is not equal to 8
1412 * -FDT_ERR_NOTFOUND, node does not have the named property
1413 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1414 * -FDT_ERR_BADMAGIC,
1415 * -FDT_ERR_BADVERSION,
1416 * -FDT_ERR_BADSTATE,
1417 * -FDT_ERR_BADSTRUCTURE,
1418 * -FDT_ERR_TRUNCATED, standard meanings
1428 * fdt_setprop_inplace_cell - change the value of a single-cell property
1429 * @fdt: pointer to the device tree blob
1432 * @val: new value of the 32-bit cell
1444 * fdt_nop_property - replace a property with nop tags
1445 * @fdt: pointer to the device tree blob
1450 * in the blob with FDT_NOP tags, effectively removing it from the
1451 * tree.
1453 * This function will alter only the bytes in the blob which contain
1455 * tree.
1459 * -FDT_ERR_NOTFOUND, node does not have the named property
1460 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1461 * -FDT_ERR_BADMAGIC,
1462 * -FDT_ERR_BADVERSION,
1463 * -FDT_ERR_BADSTATE,
1464 * -FDT_ERR_BADSTRUCTURE,
1465 * -FDT_ERR_TRUNCATED, standard meanings
1470 * fdt_nop_node - replace a node (subtree) with nop tags
1471 * @fdt: pointer to the device tree blob
1474 * fdt_nop_node() will replace a given node's representation in the
1476 * effectively removing it from the tree.
1478 * This function will alter only the bytes in the blob which contain
1480 * move any other part of the tree.
1484 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1485 * -FDT_ERR_BADMAGIC,
1486 * -FDT_ERR_BADVERSION,
1487 * -FDT_ERR_BADSTATE,
1488 * -FDT_ERR_BADSTRUCTURE,
1489 * -FDT_ERR_TRUNCATED, standard meanings
1499 /* FDT_CREATE_FLAG_NO_NAME_DEDUP: Do not try to de-duplicate property
1500 * names in the fdt. This can result in faster creation times, but
1506 * fdt_create_with_flags - begin creation of a new fdt
1518 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1519 * -FDT_ERR_BADFLAGS, flags is not valid
1524 * fdt_create - begin creation of a new fdt
1532 * -FDT_ERR_NOSPACE, bufsize is insufficient for a minimal fdt
1552 #ifndef SWIG /* Not available in Python */
1560 * fdt_property_placeholder - add a new property and return a ptr to its value
1562 * @fdt: pointer to the device tree blob
1564 * @len: length of property value in bytes
1569 * -FDT_ERR_BADMAGIC,
1570 * -FDT_ERR_NOSPACE, standard meanings
1580 /* Read-write functions */
1588 * fdt_add_mem_rsv - add one memory reserve map entry
1589 * @fdt: pointer to the device tree blob
1590 * @address: 64-bit start address of the reserve map entry
1591 * @size: 64-bit size of the reserved region
1597 * therefore change the indexes of some entries in the table.
1601 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1603 * -FDT_ERR_BADMAGIC,
1604 * -FDT_ERR_BADVERSION,
1605 * -FDT_ERR_BADSTATE,
1606 * -FDT_ERR_BADSTRUCTURE,
1607 * -FDT_ERR_BADLAYOUT,
1608 * -FDT_ERR_TRUNCATED, standard meanings
1613 * fdt_del_mem_rsv - remove a memory reserve map entry
1614 * @fdt: pointer to the device tree blob
1617 * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
1621 * therefore change the indexes of some entries in the table.
1625 * -FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
1627 * -FDT_ERR_BADMAGIC,
1628 * -FDT_ERR_BADVERSION,
1629 * -FDT_ERR_BADSTATE,
1630 * -FDT_ERR_BADSTRUCTURE,
1631 * -FDT_ERR_BADLAYOUT,
1632 * -FDT_ERR_TRUNCATED, standard meanings
1637 * fdt_set_name - change the name of a given node
1638 * @fdt: pointer to the device tree blob
1653 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob
1655 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1656 * -FDT_ERR_BADMAGIC,
1657 * -FDT_ERR_BADVERSION,
1658 * -FDT_ERR_BADSTATE, standard meanings
1663 * fdt_setprop - create or change a property
1664 * @fdt: pointer to the device tree blob
1670 * fdt_setprop() sets the value of the named property in the given
1679 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1681 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1682 * -FDT_ERR_BADLAYOUT,
1683 * -FDT_ERR_BADMAGIC,
1684 * -FDT_ERR_BADVERSION,
1685 * -FDT_ERR_BADSTATE,
1686 * -FDT_ERR_BADSTRUCTURE,
1687 * -FDT_ERR_BADLAYOUT,
1688 * -FDT_ERR_TRUNCATED, standard meanings
1694 * fdt_setprop_placeholder - allocate space for a property
1695 * @fdt: pointer to the device tree blob
1701 * fdt_setprop_placeholer() allocates the named property in the given node.
1702 * If the property exists it is resized. In either case a pointer to the
1710 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1712 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1713 * -FDT_ERR_BADLAYOUT,
1714 * -FDT_ERR_BADMAGIC,
1715 * -FDT_ERR_BADVERSION,
1716 * -FDT_ERR_BADSTATE,
1717 * -FDT_ERR_BADSTRUCTURE,
1718 * -FDT_ERR_BADLAYOUT,
1719 * -FDT_ERR_TRUNCATED, standard meanings
1725 * fdt_setprop_u32 - set a property to a 32-bit integer
1726 * @fdt: pointer to the device tree blob
1729 * @val: 32-bit integer value for the property (native endian)
1731 * fdt_setprop_u32() sets the value of the named property in the given
1732 * node to the given 32-bit integer value (converting to big-endian if
1741 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1743 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1744 * -FDT_ERR_BADLAYOUT,
1745 * -FDT_ERR_BADMAGIC,
1746 * -FDT_ERR_BADVERSION,
1747 * -FDT_ERR_BADSTATE,
1748 * -FDT_ERR_BADSTRUCTURE,
1749 * -FDT_ERR_BADLAYOUT,
1750 * -FDT_ERR_TRUNCATED, standard meanings
1760 * fdt_setprop_u64 - set a property to a 64-bit integer
1761 * @fdt: pointer to the device tree blob
1764 * @val: 64-bit integer value for the property (native endian)
1766 * fdt_setprop_u64() sets the value of the named property in the given
1767 * node to the given 64-bit integer value (converting to big-endian if
1776 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1778 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1779 * -FDT_ERR_BADLAYOUT,
1780 * -FDT_ERR_BADMAGIC,
1781 * -FDT_ERR_BADVERSION,
1782 * -FDT_ERR_BADSTATE,
1783 * -FDT_ERR_BADSTRUCTURE,
1784 * -FDT_ERR_BADLAYOUT,
1785 * -FDT_ERR_TRUNCATED, standard meanings
1795 * fdt_setprop_cell - set a property to a single cell value
1796 * @fdt: pointer to the device tree blob
1799 * @val: 32-bit integer value for the property (native endian)
1812 * fdt_setprop_string - set a property to a string value
1813 * @fdt: pointer to the device tree blob
1818 * fdt_setprop_string() sets the value of the named property in the
1828 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1830 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1831 * -FDT_ERR_BADLAYOUT,
1832 * -FDT_ERR_BADMAGIC,
1833 * -FDT_ERR_BADVERSION,
1834 * -FDT_ERR_BADSTATE,
1835 * -FDT_ERR_BADSTRUCTURE,
1836 * -FDT_ERR_BADLAYOUT,
1837 * -FDT_ERR_TRUNCATED, standard meanings
1844 * fdt_setprop_empty - set a property to an empty value
1845 * @fdt: pointer to the device tree blob
1849 * fdt_setprop_empty() sets the value of the named property in the
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
1873 * fdt_appendprop - append to or create a property
1874 * @fdt: pointer to the device tree blob
1880 * fdt_appendprop() appends the value to the named property in the
1888 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1890 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1891 * -FDT_ERR_BADLAYOUT,
1892 * -FDT_ERR_BADMAGIC,
1893 * -FDT_ERR_BADVERSION,
1894 * -FDT_ERR_BADSTATE,
1895 * -FDT_ERR_BADSTRUCTURE,
1896 * -FDT_ERR_BADLAYOUT,
1897 * -FDT_ERR_TRUNCATED, standard meanings
1903 * fdt_appendprop_u32 - append a 32-bit integer value to a property
1904 * @fdt: pointer to the device tree blob
1907 * @val: 32-bit integer value to append to the property (native endian)
1909 * fdt_appendprop_u32() appends the given 32-bit integer value
1910 * (converting to big-endian if necessary) to the value of the named
1911 * property in the given node, or creates a new property with that
1919 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1921 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1922 * -FDT_ERR_BADLAYOUT,
1923 * -FDT_ERR_BADMAGIC,
1924 * -FDT_ERR_BADVERSION,
1925 * -FDT_ERR_BADSTATE,
1926 * -FDT_ERR_BADSTRUCTURE,
1927 * -FDT_ERR_BADLAYOUT,
1928 * -FDT_ERR_TRUNCATED, standard meanings
1938 * fdt_appendprop_u64 - append a 64-bit integer value to a property
1939 * @fdt: pointer to the device tree blob
1942 * @val: 64-bit integer value to append to the property (native endian)
1944 * fdt_appendprop_u64() appends the given 64-bit integer value
1945 * (converting to big-endian if necessary) to the value of the named
1946 * property in the given node, or creates a new property with that
1954 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
1956 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
1957 * -FDT_ERR_BADLAYOUT,
1958 * -FDT_ERR_BADMAGIC,
1959 * -FDT_ERR_BADVERSION,
1960 * -FDT_ERR_BADSTATE,
1961 * -FDT_ERR_BADSTRUCTURE,
1962 * -FDT_ERR_BADLAYOUT,
1963 * -FDT_ERR_TRUNCATED, standard meanings
1973 * fdt_appendprop_cell - append a single cell value to a property
1974 * @fdt: pointer to the device tree blob
1977 * @val: 32-bit integer value to append to the property (native endian)
1990 * fdt_appendprop_string - append a string to a property
1991 * @fdt: pointer to the device tree blob
1997 * the named property in the given node, or creates a new property
2005 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
2007 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2008 * -FDT_ERR_BADLAYOUT,
2009 * -FDT_ERR_BADMAGIC,
2010 * -FDT_ERR_BADVERSION,
2011 * -FDT_ERR_BADSTATE,
2012 * -FDT_ERR_BADSTRUCTURE,
2013 * -FDT_ERR_BADLAYOUT,
2014 * -FDT_ERR_TRUNCATED, standard meanings
2020 * fdt_appendprop_addrrange - append a address range property
2021 * @fdt: pointer to the device tree blob
2029 * address and size) to the value of the named property in the given
2033 * Cell sizes are determined by parent's #address-cells and #size-cells.
2040 * -FDT_ERR_BADLAYOUT,
2041 * -FDT_ERR_BADMAGIC,
2042 * -FDT_ERR_BADNCELLS, if the node has a badly formatted or invalid
2043 * #address-cells property
2044 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2045 * -FDT_ERR_BADSTATE,
2046 * -FDT_ERR_BADSTRUCTURE,
2047 * -FDT_ERR_BADVERSION,
2048 * -FDT_ERR_BADVALUE, addr or size doesn't fit to respective cells size
2049 * -FDT_ERR_NOSPACE, there is insufficient free space in the blob to
2051 * -FDT_ERR_TRUNCATED, standard meanings
2057 * fdt_delprop - delete a property
2058 * @fdt: pointer to the device tree blob
2069 * -FDT_ERR_NOTFOUND, node does not have the named property
2070 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2071 * -FDT_ERR_BADLAYOUT,
2072 * -FDT_ERR_BADMAGIC,
2073 * -FDT_ERR_BADVERSION,
2074 * -FDT_ERR_BADSTATE,
2075 * -FDT_ERR_BADSTRUCTURE,
2076 * -FDT_ERR_TRUNCATED, standard meanings
2081 * fdt_add_subnode_namelen - creates a new node based on substring
2082 * @fdt: pointer to the device tree blob
2095 #ifndef SWIG /* Not available in Python */
2101 * fdt_add_subnode - creates a new node
2102 * @fdt: pointer to the device tree blob
2116 * -FDT_ERR_NOTFOUND, if the requested subnode does not exist
2117 * -FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE
2119 * -FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
2121 * -FDT_ERR_NOSPACE, if there is insufficient free space in the
2123 * -FDT_ERR_NOSPACE
2124 * -FDT_ERR_BADLAYOUT
2125 * -FDT_ERR_BADMAGIC,
2126 * -FDT_ERR_BADVERSION,
2127 * -FDT_ERR_BADSTATE,
2128 * -FDT_ERR_BADSTRUCTURE,
2129 * -FDT_ERR_TRUNCATED, standard meanings.
2134 * fdt_del_node - delete a node (subtree)
2135 * @fdt: pointer to the device tree blob
2146 * -FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
2147 * -FDT_ERR_BADLAYOUT,
2148 * -FDT_ERR_BADMAGIC,
2149 * -FDT_ERR_BADVERSION,
2150 * -FDT_ERR_BADSTATE,
2151 * -FDT_ERR_BADSTRUCTURE,
2152 * -FDT_ERR_TRUNCATED, standard meanings
2157 * fdt_overlay_apply - Applies a DT overlay on a base DT
2158 * @fdt: pointer to the base device tree blob
2159 * @fdto: pointer to the device tree overlay blob
2161 * fdt_overlay_apply() will apply the given device tree overlay on the
2162 * given base device tree.
2164 * Expect the base device tree to be modified, even if the function
2169 * -FDT_ERR_NOSPACE, there's not enough space in the base device tree
2170 * -FDT_ERR_NOTFOUND, the overlay points to some inexistant nodes or
2171 * properties in the base DT
2172 * -FDT_ERR_BADPHANDLE,
2173 * -FDT_ERR_BADOVERLAY,
2174 * -FDT_ERR_NOPHANDLES,
2175 * -FDT_ERR_INTERNAL,
2176 * -FDT_ERR_BADLAYOUT,
2177 * -FDT_ERR_BADMAGIC,
2178 * -FDT_ERR_BADOFFSET,
2179 * -FDT_ERR_BADPATH,
2180 * -FDT_ERR_BADVERSION,
2181 * -FDT_ERR_BADSTRUCTURE,
2182 * -FDT_ERR_BADSTATE,
2183 * -FDT_ERR_TRUNCATED, standard meanings
2188 * fdt_overlay_target_offset - retrieves the offset of a fragment's target
2189 * @fdt: Base device tree blob
2190 * @fdto: Device tree overlay blob
2191 * @fragment_offset: node offset of the fragment in the overlay
2194 * fdt_overlay_target_offset() retrieves the target offset in the base
2195 * device tree of a fragment, no matter how the actual targeting is
2199 * the targeted node offset in the base device tree