Lines Matching full:node

15 # This deals with a device tree, presenting it as an assortment of Node and
40 def __init__(self, node, offset, name, bytes): argument
41 self._node = node
202 node = self._node
203 fdt_obj = node._fdt._fdt_obj
205 while fdt_obj.setprop(node.Offset(), self.name, self.bytes,
208 fdt_obj.setprop(node.Offset(), self.name, self.bytes)
210 fdt_obj.setprop(node.Offset(), self.name, self.bytes)
213 class Node: class
214 """A device tree node
218 name: Device tree node tname
219 path: Full path to node, along with the node name itself
221 subnodes: A list of subnodes for this node, each a Node object
222 props: A dict of properties for this node, each a Prop object.
235 """Get the Fdt object for this node
243 """Find a node given its name
246 name: Node name to look for
248 Node object if found, else None
256 """Returns the offset of a node, after checking the cache
265 """Scan a node's properties and subnodes
281 node = Node(self._fdt, self, offset, name, path)
282 self.subnodes.append(node)
284 node.Scan()
288 """Fix up the _offset for each node, recursively
299 raise ValueError('Internal error, node name mismatch %s != %s' %
317 """Delete a property of a node
327 "Node '%s': delete property: '%s'" % (self.path, prop_name))
391 """Add a new string property to a node
403 """Add a new subnode to the node
406 name: name of node to add
412 subnode = Node(self._fdt, self, None, name, path)
417 """Sync node changes back to the device tree
419 This updates the device tree blob with any changes to this node and its
443 # Sync subnodes in reverse so that we don't disturb node offsets for
445 # node offsets.
446 for node in reversed(self.subnodes):
447 node.Sync(auto_resize)
463 _root: Root of device tree (a Node object)
496 Node object the phandle points to
501 """Scan a device tree, building up a tree of Node objects
511 self._root = self.Node(self, None, 0, '/', '/')
515 """Get the root Node of the device tree
518 The root Node object
523 """Look up a node from its path
528 Node object, or None if not found
530 node = self._root
535 node = node.FindNode(part)
536 if not node:
538 return node
586 def GetProps(self, node): argument
587 """Get all properties from a node.
590 node: Full path to node name to look in.
593 A dictionary containing all the properties, indexed by node name.
597 ValueError: if the node does not exist.
600 poffset = self._fdt_obj.first_property_offset(node._offset,
604 prop = Prop(node, poffset, p.name, p)
637 def Node(self, fdt, parent, offset, name, path): member in Fdt
638 """Create a new node
640 This is used by Fdt.Scan() to create a new node using the correct
645 parent: Parent node, or None if this is the root node
646 offset: Offset of node
647 name: Node name
648 path: Full path to node
650 node = Node(fdt, parent, offset, name, path)
651 return node