Lines Matching +full:device +full:- +full:tree
1 /* SPDX-License-Identifier: GPL-2.0+ OR BSD-2-Clause */
3 * pylibfdt - Flat Device Tree manipulation in Python
55 # Pass this as the 'quiet' parameter to return -ENOTFOUND on NOTFOUND errors,
73 fdt_err: Error number (-ve)
81 """Raise an error if the return value is -ve
96 if -val not in quiet:
120 if -val not in quiet:
125 """Class for a read-only device-tree
127 This is a base class used by FdtRw (read-write access) and FdtSw
128 (sequential-write access). It implements read-only access to the
129 device tree.
133 FdtRo - read-only access to an existing FDT
134 FdtRw - read-write access to an existing FDT (most common case)
135 FdtSw - for creating a new FDT, as well as allowing read-only access
142 """Get the device tree contents as a bytearray
145 const void * for the device tree.
148 bytearray containing the device tree
163 Offset of the next node, if any, else a -ve error
210 """Return the total size of the device tree
213 Total tree size in bytes
218 """Return the start of the device-tree struct area
226 """Return the start of the device-tree string area
242 """Return the version of the device tree
245 Version number of the device tree
250 """Return the last compatible version of the device tree
253 Last compatible version number of the device tree
266 """Return the start of the device-tree string area
274 """Return the start of the device-tree struct area
282 """Return the number of memory reserve-map records
285 Number of memory reserve-map records
290 """Return the indexed memory reserve-map record
296 Number of memory reserve-map records
391 FdtException on error (e.g. invalid prop_offset or device
392 tree format)
410 bytearray/string), or -ve error number. On failure, returns an
466 """Device tree class, supporting all operations
468 The Fdt object is created is created from a device tree binary file,
480 (e.g. -NOTFOUND).
487 """Create an empty device tree ready for use
490 size: Size of device tree in bytes
493 Fdt object containing the device tree
502 """Move the device tree into a larger or smaller space
504 This creates a new device tree of size @size and moves the existing
505 device tree contents over to that. It can be used to create more space
506 in a device tree. Note that the Fdt object remains the same, but it
510 size: Required new size of device tree in bytes
519 """Pack the device tree to remove unused space
521 This adjusts the tree in place.
618 supposed by encoding to UTF-8
627 val = val.encode('utf-8') + '\0'
678 """Holds a device tree property name and value.
680 This holds a copy of a property taken from the device tree. It does not
681 reference the device tree, so if anything changes in the device tree,
708 """Unicode is supported by decoding from UTF-8"""
709 if self[-1] != 0:
711 if 0 in self[:-1]:
713 return self[:-1].decode('utf-8')
717 """Software interface to create a device tree from scratch
719 The methods in this class work by adding to an existing 'partial' device
720 tree buffer of a fixed size created by instantiating this class. When the
721 tree is complete, call as_fdt() to obtain a device tree ready to be used.
728 # First create the device tree with a node and property:
734 # Now we can use it as a real device tree
738 device tree. This will be increased automatically as needed as new items
739 are added to the tree.
766 Creates a new Fdt object from the work-in-progress device tree. This
769 tree.
772 Fdt object allowing access to the newly created device tree
782 -NOSPACE then the FDT will be expanded to have more space, and True will
797 """Resize the buffer to accommodate a larger tree
800 size: New size of tree
815 addr: 64-bit start address
816 size: 64-bit size
853 The string will be nul-terminated when written to the device tree
866 """Add a property with a 32-bit value
868 Write a single-cell value to the device tree
881 """Add a property with a 64-bit value
883 Write a double-cell value to the device tree in big-endian format
896 """Add a property with a single-cell value
898 Write a single-cell value to the device tree
914 Write a new property with the given value to the device tree. The value
915 is taken as is and is not nul-terminated
981 * fdt32_t is a big-endian 32-bit value defined to uint32_t in libfdt_env.h
990 /* Most functions don't change the device tree, so use a const void * */
1001 /* Some functions do change the device tree, so use void * */
1018 fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
1020 (const char *)($1 + 1), fdt32_to_cpu($1->len));