Lines Matching full:node

110 def get_compat_name(node):  argument
111 """Get a node's first compatible string as a C identifier
114 node: Node object to check
121 compat = node.props['compatible'].value
138 _valid_nodes: A list of Node object with compatible strings
203 """Check if a node contains phandles
205 We have no reliable way of detecting whether a node uses a phandle
231 raise ValueError("Cannot parse '%s' in node '%s'" %
236 raise ValueError("Node '%s' has no '%s' property" %
249 device tree root node, and progress from there.
254 """Scan a node and subnodes to build a tree of node and phandle info
256 This adds each node to self._valid_nodes.
259 root: Root node for scan
261 for node in root.subnodes:
262 if 'compatible' in node.props:
263 status = node.props.get('status')
266 self._valid_nodes.append(node)
269 self.scan_node(node)
282 def get_num_cells(node): argument
283 """Get the number of cells in addresses and sizes for this node
286 node: Node to check
290 Number of address cells for this node
291 Number of size cells for this node
293 parent = node.parent
311 for node in self._valid_nodes:
312 reg = node.props.get('reg')
315 na, ns = self.get_num_cells(node)
319 raise ValueError("Node '%s' reg property is not an int" %
320 node.name)
322 raise ValueError("Node '%s' reg property has %d cells "
324 (node.name, len(reg.value), na, ns))
354 for node in self._valid_nodes:
355 node_name, _ = get_compat_name(node)
358 # Get a list of all the valid properties in this node.
359 for name, prop in node.props.items():
378 for node in self._valid_nodes:
379 node_name, _ = get_compat_name(node)
381 for name, prop in node.props.items():
386 struct_name, aliases = get_compat_name(node)
393 """Figure out what phandles each node uses
400 This function adds to each node a list of phandle nodes that the node
403 for node in self._valid_nodes:
404 node.phandles = set()
405 for pname, prop in node.props.items():
408 info = self.get_phandle_argc(prop, node.name)
416 node.phandles.add(target_node)
424 definitions for node in self._valid_nodes. See the documentation in
456 def output_node(self, node): argument
457 """Output the C code for a node
460 node: node to output
462 struct_name, _ = get_compat_name(node)
463 var_name = conv_name_to_c(node.name)
466 for pname, prop in node.props.items():
477 # of the target node.
478 info = self.get_phandle_argc(prop, node.name)
524 U_BOOT_DEVICE() declarations for each valid node. Where a node has
539 node = nodes_to_output[0]
540 # Output all the node's dependencies first
541 for req_node in node.phandles:
545 self.output_node(node)
546 nodes_to_output.remove(node)