From e2510831f8ee22da837bd2327c1f6d170d802c81 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:53 +0200 Subject: [PATCH 01/72] dtc: dt-check-style: Handle sorting of top-level nodes and properties Top-level DTS (but not example in the bindings) has only two nodes with unit-addresses: memory@ and soc@. There are two special cases here, in terms of coding style: 1. The unit-address of memory is often not known thus set to @0, because it is filled up by bootloader. 2. There is mixture of non-unit-address and unit-address nodes. Therefore usually the DTS chooses for the top-level part sorting by the node name, not the unit address. Also the properties have one exception: 'model' property is supposed to be before the 'compatible'. This cannot be applied to the entire DTS, because sound cards have also 'model' where it is supposed to follow standard rules (after the 'compatible'). Root node is just special. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-1-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 70 ++++++++++++++++--- .../bad/dts-child-name-order.dtso | 33 +++++++++ .../bad/dts-digit-node-order.dts | 40 +++++++++++ .../bad/dts-digit-node-order.dtso | 41 +++++++++++ .../bad/dts-extend-node-child-name-order.dtso | 26 +++++++ .../bad/dts-extend-node-digit-node-order.dtso | 34 +++++++++ .../bad/dts-property-order.dts | 15 ++++ .../bad/dts-property-order.dtso | 59 ++++++++++++++++ .../expected/dts-child-name-order.dts.txt | 1 + .../expected/dts-child-name-order.dtso.txt | 3 + .../expected/dts-digit-node-order.dts.txt | 2 + .../expected/dts-digit-node-order.dtso.txt | 2 + .../dts-extend-node-child-name-order.dtso.txt | 2 + .../dts-extend-node-digit-node-order.dtso.txt | 2 + .../expected/dts-property-order.dts.txt | 14 ++-- .../expected/dts-property-order.dtso.txt | 10 +++ .../good/dts-child-name-order.dtso | 44 ++++++++++++ .../good/dts-digit-node-order.dts | 3 - .../good/dts-digit-node-order.dtso | 59 ++++++++++++++++ .../dts-extend-node-child-name-order.dtso | 26 +++++++ .../dts-extend-node-digit-node-order.dtso | 34 +++++++++ .../good/dts-property-order.dts | 5 ++ .../good/dts-property-order.dtso | 47 +++++++++++++ 23 files changed, 554 insertions(+), 18 deletions(-) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt create mode 100644 scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso create mode 100644 scripts/dtc/dt-style-selftest/good/dts-property-order.dtso diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 96deffc0d8a7..5a9985baa051 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -77,24 +77,26 @@ def is_preprocessor(stripped): class DtsLine: - __slots__ = ('lineno', 'raw', 'linetype', 'indent_str', 'stripped', + __slots__ = ('lineno', 'raw', 'linetype', 'indent_str', 'stripped', 'is_root', 'prop_name', 'continuations', - 'node_name', 'node_addr', 'label', 'ref_name', 'depth', + 'node_name', 'node_addr', 'label', 'ref_name', 'parent', 'depth', 'closures') - def __init__(self, lineno, raw, linetype, depth, indent_str, stripped): + def __init__(self, lineno, raw, linetype, depth, indent_str, stripped, is_root = False): self.lineno = lineno # 1-based within the block self.raw = raw self.linetype = linetype self.indent_str = indent_str # leading whitespace as-is self.depth = depth self.stripped = stripped + self.is_root = is_root self.prop_name = None self.continuations = [] self.node_name = None self.node_addr = None self.label = None self.ref_name = None + self.parent = None # DtsLine of parent node self.closures = 1 # count of '}' on a NODE_CLOSE line @@ -228,7 +230,10 @@ def classify_lines(text): continue if code.endswith('{'): - dl = DtsLine(i, raw, LineType.NODE_OPEN, depth, indent_str, code) + is_root = False + if re.search(r'&{/}\s*{', code) or re.search(r'^/\s*\{$', code): + is_root = True + dl = DtsLine(i, raw, LineType.NODE_OPEN, depth, indent_str, code, is_root=is_root) parse_node_header(dl) out.append(dl) depth += 1 @@ -491,16 +496,24 @@ def _walk_bodies(lines): """Yield lists of immediate-child NODE_OPEN lines for each node body in the input. Skips ref-nodes (&label) since those don't have an intrinsic ordering.""" + # Array of stacked nodes (parent/child) body_stack = [[]] + # Current stack of nodes, purely to track parent relationship for each node + node_stack = [] + parent_dl = None for dl in lines: if dl.linetype == LineType.NODE_OPEN: + dl.parent = parent_dl + node_stack.append(dl) body_stack[-1].append(dl) body_stack.append([]) + parent_dl = dl continue if dl.linetype == LineType.NODE_CLOSE: if len(body_stack) <= 1: # Unbalanced; ignore to avoid crashing on malformed input continue + parent_dl = node_stack.pop().parent yield body_stack.pop() continue while body_stack: @@ -521,12 +534,18 @@ def _natural_sort_key(s): def check_child_address_order(ctx): """Addressed siblings (foo@N) must appear in ascending address - order within their parent node body.""" + order within their parent node body. + Exception: Top-level in DTS follows name order, regardless of unit address + in memory@N and soc@N nodes + """ for children in _walk_bodies(ctx.lines): addressed = [] for c in children: if c.node_addr is None: continue + if c.parent and c.parent.is_root: + # Top-level does not use unit address sorting usually + continue try: parts = tuple(int(p, 16) for p in c.node_addr.split(',')) except ValueError: @@ -544,12 +563,16 @@ def check_child_name_order(ctx): """Unaddressed siblings must appear in natural-sort order by node name within their parent node body. Addressed children are scoped by check_child_address_order; reference nodes (&label { ... }) and - the root node are skipped.""" + the root node are skipped. + However root node has children with and without unit address, and + sorting should be only by name.""" for children in _walk_bodies(ctx.lines): unaddressed = [] for c in children: if c.node_addr is not None: - continue + # Skip nodes with unit address, except when sorting top-level + if not c.parent or not c.parent.is_root: + continue if c.node_name in (None, '/'): continue if c.ref_name is not None: @@ -591,6 +614,30 @@ def _property_bucket(name): return (5 if ',' in stripped else 4, None) +def _property_bucket_root(name): + """Return the canonical bucket index for a property: + 0 model (for root nodes only) + 1 compatible + Plus a sub-key inside the bucket for fixed slots (device_type, compatible, + reg, reg-names, ranges, status). 'standard' and 'vendor' return None for + the sub-key, signalling that the within-bucket key is computed by + the pairing rules.""" + stripped = name.lstrip('#') + if name == 'model': + return (0, 0) + if name == 'compatible': + return (1, 0) + if name == 'reg': + return (2, 0) + if name == 'reg-names': + return (2, 1) + if name == 'ranges': + return (3, 0) + if name == 'status': + return (6, 0) + return (5 if ',' in stripped else 4, None) + + # Declarative pairing rules: each is a callable # (name, all_names) -> anchor_name_or_None # If a rule returns an anchor, the property sorts immediately after the @@ -627,13 +674,16 @@ def _pair_x_names(name, all_names): PAIRING_RULES = (_pair_pinctrl_names, _pair_x_names) -def _property_sort_key(name, all_names): +def _property_sort_key(dl, name, all_names): """Sort key for a property among its node-body siblings. Format: (bucket, within_key, tiebreak). 'within_key' for standard/vendor buckets follows pairing rules: a property paired with anchor X sorts as if it were X with a higher tiebreak.""" - bucket, fixed_sub = _property_bucket(name) + if dl.is_root: + bucket, fixed_sub = _property_bucket_root(name) + else: + bucket, fixed_sub = _property_bucket(name) if fixed_sub is not None: return (bucket, (), fixed_sub) @@ -668,7 +718,7 @@ def check_property_order(ctx): if len(props) < 2: continue all_names = [p.prop_name for p in props] - keyed = [(p, _property_sort_key(p.prop_name, all_names)) + keyed = [(p, _property_sort_key(dl, p.prop_name, all_names)) for p in props] for k in range(1, len(keyed)): if keyed[k][1] < keyed[k - 1][1]: diff --git a/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso new file mode 100644 index 000000000000..74b49be69e98 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-child-name-order.dtso @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + pmu { + compatible = "example,pmu"; + + /* Include labels to be sure they do not affect sorting */ + foo: foo { + label = "foo"; + }; + + label_bar: bar { + label = "bar"; + }; + }; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu-2 { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts new file mode 100644 index 000000000000..74c956398324 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dts @@ -0,0 +1,40 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso new file mode 100644 index 000000000000..052c02935a45 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-digit-node-order.dtso @@ -0,0 +1,41 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso new file mode 100644 index 000000000000..d9cf670f19f6 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-child-name-order.dtso @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + pmu { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + foo: foo { + label = "foo"; + }; + + label_bar: bar { + label = "bar"; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso new file mode 100644 index 000000000000..4b2cf60e5a92 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-extend-node-digit-node-order.dtso @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + soc: soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&soc { + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts index f31abb6ceae4..ebe561e38766 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts @@ -6,6 +6,11 @@ /dts-v1/; / { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; + qcom,board-id = <8 0>; + chassis-type = "handset"; + cpus { #address-cells = <1>; #size-cells = <0>; @@ -41,3 +46,13 @@ interrupt-controller@10000 { }; }; }; + +/ { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +}; + +/{ + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso new file mode 100644 index 000000000000..64604fa6b8c3 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Incorrect property order + */ + +/dts-v1/; +/plugin/; + +&{/} { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; + qcom,board-id = <8 0>; + chassis-type = "handset"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + reg = <0x0 0x0>; + compatible = "arm,cortex-a57"; + device_type = "cpu"; + enable-method = "psci"; + }; + }; + + pmu { + compatible = "example,pmu"; + + status = "disabled"; + dma-coherent; + }; + + soc@0 { + ranges = <0 0 0 0xc0000000>; + compatible = "simple-bus"; + + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + reg = <0x10000 0x1000>; + interrupts = <1 2 3>, + <4 5 6>, + <7 8 9>; + compatible = "example,intc"; + }; + }; +}; + +&{/} { + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +}; + +&{/}{ + compatible = "example,test-board", "example,test-soc"; + model = "DT style selftest"; +}; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt index e2eea0862102..312a45ed913a 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dts.txt @@ -1,2 +1,3 @@ # mode=strict bad/dts-child-name-order.dts:16: [child-name-order] child node 'bar' out of name order +bad/dts-child-name-order.dts:21: [child-name-order] child node 'memory' out of name order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt new file mode 100644 index 000000000000..e44ceb24ece8 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-child-name-order.dtso.txt @@ -0,0 +1,3 @@ +# mode=strict +bad/dts-child-name-order.dtso:17: [child-name-order] child node 'bar' out of name order +bad/dts-child-name-order.dtso:22: [child-name-order] child node 'memory' out of name order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt new file mode 100644 index 000000000000..1f41acdea0b0 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dts.txt @@ -0,0 +1,2 @@ +# mode=strict +bad/dts-digit-node-order.dts:29: [child-address-order] child node @10000 out of address order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt new file mode 100644 index 000000000000..21db32f6e639 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-digit-node-order.dtso.txt @@ -0,0 +1,2 @@ +# mode=strict +bad/dts-digit-node-order.dtso:30: [child-address-order] child node @10000 out of address order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt new file mode 100644 index 000000000000..d7941a891135 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-child-name-order.dtso.txt @@ -0,0 +1,2 @@ +# mode=strict +bad/dts-extend-node-child-name-order.dtso:23: [child-name-order] child node 'bar' out of name order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt new file mode 100644 index 000000000000..408796d5bb03 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-extend-node-digit-node-order.dtso.txt @@ -0,0 +1,2 @@ +# mode=strict +bad/dts-extend-node-digit-node-order.dtso:24: [child-address-order] child node @10000 out of address order diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt index 4bc21328625f..aab048a0ba3b 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt @@ -1,6 +1,10 @@ # mode=strict -bad/dts-property-order.dts:15: [property-order] property 'compatible' out of canonical order (should sort before 'reg') -bad/dts-property-order.dts:16: [property-order] property 'device_type' out of canonical order (should sort before 'compatible') -bad/dts-property-order.dts:25: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') -bad/dts-property-order.dts:30: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') -bad/dts-property-order.dts:40: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dts:10: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:12: [property-order] property 'chassis-type' out of canonical order (should sort before 'qcom,board-id') +bad/dts-property-order.dts:20: [property-order] property 'compatible' out of canonical order (should sort before 'reg') +bad/dts-property-order.dts:21: [property-order] property 'device_type' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:30: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') +bad/dts-property-order.dts:35: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') +bad/dts-property-order.dts:45: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dts:52: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:57: [property-order] property 'model' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt new file mode 100644 index 000000000000..e9b3ac985718 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt @@ -0,0 +1,10 @@ +# mode=strict +bad/dts-property-order.dtso:11: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:13: [property-order] property 'chassis-type' out of canonical order (should sort before 'qcom,board-id') +bad/dts-property-order.dtso:21: [property-order] property 'compatible' out of canonical order (should sort before 'reg') +bad/dts-property-order.dtso:22: [property-order] property 'device_type' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:31: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') +bad/dts-property-order.dtso:36: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') +bad/dts-property-order.dtso:46: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dtso:53: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:58: [property-order] property 'model' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso new file mode 100644 index 000000000000..1fd75a6285ce --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-child-name-order.dtso @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + + /* Include labels to be sure they do not affect sorting */ + label_bar: bar { + label = "bar"; + }; + + foo: foo { + label = "foo"; + }; + }; + + pmu-2 { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + label_bar_2: bar-2 { + label = "bar"; + }; + + foo_2: foo-2 { + label = "foo"; + }; +} diff --git a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts index cdf3f91ebe01..2b21dde7f3c8 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dts @@ -5,13 +5,10 @@ / { #address-cells = <1>; #size-cells = <1>; - /* TODO: uncomment when child-address-order is fixed for top-level */ - /* memory@a0000000 { device_type = "memory"; reg = <0x0 0xa0000000 0x0 0x0>; }; - */ pmu { compatible = "example,pmu"; diff --git a/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso new file mode 100644 index 000000000000..efafa1cccc15 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-digit-node-order.dtso @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + memory@a0000000 { + device_type = "memory"; + reg = <0x0 0xa0000000 0x0 0x0>; + }; + + pmu { + compatible = "example,pmu"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; + }; +}; + +&soc { + interrupt-controller@110000 { + compatible = "example,intc"; + reg = <0x110000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@120000 { + compatible = "example,serial"; + reg = <0x120000 0x1000>; + }; + + serial@130000 { + compatible = "example,serial"; + reg = <0x130000 0x1000>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso new file mode 100644 index 000000000000..b00c2a195179 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-extend-node-child-name-order.dtso @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + pmu { + compatible = "example,pmu"; + + /* Just reference labels to avoid strict warnings */ + example,foo = <&foo>, <&label_bar>; + }; +}; + +&pmu { + /* Include labels to be sure they do not affect sorting */ + label_bar: bar { + label = "bar"; + }; + + foo: foo { + label = "foo"; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso new file mode 100644 index 000000000000..1ce18afb80de --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-extend-node-digit-node-order.dtso @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + #address-cells = <1>; + #size-cells = <1>; + + soc: soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + }; +}; + +&soc { + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + + serial@20000 { + compatible = "example,serial"; + reg = <0x20000 0x1000>; + }; + + serial@30000 { + compatible = "example,serial"; + reg = <0x30000 0x1000>; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts index 0e183e3459cd..3d847cc9fa3e 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts @@ -6,6 +6,11 @@ /dts-v1/; / { + model = "DT style selftest"; + compatible = "example,test-board", "example,test-soc"; + chassis-type = "handset"; + qcom,board-id = <8 0>; + cpus { #address-cells = <1>; #size-cells = <0>; diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso new file mode 100644 index 000000000000..5ae78541f68b --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso @@ -0,0 +1,47 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Incorrect property order + */ + +/dts-v1/; +/plugin/; + +&{/} { + model = "DT style selftest"; + compatible = "example,test-board", "example,test-soc"; + chassis-type = "handset"; + qcom,board-id = <8 0>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "arm,cortex-a57"; + reg = <0x0 0x0>; + enable-method = "psci"; + }; + }; + + pmu { + compatible = "example,pmu"; + dma-coherent; + + status = "disabled"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + interrupts = <1 2 3>; + }; + }; +}; From 35c19608562dd5d052901299cd8090017bc750a9 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:54 +0200 Subject: [PATCH 02/72] dtc: dt-check-style: Drop stray backslash before quote for continuation-alignment Drop stray backslash before the quote character in a warning for continuation-alignment rule: (under "<" or \"). Since the '"' character has no quotes, drop the quotes also from '<'. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-2-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 4 ++-- .../dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 5a9985baa051..22e1ceac7f8b 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -948,7 +948,7 @@ def check_continuation_alignment(ctx): if _display_col(cont.indent_str) != target_col: yield (cont.lineno, 'continuation should align to column %d ' - '(under "<" or \\")' % (target_col + 1)) + '(under < or ")' % (target_col + 1)) def check_unclosed_block_comment(ctx): @@ -1052,7 +1052,7 @@ RULES = [ 'lines must not exceed 80 columns', check_line_length), Rule('continuation-alignment', 'strict', - 'multi-line property continuations align under "<" or "\\""', + 'multi-line property continuations align under < or "', check_continuation_alignment), Rule('unused-labels', 'strict', 'every label must be &-referenced in the same example/file ' diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt index b5576dd0f6b1..c0801c56d5db 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt @@ -1,2 +1,2 @@ # mode=strict -bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (under "<" or \") +bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (under < or ") From 98d3da8dc2cc5699a8f39426907cff694acb4aaf Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:55 +0200 Subject: [PATCH 03/72] dtc: dt-check-style: Fix alignment of values in continued property lines Continued lines in property assignments should be indented to opening '<' or '"' if they also start with that character, e.g.: reg = <0x1000 0x100>, <0x2000 0x100>; If the continued line is part of previous phandle, then alignment should be to inner values to make it more readable, e.g.: reg = <0x1000 0x100 0x2000 0x100>; Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-3-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 32 ++++++++++++------- .../dt-style-selftest/bad/dts-cont-align.dts | 26 +++++++++++++++ .../bad/yaml-cont-align.yaml | 6 ++-- .../expected/dts-cont-align.dts.txt | 10 ++++++ .../expected/yaml-cont-align.yaml.txt | 3 +- .../expected/yaml-value-ws-multiline.yaml.txt | 1 + .../dt-style-selftest/good/dts-cont-align.dts | 13 +++++--- .../good/yaml-cont-align.yaml | 32 +++++++++++++++++++ 8 files changed, 104 insertions(+), 19 deletions(-) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 22e1ceac7f8b..eb5045f0ad9e 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -926,10 +926,11 @@ def check_line_length(ctx): def check_continuation_alignment(ctx): """A multi-line property's continuation lines must align their - first non-whitespace character to the display column of the first - '<' or '"' after the '=' in the leading line. Display columns are - used so tab-indented .dts files (where a continuation aligns with - tabs plus spaces) are compared correctly.""" + first non-whitespace character to the display column of: + 1. the first '<' or '"' after the '=' in the leading line, if continuation is with '<' or '"' + 2. the first value, if the continuation is still the same phandle. + Display columns are used so tab-indented .dts files (where a continuation + aligns with tabs plus spaces) are compared correctly.""" for dl in ctx.lines: if dl.linetype != LineType.PROPERTY: continue @@ -938,17 +939,26 @@ def check_continuation_alignment(ctx): eq = dl.raw.find('=') if eq < 0: continue - # First '<' or '"' after '=' - rest = dl.raw[eq + 1:] - m = re.search(r'[<"]', rest) + # First '<' or '"' after '=', but ignore comments and strip trailing + # whitespace (e.g. remaining after removing the comment) + rest = _strip_strings_and_comments(dl.raw[eq + 1:]).rstrip() + m = re.search(r'\s*([<"])', rest) if not m: continue - target_col = _display_col(dl.raw[:eq + 1 + m.start()]) + dl_value_complete = rest.endswith('",') or rest.endswith('>,') + target_col = _display_col(_strip_strings_and_comments(dl.raw[:eq + 1 + m.start(1)])) for cont in dl.continuations: - if _display_col(cont.indent_str) != target_col: + target_offset = 0 + err_msg_explanation = 'to < or "' + if not dl_value_complete: + target_offset = 1 + err_msg_explanation = 'to the value under <' + if _display_col(cont.indent_str) != target_col + target_offset: yield (cont.lineno, 'continuation should align to column %d ' - '(under < or ")' % (target_col + 1)) + '(%s)' % (target_col + target_offset + 1, err_msg_explanation)) + # Align to the value within <> or "" of continuation (so the previous line) + dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,') def check_unclosed_block_comment(ctx): @@ -1052,7 +1062,7 @@ RULES = [ 'lines must not exceed 80 columns', check_line_length), Rule('continuation-alignment', 'strict', - 'multi-line property continuations align under < or "', + 'multi-line property continuations align under <, " or the value under <', check_continuation_alignment), Rule('unused-labels', 'strict', 'every label must be &-referenced in the same example/file ' diff --git a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts new file mode 100644 index 000000000000..5390ebbf4059 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + clocks = <1 2 3>, /* comments with " < , should not matter */ + <4 5 6>, + <7 8 9>; + interrupts = <1 2 3>, /* comments with " < , should not ... */ + <4 5 6>, + <7 8 9>; + pinmux = <0x01 + 0x02>, + <0x03 + 0x04>; + power-domain-names = "foo", + "bar", /* comments with " < , should not */ + "baz"; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml index 92778540b056..ccf443173dca 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml @@ -25,6 +25,8 @@ examples: - | foo@1000 { compatible = "example,test-cont-align"; - reg = <0x1000 0x100>, - <0x2000 0x100>; + reg = <0x1000 0x100>, /* comments with " < , should not matter */ + <0x2000 0x100>, /* comments with " < , should not matter */ + <0x3000 + 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt new file mode 100644 index 000000000000..a7ed62677a2b --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt @@ -0,0 +1,10 @@ +# mode=strict +bad/dts-cont-align.dts:13: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:14: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:16: [continuation-alignment] continuation should align to column 30 (to < or ") +bad/dts-cont-align.dts:17: [continuation-alignment] continuation should align to column 30 (to < or ") +bad/dts-cont-align.dts:19: [continuation-alignment] continuation should align to column 27 (to the value under <) +bad/dts-cont-align.dts:20: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:21: [continuation-alignment] continuation should align to column 27 (to the value under <) +bad/dts-cont-align.dts:23: [continuation-alignment] continuation should align to column 38 (to < or ") +bad/dts-cont-align.dts:24: [continuation-alignment] continuation should align to column 38 (to < or ") diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt index c0801c56d5db..eb9a84d5c222 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt @@ -1,2 +1,3 @@ # mode=strict -bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (under < or ") +bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (to < or ") +bad/yaml-cont-align.yaml:31: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <) diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt index 3df55b1762d0..d25b5b425e3f 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-value-ws-multiline.yaml.txt @@ -1,2 +1,3 @@ # mode=strict bad/yaml-value-ws-multiline.yaml:25: example 0 [value-whitespace] extra whitespace inside <...> +bad/yaml-value-ws-multiline.yaml:26: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <) diff --git a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts index 36fb4eefcd83..b52ee6cccd8c 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts @@ -15,12 +15,15 @@ / { interrupt-controller@10000 { compatible = "example,intc"; reg = <0x10000 0x1000>; - interrupts = <1 2 3>, + interrupts = <1 2 3>, /* comments with " < , should not ... */ <4 5 6>, <7 8 9>; - pinmux = < - 0x01 - 0x02 - >; + pinmux = <0x01 + 0x02>, + <0x03 /* comments with " < , should not matter */ + 0x04>; + power-domain-names = "foo", /* comments with " < , should not */ + "bar", + "baz"; }; }; diff --git a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml new file mode 100644 index 000000000000..2e7b8582bb7c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-good-cont-align.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with aligned multi-line property + +maintainers: + - Test User + +properties: + compatible: + const: example,test-cont-align + reg: + maxItems: 2 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + foo@1000 { + compatible = "example,test-cont-align"; + reg = <0x1000 0x100>, + <0x2000 0x100>, + <0x3000 + 0x100>; + }; From a3b23ea1e3bbc17b1d974dce82ff16d5def368fe Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:56 +0200 Subject: [PATCH 04/72] dtc: dt-check-style: Consistently call 'kind' as 'file_type' Script was using different names for variables or attributes with the same meaning: the type of file (YAML, DTS, DTSI, DTSO). Unify 'kind', 'input_kind' and function input_kind() to consistent 'file_type'. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-4-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index eb5045f0ad9e..17332018d70b 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -314,13 +314,13 @@ def collect_labels_and_refs(text): class Ctx: """Context passed to each rule check. Carries the parsed lines, - raw text, mode and kind.""" + raw text, mode and file_type.""" - def __init__(self, lines, text, mode, kind): + def __init__(self, lines, text, mode, file_type): self.lines = lines self.text = text self.mode = mode # 'relaxed' or 'strict' - if kind in DTS_FAMILY: + if file_type in DTS_FAMILY: self.file_type = 'dts' else: self.file_type = 'yaml' @@ -1071,14 +1071,14 @@ RULES = [ ] -def select_rules(mode, input_kind): +def select_rules(mode, file_type): """Return rules that apply to the given mode and input type.""" rank = {'relaxed': 0, 'strict': 1} out = [] for r in RULES: if rank[r.mode] > rank[mode]: continue - if input_kind not in r.applies_to: + if file_type not in r.applies_to: continue out.append(r) return out @@ -1088,12 +1088,12 @@ def select_rules(mode, input_kind): # Block runner # --------------------------------------------------------------------------- -def check_block(text, mode, input_type): +def check_block(text, mode, file_type): """Run all selected rules on a single block of DTS text. Returns a list of (lineno, rule_name, message) tuples.""" lines = classify_lines(text) - ctx = Ctx(lines, text, mode, input_type) - rules = select_rules(mode, input_type) + ctx = Ctx(lines, text, mode, file_type) + rules = select_rules(mode, file_type) findings = [] for r in rules: for lineno, msg in r.check(ctx): @@ -1150,7 +1150,7 @@ def iter_dts_file(filepath): # Top-level processing # --------------------------------------------------------------------------- -def input_kind(filepath): +def get_file_type(filepath): p = filepath.lower() if p.endswith('.yaml') or p.endswith('.yml'): return 'yaml' @@ -1170,17 +1170,17 @@ DTS_FAMILY = ('dts', 'dtsi', 'dtso') def collect_findings(filepath, mode): """Return a (lines, count) pair for filepath. lines is a list of formatted output strings; count is the number of findings.""" - kind = input_kind(filepath) - if kind == 'yaml': + file_type = get_file_type(filepath) + if file_type == 'yaml': iterator = iter_yaml_examples(filepath) - elif kind in DTS_FAMILY: + elif file_type in DTS_FAMILY: iterator = iter_dts_file(filepath) else: return (['%s: unknown file type, skipping' % filepath], 0) out = [] for text, base, idx in iterator: - for lineno, rule, msg in check_block(text, mode, kind): + for lineno, rule, msg in check_block(text, mode, file_type): abs_line = base + lineno - 1 ex_tag = '' if idx is None else ' example %d' % idx out.append('%s:%d:%s [%s] %s' % From 3a4b642c94e783c7570009c9d26d21d56bec34f0 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:57 +0200 Subject: [PATCH 05/72] dtc: dt-check-style: Introduce 'stricter' mode Two rules, which are enabled in 'strict' mode make little sense for DTS: 1. line-length, limiting length of line to 80 characters: DTS often has a bit longer lines, especially for interconnects or heavily nested opp-level. Checkpatch already does not warn for exceeding 80 characters. 2. unused-labels, discouraging unused labels in DTS or YAML (not DTSI or DTSO): while not harming this leads to many false positives, e.g. unused PMIC regulators in DTS. Introduce another 'mode' of running beside existing relaxed and strict: a 'stricter' one where these two rules are moved for DTS. Intention is to have in-tree DTS passing 'strict' mode. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-5-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 25 +++++++++++++------ .../dt-style-selftest/bad/dts-line-length.dts | 21 ++++++++++++++++ .../bad/dts-unused-label.dts | 21 ++++++++++++++++ .../expected/dts-line-length.dts.txt | 2 ++ .../expected/dts-unused-label.dts.txt | 2 ++ scripts/dtc/dt-style-selftest/run.sh | 2 +- 6 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-line-length.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 17332018d70b..b71e6bf815a7 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -5,12 +5,14 @@ # .dts/.dtsi/.dtso source files. Enforces rules from # Documentation/devicetree/bindings/dts-coding-style.rst. # -# Two modes: +# Three modes: # --mode=relaxed (default) # Only rules that produce zero warnings on the current tree. # Suitable for dt_binding_check. # --mode=strict -# All rules. Required for new submissions. +# Most of the rules. Required for new submissions. +# --mode=stricter +# All rules, including ones having false positives. # # Two input types (auto-detected by file extension): # *.yaml -- DT binding; check each example block @@ -319,7 +321,7 @@ class Ctx: def __init__(self, lines, text, mode, file_type): self.lines = lines self.text = text - self.mode = mode # 'relaxed' or 'strict' + self.mode = mode # 'relaxed', 'strict' or 'stricter' if file_type in DTS_FAMILY: self.file_type = 'dts' else: @@ -332,7 +334,7 @@ class Rule: def __init__(self, name, mode, description, check, applies_to=('yaml', 'dts', 'dtsi', 'dtso')): self.name = name - self.mode = mode # 'relaxed' or 'strict' + self.mode = mode # 'relaxed', 'strict' or 'stricter' self.description = description self.check = check self.applies_to = applies_to # input types this rule covers @@ -1060,20 +1062,27 @@ RULES = [ check_node_close_alone), Rule('line-length', 'strict', 'lines must not exceed 80 columns', - check_line_length), + check_line_length, applies_to=('yaml',)), + Rule('line-length-dts', 'stricter', + 'lines must not exceed 80 columns', + check_line_length, applies_to=('dts', 'dtsi', 'dtso')), Rule('continuation-alignment', 'strict', 'multi-line property continuations align under <, " or the value under <', check_continuation_alignment), Rule('unused-labels', 'strict', 'every label must be &-referenced in the same example/file ' '(skipped for .dtsi/.dtso since labels there are exported)', - check_unused_labels, applies_to=('yaml', 'dts')), + check_unused_labels, applies_to=('yaml',)), + Rule('unused-labels-dts', 'stricter', + 'every label must be &-referenced in the same example/file ' + '(skipped for .dtsi/.dtso since labels there are exported)', + check_unused_labels, applies_to=('dts',)), ] def select_rules(mode, file_type): """Return rules that apply to the given mode and input type.""" - rank = {'relaxed': 0, 'strict': 1} + rank = {'relaxed': 0, 'strict': 1, 'stricter': 2} out = [] for r in RULES: if rank[r.mode] > rank[mode]: @@ -1201,7 +1210,7 @@ def main(): description='Check DTS coding style on YAML examples and ' '.dts/.dtsi/.dtso files.', fromfile_prefix_chars='@') - ap.add_argument('--mode', choices=('relaxed', 'strict'), + ap.add_argument('--mode', choices=('relaxed', 'strict', 'stricter'), default='relaxed', help='which rule set to apply (default: relaxed)') ap.add_argument('-j', '--jobs', type=int, default=0, diff --git a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts new file mode 100644 index 000000000000..bde91a922477 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Line length in DTS + */ + +/dts-v1/; + +/ { + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + foo@1000 { + compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah"; + reg = <0x1000 0x100>; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts b/scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts new file mode 100644 index 000000000000..90802ae107e1 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-unused-label.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/* + * Test fixture: Unused label in DTS + */ + +/dts-v1/; + +/ { + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + dev: device@1000 { + compatible = "example,test-unused-label"; + reg = <0x1000 0x100>; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt new file mode 100644 index 000000000000..8ed08c309632 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt @@ -0,0 +1,2 @@ +# mode=stricter +bad/dts-line-length.dts:17: [line-length-dts] line exceeds 80 columns (101) diff --git a/scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt new file mode 100644 index 000000000000..4cdcaba3ba2f --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-unused-label.dts.txt @@ -0,0 +1,2 @@ +# mode=stricter +bad/dts-unused-label.dts:16: [unused-labels-dts] label 'dev' defined but never &-referenced diff --git a/scripts/dtc/dt-style-selftest/run.sh b/scripts/dtc/dt-style-selftest/run.sh index 8117dd9be90a..5691301d6a4a 100755 --- a/scripts/dtc/dt-style-selftest/run.sh +++ b/scripts/dtc/dt-style-selftest/run.sh @@ -26,7 +26,7 @@ run() { # good/ -- must exit 0 and produce no output in both modes for f in "$here"/good/*; do [ -e "$f" ] || continue - for mode in relaxed strict; do + for mode in relaxed strict stricter; do out=$(run "$f" "$mode") rc=$? if [ -n "$out" ] || [ "$rc" -ne 0 ]; then From 7e17fa6b828385aaa6602d032a51041c30bcdcff Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:58 +0200 Subject: [PATCH 06/72] dtc: dt-check-style: Replace Test User email with Rob Herring scripts/get_maintainer.pl reports email from the example binding fixtures, so let's spare someone at @example.com from receiving bunch of odd emails. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-6-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml | 2 +- .../dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml | 2 +- scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml | 2 +- scripts/dtc/dt-style-selftest/good/yaml-4space.yaml | 2 +- scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml | 2 +- scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml index 3df56e69a1ff..7c3b731e059a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-child-addr-order.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with addressed children out of order maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml index 35d85e5573c2..f3483033859a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-child-name-order.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with unaddressed children out of name order maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml index ccf443173dca..a5a9eb17fc17 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with mis-aligned multi-line property maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml index 44a9d25e5ba0..068542a98576 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-digit-node-order.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with digit-leading nodes out of address order maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml index b26d1bf58de9..c55359a4ca68 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with uppercase hex literals maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml index bee4cf118d73..155060a79887 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-indent-strict.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture using 2-space indent (rejected by strict mode) maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml index ba512869b702..4a69b503af4b 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-label-in-string.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture where a label is only "referenced" inside a string maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml index 64427bf1c385..6e4140e500b5 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture exceeding 80 columns maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml index 5401d1a423a1..c25a0d1a999e 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture mixing tabs and spaces in indent maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml index 4d9fa27b50a2..afc202a698eb 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-multi-close.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with two closing braces on one line maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml index e107659fd9e8..9e714f7e7d47 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-node-close.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with closing brace not on its own line maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml index e2c69e9ff452..c71fb2c0a3e5 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order-device-type.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with device_type maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml index 75582a3d2f6e..bf1480e97209 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with reg before compatible maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml index 767ab21c39f3..51abc540af11 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-pairing.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture exercising -names and pinctrl-names pairing maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml index 8bb53240cffa..0036d5e0c4ea 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-required-blank.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture missing required blank lines maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml index 487d07ff8cb6..937ecdd923b0 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-tab.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with a tab in a DTS line maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml index 2368ada8106f..695d046e8454 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-comment.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with properties out of order behind trailing comments maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml index 5c4b4bd833c5..f338c14174e6 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with trailing whitespace maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml index 63c1c08712a5..191ed775384b 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unclosed-comment.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with an unclosed /* block comment maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml index 9b3fe508c5fd..62590948d2de 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr-prefix.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with 0x-prefixed unit address maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml index 93705cd45410..5bb19fba5c19 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unit-addr.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with malformed unit address maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml index 28d7176cbf08..7f862ae5a175 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-unused-label.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with an unused label maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml index 504bf0931c27..1d7bc8142fd7 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws-multiline.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with extra whitespace in a multi-line cell array maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml index 342ab9f399f1..a5082a158155 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-value-ws.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with extra whitespace inside <...> maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml b/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml index 1502f803c24c..b91b8a8a9512 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-4space.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture for dt-check-style maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml index 2e7b8582bb7c..8463075f9f4c 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Test fixture with aligned multi-line property maintainers: - - Test User + - Rob Herring properties: compatible: diff --git a/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml b/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml index a836d5f36b93..a95d07f883ef 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-tricky-parsing.yaml @@ -17,7 +17,7 @@ description: | not leave the parser in block-comment state. maintainers: - - Test User + - Rob Herring properties: compatible: From e1945a960f35b17bcbcea55dabca76384f6321d4 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:15:59 +0200 Subject: [PATCH 07/72] dtc: dt-check-style: Call _strip_strings_and_comments() only once More than one rule evaluates pure code - stripped from comments and indentation - thus store this pure code in DtsLine class for better performance. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-7-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index b71e6bf815a7..43069fc1fac9 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -79,18 +79,19 @@ def is_preprocessor(stripped): class DtsLine: - __slots__ = ('lineno', 'raw', 'linetype', 'indent_str', 'stripped', 'is_root', + __slots__ = ('lineno', 'raw', 'code', 'linetype', 'indent_str', 'stripped', 'is_root', 'prop_name', 'continuations', 'node_name', 'node_addr', 'label', 'ref_name', 'parent', 'depth', 'closures') def __init__(self, lineno, raw, linetype, depth, indent_str, stripped, is_root = False): self.lineno = lineno # 1-based within the block - self.raw = raw + self.raw = raw # Entire raw line self.linetype = linetype self.indent_str = indent_str # leading whitespace as-is self.depth = depth - self.stripped = stripped + self.stripped = stripped # Code without indentation + self.code = _strip_strings_and_comments(stripped) # Only the code, skipping trailing comments self.is_root = is_root self.prop_name = None self.continuations = [] @@ -811,8 +812,7 @@ def check_hex_case(ctx): LineType.COMMENT_START, LineType.COMMENT_BODY, LineType.COMMENT_END, LineType.PREPROCESSOR): continue - text = _strip_strings_and_comments(dl.raw) - for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', text): + for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): lit = m.group(0) if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': yield (dl.lineno, @@ -860,9 +860,9 @@ def check_value_whitespace(ctx): for dl in ctx.lines: if dl.linetype != LineType.PROPERTY: continue - segs = [_strip_strings_and_comments(dl.raw).strip()] + segs = [dl.code.strip()] for cont in dl.continuations: - segs.append(_strip_strings_and_comments(cont.stripped).strip()) + segs.append(cont.code.strip()) text = '' for s in segs: if not s: @@ -895,8 +895,7 @@ def check_node_close_alone(ctx): LineType.COMMENT_START, LineType.COMMENT_BODY, LineType.COMMENT_END, LineType.PREPROCESSOR): continue - text = _strip_strings_and_comments(dl.raw) - if '};' in text: + if '};' in dl.code: yield (dl.lineno, 'closing brace must be on its own line') From f976e82f64d99c028bb503c4993754d14ea96996 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:16:00 +0200 Subject: [PATCH 08/72] dtc: dt-check-style: Add test for trailing white-space in DTS Add unit tests for expected warnings for trailing white-spaces in DTS (there is only one for YAML files). Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-8-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts | 8 ++++++++ .../dt-style-selftest/expected/dts-trailing-ws.dts.txt | 2 ++ 2 files changed, 10 insertions(+) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt diff --git a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts new file mode 100644 index 000000000000..1eb24d91c640 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; +}; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt new file mode 100644 index 000000000000..94d9ae9d616c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt @@ -0,0 +1,2 @@ +# mode=relaxed +bad/dts-trailing-ws.dts:5: [trailing-whitespace] trailing whitespace From ed47943d94f18bb2ca2995936ae8c06f65fa720e Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:16:01 +0200 Subject: [PATCH 09/72] dtc: dt-check-style: Add warning for redundant white-spaces Show warnings of too many spaces around '=', after ':', before '{' and ';' characters, or using tabs for these. Both in-tree DTS and DT bindings have many warnings for the first case (too mant spaces around '='), thus keep this one only for 'strict' mode. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-9-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 44 +++++++++++++++++++ .../bad/dts-redundant-ws-strict.dts | 27 ++++++++++++ .../bad/dts-redundant-ws.dts | 28 ++++++++++++ .../bad/dts-redundant-ws.dtso | 9 ++++ .../bad/yaml-redundant-ws-strict.yaml | 31 +++++++++++++ .../bad/yaml-redundant-ws.yaml | 35 +++++++++++++++ .../expected/dts-property-order.dts.txt | 1 + .../expected/dts-property-order.dtso.txt | 1 + .../expected/dts-redundant-ws-strict.dts.txt | 13 ++++++ .../expected/dts-redundant-ws.dts.txt | 10 +++++ .../expected/dts-redundant-ws.dtso.txt | 2 + .../yaml-redundant-ws-strict.yaml.txt | 5 +++ .../expected/yaml-redundant-ws.yaml.txt | 4 ++ 13 files changed, 210 insertions(+) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso create mode 100644 scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml create mode 100644 scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 43069fc1fac9..487e76b85105 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -349,6 +349,42 @@ def check_trailing_whitespace(ctx): yield (dl.lineno, 'trailing whitespace') +def _check_redundant_whitespace(dl): + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.COMMENT_START, + LineType.PREPROCESSOR): + return + if re.search(r'(\s\s+|\t)\{', dl.code): + yield (dl.lineno, 'extra whitespace before {') + if re.search(r':(\s\s+|\t)', dl.code): + yield (dl.lineno, 'extra whitespace after :') + if re.search(r'\s+;', dl.code): + yield (dl.lineno, 'extra whitespace before ;') + + +def check_redundant_whitespace(ctx): + """No whitespace between brackets or other code elements. + See also check_value_whitespace() for more checks.""" + for dl in ctx.lines: + yield from _check_redundant_whitespace(dl) + for cont in dl.continuations: + yield from _check_redundant_whitespace(cont) + + +def check_redundant_whitespace_strict(ctx): + """No whitespace between brackets or other code elements. + See also check_value_whitespace() for more checks.""" + for dl in ctx.lines: + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.COMMENT_START, + LineType.PREPROCESSOR): + continue + if re.search(r'(\s\s+|\t)=', dl.code): + yield (dl.lineno, 'extra whitespace before =') + if re.search(r'=(\s\s+|\t)', dl.code): + yield (dl.lineno, 'extra whitespace after =') + + def check_tab_in_yaml_example(ctx): """Reject literal tabs in DTS lines when input is YAML. @@ -1003,6 +1039,10 @@ RULES = [ Rule('trailing-whitespace', 'relaxed', 'no trailing whitespace on any line', check_trailing_whitespace), + # See also check_redundant_whitespace_strict() and check_value_whitespace() + Rule('redundant-whitespace', 'relaxed', + 'no redundant whitespace within code', + check_redundant_whitespace), Rule('tab-in-yaml', 'relaxed', 'YAML (also DTS examples) may not contain tab characters', check_tab_in_yaml_example, applies_to=('yaml',)), @@ -1053,6 +1093,10 @@ RULES = [ Rule('unit-address-format', 'strict', 'unit addresses must be lowercase hex without leading zeros', check_unit_address_format), + # See also check_redundant_whitespace() and check_value_whitespace() + Rule('redundant-whitespace-strict', 'strict', + 'no redundant whitespace within code', + check_redundant_whitespace_strict), Rule('value-whitespace', 'strict', 'no whitespace directly inside <...> brackets', check_value_whitespace), diff --git a/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts new file mode 100644 index 000000000000..201e3940ba1c --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws-strict.dts @@ -0,0 +1,27 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +#define SOME_MACRO(foo) \ + (foo) ? <1> : <2> ; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + /* comments { are okay = though ; */ + soc: soc@0 { /* comments { are okay = though ; */ + compatible = "simple-bus"; /* comments { are okay = though ; */ + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + } ; +}; /* comments { are okay = though ; */ + +&soc { + serial: serial@20000 { /* comments { are okay = though ; */ + compatible = "example,serial"; + reg = <0x20000 0x1000>; + } ; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts new file mode 100644 index 000000000000..f6480ddc508a --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dts @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +#define SOME_MACRO(foo) \ + (foo) ? <1> : <2> ; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + /* comments { are okay = though ; */ + soc: soc@0 { /* comments { are okay = though ; */ + compatible = "simple-bus"; /* comments { are okay = though ; */ + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + } ; +}; /* comments { are okay = though ; */ + +&soc { + serial: serial@20000 { /* comments { are okay = though ; */ + compatible = "example,serial"; + reg = <0x20000 0x1000>, + <0x30000 0x1000> ; + } ; /* comments { are okay = though ; */ +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso new file mode 100644 index 000000000000..01d94e14071a --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-redundant-ws.dtso @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; +/plugin/; + +&{/} { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml new file mode 100644 index 000000000000..739c44fd7217 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws-strict.yaml @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/yaml-redundant-ws-strict.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with redundant whitespace + +maintainers: + - Rob Herring + +properties: + compatible: + const: example,test-redundant + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + device@1000 { + compatible = "example,test-trailing"; + reg = <0x1000 0x100>; + clocks = <&clk 0>; /* comments { are okay = though ; */ + clock-names = "bus"; /* comments { are okay = though ; */ + } ; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml new file mode 100644 index 000000000000..b2f51969b0ff --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-redundant-ws.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/yaml-redundant-ws.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with redundant whitespace + +maintainers: + - Rob Herring + +properties: + compatible: + const: example,test-redundant + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + device@1000 { /* comments { are okay = though ; */ + compatible = "example,test-trailing"; + reg = <0x1000 0x100>, + <0x3000 0x100> ; + } ; + + device@2000 { /* comments { are okay = though ; */ + compatible = "example,test-trailing"; + reg = <0x2000 0x100>; + }; /* comments { are okay = though ; */ diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt index aab048a0ba3b..0ab832ccf07a 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt @@ -6,5 +6,6 @@ bad/dts-property-order.dts:21: [property-order] property 'device_type' out of ca bad/dts-property-order.dts:30: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') bad/dts-property-order.dts:35: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') bad/dts-property-order.dts:45: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dts:50: [redundant-whitespace] extra whitespace before { bad/dts-property-order.dts:52: [property-order] property 'model' out of canonical order (should sort before 'compatible') bad/dts-property-order.dts:57: [property-order] property 'model' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt index e9b3ac985718..9f2a00916329 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt @@ -6,5 +6,6 @@ bad/dts-property-order.dtso:22: [property-order] property 'device_type' out of c bad/dts-property-order.dtso:31: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') bad/dts-property-order.dtso:36: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') bad/dts-property-order.dtso:46: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') +bad/dts-property-order.dtso:51: [redundant-whitespace] extra whitespace before { bad/dts-property-order.dtso:53: [property-order] property 'model' out of canonical order (should sort before 'compatible') bad/dts-property-order.dtso:58: [property-order] property 'model' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt new file mode 100644 index 000000000000..ac0d57bdecdf --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws-strict.dts.txt @@ -0,0 +1,13 @@ +# mode=strict +bad/dts-redundant-ws-strict.dts:7: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:13: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:13: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws-strict.dts:17: [redundant-whitespace-strict] extra whitespace before = +bad/dts-redundant-ws-strict.dts:18: [redundant-whitespace-strict] extra whitespace after = +bad/dts-redundant-ws-strict.dts:19: [redundant-whitespace] extra whitespace before ; +bad/dts-redundant-ws-strict.dts:22: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:23: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws-strict.dts:23: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws-strict.dts:24: [redundant-whitespace-strict] extra whitespace before = +bad/dts-redundant-ws-strict.dts:25: [redundant-whitespace-strict] extra whitespace after = +bad/dts-redundant-ws-strict.dts:26: [redundant-whitespace] extra whitespace before ; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt new file mode 100644 index 000000000000..3b2a989045ed --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dts.txt @@ -0,0 +1,10 @@ +# mode=relaxed +bad/dts-redundant-ws.dts:7: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:13: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:13: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws.dts:19: [redundant-whitespace] extra whitespace before ; +bad/dts-redundant-ws.dts:22: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:23: [redundant-whitespace] extra whitespace before { +bad/dts-redundant-ws.dts:23: [redundant-whitespace] extra whitespace after : +bad/dts-redundant-ws.dts:26: [redundant-whitespace] extra whitespace before ; +bad/dts-redundant-ws.dts:27: [redundant-whitespace] extra whitespace before ; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt new file mode 100644 index 000000000000..5f9a63061709 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-redundant-ws.dtso.txt @@ -0,0 +1,2 @@ +# mode=strict +bad/dts-redundant-ws.dtso:5: [redundant-whitespace] extra whitespace before { diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt new file mode 100644 index 000000000000..fbf323832c91 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws-strict.yaml.txt @@ -0,0 +1,5 @@ +# mode=strict +bad/yaml-redundant-ws-strict.yaml:26: example 0 [redundant-whitespace] extra whitespace before { +bad/yaml-redundant-ws-strict.yaml:27: example 0 [redundant-whitespace-strict] extra whitespace before = +bad/yaml-redundant-ws-strict.yaml:28: example 0 [redundant-whitespace-strict] extra whitespace after = +bad/yaml-redundant-ws-strict.yaml:31: example 0 [redundant-whitespace] extra whitespace before ; diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt new file mode 100644 index 000000000000..a162967e4336 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-redundant-ws.yaml.txt @@ -0,0 +1,4 @@ +# mode=relaxed +bad/yaml-redundant-ws.yaml:26: example 0 [redundant-whitespace] extra whitespace before { +bad/yaml-redundant-ws.yaml:29: example 0 [redundant-whitespace] extra whitespace before ; +bad/yaml-redundant-ws.yaml:30: example 0 [redundant-whitespace] extra whitespace before ; From 50a0e8d6481ea4f5c204c4a3743fcac502f38fc1 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 29 Aug 2026 21:53:17 +0200 Subject: [PATCH 10/72] dtc: dt-check-style: Sort rule directory by name Sort the array with all the rules, so managing this will be at bit easier and simultaneous addons of new rules less conflict-prone. No functional changes. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260829-dts-style-checker-sort-v1-1-6693a37d7ae1@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 95 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 487e76b85105..49b5c28563eb 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -1036,22 +1036,7 @@ RULES = [ # 'relaxed' is the default; rules in this group must produce zero # output on a clean kernel tree (post the small prep-cleanup # commit at the head of this series). - Rule('trailing-whitespace', 'relaxed', - 'no trailing whitespace on any line', - check_trailing_whitespace), - # See also check_redundant_whitespace_strict() and check_value_whitespace() - Rule('redundant-whitespace', 'relaxed', - 'no redundant whitespace within code', - check_redundant_whitespace), - Rule('tab-in-yaml', 'relaxed', - 'YAML (also DTS examples) may not contain tab characters', - check_tab_in_yaml_example, applies_to=('yaml',)), - Rule('mixed-indent-chars', 'relaxed', - 'indent must not mix tabs and spaces', - check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')), - Rule('unclosed-block-comment', 'relaxed', - 'every /* block comment must close with */', - check_unclosed_block_comment), + # Rules are sorted here by group (relaxed, strict, stricter) and name # DTS files always use tabs; this is not negotiable per kernel # coding style (.dts files are real source). Relaxed mode. @@ -1059,19 +1044,26 @@ RULES = [ 'DTS files: 1 tab per nesting level', check_indent_unit_dts, applies_to=('dts', 'dtsi', 'dtso')), + Rule('mixed-indent-chars', 'relaxed', + 'indent must not mix tabs and spaces', + check_mixed_indent_chars, applies_to=('dts', 'dtsi', 'dtso')), + # See also check_redundant_whitespace_strict() and check_value_whitespace() + Rule('redundant-whitespace', 'relaxed', + 'no redundant whitespace within code', + check_redundant_whitespace), + Rule('tab-in-yaml', 'relaxed', + 'YAML (also DTS examples) may not contain tab characters', + check_tab_in_yaml_example, applies_to=('yaml',)), + Rule('trailing-whitespace', 'relaxed', + 'no trailing whitespace on any line', + check_trailing_whitespace), + Rule('unclosed-block-comment', 'relaxed', + 'every /* block comment must close with */', + check_unclosed_block_comment), # 'strict' rules are opt-in (e.g. for new submissions via # checkpatch.pl in a follow-up series). They flag many existing # files and can be promoted to relaxed once those are cleaned up. - Rule('indent-unit', 'strict', - 'YAML: 2 or 4 spaces per level', - check_indent_unit_relaxed, applies_to=('yaml',)), - Rule('indent-unit-strict', 'strict', - 'YAML: must be 4 spaces per level', - check_indent_unit_strict, applies_to=('yaml',)), - Rule('indent-consistent', 'strict', - 'every line indented at depth * unit', - check_indent_consistent), Rule('blank-lines', 'strict', 'no consecutive blanks; no blanks at node body edges', check_blank_lines), @@ -1081,37 +1073,43 @@ RULES = [ Rule('child-name-order', 'strict', 'unaddressed siblings must be in natural-sort name order', check_child_name_order), - Rule('property-order', 'strict', - 'canonical bucket + pairing + natural-sort order of properties', - check_property_order), - Rule('required-blank-lines', 'strict', - 'blank line before child nodes and before "status"', - check_required_blank_lines), + Rule('continuation-alignment', 'strict', + 'multi-line property continuations align under <, " or the value under <', + check_continuation_alignment), Rule('hex-case', 'strict', 'hex literals must be lowercase', check_hex_case), - Rule('unit-address-format', 'strict', - 'unit addresses must be lowercase hex without leading zeros', - check_unit_address_format), - # See also check_redundant_whitespace() and check_value_whitespace() - Rule('redundant-whitespace-strict', 'strict', - 'no redundant whitespace within code', - check_redundant_whitespace_strict), - Rule('value-whitespace', 'strict', - 'no whitespace directly inside <...> brackets', - check_value_whitespace), - Rule('node-close-alone', 'strict', - 'closing brace must be on its own line', - check_node_close_alone), + Rule('indent-consistent', 'strict', + 'every line indented at depth * unit', + check_indent_consistent), + Rule('indent-unit', 'strict', + 'YAML: 2 or 4 spaces per level', + check_indent_unit_relaxed, applies_to=('yaml',)), + Rule('indent-unit-strict', 'strict', + 'YAML: must be 4 spaces per level', + check_indent_unit_strict, applies_to=('yaml',)), Rule('line-length', 'strict', 'lines must not exceed 80 columns', check_line_length, applies_to=('yaml',)), Rule('line-length-dts', 'stricter', 'lines must not exceed 80 columns', check_line_length, applies_to=('dts', 'dtsi', 'dtso')), - Rule('continuation-alignment', 'strict', - 'multi-line property continuations align under <, " or the value under <', - check_continuation_alignment), + Rule('node-close-alone', 'strict', + 'closing brace must be on its own line', + check_node_close_alone), + Rule('property-order', 'strict', + 'canonical bucket + pairing + natural-sort order of properties', + check_property_order), + # See also check_redundant_whitespace() and check_value_whitespace() + Rule('redundant-whitespace-strict', 'strict', + 'no redundant whitespace within code', + check_redundant_whitespace_strict), + Rule('required-blank-lines', 'strict', + 'blank line before child nodes and before "status"', + check_required_blank_lines), + Rule('unit-address-format', 'strict', + 'unit addresses must be lowercase hex without leading zeros', + check_unit_address_format), Rule('unused-labels', 'strict', 'every label must be &-referenced in the same example/file ' '(skipped for .dtsi/.dtso since labels there are exported)', @@ -1120,6 +1118,9 @@ RULES = [ 'every label must be &-referenced in the same example/file ' '(skipped for .dtsi/.dtso since labels there are exported)', check_unused_labels, applies_to=('dts',)), + Rule('value-whitespace', 'strict', + 'no whitespace directly inside <...> brackets', + check_value_whitespace), ] From f7ec3884072509b92588c402dd21e53a6dff8f9a Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 29 Aug 2026 21:53:18 +0200 Subject: [PATCH 11/72] dtc: dt-check-style: Sort rule functions by name Sort all the functions implementing style rules by name, so managing this will be at bit easier and simultaneous addons of new rules less conflict-prone. No functional changes, except adding underscore to _detect_indent_unit() to match other helpers used by the rules. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260829-dts-style-checker-sort-v1-2-6693a37d7ae1@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 607 +++++++++++++++++++------------------ 1 file changed, 304 insertions(+), 303 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 49b5c28563eb..5385a03f377e 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -343,88 +343,8 @@ class Rule: # --- individual rule check functions -------------------------------------- -def check_trailing_whitespace(ctx): - for dl in ctx.lines: - if dl.raw != dl.raw.rstrip(): - yield (dl.lineno, 'trailing whitespace') - -def _check_redundant_whitespace(dl): - if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.COMMENT_START, - LineType.PREPROCESSOR): - return - if re.search(r'(\s\s+|\t)\{', dl.code): - yield (dl.lineno, 'extra whitespace before {') - if re.search(r':(\s\s+|\t)', dl.code): - yield (dl.lineno, 'extra whitespace after :') - if re.search(r'\s+;', dl.code): - yield (dl.lineno, 'extra whitespace before ;') - - -def check_redundant_whitespace(ctx): - """No whitespace between brackets or other code elements. - See also check_value_whitespace() for more checks.""" - for dl in ctx.lines: - yield from _check_redundant_whitespace(dl) - for cont in dl.continuations: - yield from _check_redundant_whitespace(cont) - - -def check_redundant_whitespace_strict(ctx): - """No whitespace between brackets or other code elements. - See also check_value_whitespace() for more checks.""" - for dl in ctx.lines: - if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.COMMENT_START, - LineType.PREPROCESSOR): - continue - if re.search(r'(\s\s+|\t)=', dl.code): - yield (dl.lineno, 'extra whitespace before =') - if re.search(r'=(\s\s+|\t)', dl.code): - yield (dl.lineno, 'extra whitespace after =') - - -def check_tab_in_yaml_example(ctx): - """Reject literal tabs in DTS lines when input is YAML. - - For YAML examples, indent and content must use spaces. Tabs inside - a #define value are tolerated (those are CPP macros, not DTS). - For .dts files, this rule does not apply -- tabs are required. - """ - if ctx.file_type != 'yaml': - return - for dl in ctx.lines: - if dl.linetype == LineType.PREPROCESSOR: - continue - if dl.linetype == LineType.BLANK: - continue - if '\t' in dl.raw: - yield (dl.lineno, 'tab character not allowed in DTS example') - - -def check_mixed_indent_chars(ctx): - """Indent must be all-tabs, except for aligning indentation (comments - or continued lines).""" - for dl in ctx.lines: - if not dl.indent_str: - continue - if dl.linetype == LineType.PREPROCESSOR: - continue - if re.search(r' \t', dl.indent_str): - yield (dl.lineno, 'mixed tabs and spaces in indent') - if dl.indent_str.count(' ') > 7: - yield (dl.lineno, 'too many space characters in indent (more than 7)') - for cont in dl.continuations: - if not cont.indent_str: - continue - if cont.linetype == LineType.PREPROCESSOR: - continue - if re.search(r' \t', cont.indent_str): - yield (cont.lineno, 'mixed tabs and spaces in indent') - - -def detect_indent_unit(ctx): +def _detect_indent_unit(ctx): """Find the indent unit used at depth 1 in this block. Returns tuple of string (one of: ' ' (2 spaces), ' ' (4 spaces), @@ -450,85 +370,42 @@ def detect_indent_unit(ctx): return (None, None) -def check_indent_unit_relaxed(ctx): - """YAML examples: 2 or 4 spaces. Never tabs or other widths.""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if unit not in (' ', ' '): - yield (lineno, 'indent unit must be 2 or 4 spaces, got %r' % unit) +def _display_col(text): + """Visual column width of text, with tabs expanded to the next + 8-column stop, matching how printf and most editors render a + line and the kernel-wide line length convention.""" + col = 0 + for ch in text: + if ch == '\t': + col = (col // 8 + 1) * 8 + else: + col += 1 + return col -def check_indent_unit_dts(ctx): - """DTS files: 1 tab per level. Always required.""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if unit != '\t': - yield (lineno, 'indent unit must be 1 tab in DTS, got %r' % unit) +def _natural_sort_key(s): + """Split a string into a tuple of (kind, value) pairs that compares + numeric runs as ints, so 'foo10' sorts after 'foo2'.""" + parts = [] + for part in re.split(r'(\d+)', s): + if part.isdigit(): + parts.append((0, int(part))) + else: + parts.append((1, part)) + return tuple(parts) -def check_indent_unit_strict(ctx): - """YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed).""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if ctx.file_type == 'yaml': - if unit != ' ': - yield (lineno, 'indent unit must be 4 spaces in strict mode, ' - 'got %r' % unit) - - -def check_indent_consistent(ctx): - """All indented lines must be a multiple of the detected unit.""" - (unit, lineno) = detect_indent_unit(ctx) - if unit is None: - return - if ctx.file_type == 'yaml': - if unit not in (' ', ' '): - return # let check_indent_unit_* report this - else: - if unit != '\t': - return - - for dl in ctx.lines: - if dl.linetype in (LineType.BLANK, LineType.PREPROCESSOR): - continue - if dl.linetype == LineType.CONTINUATION: - continue # continuations align to <, not to indent unit - if dl.linetype in (LineType.COMMENT_BODY, LineType.COMMENT_END): - continue - if not dl.indent_str: - continue - # The indent must be 'unit' repeated dl.depth times, exactly. - # NODE_CLOSE lines have depth equal to the post-decrement value, - # which matches the indent expected. - expected = unit * dl.depth - if dl.indent_str != expected: - yield (dl.lineno, - 'indent mismatch (expected depth %d * %r)' % - (dl.depth, unit)) - - -def check_blank_lines(ctx): - """No two consecutive blank lines, no leading/trailing blank lines - in any node body.""" - lines = ctx.lines - # Consecutive blanks - for i in range(1, len(lines)): - if lines[i].linetype == LineType.BLANK and \ - lines[i - 1].linetype == LineType.BLANK: - yield (lines[i].lineno, 'consecutive blank lines') - # Blank right after { or right before } - for i, dl in enumerate(lines): - if dl.linetype != LineType.BLANK: - continue - prev = lines[i - 1] if i > 0 else None - nxt = lines[i + 1] if i + 1 < len(lines) else None - if prev is not None and prev.linetype == LineType.NODE_OPEN: - yield (dl.lineno, 'blank line at start of node body') - if nxt is not None and nxt.linetype == LineType.NODE_CLOSE: - yield (dl.lineno, 'blank line at end of node body') +def _strip_strings_and_comments(text): + """Remove string literals and /* */ + // comments from a single + line, replacing them with empty strings. Used so syntactic checks + (whitespace, hex case, etc.) don't false-positive on contents of + quoted strings or comments. An unclosed /* on the line is treated + as a comment running to end of line.""" + text = re.sub(r'"(?:[^"\\]|\\.)*"', '""', text) + text = re.sub(r'/\*.*?\*/', '', text) + text = re.sub(r'/\*.*$', '', text) + text = re.sub(r'//.*$', '', text) + return text def _walk_bodies(lines): @@ -559,16 +436,25 @@ def _walk_bodies(lines): yield body_stack.pop() -def _natural_sort_key(s): - """Split a string into a tuple of (kind, value) pairs that compares - numeric runs as ints, so 'foo10' sorts after 'foo2'.""" - parts = [] - for part in re.split(r'(\d+)', s): - if part.isdigit(): - parts.append((0, int(part))) - else: - parts.append((1, part)) - return tuple(parts) +def check_blank_lines(ctx): + """No two consecutive blank lines, no leading/trailing blank lines + in any node body.""" + lines = ctx.lines + # Consecutive blanks + for i in range(1, len(lines)): + if lines[i].linetype == LineType.BLANK and \ + lines[i - 1].linetype == LineType.BLANK: + yield (lines[i].lineno, 'consecutive blank lines') + # Blank right after { or right before } + for i, dl in enumerate(lines): + if dl.linetype != LineType.BLANK: + continue + prev = lines[i - 1] if i > 0 else None + nxt = lines[i + 1] if i + 1 < len(lines) else None + if prev is not None and prev.linetype == LineType.NODE_OPEN: + yield (dl.lineno, 'blank line at start of node body') + if nxt is not None and nxt.linetype == LineType.NODE_CLOSE: + yield (dl.lineno, 'blank line at end of node body') def check_child_address_order(ctx): @@ -624,6 +510,172 @@ def check_child_name_order(ctx): 'child node %r out of name order' % dl.node_name) +def check_continuation_alignment(ctx): + """A multi-line property's continuation lines must align their + first non-whitespace character to the display column of: + 1. the first '<' or '"' after the '=' in the leading line, if continuation is with '<' or '"' + 2. the first value, if the continuation is still the same phandle. + Display columns are used so tab-indented .dts files (where a continuation + aligns with tabs plus spaces) are compared correctly.""" + for dl in ctx.lines: + if dl.linetype != LineType.PROPERTY: + continue + if not dl.continuations: + continue + eq = dl.raw.find('=') + if eq < 0: + continue + # First '<' or '"' after '=', but ignore comments and strip trailing + # whitespace (e.g. remaining after removing the comment) + rest = _strip_strings_and_comments(dl.raw[eq + 1:]).rstrip() + m = re.search(r'\s*([<"])', rest) + if not m: + continue + dl_value_complete = rest.endswith('",') or rest.endswith('>,') + target_col = _display_col(_strip_strings_and_comments(dl.raw[:eq + 1 + m.start(1)])) + for cont in dl.continuations: + target_offset = 0 + err_msg_explanation = 'to < or "' + if not dl_value_complete: + target_offset = 1 + err_msg_explanation = 'to the value under <' + if _display_col(cont.indent_str) != target_col + target_offset: + yield (cont.lineno, + 'continuation should align to column %d ' + '(%s)' % (target_col + target_offset + 1, err_msg_explanation)) + # Align to the value within <> or "" of continuation (so the previous line) + dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,') + + +def check_hex_case(ctx): + """Hex literals (0xN) must use lowercase digits and prefix.""" + for dl in ctx.lines: + if dl.linetype in (LineType.BLANK, LineType.COMMENT, + LineType.COMMENT_START, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.PREPROCESSOR): + continue + for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): + lit = m.group(0) + if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': + yield (dl.lineno, + 'hex literal %r must be lowercase' % lit) + + +def check_indent_consistent(ctx): + """All indented lines must be a multiple of the detected unit.""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if ctx.file_type == 'yaml': + if unit not in (' ', ' '): + return # let check_indent_unit_* report this + else: + if unit != '\t': + return + + for dl in ctx.lines: + if dl.linetype in (LineType.BLANK, LineType.PREPROCESSOR): + continue + if dl.linetype == LineType.CONTINUATION: + continue # continuations align to <, not to indent unit + if dl.linetype in (LineType.COMMENT_BODY, LineType.COMMENT_END): + continue + if not dl.indent_str: + continue + # The indent must be 'unit' repeated dl.depth times, exactly. + # NODE_CLOSE lines have depth equal to the post-decrement value, + # which matches the indent expected. + expected = unit * dl.depth + if dl.indent_str != expected: + yield (dl.lineno, + 'indent mismatch (expected depth %d * %r)' % + (dl.depth, unit)) + + +def check_indent_unit_dts(ctx): + """DTS files: 1 tab per level. Always required.""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if unit != '\t': + yield (lineno, 'indent unit must be 1 tab in DTS, got %r' % unit) + + +def check_indent_unit_relaxed(ctx): + """YAML examples: 2 or 4 spaces. Never tabs or other widths.""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if unit not in (' ', ' '): + yield (lineno, 'indent unit must be 2 or 4 spaces, got %r' % unit) + + +def check_indent_unit_strict(ctx): + """YAML: must be exactly 4 spaces. DTS: 1 tab (same as relaxed).""" + (unit, lineno) = _detect_indent_unit(ctx) + if unit is None: + return + if ctx.file_type == 'yaml': + if unit != ' ': + yield (lineno, 'indent unit must be 4 spaces in strict mode, ' + 'got %r' % unit) + + +def check_line_length(ctx): + """Lines must not exceed 80 columns; tabs count as 8 (see + _display_col).""" + for dl in ctx.lines: + if dl.linetype == LineType.BLANK: + continue + cols = _display_col(dl.raw) + if cols > 80: + yield (dl.lineno, + 'line exceeds 80 columns (%d)' % cols) + + +def check_mixed_indent_chars(ctx): + """Indent must be all-tabs, except for aligning indentation (comments + or continued lines).""" + for dl in ctx.lines: + if not dl.indent_str: + continue + if dl.linetype == LineType.PREPROCESSOR: + continue + if re.search(r' \t', dl.indent_str): + yield (dl.lineno, 'mixed tabs and spaces in indent') + if dl.indent_str.count(' ') > 7: + yield (dl.lineno, 'too many space characters in indent (more than 7)') + for cont in dl.continuations: + if not cont.indent_str: + continue + if cont.linetype == LineType.PREPROCESSOR: + continue + if re.search(r' \t', cont.indent_str): + yield (cont.lineno, 'mixed tabs and spaces in indent') + + +def check_node_close_alone(ctx): + """The closing '};' of a node must be on its own line. The + classifier accepts a canonical "}" or "};" as NODE_CLOSE; a line + that is all closures (e.g. "}; };") is still NODE_CLOSE for depth + tracking but is flagged here via dl.closures. Any other line that + still contains '};' (in code, not in strings or comments) is + mixing a node close with something else.""" + for dl in ctx.lines: + if dl.linetype == LineType.NODE_CLOSE: + if dl.closures > 1: + yield (dl.lineno, + 'closing brace must be on its own line') + continue + if dl.linetype in (LineType.BLANK, LineType.COMMENT, + LineType.COMMENT_START, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.PREPROCESSOR): + continue + if '};' in dl.code: + yield (dl.lineno, + 'closing brace must be on its own line') + + def _property_bucket(name): """Return the canonical bucket index for a property: 0 device_type @@ -769,17 +821,40 @@ def check_property_order(ctx): (p.prop_name, prev.prop_name)) -def _strip_strings_and_comments(text): - """Remove string literals and /* */ + // comments from a single - line, replacing them with empty strings. Used so syntactic checks - (whitespace, hex case, etc.) don't false-positive on contents of - quoted strings or comments. An unclosed /* on the line is treated - as a comment running to end of line.""" - text = re.sub(r'"(?:[^"\\]|\\.)*"', '""', text) - text = re.sub(r'/\*.*?\*/', '', text) - text = re.sub(r'/\*.*$', '', text) - text = re.sub(r'//.*$', '', text) - return text +def _check_redundant_whitespace(dl): + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.COMMENT_START, + LineType.PREPROCESSOR): + return + if re.search(r'(\s\s+|\t)\{', dl.code): + yield (dl.lineno, 'extra whitespace before {') + if re.search(r':(\s\s+|\t)', dl.code): + yield (dl.lineno, 'extra whitespace after :') + if re.search(r'\s+;', dl.code): + yield (dl.lineno, 'extra whitespace before ;') + + +def check_redundant_whitespace(ctx): + """No whitespace between brackets or other code elements. + See also check_value_whitespace() for more checks.""" + for dl in ctx.lines: + yield from _check_redundant_whitespace(dl) + for cont in dl.continuations: + yield from _check_redundant_whitespace(cont) + + +def check_redundant_whitespace_strict(ctx): + """No whitespace between brackets or other code elements. + See also check_value_whitespace() for more checks.""" + for dl in ctx.lines: + if dl.linetype in (LineType.COMMENT, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.COMMENT_START, + LineType.PREPROCESSOR): + continue + if re.search(r'(\s\s+|\t)=', dl.code): + yield (dl.lineno, 'extra whitespace before =') + if re.search(r'=(\s\s+|\t)', dl.code): + yield (dl.lineno, 'extra whitespace after =') def check_required_blank_lines(ctx): @@ -841,18 +916,49 @@ def check_required_blank_lines(ctx): between_blanks = 0 -def check_hex_case(ctx): - """Hex literals (0xN) must use lowercase digits and prefix.""" +def check_tab_in_yaml_example(ctx): + """Reject literal tabs in DTS lines when input is YAML. + + For YAML examples, indent and content must use spaces. Tabs inside + a #define value are tolerated (those are CPP macros, not DTS). + For .dts files, this rule does not apply -- tabs are required. + """ + if ctx.file_type != 'yaml': + return for dl in ctx.lines: - if dl.linetype in (LineType.BLANK, LineType.COMMENT, - LineType.COMMENT_START, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.PREPROCESSOR): + if dl.linetype == LineType.PREPROCESSOR: continue - for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): - lit = m.group(0) - if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': - yield (dl.lineno, - 'hex literal %r must be lowercase' % lit) + if dl.linetype == LineType.BLANK: + continue + if '\t' in dl.raw: + yield (dl.lineno, 'tab character not allowed in DTS example') + + +def check_trailing_whitespace(ctx): + for dl in ctx.lines: + if dl.raw != dl.raw.rstrip(): + yield (dl.lineno, 'trailing whitespace') + + +def check_unclosed_block_comment(ctx): + """Every /* must have a matching */ in the same block. Catches both + a comment opened on its own line (COMMENT_START) and a tail comment + opened on a PROPERTY or other code line (where in_block_comment is + set by _split_code so the next line becomes COMMENT_BODY without a + preceding COMMENT_START).""" + open_lineno = None + for dl in ctx.lines: + if dl.linetype == LineType.COMMENT_START: + open_lineno = dl.lineno + elif dl.linetype == LineType.COMMENT_END: + open_lineno = None + elif dl.linetype == LineType.COMMENT_BODY and open_lineno is None: + # Block was opened by a /* tail on a code line; report at + # the first orphan body line since the originating line is + # already classified as something else. + open_lineno = dl.lineno + if open_lineno is not None: + yield (open_lineno, 'unclosed /* block comment') def check_unit_address_format(ctx): @@ -886,6 +992,17 @@ def check_unit_address_format(ctx): break +def check_unused_labels(ctx): + """Labels defined but never referenced are clutter.""" + defined, referenced = collect_labels_and_refs(ctx.text) + for label in sorted(defined - referenced): + # Find the line where this label is defined for line-number + # reporting. + m = re.search(r'(?m)^.*\b' + re.escape(label) + r'\s*:', ctx.text) + lineno = ctx.text[:m.start()].count('\n') + 1 if m else 1 + yield (lineno, 'label %r defined but never &-referenced' % label) + + def check_value_whitespace(ctx): """A <...> cell list must have no whitespace directly after '<' or directly before '>'. Continuation lines are joined onto the @@ -914,122 +1031,6 @@ def check_value_whitespace(ctx): break -def check_node_close_alone(ctx): - """The closing '};' of a node must be on its own line. The - classifier accepts a canonical "}" or "};" as NODE_CLOSE; a line - that is all closures (e.g. "}; };") is still NODE_CLOSE for depth - tracking but is flagged here via dl.closures. Any other line that - still contains '};' (in code, not in strings or comments) is - mixing a node close with something else.""" - for dl in ctx.lines: - if dl.linetype == LineType.NODE_CLOSE: - if dl.closures > 1: - yield (dl.lineno, - 'closing brace must be on its own line') - continue - if dl.linetype in (LineType.BLANK, LineType.COMMENT, - LineType.COMMENT_START, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.PREPROCESSOR): - continue - if '};' in dl.code: - yield (dl.lineno, - 'closing brace must be on its own line') - - -def _display_col(text): - """Visual column width of text, with tabs expanded to the next - 8-column stop, matching how printf and most editors render a - line and the kernel-wide line length convention.""" - col = 0 - for ch in text: - if ch == '\t': - col = (col // 8 + 1) * 8 - else: - col += 1 - return col - - -def check_line_length(ctx): - """Lines must not exceed 80 columns; tabs count as 8 (see - _display_col).""" - for dl in ctx.lines: - if dl.linetype == LineType.BLANK: - continue - cols = _display_col(dl.raw) - if cols > 80: - yield (dl.lineno, - 'line exceeds 80 columns (%d)' % cols) - - -def check_continuation_alignment(ctx): - """A multi-line property's continuation lines must align their - first non-whitespace character to the display column of: - 1. the first '<' or '"' after the '=' in the leading line, if continuation is with '<' or '"' - 2. the first value, if the continuation is still the same phandle. - Display columns are used so tab-indented .dts files (where a continuation - aligns with tabs plus spaces) are compared correctly.""" - for dl in ctx.lines: - if dl.linetype != LineType.PROPERTY: - continue - if not dl.continuations: - continue - eq = dl.raw.find('=') - if eq < 0: - continue - # First '<' or '"' after '=', but ignore comments and strip trailing - # whitespace (e.g. remaining after removing the comment) - rest = _strip_strings_and_comments(dl.raw[eq + 1:]).rstrip() - m = re.search(r'\s*([<"])', rest) - if not m: - continue - dl_value_complete = rest.endswith('",') or rest.endswith('>,') - target_col = _display_col(_strip_strings_and_comments(dl.raw[:eq + 1 + m.start(1)])) - for cont in dl.continuations: - target_offset = 0 - err_msg_explanation = 'to < or "' - if not dl_value_complete: - target_offset = 1 - err_msg_explanation = 'to the value under <' - if _display_col(cont.indent_str) != target_col + target_offset: - yield (cont.lineno, - 'continuation should align to column %d ' - '(%s)' % (target_col + target_offset + 1, err_msg_explanation)) - # Align to the value within <> or "" of continuation (so the previous line) - dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,') - - -def check_unclosed_block_comment(ctx): - """Every /* must have a matching */ in the same block. Catches both - a comment opened on its own line (COMMENT_START) and a tail comment - opened on a PROPERTY or other code line (where in_block_comment is - set by _split_code so the next line becomes COMMENT_BODY without a - preceding COMMENT_START).""" - open_lineno = None - for dl in ctx.lines: - if dl.linetype == LineType.COMMENT_START: - open_lineno = dl.lineno - elif dl.linetype == LineType.COMMENT_END: - open_lineno = None - elif dl.linetype == LineType.COMMENT_BODY and open_lineno is None: - # Block was opened by a /* tail on a code line; report at - # the first orphan body line since the originating line is - # already classified as something else. - open_lineno = dl.lineno - if open_lineno is not None: - yield (open_lineno, 'unclosed /* block comment') - - -def check_unused_labels(ctx): - """Labels defined but never referenced are clutter.""" - defined, referenced = collect_labels_and_refs(ctx.text) - for label in sorted(defined - referenced): - # Find the line where this label is defined for line-number - # reporting. - m = re.search(r'(?m)^.*\b' + re.escape(label) + r'\s*:', ctx.text) - lineno = ctx.text[:m.start()].count('\n') + 1 if m else 1 - yield (lineno, 'label %r defined but never &-referenced' % label) - - # --- registry -------------------------------------------------------------- RULES = [ From e3a8397f060251d53715877ee4225ae539d95cfa Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 29 Aug 2026 21:53:19 +0200 Subject: [PATCH 12/72] dtc: dt-check-style: Process property names with a question mark Devicetree spec allows question mark '?' in property names and such code is also accepted by DTC, thus catch such properties as a valid code, even if discouraged. Otherwise certain rules checking for property names would ignore that line. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260829-dts-style-checker-sort-v1-3-6693a37d7ae1@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 5385a03f377e..7c3ee1432dc6 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -280,7 +280,7 @@ def parse_node_header(dl): def parse_property_name(dl): - m = re.match(r'^([a-zA-Z0-9#][a-zA-Z0-9,._+#-]*)\s*[=;]', dl.stripped) + m = re.match(r'^([a-zA-Z0-9#][a-zA-Z0-9,._+?#-]*)\s*[=;]', dl.stripped) if m: dl.prop_name = m.group(1) From 868507636f6c9c8ee2d0cf48f1a03ccd5abb6195 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 29 Aug 2026 21:53:20 +0200 Subject: [PATCH 13/72] dtc: dt-check-style: Add test for node and property name styles Common style violation is usage of underscores in node or property names, so add rules for following recommended names. There is plenty of legacy approach, so add the rules only for 'strict' mode of checking. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260829-dts-style-checker-sort-v1-4-6693a37d7ae1@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 31 ++++++++++ .../dt-style-selftest/bad/dts-node-name.dts | 60 +++++++++++++++++++ .../bad/dts-property-name.dts | 28 +++++++++ .../dt-style-selftest/bad/yaml-node-name.yaml | 54 +++++++++++++++++ .../bad/yaml-property-name.yaml | 46 ++++++++++++++ .../expected/dts-node-name.dts.txt | 13 ++++ .../expected/dts-property-name.dts.txt | 14 +++++ .../expected/yaml-node-name.yaml.txt | 7 +++ .../expected/yaml-property-name.yaml.txt | 14 +++++ 9 files changed, 267 insertions(+) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-node-name.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-property-name.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml create mode 100644 scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 7c3ee1432dc6..16586d0029ff 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -676,6 +676,31 @@ def check_node_close_alone(ctx): 'closing brace must be on its own line') +def check_node_name(ctx): + """Only recommended characters are used in node names.""" + for dl in ctx.lines: + if not dl.node_name in (None, '/'): + if not re.match(r'[0-9a-z][0-9a-z-]*(?; + #size-cells = <1>; + + foo_bar { + compatible = "example,test-node-name"; + }; + + foo,bar { + compatible = "example,test-node-name"; + }; + + foo.bar { + compatible = "example,test-node-name"; + }; + + foo+bar { + compatible = "example,test-node-name"; + }; + + foo-bar- { + compatible = "example,test-node-name"; + }; + + soc@0 { + compatible = "simple-bus"; + ranges = <0 0 0 0xc0000000>; + + #address-cells = <1>; + #size-cells = <1>; + + foo_bar@1000 { + compatible = "example,test-node-name"; + reg = <0x1000 0x100>; + }; + + foo,bar@2000 { + compatible = "example,test-node-name"; + reg = <0x2000 0x100>; + }; + + foo.bar@3000 { + compatible = "example,test-node-name"; + reg = <0x3000 0x100>; + }; + + foo+bar@4000 { + compatible = "example,test-node-name"; + reg = <0x4000 0x100>; + }; + + foo-bar-@5000 { + compatible = "example,test-node-name"; + reg = <0x5000 0x100>; + }; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-name.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-name.dts new file mode 100644 index 000000000000..110e33a524dd --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-name.dts @@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + foo { + compatible = "example,test-property-name"; + + property#foo; + property+foo; + property-foo; + property-foo-; + property.foo; + property?foo; + property_foo; + + vendor,property#foo; + vendor,property+foo; + vendor,property,foo; + vendor,property-foo; + vendor,property-foo-; + vendor,property.foo; + vendor,property?foo; + vendor,property_foo; + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml new file mode 100644 index 000000000000..03373cae9a66 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-node-name.yaml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-node-name.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with incorrect node names + +maintainers: + - Rob Herring + +properties: + compatible: + const: example,test-node-name + reg: + maxItems: 1 + +required: + - compatible + +additionalProperties: false + +examples: + - | + foo_bar@1000 { + compatible = "example,test-node-name"; + reg = <0x1000 0x100>; + }; + + foo,bar@2000 { + compatible = "example,test-node-name"; + reg = <0x2000 0x100>; + }; + + foo.bar@3000 { + compatible = "example,test-node-name"; + reg = <0x3000 0x100>; + }; + + foo+bar@4000 { + compatible = "example,test-node-name"; + reg = <0x4000 0x100>; + }; + + foo-bar-@5000 { + compatible = "example,test-node-name"; + reg = <0x5000 0x100>; + }; + + // TODO handle also "-foo-bar" which is against spec but accepted by DTC + + foo_bar { + compatible = "example,test-node-name"; + }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml new file mode 100644 index 000000000000..08e0d1eb152a --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-property-name.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-property-name.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with incorrect property names + +maintainers: + - Rob Herring + +properties: + compatible: + const: example,test-property-name + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + foo@1000 { + compatible = "example,test-property-name"; + reg = <0x1000 0x100>; + + property#foo; + property+foo; + property-foo; + property-foo-; + property.foo; + property?foo; + property_foo; + + vendor,property#foo; + vendor,property+foo; + vendor,property,foo; + vendor,property-foo; + vendor,property-foo-; + vendor,property.foo; + vendor,property?foo; + vendor,property_foo; + }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt new file mode 100644 index 000000000000..bd8d7e21e243 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-node-name.dts.txt @@ -0,0 +1,13 @@ +# mode=strict +bad/dts-node-name.dts:8: [node-name] node name "foo_bar" is using discouraged style +bad/dts-node-name.dts:12: [child-name-order] child node 'foo,bar' out of name order +bad/dts-node-name.dts:12: [node-name] node name "foo,bar" is using discouraged style +bad/dts-node-name.dts:16: [node-name] node name "foo.bar" is using discouraged style +bad/dts-node-name.dts:20: [child-name-order] child node 'foo+bar' out of name order +bad/dts-node-name.dts:20: [node-name] node name "foo+bar" is using discouraged style +bad/dts-node-name.dts:24: [node-name] node name "foo-bar-" is using discouraged style +bad/dts-node-name.dts:35: [node-name] node name "foo_bar" is using discouraged style +bad/dts-node-name.dts:40: [node-name] node name "foo,bar" is using discouraged style +bad/dts-node-name.dts:45: [node-name] node name "foo.bar" is using discouraged style +bad/dts-node-name.dts:50: [node-name] node name "foo+bar" is using discouraged style +bad/dts-node-name.dts:55: [node-name] node name "foo-bar-" is using discouraged style diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt new file mode 100644 index 000000000000..f447743383da --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-name.dts.txt @@ -0,0 +1,14 @@ +# mode=strict +bad/dts-property-name.dts:11: [property-name] property name "property#foo" is using discouraged style +bad/dts-property-name.dts:12: [property-name] property name "property+foo" is using discouraged style +bad/dts-property-name.dts:14: [property-name] property name "property-foo-" is using discouraged style +bad/dts-property-name.dts:15: [property-name] property name "property.foo" is using discouraged style +bad/dts-property-name.dts:16: [property-name] property name "property?foo" is using discouraged style +bad/dts-property-name.dts:17: [property-name] property name "property_foo" is using discouraged style +bad/dts-property-name.dts:19: [property-name] property name "vendor,property#foo" is using discouraged style +bad/dts-property-name.dts:20: [property-name] property name "vendor,property+foo" is using discouraged style +bad/dts-property-name.dts:21: [property-name] property name "vendor,property,foo" is using discouraged style +bad/dts-property-name.dts:23: [property-name] property name "vendor,property-foo-" is using discouraged style +bad/dts-property-name.dts:24: [property-name] property name "vendor,property.foo" is using discouraged style +bad/dts-property-name.dts:25: [property-name] property name "vendor,property?foo" is using discouraged style +bad/dts-property-name.dts:26: [property-name] property name "vendor,property_foo" is using discouraged style diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt new file mode 100644 index 000000000000..d9cf749e35c2 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-node-name.yaml.txt @@ -0,0 +1,7 @@ +# mode=strict +bad/yaml-node-name.yaml:25: example 0 [node-name] node name "foo_bar" is using discouraged style +bad/yaml-node-name.yaml:30: example 0 [node-name] node name "foo,bar" is using discouraged style +bad/yaml-node-name.yaml:35: example 0 [node-name] node name "foo.bar" is using discouraged style +bad/yaml-node-name.yaml:40: example 0 [node-name] node name "foo+bar" is using discouraged style +bad/yaml-node-name.yaml:45: example 0 [node-name] node name "foo-bar-" is using discouraged style +bad/yaml-node-name.yaml:52: example 0 [node-name] node name "foo_bar" is using discouraged style diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt new file mode 100644 index 000000000000..6aa3a004532b --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-property-name.yaml.txt @@ -0,0 +1,14 @@ +# mode=strict +bad/yaml-property-name.yaml:30: example 0 [property-name] property name "property#foo" is using discouraged style +bad/yaml-property-name.yaml:31: example 0 [property-name] property name "property+foo" is using discouraged style +bad/yaml-property-name.yaml:33: example 0 [property-name] property name "property-foo-" is using discouraged style +bad/yaml-property-name.yaml:34: example 0 [property-name] property name "property.foo" is using discouraged style +bad/yaml-property-name.yaml:35: example 0 [property-name] property name "property?foo" is using discouraged style +bad/yaml-property-name.yaml:36: example 0 [property-name] property name "property_foo" is using discouraged style +bad/yaml-property-name.yaml:38: example 0 [property-name] property name "vendor,property#foo" is using discouraged style +bad/yaml-property-name.yaml:39: example 0 [property-name] property name "vendor,property+foo" is using discouraged style +bad/yaml-property-name.yaml:40: example 0 [property-name] property name "vendor,property,foo" is using discouraged style +bad/yaml-property-name.yaml:42: example 0 [property-name] property name "vendor,property-foo-" is using discouraged style +bad/yaml-property-name.yaml:43: example 0 [property-name] property name "vendor,property.foo" is using discouraged style +bad/yaml-property-name.yaml:44: example 0 [property-name] property name "vendor,property?foo" is using discouraged style +bad/yaml-property-name.yaml:45: example 0 [property-name] property name "vendor,property_foo" is using discouraged style From 233c5c03adbfa0a39f64556f7b7198bc989f4b12 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 29 Aug 2026 21:53:21 +0200 Subject: [PATCH 14/72] dtc: dt-check-style: Check for indentation also in continued lines of DTS Add missing code in check_mixed_indent_chars() for DTS to apply the same rule of too many spaces for indentation also for continued lines (iterating over all DtsLines is not enough). Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/all/20260709180118.6935B1F000E9@smtp.kernel.org/ Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260829-dts-style-checker-sort-v1-5-6693a37d7ae1@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 2 ++ scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt | 1 + 2 files changed, 3 insertions(+) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 16586d0029ff..dc5a8ee23d68 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -652,6 +652,8 @@ def check_mixed_indent_chars(ctx): continue if re.search(r' \t', cont.indent_str): yield (cont.lineno, 'mixed tabs and spaces in indent') + if cont.indent_str.count(' ') > 7: + yield (cont.lineno, 'too many space characters in indent (more than 7)') def check_node_close_alone(ctx): diff --git a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt index 93146cfb51c7..1706390f5664 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-mixed-indent.dts.txt @@ -6,4 +6,5 @@ bad/dts-mixed-indent.dts:12: [mixed-indent-chars] mixed tabs and spaces in inden bad/dts-mixed-indent.dts:13: [indent-consistent] indent mismatch (expected depth 2 * '\t') bad/dts-mixed-indent.dts:13: [mixed-indent-chars] mixed tabs and spaces in indent bad/dts-mixed-indent.dts:16: [mixed-indent-chars] mixed tabs and spaces in indent +bad/dts-mixed-indent.dts:18: [mixed-indent-chars] too many space characters in indent (more than 7) bad/dts-mixed-indent.dts:19: [indent-consistent] indent mismatch (expected depth 2 * '\t') From 99a1ea49cd4239726f2382213c273f73bcb6a93d Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 29 Aug 2026 21:53:22 +0200 Subject: [PATCH 15/72] dtc: dt-check-style: Check for indentation also in continued lines of bindings example Add missing code in check_tab_in_yaml_example() for example in the bindings to apply the same rule of discouraged tab character also for continued lines (iterating over all DtsLines is not enough). Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260829-dts-style-checker-sort-v1-6-6693a37d7ae1@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 3 +++ scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml | 2 ++ .../dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt | 1 + 3 files changed, 6 insertions(+) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index dc5a8ee23d68..0ebbe658b893 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -959,6 +959,9 @@ def check_tab_in_yaml_example(ctx): continue if '\t' in dl.raw: yield (dl.lineno, 'tab character not allowed in DTS example') + for cont in dl.continuations: + if '\t' in cont.raw: + yield (cont.lineno, 'tab character not allowed in DTS example') def check_trailing_whitespace(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml index c25a0d1a999e..4f76188b5e23 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-mixed-indent.yaml @@ -26,4 +26,6 @@ examples: device@1000 { compatible = "example,test-mixed"; reg = <0x1000 0x100>; + clocks = <1>, + <2>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt index bc3fc3cf00cc..442f21f90e83 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-mixed-indent.yaml.txt @@ -1,2 +1,3 @@ # mode=relaxed bad/yaml-mixed-indent.yaml:27: example 0 [tab-in-yaml] tab character not allowed in DTS example +bad/yaml-mixed-indent.yaml:30: example 0 [tab-in-yaml] tab character not allowed in DTS example From a0bbc53738f7c161ded8a2fd2bdd9844a45ca9d2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 13:16:02 +0200 Subject: [PATCH 16/72] MAINTAINERS: dt-bindings: Include dt-check-style in DT binding entry The dt-check-style tool is in interest of Devicetree bindings maintainers, not only the driver OF-core (where it is covered through "F: scripts/dtc/"), because it covers the DTS and the bindings. Add it to the DT bindings maintainers entry. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826-n-dts-style-checker-continued-v6-10-f270b1e81f8e@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3a19da74d00c..d68479f4d473 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20478,6 +20478,8 @@ F: Documentation/devicetree/ F: Documentation/process/maintainer-devicetree.rst F: arch/*/boot/dts/ F: include/dt-bindings/ +F: scripts/dtc/dt-check-style +F: scripts/dtc/dt-style-selftest/ OPENCOMPUTE PTP CLOCK DRIVER M: Vadim Fedorenko From 869ca7e0951a4277d397c02e6152f6f12af3997b Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Wed, 26 Aug 2026 12:20:45 +0200 Subject: [PATCH 17/72] dt-bindings: Drop redundant white-space around values in <> Correct a few white-space issues around <>, which will be flagged by dt-check-style. No functional changes. Signed-off-by: Krzysztof Kozlowski Acked-by: Mark Brown Reviewed-by: Luca Ceresoli Reviewed-by: Andy Shevchenko Reviewed-by: Leo Yan Acked-by: Conor Dooley Acked-by: Lee Jones Link: https://patch.msgid.link/20260826102044.142986-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../bindings/arm/arm,coresight-cti.yaml | 2 +- .../bindings/display/bridge/sil,sii9022.yaml | 2 +- .../bindings/i2c/xlnx,xps-iic-2.00.a.yaml | 4 ++-- .../bindings/iio/light/upisemi,us5182.yaml | 2 +- .../bindings/input/matrix-keymap.yaml | 3 +-- .../devicetree/bindings/input/ti,tca8418.yaml | 21 +++++++++---------- .../bindings/media/nxp,imx8-jpeg.yaml | 4 ++-- .../devicetree/bindings/mfd/ti,tps65910.yaml | 2 +- .../bindings/pci/hisilicon,kirin-pcie.yaml | 4 ++-- .../pinctrl/sunplus,sp7021-pinctrl.yaml | 2 +- .../bindings/spi/aspeed,ast2600-fmc.yaml | 6 +++--- .../bindings/thermal/thermal-idle.yaml | 2 +- 12 files changed, 26 insertions(+), 28 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml b/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml index 949444aba1f8..f4101f94241a 100644 --- a/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml +++ b/Documentation/devicetree/bindings/arm/arm,coresight-cti.yaml @@ -308,7 +308,7 @@ examples: arm,trig-in-sigs = <0 1>; arm,trig-in-types = ; - arm,trig-out-sigs = <0 1 2 >; + arm,trig-out-sigs = <0 1 2>; arm,trig-out-types = ; diff --git a/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml b/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml index 17ea06719b56..b869552596f4 100644 --- a/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml +++ b/Documentation/devicetree/bindings/display/bridge/sil,sii9022.yaml @@ -128,7 +128,7 @@ examples: cvcc12-supply = <&v1v2_hdmi>; #sound-dai-cells = <0>; - sil,i2s-data-lanes = < 0 1 2 >; + sil,i2s-data-lanes = <0 1 2>; clocks = <&mclk>; clock-names = "mclk"; diff --git a/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml b/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml index 658ae92fa86d..edd561d9733a 100644 --- a/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml +++ b/Documentation/devicetree/bindings/i2c/xlnx,xps-iic-2.00.a.yaml @@ -52,8 +52,8 @@ examples: axi_iic_0: i2c@40800000 { compatible = "xlnx,xps-iic-2.00.a"; clocks = <&clkc 15>; - interrupts = < 1 2 >; - reg = < 0x40800000 0x10000 >; + interrupts = <1 2>; + reg = <0x40800000 0x10000>; #size-cells = <0>; #address-cells = <1>; diff --git a/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml index dd78abe0ec8d..979d7e782290 100644 --- a/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml +++ b/Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml @@ -69,7 +69,7 @@ examples: light-sensor@39 { compatible = "upisemi,usd5182"; reg = <0x39>; - upisemi,glass-coef = < 1000 >; + upisemi,glass-coef = <1000>; upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>; upisemi,upper-dark-gain = /bits/ 8 <0x00>; upisemi,lower-dark-gain = /bits/ 8 <0x16>; diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.yaml b/Documentation/devicetree/bindings/input/matrix-keymap.yaml index ce910e4ac823..bef8f9813535 100644 --- a/Documentation/devicetree/bindings/input/matrix-keymap.yaml +++ b/Documentation/devicetree/bindings/input/matrix-keymap.yaml @@ -41,8 +41,7 @@ examples: - | keypad { /* ... */ - linux,keymap = < 0x00030012 - 0x0102003a >; + linux,keymap = <0x00030012 0x0102003a>; keypad,num-rows = <2>; keypad,num-columns = <8>; }; diff --git a/Documentation/devicetree/bindings/input/ti,tca8418.yaml b/Documentation/devicetree/bindings/input/ti,tca8418.yaml index 624a1830d0b0..a8897c5c4d9d 100644 --- a/Documentation/devicetree/bindings/input/ti,tca8418.yaml +++ b/Documentation/devicetree/bindings/input/ti,tca8418.yaml @@ -46,16 +46,15 @@ examples: interrupts = <11 IRQ_TYPE_EDGE_FALLING>; keypad,num-rows = <4>; keypad,num-columns = <4>; - linux,keymap = < MATRIX_KEY(0x00, 0x01, BTN_0) - MATRIX_KEY(0x00, 0x00, BTN_1) - MATRIX_KEY(0x01, 0x01, BTN_2) - MATRIX_KEY(0x01, 0x00, BTN_3) - MATRIX_KEY(0x02, 0x00, BTN_4) - MATRIX_KEY(0x00, 0x03, BTN_5) - MATRIX_KEY(0x00, 0x02, BTN_6) - MATRIX_KEY(0x01, 0x03, BTN_7) - MATRIX_KEY(0x01, 0x02, BTN_8) - MATRIX_KEY(0x02, 0x02, BTN_9) - >; + linux,keymap = ; }; }; diff --git a/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml b/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml index 6ba668aa633d..4727dd7040a8 100644 --- a/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml +++ b/Documentation/devicetree/bindings/media/nxp,imx8-jpeg.yaml @@ -95,7 +95,7 @@ examples: jpegdec: jpegdec@58400000 { compatible = "nxp,imx8qxp-jpgdec"; - reg = <0x58400000 0x00050000 >; + reg = <0x58400000 0x00050000>; clocks = <&img_jpeg_dec_lpcg IMX_LPCG_CLK_0>, <&img_jpeg_dec_lpcg IMX_LPCG_CLK_4>; interrupts = , @@ -111,7 +111,7 @@ examples: jpegenc: jpegenc@58450000 { compatible = "nxp,imx8qm-jpgenc", "nxp,imx8qxp-jpgenc"; - reg = <0x58450000 0x00050000 >; + reg = <0x58450000 0x00050000>; clocks = <&img_jpeg_enc_lpcg IMX_LPCG_CLK_0>, <&img_jpeg__lpcg IMX_LPCG_CLK_4>; interrupts = , diff --git a/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml b/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml index f1a76f88fc0c..f285e8cb29fb 100644 --- a/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml +++ b/Documentation/devicetree/bindings/mfd/ti,tps65910.yaml @@ -208,7 +208,7 @@ examples: compatible = "ti,tps65910"; reg = <0x2d>; interrupt-parent = <&intc>; - interrupts = < 0 118 0x04 >; + interrupts = <0 118 0x04>; #gpio-cells = <2>; gpio-controller; diff --git a/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml b/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml index e863519f3161..b6801057e31e 100644 --- a/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/hisilicon,kirin-pcie.yaml @@ -160,7 +160,7 @@ examples: reg = <0x2800 0 0 0 0>; compatible = "pciclass,0604"; device_type = "pci"; - reset-gpios = <&gpio27 4 0 >; + reset-gpios = <&gpio27 4 0>; #address-cells = <3>; #size-cells = <2>; ranges; @@ -170,7 +170,7 @@ examples: reg = <0x03800 0 0 0 0>; compatible = "pciclass,0604"; device_type = "pci"; - reset-gpios = <&gpio25 2 0 >; + reset-gpios = <&gpio25 2 0>; #address-cells = <3>; #size-cells = <2>; ranges; diff --git a/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml index 94b868c7ceb1..0084350ec579 100644 --- a/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/sunplus,sp7021-pinctrl.yaml @@ -339,7 +339,7 @@ examples: sdcard-pins { function = "SD_CARD"; groups = "SD_CARD"; - sunplus,pins = < SPPCTL_IOPAD(91, SPPCTL_PCTL_G_GPIO, 0, 0) >; + sunplus,pins = ; }; hdmi_A_tx1-pins { diff --git a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml index 80e542624cc6..ad830aebb798 100644 --- a/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml +++ b/Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml @@ -62,21 +62,21 @@ examples: interrupts = ; flash@0 { - reg = < 0 >; + reg = <0>; compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; spi-rx-bus-width = <2>; }; flash@1 { - reg = < 1 >; + reg = <1>; compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; spi-rx-bus-width = <2>; }; flash@2 { - reg = < 2 >; + reg = <2>; compatible = "jedec,spi-nor"; spi-max-frequency = <50000000>; spi-rx-bus-width = <2>; diff --git a/Documentation/devicetree/bindings/thermal/thermal-idle.yaml b/Documentation/devicetree/bindings/thermal/thermal-idle.yaml index 1b77d542a7b8..6b4b16580adf 100644 --- a/Documentation/devicetree/bindings/thermal/thermal-idle.yaml +++ b/Documentation/devicetree/bindings/thermal/thermal-idle.yaml @@ -137,7 +137,7 @@ examples: cooling-maps { map0 { trip = <&cpu_alert1>; - cooling-device = <&cpu_b0_therm 0 15 >, + cooling-device = <&cpu_b0_therm 0 15>, <&cpu_b1_therm 0 15>; }; From e8c5bddb548f437213cc83805dd9bd0da8df5aa4 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 26 Aug 2026 15:44:44 -0400 Subject: [PATCH 18/72] dt-bindings: trivial-devices: Add SDMC DM2016 Add SDMC DM2016 (1024bit EEPROM + 128bit OTP memory for key). Fix legacy imx6 platform CHECK_DTBS warnings: /soc/bus@2100000/i2c@21a4000/dm2016@51: failed to match any schema with compatible: ['sdmc,dm2016'] Signed-off-by: Frank Li Acked-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260826194447.3230715-1-Frank.Li@oss.nxp.com Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/trivial-devices.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index 2de8eb09cb7d..05f88cf81d6c 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -414,6 +414,8 @@ properties: - samsung,24ad0xd1 # Samsung Exynos SoC SATA PHY I2C device - samsung,exynos-sataphy-i2c + # SDMC 1024bit EEPROM + 128bit OTP memory for key + - sdmc,dm2016 # Semtech sx1301 baseband processor - semtech,sx1301 # Sensirion multi-pixel gas sensor with I2C interface From f91a7dcb7d39661ca61cec99012ed46ebb9405bf Mon Sep 17 00:00:00 2001 From: Zhijian Han Date: Fri, 28 Aug 2026 17:54:59 +0800 Subject: [PATCH 19/72] dt-bindings: fix typos in various bindings Fix spelling errors found by the kernel's scripts/spelling.txt and codespell in several devicetree binding documents: - "curent" -> "current" in adi,ltc2991.yaml - "deivce" -> "device" in zii,rave-sp-eeprom.yaml - "ouput" -> "output" in delta,tn48m-gpio.yaml - "redudant" -> "redundant" in trivial-devices.yaml Signed-off-by: Zhijian Han Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260828095459.834657-1-hanzhijian1991@gmail.com Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml | 2 +- Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml | 2 +- Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml | 2 +- Documentation/devicetree/bindings/trivial-devices.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml b/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml index e3e668a12091..698cc14b027f 100644 --- a/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml +++ b/Documentation/devicetree/bindings/gpio/delta,tn48m-gpio.yaml @@ -14,7 +14,7 @@ description: | details see ../mfd/delta,tn48m-cpld.yaml. Delta TN48M has an onboard Lattice CPLD that is used as an GPIO expander. - It provides 12 pins in total, they are input-only or ouput-only type. + It provides 12 pins in total, they are input-only or output-only type. properties: compatible: diff --git a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml index 1ff44cb22ef4..2210764a81bb 100644 --- a/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml +++ b/Documentation/devicetree/bindings/hwmon/adi,ltc2991.yaml @@ -49,7 +49,7 @@ patternProperties: shunt-resistor-micro-ohms: description: - The value of curent sense resistor in micro ohms. Pin configuration is + The value of current sense resistor in micro ohms. Pin configuration is set for differential input pair. adi,temperature-enable: diff --git a/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml b/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml index d073c51c2b9a..e0aacecd652d 100644 --- a/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml +++ b/Documentation/devicetree/bindings/nvmem/zii,rave-sp-eeprom.yaml @@ -27,7 +27,7 @@ properties: $ref: /schemas/types.yaml#/definitions/string description: Unique EEPROM identifier describing its function in the - system. Will be used as created NVMEM deivce's name. + system. Will be used as created NVMEM device's name. required: - compatible diff --git a/Documentation/devicetree/bindings/trivial-devices.yaml b/Documentation/devicetree/bindings/trivial-devices.yaml index 05f88cf81d6c..3246dfa7fe83 100644 --- a/Documentation/devicetree/bindings/trivial-devices.yaml +++ b/Documentation/devicetree/bindings/trivial-devices.yaml @@ -186,7 +186,7 @@ properties: - injoinic,ip5306 # Inspur Power System power supply unit version 1 - inspur,ipsps1 - # Intel common redudant power supply crps185 + # Intel common redundant power supply crps185 - intel,crps185 # Intersil ISL29028 Ambient Light and Proximity Sensor - isil,isl29028 From 70b05c20f5a003d109177e4806ca90660e30ff67 Mon Sep 17 00:00:00 2001 From: Bhargav Joshi Date: Tue, 18 Aug 2026 21:59:49 +0530 Subject: [PATCH 20/72] dt-bindings: bus: ti,omap-ocp2scp: Convert to DT schema Convert the TI OCP2SCP bridge device tree bindings to DT schema. Changes during conversion: - Add list #address-cells and #size-cells as required properties. - Drop ranges from the required properties as it is omitted in some existing DTS. - Mark reg is not required for compatible ti,am437x-ocp2scp, driver skips fetching memory resources for this, existing DTS also omit it. - Mark the ti,hwmods property as deprecated. - Set additionalProperties to type: object rather than using patternProperties`. Since OCP2SCP acts as a generic bridge/bus, its child nodes represent various PHY devices. Signed-off-by: Bhargav Joshi Link: https://patch.msgid.link/20260818-ti-ocp2scp-v1-1-9d2885011cda@gmail.com Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/bus/omap-ocp2scp.txt | 29 -------- .../bindings/bus/ti,omap-ocp2scp.yaml | 74 +++++++++++++++++++ 2 files changed, 74 insertions(+), 29 deletions(-) delete mode 100644 Documentation/devicetree/bindings/bus/omap-ocp2scp.txt create mode 100644 Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml diff --git a/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt b/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt deleted file mode 100644 index 18729f6fe1e5..000000000000 --- a/Documentation/devicetree/bindings/bus/omap-ocp2scp.txt +++ /dev/null @@ -1,29 +0,0 @@ -* OMAP OCP2SCP - ocp interface to scp interface - -properties: -- compatible : Should be "ti,am437x-ocp2scp" for AM437x processor - Should be "ti,omap-ocp2scp" for all others -- reg : Address and length of the register set for the device -- #address-cells, #size-cells : Must be present if the device has sub-nodes -- ranges : the child address space are mapped 1:1 onto the parent address space -- ti,hwmods : must be "ocp2scp_usb_phy" - -Sub-nodes: -All the devices connected to ocp2scp are described using sub-node to ocp2scp - -ocp2scp@4a0ad000 { - compatible = "ti,omap-ocp2scp"; - reg = <0x4a0ad000 0x1f>; - #address-cells = <1>; - #size-cells = <1>; - ranges; - ti,hwmods = "ocp2scp_usb_phy"; - - subnode1 { - ... - }; - - subnode2 { - ... - }; -}; diff --git a/Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml b/Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml new file mode 100644 index 000000000000..a8852185144d --- /dev/null +++ b/Documentation/devicetree/bindings/bus/ti,omap-ocp2scp.yaml @@ -0,0 +1,74 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/ti,omap-ocp2scp.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI OMAP OCP to SCP bus bridge + +maintainers: + - Kishon Vijay Abraham I + +properties: + compatible: + oneOf: + - items: + - const: ti,am437x-ocp2scp + - const: ti,omap-ocp2scp + - const: ti,omap-ocp2scp + + reg: + maxItems: 1 + + "#address-cells": + const: 1 + + "#size-cells": + const: 1 + + ranges: true + + ti,hwmods: + $ref: /schemas/types.yaml#/definitions/string + description: Name of the hwmod associated with the device. + deprecated: true + +required: + - compatible + - "#address-cells" + - "#size-cells" + +allOf: + - if: + properties: + compatible: + contains: + const: ti,am437x-ocp2scp + then: + properties: + reg: false + else: + required: + - reg + +additionalProperties: + type: object + +examples: + - | + ocp2scp@4a0ad000 { + compatible = "ti,omap-ocp2scp"; + reg = <0x4a0ad000 0x1f>; + #address-cells = <1>; + #size-cells = <1>; + ranges; + + phy@80 { + compatible = "ti,omap-usb2"; + reg = <0x80 0x58>; + ctrl-module = <&omap_control_usb2phy>; + clocks = <&usb_phy_cm_clk32k>; + clock-names = "wkupclk"; + #phy-cells = <0>; + }; + }; From 1e151de2d11ec09766e719427eb0d852fc6db8b8 Mon Sep 17 00:00:00 2001 From: Bhargav Joshi Date: Tue, 18 Aug 2026 23:29:51 +0530 Subject: [PATCH 21/72] dt-bindings: arm: ti,omap-mpu: Convert to DT schema Convert TI OMAP Main Processor Unit MPU text to DT schema. Changes from the original text binding during conversion: - Mark ti,hwmods as deprecated, as it is longer needed. - The pm-sram property name is kept as-is without a vendor prefix ti,pm-sram to maintain backward compatibility with older device trees and the existing pm33xx driver. Signed-off-by: Bhargav Joshi Link: https://patch.msgid.link/20260818-ti-mpu-v1-1-5b1c71a34669@gmail.com Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/arm/omap/mpu.txt | 54 ----------------- .../bindings/arm/ti/ti,omap-mpu.yaml | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 54 deletions(-) delete mode 100644 Documentation/devicetree/bindings/arm/omap/mpu.txt create mode 100644 Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml diff --git a/Documentation/devicetree/bindings/arm/omap/mpu.txt b/Documentation/devicetree/bindings/arm/omap/mpu.txt deleted file mode 100644 index e41490e6979c..000000000000 --- a/Documentation/devicetree/bindings/arm/omap/mpu.txt +++ /dev/null @@ -1,54 +0,0 @@ -* TI - MPU (Main Processor Unit) subsystem - -The MPU subsystem contain one or several ARM cores -depending of the version. -The MPU contain CPUs, GIC, L2 cache and a local PRCM. - -Required properties: -- compatible : Should be "ti,omap3-mpu" for OMAP3 - Should be "ti,omap4-mpu" for OMAP4 - Should be "ti,omap5-mpu" for OMAP5 -- ti,hwmods: "mpu" - -Optional properties: -- sram: Phandle to the ocmcram node - -am335x and am437x only: -- pm-sram: Phandles to ocmcram nodes to be used for power management. - First should be type 'protect-exec' for the driver to use to copy - and run PM functions, second should be regular pool to be used for - data region for code. See Documentation/devicetree/bindings/sram/sram.yaml - for more details. - -Examples: - -- For an OMAP5 SMP system: - -mpu { - compatible = "ti,omap5-mpu"; - ti,hwmods = "mpu" -}; - -- For an OMAP4 SMP system: - -mpu { - compatible = "ti,omap4-mpu"; - ti,hwmods = "mpu"; -}; - - -- For an OMAP3 monocore system: - -mpu { - compatible = "ti,omap3-mpu"; - ti,hwmods = "mpu"; -}; - -- For an AM335x system: - -mpu { - compatible = "ti,omap3-mpu"; - ti,hwmods = "mpu"; - pm-sram = <&pm_sram_code - &pm_sram_data>; -}; diff --git a/Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml b/Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml new file mode 100644 index 000000000000..abd8c64e8e9f --- /dev/null +++ b/Documentation/devicetree/bindings/arm/ti/ti,omap-mpu.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/ti/ti,omap-mpu.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI MPU (Main Processor Unit) subsystem + +maintainers: + - Benoit Cousson + +description: + The MPU subsystem contains one or several ARM cores depending on the version. + The MPU contains CPUs, GIC, L2 cache and a local PRCM. + +properties: + compatible: + enum: + - ti,omap3-mpu + - ti,omap4-mpu + - ti,omap5-mpu + + ti,hwmods: + $ref: /schemas/types.yaml#/definitions/string + description: Name of the hwmod associated with the MPU + const: mpu + deprecated: true + + sram: + description: ocmcram node + + pm-sram: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: ocmcram nodes for power management. For am335x and am437x. + items: + - items: + - description: ocmcram node of type protect-exec for PM functions + - items: + - description: ocmcram node of regular pool to be used for data region + +required: + - compatible + +additionalProperties: false + +examples: + - | + mpu { + compatible = "ti,omap5-mpu"; + ti,hwmods = "mpu"; + }; + + - | + mpu { + compatible = "ti,omap3-mpu"; + ti,hwmods = "mpu"; + pm-sram = <&pm_sram_code &pm_sram_data>; + }; From 30144bb6e8c88432e0c2fb958276bad935403d6d Mon Sep 17 00:00:00 2001 From: Hardeep Sharma Date: Thu, 27 Aug 2026 23:21:15 +0530 Subject: [PATCH 22/72] dt-bindings: interrupt-controller: qcom,pdc: Add Kuno compatible string Document the Power Domain Controller found on the Qualcomm Kuno SoC. Acked-by: Krzysztof Kozlowski Signed-off-by: Hardeep Sharma Link: https://patch.msgid.link/20260827-kuno-soc-support-v5-12-6d47636a8f09@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/interrupt-controller/qcom,pdc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml b/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml index 8162a49d49a6..518fbf6b2761 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml @@ -30,6 +30,7 @@ properties: - qcom,glymur-pdc - qcom,hawi-pdc - qcom,kaanapali-pdc + - qcom,kuno-pdc - qcom,maili-pdc - qcom,milos-pdc - qcom,nord-pdc From 6b91b2fdc32a8cefdff9319d6713a12e0ac991fd Mon Sep 17 00:00:00 2001 From: Genevieve Chan Date: Fri, 4 Sep 2026 11:28:49 +0800 Subject: [PATCH 23/72] dt-bindings: clock: agilex: mark mpu_l2ram_clk deprecated Preliminary documentation referred to mpu_l2ram_clk, but that clock is now mpu_ccu_clk and is already represented by AGILEX_MPU_CCU_CLK. Keep AGILEX_MPU_L2RAM_CLK as a legacy ABI-preserved ID (do not use in new DTs). Signed-off-by: Genevieve Chan Acked-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260904032849.10554-1-genevieve.chan@altera.com Signed-off-by: Rob Herring (Arm) --- include/dt-bindings/clock/agilex-clock.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/dt-bindings/clock/agilex-clock.h b/include/dt-bindings/clock/agilex-clock.h index 06feca07e08e..6206a45e007c 100644 --- a/include/dt-bindings/clock/agilex-clock.h +++ b/include/dt-bindings/clock/agilex-clock.h @@ -44,6 +44,7 @@ /* Gate clocks */ #define AGILEX_MPU_CLK 30 +/* Legacy ABI ID; do not use in new DTs, use AGILEX_MPU_CCU_CLK */ #define AGILEX_MPU_L2RAM_CLK 31 #define AGILEX_MPU_PERIPH_CLK 32 #define AGILEX_L4_MAIN_CLK 33 From a64ec0aefc7e05c3ca899ed8c2835142d3c2b8ff Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 3 Sep 2026 11:07:58 +0200 Subject: [PATCH 24/72] of: property: Drop superfluous !! When assigning a pointer or integral value to a boolean, there is no need to insert a double logical inversion, as the assignment already takes care of the conversion. Signed-off-by: Geert Uytterhoeven Link: https://patch.msgid.link/d32521ecddc0df9de1c5f21edb7935f7f543590f.1788426412.git.geert+renesas@glider.be Signed-off-by: Rob Herring (Arm) --- drivers/of/property.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/of/property.c b/drivers/of/property.c index 72cf12907de0..abd0b2320779 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -74,7 +74,7 @@ bool of_graph_is_present(const struct device_node *node) struct device_node *port __free(device_node) = of_get_child_by_name(node, "port"); - return !!port; + return port; } EXPORT_SYMBOL(of_graph_is_present); @@ -1659,12 +1659,12 @@ static bool of_is_fwnode_add_links_supported(void) return true; if (is_supported != -1) - return !!is_supported; + return is_supported; is_supported = !((match_property_by_path("/soc", "compatible", "intel,ce4100-cp") >= 0) || (match_property_by_path("/", "architecture", "OLPC") >= 0)); - return !!is_supported; + return is_supported; } static int of_fwnode_add_links(struct fwnode_handle *fwnode) From 8273a4059c41748d21a7dfc076407396ddca25b5 Mon Sep 17 00:00:00 2001 From: Udaya Kiran Challa Date: Sat, 22 Aug 2026 15:08:29 +0530 Subject: [PATCH 25/72] dt-bindings: arm: mediatek: mediatek,g3dsys: Convert to DT schema Convert the MediaTek G3D system controller devicetree binding from the legacy text format to DT schema. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Udaya Kiran Challa Link: https://patch.msgid.link/20260822093829.46295-1-challauday369@gmail.com Signed-off-by: Rob Herring (Arm) --- .../bindings/arm/mediatek/mediatek,g3dsys.txt | 30 ---------- .../soc/mediatek/mediatek,mt2701-g3dsys.yaml | 58 +++++++++++++++++++ 2 files changed, 58 insertions(+), 30 deletions(-) delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt create mode 100644 Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt b/Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt deleted file mode 100644 index 7de43bf41fdc..000000000000 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,g3dsys.txt +++ /dev/null @@ -1,30 +0,0 @@ -MediaTek g3dsys controller -============================ - -The MediaTek g3dsys controller provides various clocks and reset controller to -the GPU. - -Required Properties: - -- compatible: Should be: - - "mediatek,mt2701-g3dsys", "syscon": - for MT2701 SoC - - "mediatek,mt7623-g3dsys", "mediatek,mt2701-g3dsys", "syscon": - for MT7623 SoC -- #clock-cells: Must be 1 -- #reset-cells: Must be 1 - -The g3dsys controller uses the common clk binding from -Documentation/devicetree/bindings/clock/clock-bindings.txt -The available clocks are defined in dt-bindings/clock/mt*-clk.h. - -Example: - -g3dsys: clock-controller@13000000 { - compatible = "mediatek,mt7623-g3dsys", - "mediatek,mt2701-g3dsys", - "syscon"; - reg = <0 0x13000000 0 0x200>; - #clock-cells = <1>; - #reset-cells = <1>; -}; diff --git a/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml new file mode 100644 index 000000000000..ad3df062d5db --- /dev/null +++ b/Documentation/devicetree/bindings/soc/mediatek/mediatek,mt2701-g3dsys.yaml @@ -0,0 +1,58 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mt2701-g3dsys.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek G3D System Controller + +maintainers: + - Sean Wang + - Ryder Lee + +description: | + The MediaTek G3D system controller provides clocks and reset control + for the GPU subsystem on MediaTek SoCs. + +properties: + compatible: + oneOf: + - items: + - const: mediatek,mt2701-g3dsys + - const: syscon + - items: + - const: mediatek,mt7623-g3dsys + - const: mediatek,mt2701-g3dsys + - const: syscon + + reg: + maxItems: 1 + + "#clock-cells": + const: 1 + + "#reset-cells": + const: 1 + +required: + - compatible + - reg + - "#clock-cells" + - "#reset-cells" + +additionalProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + g3dsys: syscon@13000000 { + compatible = "mediatek,mt7623-g3dsys", + "mediatek,mt2701-g3dsys", + "syscon"; + reg = <0 0x13000000 0 0x200>; + #clock-cells = <1>; + #reset-cells = <1>; + }; + }; From 135686ed2e0b8df8a4e7abff978ca82efc0444d5 Mon Sep 17 00:00:00 2001 From: Hemanth Selam Date: Wed, 9 Sep 2026 18:05:01 +0530 Subject: [PATCH 26/72] of: fdt: fix "Cound" typo in fdt_translate_address() The comment above the count_cells() call reads "Cound address cells" where it should read "Count address cells", which is what the call below it does. Comment only, no functional change. Assisted-by: Cursor:claude-opus-5 Signed-off-by: Hemanth Selam Link: https://patch.msgid.link/20260909123501.215711-1-hemanth.selam@gmail.com Signed-off-by: Rob Herring (Arm) --- drivers/of/fdt_address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/fdt_address.c b/drivers/of/fdt_address.c index f358d2c80754..2e4e46a58cb6 100644 --- a/drivers/of/fdt_address.c +++ b/drivers/of/fdt_address.c @@ -172,7 +172,7 @@ static u64 __init fdt_translate_address(const void *blob, int node_offset) goto bail; bus = &of_busses[0]; - /* Cound address cells & copy address locally */ + /* Count address cells & copy address locally */ bus->count_cells(blob, parent, &na, &ns); if (!OF_CHECK_COUNTS(na, ns)) { pr_err("Bad cell count for %s\n", From 684afdcd41bb1cd2f5ce2f4f96b0f1c2a56781ad Mon Sep 17 00:00:00 2001 From: Luca Leonardo Scorcia Date: Tue, 8 Sep 2026 20:41:05 +0200 Subject: [PATCH 27/72] dt-bindings: mediatek: hdmi-ddc: Correct the compatibles for mt7623-mt8167 The HDMI DDC driver for both mt7623 and mt8167 is actually the same as mt8173-hdmi-ddc and the mt7623n.dtsi board include file already uses mt8173-hdmi-ddc compatible as a fallback, but the documentation lists them as separate entries. Correct the binding by adding the correct fallback. Signed-off-by: Luca Leonardo Scorcia Reviewed-by: Krzysztof Kozlowski Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20260908184125.10916-1-l.scorcia@gmail.com Signed-off-by: Rob Herring (Arm) --- .../bindings/display/mediatek/mediatek,hdmi-ddc.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml index bd8f7b8ae0ff..966127e1ee63 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi-ddc.yaml @@ -15,10 +15,13 @@ description: | properties: compatible: - enum: - - mediatek,mt7623-hdmi-ddc - - mediatek,mt8167-hdmi-ddc - - mediatek,mt8173-hdmi-ddc + oneOf: + - const: mediatek,mt8173-hdmi-ddc + - items: + - enum: + - mediatek,mt7623-hdmi-ddc + - mediatek,mt8167-hdmi-ddc + - const: mediatek,mt8173-hdmi-ddc reg: maxItems: 1 From 95041262511eeec15aa14c53b7e7daf1355259c5 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:45 +0200 Subject: [PATCH 28/72] dtc: dt-check-style: Handle continued lines in check_hex_case() Continued lines are not separate DtsLine items in ctx.lines, so they need own iteration. Rule for hex case is applicable to continued values as well. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-1-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 24 ++++++++++++------- .../dt-style-selftest/bad/yaml-hex-case.yaml | 5 +++- .../expected/yaml-hex-case.yaml.txt | 2 ++ 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 0ebbe658b893..2d0463c626e5 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -547,18 +547,24 @@ def check_continuation_alignment(ctx): dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,') +def _check_hex_case(dl): + if dl.linetype in (LineType.BLANK, LineType.COMMENT, + LineType.COMMENT_START, LineType.COMMENT_BODY, + LineType.COMMENT_END, LineType.PREPROCESSOR): + return + for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): + lit = m.group(0) + if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': + yield (dl.lineno, + 'hex literal %r must be lowercase' % lit) + + def check_hex_case(ctx): """Hex literals (0xN) must use lowercase digits and prefix.""" for dl in ctx.lines: - if dl.linetype in (LineType.BLANK, LineType.COMMENT, - LineType.COMMENT_START, LineType.COMMENT_BODY, - LineType.COMMENT_END, LineType.PREPROCESSOR): - continue - for m in re.finditer(r'\b0[xX][0-9a-fA-F]+\b', dl.code): - lit = m.group(0) - if any(c.isupper() for c in lit[2:]) or lit[1] == 'X': - yield (dl.lineno, - 'hex literal %r must be lowercase' % lit) + yield from _check_hex_case(dl) + for cont in dl.continuations: + yield from _check_hex_case(cont) def check_indent_consistent(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml index c55359a4ca68..b0b8683b883a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-hex-case.yaml @@ -25,5 +25,8 @@ examples: - | foo@1000 { compatible = "example,test-hex-case"; - reg = <0xABCD 0x100>; + reg = <0xABCD 0x100>, + <0x2BCD 0x100>, + <0x3BCD + 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt index 6600f7cd1ba5..f42490256939 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-hex-case.yaml.txt @@ -1,2 +1,4 @@ # mode=strict bad/yaml-hex-case.yaml:28: example 0 [hex-case] hex literal '0xABCD' must be lowercase +bad/yaml-hex-case.yaml:29: example 0 [hex-case] hex literal '0x2BCD' must be lowercase +bad/yaml-hex-case.yaml:30: example 0 [hex-case] hex literal '0x3BCD' must be lowercase From 27e3cf7b9125af41acdb935ffb413e6a4f03e94d Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:46 +0200 Subject: [PATCH 29/72] dtc: dt-check-style: Handle continued lines in check_line_length() Continued lines are not separate DtsLine items in ctx.lines, so they need own iteration. Rule for length of line is applicable to continued values as well. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-2-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 18 ++++++++++++------ .../dt-style-selftest/bad/dts-line-length.dts | 3 ++- .../bad/yaml-line-length.yaml | 3 ++- .../expected/dts-line-length.dts.txt | 1 + .../expected/yaml-line-length.yaml.txt | 1 + 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 2d0463c626e5..525d9df6c11b 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -627,16 +627,22 @@ def check_indent_unit_strict(ctx): 'got %r' % unit) +def _check_line_length(dl): + if dl.linetype == LineType.BLANK: + return + cols = _display_col(dl.raw) + if cols > 80: + yield (dl.lineno, + 'line exceeds 80 columns (%d)' % cols) + + def check_line_length(ctx): """Lines must not exceed 80 columns; tabs count as 8 (see _display_col).""" for dl in ctx.lines: - if dl.linetype == LineType.BLANK: - continue - cols = _display_col(dl.raw) - if cols > 80: - yield (dl.lineno, - 'line exceeds 80 columns (%d)' % cols) + yield from _check_line_length(dl) + for cont in dl.continuations: + yield from _check_line_length(cont) def check_mixed_indent_chars(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts index bde91a922477..adf40e3c95f7 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-line-length.dts @@ -14,7 +14,8 @@ soc@0 { #size-cells = <1>; foo@1000 { - compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah"; + compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah", + "example,test-line-length-this-is-a-very-long-name-indeed-yeah-second"; reg = <0x1000 0x100>; }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml index 6e4140e500b5..6b1209ee4f26 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-line-length.yaml @@ -24,6 +24,7 @@ additionalProperties: false examples: - | foo@1000 { - compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah"; + compatible = "example,test-line-length-this-is-a-very-long-name-indeed-yeah", + "example,test-line-length-this-is-a-very-long-name-indeed-yeah-second"; reg = <0x1000 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt index 8ed08c309632..9cdb7550b56c 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-line-length.dts.txt @@ -1,2 +1,3 @@ # mode=stricter bad/dts-line-length.dts:17: [line-length-dts] line exceeds 80 columns (101) +bad/dts-line-length.dts:18: [line-length-dts] line exceeds 80 columns (108) diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt index 89b36360caa4..f21b823c6136 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-line-length.yaml.txt @@ -1,2 +1,3 @@ # mode=strict bad/yaml-line-length.yaml:27: example 0 [line-length] line exceeds 80 columns (81) +bad/yaml-line-length.yaml:28: example 0 [line-length] line exceeds 80 columns (88) From 77852e61c8f0bcca5aab708df649571c16388806 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:47 +0200 Subject: [PATCH 30/72] dtc: dt-check-style: Handle continued lines in check_trailing_whitespace() Continued lines are not separate DtsLine items in ctx.lines, so they need own iteration. Rule for trailing white-space is applicable to continued values as well. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-3-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 10 ++++++++-- scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts | 8 ++++++++ .../dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml | 5 ++++- .../dt-style-selftest/expected/dts-trailing-ws.dts.txt | 1 + .../expected/yaml-trailing-ws.yaml.txt | 2 ++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 525d9df6c11b..4ac10cb45068 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -976,10 +976,16 @@ def check_tab_in_yaml_example(ctx): yield (cont.lineno, 'tab character not allowed in DTS example') +def _check_trailing_whitespace(dl): + if dl.raw != dl.raw.rstrip(): + yield (dl.lineno, 'trailing whitespace') + + def check_trailing_whitespace(ctx): for dl in ctx.lines: - if dl.raw != dl.raw.rstrip(): - yield (dl.lineno, 'trailing whitespace') + yield from _check_trailing_whitespace(dl) + for cont in dl.continuations: + yield from _check_trailing_whitespace(cont) def check_unclosed_block_comment(ctx): diff --git a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts index 1eb24d91c640..73c24525ce18 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-trailing-ws.dts @@ -5,4 +5,12 @@ / { compatible = "example,test-board"; #address-cells = <1>; #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + reg = <0x10000 0x1000>; + clocks = <1 2 3>, + <4 5 6>, + <7 8 9>; + }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml index f338c14174e6..17eeed3411c6 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-trailing-ws.yaml @@ -25,5 +25,8 @@ examples: - | device@1000 { compatible = "example,test-trailing"; - reg = <0x1000 0x100>; + reg = <0x1000 0x100>, + <0x2000 0x100>, + <0x3000 + 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt index 94d9ae9d616c..a15a7d637c30 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-trailing-ws.dts.txt @@ -1,2 +1,3 @@ # mode=relaxed bad/dts-trailing-ws.dts:5: [trailing-whitespace] trailing whitespace +bad/dts-trailing-ws.dts:13: [trailing-whitespace] trailing whitespace diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt index cfdbc8476c73..4f2ec9572bc6 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-trailing-ws.yaml.txt @@ -1,2 +1,4 @@ # mode=relaxed bad/yaml-trailing-ws.yaml:27: example 0 [trailing-whitespace] trailing whitespace +bad/yaml-trailing-ws.yaml:29: example 0 [trailing-whitespace] trailing whitespace +bad/yaml-trailing-ws.yaml:30: example 0 [trailing-whitespace] trailing whitespace From c6138ed5cec688f86c4c2b872c6fb872b162987a Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:48 +0200 Subject: [PATCH 31/72] dtc: dt-check-style: Unduplicate checks in check_mixed_indent_chars() Code checking each DtsLine and continuations is the same, so split it to separate function to avoid duplicated code. This has a positive side effect - if DtsLine did not have indentation, then check continued to next one, but now it will still go through the continued lines in the second loop. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-4-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 4ac10cb45068..41c97d996882 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -645,27 +645,24 @@ def check_line_length(ctx): yield from _check_line_length(cont) +def _check_mixed_indent_chars(dl): + if not dl.indent_str: + return + if dl.linetype == LineType.PREPROCESSOR: + return + if re.search(r' \t', dl.indent_str): + yield (dl.lineno, 'mixed tabs and spaces in indent') + if dl.indent_str.count(' ') > 7: + yield (dl.lineno, 'too many space characters in indent (more than 7)') + + def check_mixed_indent_chars(ctx): """Indent must be all-tabs, except for aligning indentation (comments or continued lines).""" for dl in ctx.lines: - if not dl.indent_str: - continue - if dl.linetype == LineType.PREPROCESSOR: - continue - if re.search(r' \t', dl.indent_str): - yield (dl.lineno, 'mixed tabs and spaces in indent') - if dl.indent_str.count(' ') > 7: - yield (dl.lineno, 'too many space characters in indent (more than 7)') + yield from _check_mixed_indent_chars(dl) for cont in dl.continuations: - if not cont.indent_str: - continue - if cont.linetype == LineType.PREPROCESSOR: - continue - if re.search(r' \t', cont.indent_str): - yield (cont.lineno, 'mixed tabs and spaces in indent') - if cont.indent_str.count(' ') > 7: - yield (cont.lineno, 'too many space characters in indent (more than 7)') + yield from _check_mixed_indent_chars(cont) def check_node_close_alone(ctx): From 897e4c0de6e6fda41815ae0457db0e254fc67821 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:49 +0200 Subject: [PATCH 32/72] dtc: dt-check-style: Right strip whitespaces, leftovers before comments Stripping a comment from a line to get the code leads trailing whitespace (e.g. in a line like "enable-active-high; /* comment */") which will break DtsLine.code.endswith() checks. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-5-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 41c97d996882..a36c45c29476 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -91,7 +91,8 @@ class DtsLine: self.indent_str = indent_str # leading whitespace as-is self.depth = depth self.stripped = stripped # Code without indentation - self.code = _strip_strings_and_comments(stripped) # Only the code, skipping trailing comments + # Only the code, skipping trailing comments and space between code and trailing comment + self.code = _strip_strings_and_comments(stripped).rstrip() self.is_root = is_root self.prop_name = None self.continuations = [] From e97e9becf957216855a6b182ca5c1d0bc5e5065d Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:50 +0200 Subject: [PATCH 33/72] dtc: dt-check-style: Properly detect comments in multi-line properties Code classifying given line exits on first condition match, thus a line consisting only of a comment in a continued (multi-line) property, like: interrupts = , /* Performance counter interrupts */ ; was treated as a comment-line line, not as continuation, leading to false positive warnings of invalid indentation: arch/arm64/boot/dts/tesla/fsd.dtsi:456: [indent-consistent] indent mismatch (expected depth 3 * '\t') This needs two related fixes: 1. Move the judgment as a LineType.CONTINUATION earlier before one classifying as a comment 2. Check the comment-stripped DtsLine.code, not DtsLine.stripped, to verify if it is a continuation. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-6-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 19 ++++++++++--------- .../dt-style-selftest/bad/dts-cont-align.dts | 1 + .../bad/yaml-cont-align.yaml | 1 + .../expected/dts-cont-align.dts.txt | 11 ++++++----- .../expected/yaml-cont-align.yaml.txt | 3 ++- .../dt-style-selftest/good/dts-cont-align.dts | 1 + .../good/yaml-cont-align.yaml | 1 + 7 files changed, 22 insertions(+), 15 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index a36c45c29476..cbbb8d384aca 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -202,6 +202,14 @@ def classify_lines(text): if opens_block: in_block_comment = True + if not prev_complete: + dl = DtsLine(i, raw, LineType.CONTINUATION, depth, indent_str, code) + out.append(dl) + prev_complete = (code.endswith(';') or + code.endswith('{') or + code.endswith('};')) + continue + # Pure-comment line: nothing left after stripping. Classify as # COMMENT_START (carries to next line) or COMMENT, and skip the # structural classification entirely. @@ -211,14 +219,6 @@ def classify_lines(text): out.append(dl) continue - if not prev_complete: - dl = DtsLine(i, raw, LineType.CONTINUATION, depth, indent_str, code) - out.append(dl) - prev_complete = (code.endswith(';') or - code.endswith('{') or - code.endswith('};')) - continue - # NODE_CLOSE: the canonical form is "}" or "};" alone. A line # that is nothing but closures (e.g. "}; };") is still treated # as NODE_CLOSE for depth tracking, but the multi-closure case @@ -545,7 +545,8 @@ def check_continuation_alignment(ctx): 'continuation should align to column %d ' '(%s)' % (target_col + target_offset + 1, err_msg_explanation)) # Align to the value within <> or "" of continuation (so the previous line) - dl_value_complete = cont.stripped.endswith('",') or cont.stripped.endswith('>,') + if len(cont.code): + dl_value_complete = cont.code.endswith('",') or cont.code.endswith('>,') def _check_hex_case(dl): diff --git a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts index 5390ebbf4059..91a74887c774 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-cont-align.dts @@ -11,6 +11,7 @@ interrupt-controller@10000 { reg = <0x10000 0x1000>; clocks = <1 2 3>, /* comments with " < , should not matter */ <4 5 6>, + /* but comments should be placed properly */ <7 8 9>; interrupts = <1 2 3>, /* comments with " < , should not ... */ <4 5 6>, diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml index a5a9eb17fc17..0189b654a5b0 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-cont-align.yaml @@ -27,6 +27,7 @@ examples: compatible = "example,test-cont-align"; reg = <0x1000 0x100>, /* comments with " < , should not matter */ <0x2000 0x100>, /* comments with " < , should not matter */ + /* but comments should be placed properly */ <0x3000 0x100>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt index a7ed62677a2b..fd7f389d6cce 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-cont-align.dts.txt @@ -1,10 +1,11 @@ # mode=strict bad/dts-cont-align.dts:13: [continuation-alignment] continuation should align to column 26 (to < or ") bad/dts-cont-align.dts:14: [continuation-alignment] continuation should align to column 26 (to < or ") -bad/dts-cont-align.dts:16: [continuation-alignment] continuation should align to column 30 (to < or ") +bad/dts-cont-align.dts:15: [continuation-alignment] continuation should align to column 26 (to < or ") bad/dts-cont-align.dts:17: [continuation-alignment] continuation should align to column 30 (to < or ") -bad/dts-cont-align.dts:19: [continuation-alignment] continuation should align to column 27 (to the value under <) -bad/dts-cont-align.dts:20: [continuation-alignment] continuation should align to column 26 (to < or ") -bad/dts-cont-align.dts:21: [continuation-alignment] continuation should align to column 27 (to the value under <) -bad/dts-cont-align.dts:23: [continuation-alignment] continuation should align to column 38 (to < or ") +bad/dts-cont-align.dts:18: [continuation-alignment] continuation should align to column 30 (to < or ") +bad/dts-cont-align.dts:20: [continuation-alignment] continuation should align to column 27 (to the value under <) +bad/dts-cont-align.dts:21: [continuation-alignment] continuation should align to column 26 (to < or ") +bad/dts-cont-align.dts:22: [continuation-alignment] continuation should align to column 27 (to the value under <) bad/dts-cont-align.dts:24: [continuation-alignment] continuation should align to column 38 (to < or ") +bad/dts-cont-align.dts:25: [continuation-alignment] continuation should align to column 38 (to < or ") diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt index eb9a84d5c222..9e98c28867aa 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-cont-align.yaml.txt @@ -1,3 +1,4 @@ # mode=strict bad/yaml-cont-align.yaml:29: example 0 [continuation-alignment] continuation should align to column 11 (to < or ") -bad/yaml-cont-align.yaml:31: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <) +bad/yaml-cont-align.yaml:30: example 0 [continuation-alignment] continuation should align to column 11 (to < or ") +bad/yaml-cont-align.yaml:32: example 0 [continuation-alignment] continuation should align to column 12 (to the value under <) diff --git a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts index b52ee6cccd8c..e6450a1d8209 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-cont-align.dts @@ -17,6 +17,7 @@ interrupt-controller@10000 { reg = <0x10000 0x1000>; interrupts = <1 2 3>, /* comments with " < , should not ... */ <4 5 6>, + /* but comments should be placed properly */ <7 8 9>; pinmux = <0x01 0x02>, diff --git a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml index 8463075f9f4c..4a5b5ad43ee8 100644 --- a/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml +++ b/scripts/dtc/dt-style-selftest/good/yaml-cont-align.yaml @@ -27,6 +27,7 @@ examples: compatible = "example,test-cont-align"; reg = <0x1000 0x100>, <0x2000 0x100>, + /* but comments should be placed properly */ <0x3000 0x100>; }; From c08fe4da4acc36103152cd310a9eb64a99c161d2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Tue, 15 Sep 2026 19:03:51 +0200 Subject: [PATCH 34/72] dtc: dt-check-style: Relax property ordering rules (drop alphabetical) Existing rules checked whether properties follow DTS Coding Style guidelines in respect of common properties and standard vs vendor properties, plus additionally it enforced alphabetical order within each of such group. The in-tree DTS does not follow such style at all, so this lead to many warnings. There is little value in fixing these warnings, because DTS with non-alphabetical order of properties is exactly the same readable, even though DTS Coding Style mentions natural order. Actually groupping properties logically, e.g. all supplies together regardless of their name, is more readable than pure natural sort. Relax the property order rules to the most important aspects (device_type, reg/reg-names, ranges, standard properties, vendor properties, status) and skip the alphabetical sorting completely. Assisted-by: LLM Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260915-b4-dts-style-checker-continued-lines-v4-7-5b8e09b11ef2@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/dts-coding-style.rst | 5 +- scripts/dtc/dt-check-style | 137 ++++++++---------- .../bad/dts-property-order.dts | 3 + .../bad/dts-property-order.dtso | 3 + .../bad/yaml-prop-order.yaml | 5 + .../expected/dts-property-order.dts.txt | 7 +- .../expected/dts-property-order.dtso.txt | 7 +- .../expected/yaml-prop-order.yaml.txt | 1 + .../expected/yaml-prop-pairing.yaml.txt | 4 +- .../good/dts-property-order.dts | 3 + .../good/dts-property-order.dtso | 3 + 11 files changed, 89 insertions(+), 89 deletions(-) diff --git a/Documentation/devicetree/bindings/dts-coding-style.rst b/Documentation/devicetree/bindings/dts-coding-style.rst index 63648db377e1..441436b7fa80 100644 --- a/Documentation/devicetree/bindings/dts-coding-style.rst +++ b/Documentation/devicetree/bindings/dts-coding-style.rst @@ -135,8 +135,9 @@ The above-described ordering follows this approach: 3. Status is the last information to annotate that device node is or is not finished (board resources are needed). -The individual properties inside each group shall use natural sort order by -the property name. +The individual properties inside each group shall use usually natural sort +order by the property name, with exceptions of logical grouping of properties, +e.g. supplies. Example:: diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index cbbb8d384aca..b8c40873905c 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -714,65 +714,40 @@ def check_property_name(ctx): yield (dl.lineno, f'property name "{dl.prop_name}" is using discouraged style') -def _property_bucket(name): - """Return the canonical bucket index for a property: - 0 device_type +def _property_bucket(name, is_root=False): + """Return the canonical bucket (group) index for a property: + 0 device_type ('model' in the root node) 1 compatible - 2 reg / reg-names + 2 reg, reg-names 3 ranges 4 standard properties (no vendor comma in #-stripped name) 5 vendor-specific properties 6 status - Plus a sub-key inside the bucket for fixed slots (device_type, compatible, - reg, reg-names, ranges, status). 'standard' and 'vendor' return None for - the sub-key, signalling that the within-bucket key is computed by - the pairing rules.""" + Properties sharing a bucket compare equal: their relative order + within the group is not checked, only the pairing rules below + apply.""" stripped = name.lstrip('#') - if name == 'device_type': - return (0, 0) + if is_root: + if name == 'model': + return 0 + elif name == 'device_type': + return 0 if name == 'compatible': - return (1, 0) - if name == 'reg': - return (2, 0) - if name == 'reg-names': - return (2, 1) + return 1 + if name in ('reg', 'reg-names'): + return 2 if name == 'ranges': - return (3, 0) + return 3 if name == 'status': - return (6, 0) - return (5 if ',' in stripped else 4, None) - - -def _property_bucket_root(name): - """Return the canonical bucket index for a property: - 0 model (for root nodes only) - 1 compatible - Plus a sub-key inside the bucket for fixed slots (device_type, compatible, - reg, reg-names, ranges, status). 'standard' and 'vendor' return None for - the sub-key, signalling that the within-bucket key is computed by - the pairing rules.""" - stripped = name.lstrip('#') - if name == 'model': - return (0, 0) - if name == 'compatible': - return (1, 0) - if name == 'reg': - return (2, 0) - if name == 'reg-names': - return (2, 1) - if name == 'ranges': - return (3, 0) - if name == 'status': - return (6, 0) - return (5 if ',' in stripped else 4, None) + return 6 + return 5 if ',' in stripped else 4 # Declarative pairing rules: each is a callable # (name, all_names) -> anchor_name_or_None -# If a rule returns an anchor, the property sorts immediately after the +# If a rule returns an anchor, the property must be placed after the # anchor. Rules are tried in order; the first match wins. If none -# matches, the within-bucket key falls back to natural sort by the -# #-stripped name. +# matches, the property can be placed anywhere within its bucket. def _pair_pinctrl_names(name, all_names): """pinctrl-names follows the highest pinctrl-N in the same node.""" @@ -787,8 +762,7 @@ def _pair_pinctrl_names(name, all_names): def _pair_x_names(name, all_names): """Generic -names follows its owning property. The owner is usually plural (clocks/clock-names, dmas/dma-names, - resets/reset-names) but occasionally singular (reg/reg-names is - handled by the fixed slot above; this rule catches anything else).""" + resets/reset-names) but occasionally singular (reg/reg-names).""" if not name.endswith('-names'): return None base = name[:-len('-names')] @@ -803,33 +777,27 @@ def _pair_x_names(name, all_names): PAIRING_RULES = (_pair_pinctrl_names, _pair_x_names) -def _property_sort_key(dl, name, all_names): - """Sort key for a property among its node-body siblings. - - Format: (bucket, within_key, tiebreak). 'within_key' for - standard/vendor buckets follows pairing rules: a property paired - with anchor X sorts as if it were X with a higher tiebreak.""" - if dl.is_root: - bucket, fixed_sub = _property_bucket_root(name) - else: - bucket, fixed_sub = _property_bucket(name) - if fixed_sub is not None: - return (bucket, (), fixed_sub) - +def _property_anchor(name, all_names): + """Return the property this one must be placed after, or None.""" for rule in PAIRING_RULES: anchor = rule(name, all_names) if anchor is not None: - return (bucket, _natural_sort_key(anchor.lstrip('#')), 1) - - return (bucket, _natural_sort_key(name.lstrip('#')), 0) + return anchor + return None def check_property_order(ctx): - """Properties within a node body must appear in canonical order: - compatible, reg(/reg-names), ranges, then the standard group, then - the vendor-specific group, then status. Inside the standard and - vendor groups, pairing rules apply (e.g. -names follows ); - everything else falls back to natural sort by the #-stripped name.""" + """Properties within a node body must be grouped in canonical + order: device_type ('model' for the root node), compatible, + reg(/reg-names), ranges, then the standard group, then the + vendor-specific group, then status. + + The order of properties within one group is free, e.g. it does not + matter whether '#address-cells' comes before or after 'clocks'. + Paired properties still keep their relative order: -names + follows (clocks/clock-names, reg/reg-names, ...), pinctrl-names + follows the pinctrl-N states and #size-cells follows + #address-cells.""" lines = ctx.lines for i, dl in enumerate(lines): if dl.linetype != LineType.NODE_OPEN: @@ -847,16 +815,26 @@ def check_property_order(ctx): if len(props) < 2: continue all_names = [p.prop_name for p in props] - keyed = [(p, _property_sort_key(dl, p.prop_name, all_names)) - for p in props] - for k in range(1, len(keyed)): - if keyed[k][1] < keyed[k - 1][1]: - p = keyed[k][0] - prev = keyed[k - 1][0] - yield (p.lineno, - 'property %r out of canonical order ' - '(should sort before %r)' % - (p.prop_name, prev.prop_name)) + buckets = [_property_bucket(p.prop_name, dl.is_root) for p in props] + findings = [] + # Group (bucket) order + for k in range(1, len(props)): + if buckets[k] < buckets[k - 1]: + findings.append((props[k].lineno, + 'property %r out of canonical order ' + '(should sort before %r)' % + (props[k].prop_name, + props[k - 1].prop_name))) + # Pairing within a group: the anchor must come first + seen = set() + for p in props: + anchor = _property_anchor(p.prop_name, all_names) + if anchor is not None and anchor not in seen: + findings.append((p.lineno, + 'property %r must be placed after %r' % + (p.prop_name, anchor))) + seen.add(p.prop_name) + yield from sorted(findings) def _check_redundant_whitespace(dl): @@ -1152,7 +1130,8 @@ RULES = [ 'property names use only recommended characters (see DTS Coding Style)', check_property_name), Rule('property-order', 'strict', - 'canonical bucket + pairing + natural-sort order of properties', + 'canonical group + pairing order of properties (order within ' + 'a group is not checked)', check_property_order), # See also check_redundant_whitespace() and check_value_whitespace() Rule('redundant-whitespace-strict', 'strict', diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts index ebe561e38766..eb36daa4fe72 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dts @@ -43,6 +43,9 @@ interrupt-controller@10000 { <4 5 6>, <7 8 9>; compatible = "example,intc"; + qcom,calibration-variant = "foo"; + clocks = <6>; + qcom,opp-fuse-level = <1>; }; }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso index 64604fa6b8c3..b2e564f2af2b 100644 --- a/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso +++ b/scripts/dtc/dt-style-selftest/bad/dts-property-order.dtso @@ -44,6 +44,9 @@ interrupt-controller@10000 { <4 5 6>, <7 8 9>; compatible = "example,intc"; + qcom,calibration-variant = "foo"; + clocks = <6>; + qcom,opp-fuse-level = <1>; }; }; }; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml index bf1480e97209..4d8a50d0e35a 100644 --- a/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml +++ b/scripts/dtc/dt-style-selftest/bad/yaml-prop-order.yaml @@ -26,4 +26,9 @@ examples: device@1000 { reg = <0x1000 0x100>; compatible = "example,test-prop-order"; + + interrupts = <1>; + qcom,calibration-variant = "foo"; + clocks = <6>; + qcom,opp-fuse-level = <1>; }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt index 0ab832ccf07a..155b072f0ac2 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dts.txt @@ -6,6 +6,7 @@ bad/dts-property-order.dts:21: [property-order] property 'device_type' out of ca bad/dts-property-order.dts:30: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') bad/dts-property-order.dts:35: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') bad/dts-property-order.dts:45: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') -bad/dts-property-order.dts:50: [redundant-whitespace] extra whitespace before { -bad/dts-property-order.dts:52: [property-order] property 'model' out of canonical order (should sort before 'compatible') -bad/dts-property-order.dts:57: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:47: [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant') +bad/dts-property-order.dts:53: [redundant-whitespace] extra whitespace before { +bad/dts-property-order.dts:55: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dts:60: [property-order] property 'model' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt index 9f2a00916329..48c020d21b64 100644 --- a/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt +++ b/scripts/dtc/dt-style-selftest/expected/dts-property-order.dtso.txt @@ -6,6 +6,7 @@ bad/dts-property-order.dtso:22: [property-order] property 'device_type' out of c bad/dts-property-order.dtso:31: [property-order] property 'dma-coherent' out of canonical order (should sort before 'status') bad/dts-property-order.dtso:36: [property-order] property 'compatible' out of canonical order (should sort before 'ranges') bad/dts-property-order.dtso:46: [property-order] property 'compatible' out of canonical order (should sort before 'interrupts') -bad/dts-property-order.dtso:51: [redundant-whitespace] extra whitespace before { -bad/dts-property-order.dtso:53: [property-order] property 'model' out of canonical order (should sort before 'compatible') -bad/dts-property-order.dtso:58: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:48: [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant') +bad/dts-property-order.dtso:54: [redundant-whitespace] extra whitespace before { +bad/dts-property-order.dtso:56: [property-order] property 'model' out of canonical order (should sort before 'compatible') +bad/dts-property-order.dtso:61: [property-order] property 'model' out of canonical order (should sort before 'compatible') diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt index 578df7209170..bb0dd5db5135 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-order.yaml.txt @@ -1,2 +1,3 @@ # mode=strict bad/yaml-prop-order.yaml:28: example 0 [property-order] property 'compatible' out of canonical order (should sort before 'reg') +bad/yaml-prop-order.yaml:32: example 0 [property-order] property 'clocks' out of canonical order (should sort before 'qcom,calibration-variant') diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt index e6e21349a939..ee666559424a 100644 --- a/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt +++ b/scripts/dtc/dt-style-selftest/expected/yaml-prop-pairing.yaml.txt @@ -1,3 +1,3 @@ # mode=strict -bad/yaml-prop-pairing.yaml:30: example 0 [property-order] property 'clocks' out of canonical order (should sort before 'clock-names') -bad/yaml-prop-pairing.yaml:32: example 0 [property-order] property 'pinctrl-0' out of canonical order (should sort before 'pinctrl-names') +bad/yaml-prop-pairing.yaml:29: example 0 [property-order] property 'clock-names' must be placed after 'clocks' +bad/yaml-prop-pairing.yaml:31: example 0 [property-order] property 'pinctrl-names' must be placed after 'pinctrl-0' diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts index 3d847cc9fa3e..288fcfb9888f 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dts +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dts @@ -40,7 +40,10 @@ soc@0 { interrupt-controller@10000 { compatible = "example,intc"; reg = <0x10000 0x1000>; + clocks = <6>; interrupts = <1 2 3>; + qcom,calibration-variant = "foo"; + qcom,opp-fuse-level = <1>; }; }; }; diff --git a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso index 5ae78541f68b..60c68b3f908a 100644 --- a/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso +++ b/scripts/dtc/dt-style-selftest/good/dts-property-order.dtso @@ -41,7 +41,10 @@ soc@0 { interrupt-controller@10000 { compatible = "example,intc"; reg = <0x10000 0x1000>; + clocks = <6>; interrupts = <1 2 3>; + qcom,calibration-variant = "foo"; + qcom,opp-fuse-level = <1>; }; }; }; From d5eefb1d97ad476c734997fa6741651dde610ceb Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 11 Sep 2026 13:42:04 +0200 Subject: [PATCH 35/72] dtc: dt-check-style: Re-work classifying property continuations Script has an enumeration of DTS Line types (LineType) and one type is a continuation of multi-line property. This has limitations, because it basically hides true type of a continued line which makes certain checks difficult. For example detecting consecutive blank lines (LineType.BLANK) will fail if the type is continuation. clock-names = "foo", /* Comment */ "bar"; Above code not only fails check_blank_lines() rule, but also messes up how DtsLine array is constructed - the two middle continued lines are not put under the DtsLine.continuations array. The concepts of type of line (blank, preprocessor, property etc) and actual continuation are orthogonal to most of the checks - the checks need to know what sort of continued line it is. Fixing this solves false positives of continued properties with blank lines and comments: arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi:135: [blank-lines] consecutive blank lines arch/arm64/boot/dts/exynos/exynos5433-tm2-common.dtsi:135: [blank-lines] blank line at end of node body Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260911-dts-style-checker-blank-lines-v1-1-85e779600d98@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index b8c40873905c..46aa4dda6d33 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -44,7 +44,6 @@ class LineType(Enum): NODE_OPEN = auto() # something { (with optional label/name/addr) NODE_CLOSE = auto() # }; PROPERTY = auto() # name = value; or name; - CONTINUATION = auto() # continuation of a multi-line property re_cpp_directive = re.compile( @@ -80,11 +79,12 @@ def is_preprocessor(stripped): class DtsLine: __slots__ = ('lineno', 'raw', 'code', 'linetype', 'indent_str', 'stripped', 'is_root', - 'prop_name', 'continuations', + 'prop_name', 'continuation', 'continuations', 'node_name', 'node_addr', 'label', 'ref_name', 'parent', 'depth', 'closures') - def __init__(self, lineno, raw, linetype, depth, indent_str, stripped, is_root = False): + def __init__(self, lineno, raw, linetype, depth, indent_str, stripped, + continuation = False, is_root = False): self.lineno = lineno # 1-based within the block self.raw = raw # Entire raw line self.linetype = linetype @@ -95,6 +95,7 @@ class DtsLine: self.code = _strip_strings_and_comments(stripped).rstrip() self.is_root = is_root self.prop_name = None + self.continuation = continuation # Continuation of a multi-line property self.continuations = [] self.node_name = None self.node_addr = None @@ -175,7 +176,7 @@ def classify_lines(text): continue if not stripped: - dl = DtsLine(i, raw, LineType.BLANK, depth, '', '') + dl = DtsLine(i, raw, LineType.BLANK, depth, '', '', continuation=not prev_complete) out.append(dl) continue @@ -184,7 +185,7 @@ def classify_lines(text): else LineType.COMMENT_BODY) if ltype == LineType.COMMENT_END: in_block_comment = False - dl = DtsLine(i, raw, ltype, depth, indent_str, stripped) + dl = DtsLine(i, raw, ltype, depth, indent_str, stripped, continuation=not prev_complete) out.append(dl) continue @@ -202,20 +203,12 @@ def classify_lines(text): if opens_block: in_block_comment = True - if not prev_complete: - dl = DtsLine(i, raw, LineType.CONTINUATION, depth, indent_str, code) - out.append(dl) - prev_complete = (code.endswith(';') or - code.endswith('{') or - code.endswith('};')) - continue - # Pure-comment line: nothing left after stripping. Classify as # COMMENT_START (carries to next line) or COMMENT, and skip the # structural classification entirely. if not code: ltype = LineType.COMMENT_START if opens_block else LineType.COMMENT - dl = DtsLine(i, raw, ltype, depth, indent_str, stripped) + dl = DtsLine(i, raw, ltype, depth, indent_str, stripped, continuation=not prev_complete) out.append(dl) continue @@ -245,7 +238,8 @@ def classify_lines(text): continue # Property (or first line of a multi-line property). - dl = DtsLine(i, raw, LineType.PROPERTY, depth, indent_str, code) + dl = DtsLine(i, raw, LineType.PROPERTY, depth, indent_str, code, + continuation=not prev_complete) parse_property_name(dl) out.append(dl) prev_complete = code.endswith(';') @@ -254,7 +248,7 @@ def classify_lines(text): last_prop = None grouped = [] for dl in out: - if dl.linetype == LineType.CONTINUATION and last_prop is not None: + if dl.continuation and last_prop is not None: last_prop.continuations.append(dl) continue if dl.linetype == LineType.PROPERTY: @@ -535,6 +529,8 @@ def check_continuation_alignment(ctx): dl_value_complete = rest.endswith('",') or rest.endswith('>,') target_col = _display_col(_strip_strings_and_comments(dl.raw[:eq + 1 + m.start(1)])) for cont in dl.continuations: + if cont.linetype == LineType.BLANK: + continue target_offset = 0 err_msg_explanation = 'to < or "' if not dl_value_complete: @@ -582,10 +578,10 @@ def check_indent_consistent(ctx): return for dl in ctx.lines: + if dl.continuation: + continue # continuations align to <, not to indent unit if dl.linetype in (LineType.BLANK, LineType.PREPROCESSOR): continue - if dl.linetype == LineType.CONTINUATION: - continue # continuations align to <, not to indent unit if dl.linetype in (LineType.COMMENT_BODY, LineType.COMMENT_END): continue if not dl.indent_str: @@ -890,6 +886,8 @@ def check_required_blank_lines(ctx): if d.linetype == LineType.NODE_CLOSE and \ d.depth == body_depth - 1 and depth_inside == 0: break + if d.continuation: + continue # Track depth inside nested children so we only look at # immediate-body items. if d.linetype == LineType.NODE_OPEN and \ @@ -909,8 +907,6 @@ def check_required_blank_lines(ctx): LineType.COMMENT_BODY, LineType.COMMENT_END, LineType.PREPROCESSOR): continue - if d.linetype == LineType.CONTINUATION: - continue needs_blank = False if d.linetype == LineType.NODE_OPEN: From 117d30d3107afcdbb5e681aadbd86d925675c0e2 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 11 Sep 2026 13:42:05 +0200 Subject: [PATCH 36/72] dtc: dt-check-style: Handle multiple blank lines in continued properties Properly ignore comments and report duplicated blank lines in multi-line properties. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260911-dts-style-checker-blank-lines-v1-2-85e779600d98@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- scripts/dtc/dt-check-style | 6 +++ .../dt-style-selftest/bad/dts-blank-lines.dts | 37 +++++++++++++ .../bad/yaml-blank-lines.yaml | 54 +++++++++++++++++++ .../expected/dts-blank-lines.dts.txt | 6 +++ .../expected/yaml-blank-lines.yaml.txt | 6 +++ 5 files changed, 109 insertions(+) create mode 100644 scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts create mode 100644 scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml create mode 100644 scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt create mode 100644 scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt diff --git a/scripts/dtc/dt-check-style b/scripts/dtc/dt-check-style index 46aa4dda6d33..6bbd12b308a1 100755 --- a/scripts/dtc/dt-check-style +++ b/scripts/dtc/dt-check-style @@ -440,6 +440,12 @@ def check_blank_lines(ctx): if lines[i].linetype == LineType.BLANK and \ lines[i - 1].linetype == LineType.BLANK: yield (lines[i].lineno, 'consecutive blank lines') + prev_is_blank = lines[i].linetype == LineType.BLANK + for cont in lines[i].continuations: + if cont.linetype == LineType.BLANK and prev_is_blank: + yield (cont.lineno, 'consecutive blank lines') + prev_is_blank = cont.linetype == LineType.BLANK + # Blank right after { or right before } for i, dl in enumerate(lines): if dl.linetype != LineType.BLANK: diff --git a/scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts b/scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts new file mode 100644 index 000000000000..f2e99fb7bb29 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/dts-blank-lines.dts @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +/dts-v1/; + +/ { + compatible = "example,test-board"; + #address-cells = <1>; + #size-cells = <1>; + + interrupt-controller@10000 { + compatible = "example,intc"; + + reg = <0x10000 0x1000>; + + clocks = <1 2 3>, + + + /* Comment is not a blank line */ + <4 5 6>, + + /* Comment is not a blank line */ + <7 8 9>; + + + interrupts = <1>; + + /* Comment is not a blank line */ + qcom,calibration-variant = "foo"; + }; + + + interrupt-controller@20000 { + + compatible = "example,intc"; + reg = <0x20000 0x1000>; + + }; +}; diff --git a/scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml b/scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml new file mode 100644 index 000000000000..a58cd534a003 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/bad/yaml-blank-lines.yaml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/test-bad-blank-lines.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Test fixture with too many blank lines + +maintainers: + - Test User + +properties: + compatible: + const: example,test-blank-lines + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + foo@1000 { + compatible = "example,test-blank-lines"; + + reg = <0x1000 0x100>; + + clocks = <1 2 3>, + + + /* Comment is not a blank line */ + <4 5 6>, + + /* Comment is not a blank line */ + <7 8 9>; + + + interrupts = <1>; + + /* Comment is not a blank line */ + qcom,calibration-variant = "foo"; + }; + + + foo@2000 { + + compatible = "example,test-blank-lines"; + + reg = <0x2000 0x100>; + + }; diff --git a/scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt b/scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt new file mode 100644 index 000000000000..97617bc42a17 --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/dts-blank-lines.dts.txt @@ -0,0 +1,6 @@ +# mode=strict +bad/dts-blank-lines.dts:16: [blank-lines] consecutive blank lines +bad/dts-blank-lines.dts:23: [blank-lines] consecutive blank lines +bad/dts-blank-lines.dts:30: [blank-lines] consecutive blank lines +bad/dts-blank-lines.dts:32: [blank-lines] blank line at start of node body +bad/dts-blank-lines.dts:35: [blank-lines] blank line at end of node body diff --git a/scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt b/scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt new file mode 100644 index 000000000000..8a8db8d35b1e --- /dev/null +++ b/scripts/dtc/dt-style-selftest/expected/yaml-blank-lines.yaml.txt @@ -0,0 +1,6 @@ +# mode=strict +bad/yaml-blank-lines.yaml:33: example 0 [blank-lines] consecutive blank lines +bad/yaml-blank-lines.yaml:40: example 0 [blank-lines] consecutive blank lines +bad/yaml-blank-lines.yaml:47: example 0 [blank-lines] consecutive blank lines +bad/yaml-blank-lines.yaml:49: example 0 [blank-lines] blank line at start of node body +bad/yaml-blank-lines.yaml:53: example 0 [blank-lines] blank line at end of node body From cfbc5d96e8ff47a35821dfd6acf3146e67cfb9fe Mon Sep 17 00:00:00 2001 From: Douglas Anderson Date: Fri, 14 Aug 2026 12:46:12 -0700 Subject: [PATCH 37/72] dt-bindings: mailbox: Delete old 'mailbox.txt' bindings file As per mailing-list discussions [1] [2] [3], we want to delete the following old file from the device-tree bindings that live in the Linux kernel git tree: * Documentation/devicetree/bindings/mailbox/mailbox.txt The old .txt file did have some descriptive text about what some of the properties meant. Those have been added to the dt-schema repository in a pull request [4]. Also remove dangling references to `mailbox.txt` across all remaining device-tree binding documentation files. Link: https://lore.kernel.org/r/20260722140214.GA548057-robh@kernel.org [1] Link: https://lore.kernel.org/r/dc7a2041-50a4-482e-9930-566bb3fd1e72@kernel.org [2] Link: https://lore.kernel.org/r/CAL_JsqKVjQ2m-dzMUENQry-f_YE9QrYSOKoH9CPj1gjj8XkPRA@mail.gmail.com [3] Link: https://github.com/devicetree-org/dt-schema/pull/202 [4] Cc: Sudeep Holla Cc: Jassi Brar Cc: Lee Jones Signed-off-by: Douglas Anderson Link: https://patch.msgid.link/20260814124603.v2.1.I8b3ff71c528133e7d6f81fe926fa39e6451d63fd@changeid Signed-off-by: Rob Herring (Arm) --- .../firmware/nvidia,tegra186-bpmp.yaml | 6 +- .../mailbox/allwinner,sun6i-a31-msgbox.yaml | 3 - .../bindings/mailbox/altera-mailbox.txt | 12 ++-- .../mailbox/hisilicon,hi3660-mailbox.txt | 2 +- .../mailbox/hisilicon,hi6220-mailbox.txt | 2 +- .../devicetree/bindings/mailbox/mailbox.txt | 60 ------------------- .../bindings/mailbox/ti,omap-mailbox.yaml | 3 +- .../power/reset/xlnx,zynqmp-power.yaml | 9 +-- .../bindings/soc/qcom/qcom,aoss-qmp.yaml | 2 +- 9 files changed, 15 insertions(+), 84 deletions(-) delete mode 100644 Documentation/devicetree/bindings/mailbox/mailbox.txt diff --git a/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml b/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml index 3c44fe607e12..acdc5c1d3d8b 100644 --- a/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml +++ b/Documentation/devicetree/bindings/firmware/nvidia,tegra186-bpmp.yaml @@ -18,11 +18,9 @@ description: | which can create the interprocessor communication (IPC) between the CPU and BPMP. - This node is a mailbox consumer. See the following files for details - of the mailbox subsystem, and the specifiers implemented by the - relevant provider(s): + This node is a mailbox consumer. See the following file for details + of the mailbox specifiers implemented by the relevant provider(s): - - .../mailbox/mailbox.txt - .../mailbox/nvidia,tegra186-hsp.yaml This node is a clock, power domain, and reset provider. See the diff --git a/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml b/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml index 87d31963c1b7..f58b0d412186 100644 --- a/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/allwinner,sun6i-a31-msgbox.yaml @@ -17,9 +17,6 @@ description: | hold four 32-bit messages; when a FIFO is full, clients must wait before attempting more transmissions. - Refer to ./mailbox.txt for generic information about mailbox device-tree - bindings. - properties: compatible: oneOf: diff --git a/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt b/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt index c4dd93f1fed2..87749d251f09 100644 --- a/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/altera-mailbox.txt @@ -31,12 +31,12 @@ Example: Mailbox client =============== -"mboxes" and the optional "mbox-names" (please see -Documentation/devicetree/bindings/mailbox/mailbox.txt for details). Each value -of the mboxes property should contain a phandle to the mailbox controller -device node and second argument is the channel index. It must be 0 (hardware -support only one channel).The equivalent "mbox-names" property value can be -used to give a name to the communication channel to be used by the client user. +The common mailbox binding properties "mboxes" and the optional "mbox-names" +can be used. Each value of the mboxes property should contain a phandle to +the mailbox controller device node and second argument is the channel index. +It must be 0 (hardware support only one channel). The equivalent "mbox-names" +property value can be used to give a name to the communication channel to be +used by the client user. Example: mclient0: mclient0@400 { diff --git a/Documentation/devicetree/bindings/mailbox/hisilicon,hi3660-mailbox.txt b/Documentation/devicetree/bindings/mailbox/hisilicon,hi3660-mailbox.txt index 3e5b4537407d..ec2da5c9e647 100644 --- a/Documentation/devicetree/bindings/mailbox/hisilicon,hi3660-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/hisilicon,hi3660-mailbox.txt @@ -35,7 +35,7 @@ Client Required properties: - compatible : See the client docs -- mboxes : Standard property to specify a Mailbox (See ./mailbox.txt) +- mboxes : Standard property to specify a Mailbox Cells must match 'mbox-cells' (See Controller docs above) Optional properties diff --git a/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt index 044b17f3a77a..de9fbf722bee 100644 --- a/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt +++ b/Documentation/devicetree/bindings/mailbox/hisilicon,hi6220-mailbox.txt @@ -55,7 +55,7 @@ Mailbox client Required properties: -------------------- - compatible: Many (See the client docs). -- mboxes: Standard property to specify a Mailbox (See ./mailbox.txt) +- mboxes: Standard property to specify a Mailbox Cells must match 'mbox-cells' (See Mailbox Device Node above). Optional Properties: diff --git a/Documentation/devicetree/bindings/mailbox/mailbox.txt b/Documentation/devicetree/bindings/mailbox/mailbox.txt deleted file mode 100644 index af8ecee2ac68..000000000000 --- a/Documentation/devicetree/bindings/mailbox/mailbox.txt +++ /dev/null @@ -1,60 +0,0 @@ -* Generic Mailbox Controller and client driver bindings - -Generic binding to provide a way for Mailbox controller drivers to -assign appropriate mailbox channel to client drivers. - -* Mailbox Controller - -Required property: -- #mbox-cells: Must be at least 1. Number of cells in a mailbox - specifier. - -Example: - mailbox: mailbox { - ... - #mbox-cells = <1>; - }; - - -* Mailbox Client - -Required property: -- mboxes: List of phandle and mailbox channel specifiers. - -Optional property: -- mbox-names: List of identifier strings for each mailbox channel. -- shmem : List of phandle pointing to the shared memory(SHM) area between the - users of these mailboxes for IPC, one for each mailbox. This shared - memory can be part of any memory reserved for the purpose of this - communication between the mailbox client and the remote. - - -Example: - pwr_cntrl: power { - ... - mbox-names = "pwr-ctrl", "rpc"; - mboxes = <&mailbox 0 &mailbox 1>; - }; - -Example with shared memory(shmem): - - sram: sram@50000000 { - compatible = "mmio-sram"; - reg = <0x50000000 0x10000>; - - #address-cells = <1>; - #size-cells = <1>; - ranges = <0 0x50000000 0x10000>; - - cl_shmem: shmem@0 { - compatible = "client-shmem"; - reg = <0x0 0x200>; - }; - }; - - client@2e000000 { - ... - mboxes = <&mailbox 0>; - shmem = <&cl_shmem>; - .. - }; diff --git a/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml index 8504ceb64806..7e3b7b68841c 100644 --- a/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml +++ b/Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml @@ -53,8 +53,7 @@ description: | ============== A device needing to communicate with a target processor device should specify them using the common mailbox binding properties, "mboxes" and the optional - "mbox-names" (please see Documentation/devicetree/bindings/mailbox/mailbox.txt - for details). Each value of the mboxes property should contain a phandle to + "mbox-names". Each value of the mboxes property should contain a phandle to the mailbox controller device node and an args specifier that will be the phandle to the intended sub-mailbox child node to be used for communication. The equivalent "mbox-names" property value can be used to give a name to the diff --git a/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml b/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml index 079ad977b907..60f0882f5381 100644 --- a/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml +++ b/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.yaml @@ -27,12 +27,9 @@ properties: mailbox controller device node and an args specifier that will be the phandle to the intended sub-mailbox child node to be used for communication. See - Documentation/devicetree/bindings/mailbox/mailbox.txt - for more details about the generic mailbox controller - and client driver bindings. Also see - Documentation/devicetree/bindings/mailbox/ \ - xlnx,zynqmp-ipi-mailbox.txt for typical controller that - is used to communicate with this System controllers. + Documentation/devicetree/bindings/mailbox/xlnx,zynqmp-ipi-mailbox.yaml + for typical controller that is used to communicate with + this System controllers. items: - description: tx channel - description: rx channel diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml b/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml index d2ae2ae87a95..e94c4fd34177 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,aoss-qmp.yaml @@ -71,7 +71,7 @@ properties: maxItems: 1 description: Reference to the mailbox representing the outgoing doorbell in APCS for - this client, as described in mailbox/mailbox.txt + this client. "#clock-cells": const: 0 From 218ffd1a2cf31cfee63861f80ced0f2a534efe90 Mon Sep 17 00:00:00 2001 From: Abdurrahman Hussain Date: Sat, 15 Aug 2026 20:33:13 -0700 Subject: [PATCH 38/72] of: property: add i2c-parent to fw_devlink supplier bindings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Platform-device i2c muxes (i2c-mux-reg, i2c-mux-gpio, ...) reference the bus they multiplex with an i2c-parent phandle and hold a reference on that adapter from probe until remove. Unlike muxes that are clients on the parent bus, they live outside the adapter's device hierarchy, so nothing orders their teardown against it: if the adapter's device is unbound first — e.g. while reverting a device-tree overlay whose changeset attached the mux nodes before the controller nodes — i2c_del_adapter() blocks forever in wait_for_completion(&adap->dev_released), waiting for a reference that is only dropped later in the same teardown sequence. Teach fw_devlink about i2c-parent so the core creates the corresponding device links: consumers are unbound before the parent adapter's device, and probe ordering no longer needs -EPROBE_DEFER. A plain DEFINE_SIMPLE_PROP() cannot be used because the property has two incompatible layouts: the i2c mux bindings hold a list of bare phandles (i2c-demux-pinctrl takes several), while toshiba,tc9563 holds a single phandle followed by an i2c slave-address cell. The two forms are indistinguishable in the flattened tree, and a 0-cell parse of the tc9563 form would read the slave address as a phandle, linking the consumer to whatever node happens to carry that phandle value. Use a custom parser that only takes entry 0 for toshiba,tc9563 nodes. Signed-off-by: Abdurrahman Hussain Link: https://patch.msgid.link/20260815-b4-of-property-add-i2c-parent-v3-1-c22588b6482a@nexthop.ai Signed-off-by: Rob Herring (Arm) --- drivers/of/property.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/of/property.c b/drivers/of/property.c index abd0b2320779..45e55f618488 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1471,6 +1471,22 @@ static struct device_node *parse_gpio_compat(struct device_node *np, return sup_args.np; } +static struct device_node *parse_i2c_parent(struct device_node *np, + const char *prop_name, int index) +{ + if (strcmp(prop_name, "i2c-parent")) + return NULL; + + /* tc9563 (pci1179,0623) is ; every other user is bare phandles */ + if (of_device_is_compatible(np, "pci1179,0623")) { + if (index) + return NULL; + return of_parse_phandle(np, prop_name, 0); + } + + return of_parse_phandle(np, prop_name, index); +} + static struct device_node *parse_interrupts(struct device_node *np, const char *prop_name, int index) { @@ -1562,6 +1578,7 @@ static const struct supplier_bindings of_supplier_bindings[] = { { .parse_prop = parse_resets, }, { .parse_prop = parse_leds, }, { .parse_prop = parse_backlight, }, + { .parse_prop = parse_i2c_parent, }, { .parse_prop = parse_panel, }, { .parse_prop = parse_msi_parent, }, { .parse_prop = parse_pses, }, From f0597e96a23b0cc7877581cf907407645ca71c03 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 3 Sep 2026 11:06:29 +0200 Subject: [PATCH 39/72] dt-bindings: interrupt-controller: chrp,open-pic: Typo s/pci/pic/ The device_type for an OpenPIC node is "open-pic", not "open-pci". Fixes: a241f1a1b338b714 ("dt-bindings: interrupt-controller: Convert chrp,open-pic to DT schema") Signed-off-by: Geert Uytterhoeven Link: https://patch.msgid.link/f2cc11922b3e5dd73997ef8c673137951d3fe715.1788426169.git.geert+renesas@glider.be Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/interrupt-controller/chrp,open-pic.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml b/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml index 642738512f3c..5363f4c6ffbc 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml @@ -24,7 +24,7 @@ properties: - const: chrp,open-pic device_type: - const: open-pci + const: open-pic deprecated: true reg: From 2fb6f1a87cba099b2921fc3e777bf399d4153a39 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 3 Sep 2026 11:06:30 +0200 Subject: [PATCH 40/72] dt-bindings: interrupt-controller: chrp,open-pic: Fix dangling reference The target of "[1]" was lost during the conversion to json-schema. Replace it by an inline reference. Fixes: a241f1a1b338b714 ("dt-bindings: interrupt-controller: Convert chrp,open-pic to DT schema") Signed-off-by: Geert Uytterhoeven Link: https://patch.msgid.link/86dd3544f7286fc117dc7ad0f6d799761283ec54.1788426169.git.geert+renesas@glider.be Signed-off-by: Rob Herring (Arm) --- .../bindings/interrupt-controller/chrp,open-pic.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml b/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml index 5363f4c6ffbc..294af57a7c37 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/chrp,open-pic.yaml @@ -12,8 +12,9 @@ maintainers: description: This binding specifies what properties must be available in the device tree representation of an Open PIC compliant interrupt controller. This binding is - based on the binding defined for Open PIC in [1] and is a superset of that - binding. + based on the binding defined for Open PIC in the Devicetree Specification + (available from https://www.devicetree.org/specifications/) and is a superset + of that binding. properties: compatible: From 307b773daa5ee5cd3b5d4616c0594b6ab18a50df Mon Sep 17 00:00:00 2001 From: Karl Mehltretter Date: Mon, 7 Sep 2026 03:30:30 +0200 Subject: [PATCH 41/72] docs: dt: unittest: Use unittest_data_add() selftest_data_add() was renamed to unittest_data_add() by commit 9697a5595ece ("of/unittest: replace 'selftest' with 'unittest'"). Use the new name. Fixes: 9697a5595ece ("of/unittest: replace 'selftest' with 'unittest'") Assisted-by: LLM Signed-off-by: Karl Mehltretter Link: https://patch.msgid.link/20260907013030.22528-1-kmehltretter@gmail.com Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/of_unittest.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/of_unittest.rst b/Documentation/devicetree/of_unittest.rst index 6ed6e3291964..5ea8ee0e81ef 100644 --- a/Documentation/devicetree/of_unittest.rst +++ b/Documentation/devicetree/of_unittest.rst @@ -125,7 +125,7 @@ Figure 1: Generic structure of un-flattened device tree Before executing OF unittest, it is required to attach the test data to -machine's device tree (if present). So, when selftest_data_add() is called, +machine's device tree (if present). So, when unittest_data_add() is called, at first it reads the flattened device tree data linked into the kernel image via the following kernel symbols:: From 0414dd2ce38ba19f3243f4e070b2357d860d516e Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sat, 1 Aug 2026 21:55:29 +0200 Subject: [PATCH 42/72] media: dt-bindings: Correct white-space style Correct a few white-space issues, like double space after '=' or before bracket '{' characters, which will be flagged by dt-check-style. No functional changes. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Bryan O'Donoghue Reviewed-by: Stefan Klug Acked-by: Rob Herring (Arm) Reviewed-by: Keke Li Link: https://patch.msgid.link/20260801195528.235230-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../bindings/media/amlogic,c3-mipi-csi2.yaml | 4 +- .../bindings/media/i2c/galaxycore,gc05a2.yaml | 2 +- .../media/mediatek,vcodec-encoder.yaml | 2 +- .../bindings/media/mediatek-jpeg-decoder.yaml | 4 +- .../bindings/media/mediatek-jpeg-encoder.yaml | 2 +- .../bindings/media/qcom,msm8996-venus.yaml | 40 +++++++++---------- .../bindings/media/raspberrypi,pispbe.yaml | 2 +- 7 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml b/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml index b0129beab0c3..2f11e5f45839 100644 --- a/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml +++ b/Documentation/devicetree/bindings/media/amlogic,c3-mipi-csi2.yaml @@ -96,8 +96,8 @@ examples: <0x0 0xff01a000 0x0 0x100>; reg-names = "aphy", "dphy", "host"; power-domains = <&pwrc PWRC_C3_MIPI_ISP_WRAP_ID>; - clocks = <&clkc_periphs CLKID_VAPB>, - <&clkc_periphs CLKID_CSI_PHY0>; + clocks = <&clkc_periphs CLKID_VAPB>, + <&clkc_periphs CLKID_CSI_PHY0>; clock-names = "vapb", "phy0"; assigned-clocks = <&clkc_periphs CLKID_VAPB>, <&clkc_periphs CLKID_CSI_PHY0>; diff --git a/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml b/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml index 0e7a7b5ac89f..99d728c47cfb 100644 --- a/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml +++ b/Documentation/devicetree/bindings/media/i2c/galaxycore,gc05a2.yaml @@ -88,7 +88,7 @@ examples: #size-cells = <0>; sensor@37 { - compatible = "galaxycore,gc05a2"; + compatible = "galaxycore,gc05a2"; reg = <0x37>; clocks = <&gc05a2_clk>; diff --git a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml index 4505e66876a2..551e483f3e51 100644 --- a/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek,vcodec-encoder.yaml @@ -160,7 +160,7 @@ examples: vcodec_enc_vp8: vcodec@19002000 { compatible = "mediatek,mt8173-vcodec-enc-vp8"; - reg = <0x19002000 0x1000>; /* VENC_LT_SYS */ + reg = <0x19002000 0x1000>; /* VENC_LT_SYS */ interrupts = ; iommus = <&iommu M4U_PORT_VENC_RCPU_SET2>, <&iommu M4U_PORT_VENC_REC_FRM_SET2>, diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml index a4aacd3eb189..76878050cfd9 100644 --- a/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-decoder.yaml @@ -72,8 +72,8 @@ examples: compatible = "mediatek,mt2701-jpgdec"; reg = <0x15004000 0x1000>; interrupts = ; - clocks = <&imgsys CLK_IMG_JPGDEC_SMI>, - <&imgsys CLK_IMG_JPGDEC>; + clocks = <&imgsys CLK_IMG_JPGDEC_SMI>, + <&imgsys CLK_IMG_JPGDEC>; clock-names = "jpgdec-smi", "jpgdec"; power-domains = <&scpsys MT2701_POWER_DOMAIN_ISP>; diff --git a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml index 5b15f8977f67..3bc1ccb25893 100644 --- a/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml +++ b/Documentation/devicetree/bindings/media/mediatek-jpeg-encoder.yaml @@ -67,7 +67,7 @@ examples: "mediatek,mtk-jpgenc"; reg = <0x1500a000 0x1000>; interrupts = ; - clocks = <&imgsys CLK_IMG_VENC>; + clocks = <&imgsys CLK_IMG_VENC>; clock-names = "jpgenc"; power-domains = <&scpsys MT2701_POWER_DOMAIN_ISP>; iommus = <&iommu MT2701_M4U_PORT_JPGENC_RDMA>, diff --git a/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml b/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml index 56c16458e3bb..389b545c9631 100644 --- a/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml +++ b/Documentation/devicetree/bindings/media/qcom,msm8996-venus.yaml @@ -119,26 +119,26 @@ examples: <&mmcc VIDEO_MAXI_CLK>; clock-names = "core", "iface", "bus", "mbus"; power-domains = <&mmcc VENUS_GDSC>; - iommus = <&venus_smmu 0x00>, - <&venus_smmu 0x01>, - <&venus_smmu 0x0a>, - <&venus_smmu 0x07>, - <&venus_smmu 0x0e>, - <&venus_smmu 0x0f>, - <&venus_smmu 0x08>, - <&venus_smmu 0x09>, - <&venus_smmu 0x0b>, - <&venus_smmu 0x0c>, - <&venus_smmu 0x0d>, - <&venus_smmu 0x10>, - <&venus_smmu 0x11>, - <&venus_smmu 0x21>, - <&venus_smmu 0x28>, - <&venus_smmu 0x29>, - <&venus_smmu 0x2b>, - <&venus_smmu 0x2c>, - <&venus_smmu 0x2d>, - <&venus_smmu 0x31>; + iommus = <&venus_smmu 0x00>, + <&venus_smmu 0x01>, + <&venus_smmu 0x0a>, + <&venus_smmu 0x07>, + <&venus_smmu 0x0e>, + <&venus_smmu 0x0f>, + <&venus_smmu 0x08>, + <&venus_smmu 0x09>, + <&venus_smmu 0x0b>, + <&venus_smmu 0x0c>, + <&venus_smmu 0x0d>, + <&venus_smmu 0x10>, + <&venus_smmu 0x11>, + <&venus_smmu 0x21>, + <&venus_smmu 0x28>, + <&venus_smmu 0x29>, + <&venus_smmu 0x2b>, + <&venus_smmu 0x2c>, + <&venus_smmu 0x2d>, + <&venus_smmu 0x31>; memory-region = <&venus_mem>; video-decoder { diff --git a/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml b/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml index 1fc62a1d8eda..5c0f2f7b1d95 100644 --- a/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml +++ b/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml @@ -53,7 +53,7 @@ examples: #address-cells = <2>; #size-cells = <2>; - isp@880000 { + isp@880000 { compatible = "brcm,bcm2712-pispbe", "raspberrypi,pispbe"; reg = <0x10 0x00880000 0x0 0x4000>; interrupts = ; From 0995173b0b077576e8853d42636cd2fb4306e0e3 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 13 Sep 2026 14:32:53 +0200 Subject: [PATCH 43/72] media: dt-bindings: Use consistent indentation in the example Correct indentation in the examples to consistent 2- or 4-spaces indentation to fix dt-check-style warnings ("example 0 [indent-consistent] indent mismatch ..."). Preferred is 4-spaces, but re-indenting entire example just for that is too much churn. Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260913123252.100085-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../bindings/media/arm,mali-c55.yaml | 2 +- .../devicetree/bindings/media/atmel,isc.yaml | 14 ++--- .../bindings/media/brcm,bcm2835-unicam.yaml | 10 ++-- .../bindings/media/cdns,csi2rx.yaml | 58 +++++++++---------- .../bindings/media/i2c/ovti,ov2680.yaml | 26 ++++----- .../bindings/media/i2c/ovti,ov2732.yaml | 6 +- .../bindings/media/img,e5010-jpeg-enc.yaml | 22 +++---- .../bindings/media/microchip,csi2dc.yaml | 52 ++++++++--------- .../bindings/media/microchip,xisc.yaml | 14 ++--- .../bindings/media/qcom,x1e80100-camss.yaml | 26 ++++----- .../bindings/media/raspberrypi,pispbe.yaml | 10 ++-- .../bindings/media/samsung,fimc.yaml | 14 ++--- .../bindings/media/st,stm32-dcmi.yaml | 16 ++--- .../bindings/media/st,stm32-dcmipp.yaml | 14 ++--- .../devicetree/bindings/media/ti,cal.yaml | 48 +++++++-------- 15 files changed, 166 insertions(+), 166 deletions(-) diff --git a/Documentation/devicetree/bindings/media/arm,mali-c55.yaml b/Documentation/devicetree/bindings/media/arm,mali-c55.yaml index fc4fcd19922a..39af7ffc70b4 100644 --- a/Documentation/devicetree/bindings/media/arm,mali-c55.yaml +++ b/Documentation/devicetree/bindings/media/arm,mali-c55.yaml @@ -79,7 +79,7 @@ examples: port { isp_in: endpoint { - remote-endpoint = <&csi2_rx_out>; + remote-endpoint = <&csi2_rx_out>; }; }; }; diff --git a/Documentation/devicetree/bindings/media/atmel,isc.yaml b/Documentation/devicetree/bindings/media/atmel,isc.yaml index dc8aba698d78..5c84f372e81a 100644 --- a/Documentation/devicetree/bindings/media/atmel,isc.yaml +++ b/Documentation/devicetree/bindings/media/atmel,isc.yaml @@ -102,12 +102,12 @@ examples: clock-output-names = "isc-mck"; port { - isc_0: endpoint { - remote-endpoint = <&ov7740_0>; - hsync-active = <1>; - vsync-active = <0>; - pclk-sample = <1>; - bus-width = <8>; - }; + isc_0: endpoint { + remote-endpoint = <&ov7740_0>; + hsync-active = <1>; + vsync-active = <0>; + pclk-sample = <1>; + bus-width = <8>; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml index 5fb5d60f069a..bfec4daccd0a 100644 --- a/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml +++ b/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml @@ -117,11 +117,11 @@ examples: power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>; brcm,num-data-lanes = <2>; port { - csi1_ep: endpoint { - remote-endpoint = <&imx219_0>; - bus-type = ; - data-lanes = <1 2>; - }; + csi1_ep: endpoint { + remote-endpoint = <&imx219_0>; + bus-type = ; + data-lanes = <1 2>; + }; }; }; ... diff --git a/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml b/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml index 6ed9a5621064..cbc6249e8803 100644 --- a/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml +++ b/Documentation/devicetree/bindings/media/cdns,csi2rx.yaml @@ -160,50 +160,50 @@ examples: phy-names = "dphy"; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; + port@0 { + reg = <0>; - csi2rx_in_sensor: endpoint { - remote-endpoint = <&sensor_out_csi2rx>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; + csi2rx_in_sensor: endpoint { + remote-endpoint = <&sensor_out_csi2rx>; + clock-lanes = <0>; + data-lanes = <1 2>; }; + }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - csi2rx_out_grabber0: endpoint { - remote-endpoint = <&grabber0_in_csi2rx>; - }; + csi2rx_out_grabber0: endpoint { + remote-endpoint = <&grabber0_in_csi2rx>; }; + }; - port@2 { - reg = <2>; + port@2 { + reg = <2>; - csi2rx_out_grabber1: endpoint { - remote-endpoint = <&grabber1_in_csi2rx>; - }; + csi2rx_out_grabber1: endpoint { + remote-endpoint = <&grabber1_in_csi2rx>; }; + }; - port@3 { - reg = <3>; + port@3 { + reg = <3>; - csi2rx_out_grabber2: endpoint { - remote-endpoint = <&grabber2_in_csi2rx>; - }; + csi2rx_out_grabber2: endpoint { + remote-endpoint = <&grabber2_in_csi2rx>; }; + }; - port@4 { - reg = <4>; + port@4 { + reg = <4>; - csi2rx_out_grabber3: endpoint { - remote-endpoint = <&grabber3_in_csi2rx>; - }; + csi2rx_out_grabber3: endpoint { + remote-endpoint = <&grabber3_in_csi2rx>; }; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml index 634d3b821b8c..83f84a7828bf 100644 --- a/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml @@ -90,22 +90,22 @@ examples: #size-cells = <0>; ov2680: camera-sensor@36 { - compatible = "ovti,ov2680"; - reg = <0x36>; - clocks = <&osc>; - clock-names = "xvclk"; - reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; + compatible = "ovti,ov2680"; + reg = <0x36>; + clocks = <&osc>; + clock-names = "xvclk"; + reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - DOVDD-supply = <&sw2_reg>; - DVDD-supply = <&sw2_reg>; - AVDD-supply = <®_peri_3p15v>; + DOVDD-supply = <&sw2_reg>; + DVDD-supply = <&sw2_reg>; + AVDD-supply = <®_peri_3p15v>; - port { - ov2680_to_mipi: endpoint { - remote-endpoint = <&mipi_from_sensor>; - link-frequencies = /bits/ 64 <330000000>; - }; + port { + ov2680_to_mipi: endpoint { + remote-endpoint = <&mipi_from_sensor>; + link-frequencies = /bits/ 64 <330000000>; }; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml b/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml index 814fc568c550..b6b5145802e7 100644 --- a/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml +++ b/Documentation/devicetree/bindings/media/i2c/ovti,ov2732.yaml @@ -94,9 +94,9 @@ examples: port { camera_out: endpoint { - data-lanes = <1 2>; - link-frequencies = /bits/ 64 <360000000>; - remote-endpoint = <&mipi_in_camera>; + data-lanes = <1 2>; + link-frequencies = /bits/ 64 <360000000>; + remote-endpoint = <&mipi_in_camera>; }; }; }; diff --git a/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml b/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml index 085020cb9e61..b6f80098beb7 100644 --- a/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml +++ b/Documentation/devicetree/bindings/media/img,e5010-jpeg-enc.yaml @@ -61,15 +61,15 @@ examples: #include soc { - #address-cells = <2>; - #size-cells = <2>; - jpeg-encoder@fd20000 { - compatible = "img,e5010-jpeg-enc"; - reg = <0x00 0xfd20000 0x00 0x100>, - <0x00 0xfd20200 0x00 0x200>; - reg-names = "core", "mmu"; - clocks = <&k3_clks 201 0>; - power-domains = <&k3_pds 201 TI_SCI_PD_EXCLUSIVE>; - interrupts = ; - }; + #address-cells = <2>; + #size-cells = <2>; + jpeg-encoder@fd20000 { + compatible = "img,e5010-jpeg-enc"; + reg = <0x00 0xfd20000 0x00 0x100>, + <0x00 0xfd20200 0x00 0x200>; + reg-names = "core", "mmu"; + clocks = <&k3_clks 201 0>; + power-domains = <&k3_pds 201 TI_SCI_PD_EXCLUSIVE>; + interrupts = ; + }; }; diff --git a/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml b/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml index b3a345fc6464..d06987680ed8 100644 --- a/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml +++ b/Documentation/devicetree/bindings/media/microchip,csi2dc.yaml @@ -149,22 +149,22 @@ examples: clock-names = "pclk", "scck"; ports { - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; /* must be 0, first child port */ - csi2dc_in: endpoint { /* input from IDI interface */ - bus-type = <4>; /* MIPI CSI2 D-PHY */ - remote-endpoint = <&csi2host_out>; - }; - }; + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; /* must be 0, first child port */ + csi2dc_in: endpoint { /* input from IDI interface */ + bus-type = <4>; /* MIPI CSI2 D-PHY */ + remote-endpoint = <&csi2host_out>; + }; + }; - port@1 { - reg = <1>; /* must be 1, second child port */ - csi2dc_out: endpoint { - remote-endpoint = <&xisc_in>; /* output to sensor controller */ - }; - }; + port@1 { + reg = <1>; /* must be 1, second child port */ + csi2dc_out: endpoint { + remote-endpoint = <&xisc_in>; /* output to sensor controller */ + }; + }; }; }; @@ -181,18 +181,18 @@ examples: dma-names = "rx"; ports { - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; /* must be 0, first child port */ - csi2dc_input: endpoint { /* input from IDI interface */ - remote-endpoint = <&csi2host_out>; - }; - }; + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; /* must be 0, first child port */ + csi2dc_input: endpoint { /* input from IDI interface */ + remote-endpoint = <&csi2host_out>; + }; + }; - port@1 { - reg = <1>; - }; + port@1 { + reg = <1>; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/microchip,xisc.yaml b/Documentation/devicetree/bindings/media/microchip,xisc.yaml index 25f5f79d40ce..6a9e56c486c2 100644 --- a/Documentation/devicetree/bindings/media/microchip,xisc.yaml +++ b/Documentation/devicetree/bindings/media/microchip,xisc.yaml @@ -118,12 +118,12 @@ examples: clock-output-names = "isc-mck"; port { - xisc_in: endpoint { - bus-type = ; - remote-endpoint = <&csi2dc_out>; - hsync-active = <1>; - vsync-active = <1>; - bus-width = <12>; - }; + xisc_in: endpoint { + bus-type = ; + remote-endpoint = <&csi2dc_out>; + hsync-active = <1>; + vsync-active = <1>; + bus-width = <12>; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml index 2d1662ef522b..bdf03a944fd7 100644 --- a/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml +++ b/Documentation/devicetree/bindings/media/qcom,x1e80100-camss.yaml @@ -289,19 +289,19 @@ examples: "vfe_lite_cphy_rx", "vfe_lite_csid"; - interrupts = , - , - , - , - , - , - , - , - , - , - , - , - ; + interrupts = , + , + , + , + , + , + , + , + , + , + , + , + ; interrupt-names = "csid0", "csid1", diff --git a/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml b/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml index 5c0f2f7b1d95..36fde927382a 100644 --- a/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml +++ b/Documentation/devicetree/bindings/media/raspberrypi,pispbe.yaml @@ -54,10 +54,10 @@ examples: #size-cells = <2>; isp@880000 { - compatible = "brcm,bcm2712-pispbe", "raspberrypi,pispbe"; - reg = <0x10 0x00880000 0x0 0x4000>; - interrupts = ; - clocks = <&firmware_clocks 7>; - iommus = <&iommu2>; + compatible = "brcm,bcm2712-pispbe", "raspberrypi,pispbe"; + reg = <0x10 0x00880000 0x0 0x4000>; + interrupts = ; + clocks = <&firmware_clocks 7>; + iommus = <&iommu2>; }; }; diff --git a/Documentation/devicetree/bindings/media/samsung,fimc.yaml b/Documentation/devicetree/bindings/media/samsung,fimc.yaml index 1bfba84f8854..1329d4ee0705 100644 --- a/Documentation/devicetree/bindings/media/samsung,fimc.yaml +++ b/Documentation/devicetree/bindings/media/samsung,fimc.yaml @@ -188,13 +188,13 @@ examples: /* ... CSIS 1 */ fimc-lite@b90000 { - compatible = "samsung,exynos4212-fimc-lite"; - reg = <0xb90000 0x1000>; - interrupts = ; - power-domains = <&pd_isp>; - clocks = <&isp_clock CLK_ISP_FIMC_LITE0>; - clock-names = "flite"; - iommus = <&sysmmu_fimc_lite0>; + compatible = "samsung,exynos4212-fimc-lite"; + reg = <0xb90000 0x1000>; + interrupts = ; + power-domains = <&pd_isp>; + clocks = <&isp_clock CLK_ISP_FIMC_LITE0>; + clock-names = "flite"; + iommus = <&sysmmu_fimc_lite0>; }; /* ... FIMC-LITE 1 */ diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml index 7c2ddd27780f..cb0116176c3f 100644 --- a/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmi.yaml @@ -120,14 +120,14 @@ examples: dma-names = "tx"; port { - dcmi_0: endpoint { - remote-endpoint = <&ov5640_0>; - bus-type = ; - bus-width = <8>; - hsync-active = <0>; - vsync-active = <0>; - pclk-sample = <1>; - }; + dcmi_0: endpoint { + remote-endpoint = <&ov5640_0>; + bus-type = ; + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <1>; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml b/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml index 162a0c526d5d..0bf7c674dd97 100644 --- a/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml +++ b/Documentation/devicetree/bindings/media/st,stm32-dcmipp.yaml @@ -120,13 +120,13 @@ examples: clocks = <&rcc DCMIPP_K>; port { - endpoint { - remote-endpoint = <&mipid02_2>; - bus-width = <8>; - hsync-active = <0>; - vsync-active = <0>; - pclk-sample = <0>; - }; + endpoint { + remote-endpoint = <&mipid02_2>; + bus-width = <8>; + hsync-active = <0>; + vsync-active = <0>; + pclk-sample = <0>; + }; }; }; diff --git a/Documentation/devicetree/bindings/media/ti,cal.yaml b/Documentation/devicetree/bindings/media/ti,cal.yaml index f1a940a110d2..c223b4f2d75a 100644 --- a/Documentation/devicetree/bindings/media/ti,cal.yaml +++ b/Documentation/devicetree/bindings/media/ti,cal.yaml @@ -136,17 +136,17 @@ examples: ti,camerrx-control = <&scm_conf 0xE94>; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - csi2_0: port@0 { - reg = <0>; - csi2_phy0: endpoint { - remote-endpoint = <&csi2_cam0>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; - }; + csi2_0: port@0 { + reg = <0>; + csi2_phy0: endpoint { + remote-endpoint = <&csi2_cam0>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; }; }; @@ -156,21 +156,21 @@ examples: #size-cells = <0>; camera-sensor@3c { - compatible = "ovti,ov5640"; - reg = <0x3c>; - AVDD-supply = <®_2p8v>; - DOVDD-supply = <®_1p8v>; - DVDD-supply = <®_1p5v>; - clocks = <&clk_ov5640_fixed>; - clock-names = "xclk"; + compatible = "ovti,ov5640"; + reg = <0x3c>; + AVDD-supply = <®_2p8v>; + DOVDD-supply = <®_1p8v>; + DVDD-supply = <®_1p5v>; + clocks = <&clk_ov5640_fixed>; + clock-names = "xclk"; - port { - csi2_cam0: endpoint { - remote-endpoint = <&csi2_phy0>; - clock-lanes = <0>; - data-lanes = <1 2>; - }; - }; + port { + csi2_cam0: endpoint { + remote-endpoint = <&csi2_phy0>; + clock-lanes = <0>; + data-lanes = <1 2>; + }; + }; }; }; From 4f9e4e95bf19e7f87ca5e460498daec017803c91 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 13 Sep 2026 14:33:32 +0200 Subject: [PATCH 44/72] dt-bindings: display: Use consistent indentation in the example Correct indentation in the examples to consistent 2- or 4-spaces indentation to fix dt-check-style warnings ("example 0 [indent-consistent] indent mismatch ..."). Preferred is 4-spaces, but re-indenting entire example just for that is too much churn. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Luca Ceresoli Reviewed-by: Javier Martinez Canillas Link: https://patch.msgid.link/20260913123331.100293-3-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../display/allwinner,sun6i-a31-mipi-dsi.yaml | 10 +-- .../display/bridge/fsl,imx8qxp-pxl2dpi.yaml | 4 +- .../display/bridge/lontium,lt8912b.yaml | 8 +- .../megachips,stdp2690-ge-b850v3-fw.yaml | 2 +- .../bindings/display/bridge/nxp,tda998x.yaml | 2 +- .../display/bridge/toshiba,tc358764.yaml | 2 +- .../display/bridge/toshiba,tc358775.yaml | 12 +-- .../bindings/display/himax,hx8357.yaml | 2 +- .../bindings/display/imx/fsl,imx-lcdc.yaml | 2 +- .../bindings/display/imx/fsl,imx6q-ldb.yaml | 54 +++++------ .../display/mediatek/mediatek,ethdr.yaml | 90 +++++++++---------- .../display/mediatek/mediatek,hdmi.yaml | 24 ++--- .../display/panel/samsung,ams495qa01.yaml | 2 +- .../bindings/display/sitronix,st7567.yaml | 4 +- .../bindings/display/st,stm32-dsi.yaml | 46 +++++----- .../bindings/display/st,stm32-ltdc.yaml | 6 +- .../bindings/display/st,stm32mp25-lvds.yaml | 4 +- 17 files changed, 137 insertions(+), 137 deletions(-) diff --git a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml index c731fbdc2fe0..7b11cb5e5f6d 100644 --- a/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml +++ b/Documentation/devicetree/bindings/display/allwinner,sun6i-a31-mipi-dsi.yaml @@ -119,11 +119,11 @@ examples: #size-cells = <0>; panel@0 { - compatible = "bananapi,lhr050h41", "ilitek,ili9881c"; - reg = <0>; - power-supply = <®_display>; - reset-gpios = <&r_pio 0 5 1>; /* PL05 */ - backlight = <&pwm_bl>; + compatible = "bananapi,lhr050h41", "ilitek,ili9881c"; + reg = <0>; + power-supply = <®_display>; + reset-gpios = <&r_pio 0 5 1>; /* PL05 */ + backlight = <&pwm_bl>; }; port { diff --git a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml index e4e77fad05f1..af9ad07ef08b 100644 --- a/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml +++ b/Documentation/devicetree/bindings/display/bridge/fsl,imx8qxp-pxl2dpi.yaml @@ -84,8 +84,8 @@ examples: }; mipi_lvds_0_pxl2dpi_dc_pixel_link1: endpoint@1 { - reg = <1>; - remote-endpoint = <&dc_pixel_link1_mipi_lvds_0_pxl2dpi>; + reg = <1>; + remote-endpoint = <&dc_pixel_link1_mipi_lvds_0_pxl2dpi>; }; }; diff --git a/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml b/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml index 988351f3cd01..2d2dc9c046fb 100644 --- a/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml +++ b/Documentation/devicetree/bindings/display/bridge/lontium,lt8912b.yaml @@ -107,11 +107,11 @@ examples: }; port@1 { - reg = <1>; + reg = <1>; - endpoint { - remote-endpoint = <&hdmi_in>; - }; + endpoint { + remote-endpoint = <&hdmi_in>; + }; }; }; }; diff --git a/Documentation/devicetree/bindings/display/bridge/megachips,stdp2690-ge-b850v3-fw.yaml b/Documentation/devicetree/bindings/display/bridge/megachips,stdp2690-ge-b850v3-fw.yaml index dfa6ff6f115e..74539132bf94 100644 --- a/Documentation/devicetree/bindings/display/bridge/megachips,stdp2690-ge-b850v3-fw.yaml +++ b/Documentation/devicetree/bindings/display/bridge/megachips,stdp2690-ge-b850v3-fw.yaml @@ -104,7 +104,7 @@ examples: endpoint { remote-endpoint = <&stdp2690_in>; }; - }; + }; }; }; }; diff --git a/Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml b/Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml index 1205c8e9de32..0ad55ff8e330 100644 --- a/Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml +++ b/Documentation/devicetree/bindings/display/bridge/nxp,tda998x.yaml @@ -106,7 +106,7 @@ examples: video-ports = <0x230145>; #sound-dai-cells = <1>; - /* DAI-format / AP_ENA reg value */ + /* DAI-format / AP_ENA reg value */ audio-ports = , ; diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.yaml b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.yaml index 866607400514..23c5b254426b 100644 --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.yaml +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358764.yaml @@ -81,7 +81,7 @@ examples: port@1 { reg = <1>; lvds_ep: endpoint { - remote-endpoint = <&panel_ep>; + remote-endpoint = <&panel_ep>; }; }; }; diff --git a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml index 258dd9cfd770..8a0d8a66a9b0 100644 --- a/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml +++ b/Documentation/devicetree/bindings/display/bridge/toshiba,tc358775.yaml @@ -161,9 +161,9 @@ examples: dsi0_out: endpoint { remote-endpoint = <&d2l_in_test>; }; - }; - }; - }; + }; + }; + }; - | /* For dual-link LVDS display panel */ @@ -227,7 +227,7 @@ examples: dsi0_out_dual: endpoint { remote-endpoint = <&d2l_in_dual>; }; - }; - }; - }; + }; + }; + }; ... diff --git a/Documentation/devicetree/bindings/display/himax,hx8357.yaml b/Documentation/devicetree/bindings/display/himax,hx8357.yaml index 34c3b89bf003..bafcd4418d5a 100644 --- a/Documentation/devicetree/bindings/display/himax,hx8357.yaml +++ b/Documentation/devicetree/bindings/display/himax,hx8357.yaml @@ -74,5 +74,5 @@ examples: dc-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>; rotation = <90>; backlight = <&backlight>; - }; + }; }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml index c2b29622bceb..84610b5690c4 100644 --- a/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx-lcdc.yaml @@ -110,7 +110,7 @@ examples: port { parallel_out: endpoint { - remote-endpoint = <&panel_in>; + remote-endpoint = <&panel_in>; }; }; }; diff --git a/Documentation/devicetree/bindings/display/imx/fsl,imx6q-ldb.yaml b/Documentation/devicetree/bindings/display/imx/fsl,imx6q-ldb.yaml index 1646f41d8f72..cee1b504adf9 100644 --- a/Documentation/devicetree/bindings/display/imx/fsl,imx6q-ldb.yaml +++ b/Documentation/devicetree/bindings/display/imx/fsl,imx6q-ldb.yaml @@ -150,44 +150,44 @@ examples: /* Using an of-graph endpoint link to connect the panel */ lvds-channel@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + port@0 { reg = <0>; - #address-cells = <1>; - #size-cells = <0>; - port@0 { - reg = <0>; - - endpoint { - remote-endpoint = <&ipu_di0_lvds0>; - }; + endpoint { + remote-endpoint = <&ipu_di0_lvds0>; }; + }; - port@2 { - reg = <2>; + port@2 { + reg = <2>; - endpoint { - remote-endpoint = <&panel_in>; - }; - }; + endpoint { + remote-endpoint = <&panel_in>; + }; + }; }; /* Using display-timings and fsl,data-mapping/width instead */ lvds-channel@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + fsl,data-mapping = "spwg"; + fsl,data-width = <24>; + + display-timings {/* ... */ + }; + + port@1 { reg = <1>; - #address-cells = <1>; - #size-cells = <0>; - fsl,data-mapping = "spwg"; - fsl,data-width = <24>; - display-timings {/* ... */ - }; - - port@1 { - reg = <1>; - - endpoint { - remote-endpoint = <&ipu_di1_lvds1>; - }; + endpoint { + remote-endpoint = <&ipu_di1_lvds1>; }; + }; }; }; diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml index 98db47894eeb..6c0edbae96d7 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,ethdr.yaml @@ -158,51 +158,51 @@ examples: #size-cells = <2>; hdr-engine@1c114000 { - compatible = "mediatek,mt8195-disp-ethdr"; - reg = <0 0x1c114000 0 0x1000>, - <0 0x1c115000 0 0x1000>, - <0 0x1c117000 0 0x1000>, - <0 0x1c119000 0 0x1000>, - <0 0x1c11a000 0 0x1000>, - <0 0x1c11b000 0 0x1000>, - <0 0x1c11c000 0 0x1000>; - reg-names = "mixer", "vdo_fe0", "vdo_fe1", "gfx_fe0", "gfx_fe1", - "vdo_be", "adl_ds"; - mediatek,gce-client-reg = <&gce0 SUBSYS_1c11XXXX 0x4000 0x1000>, - <&gce0 SUBSYS_1c11XXXX 0x5000 0x1000>, - <&gce0 SUBSYS_1c11XXXX 0x7000 0x1000>, - <&gce0 SUBSYS_1c11XXXX 0x9000 0x1000>, - <&gce0 SUBSYS_1c11XXXX 0xa000 0x1000>, - <&gce0 SUBSYS_1c11XXXX 0xb000 0x1000>, - <&gce0 SUBSYS_1c11XXXX 0xc000 0x1000>; - clocks = <&vdosys1 CLK_VDO1_DISP_MIXER>, - <&vdosys1 CLK_VDO1_HDR_VDO_FE0>, - <&vdosys1 CLK_VDO1_HDR_VDO_FE1>, - <&vdosys1 CLK_VDO1_HDR_GFX_FE0>, - <&vdosys1 CLK_VDO1_HDR_GFX_FE1>, - <&vdosys1 CLK_VDO1_HDR_VDO_BE>, - <&vdosys1 CLK_VDO1_26M_SLOW>, - <&vdosys1 CLK_VDO1_HDR_VDO_FE0_DL_ASYNC>, - <&vdosys1 CLK_VDO1_HDR_VDO_FE1_DL_ASYNC>, - <&vdosys1 CLK_VDO1_HDR_GFX_FE0_DL_ASYNC>, - <&vdosys1 CLK_VDO1_HDR_GFX_FE1_DL_ASYNC>, - <&vdosys1 CLK_VDO1_HDR_VDO_BE_DL_ASYNC>, - <&topckgen CLK_TOP_ETHDR>; - clock-names = "mixer", "vdo_fe0", "vdo_fe1", "gfx_fe0", "gfx_fe1", - "vdo_be", "adl_ds", "vdo_fe0_async", "vdo_fe1_async", - "gfx_fe0_async", "gfx_fe1_async","vdo_be_async", - "ethdr_top"; - power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; - iommus = <&iommu_vpp M4U_PORT_L3_HDR_DS>, - <&iommu_vpp M4U_PORT_L3_HDR_ADL>; - interrupts = ; /* disp mixer */ - resets = <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_FE0_DL_ASYNC>, - <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_FE1_DL_ASYNC>, - <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_GFX_FE0_DL_ASYNC>, - <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_GFX_FE1_DL_ASYNC>, - <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_BE_DL_ASYNC>; - reset-names = "vdo_fe0_async", "vdo_fe1_async", "gfx_fe0_async", - "gfx_fe1_async", "vdo_be_async"; + compatible = "mediatek,mt8195-disp-ethdr"; + reg = <0 0x1c114000 0 0x1000>, + <0 0x1c115000 0 0x1000>, + <0 0x1c117000 0 0x1000>, + <0 0x1c119000 0 0x1000>, + <0 0x1c11a000 0 0x1000>, + <0 0x1c11b000 0 0x1000>, + <0 0x1c11c000 0 0x1000>; + reg-names = "mixer", "vdo_fe0", "vdo_fe1", "gfx_fe0", "gfx_fe1", + "vdo_be", "adl_ds"; + mediatek,gce-client-reg = <&gce0 SUBSYS_1c11XXXX 0x4000 0x1000>, + <&gce0 SUBSYS_1c11XXXX 0x5000 0x1000>, + <&gce0 SUBSYS_1c11XXXX 0x7000 0x1000>, + <&gce0 SUBSYS_1c11XXXX 0x9000 0x1000>, + <&gce0 SUBSYS_1c11XXXX 0xa000 0x1000>, + <&gce0 SUBSYS_1c11XXXX 0xb000 0x1000>, + <&gce0 SUBSYS_1c11XXXX 0xc000 0x1000>; + clocks = <&vdosys1 CLK_VDO1_DISP_MIXER>, + <&vdosys1 CLK_VDO1_HDR_VDO_FE0>, + <&vdosys1 CLK_VDO1_HDR_VDO_FE1>, + <&vdosys1 CLK_VDO1_HDR_GFX_FE0>, + <&vdosys1 CLK_VDO1_HDR_GFX_FE1>, + <&vdosys1 CLK_VDO1_HDR_VDO_BE>, + <&vdosys1 CLK_VDO1_26M_SLOW>, + <&vdosys1 CLK_VDO1_HDR_VDO_FE0_DL_ASYNC>, + <&vdosys1 CLK_VDO1_HDR_VDO_FE1_DL_ASYNC>, + <&vdosys1 CLK_VDO1_HDR_GFX_FE0_DL_ASYNC>, + <&vdosys1 CLK_VDO1_HDR_GFX_FE1_DL_ASYNC>, + <&vdosys1 CLK_VDO1_HDR_VDO_BE_DL_ASYNC>, + <&topckgen CLK_TOP_ETHDR>; + clock-names = "mixer", "vdo_fe0", "vdo_fe1", "gfx_fe0", "gfx_fe1", + "vdo_be", "adl_ds", "vdo_fe0_async", "vdo_fe1_async", + "gfx_fe0_async", "gfx_fe1_async","vdo_be_async", + "ethdr_top"; + power-domains = <&spm MT8195_POWER_DOMAIN_VDOSYS1>; + iommus = <&iommu_vpp M4U_PORT_L3_HDR_DS>, + <&iommu_vpp M4U_PORT_L3_HDR_ADL>; + interrupts = ; /* disp mixer */ + resets = <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_FE0_DL_ASYNC>, + <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_FE1_DL_ASYNC>, + <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_GFX_FE0_DL_ASYNC>, + <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_GFX_FE1_DL_ASYNC>, + <&vdosys1 MT8195_VDOSYS1_SW1_RST_B_HDR_VDO_BE_DL_ASYNC>; + reset-names = "vdo_fe0_async", "vdo_fe1_async", "gfx_fe0_async", + "gfx_fe1_async", "vdo_be_async"; }; }; ... diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml index b90b6d18a828..9af876329e6a 100644 --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,hdmi.yaml @@ -112,24 +112,24 @@ examples: mediatek,syscon-hdmi = <&mmsys 0x900>; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; + port@0 { + reg = <0>; - hdmi0_in: endpoint { - remote-endpoint = <&dpi0_out>; + hdmi0_in: endpoint { + remote-endpoint = <&dpi0_out>; + }; }; - }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - hdmi0_out: endpoint { - remote-endpoint = <&hdmi_con_in>; + hdmi0_out: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; }; - }; }; }; diff --git a/Documentation/devicetree/bindings/display/panel/samsung,ams495qa01.yaml b/Documentation/devicetree/bindings/display/panel/samsung,ams495qa01.yaml index e081c84a932b..6db87f7d70d8 100644 --- a/Documentation/devicetree/bindings/display/panel/samsung,ams495qa01.yaml +++ b/Documentation/devicetree/bindings/display/panel/samsung,ams495qa01.yaml @@ -51,7 +51,7 @@ examples: port { mipi_in_panel: endpoint { - remote-endpoint = <&mipi_out_panel>; + remote-endpoint = <&mipi_out_panel>; }; }; }; diff --git a/Documentation/devicetree/bindings/display/sitronix,st7567.yaml b/Documentation/devicetree/bindings/display/sitronix,st7567.yaml index 2eb6d00b5a25..c007718541f6 100644 --- a/Documentation/devicetree/bindings/display/sitronix,st7567.yaml +++ b/Documentation/devicetree/bindings/display/sitronix,st7567.yaml @@ -64,5 +64,5 @@ examples: vfront-porch = <0>; vsync-len = <0>; }; - }; - }; + }; + }; diff --git a/Documentation/devicetree/bindings/display/st,stm32-dsi.yaml b/Documentation/devicetree/bindings/display/st,stm32-dsi.yaml index 53560052aaf0..1b5f4317dab2 100644 --- a/Documentation/devicetree/bindings/display/st,stm32-dsi.yaml +++ b/Documentation/devicetree/bindings/display/st,stm32-dsi.yaml @@ -101,35 +101,35 @@ examples: #size-cells = <0>; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; - dsi_in: endpoint { - remote-endpoint = <<dc_ep1_out>; - }; - }; + port@0 { + reg = <0>; + dsi_in: endpoint { + remote-endpoint = <<dc_ep1_out>; + }; + }; - port@1 { - reg = <1>; - dsi_out: endpoint { - remote-endpoint = <&panel_in>; - }; - }; + port@1 { + reg = <1>; + dsi_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; }; panel@0 { - compatible = "orisetech,otm8009a"; - reg = <0>; - reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>; - power-supply = <&v3v3>; + compatible = "orisetech,otm8009a"; + reg = <0>; + reset-gpios = <&gpioe 4 GPIO_ACTIVE_LOW>; + power-supply = <&v3v3>; - port { - panel_in: endpoint { - remote-endpoint = <&dsi_out>; - }; - }; + port { + panel_in: endpoint { + remote-endpoint = <&dsi_out>; + }; + }; }; }; diff --git a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml index 77058a5ccf68..81c7772de25b 100644 --- a/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml +++ b/Documentation/devicetree/bindings/display/st,stm32-ltdc.yaml @@ -119,9 +119,9 @@ examples: resets = <&rcc LTDC_R>; port { - ltdc_out_dsi: endpoint { - remote-endpoint = <&dsi_in>; - }; + ltdc_out_dsi: endpoint { + remote-endpoint = <&dsi_in>; + }; }; }; diff --git a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml index 14e042156179..f8e43c5a656a 100644 --- a/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml +++ b/Documentation/devicetree/bindings/display/st,stm32mp25-lvds.yaml @@ -114,14 +114,14 @@ examples: port@0 { reg = <0>; lvds_in: endpoint { - remote-endpoint = <<dc_ep1_out>; + remote-endpoint = <<dc_ep1_out>; }; }; port@1 { reg = <1>; lvds_out0: endpoint { - remote-endpoint = <&lvds_panel_in>; + remote-endpoint = <&lvds_panel_in>; }; }; }; From 22191a2c4636f7dc3d2bc233e47dd7b33023c611 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 13 Sep 2026 14:33:33 +0200 Subject: [PATCH 45/72] dt-bindings: display/msm: Use consistent indentation in the example Correct indentation in the examples to consistent 2- or 4-spaces indentation to fix dt-check-style warnings ("example 0 [indent-consistent] indent mismatch ..."). Preferred is 4-spaces, but re-indenting entire example just for that is too much churn. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov Reviewed-by: Luca Ceresoli Link: https://patch.msgid.link/20260913123331.100293-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- .../display/msm/qcom,qcs8300-mdss.yaml | 6 +- .../display/msm/qcom,sar2130p-mdss.yaml | 4 +- .../bindings/display/msm/qcom,sm6150-dpu.yaml | 14 ++--- .../display/msm/qcom,sm8350-mdss.yaml | 2 +- .../display/msm/qcom,x1e80100-mdss.yaml | 60 +++++++++---------- 5 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Documentation/devicetree/bindings/display/msm/qcom,qcs8300-mdss.yaml b/Documentation/devicetree/bindings/display/msm/qcom,qcs8300-mdss.yaml index c41a86203e78..287cce4dbddc 100644 --- a/Documentation/devicetree/bindings/display/msm/qcom,qcs8300-mdss.yaml +++ b/Documentation/devicetree/bindings/display/msm/qcom,qcs8300-mdss.yaml @@ -150,7 +150,7 @@ examples: reg = <0>; dpu_intf0_out: endpoint { - remote-endpoint = <&mdss_dp0_in>; + remote-endpoint = <&mdss_dp0_in>; }; }; @@ -352,9 +352,9 @@ examples: }; port@1 { - reg = <1>; + reg = <1>; - mdss_dp_out: endpoint { }; + mdss_dp_out: endpoint { }; }; }; diff --git a/Documentation/devicetree/bindings/display/msm/qcom,sar2130p-mdss.yaml b/Documentation/devicetree/bindings/display/msm/qcom,sar2130p-mdss.yaml index 44c1bb9e4109..fb3d24bbac7d 100644 --- a/Documentation/devicetree/bindings/display/msm/qcom,sar2130p-mdss.yaml +++ b/Documentation/devicetree/bindings/display/msm/qcom,sar2130p-mdss.yaml @@ -248,9 +248,9 @@ examples: remote-endpoint = <&usb_dp_qmpphy_dp_in>; }; }; - }; + }; - dp_opp_table: opp-table { + dp_opp_table: opp-table { compatible = "operating-points-v2"; opp-162000000 { diff --git a/Documentation/devicetree/bindings/display/msm/qcom,sm6150-dpu.yaml b/Documentation/devicetree/bindings/display/msm/qcom,sm6150-dpu.yaml index b4f437172218..8cbf99f9fcba 100644 --- a/Documentation/devicetree/bindings/display/msm/qcom,sm6150-dpu.yaml +++ b/Documentation/devicetree/bindings/display/msm/qcom,sm6150-dpu.yaml @@ -81,7 +81,7 @@ examples: port@1 { reg = <1>; dpu_intf1_out: endpoint { - remote-endpoint = <&mdss_dsi0_in>; + remote-endpoint = <&mdss_dsi0_in>; }; }; }; @@ -90,18 +90,18 @@ examples: compatible = "operating-points-v2"; opp-19200000 { - opp-hz = /bits/ 64 <19200000>; - required-opps = <&rpmhpd_opp_low_svs>; + opp-hz = /bits/ 64 <19200000>; + required-opps = <&rpmhpd_opp_low_svs>; }; opp-25600000 { - opp-hz = /bits/ 64 <25600000>; - required-opps = <&rpmhpd_opp_svs>; + opp-hz = /bits/ 64 <25600000>; + required-opps = <&rpmhpd_opp_svs>; }; opp-307200000 { - opp-hz = /bits/ 64 <307200000>; - required-opps = <&rpmhpd_opp_nom>; + opp-hz = /bits/ 64 <307200000>; + required-opps = <&rpmhpd_opp_nom>; }; }; }; diff --git a/Documentation/devicetree/bindings/display/msm/qcom,sm8350-mdss.yaml b/Documentation/devicetree/bindings/display/msm/qcom,sm8350-mdss.yaml index 68176de854b3..f5acf528d0e4 100644 --- a/Documentation/devicetree/bindings/display/msm/qcom,sm8350-mdss.yaml +++ b/Documentation/devicetree/bindings/display/msm/qcom,sm8350-mdss.yaml @@ -223,7 +223,7 @@ examples: phys = <&mdss_dsi0_phy>; ports { - #address-cells = <1>; + #address-cells = <1>; #size-cells = <0>; port@0 { diff --git a/Documentation/devicetree/bindings/display/msm/qcom,x1e80100-mdss.yaml b/Documentation/devicetree/bindings/display/msm/qcom,x1e80100-mdss.yaml index 8d698a2e055a..8c65a80b46e4 100644 --- a/Documentation/devicetree/bindings/display/msm/qcom,x1e80100-mdss.yaml +++ b/Documentation/devicetree/bindings/display/msm/qcom,x1e80100-mdss.yaml @@ -208,47 +208,47 @@ examples: #sound-dai-cells = <0>; ports { - #address-cells = <1>; - #size-cells = <0>; + #address-cells = <1>; + #size-cells = <0>; - port@0 { - reg = <0>; + port@0 { + reg = <0>; - mdss_dp0_in: endpoint { - remote-endpoint = <&mdss_intf0_out>; - }; - }; + mdss_dp0_in: endpoint { + remote-endpoint = <&mdss_intf0_out>; + }; + }; - port@1 { - reg = <1>; + port@1 { + reg = <1>; - mdss_dp0_out: endpoint { - }; - }; + mdss_dp0_out: endpoint { + }; + }; }; mdss_dp0_opp_table: opp-table { - compatible = "operating-points-v2"; + compatible = "operating-points-v2"; - opp-160000000 { - opp-hz = /bits/ 64 <160000000>; - required-opps = <&rpmhpd_opp_low_svs>; - }; + opp-160000000 { + opp-hz = /bits/ 64 <160000000>; + required-opps = <&rpmhpd_opp_low_svs>; + }; - opp-270000000 { - opp-hz = /bits/ 64 <270000000>; - required-opps = <&rpmhpd_opp_svs>; - }; + opp-270000000 { + opp-hz = /bits/ 64 <270000000>; + required-opps = <&rpmhpd_opp_svs>; + }; - opp-540000000 { - opp-hz = /bits/ 64 <540000000>; - required-opps = <&rpmhpd_opp_svs_l1>; - }; + opp-540000000 { + opp-hz = /bits/ 64 <540000000>; + required-opps = <&rpmhpd_opp_svs_l1>; + }; - opp-810000000 { - opp-hz = /bits/ 64 <810000000>; - required-opps = <&rpmhpd_opp_nom>; - }; + opp-810000000 { + opp-hz = /bits/ 64 <810000000>; + required-opps = <&rpmhpd_opp_nom>; + }; }; }; }; From 1ff08266c7f785a28be734d57319eeb061d34ce2 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 21 Sep 2026 18:26:16 -0500 Subject: [PATCH 46/72] dt-bindings: mux: reg-mux: Allow zero-cell controls Some reg-mux users reference a controller without an argument cell when there is only one mux control exposed by the provider. Permit #mux-control-cells to be either 0 or 1 so the converted schema matches both existing provider styles. Assisted-by: LLM Acked-by: Conor Dooley Link: https://patch.msgid.link/20260921232617.3130745-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/mux/reg-mux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mux/reg-mux.yaml b/Documentation/devicetree/bindings/mux/reg-mux.yaml index dc4be092fc2f..c8de11a90d90 100644 --- a/Documentation/devicetree/bindings/mux/reg-mux.yaml +++ b/Documentation/devicetree/bindings/mux/reg-mux.yaml @@ -22,7 +22,7 @@ properties: reg: true '#mux-control-cells': - const: 1 + enum: [ 0, 1 ] mux-reg-masks: $ref: /schemas/types.yaml#/definitions/uint32-matrix From 234ad23ef7b19739cc9327dea647389af7210a50 Mon Sep 17 00:00:00 2001 From: Quchaosheng Date: Thu, 17 Sep 2026 19:58:18 +0800 Subject: [PATCH 47/72] dt-bindings: arm: vexpress: drop the obsolete hwmon and regulator text files Documentation/devicetree/bindings/hwmon/vexpress.txt describes the arm,vexpress-volt, -amp, -temp, -power and -energy sensors, and Documentation/devicetree/bindings/regulator/vexpress.txt describes the arm,vexpress-volt regulator. Both restate what arm/vexpress-config.yaml already documents: the same compatibles, the arm,vexpress-sysreg,func property and the label property. The regulator node refers to regulator.yaml, which covers the generic regulator properties the second file lists, and all 13 in-tree arm,vexpress-volt nodes set both of the properties it calls required. One sentence in the regulator file is not a restatement: it says that a supply without regulator-min-microvolt and regulator-max-microvolt is treated as fixed. vexpress_regulator_probe() implements that by selecting vexpress_regulator_ops_ro when the two properties do not both define a range. Move the note into the regulator node description in the schema, so that removing the file does not lose it. Nothing else refers to the two files. Remove them. Assisted-by: LLM Signed-off-by: Quchaosheng Link: https://patch.msgid.link/20260917115818.540344-2-quchaosheng000406@163.com Signed-off-by: Rob Herring (Arm) --- .../bindings/arm/vexpress-config.yaml | 4 +++ .../devicetree/bindings/hwmon/vexpress.txt | 23 ------------- .../bindings/regulator/vexpress.txt | 32 ------------------- 3 files changed, 4 insertions(+), 55 deletions(-) delete mode 100644 Documentation/devicetree/bindings/hwmon/vexpress.txt delete mode 100644 Documentation/devicetree/bindings/regulator/vexpress.txt diff --git a/Documentation/devicetree/bindings/arm/vexpress-config.yaml b/Documentation/devicetree/bindings/arm/vexpress-config.yaml index 41c53e3acc12..b04e8e052181 100644 --- a/Documentation/devicetree/bindings/arm/vexpress-config.yaml +++ b/Documentation/devicetree/bindings/arm/vexpress-config.yaml @@ -139,6 +139,10 @@ patternProperties: "^regulator-.+$": $ref: /schemas/regulator/regulator.yaml# + description: + If regulator-min-microvolt and regulator-max-microvolt do not both + define a range, the supply is treated as fixed and only its voltage + can be read. properties: compatible: const: arm,vexpress-volt diff --git a/Documentation/devicetree/bindings/hwmon/vexpress.txt b/Documentation/devicetree/bindings/hwmon/vexpress.txt deleted file mode 100644 index 4a4df4ffc460..000000000000 --- a/Documentation/devicetree/bindings/hwmon/vexpress.txt +++ /dev/null @@ -1,23 +0,0 @@ -Versatile Express hwmon sensors -------------------------------- - -Requires node properties: -- "compatible" value : one of - "arm,vexpress-volt" - "arm,vexpress-amp" - "arm,vexpress-temp" - "arm,vexpress-power" - "arm,vexpress-energy" -- "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg - (see Documentation/devicetree/bindings/arm/vexpress-config.yaml - for more details) - -Optional node properties: -- label : string describing the monitored value - -Example: - energy@0 { - compatible = "arm,vexpress-energy"; - arm,vexpress-sysreg,func = <13 0>; - label = "A15 Jcore"; - }; diff --git a/Documentation/devicetree/bindings/regulator/vexpress.txt b/Documentation/devicetree/bindings/regulator/vexpress.txt deleted file mode 100644 index 1c2e92c7831e..000000000000 --- a/Documentation/devicetree/bindings/regulator/vexpress.txt +++ /dev/null @@ -1,32 +0,0 @@ -Versatile Express voltage regulators ------------------------------------- - -Requires node properties: -- "compatible" value: "arm,vexpress-volt" -- "arm,vexpress-sysreg,func" when controlled via vexpress-sysreg - (see Documentation/devicetree/bindings/arm/vexpress-config.yaml - for more details) - -Required regulator properties: -- "regulator-name" -- "regulator-always-on" - -Optional regulator properties: -- "regulator-min-microvolt" -- "regulator-max-microvolt" - -See Documentation/devicetree/bindings/regulator/regulator.txt -for more details about the regulator properties. - -When no "regulator-[min|max]-microvolt" properties are defined, -the device is treated as fixed (or rather "read-only") regulator. - -Example: - volt@0 { - compatible = "arm,vexpress-volt"; - arm,vexpress-sysreg,func = <2 0>; - regulator-name = "Cores"; - regulator-min-microvolt = <800000>; - regulator-max-microvolt = <1050000>; - regulator-always-on; - }; From 2565b3cf550a4055a1254427c3c3ae566f66ddcb Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Wed, 23 Sep 2026 14:14:48 -0500 Subject: [PATCH 48/72] dt-bindings: soc: hisilicon: Add HIP05 CPLD Add schema for the hisilicon,hip05-cpld node on the HIP05 D02 board which is already in use. The node only contains the compatible string and one register window on the local bus. Assisted-by: LLM Acked-by: Wei Xu Acked-by: Conor Dooley Link: https://patch.msgid.link/20260923191449.2204388-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../soc/hisilicon/hisilicon,hip05-cpld.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml diff --git a/Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml b/Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml new file mode 100644 index 000000000000..eaaa8f917bdd --- /dev/null +++ b/Documentation/devicetree/bindings/soc/hisilicon/hisilicon,hip05-cpld.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/hisilicon/hisilicon,hip05-cpld.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HIP05 CPLD registers + +maintainers: + - Wei Xu + +properties: + compatible: + const: hisilicon,hip05-cpld + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + local-bus { + #address-cells = <2>; + #size-cells = <1>; + + cpld@100000000 { + compatible = "hisilicon,hip05-cpld"; + reg = <0x1 0x0 0x100>; + }; + }; From 30ebfdd7d5d78400605de65cf1dceebc717d7ffa Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 21 Sep 2026 18:28:26 -0500 Subject: [PATCH 49/72] dt-bindings: arm: cci: Allow syscon fallback Allow ARM CCI-400 slave interface nodes to use a syscon fallback compatible. The MT7622 DTS uses the fallback on cci_control2 while keeping arm,cci-400-ctrl-if as the primary compatible. Assisted-by: LLM Link: https://patch.msgid.link/20260921232827.3138193-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/arm/arm,cci-400.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/arm,cci-400.yaml b/Documentation/devicetree/bindings/arm/arm,cci-400.yaml index d28303d909e1..a4f086c2f9c4 100644 --- a/Documentation/devicetree/bindings/arm/arm,cci-400.yaml +++ b/Documentation/devicetree/bindings/arm/arm,cci-400.yaml @@ -45,7 +45,11 @@ patternProperties: properties: compatible: - const: arm,cci-400-ctrl-if + oneOf: + - const: arm,cci-400-ctrl-if + - items: + - const: arm,cci-400-ctrl-if + - const: syscon interface-type: enum: From 034b3b1ce25a62222920e2bb3b6a0c7ef160b108 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 21 Sep 2026 18:28:18 -0500 Subject: [PATCH 50/72] dt-bindings: arm: mediatek: Fix MT6779 audsys compatible The correct name for the MediaTek MT6779 audsys compatible is "mediatek,mt6779-audio", not "mediatek,mt6779-audsys". The original .txt binding was correct. Fixes: e97c618234d9 ("dt-bindings: arm: mediatek: convert audsys and mt2701-afe-pcm to yaml") Assisted-by: LLM Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20260921232819.3137721-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/arm/mediatek/mediatek,audsys.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml index 9aa39b002361..5ede7d277488 100644 --- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml +++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,audsys.yaml @@ -19,7 +19,7 @@ properties: - enum: - mediatek,mt2701-audsys - mediatek,mt6765-audsys - - mediatek,mt6779-audsys + - mediatek,mt6779-audio - mediatek,mt7622-audsys - mediatek,mt8167-audsys - mediatek,mt8173-audsys From a1a1b1102fbd348beb1c22433591f9d7207a5278 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 21 Sep 2026 18:27:58 -0500 Subject: [PATCH 51/72] dt-bindings: gpu: Allow Hi6220 Mali resets Hi6220 Mali nodes provide both ao_g3d and media_g3d resets. Require those two resets and their names for the Hi6220 compatible. Other Mali Utgard nodes have at most one reset and do not use reset names. Assisted-by: LLM Link: https://patch.msgid.link/20260921232758.3136548-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/gpu/arm,mali-utgard.yaml | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml index c8d0d9192d92..d68fe8c7d010 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml +++ b/Documentation/devicetree/bindings/gpu/arm,mali-utgard.yaml @@ -112,7 +112,13 @@ properties: maxItems: 1 resets: - maxItems: 1 + minItems: 1 + maxItems: 2 + + reset-names: + items: + - const: ao_g3d + - const: media_g3d operating-points-v2: true @@ -130,6 +136,23 @@ required: additionalProperties: false allOf: + - if: + properties: + compatible: + contains: + const: hisilicon,hi6220-mali + then: + properties: + resets: + minItems: 2 + required: + - reset-names + else: + properties: + resets: + maxItems: 1 + reset-names: false + - if: properties: compatible: From 7766b5b6b0e48cc6d493068e00243540582c0560 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 21 Sep 2026 18:25:08 -0500 Subject: [PATCH 52/72] dt-bindings: soc: nuvoton: Fix NPCM845 GCR compatibles The Nuvoton NPCM845 GCR doesn't have any child nodes and therefore isn't a simple-mfd device, so drop the compatible for it. This matches the DTS files. Assisted-by: LLM Link: https://patch.msgid.link/20260921232509.3126844-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml b/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml index 23e7e4ea01ff..9f6f009ec991 100644 --- a/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml +++ b/Documentation/devicetree/bindings/soc/nuvoton/nuvoton,npcm-gcr.yaml @@ -17,13 +17,17 @@ description: properties: compatible: - items: - - enum: - - nuvoton,wpcm450-gcr - - nuvoton,npcm750-gcr - - nuvoton,npcm845-gcr - - const: syscon - - const: simple-mfd + oneOf: + - items: + - enum: + - nuvoton,npcm845-gcr + - const: syscon + - items: + - enum: + - nuvoton,wpcm450-gcr + - nuvoton,npcm750-gcr + - const: syscon + - const: simple-mfd reg: maxItems: 1 From fa2f7a195ed2ac9f9221051d190b882cb1cdd550 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Mon, 21 Sep 2026 11:15:54 +0200 Subject: [PATCH 53/72] dt-bindings: display: faraday,tve200: Use a level-high interrupt The TVE200 vertical interrupt can remain pending after acknowledgment. Using rising-edge triggering can leave it unserviced when no new edge is generated, causing vblank and page-flip timeouts on the D-Link DIR-685. Use level-high triggering in the binding example so a pending interrupt is delivered again without requiring a new edge. Assisted-by: LLM Signed-off-by: Linus Walleij Acked-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260921-gemini-tve200-fix-v1-1-8be03ac2a8f7@kernel.org Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/display/faraday,tve200.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/faraday,tve200.yaml b/Documentation/devicetree/bindings/display/faraday,tve200.yaml index b09628b69177..43dbe2778d6b 100644 --- a/Documentation/devicetree/bindings/display/faraday,tve200.yaml +++ b/Documentation/devicetree/bindings/display/faraday,tve200.yaml @@ -54,7 +54,7 @@ examples: display-controller@6a000000 { compatible = "faraday,tve200"; reg = <0x6a000000 0x1000>; - interrupts = <13 IRQ_TYPE_EDGE_RISING>; + interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; resets = <&syscon GEMINI_RESET_TVC>; clocks = <&syscon GEMINI_CLK_GATE_TVC>, <&syscon GEMINI_CLK_TVC>; From cbe0f79dcab1c121d767927b53a61eadf2c5b518 Mon Sep 17 00:00:00 2001 From: Fuad Tabba Date: Mon, 7 Sep 2026 12:29:43 +0100 Subject: [PATCH 54/72] of/irq: Fix device node refcount leak in of_check_msi_parent() of_msi_xlate() documents @msi_np as a filter when it points at a node on entry, handing back a reference only when it points at NULL. The msi-map branch does that. of_check_msi_parent() keeps the reference from the 1:1 msi-parent match either way. pci_msi_domain_get_msi_rid() is the only caller that passes a node in, from irq_domain_get_of_node(), and it puts nothing, so a 1:1 match there leaks the MSI controller node. Fixes: 119aaeed0b67 ("of/irq: Add msi-parent check to of_msi_xlate()") Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260826113604.010C01F000E9@smtp.kernel.org/ Signed-off-by: Fuad Tabba Link: https://lore.kernel.org/all/20260826113604.010C01F000E9@smtp.kernel.org/ Link: https://patch.msgid.link/20260907112944.313618-2-fuad.tabba@linux.dev Signed-off-by: Rob Herring (Arm) --- drivers/of/irq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index ec035367c950..109c54f34647 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -785,7 +785,7 @@ static int of_check_msi_parent(struct device_node *dev_node, struct device_node if ((*msi_node && *msi_node != msi_spec.np) || msi_spec.args_count != 0) ret = -EINVAL; - if (!ret) { + if (!ret && !*msi_node) { /* Return with a node reference held */ *msi_node = msi_spec.np; return 0; From 833aaa4790eee9812269b776eb8672acf1524741 Mon Sep 17 00:00:00 2001 From: Fuad Tabba Date: Mon, 7 Sep 2026 12:29:44 +0100 Subject: [PATCH 55/72] of/irq: Stop the MSI walk at the first msi-parent of_check_msi_parent() returns -EINVAL both when the msi-parent names a controller other than the one the caller filters on and when #msi-cells isn't 0, so of_msi_xlate() can't tell the two apart and carries on up the hierarchy. An ancestor's msi-map then maps the device onto a controller its own node didn't name. Hand the parsed specifier back to of_msi_xlate(), which owns the reference as it already does on the msi-map path, and end the walk at any node that declares an msi-parent. Reported-by: Sashiko Closes: https://lore.kernel.org/all/20260904074800.875391F00A3F@smtp.kernel.org/ Suggested-by: Lorenzo Pieralisi Link: https://lore.kernel.org/all/apqnaNmeuUjfC8Ng@red-moon/ Signed-off-by: Fuad Tabba Link: https://patch.msgid.link/20260907112944.313618-3-fuad.tabba@linux.dev Signed-off-by: Rob Herring (Arm) --- drivers/of/irq.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/drivers/of/irq.c b/drivers/of/irq.c index 109c54f34647..4fbbd13f4d0a 100644 --- a/drivers/of/irq.c +++ b/drivers/of/irq.c @@ -765,34 +765,27 @@ void __init of_irq_init(const struct of_device_id *matches) } } -static int of_check_msi_parent(struct device_node *dev_node, struct device_node **msi_node) +static int of_check_msi_parent(struct device_node *dev_node, struct device_node **msi_node, + struct of_phandle_args *msi_spec) { - struct of_phandle_args msi_spec; int ret; /* * An msi-parent phandle with a missing or == 0 #msi-cells * property identifies a 1:1 ID translation mapping. * - * Set the msi controller node if the firmware matches this - * condition. + * @msi_spec keeps a reference to the target node whenever the + * phandle parses, -EINVAL included, and the caller releases it. */ ret = of_parse_phandle_with_optional_args(dev_node, "msi-parent", "#msi-cells", - 0, &msi_spec); + 0, msi_spec); if (ret) return ret; - if ((*msi_node && *msi_node != msi_spec.np) || msi_spec.args_count != 0) - ret = -EINVAL; + if ((*msi_node && *msi_node != msi_spec->np) || msi_spec->args_count != 0) + return -EINVAL; - if (!ret && !*msi_node) { - /* Return with a node reference held */ - *msi_node = msi_spec.np; - return 0; - } - of_node_put(msi_spec.np); - - return ret; + return 0; } /** @@ -806,7 +799,9 @@ static int of_check_msi_parent(struct device_node *dev_node, struct device_node * @id_in: Device ID. * * Walk up the device hierarchy looking for devices with a "msi-map" - * or "msi-parent" property. If found, apply the mapping to @id_in. + * or "msi-parent" property. If found, apply the mapping to @id_in. With + * @msi_np non-NULL, a device declaring an msi-parent ends the walk, usable + * or not. * * Returns: The mapped MSI id. */ @@ -821,6 +816,7 @@ u32 of_msi_xlate(struct device *dev, struct device_node **msi_np, u32 id_in) */ for (parent_dev = dev; parent_dev; parent_dev = parent_dev->parent) { struct of_phandle_args msi_spec = {}; + int ret; if (!of_map_msi_id(parent_dev->of_node, id_in, msi_np, &msi_spec)) { if (msi_spec.np) { @@ -835,8 +831,17 @@ u32 of_msi_xlate(struct device *dev, struct device_node **msi_np, u32 id_in) break; } /* -ENODEV: msi-map absent → check for msi-parent */ - if (msi_np && !of_check_msi_parent(parent_dev->of_node, msi_np)) + if (!msi_np) + continue; + + ret = of_check_msi_parent(parent_dev->of_node, msi_np, &msi_spec); + if (msi_spec.np) { + /* A declared msi-parent names the controller, usable or not */ + if (!ret && !*msi_np) + *msi_np = of_node_get(msi_spec.np); + of_node_put(msi_spec.np); break; + } } return id_out; } From e522371064a42c2492a2a3c232ef0da454b85848 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Wed, 23 Sep 2026 14:15:10 -0500 Subject: [PATCH 56/72] dt-bindings: scsi: Convert hisilicon,hip05-sas-v1 to DT schema Convert the HiSilicon SAS controller binding to DT schema. It's a straight forward conversion. Assisted-by: LLM Link: https://patch.msgid.link/20260923191511.2205564-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/scsi/hisilicon,hip05-sas-v1.yaml | 158 ++++++++++++++++++ .../bindings/scsi/hisilicon-sas.txt | 98 ----------- MAINTAINERS | 2 +- 3 files changed, 159 insertions(+), 99 deletions(-) create mode 100644 Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml delete mode 100644 Documentation/devicetree/bindings/scsi/hisilicon-sas.txt diff --git a/Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml b/Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml new file mode 100644 index 000000000000..27d4cf5078e6 --- /dev/null +++ b/Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml @@ -0,0 +1,158 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/scsi/hisilicon,hip05-sas-v1.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon SAS controller + +maintainers: + - Xingui Yang + +properties: + compatible: + items: + - enum: + - hisilicon,hip05-sas-v1 + - hisilicon,hip06-sas-v2 + - hisilicon,hip07-sas-v2 + + reg: + minItems: 1 + items: + - description: SAS registers + - description: CPLD SGPIO control registers + + clocks: + minItems: 1 + maxItems: 2 + + dma-coherent: true + + interrupts: + description: > + Interrupt specifiers for PHY, SATA, and completion queues; ordering and + number depend on controller version. + + For v1 hw: Interrupts for phys, completion queues, and fatal + sources; the interrupts are ordered in 3 groups, as follows: + + - Phy interrupts - Each phy has 3 interrupt sources: + - broadcast + - phyup + - abnormal + The phy interrupts are ordered into groups of 3 per phy + (broadcast, phyup, and abnormal) in increasing order. + - Completion queue interrupts - each completion queue has 1 interrupt + source. + - Fatal interrupts - the fatal interrupts are ordered as follows: + - ECC + - AXI bus + + For v2 hw: Interrupts for phys, Sata, and completion queues; + the interrupts are ordered in 3 groups, as follows: + + - Phy interrupts - Each controller has 2 phy interrupts: + - phy up/down + - channel interrupt + - Sata interrupts - Each phy on the controller has 1 Sata interrupt. + - Completion queue interrupts - each completion queue has 1 interrupt + source + minItems: 58 + maxItems: 128 + + ctrl-reset-reg: + description: Offset to controller reset register in SAS syscon region. + $ref: /schemas/types.yaml#/definitions/uint32 + + ctrl-reset-sts-reg: + description: Offset to controller reset status register in SAS syscon region. + $ref: /schemas/types.yaml#/definitions/uint32 + + ctrl-clock-ena-reg: + description: Offset to controller clock enable register in SAS syscon region. + $ref: /schemas/types.yaml#/definitions/uint32 + + hip06-sas-v2-quirk-amt: + description: + Indicates that the v2 controller has the "am-max-transmissions" limitation. + type: boolean + + hisilicon,sas-syscon: + description: Phandle of syscon used for SAS control. + $ref: /schemas/types.yaml#/definitions/phandle + + hisilicon,signal-attenuation: + description: + De-emphasis, preshoot, and boost attenuation readings for the board, + used to calculate signal attenuation (y = (x-10000)/10000). + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 3 + maxItems: 3 + items: + minimum: 7600 + maximum: 12400 + + phy-count: + description: Number of PHYs accessible by the controller. + $ref: /schemas/types.yaml#/definitions/uint32 + + queue-count: + description: Number of delivery and completion queues in the controller. + $ref: /schemas/types.yaml#/definitions/uint32 + + sas-addr: + description: SAS address, array of 8 bytes representing host SAS address. + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 8 + maxItems: 8 + +required: + - compatible + - reg + - interrupts + - ctrl-reset-reg + - ctrl-reset-sts-reg + - ctrl-clock-ena-reg + - hisilicon,sas-syscon + - phy-count + - queue-count + - sas-addr + +additionalProperties: false + +examples: + - | + sas@c1000000 { + compatible = "hisilicon,hip05-sas-v1"; + reg = <0xc1000000 0x10000>; + dma-coherent; + interrupts = <259 4>, <263 4>, <264 4>, /* phy0 */ + <269 4>, <273 4>, <274 4>, /* phy1 */ + <279 4>, <283 4>, <284 4>, /* phy2 */ + <289 4>, <293 4>, <294 4>, /* phy3 */ + <299 4>, <303 4>, <304 4>, /* phy4 */ + <309 4>, <313 4>, <314 4>, /* phy5 */ + <319 4>, <323 4>, <324 4>, /* phy6 */ + <329 4>, <333 4>, <334 4>, /* phy7 */ + <336 1>, <337 1>, <338 1>, /* cq0-2 */ + <339 1>, <340 1>, <341 1>, /* cq3-5 */ + <342 1>, <343 1>, <344 1>, /* cq6-8 */ + <345 1>, <346 1>, <347 1>, /* cq9-11 */ + <348 1>, <349 1>, <350 1>, /* cq12-14 */ + <351 1>, <352 1>, <353 1>, /* cq15-17 */ + <354 1>, <355 1>, <356 1>, /* cq18-20 */ + <357 1>, <358 1>, <359 1>, /* cq21-23 */ + <360 1>, <361 1>, <362 1>, /* cq24-26 */ + <363 1>, <364 1>, <365 1>, /* cq27-29 */ + <366 1>, <367 1>, /* cq30-31 */ + <376 4>, /* fatal ecc */ + <381 4>; /* fatal axi */ + ctrl-reset-reg = <0xa60>; + ctrl-reset-sts-reg = <0x5a30>; + ctrl-clock-ena-reg = <0x338>; + hisilicon,sas-syscon = <&pcie_sas>; + queue-count = <32>; + phy-count = <8>; + sas-addr = [50 01 88 20 16 00 00 0a]; + }; diff --git a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt b/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt deleted file mode 100644 index 8c6659ed2cfc..000000000000 --- a/Documentation/devicetree/bindings/scsi/hisilicon-sas.txt +++ /dev/null @@ -1,98 +0,0 @@ -* HiSilicon SAS controller - -The HiSilicon SAS controller supports SAS/SATA. - -Main node required properties: - - compatible : value should be as follows: - (a) "hisilicon,hip05-sas-v1" for v1 hw in hip05 chipset - (b) "hisilicon,hip06-sas-v2" for v2 hw in hip06 chipset - (c) "hisilicon,hip07-sas-v2" for v2 hw in hip07 chipset - - sas-addr : array of 8 bytes for host SAS address - - reg : Contains two regions. The first is the address and length of the SAS - register. The second is the address and length of CPLD register for - SGPIO control. The second is optional, and should be set only when - we use a CPLD for directly attached disk LED control. - - hisilicon,sas-syscon: phandle of syscon used for sas control - - ctrl-reset-reg : offset to controller reset register in ctrl reg - - ctrl-reset-sts-reg : offset to controller reset status register in ctrl reg - - ctrl-clock-ena-reg : offset to controller clock enable register in ctrl reg - - queue-count : number of delivery and completion queues in the controller - - phy-count : number of phys accessible by the controller - - interrupts : For v1 hw: Interrupts for phys, completion queues, and fatal - sources; the interrupts are ordered in 3 groups, as follows: - - Phy interrupts - - Completion queue interrupts - - Fatal interrupts - Phy interrupts : Each phy has 3 interrupt sources: - - broadcast - - phyup - - abnormal - The phy interrupts are ordered into groups of 3 per phy - (broadcast, phyup, and abnormal) in increasing order. - Completion queue interrupts : each completion queue has 1 - interrupt source. - The interrupts are ordered in increasing order. - Fatal interrupts : the fatal interrupts are ordered as follows: - - ECC - - AXI bus - For v2 hw: Interrupts for phys, Sata, and completion queues; - the interrupts are ordered in 3 groups, as follows: - - Phy interrupts - - Sata interrupts - - Completion queue interrupts - Phy interrupts : Each controller has 2 phy interrupts: - - phy up/down - - channel interrupt - Sata interrupts : Each phy on the controller has 1 Sata - interrupt. The interrupts are ordered in increasing - order. - Completion queue interrupts : each completion queue has 1 - interrupt source. The interrupts are ordered in - increasing order. - -Optional main node properties: - - hip06-sas-v2-quirk-amt : when set, indicates that the v2 controller has the - "am-max-transmissions" limitation. - - hisilicon,signal-attenuation : array of 3 32-bit values, containing de-emphasis, - preshoot, and boost attenuation readings for the board. They - are used to describe the signal attenuation of the board. These - values' range is 7600 to 12400, and used to represent -24dB to - 24dB. - The formula is "y = (x-10000)/10000". For example, 10478 - means 4.78dB. - -Example: - sas0: sas@c1000000 { - compatible = "hisilicon,hip05-sas-v1"; - sas-addr = [50 01 88 20 16 00 00 0a]; - reg = <0x0 0xc1000000 0x0 0x10000>; - hisilicon,sas-syscon = <&pcie_sas>; - ctrl-reset-reg = <0xa60>; - ctrl-reset-sts-reg = <0x5a30>; - ctrl-clock-ena-reg = <0x338>; - queue-count = <32>; - phy-count = <8>; - dma-coherent; - interrupt-parent = <&mbigen_dsa>; - interrupts = <259 4>,<263 4>,<264 4>,/* phy0 */ - <269 4>,<273 4>,<274 4>,/* phy1 */ - <279 4>,<283 4>,<284 4>,/* phy2 */ - <289 4>,<293 4>,<294 4>,/* phy3 */ - <299 4>,<303 4>,<304 4>,/* phy4 */ - <309 4>,<313 4>,<314 4>,/* phy5 */ - <319 4>,<323 4>,<324 4>,/* phy6 */ - <329 4>,<333 4>,<334 4>,/* phy7 */ - <336 1>,<337 1>,<338 1>,/* cq0-2 */ - <339 1>,<340 1>,<341 1>,/* cq3-5 */ - <342 1>,<343 1>,<344 1>,/* cq6-8 */ - <345 1>,<346 1>,<347 1>,/* cq9-11 */ - <348 1>,<349 1>,<350 1>,/* cq12-14 */ - <351 1>,<352 1>,<353 1>,/* cq15-17 */ - <354 1>,<355 1>,<356 1>,/* cq18-20 */ - <357 1>,<358 1>,<359 1>,/* cq21-23 */ - <360 1>,<361 1>,<362 1>,/* cq24-26 */ - <363 1>,<364 1>,<365 1>,/* cq27-29 */ - <366 1>,<367 1>/* cq30-31 */ - <376 4>,/* fatal ecc */ - <381 4>;/* fatal axi */ - }; diff --git a/MAINTAINERS b/MAINTAINERS index d68479f4d473..d1d62c6fde28 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11877,7 +11877,7 @@ HISILICON SAS Controller M: Xingui Yang S: Supported W: http://www.hisilicon.com -F: Documentation/devicetree/bindings/scsi/hisilicon-sas.txt +F: Documentation/devicetree/bindings/scsi/hisilicon,hip05-sas-v1.yaml F: drivers/scsi/hisi_sas/ HISILICON SECURITY ENGINE V2 DRIVER (SEC2) From bb91f8668c2478dbea41e3b08f214732c5f5870a Mon Sep 17 00:00:00 2001 From: Ariel D'Alessandro Date: Wed, 1 Oct 2025 15:35:17 -0300 Subject: [PATCH 57/72] dt-bindings: ASoC: Convert MediaTek RT5650 codecs bindings to DT schema Convert the existing text-based DT bindings for Mediatek MT8173 RT5650 codecs to a DT schema. Signed-off-by: Ariel D'Alessandro Reviewed-by: Rob Herring (Arm) Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20251001183517.83278-1-ariel.dalessandro@collabora.com Signed-off-by: Rob Herring (Arm) --- .../sound/mediatek,mt8173-rt5650.yaml | 73 +++++++++++++++++++ .../bindings/sound/mt8173-rt5650.txt | 31 -------- 2 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml delete mode 100644 Documentation/devicetree/bindings/sound/mt8173-rt5650.txt diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml new file mode 100644 index 000000000000..a3166cc40a20 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/mediatek,mt8173-rt5650.yaml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/sound/mediatek,mt8173-rt5650.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Mediatek MT8173 with RT5650 codecs and HDMI via I2S + +maintainers: + - Ariel D'Alessandro + +properties: + compatible: + const: mediatek,mt8173-rt5650 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + mediatek,audio-codec: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + The phandles of rt5650 codecs and of the HDMI encoder node. + minItems: 2 + + mediatek,platform: + $ref: /schemas/types.yaml#/definitions/phandle + description: + The phandle of MT8173 ASoC platform. + + mediatek,mclk: + $ref: /schemas/types.yaml#/definitions/uint32 + description: | + The MCLK source. + 0: external oscillator, MCLK = 12.288M + 1: internal source from mt8173, MCLK = sampling rate * 256 + + codec-capture: + description: Subnode of rt5650 codec capture. + type: object + + properties: + sound-dai: + maxItems: 1 + description: phandle of the CPU DAI + + additionalProperties: false + +required: + - compatible + - mediatek,audio-codec + - mediatek,platform + +additionalProperties: false + +examples: + - | + sound { + compatible = "mediatek,mt8173-rt5650"; + mediatek,audio-codec = <&rt5650 &hdmi0>; + mediatek,platform = <&afe>; + pinctrl-names = "default"; + pinctrl-0 = <&aud_i2s2>; + + mediatek,mclk = <1>; + codec-capture { + sound-dai = <&rt5650 1>; + }; + }; + +... diff --git a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt b/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt deleted file mode 100644 index 29dce2ac8773..000000000000 --- a/Documentation/devicetree/bindings/sound/mt8173-rt5650.txt +++ /dev/null @@ -1,31 +0,0 @@ -MT8173 with RT5650 CODECS and HDMI via I2S - -Required properties: -- compatible : "mediatek,mt8173-rt5650" -- mediatek,audio-codec: the phandles of rt5650 codecs - and of the hdmi encoder node -- mediatek,platform: the phandle of MT8173 ASoC platform - -Optional subnodes: -- codec-capture : the subnode of rt5650 codec capture -Required codec-capture subnode properties: -- sound-dai: audio codec dai name on capture path - <&rt5650 0> : Default setting. Connect rt5650 I2S1 for capture. (dai_name = rt5645-aif1) - <&rt5650 1> : Connect rt5650 I2S2 for capture. (dai_name = rt5645-aif2) - -- mediatek,mclk: the MCLK source - 0 : external oscillator, MCLK = 12.288M - 1 : internal source from mt8173, MCLK = sampling rate*256 - -Example: - - sound { - compatible = "mediatek,mt8173-rt5650"; - mediatek,audio-codec = <&rt5650 &hdmi0>; - mediatek,platform = <&afe>; - mediatek,mclk = <0>; - codec-capture { - sound-dai = <&rt5650 1>; - }; - }; - From da95a0d8ab0a7c53f03ec944eadd9b3e5b5d8a21 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Fri, 2 Oct 2026 08:30:12 +0200 Subject: [PATCH 58/72] dt-bindings: arm: keystone: ti,sci: Correct reg and mboxes constraints minItems does not impose any limit on actual maximum number of items in a list, thus it needs maxItems. maxItems on the other hand does imply minItems. Add missing upper bound on 'reg' and 'mboxes'. Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley Link: https://patch.msgid.link/20261002063011.38972-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml b/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml index 25a2b42105e5..052e23966a8f 100644 --- a/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml +++ b/Documentation/devicetree/bindings/arm/keystone/ti,sci.yaml @@ -48,7 +48,7 @@ properties: const: debug_messages reg: - minItems: 1 + maxItems: 1 mbox-names: description: | @@ -59,7 +59,7 @@ properties: - const: tx mboxes: - minItems: 2 + maxItems: 2 ti,host-id: $ref: /schemas/types.yaml#/definitions/uint32 From e2c8975e89ebd674ca86cefaaa96a2bd35ad8e55 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Fri, 2 Oct 2026 12:14:10 -0500 Subject: [PATCH 59/72] dt-bindings: reset: Drop obsolete STM32(MP1) RCC bindings The STM32 RCC bindings are replaced with schemas already. Drop the obsolete .txt bindings. Assisted-by: LLM Acked-by: Conor Dooley Link: https://patch.msgid.link/20261002171412.2716314-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/reset/st,stm32-rcc.txt | 6 ------ Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt | 6 ------ 2 files changed, 12 deletions(-) delete mode 100644 Documentation/devicetree/bindings/reset/st,stm32-rcc.txt delete mode 100644 Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt diff --git a/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt b/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt deleted file mode 100644 index 384035e8e60b..000000000000 --- a/Documentation/devicetree/bindings/reset/st,stm32-rcc.txt +++ /dev/null @@ -1,6 +0,0 @@ -STMicroelectronics STM32 Peripheral Reset Controller -==================================================== - -The RCC IP is both a reset and a clock controller. - -Please see Documentation/devicetree/bindings/clock/st,stm32-rcc.yaml diff --git a/Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt b/Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt deleted file mode 100644 index 2880d5dda95e..000000000000 --- a/Documentation/devicetree/bindings/reset/st,stm32mp1-rcc.txt +++ /dev/null @@ -1,6 +0,0 @@ -STMicroelectronics STM32MP1 Peripheral Reset Controller -======================================================= - -The RCC IP is both a reset and a clock controller. - -Please see Documentation/devicetree/bindings/clock/st,stm32mp1-rcc.yaml From 5ef299ffb56531b3a4f2b311000da76beed403ee Mon Sep 17 00:00:00 2001 From: Long Zhao Date: Wed, 14 Oct 2026 01:46:00 +0800 Subject: [PATCH 60/72] dt-bindings: vendor-prefixes: add Ambarella Document the Ambarella, Inc. vendor prefix so Ambarella DT bindings can be applied without waiting for the SoC series. Signed-off-by: Long Zhao Acked-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Acked-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261014-cv75-prefix-v1-1-fe95ed567880@ambarella.com Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index ba2002969373..a42fe1bf9ecd 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -114,6 +114,8 @@ patternProperties: description: Amarula Solutions "^amazon,.*": description: Amazon.com, Inc. + "^ambarella,.*": + description: Ambarella, Inc. "^amcc,.*": description: Applied Micro Circuits Corporation (APM, formally AMCC) "^amd,.*": From e8b2cbfafc4e844509a862b056528e8a0750d3d9 Mon Sep 17 00:00:00 2001 From: Sreeshankar K Date: Thu, 15 Oct 2026 05:19:24 +0000 Subject: [PATCH 61/72] dt-bindings: interrupt-controller: qcom,pdc: Document SM7250 PDC Document the PDC block on the SM7250 SoC. Signed-off-by: Sreeshankar K Acked-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261015051926.13752-5-sreeshankar0910@gmail.com Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/interrupt-controller/qcom,pdc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml b/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml index 518fbf6b2761..3d31f8ed8bc7 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/qcom,pdc.yaml @@ -51,6 +51,7 @@ properties: - qcom,sdx75-pdc - qcom,sm4450-pdc - qcom,sm6350-pdc + - qcom,sm7250-pdc - qcom,sm8150-pdc - qcom,sm8250-pdc - qcom,sm8350-pdc From 16f30811a93561a53307955b96573a0f24404d9f Mon Sep 17 00:00:00 2001 From: Baihui Liang Date: Thu, 15 Oct 2026 15:00:48 +0800 Subject: [PATCH 62/72] dt-bindings: gpu: img,powervr-rogue: add spacemit,k1-gpu and spacemit,k3-gpu Add compatible strings for the IMG GPUs in SpacemiT K1 and K3 SoCs: - K1: IMG BXE-2-32 (adds a dedicated entry for a single core clock and power domain). - K3: IMG BXM-4-64 (shares the same configuration and entry as the T-Head TH1520). Signed-off-by: Baihui Liang Reviewed-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20261015-spacemit-gpu-binding-v1-1-a7a23c7e7788@linux.spacemit.com Signed-off-by: Rob Herring (Arm) --- .../bindings/gpu/img,powervr-rogue.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml index e9218e0f363d..600445cd506d 100644 --- a/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml +++ b/Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml @@ -37,6 +37,12 @@ properties: - const: img,img-rogue - items: - enum: + - spacemit,k1-gpu + - const: img,img-bxe-2-32 + - const: img,img-rogue + - items: + - enum: + - spacemit,k3-gpu - thead,th1520-gpu - const: img,img-bxm-4-64 - const: img,img-rogue @@ -102,6 +108,8 @@ allOf: compatible: contains: enum: + - spacemit,k1-gpu + - spacemit,k3-gpu - ti,am62-gpu - ti,am62p-gpu - ti,j721s2-gpu @@ -162,13 +170,16 @@ allOf: properties: compatible: contains: - const: thead,th1520-gpu + enum: + - spacemit,k1-gpu + - spacemit,k3-gpu + - thead,th1520-gpu then: properties: power-domains: items: - - description: The single, unified power domain for the GPU on the - TH1520 SoC, integrating all internal IP power domains. + - description: The single, unified power domain for the GPU, + integrating all internal IP power domains. power-domain-names: false required: - power-domains From 0296643f62d6225f81f87050923ae677cf52078d Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 5 Oct 2026 15:53:09 -0500 Subject: [PATCH 63/72] dt-bindings: bus: Add HiSilicon local bus Add a schema for hisilicon,hisi-localbus which is already in use for a long time. Link: https://patch.msgid.link/20261005205310.2079198-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/bus/hisilicon,hisi-localbus.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml diff --git a/Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml b/Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml new file mode 100644 index 000000000000..56f13e21f24d --- /dev/null +++ b/Documentation/devicetree/bindings/bus/hisilicon,hisi-localbus.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/bus/hisilicon,hisi-localbus.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon local bus + +maintainers: + - Wei Xu + +allOf: + - $ref: /schemas/simple-bus.yaml# + +properties: + compatible: + items: + - const: hisilicon,hisi-localbus + - const: simple-bus + + reg: + maxItems: 1 + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + soc { + #address-cells = <2>; + #size-cells = <2>; + + local-bus@80380000 { + compatible = "hisilicon,hisi-localbus", "simple-bus"; + reg = <0x0 0x80380000 0x0 0x10000>; + #address-cells = <2>; + #size-cells = <1>; + ranges = <0 0 0x0 0x90000000 0x08000000>, + <1 0 0x0 0x98000000 0x08000000>; + }; + }; From 22a77ae9bae23cbfb9f772f24869621fde440d17 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 28 Sep 2026 17:25:51 -0500 Subject: [PATCH 64/72] dt-bindings: power: Convert mediatek,mt2701-scpsys to DT schema Convert the mediatek,mt2701-scpsys binding to DT schema. The mt6735 and mt6765 don't exist anywhere. The mt8183 is covered by mediatek,mt8195-scpsys.yaml schema. With those dropped, the clock-names are trimmed to drop mm-*, isp-*, cam-*, and venc_lt. The venc_lt and mfg_2d supplies are dropped as well. Link: https://patch.msgid.link/20260928222552.1118609-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../power/mediatek,mt2701-scpsys.yaml | 184 ++++++++++++++++++ .../bindings/soc/mediatek/scpsys.txt | 79 -------- 2 files changed, 184 insertions(+), 79 deletions(-) create mode 100644 Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml delete mode 100644 Documentation/devicetree/bindings/soc/mediatek/scpsys.txt diff --git a/Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml b/Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml new file mode 100644 index 000000000000..75c84abc865f --- /dev/null +++ b/Documentation/devicetree/bindings/power/mediatek,mt2701-scpsys.yaml @@ -0,0 +1,184 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/mediatek,mt2701-scpsys.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: MediaTek SCPSYS + +maintainers: + - Matthias Brugger + - AngeloGioacchino Del Regno + +description: > + The System Control Processor System (SCPSYS) has several power management + related tasks in the system. The tasks include thermal measurement, dynamic + voltage frequency scaling (DVFS), interrupt filter and lowlevel sleep control. + The System Power Manager (SPM) inside the SCPSYS is for the MTCMOS power + domain control. + + It provides the power domains defined in: + - include/dt-bindings/power/mt2701-power.h + - include/dt-bindings/power/mt2712-power.h + - include/dt-bindings/power/mt6797-power.h + - include/dt-bindings/power/mt7622-power.h + - include/dt-bindings/power/mt7623a-power.h + +properties: + compatible: + oneOf: + - enum: + - mediatek,mt7623a-scpsys + - mediatek,mt6797-scpsys + - items: + - enum: + - mediatek,mt2701-scpsys + - mediatek,mt2712-scpsys + - mediatek,mt7622-scpsys + - const: syscon + - items: + - const: mediatek,mt7623-scpsys + - const: mediatek,mt2701-scpsys + - const: syscon + - items: + - const: mediatek,mt7629-scpsys + - const: mediatek,mt7622-scpsys + + '#power-domain-cells': + description: Always 1 + const: 1 + + reg: + maxItems: 1 + + interrupts: + maxItems: 4 + + clocks: + minItems: 1 + maxItems: 20 + + clock-names: + minItems: 1 + maxItems: 6 + items: + enum: + - mm + - mfg + - ethif + - venc + - jpgdec + - audio + - vdec + - hif_sel + + vdec-supply: true + venc-supply: true + isp-supply: true + mm-supply: true + audio-supply: true + usb-supply: true + mfg_async-supply: true + mfg-supply: true + + infracfg: + description: Infrastructure configuration controller phandle + $ref: /schemas/types.yaml#/definitions/phandle + +required: + - compatible + - '#power-domain-cells' + - reg + - infracfg + - clocks + - clock-names + +additionalProperties: false + +allOf: + - if: + properties: + compatible: + contains: + const: mediatek,mt2701-scpsys + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mm + - const: mfg + - const: ethif + - if: + properties: + compatible: + contains: + const: mediatek,mt7623a-scpsys + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: ethif + - if: + properties: + compatible: + contains: + const: mediatek,mt2712-scpsys + then: + properties: + clocks: + minItems: 6 + clock-names: + items: + - const: mm + - const: mfg + - const: venc + - const: jpgdec + - const: audio + - const: vdec + - if: + properties: + compatible: + contains: + const: mediatek,mt7622-scpsys + then: + properties: + clocks: + maxItems: 1 + clock-names: + items: + - const: hif_sel + - if: + properties: + compatible: + contains: + const: mediatek,mt6797-scpsys + then: + properties: + clocks: + minItems: 3 + maxItems: 3 + clock-names: + items: + - const: mfg + - const: mm + - const: vdec + +examples: + - | + #include + + power-controller@10006000 { + #power-domain-cells = <1>; + compatible = "mediatek,mt2701-scpsys", "syscon"; + reg = <0x10006000 0x1000>; + infracfg = <&infracfg>; + clocks = <&topckgen CLK_TOP_MM_SEL>, + <&topckgen CLK_TOP_MFG_SEL>, + <&topckgen CLK_TOP_ETHIF_SEL>; + clock-names = "mm", "mfg", "ethif"; + }; diff --git a/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt b/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt deleted file mode 100644 index 3530a6668b48..000000000000 --- a/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt +++ /dev/null @@ -1,79 +0,0 @@ -MediaTek SCPSYS -=============== - -The System Control Processor System (SCPSYS) has several power management -related tasks in the system. The tasks include thermal measurement, dynamic -voltage frequency scaling (DVFS), interrupt filter and lowlevel sleep control. -The System Power Manager (SPM) inside the SCPSYS is for the MTCMOS power -domain control. - -The driver implements the Generic PM domain bindings described in -power/power-domain.yaml. It provides the power domains defined in -- include/dt-bindings/power/mt8173-power.h -- include/dt-bindings/power/mt6797-power.h -- include/dt-bindings/power/mt6765-power.h -- include/dt-bindings/power/mt2701-power.h -- include/dt-bindings/power/mt2712-power.h -- include/dt-bindings/power/mt7622-power.h - -Required properties: -- compatible: Should be one of: - - "mediatek,mt2701-scpsys" - - "mediatek,mt2712-scpsys" - - "mediatek,mt6735-scpsys" - - "mediatek,mt6765-scpsys" - - "mediatek,mt6797-scpsys" - - "mediatek,mt7622-scpsys" - - "mediatek,mt7623-scpsys", "mediatek,mt2701-scpsys": For MT7623 SoC - - "mediatek,mt7623a-scpsys": For MT7623A SoC - - "mediatek,mt7629-scpsys", "mediatek,mt7622-scpsys": For MT7629 SoC - - "mediatek,mt8173-scpsys" -- #power-domain-cells: Must be 1 -- reg: Address range of the SCPSYS unit -- infracfg: must contain a phandle to the infracfg controller -- clock, clock-names: clocks according to the common clock binding. - These are clocks which hardware needs to be - enabled before enabling certain power domains. - Required clocks for MT2701 or MT7623: "mm", "mfg", "ethif" - Required clocks for MT2712: "mm", "mfg", "venc", "jpgdec", "audio", "vdec" - Required clocks for MT6765: MUX: "mm", "mfg" - CG: "mm-0", "mm-1", "mm-2", "mm-3", "isp-0", - "isp-1", "cam-0", "cam-1", "cam-2", - "cam-3","cam-4" - Required clocks for MT6797: "mm", "mfg", "vdec" - Required clocks for MT7622 or MT7629: "hif_sel" - Required clocks for MT7623A: "ethif" - Required clocks for MT8173: "mm", "mfg", "venc", "venc_lt" - -Optional properties: -- vdec-supply: Power supply for the vdec power domain -- venc-supply: Power supply for the venc power domain -- isp-supply: Power supply for the isp power domain -- mm-supply: Power supply for the mm power domain -- venc_lt-supply: Power supply for the venc_lt power domain -- audio-supply: Power supply for the audio power domain -- usb-supply: Power supply for the usb power domain -- mfg_async-supply: Power supply for the mfg_async power domain -- mfg_2d-supply: Power supply for the mfg_2d power domain -- mfg-supply: Power supply for the mfg power domain - -Example: - - scpsys: scpsys@10006000 { - #power-domain-cells = <1>; - compatible = "mediatek,mt8173-scpsys"; - reg = <0 0x10006000 0 0x1000>; - infracfg = <&infracfg>; - clocks = <&clk26m>, - <&topckgen CLK_TOP_MM_SEL>; - <&topckgen CLK_TOP_VENC_SEL>, - <&topckgen CLK_TOP_VENC_LT_SEL>; - clock-names = "mfg", "mm", "venc", "venc_lt"; - }; - -Example consumer: - - afe: mt8173-afe-pcm@11220000 { - compatible = "mediatek,mt8173-afe-pcm"; - power-domains = <&scpsys MT8173_POWER_DOMAIN_AUDIO>; - }; From 24873b2778a97464e7dd8c024d4726b182584a76 Mon Sep 17 00:00:00 2001 From: Abdurrahman Hussain Date: Wed, 14 Oct 2026 15:59:36 -0700 Subject: [PATCH 65/72] of: overlay: remove unused of_overlay_remove_all() of_overlay_remove_all() has no in-tree callers. It is also subtly broken. It passes &ovcs->id to of_overlay_remove(), which zeroes *ovcs_id once the changeset is reverted, before calling free_overlay_changeset(). Through the aliased pointer that zeroes ovcs->id itself, so free_overlay_changeset()'s "ovcs->id > 0" guard is false and both idr_remove() and list_del() are skipped: the overlay_changeset is kfree()d while still linked in ovcs_list and registered in ovcs_idr. Rather than fix a helper nobody calls, remove it, along with its !CONFIG_OF_OVERLAY stub and the paragraph documenting it in overlay-notes.rst and in the zh_CN translation. ovcs_list itself stays: overlay_removal_is_ok() still walks it to check that a changeset is topmost. Reported-by: Sashiko AI Closes: https://lore.kernel.org/20260901014554.83A8D1F000E9@smtp.kernel.org Suggested-by: Rob Herring Link: https://lore.kernel.org/all/20260928182658.GA185307-robh@kernel.org/ Signed-off-by: Abdurrahman Hussain Link: https://patch.msgid.link/20261014-b4-of-overlay-remove-all-fix-v2-1-cf5ea2cc9dc3@nexthop.ai Signed-off-by: Rob Herring (Arm) --- Documentation/devicetree/overlay-notes.rst | 4 ---- .../zh_CN/devicetree/overlay-notes.rst | 3 --- drivers/of/overlay.c | 23 ------------------- include/linux/of.h | 6 ----- 4 files changed, 36 deletions(-) diff --git a/Documentation/devicetree/overlay-notes.rst b/Documentation/devicetree/overlay-notes.rst index ba401ef850e7..f2bb1145bd9f 100644 --- a/Documentation/devicetree/overlay-notes.rst +++ b/Documentation/devicetree/overlay-notes.rst @@ -115,10 +115,6 @@ The API is quite easy to use. previously created via the call to of_overlay_fdt_apply(). Removal of an overlay changeset that is stacked by another will not be permitted. -Finally, if you need to remove all overlays in one-go, just call -of_overlay_remove_all() which will remove every single one in the correct -order. - There is the option to register notifiers that get called on overlay operations. See of_overlay_notifier_register/unregister and enum of_overlay_notify_action for details. diff --git a/Documentation/translations/zh_CN/devicetree/overlay-notes.rst b/Documentation/translations/zh_CN/devicetree/overlay-notes.rst index ba5edd05dc1e..f1217ea2ff44 100644 --- a/Documentation/translations/zh_CN/devicetree/overlay-notes.rst +++ b/Documentation/translations/zh_CN/devicetree/overlay-notes.rst @@ -116,9 +116,6 @@ DT中的适当位置。在这种情况下,可以提供目标路径。通过标 2) 调用of_overlay_remove()来删除和清理先前通过调用of_overlay_fdt_apply() 而创建的覆盖变更集。不允许删除一个被另一个覆盖的覆盖变化集。 -最后,如果你需要一次性删除所有的覆盖,只需调用of_overlay_remove_all(), -它将以正确的顺序删除每一个覆盖。 - 你可以选择注册在覆盖操作中被调用的通知器。详见 of_overlay_notifier_register/unregister和enum of_overlay_notify_action。 diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 08d5351746be..dd8571371983 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c @@ -1273,26 +1273,3 @@ int of_overlay_remove(int *ovcs_id) return ret; } EXPORT_SYMBOL_GPL(of_overlay_remove); - -/** - * of_overlay_remove_all() - Reverts and frees all overlay changesets - * - * Removes all overlays from the system in the correct order. - * - * Return: 0 on success, or a negative error number - */ -int of_overlay_remove_all(void) -{ - struct overlay_changeset *ovcs, *ovcs_n; - int ret; - - /* the tail of list is guaranteed to be safe to remove */ - list_for_each_entry_safe_reverse(ovcs, ovcs_n, &ovcs_list, ovcs_list) { - ret = of_overlay_remove(&ovcs->id); - if (ret) - return ret; - } - - return 0; -} -EXPORT_SYMBOL_GPL(of_overlay_remove_all); diff --git a/include/linux/of.h b/include/linux/of.h index b920aac6b975..44d83133a65a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -1837,7 +1837,6 @@ struct of_overlay_notify_data { int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size, int *ovcs_id, const struct device_node *target_base); int of_overlay_remove(int *ovcs_id); -int of_overlay_remove_all(void); int of_overlay_notifier_register(struct notifier_block *nb); int of_overlay_notifier_unregister(struct notifier_block *nb); @@ -1855,11 +1854,6 @@ static inline int of_overlay_remove(int *ovcs_id) return -ENOTSUPP; } -static inline int of_overlay_remove_all(void) -{ - return -ENOTSUPP; -} - static inline int of_overlay_notifier_register(struct notifier_block *nb) { return 0; From f46c76b3990adb8de80b0724b5a638b0c1a60aa5 Mon Sep 17 00:00:00 2001 From: Pankaj Dev Date: Wed, 2 Sep 2026 16:13:02 +0200 Subject: [PATCH 66/72] dt-bindings: phy: Document ST STM32MP25 USB2-FEMTO PHY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Document USB2 PHY for STM32MP25 USB2 controllers, which includes the USB2.0 host-only controller and USB 2.0 part of the DWC3 controller. Two such PHYs in total are present in STM32MP25 SoC, they both are slightly different, therefore they use different compatible string to discern them. Reviewed-by: Krzysztof Kozlowski Signed-off-by: Pankaj Dev Co-developed-by: Rahul Kumar Signed-off-by: Rahul Kumar Co-developed-by: Fabrice Gasnier Signed-off-by: Fabrice Gasnier Co-developed-by: Clément Le Goffic Signed-off-by: Clément Le Goffic Co-developed-by: Marek Vasut Signed-off-by: Marek Vasut Reviewed-by: Fabrice Gasnier Link: https://patch.msgid.link/20260902141312.649406-1-marex@nabladev.com Signed-off-by: Rob Herring (Arm) --- .../bindings/phy/st,stm32-usb2phy.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml diff --git a/Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml b/Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml new file mode 100644 index 000000000000..c76e94c044e6 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/st,stm32-usb2phy.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/phy/st,stm32-usb2phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 MPU High-Speed USB PHY + +description: + USB2 PHY block in STM32 is attached to USB 2.0 Host controller and + USB 2.0 side of DWC3 DRD controller, and provides the USB LS/FS/HS + connectivity. Both PHYs are the FEMTO-PHY, but their configuration + bits in the system control register are different for each variant. + +maintainers: + - Fabrice Gasnier + - Marek Vasut + - Pankaj Dev + +properties: + compatible: + enum: + - st,stm32mp25-usb2phy1 + - st,stm32mp25-usb2phy2 + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + resets: + maxItems: 1 + + vdd33-supply: + description: Phandle to regulator providing 3V3 power supply to the USB2 HS PHY + + "#clock-cells": + const: 1 + + "#phy-cells": + const: 0 + +required: + - compatible + - reg + - clocks + - resets + - vdd33-supply + - "#clock-cells" + - "#phy-cells" + +additionalProperties: false + +examples: + - | + #include + #include + + usb-phy@2400 { + compatible = "st,stm32mp25-usb2phy1"; + reg = <0x2400 0x24>; + #phy-cells = <0>; + #clock-cells = <1>; + clocks = <&rcc CK_KER_USB2PHY1>; + resets = <&rcc USB2PHY1_R>; + vdd33-supply = <&vdd33usb>; + }; From ed8c36964c97c73237a793c47e583986a726f932 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Fri, 16 Oct 2026 17:53:18 -0500 Subject: [PATCH 67/72] dt-bindings: display: Convert hisilicon,hi6220-dsi to DT schema Convert the hisilicon,hi6220-dsi binding to DT schema format. It's a straight forward conversion. Link: https://patch.msgid.link/20261016225320.1607923-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/display/hisilicon/dw-dsi.txt | 72 ------------------- .../hisilicon/hisilicon,hi6220-dsi.yaml | 68 ++++++++++++++++++ 2 files changed, 68 insertions(+), 72 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt create mode 100644 Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml diff --git a/Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt b/Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt deleted file mode 100644 index d270bfe4e4e0..000000000000 --- a/Documentation/devicetree/bindings/display/hisilicon/dw-dsi.txt +++ /dev/null @@ -1,72 +0,0 @@ -Device-Tree bindings for DesignWare DSI Host Controller v1.20a driver - -A DSI Host Controller resides in the middle of display controller and external -HDMI converter or panel. - -Required properties: -- compatible: value should be "hisilicon,hi6220-dsi". -- reg: physical base address and length of dsi controller's registers. -- clocks: contains APB clock phandle + clock-specifier pair. -- clock-names: should be "pclk". -- ports: contains DSI controller input and output sub port. - The input port connects to ADE output port with the reg value "0". - The output port with the reg value "1", it could connect to panel or - any other bridge endpoints. - See Documentation/devicetree/bindings/graph.txt for more device graph info. - -A example of HiKey board hi6220 SoC and board specific DT entry: -Example: - -SoC specific: - dsi: dsi@f4107800 { - compatible = "hisilicon,hi6220-dsi"; - reg = <0x0 0xf4107800 0x0 0x100>; - clocks = <&media_ctrl HI6220_DSI_PCLK>; - clock-names = "pclk"; - status = "disabled"; - - ports { - #address-cells = <1>; - #size-cells = <0>; - - /* 0 for input port */ - port@0 { - reg = <0>; - dsi_in: endpoint { - remote-endpoint = <&ade_out>; - }; - }; - }; - }; - - -Board specific: - &dsi { - status = "ok"; - - ports { - /* 1 for output port */ - port@1 { - reg = <1>; - - dsi_out0: endpoint@0 { - remote-endpoint = <&adv7533_in>; - }; - }; - }; - }; - - &i2c2 { - ... - - adv7533: adv7533@39 { - ... - - port { - adv7533_in: endpoint { - remote-endpoint = <&dsi_out0>; - }; - }; - }; - }; - diff --git a/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml new file mode 100644 index 000000000000..868ab185a71a --- /dev/null +++ b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-dsi.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/hisilicon/hisilicon,hi6220-dsi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon DesignWare DSI Host Controller + +maintainers: + - Xinliang Liu + +properties: + compatible: + const: hisilicon,hi6220-dsi + + reg: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: pclk + + ports: + $ref: /schemas/graph.yaml#/properties/ports + + properties: + port@0: + description: Input port, connects to ADE output endpoint. + $ref: /schemas/graph.yaml#/properties/port + + port@1: + description: Output port, connects to panel or bridge endpoints. + $ref: /schemas/graph.yaml#/properties/port + +required: + - compatible + - reg + - clocks + - clock-names + - ports + +additionalProperties: false + +examples: + - | + #include + + dsi@f4107800 { + compatible = "hisilicon,hi6220-dsi"; + reg = <0xf4107800 0x100>; + clocks = <&media_ctrl HI6220_DSI_PCLK>; + clock-names = "pclk"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dsi_in: endpoint { + remote-endpoint = <&ade_out>; + }; + }; + }; + }; From 3f8f05bbb4d654a82c1d34f2e7141932eda4dc60 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Fri, 16 Oct 2026 17:53:29 -0500 Subject: [PATCH 68/72] dt-bindings: display: Convert hisilicon,hi6220-ade to DT schema Convert the hisilicon,hi6220-ade binding to DT schema format. Drop the assigned-clocks as those are implicit and should never be required. Link: https://patch.msgid.link/20261016225330.1609022-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/display/hisilicon/hisi-ade.txt | 64 ------------- .../hisilicon/hisilicon,hi6220-ade.yaml | 95 +++++++++++++++++++ 2 files changed, 95 insertions(+), 64 deletions(-) delete mode 100644 Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt create mode 100644 Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml diff --git a/Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt b/Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt deleted file mode 100644 index 305a0e72a900..000000000000 --- a/Documentation/devicetree/bindings/display/hisilicon/hisi-ade.txt +++ /dev/null @@ -1,64 +0,0 @@ -Device-Tree bindings for hisilicon ADE display controller driver - -ADE (Advanced Display Engine) is the display controller which grab image -data from memory, do composition, do post image processing, generate RGB -timing stream and transfer to DSI. - -Required properties: -- compatible: value should be "hisilicon,hi6220-ade". -- reg: physical base address and length of the ADE controller's registers. -- hisilicon,noc-syscon: ADE NOC QoS syscon. -- resets: The ADE reset controller node. -- interrupt: the ldi vblank interrupt number used. -- clocks: a list of phandle + clock-specifier pairs, one for each entry - in clock-names. -- clock-names: should contain: - "clk_ade_core" for the ADE core clock. - "clk_codec_jpeg" for the media NOC QoS clock, which use the same clock with - jpeg codec. - "clk_ade_pix" for the ADE pixel clock. -- assigned-clocks: Should contain "clk_ade_core" and "clk_codec_jpeg" clocks' - phandle + clock-specifier pairs. -- assigned-clock-rates: clock rates, one for each entry in assigned-clocks. - The rate of "clk_ade_core" could be "360000000" or "180000000"; - The rate of "clk_codec_jpeg" could be or less than "1440000000". - These rate values could be configured according to performance and power - consumption. -- port: the output port. This contains one endpoint subnode, with its - remote-endpoint set to the phandle of the connected DSI input endpoint. - See Documentation/devicetree/bindings/graph.txt for more device graph info. - -Optional properties: -- dma-coherent: Present if dma operations are coherent. - - -A example of HiKey board hi6220 SoC specific DT entry: -Example: - - ade: ade@f4100000 { - compatible = "hisilicon,hi6220-ade"; - reg = <0x0 0xf4100000 0x0 0x7800>; - reg-names = "ade_base"; - hisilicon,noc-syscon = <&medianoc_ade>; - resets = <&media_ctrl MEDIA_ADE>; - interrupts = <0 115 4>; /* ldi interrupt */ - - clocks = <&media_ctrl HI6220_ADE_CORE>, - <&media_ctrl HI6220_CODEC_JPEG>, - <&media_ctrl HI6220_ADE_PIX_SRC>; - /*clock name*/ - clock-names = "clk_ade_core", - "clk_codec_jpeg", - "clk_ade_pix"; - - assigned-clocks = <&media_ctrl HI6220_ADE_CORE>, - <&media_ctrl HI6220_CODEC_JPEG>; - assigned-clock-rates = <360000000>, <288000000>; - dma-coherent; - - port { - ade_out: endpoint { - remote-endpoint = <&dsi_in>; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml new file mode 100644 index 000000000000..ec3d4b775a88 --- /dev/null +++ b/Documentation/devicetree/bindings/display/hisilicon/hisilicon,hi6220-ade.yaml @@ -0,0 +1,95 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/hisilicon/hisilicon,hi6220-ade.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Hisilicon ADE Display Controller + +maintainers: + - Xinliang Liu + +description: + ADE (Advanced Display Engine) is the display controller which grab image + data from memory, do composition, do post image processing, generate RGB + timing stream and transfer to DSI. + +properties: + compatible: + const: hisilicon,hi6220-ade + + reg: + maxItems: 1 + + reg-names: + items: + - const: ade_base + + clocks: + maxItems: 3 + + clock-names: + items: + - const: clk_ade_core + - const: clk_codec_jpeg + - const: clk_ade_pix + + dma-coherent: true + + interrupts: + items: + - description: LDI vblank interrupt specifier. + + resets: + maxItems: 1 + + hisilicon,noc-syscon: + description: ADE NOC QoS syscon. + $ref: /schemas/types.yaml#/definitions/phandle + + port: + $ref: /schemas/graph.yaml#/properties/port + description: Output port containing an endpoint subnode. + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - interrupts + - resets + - hisilicon,noc-syscon + - port + +additionalProperties: false + +examples: + - | + #include + #include + + bus { + #address-cells = <2>; + #size-cells = <2>; + + ade@f4100000 { + compatible = "hisilicon,hi6220-ade"; + reg = <0x0 0xf4100000 0x0 0x7800>; + reg-names = "ade_base"; + clocks = <&media_ctrl HI6220_ADE_CORE>, + <&media_ctrl HI6220_CODEC_JPEG>, + <&media_ctrl HI6220_ADE_PIX_SRC>; + clock-names = "clk_ade_core", "clk_codec_jpeg", "clk_ade_pix"; + dma-coherent; + interrupts = <0 115 4>; + resets = <&media_ctrl MEDIA_ADE>; + hisilicon,noc-syscon = <&medianoc_ade>; + + port { + endpoint { + remote-endpoint = <&dsi_in>; + }; + }; + }; + }; From 3db1f64a84f982f14e3e82a38f61f062cf36a4c3 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Fri, 2 Oct 2026 14:31:56 -0500 Subject: [PATCH 69/72] dt-bindings: media: Convert hisilicon,hix5hd2-ir to DT schema Convert the hisilicon,hix5hd2-ir binding to DT schema format. It's a straight forward conversion. As this was the last reference to rc.txt, it can be removed. Acked-by: Wei Xu Link: https://patch.msgid.link/20261002193158.3263741-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/media/hisilicon,hix5hd2-ir.yaml | 52 +++++++++++++++++++ .../devicetree/bindings/media/hix5hd2-ir.txt | 26 ---------- .../devicetree/bindings/media/rc.txt | 1 - 3 files changed, 52 insertions(+), 27 deletions(-) create mode 100644 Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml delete mode 100644 Documentation/devicetree/bindings/media/hix5hd2-ir.txt delete mode 100644 Documentation/devicetree/bindings/media/rc.txt diff --git a/Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml b/Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml new file mode 100644 index 000000000000..cd836f266e5a --- /dev/null +++ b/Documentation/devicetree/bindings/media/hisilicon,hix5hd2-ir.yaml @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/media/hisilicon,hix5hd2-ir.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: HiSilicon HIX5HD2 IR controller + +maintainers: + - Wei Xu + +allOf: + - $ref: rc.yaml# + +properties: + compatible: + items: + - enum: + - hisilicon,hix5hd2-ir + - hisilicon,hi3796cv300-ir + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + hisilicon,power-syscon: + description: Provide correct clocks instead. + $ref: /schemas/types.yaml#/definitions/phandle + deprecated: true + +required: + - compatible + - reg + - interrupts + - clocks + +unevaluatedProperties: false + +examples: + - | + ir@f8001000 { + compatible = "hisilicon,hix5hd2-ir"; + reg = <0xf8001000 0x1000>; + interrupts = <0 47 4>; + clocks = <&clock 0>; + linux,rc-map-name = "rc-tivo"; + }; diff --git a/Documentation/devicetree/bindings/media/hix5hd2-ir.txt b/Documentation/devicetree/bindings/media/hix5hd2-ir.txt deleted file mode 100644 index ca4cf774662e..000000000000 --- a/Documentation/devicetree/bindings/media/hix5hd2-ir.txt +++ /dev/null @@ -1,26 +0,0 @@ -Device-Tree bindings for hix5hd2 ir IP - -Required properties: - - compatible: Should contain "hisilicon,hix5hd2-ir", or: - - "hisilicon,hi3796cv300-ir" for Hi3796CV300 IR device. - - reg: Base physical address of the controller and length of memory - mapped region. - - interrupts: interrupt-specifier for the sole interrupt generated by - the device. The interrupt specifier format depends on the interrupt - controller parent. - - clocks: clock phandle and specifier pair. - -Optional properties: - - linux,rc-map-name: see rc.txt file in the same directory. - - hisilicon,power-syscon: DEPRECATED. Don't use this in new dts files. - Provide correct clocks instead. - -Example node: - - ir: ir@f8001000 { - compatible = "hisilicon,hix5hd2-ir"; - reg = <0xf8001000 0x1000>; - interrupts = <0 47 4>; - clocks = <&clock HIX5HD2_IR_CLOCK>; - linux,rc-map-name = "rc-tivo"; - }; diff --git a/Documentation/devicetree/bindings/media/rc.txt b/Documentation/devicetree/bindings/media/rc.txt deleted file mode 100644 index be629f7fa77e..000000000000 --- a/Documentation/devicetree/bindings/media/rc.txt +++ /dev/null @@ -1 +0,0 @@ -This file has been moved to rc.yaml. From 1d48ecb48e2ab9dd2564e735a1c1b29a5eeeb599 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Mon, 21 Sep 2026 18:28:06 -0500 Subject: [PATCH 70/72] dt-bindings: clock: mediatek: Add MT8516 fallbacks MT8516 topckgen and apmixedsys nodes use the common syscon fallback form. Add the MT8516 compatibles to the branches that allow the syscon fallback. Fixes: cd9fdd06b0e8 ("dt-bindings: arm: mediatek: topckgen: Convert to DT schema") Fixes: 16a146735df3 ("dt-bindings: arm: mediatek: apmixedsys: Convert to DT schema") Reviewed-by: AngeloGioacchino Del Regno Link: https://patch.msgid.link/20260921232807.3137010-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../devicetree/bindings/clock/mediatek,apmixedsys.yaml | 2 +- Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml b/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml index 591a9e862c7d..438723d25320 100644 --- a/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml +++ b/Documentation/devicetree/bindings/clock/mediatek,apmixedsys.yaml @@ -26,7 +26,6 @@ properties: - mediatek,mt7988-apmixedsys - mediatek,mt8135-apmixedsys - mediatek,mt8173-apmixedsys - - mediatek,mt8516-apmixedsys - items: - const: mediatek,mt7623-apmixedsys - const: mediatek,mt2701-apmixedsys @@ -42,6 +41,7 @@ properties: - mediatek,mt7629-apmixedsys - mediatek,mt8167-apmixedsys - mediatek,mt8183-apmixedsys + - mediatek,mt8516-apmixedsys - const: syscon reg: diff --git a/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml b/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml index c080fb0a1618..6594d491e215 100644 --- a/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml +++ b/Documentation/devicetree/bindings/clock/mediatek,topckgen.yaml @@ -23,7 +23,6 @@ properties: - mediatek,mt7622-topckgen - mediatek,mt8135-topckgen - mediatek,mt8173-topckgen - - mediatek,mt8516-topckgen - items: - const: mediatek,mt7623-topckgen - const: mediatek,mt2701-topckgen @@ -43,6 +42,7 @@ properties: - mediatek,mt7988-topckgen - mediatek,mt8167-topckgen - mediatek,mt8183-topckgen + - mediatek,mt8516-topckgen - const: syscon reg: From 88f43648d5e29aac2bc853984a2813724aa423b7 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Wed, 23 Sep 2026 14:15:45 -0500 Subject: [PATCH 71/72] dt-bindings: iommu: Describe MT8195 infra IRQs The MT8195 infra IOMMU has one fault interrupt per IOMMU bank with 5 banks. Keep other MediaTek IOMMUs limited to one unnamed interrupt. Link: https://patch.msgid.link/20260923191546.2209201-1-robh@kernel.org Signed-off-by: Rob Herring (Arm) --- .../bindings/iommu/mediatek,iommu.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml index 79c573c47b08..cbda221a4fc5 100644 --- a/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml +++ b/Documentation/devicetree/bindings/iommu/mediatek,iommu.yaml @@ -100,7 +100,10 @@ properties: maxItems: 1 interrupts: - maxItems: 1 + minItems: 1 + maxItems: 5 + description: + A single interrupt or one interrupt per bank. clocks: items: @@ -155,6 +158,19 @@ required: - '#iommu-cells' allOf: + - if: + properties: + compatible: + contains: + const: mediatek,mt8195-iommu-infra + then: + properties: + interrupts: + minItems: 5 + else: + properties: + interrupts: + maxItems: 1 - if: properties: compatible: From e8ff9af18e80279b80cf7063244db91b12f5e27e Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 10 Sep 2026 07:22:40 +0200 Subject: [PATCH 72/72] dt-bindings: usb: dwc3: Document ST STM32MP2 DWC3 xHCI USB controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ST STM32MP2 SoC contains single instance of DWC3 USB controller with glue logic wrapper around it controlled by syscon. Document the glue logic and DWC3 controller. Co-developed-by: Pankaj Dev Signed-off-by: Pankaj Dev Co-developed-by: Clément Le Goffic Signed-off-by: Clément Le Goffic Co-developed-by: Gatien Chevallier Signed-off-by: Gatien Chevallier Signed-off-by: Marek Vasut Acked-by: Fabrice Gasnier Reviewed-by: Rob Herring (Arm) Link: https://patch.msgid.link/20260910052340.246717-1-marex@nabladev.com Signed-off-by: Rob Herring (Arm) --- .../bindings/usb/st,stm32mp25-dwc3.yaml | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml diff --git a/Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml b/Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml new file mode 100644 index 000000000000..96bd55732725 --- /dev/null +++ b/Documentation/devicetree/bindings/usb/st,stm32mp25-dwc3.yaml @@ -0,0 +1,97 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/usb/st,stm32mp25-dwc3.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: STMicroelectronics STM32 MPU DWC3 USB SoC controller + +description: + The STM32 MPU DWC3 USB SoC controller block supports both + Host(SS/HS/FS/LS) and Device(SS/HS/FS) mode operation + +maintainers: + - Fabrice Gasnier + - Marek Vasut + +allOf: + - $ref: snps,dwc3-common.yaml# + +properties: + compatible: + const: st,stm32mp25-dwc3 + + reg: + maxItems: 1 + + access-controllers: + maxItems: 1 + + clocks: + minItems: 3 + maxItems: 3 + + clock-names: + items: + - const: ref + - const: bus_early + - const: suspend + + interrupts: + maxItems: 1 + + resets: + maxItems: 1 + + over-current-active-low: + type: boolean + description: Over-Current signal polarity is active-low + + st,syscfg: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: Phandle to system configuration controller. + items: + - items: + - description: phandle to syscfg + - description: USB3DR control offset within syscfg + + st,enable-port-power-control: + type: boolean + description: Enable Host-Mode Port Power Control (bit-3 of capability param HCCPARAMS) + + st,vbusen-active-low: + type: boolean + description: VBUS-ENABLE signal polarity is active-low + +required: + - compatible + - reg + - clocks + - clock-names + - interrupts + - phys + - phy-names + - resets + - st,syscfg + +unevaluatedProperties: false + +examples: + - | + #include + #include + #include + + usb@48300000 { + compatible = "st,stm32mp25-dwc3"; + reg = <0x48300000 0x100000>; + clocks = <&rcc CK_KER_USB2PHY2>, <&rcc CK_BUS_USB3DR>, <&rcc CK_KER_USB2PHY2>; + clock-names = "ref", "bus_early", "suspend"; + interrupts = ; + phys = <&usb2_phy>, <&usb3_phy>; + phy-names = "usb2-phy", "usb3-phy"; + resets = <&rcc USB3DR_R>; + over-current-active-low; + st,syscfg = <&syscfg 0x4800>; + st,vbusen-active-low; + };