Lines Matching +full:prop +full:- +full:1

1 # Copyright (c) 2018-2019 Linaro
4 # SPDX-License-Identifier: Apache-2.0
17 "python-devicetree", "src"))
22 doc_mode = os.environ.get('KCONFIG_DOC_MODE') == "1"
157 foo: some-node { ... };
199 def _node_int_prop(node, prop, unit=None): argument
202 property called 'prop' and if that 'prop' is an integer type will return
203 the value of the property 'prop' as either a string int or string hex
208 'k' or 'K' divide by 1024 (1 << 10)
209 'm' or 'M' divide by 1,048,576 (1 << 20)
210 'g' or 'G' divide by 1,073,741,824 (1 << 30)
211 'kb' or 'Kb' divide by 8192 (1 << 13)
212 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
213 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
218 if prop not in node.props:
221 if node.props[prop].type != "int":
224 return node.props[prop].val >> _dt_units_to_scale(unit)
227 def _node_array_prop(node, prop, index=0, unit=None): argument
230 property called 'prop' and if that 'prop' is an array type will return
231 the value of the property 'prop' at the given 'index' as either a string int
232 or string hex value. If the property 'prop' is not found or the given 'index'
237 'k' or 'K' divide by 1024 (1 << 10)
238 'm' or 'M' divide by 1,048,576 (1 << 20)
239 'g' or 'G' divide by 1,073,741,824 (1 << 30)
244 if prop not in node.props:
246 if node.props[prop].type != "array":
248 if int(index) >= len(node.props[prop].val):
250 return node.props[prop].val[int(index)] >> _dt_units_to_scale(unit)
252 def _node_ph_array_prop(node, prop, index, cell, unit=None): argument
254 This function takes a 'node', a property name ('prop'), index ('index') and
256 called 'prop' and if that 'prop' is an phandle-array type.
263 'k' or 'K' divide by 1024 (1 << 10)
264 'm' or 'M' divide by 1,048,576 (1 << 20)
265 'g' or 'G' divide by 1,073,741,824 (1 << 30)
270 if prop not in node.props:
272 if node.props[prop].type != "phandle-array":
274 if int(index) >= len(node.props[prop].val):
276 if cell not in node.props[prop].val[int(index)].data.keys():
278 return node.props[prop].val[int(index)].data[cell] >> _dt_units_to_scale(unit)
289 'k' or 'K' divide by 1024 (1 << 10)
290 'm' or 'M' divide by 1,048,576 (1 << 20)
291 'g' or 'G' divide by 1,073,741,824 (1 << 30)
292 'kb' or 'Kb' divide by 8192 (1 << 13)
293 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
294 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
313 'k' or 'K' divide by 1024 (1 << 10)
314 'm' or 'M' divide by 1,048,576 (1 << 20)
315 'g' or 'G' divide by 1,073,741,824 (1 << 30)
316 'kb' or 'Kb' divide by 8192 (1 << 13)
317 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
318 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
353 'k' or 'K' divide by 1024 (1 << 10)
354 'm' or 'M' divide by 1,048,576 (1 << 20)
355 'g' or 'G' divide by 1,073,741,824 (1 << 30)
356 'kb' or 'Kb' divide by 8192 (1 << 13)
357 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
358 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
393 'k' or 'K' divide by 1024 (1 << 10)
394 'm' or 'M' divide by 1,048,576 (1 << 20)
395 'g' or 'G' divide by 1,073,741,824 (1 << 30)
396 'kb' or 'Kb' divide by 8192 (1 << 13)
397 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
398 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
419 'k' or 'K' divide by 1024 (1 << 10)
420 'm' or 'M' divide by 1,048,576 (1 << 20)
421 'g' or 'G' divide by 1,073,741,824 (1 << 30)
422 'kb' or 'Kb' divide by 8192 (1 << 13)
423 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
424 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
456 foo: some-node { ... };
473 def _dt_node_bool_prop_generic(node_search_function, search_arg, prop): argument
476 a node with 'search_arg' and if node exists, checks if 'prop' exists
488 if prop not in node.props:
491 if node.props[prop].type != "boolean":
494 if node.props[prop].val:
499 def dt_node_bool_prop(kconf, _, path, prop): argument
503 by the name of 'prop'. If the 'prop' exists it will return "y" otherwise
509 return _dt_node_bool_prop_generic(edt.get_node, path, prop)
511 def dt_nodelabel_bool_prop(kconf, _, label, prop): argument
515 property by the name of 'prop'. If the 'prop' exists it will return "y"
521 return _dt_node_bool_prop_generic(edt.label2node.get, label, prop)
523 def dt_chosen_bool_prop(kconf, _, chosen, prop): argument
527 property 'prop', it returns "y". Otherwise, it returns "n".
532 return _dt_node_bool_prop_generic(edt.chosen_node, chosen, prop)
534 def _dt_node_has_prop_generic(node_search_function, search_arg, prop): argument
537 a node with 'search_arg' and if node exists, then checks if 'prop'
548 if prop in node.props:
553 def dt_node_has_prop(kconf, _, path, prop): argument
557 by the name of 'prop'. If the 'prop' exists it will return "y" otherwise
563 return _dt_node_has_prop_generic(edt.get_node, path, prop)
565 def dt_nodelabel_has_prop(kconf, _, label, prop): argument
569 by the name of 'prop'. If the 'prop' exists it will return "y" otherwise
575 return _dt_node_has_prop_generic(edt.label2node.get, label, prop)
577 def dt_node_int_prop(kconf, name, path, prop, unit=None): argument
579 This function takes a 'path' and property name ('prop') looks for an EDT
581 node has a property called 'prop' and if that 'prop' is an integer type
582 will return the value of the property 'prop' as either a string int or
587 'k' or 'K' divide by 1024 (1 << 10)
588 'm' or 'M' divide by 1,048,576 (1 << 20)
589 'g' or 'G' divide by 1,073,741,824 (1 << 30)
590 'kb' or 'Kb' divide by 8192 (1 << 13)
591 'mb' or 'Mb' divide by 8,388,608 (1 << 23)
592 'gb' or 'Gb' divide by 8,589,934,592 (1 << 33)
603 return str(_node_int_prop(node, prop, unit))
605 return hex(_node_int_prop(node, prop, unit))
608 def dt_node_array_prop(kconf, name, path, prop, index, unit=None): argument
610 This function takes a 'path', property name ('prop') and index ('index')
612 look to see if that node has a property called 'prop' and if that 'prop'
613 is an array type will return the value of the property 'prop' at the given
618 'k' or 'K' divide by 1024 (1 << 10)
619 'm' or 'M' divide by 1,048,576 (1 << 20)
620 'g' or 'G' divide by 1,073,741,824 (1 << 30)
630 return str(_node_array_prop(node, prop, index, unit))
632 return hex(_node_array_prop(node, prop, index, unit))
635 def dt_node_ph_array_prop(kconf, name, path, prop, index, cell, unit=None): argument
637 This function takes a 'path', property name ('prop'), index ('index') and
640 called 'prop' and if that 'prop' is an phandle-array type.
647 'k' or 'K' divide by 1024 (1 << 10)
648 'm' or 'M' divide by 1,048,576 (1 << 20)
649 'g' or 'G' divide by 1,073,741,824 (1 << 30)
659 return str(_node_ph_array_prop(node, prop, index, cell, unit))
661 return hex(_node_ph_array_prop(node, prop, index, cell, unit))
663 def dt_node_ph_prop_path(kconf, name, path, prop): argument
665 This function takes a 'path' and a property name ('prop') and
667 it will look to see if that node has a property called 'prop'
668 and if that 'prop' is an phandle type. Then it will return the
669 path to the pointed-to node, or an empty string if there is
680 if prop not in node.props:
682 if node.props[prop].type != "phandle":
685 phandle = node.props[prop].val
689 def dt_node_str_prop_equals(kconf, _, path, prop, val): argument
691 This function takes a 'path' and property name ('prop') looks for an EDT
693 node has a property 'prop' of type string. If that 'prop' is equal to 'val'
705 if prop not in node.props:
708 if node.props[prop].type != "string":
711 if node.props[prop].val == val:
754 def dt_compat_any_has_prop(kconf, _, compat, prop, value=None): argument
756 This function takes a 'compat', a 'prop', and a 'value'.
758 enabled node with compatible 'compat' also has a valid property 'prop'.
760 also has a valid property 'prop' with value 'value'.
768 if prop in node.props:
771 elif str(node.props[prop].val) == value:
775 def dt_compat_any_not_has_prop(kconf, _, compat, prop): argument
777 This function takes a 'compat', and a 'prop'.
779 does NOT contain the property 'prop'.
787 if prop not in node.props:
845 def dt_nodelabel_array_prop_has_val(kconf, _, label, prop, val): argument
849 'prop' with type "array". If so, and the property contains
858 if not node or (prop not in node.props) or (node.props[prop].type != "array"):
861 return "y" if int(val, base=0) in node.props[prop].val else "n"
913 Normalize the string, so that the string only contains alpha-numeric
914 characters or underscores. All non-alpha-numeric characters are replaced
918 return re.sub(r'[^a-zA-Z0-9_]', '_', string).upper()
956 $(add, 10, 3) # -> 13
957 $(add, 10, 3, 2) # -> 15
958 $(sub, 10, 3) # -> 7
959 $(sub, 10, 3, 2) # -> 5
960 $(mul, 10, 3) # -> 30
961 $(mul, 10, 3, 2) # -> 60
962 $(div, 10, 3) # -> 3
963 $(div, 10, 3, 2) # -> 1
964 $(mod, 10, 3) # -> 1
965 $(mod, 10, 3, 2) # -> 1
966 $(inc, 1) # -> 2
967 $(inc, 1, 1) # -> "2,2"
968 $(inc, $(inc, 1, 1)) # -> "3,3"
969 $(dec, 1) # -> 0
970 $(dec, 1, 1) # -> "0,0"
971 $(dec, $(dec, 1, 1)) # -> "-1,-1"
972 $(add, $(inc, 1, 1)) # -> 4
973 $(div, $(dec, 1, 1)) # Error (0 div 0)
976 intarray = map(int, args if len(args) > 1 else args[0].split(","))
1002 intarray = map(int, args if len(args) > 1 else args[0].split(","))
1005 return ",".join(map(lambda a: str(a + 1), intarray))
1007 return ",".join(map(lambda a: str(a - 1), intarray))
1022 "dt_has_compat": (dt_has_compat, 1, 1),
1023 "dt_compat_enabled": (dt_compat_enabled, 1, 1),
1027 "dt_chosen_label": (dt_chosen_label, 1, 1),
1028 "dt_chosen_enabled": (dt_chosen_enabled, 1, 1),
1029 "dt_chosen_path": (dt_chosen_path, 1, 1),
1031 "dt_path_enabled": (dt_node_enabled, 1, 1),
1032 "dt_alias_enabled": (dt_node_enabled, 1, 1),
1033 "dt_nodelabel_enabled": (dt_nodelabel_enabled, 1, 1),
1035 "dt_chosen_reg_addr_int": (dt_chosen_reg, 1, 3),
1036 "dt_chosen_reg_addr_hex": (dt_chosen_reg, 1, 3),
1037 "dt_chosen_reg_size_int": (dt_chosen_reg, 1, 3),
1038 "dt_chosen_reg_size_hex": (dt_chosen_reg, 1, 3),
1039 "dt_node_reg_addr_int": (dt_node_reg, 1, 3),
1040 "dt_node_reg_addr_hex": (dt_node_reg, 1, 3),
1041 "dt_node_reg_size_int": (dt_node_reg, 1, 3),
1042 "dt_node_reg_size_hex": (dt_node_reg, 1, 3),
1043 "dt_nodelabel_reg_addr_int": (dt_nodelabel_reg, 1, 3),
1044 "dt_nodelabel_reg_addr_hex": (dt_nodelabel_reg, 1, 3),
1045 "dt_nodelabel_reg_size_int": (dt_nodelabel_reg, 1, 3),
1046 "dt_nodelabel_reg_size_hex": (dt_nodelabel_reg, 1, 3),
1062 "dt_nodelabel_path": (dt_nodelabel_path, 1, 1),
1063 "dt_node_parent": (dt_node_parent, 1, 1),
1066 "dt_chosen_partition_addr_int": (dt_chosen_partition_addr, 1, 3),
1067 "dt_chosen_partition_addr_hex": (dt_chosen_partition_addr, 1, 3),
1068 "normalize_upper": (normalize_upper, 1, 1),
1069 "shields_list_contains": (shields_list_contains, 1, 1),
1071 "add": (arith, 1, 255),
1072 "sub": (arith, 1, 255),
1073 "mul": (arith, 1, 255),
1074 "div": (arith, 1, 255),
1075 "mod": (arith, 1, 255),
1076 "max": (arith, 1, 255),
1077 "min": (arith, 1, 255),
1078 "inc": (inc_dec, 1, 255),
1079 "dec": (inc_dec, 1, 255),