• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:quiet

1 // SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-2-Clause)
3 * pylibfdt - Flat Device Tree manipulation in Python
51 # QUIET_ALL can be passed as the 'quiet' parameter to avoid exceptions
55 # Pass this as the 'quiet' parameter to return -ENOTFOUND on NOTFOUND errors,
73 fdt_err: Error number (-ve)
80 def check_err(val, quiet=()):
81 """Raise an error if the return value is -ve
87 quiet: Errors to ignore (empty to raise on all errors)
96 if -val not in quiet:
100 def check_err_null(val, quiet=()):
108 quiet: Errors to ignore (empty to raise on all errors)
115 is 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
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
152 def next_node(self, nodeoffset, depth, quiet=()):
159 quiet: Errors to ignore (empty to raise on all errors)
163 Offset of the next node, if any, else a -ve error
169 return check_err(fdt_next_node(self._fdt, nodeoffset, depth), quiet)
171 def first_subnode(self, nodeoffset, quiet=()):
176 quiet: Errors to ignore (empty to raise on all errors)
184 return check_err(fdt_first_subnode(self._fdt, nodeoffset), quiet)
186 def next_subnode(self, nodeoffset, quiet=()):
191 quiet: Errors to ignore (empty to raise on all errors)
199 return check_err(fdt_next_subnode(self._fdt, nodeoffset), quiet)
218 """Return the start of the device-tree struct area
226 """Return the start of the device-tree string area
266 """Return the start of the device-tree string area
274 """Return the start of the device-tree struct area
281 def num_mem_rsv(self, quiet=()):
282 """Return the number of memory reserve-map records
285 Number of memory reserve-map records
287 return check_err(fdt_num_mem_rsv(self._fdt), quiet)
289 def get_mem_rsv(self, index, quiet=()):
290 """Return the indexed memory reserve-map record
296 Number of memory reserve-map records
298 return check_err(fdt_get_mem_rsv(self._fdt, index), quiet)
300 def subnode_offset(self, parentoffset, name, quiet=()):
306 quiet: Errors to ignore (empty to raise on all errors)
315 quiet)
317 def path_offset(self, path, quiet=()):
322 quiet: Errors to ignore (empty to raise on all errors)
330 return check_err(fdt_path_offset(self._fdt, path), quiet)
346 def first_property_offset(self, nodeoffset, quiet=()):
351 quiet: Errors to ignore (empty to raise on all errors)
361 quiet)
363 def next_property_offset(self, prop_offset, quiet=()):
368 quiet: Errors to ignore (empty to raise on all errors)
378 quiet)
380 def get_property_by_offset(self, prop_offset, quiet=()):
385 quiet: Errors to ignore (empty to raise on all errors)
395 fdt_get_property_by_offset(self._fdt, prop_offset), quiet)
400 def getprop(self, nodeoffset, prop_name, quiet=()):
406 quiet: Errors to ignore (empty to raise on all errors)
410 bytearray/string), or -ve error number. On failure, returns an
417 quiet)
446 def get_path(self, nodeoffset, size_hint=1024, quiet=()):
461 if ret == -NOSPACE:
464 err = check_err(ret, quiet)
469 def parent_offset(self, nodeoffset, quiet=()):
474 quiet: Errors to ignore (empty to raise on all errors)
482 return check_err(fdt_parent_offset(self._fdt, nodeoffset), quiet)
484 def node_offset_by_phandle(self, phandle, quiet=()):
489 quiet: Errors to ignore (empty to raise on all errors)
497 return check_err(fdt_node_offset_by_phandle(self._fdt, phandle), quiet)
512 behaviour a 'quiet' parameter is provided for some functions. This
515 (e.g. -NOTFOUND).
521 def create_empty_tree(size, quiet=()):
531 err = check_err(fdt_create_empty_tree(data, size), quiet)
536 def resize(self, size, quiet=()):
548 err = check_err(fdt_open_into(self._fdt, fdt, size), quiet)
553 def pack(self, quiet=()):
559 quiet: Errors to ignore (empty to raise on all errors)
567 err = check_err(fdt_pack(self._fdt), quiet)
573 def set_name(self, nodeoffset, name, quiet=()):
588 return check_err(fdt_set_name(self._fdt, nodeoffset, name), quiet)
590 def setprop(self, nodeoffset, prop_name, val, quiet=()):
597 quiet: Errors to ignore (empty to raise on all errors)
606 len(val)), quiet)
608 def setprop_u32(self, nodeoffset, prop_name, val, quiet=()):
615 quiet: Errors to ignore (empty to raise on all errors)
624 quiet)
626 def setprop_u64(self, nodeoffset, prop_name, val, quiet=()):
633 quiet: Errors to ignore (empty to raise on all errors)
642 quiet)
644 def setprop_str(self, nodeoffset, prop_name, val, quiet=()):
653 supposed by encoding to UTF-8
654 quiet: Errors to ignore (empty to raise on all errors)
662 val = val.encode('utf-8') + b'\0'
664 val, len(val)), quiet)
666 def delprop(self, nodeoffset, prop_name, quiet=()):
672 quiet: Errors to ignore (empty to raise on all errors)
680 return check_err(fdt_delprop(self._fdt, nodeoffset, prop_name), quiet)
682 def add_subnode(self, parentoffset, name, quiet=()):
695 return check_err(fdt_add_subnode(self._fdt, parentoffset, name), quiet)
697 def del_node(self, nodeoffset, quiet=()):
709 return check_err(fdt_del_node(self._fdt, nodeoffset), quiet)
758 """Unicode is supported by decoding from UTF-8"""
759 if self[-1] != 0:
761 if 0 in self[:-1]:
763 return self[:-1].decode('utf-8')
766 """Unicode is supported by decoding from UTF-8"""
767 if self[-1] != 0:
769 parts = self[:-1].split(b'\x00')
770 return list(map(lambda x: x.decode('utf-8'), parts))
825 Creates a new Fdt object from the work-in-progress device tree. This
841 -NOSPACE then the FDT will be expanded to have more space, and True will
874 addr: 64-bit start address
875 size: 64-bit size
912 The string will be nul-terminated when written to the device tree
925 """Add a property with a 32-bit value
927 Write a single-cell value to the device tree
940 """Add a property with a 64-bit value
942 Write a double-cell value to the device tree in big-endian format
955 """Add a property with a single-cell value
957 Write a single-cell value to the device tree
962 quiet: Errors to ignore (empty to raise on all errors)
974 is taken as is and is not nul-terminated
979 quiet: Errors to ignore (empty to raise on all errors)
995 quiet: Errors to ignore (empty to raise on all errors)
1043 * fdt32_t is a big-endian 32-bit value defined to uint32_t in libfdt_env.h
1080 fdt_string(fdt1, fdt32_to_cpu($1->nameoff)));
1082 (const char *)($1 + 1), fdt32_to_cpu($1->len));