Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: net: can: convert ifi_canfd to DT schema
@ 2026-09-14  1:36 Quchaosheng
  2026-09-14  1:45 ` sashiko-bot
  0 siblings, 1 reply; 4+ messages in thread
From: Quchaosheng @ 2026-09-14  1:36 UTC (permalink / raw)
  To: Marc Kleine-Budde, Rob Herring, Krzysztof Kozlowski
  Cc: linux-can, devicetree, quchaosheng000406

Convert the IFI CAN-FD controller binding from free-form text to DT
schema, and reference the common can-controller.yaml schema.

The driver matches on the "ifi,canfd-1.0" compatible and obtains its
interrupt through platform_get_irq(), so interrupts is required and no
additional properties are used.

---
v2:
 - Correct the description: this is a soft IP block typically synthesised
   into an FPGA or CPLD, not a controller found on Renesas SoCs.
   Wording now follows the driver's Kconfig entry.

Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
---
 .../bindings/net/can/ifi,canfd.yaml           | 43 +++++++++++++++++++
 .../devicetree/bindings/net/can/ifi_canfd.txt | 15 -------
 2 files changed, 43 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/can/ifi_canfd.txt

diff --git a/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
new file mode 100644
index 000000000..63ddc879c
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/can/ifi,canfd.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IFI CAN-FD Controller
+
+maintainers:
+  - Quchaosheng <quchaosheng000406@163.com>
+
+description:
+  The I/F/I CAN-FD soft IP block connected to the platform bus. It is most
+  often synthesised into an FPGA or CPLD.
+
+allOf:
+  - $ref: can-controller.yaml#
+
+properties:
+  compatible:
+    const: ifi,canfd-1.0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    canfd0: can@ff220000 {
+        compatible = "ifi,canfd-1.0";
+        reg = <0xff220000 0x1000>;
+        interrupts = <0 43 0>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/net/can/ifi_canfd.txt b/Documentation/devicetree/bindings/net/can/ifi_canfd.txt
deleted file mode 100644
index 20ea5c70a..000000000
--- a/Documentation/devicetree/bindings/net/can/ifi_canfd.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-IFI CANFD controller
---------------------
-
-Required properties:
-  - compatible: Should be "ifi,canfd-1.0"
-  - reg: Should contain CAN controller registers location and length
-  - interrupts: Should contain IRQ line for the CAN controller
-
-Example:
-
-	canfd0: canfd@ff220000 {
-		compatible = "ifi,canfd-1.0";
-		reg = <0xff220000 0x00001000>;
-		interrupts = <0 43 0>;
-	};
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2] dt-bindings: net: can: convert ifi_canfd to DT schema
@ 2026-09-14  1:37 Quchaosheng
  2026-09-14  1:45 ` sashiko-bot
  0 siblings, 1 reply; 4+ messages in thread
From: Quchaosheng @ 2026-09-14  1:37 UTC (permalink / raw)
  To: Marc Kleine-Budde, Rob Herring, Krzysztof Kozlowski
  Cc: linux-can, devicetree, quchaosheng000406

Convert the IFI CAN-FD controller binding from free-form text to DT
schema, and reference the common can-controller.yaml schema.

The driver matches on the "ifi,canfd-1.0" compatible and obtains its
interrupt through platform_get_irq(), so interrupts is required and no
additional properties are used.

---
v2:
 - Correct the description: this is a soft IP block typically synthesised
   into an FPGA or CPLD, not a controller found on Renesas SoCs.
   Wording now follows the driver's Kconfig entry.

Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
---
 .../bindings/net/can/ifi,canfd.yaml           | 43 +++++++++++++++++++
 .../devicetree/bindings/net/can/ifi_canfd.txt | 15 -------
 2 files changed, 43 insertions(+), 15 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/can/ifi_canfd.txt

