Skip to contentSkip to conversation

dt-bindings: misc: add documentation for MediaLB DIM2 controller

PATCH In review Kartik Nair 5 participants 6 messages May 10 – May 15 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: misc: add documentation for MediaLB DIM2 controller

Add device tree binding documentation for the MediaLB DIM2 hardware dependent module. This documents the compatible strings used in drivers/staging/most/dim2/dim2.c which were previously flagged as undocumented by checkpatch.

Documented compatible strings:
- fsl,imx6q-mlb150 (Freescale i.MX6Q)
- renesas,mlp (Renesas Gen2)
- renesas,rcar-gen3-mlp (Renesas Gen3)
- xlnx,axi4-os62420_3pin-1.00.a (Xilinx 3-pin)
- xlnx,axi4-os62420_6pin-1.00.a (Xilinx 6-pin)

---
 .../bindings/misc/microchip,most-dim2.yaml    | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +54 -0
new file mode 100644
index 000000000..213078811
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/microchip,most-dim2.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaLB DIM2 Hardware Dependent Module
+
+maintainers:
+  - Christian Gromm <[email protected]>
+
+description:
+  The DIM2 is a MediaLB (Media Local Bus) interface controller that
+  provides high-speed communication between devices. It supports
+  synchronous, asynchronous, control, and isochronous data channels.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6q-mlb150
+      - renesas,mlp
+      - renesas,rcar-gen3-mlp
+      - xlnx,axi4-os62420_3pin-1.00.a
+      - xlnx,axi4-os62420_6pin-1.00.a
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: mediaLB_int
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    mlb: most@2b600000 {
+        compatible = "fsl,imx6q-mlb150";
+        reg = <0x2b600000 0x4000>;
+        interrupts = <0 53 4>, <0 117 4>;
+        clocks = <&clks 218>;
+        clock-names = "mediaLB_int";
+    };
Signature · 1 line
2.50.0
#1 lore raw

Greg, Rob,

Quoted 4 lines · Kartik Nair

Add device tree binding documentation for the MediaLB DIM2 hardware dependent module. This documents the compatible strings used in drivers/staging/most/dim2/dim2.c which were previously flagged as undocumented by checkpatch.

Are we actually meant to be taking bindings for things in staging?

I thought half the point of things being in staging that the state they were in was poor at best, and that changing properties etc may be required as part of destaging them.

Greg? Rob?

Cheers,
Conor.

Quoted 77 lines

Documented compatible strings:
- fsl,imx6q-mlb150 (Freescale i.MX6Q)
- renesas,mlp (Renesas Gen2)
- renesas,rcar-gen3-mlp (Renesas Gen3)
- xlnx,axi4-os62420_3pin-1.00.a (Xilinx 3-pin)
- xlnx,axi4-os62420_6pin-1.00.a (Xilinx 6-pin)

---
 .../bindings/misc/microchip,most-dim2.yaml    | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +54 -0
new file mode 100644
index 000000000..213078811
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/microchip,most-dim2.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaLB DIM2 Hardware Dependent Module
+
+maintainers:
+  - Christian Gromm <[email protected]>
+
+description:
+  The DIM2 is a MediaLB (Media Local Bus) interface controller that
+  provides high-speed communication between devices. It supports
+  synchronous, asynchronous, control, and isochronous data channels.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx6q-mlb150
+      - renesas,mlp
+      - renesas,rcar-gen3-mlp
+      - xlnx,axi4-os62420_3pin-1.00.a
+      - xlnx,axi4-os62420_6pin-1.00.a
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: mediaLB_int
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    mlb: most@2b600000 {
+        compatible = "fsl,imx6q-mlb150";
+        reg = <0x2b600000 0x4000>;
+        interrupts = <0 53 4>, <0 117 4>;
+        clocks = <&clks 218>;
+        clock-names = "mediaLB_int";
+    };
Signature · 1 line
2.50.0
#2 lore raw
Quoted 9 lines · Conor Dooley

Greg, Rob,

Quoted 4 lines · Kartik Nair

Add device tree binding documentation for the MediaLB DIM2 hardware dependent module. This documents the compatible strings used in drivers/staging/most/dim2/dim2.c which were previously flagged as undocumented by checkpatch.

