Linux CAN drivers development
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: net: can: bosch,cc770: Convert to DT schema
@ 2026-09-14  3:02 Quchaosheng
  2026-09-14  3:02 ` [PATCH] net: can: cc770: update the binding file reference in the driver comment Quchaosheng
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Quchaosheng @ 2026-09-14  3:02 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: linux-can, devicetree, quchaosheng000406

Convert the Bosch CC770 and Intel AN82527 controller binding from
free-form text to DT schema, and reference the common can-controller.yaml
schema.

The driver reads one more property than the old text documented:
"bosch,no-comperator-bypass", which is checked at cc770_platform.c:94.
It is documented here so that it can be used. Its spelling is kept as
the driver spells it.

The interrupt is obtained with platform_get_irq(), so interrupts is
required. The register window is described with the chip select, the
address offset and the size, as the original text and the existing
device trees on the local bus use three cells. The size is usually 0x80.

unevaluatedProperties is used rather than additionalProperties so that
properties provided by can-controller.yaml, such as termination-gpios,
remain usable.

Signed-off-by: Quchaosheng <quchaosheng000406@163.com>
---
 .../bindings/net/can/bosch,cc770.yaml         | 109 ++++++++++++++++++
 .../devicetree/bindings/net/can/cc770.txt     |  53 ---------
 2 files changed, 109 insertions(+), 53 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/can/bosch,cc770.yaml
 delete mode 100644 Documentation/devicetree/bindings/net/can/cc770.txt

diff --git a/Documentation/devicetree/bindings/net/can/bosch,cc770.yaml b/Documentation/devicetree/bindings/net/can/bosch,cc770.yaml
new file mode 100644
index 000000000..448d5b4f7
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/bosch,cc770.yaml
@@ -0,0 +1,109 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/can/bosch,cc770.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Bosch CC770 and Intel AN82527 CAN controllers
+
+maintainers:
+  - Marc Kleine-Budde <mkl@pengutronix.de>
+
+description:
+  The CC770 is a CAN controller from Bosch which is 100% compatible with the
+  older AN82527 from Intel, except that some bugs have been fixed.
+
+allOf:
+  - $ref: can-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - bosch,cc770
+      - intc,82527
+
+  reg:
+    description:
+      Register window of the controller. On a PowerPC system the controller
+      sits on the local bus and the property describes the chip select, the
+      address offset and the size, the size usually being 0x80.
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  bosch,external-clock-frequency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Frequency of the external oscillator clock in Hz. The internal clock
+      frequency used by the controller is half of this value.
+    default: 16000000
+
+  bosch,clock-out-frequency:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Clock frequency in Hz on the CLKOUT pin. If not specified or if the
+      value is 0 the CLKOUT pin is disabled.
+    default: 0
+
+  bosch,slew-rate:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Slew rate of the CLKOUT signal. If not specified a reasonable value
+      is calculated. Only used when bosch,clock-out-frequency is set.
+
+  bosch,divide-memory-clock:
+    description: Divide the memory clock for slower memories.
+    type: boolean
+
+  bosch,iso-low-speed-mux:
+    description: Use the ISO low speed multiplexed bus configuration.
+    type: boolean
+
+  bosch,no-comperator-bypass:
+    description:
+      Disable the comparator bypass. When this property is absent the
+      comparator bypass is enabled.
+    type: boolean
+
+  bosch,disconnect-rx0-input:
+    description: Disconnect the RX0 input.
+    type: boolean
+
+  bosch,disconnect-rx1-input:
+    description: Disconnect the RX1 input.
+    type: boolean
+
+  bosch,disconnect-tx1-output:
+    description: Disconnect the TX1 output.
+    type: boolean
+
+  bosch,polarity-dominant:
+    description: Use dominant polarity on the bus.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    localbus {
+        #address-cells = <2>;
+        #size-cells = <1>;
+
+        can@2,100 {
+            compatible = "bosch,cc770";
+            reg = <2 0x100 0x100>;
+            interrupts = <4 1>;
+            interrupt-parent = <&mpic>;
+            bosch,external-clock-frequency = <16000000>;
+            bosch,disconnect-rx1-input;
+            bosch,disconnect-tx1-output;
+            bosch,iso-low-speed-mux;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/net/can/cc770.txt b/Documentation/devicetree/bindings/net/can/cc770.txt
deleted file mode 100644
index 042200cf4..000000000
--- a/Documentation/devicetree/bindings/net/can/cc770.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-Memory mapped Bosch CC770 and Intel AN82527 CAN controller
-
-Note: The CC770 is a CAN controller from Bosch, which is 100%
-compatible with the old AN82527 from Intel, but with "bugs" being fixed.
-
-Required properties:
-
-- compatible : should be "bosch,cc770" for the CC770 and "intc,82527"
-	for the AN82527.
-
-- reg : should specify the chip select, address offset and size required
-	to map the registers of the controller. The size is usually 0x80.
-
-- interrupts : property with a value describing the interrupt source
-	(number and sensitivity) required for the controller.
-
-Optional properties:
-
-- bosch,external-clock-frequency : frequency of the external oscillator
-	clock in Hz. Note that the internal clock frequency used by the
-	controller is half of that value. If not specified, a default
-	value of 16000000 (16 MHz) is used.
-
-- bosch,clock-out-frequency : slock frequency in Hz on the CLKOUT pin.
-	If not specified or if the specified value is 0, the CLKOUT pin
-	will be disabled.
-
-- bosch,slew-rate : slew rate of the CLKOUT signal. If not specified,
-	a reasonable value will be calculated.
-
-- bosch,disconnect-rx0-input : see data sheet.
-
-- bosch,disconnect-rx1-input : see data sheet.
-
-- bosch,disconnect-tx1-output : see data sheet.
-
-- bosch,polarity-dominant : see data sheet.
-
-- bosch,divide-memory-clock : see data sheet.
-
-- bosch,iso-low-speed-mux : see data sheet.
-
-For further information, please have a look to the CC770 or AN82527.
-
-Examples:
-
-can@3,100 {
-	compatible = "bosch,cc770";
-	reg = <3 0x100 0x80>;
-	interrupts = <2 0>;
-	interrupt-parent = <&mpic>;
-	bosch,external-clock-frequency = <16000000>;
-};
-- 
2.43.0


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

end of thread, other threads:[~2026-09-23  2:31 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14  3:02 [PATCH] dt-bindings: net: can: bosch,cc770: Convert to DT schema Quchaosheng
2026-09-14  3:02 ` [PATCH] net: can: cc770: update the binding file reference in the driver comment Quchaosheng
2026-09-14  3:06   ` sashiko-bot
2026-09-14  3:02 ` [PATCH] dt-bindings: net: can: holt,hi3110: Convert to DT schema Quchaosheng
2026-09-14  3:12   ` sashiko-bot
2026-09-15 10:52   ` Krzysztof Kozlowski
2026-09-17  9:21     ` Quchaosheng
2026-09-14  3:02 ` [PATCH] dt-bindings: net: can: fsl,mpc5xxx-mscan: " Quchaosheng
2026-09-14  3:12   ` sashiko-bot
2026-09-14  3:09 ` [PATCH] dt-bindings: net: can: bosch,cc770: " sashiko-bot
2026-09-23  2:30 ` Quchaosheng

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