diff --git a/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
new file mode 100644
index 000000000..63ddc879c
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/can/ifi,canfd.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: IFI CAN-FD Controller
+
+maintainers:
+  - Quchaosheng <quchaosheng000406@163.com>
+
+description:
+  The I/F/I CAN-FD soft IP block connected to the platform bus. It is most
+  often synthesised into an FPGA or CPLD.
+
+allOf:
+  - $ref: can-controller.yaml#
+
+properties:
+  compatible:
+    const: ifi,canfd-1.0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    canfd0: can@ff220000 {
+        compatible = "ifi,canfd-1.0";
+        reg = <0xff220000 0x1000>;
+        interrupts = <0 43 0>;
+    };
+...
diff --git a/Documentation/devicetree/bindings/net/can/ifi_canfd.txt b/Documentation/devicetree/bindings/net/can/ifi_canfd.txt
deleted file mode 100644
index 20ea5c70a..000000000
--- a/Documentation/devicetree/bindings/net/can/ifi_canfd.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-IFI CANFD controller
---------------------
-
-Required properties:
-  - compatible: Should be "ifi,canfd-1.0"
-  - reg: Should contain CAN controller registers location and length
-  - interrupts: Should contain IRQ line for the CAN controller
-
-Example:
-
-	canfd0: canfd@ff220000 {
-		compatible = "ifi,canfd-1.0";
-		reg = <0xff220000 0x00001000>;
-		interrupts = <0 43 0>;
-	};
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dt-bindings: net: can: convert ifi_canfd to DT schema
  2026-09-14  1:36 Quchaosheng
@ 2026-09-14  1:45 ` sashiko-bot
  0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-14  1:45 UTC (permalink / raw)
  To: Quchaosheng
  Cc: Marc Kleine-Budde, linux-can, Vincent Mailhol, conor+dt,
	devicetree, Oleksij Rempel, robh, Oliver Hartkopp

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] DT Schema Error: `additionalProperties: false` incorrectly restricts inherited properties
--

commit 762b0b1dc7188a87b810716f4344f47313aba8cb
Author: Quchaosheng <quchaosheng000406@163.com>

dt-bindings: net: can: convert ifi_canfd to DT schema

This patch converts the IFI CAN-FD controller binding from a free-form
text document to a YAML DT schema. It also references the common
can-controller.yaml schema to inherit standard CAN properties.

> diff --git a/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
[ ... ]
> +allOf:
> +  - $ref: can-controller.yaml#
> +
> +properties:
> +  compatible:
> +    const: ifi,canfd-1.0
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +additionalProperties: false

[Severity: Medium]
Will this strict restriction prevent inherited properties from being used?

Because this schema inherits from can-controller.yaml# using an allOf
block, using additionalProperties: false here only evaluates the local
properties block. If a standard CAN property like bitrate or
termination-gpios is added to a device tree node, dtbs_check will reject
it as an unallowed additional property.

Should this use unevaluatedProperties: false instead to properly allow the
properties defined in the referenced schema?

> +
> +examples:
> +  - |
> +    canfd0: can@ff220000 {
> +        compatible = "ifi,canfd-1.0";
> +        reg = <0xff220000 0x1000>;
> +        interrupts = <0 43 0>;
> +    };
> +...

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914013636.394263-1-quchaosheng000406@163.com?part=1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] dt-bindings: net: can: convert ifi_canfd to DT schema
  2026-09-14  1:37 [PATCH v2] dt-bindings: net: can: convert ifi_canfd to DT schema Quchaosheng
@ 2026-09-14  1:45 ` sashiko-bot
  0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-09-14  1:45 UTC (permalink / raw)
  To: Quchaosheng
  Cc: conor+dt, robh, Oleksij Rempel, devicetree, Vincent Mailhol,
	linux-can, Marc Kleine-Budde, Oliver Hartkopp

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Incorrect use of `additionalProperties: false` when inheriting from a common schema via `$ref`, which improperly blocks inherited properties.
--

commit 471062b3f0e20cbfb084fbd8547c9d66999316e1
Author: Quchaosheng <quchaosheng000406@163.com>

dt-bindings: net: can: convert ifi_canfd to DT schema

Convert the IFI CAN-FD controller binding from free-form text to DT schema,
and reference the common can-controller.yaml schema.

> diff --git a/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/can/ifi,canfd.yaml

[ ... ]

> +allOf:
> +  - $ref: can-controller.yaml#
> +
> +properties:

[ ... ]

> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +
> +additionalProperties: false

[Severity: Medium]
Does using additionalProperties: false here conflict with the $ref to
can-controller.yaml#?

When referencing another schema via allOf, using additionalProperties: false
strictly forbids any properties not defined in the local file. This will cause
validation to fail if a device tree node includes standard CAN controller
properties like termination-gpios that are inherited from can-controller.yaml.

Should this be unevaluatedProperties: false instead, to allow the properties
defined in the referenced common schema?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260914013745.394514-1-quchaosheng000406@163.com?part=1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-14  1:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14  1:37 [PATCH v2] dt-bindings: net: can: convert ifi_canfd to DT schema Quchaosheng
2026-09-14  1:45 ` sashiko-bot
  -- strict thread matches above, loose matches on Subject: below --
2026-09-14  1:36 Quchaosheng
2026-09-14  1:45 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox