From 44686c15ea6cf44d294d665a9e0f45cda9dfb61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Mar 2023 16:22:13 -0700 Subject: [PATCH 1/5] edtlib: refactor some internals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of the token 'prop' in a few places related to how we handle devicetree binding YAML files could be misleading. It seems to indicate that the values being dealt with are property names or something to do with properties, but in fact they are just arbitrary dict keys at this point in the code. Making 'check_required' a positional argument and then being inconsistent about passing it as one or a keyword argument seems worth cleaning up. Refactor the names so that they are clearer about this, and make check_required a keyword argument. No functional changes expected. Signed-off-by: Martí Bolívar --- .../src/devicetree/edtlib.py | 57 ++++++++++--------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/scripts/dts/python-devicetree/src/devicetree/edtlib.py b/scripts/dts/python-devicetree/src/devicetree/edtlib.py index 7af179c9d892..3401c3a7920f 100644 --- a/scripts/dts/python-devicetree/src/devicetree/edtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/edtlib.py @@ -1905,14 +1905,14 @@ def _merge_includes(self, raw, binding_path): if isinstance(include, str): # Simple scalar string case - _merge_props(merged, self._load_raw(include), None, binding_path, - False) + _merge_binding_dicts(merged, self._load_raw(include), None, + binding_path) elif isinstance(include, list): # List of strings and maps. These types may be intermixed. for elem in include: if isinstance(elem, str): - _merge_props(merged, self._load_raw(elem), None, - binding_path, False) + _merge_binding_dicts(merged, self._load_raw(elem), None, + binding_path) elif isinstance(elem, dict): name = elem.pop('name', None) allowlist = elem.pop('property-allowlist', None) @@ -1931,7 +1931,7 @@ def _merge_includes(self, raw, binding_path): _filter_properties(contents, allowlist, blocklist, child_filter, binding_path) - _merge_props(merged, contents, None, binding_path, False) + _merge_binding_dicts(merged, contents, None, binding_path) else: _err(f"all elements in 'include:' in {binding_path} " "should be either strings or maps with a 'name' key " @@ -1946,7 +1946,8 @@ def _merge_includes(self, raw, binding_path): # 'raw' has 'required: false' while the merged included files have # 'required: true'. - _merge_props(raw, merged, None, binding_path, check_required=True) + _merge_binding_dicts(raw, merged, None, binding_path, + check_required=True) return raw @@ -2389,8 +2390,10 @@ def _check_prop_filter(name, value, binding_path): _err(f"'{name}' value {value} in {binding_path} should be a list") -def _merge_props(to_dict, from_dict, parent, binding_path, check_required): - # Recursively merges 'from_dict' into 'to_dict', to implement 'include:'. +def _merge_binding_dicts(to_dict, from_dict, parent, binding_path, + check_required=False): + # Recursively merges 'from_dict' into 'to_dict', to implement 'include:' + # in our bindings YAML format. # # If 'from_dict' and 'to_dict' contain a 'required:' key for the same # property, then the values are ORed together. @@ -2408,18 +2411,18 @@ def _merge_props(to_dict, from_dict, parent, binding_path, check_required): # 'from_dict', and 'binding_path' is the path to the top-level binding. # These are used to generate errors for sketchy property overwrites. - for prop in from_dict: - if isinstance(to_dict.get(prop), dict) and \ - isinstance(from_dict[prop], dict): - _merge_props(to_dict[prop], from_dict[prop], prop, binding_path, - check_required) - elif prop not in to_dict: - to_dict[prop] = from_dict[prop] - elif _bad_overwrite(to_dict, from_dict, prop, check_required): - _err(f"{binding_path} (in '{parent}'): '{prop}' " - f"from included file overwritten ('{from_dict[prop]}' " - f"replaced with '{to_dict[prop]}')") - elif prop == "required": + for key in from_dict: + if isinstance(to_dict.get(key), dict) and \ + isinstance(from_dict[key], dict): + _merge_binding_dicts(to_dict[key], from_dict[key], key, + binding_path, check_required) + elif key not in to_dict: + to_dict[key] = from_dict[key] + elif _bad_overwrite(to_dict, from_dict, key, check_required): + _err(f"{binding_path} (in '{parent}'): '{key}' " + f"from included file overwritten ('{from_dict[key]}' " + f"replaced with '{to_dict[key]}')") + elif key == "required": # Need a separate check here, because this code runs before # Binding._check() if not (isinstance(from_dict["required"], bool) and @@ -2431,21 +2434,21 @@ def _merge_props(to_dict, from_dict, parent, binding_path, check_required): to_dict["required"] = to_dict["required"] or from_dict["required"] -def _bad_overwrite(to_dict, from_dict, prop, check_required): - # _merge_props() helper. Returns True in cases where it's bad that - # to_dict[prop] takes precedence over from_dict[prop]. +def _bad_overwrite(to_dict, from_dict, key, check_required): + # _merge_binding_dicts() helper. Returns True in cases where it's bad that + # to_dict[key] takes precedence over from_dict[key]. - if to_dict[prop] == from_dict[prop]: + if to_dict[key] == from_dict[key]: return False # These are overridden deliberately - if prop in {"title", "description", "compatible"}: + if key in {"title", "description", "compatible"}: return False - if prop == "required": + if key == "required": if not check_required: return False - return from_dict[prop] and not to_dict[prop] + return from_dict[key] and not to_dict[key] return True From ac11f9424ab0df924a8da75377dfe50bce97ad35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Mar 2023 17:17:38 -0700 Subject: [PATCH 2/5] devicetree: extend internal test helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This extension will make it easier to write a test for an upcoming feature. Signed-off-by: Martí Bolívar --- scripts/dts/python-devicetree/tests/test_edtlib.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index 0653eef78ba0..b8ccc7438717 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -627,18 +627,24 @@ def test_wrong_props(): assert value_str.endswith("but no 'specifier-space' was provided.") -def verify_error(dts, dts_file, expected_err): +def verify_error(dts, dts_file, expected_err, bindings_dirs=None): # Verifies that parsing a file 'dts_file' with the contents 'dts' # (a string) raises an EDTError with the message 'expected_err'. # # The path 'dts_file' is written with the string 'dts' before the # test is run. + # + # You can optionally specify a list of directories containing bindings + # to use in 'bindings_dirs'. with open(dts_file, "w", encoding="utf-8") as f: f.write(dts) f.flush() # Can't have unbuffered text IO, so flush() instead + if bindings_dirs is None: + bindings_dirs = [] + with pytest.raises(edtlib.EDTError) as e: - edtlib.EDT(dts_file, []) + edtlib.EDT(dts_file, bindings_dirs) assert str(e.value) == expected_err From 7c2427668d6df8b5f9bd7644ca4d8b5318cad343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Mar 2023 16:37:29 -0700 Subject: [PATCH 3/5] devicetree: bindings: add top-level 'interrupt-source' key MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zephyr devicetree bindings support either the 'interrupts' or the 'interrupts-extended' method of specifying interrupts. These properties are standard and defined in the Devicetree Specification. The 'interrupts' property can be treated as a special case of the 'interrupts-extended' property; you can always write something like this: node { interrupt-parent = <&parent>; interrupts = <1>; }; as this instead: node { interrupts-extended = <&parent 1>; }; The 'interrupts-extended' property, however, can be used when the node in question is hooked up to more than one interrupt controller, and can contain multiple elements, one per interrupt domain that the node generates interrupts in. Therefore, it is sensible semantically to allow an interrupt-generating devicetree node to use either 'interrupts-extended' or 'interrupts' to specify its generated interrupts, at the option of the devicetree author, and we can almost do that today. The missing piece is that we can't require in the binding that either 'interrupts' or 'interrupts-extended' is set: we can only require individual properties; we can't say "at least one of these is required". You could write some BUILD_ASSERT()s to do this in the driver, but it would be nicer to have this in the binding so the error messages are easier to read. The extra effort seems worth it since this is a special case where the properties are core to the specification itself. To enable this, add a top-level 'interrupt-source:' key to the bindings syntax which, if true, indicates that one of 'interrupts' or 'interrupts-extended' must be set. Signed-off-by: Martí Bolívar --- .../src/devicetree/edtlib.py | 74 ++++++++++++++----- .../tests/test-bindings/interrupt-source.yaml | 3 + .../python-devicetree/tests/test_edtlib.py | 19 +++++ 3 files changed, 76 insertions(+), 20 deletions(-) create mode 100644 scripts/dts/python-devicetree/tests/test-bindings/interrupt-source.yaml diff --git a/scripts/dts/python-devicetree/src/devicetree/edtlib.py b/scripts/dts/python-devicetree/src/devicetree/edtlib.py index 3401c3a7920f..bf24fe2be944 100644 --- a/scripts/dts/python-devicetree/src/devicetree/edtlib.py +++ b/scripts/dts/python-devicetree/src/devicetree/edtlib.py @@ -1330,7 +1330,9 @@ def _init_pinctrls(self): _add_names(node, "pinctrl", self.pinctrls) def _init_interrupts(self): - # Initializes self.interrupts + # Initializes self.interrupts. Errors out if the node's binding + # says it's an interrupt source, but the node doesn't have any + # interrupts specified. node = self._node @@ -1347,6 +1349,12 @@ def _init_interrupts(self): _add_names(node, "interrupt", self.interrupts) + if (self._binding and + (self._binding.interrupt_source and not self.interrupts)): + _err(f"Node '{self.path}' is marked as an interrupt source, " + "but it has neither 'interrupts' nor 'interrupts-extended' " + "properties set") + def _standard_phandle_val_list(self, prop, specifier_space): # Parses a property like # @@ -1772,6 +1780,11 @@ class Binding: If nodes with this binding's 'compatible' appear on a bus, a string describing the bus type (like "i2c"). None otherwise. + interrupt_source: + Boolean. True if nodes with this binding's 'compatible' are + interrupt-generating nodes, and therefore must have either an + 'interrupts' or 'interrupts-extended' property set. False otherwise. + child_binding: If this binding describes the properties of child nodes, then this is a Binding object for those children; it is None otherwise. @@ -1883,6 +1896,11 @@ def on_bus(self): "See the class docstring" return self.raw.get('on-bus') + @property + def interrupt_source(self): + "See the class docstring" + return self.raw.get('interrupt-source', False) + def _merge_includes(self, raw, binding_path): # Constructor helper. Merges included files in # 'raw["include"]' into 'raw' using 'self._include_paths' as a @@ -1897,9 +1915,11 @@ def _merge_includes(self, raw, binding_path): include = raw.pop("include") - # First, merge the included files together. If more than one included - # file has a 'required:' for a particular property, OR the values - # together, so that 'required: true' wins. + # First, merge the included files together. + # + # If more than one included file has an 'interrupt-source' or + # 'required' key, OR the values together, so that + # 'interrupt-source: true' or 'required: true' win. merged = {} @@ -1942,12 +1962,15 @@ def _merge_includes(self, raw, binding_path): _err(f"'include:' in {binding_path} " f"should be a string or list, but has type {type(include)}") - # Next, merge the merged included files into 'raw'. Error out if - # 'raw' has 'required: false' while the merged included files have - # 'required: true'. + # Next, merge the merged included files into 'raw'. + # + # Error out if 'raw' has 'required: false' while the merged + # included files have 'required: true' for any properties, + # or if 'raw' has 'interrupt-source: false' while the merged + # included files have 'interrupt-source: true'. _merge_binding_dicts(raw, merged, None, binding_path, - check_required=True) + check_relaxations=True) return raw @@ -1990,8 +2013,8 @@ def _check(self, require_compatible, require_description): # Allowed top-level keys. The 'include' key should have been # removed by _load_raw() already. - ok_top = {"description", "compatible", "bus", "on-bus", - "properties", "child-binding"} + ok_top = {"description", "compatible", "interrupt-source", + "bus", "on-bus", "properties", "child-binding"} # Descriptive errors for legacy bindings. legacy_errors = { @@ -2012,6 +2035,11 @@ def _check(self, require_compatible, require_description): _err(f"unknown key '{key}' in {self.path}, " "expected one of {', '.join(ok_top)}, or *-cells") + interrupt_source = raw.get("interrupt-source", False) + if interrupt_source and not isinstance(interrupt_source, bool): + _err(f"malformed 'interrupt-source:' value in {self.path}, " + "expected a boolean") + if "bus" in raw: bus = raw["bus"] if not isinstance(bus, str) and \ @@ -2391,17 +2419,23 @@ def _check_prop_filter(name, value, binding_path): def _merge_binding_dicts(to_dict, from_dict, parent, binding_path, - check_required=False): + check_relaxations=False): # Recursively merges 'from_dict' into 'to_dict', to implement 'include:' # in our bindings YAML format. # # If 'from_dict' and 'to_dict' contain a 'required:' key for the same # property, then the values are ORed together. # - # If 'check_required' is True, then an error is raised if 'from_dict' has - # 'required: true' while 'to_dict' has 'required: false'. This prevents - # bindings from "downgrading" requirements from bindings they include, - # which might help keep bindings well-organized. + # If 'check_relaxations' is True, then an error is raised if: + # + # - 'from_dict' has 'required: true' while 'to_dict' has + # 'required: false' + # - 'from_dict' has 'interrupt-source: true' while 'to_dict' has + # 'interrupt-source: false' + # + # This prevents bindings from "relaxing" requirements from + # bindings they include, which is intended to help keep bindings + # well-organized. # # It's an error for most other keys to appear in both 'from_dict' and # 'to_dict'. When it's not an error, the value in 'to_dict' takes @@ -2415,10 +2449,10 @@ def _merge_binding_dicts(to_dict, from_dict, parent, binding_path, if isinstance(to_dict.get(key), dict) and \ isinstance(from_dict[key], dict): _merge_binding_dicts(to_dict[key], from_dict[key], key, - binding_path, check_required) + binding_path, check_relaxations) elif key not in to_dict: to_dict[key] = from_dict[key] - elif _bad_overwrite(to_dict, from_dict, key, check_required): + elif _bad_overwrite(to_dict, from_dict, key, check_relaxations): _err(f"{binding_path} (in '{parent}'): '{key}' " f"from included file overwritten ('{from_dict[key]}' " f"replaced with '{to_dict[key]}')") @@ -2434,7 +2468,7 @@ def _merge_binding_dicts(to_dict, from_dict, parent, binding_path, to_dict["required"] = to_dict["required"] or from_dict["required"] -def _bad_overwrite(to_dict, from_dict, key, check_required): +def _bad_overwrite(to_dict, from_dict, key, check_relaxations): # _merge_binding_dicts() helper. Returns True in cases where it's bad that # to_dict[key] takes precedence over from_dict[key]. @@ -2445,8 +2479,8 @@ def _bad_overwrite(to_dict, from_dict, key, check_required): if key in {"title", "description", "compatible"}: return False - if key == "required": - if not check_required: + if key in ("required", "interrupt-source"): + if not check_relaxations: return False return from_dict[key] and not to_dict[key] diff --git a/scripts/dts/python-devicetree/tests/test-bindings/interrupt-source.yaml b/scripts/dts/python-devicetree/tests/test-bindings/interrupt-source.yaml new file mode 100644 index 000000000000..026af525cead --- /dev/null +++ b/scripts/dts/python-devicetree/tests/test-bindings/interrupt-source.yaml @@ -0,0 +1,3 @@ +compatible: interrupt-source +description: Test the 'interrupt-source:' feature +interrupt-source: true diff --git a/scripts/dts/python-devicetree/tests/test_edtlib.py b/scripts/dts/python-devicetree/tests/test_edtlib.py index b8ccc7438717..9fa6424726d7 100644 --- a/scripts/dts/python-devicetree/tests/test_edtlib.py +++ b/scripts/dts/python-devicetree/tests/test_edtlib.py @@ -78,6 +78,25 @@ def test_interrupts(): assert str(edt.get_node("/interrupt-map-bitops-test/node@70000000E").interrupts) == \ f"[, data: {{'one': 3, 'two': 2}}>]" +def test_interrupt_source(tmp_path): + '''Tests for the 'interrupt-source' feature in bindings.''' + + dts_file = tmp_path / "error.dts" + + with from_here(): + verify_error(""" +/dts-v1/; + +/ { + foo { + compatible = "interrupt-source"; + }; +}; +""", + dts_file, + f"Node '/foo' is marked as an interrupt source, but it has neither 'interrupts' nor 'interrupts-extended' properties set", + ["test-bindings"]) + def test_ranges(): '''Tests for the ranges property''' with from_here(): From 4e46ef26b27b174831a9f7289227ff8344b2acc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Mar 2023 16:44:40 -0700 Subject: [PATCH 4/5] doc: gen_devicetree_rest: handle 'interrupt-source' feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This new feature requires a bit of special handling since it affects multiple different properties. Signed-off-by: Martí Bolívar --- doc/_scripts/gen_devicetree_rest.py | 13 ++++++++----- doc/build/dts/bindings-syntax.rst | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/_scripts/gen_devicetree_rest.py b/doc/_scripts/gen_devicetree_rest.py index dbd6227d972c..3f982aaedd54 100644 --- a/doc/_scripts/gen_devicetree_rest.py +++ b/doc/_scripts/gen_devicetree_rest.py @@ -491,16 +491,19 @@ def print_binding_page(binding, base_names, vnd_lookup, dup_compats, file=string_io) # Binding description. - if binding.bus: - bus_help = f'These nodes are "{binding.bus}" bus nodes.' - else: - bus_help = '' print_block(f'''\ Description *********** - {bus_help} ''', string_io) + if binding.bus: + print(f'These nodes are "{binding.bus}" bus nodes.\n\n', + file=string_io) + if binding.interrupt_source: + print('These nodes are interrupt sources, which means ' + 'they must have either an ``interrupts`` or an ' + '``interrupts-extended`` property set.\n\n', + file=string_io) print(to_code_block(binding.description.strip()), file=string_io) # Properties. diff --git a/doc/build/dts/bindings-syntax.rst b/doc/build/dts/bindings-syntax.rst index aff8bb641055..1d4107ded8c3 100644 --- a/doc/build/dts/bindings-syntax.rst +++ b/doc/build/dts/bindings-syntax.rst @@ -34,6 +34,9 @@ like this: # Used to match nodes to this binding: compatible: "manufacturer,foo-device" + # Used to indicate that nodes of this type generate interrupts: + interrupt-source: + properties: # Requirements for and descriptions of the properties that this # binding's nodes need to satisfy go here. @@ -111,6 +114,17 @@ vendor. In these cases, there is no vendor prefix. One example is the :dtcompatible:`gpio-leds` compatible which is commonly used to describe board LEDs connected to GPIOs. +interrupt-source +**************** + +This key is a boolean. It is used to indicate that the hardware represented by +this compatible generates interrupts. If the binding contains +``interrupt-source: true``, then any node with this compatible must have either +an ``interrupts`` or an ``interrupts-extended`` property set. + +Refer to the Devicetree Specification v0.3 section 2.4, Interrupts and +Interrupt Mapping, for more details about these properties. + .. _dt-bindings-properties: Properties From 965dc3700485a4288d9f37b8036f6a5f473be559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bol=C3=ADvar?= Date: Fri, 24 Mar 2023 16:52:15 -0700 Subject: [PATCH 5/5] dts: bindings: nordic: use 'interrupt-source' feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt devicetree bindings for Nordic SoCs to use the 'interrupt-source' feature which was recently added to the devicetree bindings syntax. This paves the way for using them in system devicetree, for example in nRF54H20, without affecting backwards compatibility for existing use cases. We update all peripherals just to be consistent within our vendor bindings, while leaving it up to other SoC maintainers to decide what is best for their use cases. (The reason why this is useful for system devicetree support is that in a system devicetree, a single peripheral node may need to be able to express its connections to multiple interrupt controllers, such as the two independent NVICs in an SoC with two separate Arm Cortex-M cores in an AMP configuration.) Signed-off-by: Martí Bolívar --- dts/bindings/adc/nordic,nrf-adc.yaml | 5 ++--- dts/bindings/adc/nordic,nrf-comp.yaml | 5 ++--- dts/bindings/adc/nordic,nrf-lpcomp.yaml | 5 ++--- dts/bindings/adc/nordic,nrf-saadc.yaml | 5 ++--- dts/bindings/arm/nordic,nrf-egu.yaml | 5 ++--- dts/bindings/arm/nordic,nrf-kmu.yaml | 5 ++--- dts/bindings/arm/nordic,nrf-spu.yaml | 5 ++--- dts/bindings/arm/nordic,nrf-swi.yaml | 5 ++--- dts/bindings/audio/nordic,nrf-pdm.yaml | 5 ++--- dts/bindings/clock/nordic,nrf-clock.yaml | 5 ++--- dts/bindings/crypto/nordic,nrf-ccm.yaml | 5 ++--- dts/bindings/crypto/nordic,nrf-ecb.yaml | 5 ++--- dts/bindings/flash_controller/nordic,nrf-qspi.yaml | 5 ++--- dts/bindings/gpio/nordic,nrf-gpiote.yaml | 5 ++--- dts/bindings/i2c/nordic,nrf-twi-common.yaml | 5 ++--- dts/bindings/i2s/nordic,nrf-i2s.yaml | 5 ++--- dts/bindings/ipm/nordic,nrf-ipc.yaml | 5 ++--- dts/bindings/mbox/nordic,mbox-nrf-ipc.yaml | 5 ++--- dts/bindings/net/wireless/nordic,nrf-nfct.yaml | 5 ++--- dts/bindings/net/wireless/nordic,nrf-radio.yaml | 5 ++--- dts/bindings/power/nordic,nrf-power.yaml | 5 ++--- dts/bindings/power/nordic,nrf-usbreg.yaml | 5 ++--- dts/bindings/rng/nordic,nrf-rng.yaml | 5 ++--- dts/bindings/sensor/nordic,nrf-qdec.yaml | 5 ++--- dts/bindings/sensor/nordic,nrf-temp.yaml | 5 ++--- dts/bindings/serial/nordic,nrf-uart-common.yaml | 5 ++--- dts/bindings/spi/nordic,nrf-spi-common.yaml | 5 ++--- dts/bindings/timer/nordic,nrf-timer.yaml | 5 ++--- dts/bindings/usb/nordic,nrf-usbd.yaml | 5 ++--- dts/bindings/watchdog/nordic,nrf-wdt.yaml | 5 ++--- 30 files changed, 60 insertions(+), 90 deletions(-) diff --git a/dts/bindings/adc/nordic,nrf-adc.yaml b/dts/bindings/adc/nordic,nrf-adc.yaml index 7f96287b657c..a93305da295e 100644 --- a/dts/bindings/adc/nordic,nrf-adc.yaml +++ b/dts/bindings/adc/nordic,nrf-adc.yaml @@ -5,15 +5,14 @@ description: nRF ADC node compatible: "nordic,nrf-adc" +interrupt-source: true + include: adc-controller.yaml properties: reg: required: true - interrupts: - required: true - "#io-channel-cells": const: 1 diff --git a/dts/bindings/adc/nordic,nrf-comp.yaml b/dts/bindings/adc/nordic,nrf-comp.yaml index cc964015ba18..82d65885a35a 100644 --- a/dts/bindings/adc/nordic,nrf-comp.yaml +++ b/dts/bindings/adc/nordic,nrf-comp.yaml @@ -5,15 +5,14 @@ description: Nordic nRF family COMP (Comparator) compatible: "nordic,nrf-comp" +interrupt-source: true + include: base.yaml properties: reg: required: true - interrupts: - required: true - "#io-channel-cells": type: int const: 1 diff --git a/dts/bindings/adc/nordic,nrf-lpcomp.yaml b/dts/bindings/adc/nordic,nrf-lpcomp.yaml index 132b0980ac5a..cdf100b1d333 100644 --- a/dts/bindings/adc/nordic,nrf-lpcomp.yaml +++ b/dts/bindings/adc/nordic,nrf-lpcomp.yaml @@ -5,15 +5,14 @@ description: Nordic nRF family LPCOMP (Low-power Comparator) compatible: "nordic,nrf-lpcomp" +interrupt-source: true + include: base.yaml properties: reg: required: true - interrupts: - required: true - "#io-channel-cells": type: int const: 1 diff --git a/dts/bindings/adc/nordic,nrf-saadc.yaml b/dts/bindings/adc/nordic,nrf-saadc.yaml index f41cf2c048e8..f3d246b6acf9 100644 --- a/dts/bindings/adc/nordic,nrf-saadc.yaml +++ b/dts/bindings/adc/nordic,nrf-saadc.yaml @@ -5,15 +5,14 @@ description: Nordic Semiconductor nRF family SAADC node compatible: "nordic,nrf-saadc" +interrupt-source: true + include: adc-controller.yaml properties: reg: required: true - interrupts: - required: true - "#io-channel-cells": const: 1 diff --git a/dts/bindings/arm/nordic,nrf-egu.yaml b/dts/bindings/arm/nordic,nrf-egu.yaml index 2b7792b27e7b..144ea66636c5 100644 --- a/dts/bindings/arm/nordic,nrf-egu.yaml +++ b/dts/bindings/arm/nordic,nrf-egu.yaml @@ -5,11 +5,10 @@ description: Nordic EGU (Event Generator Unit) compatible: "nordic,nrf-egu" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/arm/nordic,nrf-kmu.yaml b/dts/bindings/arm/nordic,nrf-kmu.yaml index cae8c4ca7e7c..623c108fd421 100644 --- a/dts/bindings/arm/nordic,nrf-kmu.yaml +++ b/dts/bindings/arm/nordic,nrf-kmu.yaml @@ -5,11 +5,10 @@ description: Nordic KMU (Key Management Unit) compatible: "nordic,nrf-kmu" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/arm/nordic,nrf-spu.yaml b/dts/bindings/arm/nordic,nrf-spu.yaml index cd62c95dfac3..ffb3c185d05c 100644 --- a/dts/bindings/arm/nordic,nrf-spu.yaml +++ b/dts/bindings/arm/nordic,nrf-spu.yaml @@ -2,11 +2,10 @@ description: Nordic SPU (System Protection Unit) compatible: "nordic,nrf-spu" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/arm/nordic,nrf-swi.yaml b/dts/bindings/arm/nordic,nrf-swi.yaml index ce68eb848d30..ac2af72c3bea 100644 --- a/dts/bindings/arm/nordic,nrf-swi.yaml +++ b/dts/bindings/arm/nordic,nrf-swi.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family SWI (Software Interrupt) compatible: "nordic,nrf-swi" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/audio/nordic,nrf-pdm.yaml b/dts/bindings/audio/nordic,nrf-pdm.yaml index 006ff31aab98..b0a748939c27 100644 --- a/dts/bindings/audio/nordic,nrf-pdm.yaml +++ b/dts/bindings/audio/nordic,nrf-pdm.yaml @@ -5,15 +5,14 @@ description: Nordic PDM (Pulse Density Modulation interface) compatible: "nordic,nrf-pdm" +interrupt-source: true + include: [base.yaml, pinctrl-device.yaml] properties: reg: required: true - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/clock/nordic,nrf-clock.yaml b/dts/bindings/clock/nordic,nrf-clock.yaml index 22cde89bcfb1..6af5474cc979 100644 --- a/dts/bindings/clock/nordic,nrf-clock.yaml +++ b/dts/bindings/clock/nordic,nrf-clock.yaml @@ -5,15 +5,14 @@ description: Nordic nRF clock control node compatible: "nordic,nrf-clock" +interrupt-source: true + include: base.yaml properties: reg: required: true - interrupts: - required: true - hfclkaudio-frequency: type: int description: | diff --git a/dts/bindings/crypto/nordic,nrf-ccm.yaml b/dts/bindings/crypto/nordic,nrf-ccm.yaml index 6a43ebb758e0..814975dc6104 100644 --- a/dts/bindings/crypto/nordic,nrf-ccm.yaml +++ b/dts/bindings/crypto/nordic,nrf-ccm.yaml @@ -5,15 +5,14 @@ description: Nordic nRF family CCM (AES CCM mode encryption) compatible: "nordic,nrf-ccm" +interrupt-source: true + include: base.yaml properties: reg: required: true - interrupts: - required: true - length-field-length-8-bits: type: boolean description: | diff --git a/dts/bindings/crypto/nordic,nrf-ecb.yaml b/dts/bindings/crypto/nordic,nrf-ecb.yaml index 4df050aaa60f..f78e0103f7c5 100644 --- a/dts/bindings/crypto/nordic,nrf-ecb.yaml +++ b/dts/bindings/crypto/nordic,nrf-ecb.yaml @@ -5,11 +5,10 @@ description: Nordic ECB (AES electronic codebook mode encryption) compatible: "nordic,nrf-ecb" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/flash_controller/nordic,nrf-qspi.yaml b/dts/bindings/flash_controller/nordic,nrf-qspi.yaml index 65137a23b78b..e79a34b43cf9 100644 --- a/dts/bindings/flash_controller/nordic,nrf-qspi.yaml +++ b/dts/bindings/flash_controller/nordic,nrf-qspi.yaml @@ -21,6 +21,8 @@ description: | compatible: "nordic,nrf-qspi" +interrupt-source: true + include: [flash-controller.yaml, pinctrl-device.yaml] bus: qspi @@ -34,8 +36,5 @@ properties: required: true const: 0 - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/gpio/nordic,nrf-gpiote.yaml b/dts/bindings/gpio/nordic,nrf-gpiote.yaml index 49ddba3595ba..e5691709c90c 100644 --- a/dts/bindings/gpio/nordic,nrf-gpiote.yaml +++ b/dts/bindings/gpio/nordic,nrf-gpiote.yaml @@ -5,11 +5,10 @@ description: NRF5 GPIOTE node compatible: "nordic,nrf-gpiote" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/i2c/nordic,nrf-twi-common.yaml b/dts/bindings/i2c/nordic,nrf-twi-common.yaml index 621d45d0f4bb..717f5e9cdb00 100644 --- a/dts/bindings/i2c/nordic,nrf-twi-common.yaml +++ b/dts/bindings/i2c/nordic,nrf-twi-common.yaml @@ -6,12 +6,11 @@ include: [i2c-controller.yaml, pinctrl-device.yaml] +interrupt-source: true + properties: reg: required: true - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/i2s/nordic,nrf-i2s.yaml b/dts/bindings/i2s/nordic,nrf-i2s.yaml index 6491dc12a419..8bc0640f9e46 100644 --- a/dts/bindings/i2s/nordic,nrf-i2s.yaml +++ b/dts/bindings/i2s/nordic,nrf-i2s.yaml @@ -5,15 +5,14 @@ description: Nordic I2S (Inter-IC sound interface) compatible: "nordic,nrf-i2s" +interrupt-source: true + include: [i2s-controller.yaml, pinctrl-device.yaml] properties: reg: required: true - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/ipm/nordic,nrf-ipc.yaml b/dts/bindings/ipm/nordic,nrf-ipc.yaml index f3e392def63d..b5cd1d624728 100644 --- a/dts/bindings/ipm/nordic,nrf-ipc.yaml +++ b/dts/bindings/ipm/nordic,nrf-ipc.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family IPC (Interprocessor Communication) compatible: "nordic,nrf-ipc" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/mbox/nordic,mbox-nrf-ipc.yaml b/dts/bindings/mbox/nordic,mbox-nrf-ipc.yaml index 2558877fe7fd..ca68028292ac 100644 --- a/dts/bindings/mbox/nordic,mbox-nrf-ipc.yaml +++ b/dts/bindings/mbox/nordic,mbox-nrf-ipc.yaml @@ -5,6 +5,8 @@ description: Nordic nRF family IPC (MBOX Interprocessor Communication) compatible: "nordic,mbox-nrf-ipc" +interrupt-source: true + include: [base.yaml, mailbox-controller.yaml] properties: @@ -18,8 +20,5 @@ properties: required: true description: RX supported channels mask - interrupts: - required: true - mbox-cells: - channel diff --git a/dts/bindings/net/wireless/nordic,nrf-nfct.yaml b/dts/bindings/net/wireless/nordic,nrf-nfct.yaml index 5f0691300d3d..8df4b82471d2 100644 --- a/dts/bindings/net/wireless/nordic,nrf-nfct.yaml +++ b/dts/bindings/net/wireless/nordic,nrf-nfct.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family NFCT (Near Field Communication Tag) compatible: "nordic,nrf-nfct" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/net/wireless/nordic,nrf-radio.yaml b/dts/bindings/net/wireless/nordic,nrf-radio.yaml index 9814e5f5fb7c..22a6dd44a6c5 100644 --- a/dts/bindings/net/wireless/nordic,nrf-radio.yaml +++ b/dts/bindings/net/wireless/nordic,nrf-radio.yaml @@ -108,15 +108,14 @@ description: | compatible: "nordic,nrf-radio" +interrupt-source: true + include: [base.yaml] properties: reg: required: true - interrupts: - required: true - fem: type: phandle description: | diff --git a/dts/bindings/power/nordic,nrf-power.yaml b/dts/bindings/power/nordic,nrf-power.yaml index 9a138e7ff747..abe1168193d3 100644 --- a/dts/bindings/power/nordic,nrf-power.yaml +++ b/dts/bindings/power/nordic,nrf-power.yaml @@ -5,11 +5,10 @@ description: Nordic nRF power control node compatible: "nordic,nrf-power" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/power/nordic,nrf-usbreg.yaml b/dts/bindings/power/nordic,nrf-usbreg.yaml index 7e2eb47edf32..1180c6d8020a 100644 --- a/dts/bindings/power/nordic,nrf-usbreg.yaml +++ b/dts/bindings/power/nordic,nrf-usbreg.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family USBREG (USB Regulator Control) compatible: "nordic,nrf-usbreg" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/rng/nordic,nrf-rng.yaml b/dts/bindings/rng/nordic,nrf-rng.yaml index c6873b85e433..1523f2cf0e9b 100644 --- a/dts/bindings/rng/nordic,nrf-rng.yaml +++ b/dts/bindings/rng/nordic,nrf-rng.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family RNG (Random Number Generator) compatible: "nordic,nrf-rng" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/sensor/nordic,nrf-qdec.yaml b/dts/bindings/sensor/nordic,nrf-qdec.yaml index 2951715dcbf9..5ec5535fcb00 100644 --- a/dts/bindings/sensor/nordic,nrf-qdec.yaml +++ b/dts/bindings/sensor/nordic,nrf-qdec.yaml @@ -5,15 +5,14 @@ description: Nordic nRF quadrature decoder (QDEC) node compatible: "nordic,nrf-qdec" +interrupt-source: true + include: [sensor-device.yaml, pinctrl-device.yaml] properties: reg: required: true - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/sensor/nordic,nrf-temp.yaml b/dts/bindings/sensor/nordic,nrf-temp.yaml index ceb35811222a..377b556c3d0c 100644 --- a/dts/bindings/sensor/nordic,nrf-temp.yaml +++ b/dts/bindings/sensor/nordic,nrf-temp.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family TEMP node compatible: "nordic,nrf-temp" +interrupt-source: true + include: sensor-device.yaml properties: reg: required: true - - interrupts: - required: true diff --git a/dts/bindings/serial/nordic,nrf-uart-common.yaml b/dts/bindings/serial/nordic,nrf-uart-common.yaml index fa68a195cd68..107aec961194 100644 --- a/dts/bindings/serial/nordic,nrf-uart-common.yaml +++ b/dts/bindings/serial/nordic,nrf-uart-common.yaml @@ -1,12 +1,11 @@ include: [uart-controller.yaml, pinctrl-device.yaml] +interrupt-source: true + properties: reg: required: true - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/spi/nordic,nrf-spi-common.yaml b/dts/bindings/spi/nordic,nrf-spi-common.yaml index d9c0d2f9ae3a..58514941d4f6 100644 --- a/dts/bindings/spi/nordic,nrf-spi-common.yaml +++ b/dts/bindings/spi/nordic,nrf-spi-common.yaml @@ -5,13 +5,12 @@ include: [spi-controller.yaml, pinctrl-device.yaml] +interrupt-source: true + properties: reg: required: true - interrupts: - required: true - pinctrl-0: required: true diff --git a/dts/bindings/timer/nordic,nrf-timer.yaml b/dts/bindings/timer/nordic,nrf-timer.yaml index 8a961f34f883..45c1eb093a37 100644 --- a/dts/bindings/timer/nordic,nrf-timer.yaml +++ b/dts/bindings/timer/nordic,nrf-timer.yaml @@ -5,6 +5,8 @@ description: Nordic nRF timer node compatible: "nordic,nrf-timer" +interrupt-source: true + include: base.yaml properties: @@ -21,9 +23,6 @@ properties: required: true description: Maximum bit width supported - interrupts: - required: true - prescaler: type: int required: true diff --git a/dts/bindings/usb/nordic,nrf-usbd.yaml b/dts/bindings/usb/nordic,nrf-usbd.yaml index 4de7fb0f9e4c..9de633c99433 100644 --- a/dts/bindings/usb/nordic,nrf-usbd.yaml +++ b/dts/bindings/usb/nordic,nrf-usbd.yaml @@ -6,15 +6,14 @@ description: | compatible: "nordic,nrf-usbd" +interrupt-source: true + include: usb-ep.yaml properties: reg: required: true - interrupts: - required: true - num-isoin-endpoints: type: int required: true diff --git a/dts/bindings/watchdog/nordic,nrf-wdt.yaml b/dts/bindings/watchdog/nordic,nrf-wdt.yaml index cd91ad960fd6..a77690611b10 100644 --- a/dts/bindings/watchdog/nordic,nrf-wdt.yaml +++ b/dts/bindings/watchdog/nordic,nrf-wdt.yaml @@ -5,11 +5,10 @@ description: Nordic nRF family WDT (Watchdog Timer) compatible: "nordic,nrf-wdt" +interrupt-source: true + include: base.yaml properties: reg: required: true - - interrupts: - required: true