Are we actually meant to be taking bindings for things in staging?

Nope!

Quoted 5 lines

I thought half the point of things being in staging that the state they were in was poor at best, and that changing properties etc may be required as part of destaging them.

Greg? Rob?

Staging drivers need to be self-contained, without bindings outside of drivers/staging/

thanks,

greg k-h

#3 lore raw
In reply to Kartik Nair
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider: - [High] The `microchip,clock-speed` property is required by the driver but omitted from the schema.…

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] The microchip,clock-speed property is required by the driver but omitted from the schema.
- [High] The clock properties restrict definitions to a single clock named "mediaLB_int", which is incompatible with the Freescale driver.
- [High] The interrupts property permits 1 interrupt, but the driver unconditionally requires 2.
- [Medium] Missing conditional constraints to enforce hardware-specific clock requirements.
--

commit ed9d7ddf4fb03364e5365e6ea5d84fa84fa267e6
Author: Kartik Nair <[email protected]>

dt-bindings: misc: add documentation for MediaLB DIM2 controller

Add device tree binding documentation for the MediaLB DIM2 hardware dependent module. This documents the compatible strings used in drivers/staging/most/dim2/dim2.c which were previously flagged as undocumented by checkpatch.

Quoted 5 lines
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +0 -0
new file mode 100644
index 0000000000000..213078811f820

[ ... ]

Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml line 24

Quoted 8 lines
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +8 -0
+properties:
+  compatible:
+    enum:
+      - fsl,imx6q-mlb150
+      - renesas,mlp
+      - renesas,rcar-gen3-mlp
+      - xlnx,axi4-os62420_3pin-1.00.a
+      - xlnx,axi4-os62420_6pin-1.00.a

Should we add conditional constraints for the clocks property based on the compatible string?

The Freescale and Renesas variants strictly require clocks in their driver implementations, while Xilinx variants do not. Since clocks is omitted from the global required list, incomplete device tree nodes for Freescale and Renesas platforms will pass validation.

Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml line 31

Quoted 7 lines
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +7 -0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    maxItems: 2

Does the driver support a single interrupt?

The driver implementation in dim2_probe() unconditionally requests two distinct interrupts by index (index 1 and index 0). If a device tree specifies only 1 interrupt as permitted here, the driver's attempt to retrieve index 1 will return an error and abort the probe.

Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml line 37

Quoted 6 lines
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +6 -0
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: mediaLB_int

Are these clock constraints compatible with the Freescale driver?

The fsl_mx6_enable() implementation explicitly requests up to two clocks by name ("mlb" and optionally "pll8_mlb"). A device tree adhering to this schema will provide a single clock named "mediaLB_int", causing the Freescale driver to fail its clock lookup.

Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml line 44

Quoted 6 lines
Documentation/devicetree/bindings/misc/microchip,most-dim2.yaml new file +6 -0
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false

Is there a missing definition for the microchip,clock-speed property?

The driver dim2_probe() explicitly calls of_property_read_string() for microchip,clock-speed and aborts if it is missing. With additionalProperties set to false, a device tree including this required property will fail schema validation, while one conforming strictly to the schema will omit it and cause the driver to fail at runtime.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#4 lore raw
In reply to Kartik Nair
Quoted 4 lines · Kartik Nair

Add device tree binding documentation for the MediaLB DIM2 hardware dependent module. This documents the compatible strings used in drivers/staging/most/dim2/dim2.c which were previously flagged as undocumented by checkpatch.

This is not a warning you are supposed to be working on.

It's third or fourth patch like that last month.

Best regards,
Krzysztof

#5 lore raw
Quoted 9 lines · Krzysztof Kozlowski
Quoted 4 lines · Kartik Nair

Add device tree binding documentation for the MediaLB DIM2 hardware dependent module. This documents the compatible strings used in drivers/staging/most/dim2/dim2.c which were previously flagged as undocumented by checkpatch.

This is not a warning you are supposed to be working on.

It's third or fourth patch like that last month.

And judging by this:
https://lore.kernel.org/all/[email protected]/
and this:
https://lore.kernel.org/all/[email protected]/

it seems you use AI to do the work. It's not acceptable to push AI slop onto us. There is no benefit for you in sending us AI work.

Best regards,
Krzysztof