Lines Matching refs:node

51         sorted_nodes = sorted(edt.nodes, key=lambda node: node.dep_ordinal)
55 for node in sorted_nodes:
56 node.z_path_id = node_z_path_id(node)
60 for node in sorted_nodes:
61 if 'zephyr,memory-region' in node.props:
62 region = node.props['zephyr,memory-region'].val
66 regions[region] = node
68 for node in sorted_nodes:
69 write_node_comment(node)
84 if node.parent is not None:
91 node.parent.child_index(node))
94 out_dt_define(f"{node.z_path_id}_NODELABEL_NUM", len(node.labels))
96 " ".join(f"fn({nodelabel})" for nodelabel in node.labels))
98 " ".join(f"fn({nodelabel}, __VA_ARGS__)" for nodelabel in node.labels))
100 write_parent(node)
101 write_children(node)
102 write_dep_info(node)
103 write_idents_and_existence(node)
104 write_bus(node)
105 write_special_props(node)
106 write_vanilla_props(node)
112 def node_z_path_id(node: edtlib.Node) -> str:
124 if node.parent is not None:
126 node.path.split("/")[1:])
162 + ", ".join(node.path for node in scc))
180 def write_node_comment(node: edtlib.Node) -> None:
189 if node.matching_compat:
190 if node.binding_path:
201 if node.description:
235 def write_idents_and_existence(node: edtlib.Node) -> None:
240 idents = [f"N_ALIAS_{str2ident(alias)}" for alias in node.aliases]
242 for compat in node.compats:
243 instance_no = node.edt.compat2nodes[compat].index(node)
246 idents.extend(f"N_NODELABEL_{str2ident(label)}" for label in node.labels)
258 def write_bus(node: edtlib.Node) -> None:
261 bus = node.bus_node
267 for one_bus in node.on_buses:
273 def write_special_props(node: edtlib.Node) -> None:
280 write_regs(node)
281 write_ranges(node)
282 write_interrupts(node)
283 write_compatibles(node)
284 write_status(node)
288 write_pinctrls(node)
289 write_fixed_partitions(node)
290 write_gpio_hogs(node)
293 def write_ranges(node: edtlib.Node) -> None:
299 path_id = node.z_path_id
301 if node.ranges is not None:
302 idx_vals.append((f"{path_id}_RANGES_NUM", len(node.ranges)))
304 for i,range in enumerate(node.ranges):
307 if "pcie" in node.buses:
315 if "pcie" in node.buses:
334 " ".join(f"fn(DT_{path_id}, {i})" for i,range in enumerate(node.ranges)))
337 def write_regs(node: edtlib.Node) -> None:
344 path_id = node.z_path_id
346 if node.regs is not None:
347 idx_vals.append((f"{path_id}_REG_NUM", len(node.regs)))
349 for i, reg in enumerate(node.regs):
374 def write_interrupts(node: edtlib.Node) -> None:
396 path_id = node.z_path_id
398 if node.interrupts is not None:
399 idx_vals.append((f"{path_id}_IRQ_NUM", len(node.interrupts)))
401 for i, irq in enumerate(node.interrupts):
428 while node.interrupts is not None and len(node.interrupts) > 0:
429 irq = node.interrupts[0]
431 if node == irq.controller:
433 node = irq.controller
442 def write_compatibles(node: edtlib.Node) -> None:
447 for i, compat in enumerate(node.compats):
451 if node.edt.compat2vendor[compat]:
454 quote_str(node.edt.compat2vendor[compat]))
456 if node.edt.compat2model[compat]:
459 quote_str(node.edt.compat2model[compat]))
461 def write_parent(node: edtlib.Node) -> None:
463 def _visit_parent_node(node: edtlib.Node):
464 while node is not None:
465 yield node.parent
466 node = node.parent
471 _visit_parent_node(node) if parent is not None))
473 def write_children(node: edtlib.Node) -> None:
478 out_dt_define(f"{node.z_path_id}_CHILD_NUM", len(node.children))
481 for child in node.children.values():
489 node.children.values()))
493 for child in node.children.values()))
497 for child in node.children.values()))
501 for child in node.children.values()))
505 for child in node.children.values() if child.status == "okay"))
509 for child in node.children.values() if child.status == "okay"))
513 for child in node.children.values() if child.status == "okay"))
517 for child in node.children.values() if child.status == "okay"))
520 def write_status(node: edtlib.Node) -> None:
524 def write_pinctrls(node: edtlib.Node) -> None:
529 out_dt_define(f"{node.z_path_id}_PINCTRL_NUM", len(node.pinctrls))
531 if not node.pinctrls:
534 for pc_idx, pinctrl in enumerate(node.pinctrls):
554 def write_fixed_partitions(node: edtlib.Node) -> None:
557 if not (node.parent and "fixed-partitions" in node.parent.compats):
566 def write_gpio_hogs(node: edtlib.Node) -> None:
571 for i, entry in enumerate(node.gpio_hogs):
577 out_dt_define(f"{macro}_NUM", len(node.gpio_hogs))
582 def write_vanilla_props(node: edtlib.Node) -> None:
594 for prop_name, prop in node.props.items():
710 def write_dep_info(node: edtlib.Node) -> None:
716 sorted_list = sorted(dep_list, key=lambda node: node.dep_ordinal)
724 out_dt_define(f"{node.z_path_id}_ORD", node.dep_ordinal)
729 fmt_dep_list(node.depends_on))
733 fmt_dep_list(node.required_by))
817 for i, node in enumerate(prop.val):
881 for name, node in edt.chosen_nodes.items():
896 " ".join(f"fn(DT_{node.z_path_id})" for node in edt.nodes))
898 " ".join(f"fn(DT_{node.z_path_id})" for node in edt.nodes
899 if node.status == "okay"))
901 " ".join(f"fn(DT_{node.z_path_id}, __VA_ARGS__)" for node in edt.nodes))
903 " ".join(f"fn(DT_{node.z_path_id}, __VA_ARGS__)" for node in edt.nodes
904 if node.status == "okay"))
910 for node in okay_nodes:
911 buses = node.on_buses
923 for node in okay_nodes))
926 for node in okay_nodes))
935 for node in okay_nodes))
938 for node in okay_nodes))
941 for node in nodes:
943 for child in node.children.values():