[PATCH v7 1/3] dt-bindings: clock: Add bindings for Canaan K230 clock controller

Krzysztof Kozlowski krzk at kernel.org
Wed Jul 30 00:05:57 PDT 2025


On Wed, Jul 30, 2025 at 02:43:51AM +0800, Xukai Wang wrote:
> This patch adds the Device Tree binding for the clock controller
> on Canaan k230. The binding defines the clocks and the required
> properties to configure them correctly.
> 
> Signed-off-by: Xukai Wang <kingxukai at zohomail.com>
> ---
>  .../devicetree/bindings/clock/canaan,k230-clk.yaml |  61 ++++++
>  include/dt-bindings/clock/canaan,k230-clk.h        | 223 +++++++++++++++++++++
>  2 files changed, 284 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/clock/canaan,k230-clk.yaml b/Documentation/devicetree/bindings/clock/canaan,k230-clk.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..f2aa509b12bce1a69679f6d7e2853273233266d5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/canaan,k230-clk.yaml
> @@ -0,0 +1,61 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/clock/canaan,k230-clk.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Canaan Kendryte K230 Clock
> +
> +maintainers:
> +  - Xukai Wang <kingxukai at zohomail.com>
> +
> +description:
> +  The Canaan K230 clock controller generates various clocks for SoC
> +  peripherals. See include/dt-bindings/clock/canaan,k230-clk.h for
> +  valid clock IDs.
> +
> +properties:
> +  compatible:
> +    const: canaan,k230-clk
> +
> +  reg:
> +    items:
> +      - description: PLL control registers
> +      - description: Sysclk control registers
> +
> +  clocks:
> +    minItems: 1

No, drop. Hardware is not flexible.

> +    items:
> +      - description: Main external reference clock
> +      - description:
> +          External clock which used as the pulse input
> +          for the timer to provide timing signals.

So what is the difference that you removed my Rb? Only this? I do not
see any differences (and don't tell me, you claim some random indice
numbers as change DT maintainer would need to re-review...)

> +
> +  clock-names:
> +    minItems: 1

No, drop. Hardware is not flexible.

> +    items:
> +      - const: osc24m
> +      - const: timer-pulse-in
> +
> +  '#clock-cells':
> +    const: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - clock-names
> +  - '#clock-cells'
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    clock-controller at 91102000 {
> +        compatible = "canaan,k230-clk";
> +        reg = <0x91102000 0x40>,
> +              <0x91100000 0x108>;
> +        clocks = <&osc24m>;
> +        clock-names = "osc24m";

Incomplete. Post complete hardware.

> +        #clock-cells = <1>;
> +    };
> diff --git a/include/dt-bindings/clock/canaan,k230-clk.h b/include/dt-bindings/clock/canaan,k230-clk.h
> new file mode 100644
> index 0000000000000000000000000000000000000000..9eee9440a4f14583eac845b649e5685d623132e1
> --- /dev/null
> +++ b/include/dt-bindings/clock/canaan,k230-clk.h
> @@ -0,0 +1,223 @@
> +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
> +/*
> + * Kendryte Canaan K230 Clock Drivers
> + *
> + * Author: Xukai Wang <kingxukai at zohomail.com>
> + */
> +
> +#ifndef __DT_BINDINGS_CANAAN_K230_CLOCK_H__
> +#define __DT_BINDINGS_CANAAN_K230_CLOCK_H__
> +
> +/* Kendryte K230 SoC clock identifiers (arbitrary values) */

Drop comment, redundant and obvious.

Best regards,
Krzysztof




More information about the linux-riscv mailing list