diff mbox series

[v2,2/4] dt-bindings: can: Add CAST CAN Bus Controller

Message ID 20240922145151.130999-3-hal.feng@starfivetech.com (mailing list archive)
State Handled Elsewhere
Headers show
Series CAST Controller Area Network driver support | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/patch-2-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh took 134.29s
conchuod/patch-2-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh took 1339.05s
conchuod/patch-2-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh took 1572.96s
conchuod/patch-2-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh took 20.21s
conchuod/patch-2-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh took 22.31s
conchuod/patch-2-test-6 warning .github/scripts/patches/tests/checkpatch.sh took 0.55s
conchuod/patch-2-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh took 41.94s
conchuod/patch-2-test-8 success .github/scripts/patches/tests/header_inline.sh took 0.00s
conchuod/patch-2-test-9 success .github/scripts/patches/tests/kdoc.sh took 0.53s
conchuod/patch-2-test-10 success .github/scripts/patches/tests/module_param.sh took 0.01s
conchuod/patch-2-test-11 success .github/scripts/patches/tests/verify_fixes.sh took 0.00s
conchuod/patch-2-test-12 success .github/scripts/patches/tests/verify_signedoff.sh took 0.03s

Commit Message

Hal Feng Sept. 22, 2024, 2:51 p.m. UTC
From: William Qiu <william.qiu@starfivetech.com>

Add bindings for CAST CAN Bus Controller.

Signed-off-by: William Qiu <william.qiu@starfivetech.com>
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
---
 .../bindings/net/can/cast,can-ctrl.yaml       | 106 ++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml

Comments

Rob Herring Sept. 24, 2024, 6:01 p.m. UTC | #1
On Sun, 22 Sep 2024 22:51:48 +0800, Hal Feng wrote:
> From: William Qiu <william.qiu@starfivetech.com>
> 
> Add bindings for CAST CAN Bus Controller.
> 
> Signed-off-by: William Qiu <william.qiu@starfivetech.com>
> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
> ---
>  .../bindings/net/can/cast,can-ctrl.yaml       | 106 ++++++++++++++++++
>  1 file changed, 106 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml:27:9: [warning] wrong indentation: expected 10 but found 8 (indentation)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240922145151.130999-3-hal.feng@starfivetech.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.
Rob Herring Sept. 24, 2024, 8:03 p.m. UTC | #2
On Sun, Sep 22, 2024 at 10:51:48PM +0800, Hal Feng wrote:
> From: William Qiu <william.qiu@starfivetech.com>
> 
> Add bindings for CAST CAN Bus Controller.
> 
> Signed-off-by: William Qiu <william.qiu@starfivetech.com>
> Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
> ---
>  .../bindings/net/can/cast,can-ctrl.yaml       | 106 ++++++++++++++++++
>  1 file changed, 106 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml
> 
> diff --git a/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml b/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml
> new file mode 100644
> index 000000000000..2870cff80164
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml
> @@ -0,0 +1,106 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/net/can/cast,can-ctrl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: CAST CAN Bus Controller
> +
> +description:
> +  This CAN Bus Controller, also called CAN-CTRL, implements a highly
> +  featured and reliable CAN bus controller that performs serial
> +  communication according to the CAN protocol.
> +
> +  The CAN-CTRL comes in three variants, they are CC, FD, and XL.
> +  The CC variant supports only Classical CAN, the FD variant adds support
> +  for CAN FD, and the XL variant supports the Classical CAN, CAN FD, and
> +  CAN XL standards.
> +
> +maintainers:
> +  - William Qiu <william.qiu@starfivetech.com>
> +  - Hal Feng <hal.feng@starfivetech.com>
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +        - starfive,jh7110-can
> +      - const: cast,can-ctrl-fd-7x10N00S00

What's the 7x10...? Perhaps some explanation on it.

> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    minItems: 3
> +
> +  clock-names:
> +    items:
> +      - const: apb
> +      - const: timer
> +      - const: core
> +
> +  resets:
> +    minItems: 3
> +
> +  reset-names:
> +    items:
> +      - const: apb
> +      - const: timer
> +      - const: core
> +
> +  starfive,syscon:
> +    $ref: /schemas/types.yaml#/definitions/phandle-array
> +    items:
> +      - items:
> +          - description: phandle to System Register Controller syscon node
> +          - description: offset of SYS_SYSCONSAIF__SYSCFG register for CAN controller
> +          - description: shift of SYS_SYSCONSAIF__SYSCFG register for CAN controller
> +          - description: mask of SYS_SYSCONSAIF__SYSCFG register for CAN controller
> +    description:
> +      Should be four parameters, the phandle to System Register Controller
> +      syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register
> +      for CAN controller.

This just repeats what the schema says. More useful would be what you 
need to access/control in this register.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml b/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml
new file mode 100644
index 000000000000..2870cff80164
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/can/cast,can-ctrl.yaml
@@ -0,0 +1,106 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/can/cast,can-ctrl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: CAST CAN Bus Controller
+
+description:
+  This CAN Bus Controller, also called CAN-CTRL, implements a highly
+  featured and reliable CAN bus controller that performs serial
+  communication according to the CAN protocol.
+
+  The CAN-CTRL comes in three variants, they are CC, FD, and XL.
+  The CC variant supports only Classical CAN, the FD variant adds support
+  for CAN FD, and the XL variant supports the Classical CAN, CAN FD, and
+  CAN XL standards.
+
+maintainers:
+  - William Qiu <william.qiu@starfivetech.com>
+  - Hal Feng <hal.feng@starfivetech.com>
+
+properties:
+  compatible:
+    items:
+      - enum:
+        - starfive,jh7110-can
+      - const: cast,can-ctrl-fd-7x10N00S00
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    minItems: 3
+
+  clock-names:
+    items:
+      - const: apb
+      - const: timer
+      - const: core
+
+  resets:
+    minItems: 3
+
+  reset-names:
+    items:
+      - const: apb
+      - const: timer
+      - const: core
+
+  starfive,syscon:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      - items:
+          - description: phandle to System Register Controller syscon node
+          - description: offset of SYS_SYSCONSAIF__SYSCFG register for CAN controller
+          - description: shift of SYS_SYSCONSAIF__SYSCFG register for CAN controller
+          - description: mask of SYS_SYSCONSAIF__SYSCFG register for CAN controller
+    description:
+      Should be four parameters, the phandle to System Register Controller
+      syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register
+      for CAN controller.
+
+allOf:
+  - $ref: can-controller.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: starfive,jh7110-can
+    then:
+      required:
+        - starfive,syscon
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - resets
+  - reset-names
+
+additionalProperties: false
+
+examples:
+  - |
+    can@130d0000{
+        compatible = "starfive,jh7110-can", "cast,can-ctrl-fd-7x10N00S00";
+        reg = <0x130d0000 0x1000>;
+        interrupts = <112>;
+        clocks = <&syscrg 115>,
+                 <&syscrg 116>,
+                 <&syscrg 117>;
+        clock-names = "apb", "timer", "core";
+        resets = <&syscrg 111>,
+                 <&syscrg 113>,
+                 <&syscrg 112>;
+        reset-names = "apb", "timer", "core";
+        starfive,syscon = <&sys_syscon 0x10 0x3 0x8>;
+    };
+
+...