Lines Matching full:node

61     to an EDT node.  If it finds an EDT node, it will look to see if that node
63 return the node's name in the devicetree.
68 node = edt.chosen_node(chosen)
69 if not node:
72 if "label" not in node.props:
73 return node.name
75 return node.props["label"].val
81 that points to an enabled node, and "n" otherwise
86 node = edt.chosen_node(chosen)
87 return "y" if node and node.status == "okay" else "n"
92 This function takes a /chosen node property and returns the path
93 to the node in the property value, or the empty string.
98 node = edt.chosen_node(chosen)
100 return node.path if node else ""
104 This function takes a /chosen node property and returns 'y' if the
105 chosen node has the provided compatible string 'compat'
110 node = edt.chosen_node(chosen)
112 if node is None:
115 if compat in node.compats:
120 def dt_node_enabled(kconf, name, node): argument
122 This function is used to test if a node is enabled (has status
125 The 'node' argument is a string which is either a path or an
128 If 'name' is 'dt_path_enabled', 'node' is an alias or a path. If
129 'name' is 'dt_alias_enabled, 'node' is an alias.
136 if node.startswith("/"):
145 node = edt.get_node(node)
149 return "y" if node and node.status == "okay" else "n"
159 node = edt.label2node.get(label)
161 return "y" if node else "n"
167 should be a node label, like "foo" is here:
169 foo: some-node { ... };
174 node = edt.label2node.get(label)
176 return "y" if node and node.status == "okay" else "n"
179 def _node_reg_addr(node, index, unit): argument
180 if not node:
183 if not node.regs:
186 if int(index) >= len(node.regs):
189 if node.regs[int(index)].addr is None:
192 return node.regs[int(index)].addr >> _dt_units_to_scale(unit)
195 def _node_reg_addr_by_name(node, name, unit): argument
196 if not node:
199 if not node.regs:
203 for i, reg in enumerate(node.regs):
211 if node.regs[index].addr is None:
214 return node.regs[index].addr >> _dt_units_to_scale(unit)
217 def _node_reg_size(node, index, unit): argument
218 if not node:
221 if not node.regs:
224 if int(index) >= len(node.regs):
227 if node.regs[int(index)].size is None:
230 return node.regs[int(index)].size >> _dt_units_to_scale(unit)
233 def _node_int_prop(node, prop, unit=None): argument
235 This function takes a 'node' and will look to see if that 'node' has a
249 if not node:
252 if prop not in node.props:
255 if node.props[prop].type != "int":
258 return node.props[prop].val >> _dt_units_to_scale(unit)
261 def _node_array_prop(node, prop, index=0, unit=None): argument
263 This function takes a 'node' and will look to see if that 'node' has a
275 if not node:
278 if prop not in node.props:
280 if node.props[prop].type != "array":
282 if int(index) >= len(node.props[prop].val):
284 return node.props[prop].val[int(index)] >> _dt_units_to_scale(unit)
286 def _node_ph_array_prop(node, prop, index, cell, unit=None): argument
288 This function takes a 'node', a property name ('prop'), index ('index') and
289 a cell ('cell') and it will look to see if that node has a property
301 if not node:
304 if prop not in node.props:
306 if node.props[prop].type != "phandle-array":
308 if int(index) >= len(node.props[prop].val):
310 if cell not in node.props[prop].val[int(index)].data.keys():
312 return node.props[prop].val[int(index)].data[cell] >> _dt_units_to_scale(unit)
317 to an EDT node. If it finds an EDT node, it will look to see if that
318 node has a register at the given 'index' and return the address value of
333 node = edt.chosen_node(chosen)
335 return _node_reg_addr(node, index, unit)
341 to an EDT node. If it finds an EDT node, it will look to see if that node
357 node = edt.chosen_node(chosen)
359 return _node_reg_size(node, index, unit)
380 to an EDT node. If it finds an EDT node, it will look to see if that
381 node has a register, and if that node has a grandparent that has a register
397 node = edt.chosen_node(chosen)
398 if not node:
401 p_node = node.parent
405 return _node_reg_addr(p_node.parent, index, unit) + _node_reg_addr(node, 0, unit)
421 This function takes a 'path' and looks for an EDT node at that path. If it
422 finds an EDT node, it will look to see if that node has a register at the
438 node = edt.get_node(path)
442 return _node_reg_addr(node, index, unit)
447 This function takes a 'path' and looks for an EDT node at that path. If it
448 finds an EDT node, it will look to see if that node has a register with the
464 node = edt.get_node(path)
468 return _node_reg_addr_by_name(node, name, unit)
473 This function takes a 'path' and looks for an EDT node at that path. If it
474 finds an EDT node, it will look to see if that node has a register at the
490 node = edt.get_node(path)
494 return _node_reg_size(node, index, unit)
525 should be a node label, like "foo" is here:
527 foo: some-node { ... };
530 node = None
532 node = edt.label2node.get(label)
535 return str(_dt_node_reg_size(kconf, node.path, index, unit)) if node else "0"
537 return hex(_dt_node_reg_size(kconf, node.path, index, unit)) if node else "0x0"
539 return str(_dt_node_reg_addr(kconf, node.path, index, unit)) if node else "0"
541 return hex(_dt_node_reg_addr(kconf, node.path, index, unit)) if node else "0x0"
547 a node with 'search_arg' and if node exists, checks if 'prop' exists
548 inside the node and is a boolean, if it is true, returns "y".
552 node = node_search_function(search_arg)
556 if node is None:
559 if prop not in node.props:
562 if node.props[prop].type != "boolean":
565 if node.props[prop].val:
572 This function takes a 'path' and looks for an EDT node at that path. If it
573 finds an EDT node, it will look to see if that node has a boolean property
584 This function takes a 'label' and looks for an EDT node with that label.
585 If it finds an EDT node, it will look to see if that node has a boolean
596 This function takes a 'label' and looks for an EDT node with that label.
597 If it finds an EDT node, it will look to see if that node has a int
605 node = edt.label2node.get(label)
609 return str(_node_int_prop(node, prop))
613 This function takes a /chosen node property named 'chosen', and
614 looks for the chosen node. If that node exists and has a boolean
625 a node with 'search_arg' and if node exists, then checks if 'prop'
626 exists inside the node and returns "y". Otherwise, it returns "n".
629 node = node_search_function(search_arg)
633 if node is None:
636 if prop in node.props:
643 This function takes a 'path' and looks for an EDT node at that path. If it
644 finds an EDT node, it will look to see if that node has a property
655 This function takes a 'label' and looks for an EDT node with that label.
656 If it finds an EDT node, it will look to see if that node has a property
668 node at that path. If it finds an EDT node, it will look to see if that
669 node has a property called 'prop' and if that 'prop' is an integer type
686 node = edt.get_node(path)
691 return str(_node_int_prop(node, prop, unit))
693 return hex(_node_int_prop(node, prop, unit))
699 and looks for an EDT node at that path. If it finds an EDT node, it will
700 look to see if that node has a property called 'prop' and if that 'prop'
714 node = edt.get_node(path)
718 return str(_node_array_prop(node, prop, index, unit))
720 return hex(_node_array_prop(node, prop, index, unit))
726 a cell ('cell') and looks for an EDT node at that path.
727 If it finds an EDT node, it will look to see if that node has a property
743 node = edt.get_node(path)
747 return str(_node_ph_array_prop(node, prop, index, cell, unit))
749 return hex(_node_ph_array_prop(node, prop, index, cell, unit))
754 looks for an EDT node at that path. If it finds an EDT node,
755 it will look to see if that node has a property called 'prop'
757 path to the pointed-to node, or an empty string if there is
758 no such node.
764 node = edt.get_node(path)
768 if prop not in node.props:
770 if node.props[prop].type != "phandle":
773 phandle = node.props[prop].val
780 node at that path. If it finds an EDT node, it will look to see if that
781 node has a property 'prop' of type string. If that 'prop' is equal to 'val'
789 node = edt.get_node(path)
793 if prop not in node.props:
796 if node.props[prop].type != "string":
799 if node.props[prop].val == val:
807 This function takes a 'compat' and returns "y" if any compatible node
819 compatible node in the EDT otherwise we return "n"
841 compatible node in the EDT which is on bus 'bus'. It returns "n" otherwise.
847 for node in edt.compat2okay[compat]:
848 if node.on_buses is not None and bus in node.on_buses:
857 enabled node with compatible 'compat' also has a valid property 'prop'.
858 If value is given, the function returns "y" if any enabled node with compatible 'compat'
866 for node in edt.compat2okay[compat]:
867 if prop in node.props:
870 elif str(node.props[prop].val) == value:
877 The function returns "y" if any enabled node with compatible 'compat'
885 for node in edt.compat2okay[compat]:
886 if prop not in node.props:
893 This function takes a 'label' and looks for an EDT node with that label.
894 If it finds such node, it returns "y" if this node is compatible with
900 node = edt.label2node.get(label)
902 if node and compat in node.compats:
909 This function takes a 'path' and looks for an EDT node at that path. If it
910 finds an EDT node, it returns "y" if this node is compatible with
918 node = edt.get_node(path)
922 if node and compat in node.compats:
929 This function takes a 'label' and returns "y" if an enabled node with
930 such label can be found in the EDT and that node is compatible with the
937 for node in edt.compat2okay[compat]:
938 if label in node.labels:
946 This function looks for a node with node label 'label'.
947 If the node exists, it checks if the node node has a property
955 node = edt.label2node.get(label)
957 if not node or (prop not in node.props) or (node.props[prop].type != "array"):
960 return "y" if int(val, base=0) in node.props[prop].val else "n"
965 This function takes a node label (not a label property) and
966 returns the path to the node which has that label, or an empty
967 string if there is no such node.
972 node = edt.label2node.get(label)
974 return node.path if node else ""
978 This function takes a 'path' and looks for an EDT node at that path. If it
979 finds an EDT node, it will look for the parent of that node. If the parent
987 node = edt.get_node(path)
991 if node is None:
994 return node.parent.path if node.parent else ""
998 Return "y" if any GPIO hog node is enabled. Otherwise, return "n".
1003 for node in edt.nodes:
1004 if node.gpio_hogs and node.status == "okay":