# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/starfive,jhb100-per2crg.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: StarFive JHB100 Peripheral-2 Clock and Reset Generator

maintainers:
  - Changhuang Liang <changhuang.liang@starfivetech.com>

properties:
  compatible:
    const: starfive,jhb100-per2crg

  reg:
    maxItems: 1

  clocks:
    items:
      - description: Non Coherent NOC Initiator
      - description: Configure 400MHz
      - description: Configure 125MHz
      - description: GMAC2 RGMII RX
      - description: GMAC2 RMII Reference
      - description: GMAC3 SGMII TX
      - description: GMAC3 SGMII RX
      - description: Main Oscillator (25 MHz)

  clock-names:
    items:
      - const: ncnoc_init
      - const: cfg_400
      - const: cfg_125
      - const: gmac2_rgmii_rx
      - const: gmac2_rmii_ref
      - const: gmac3_sgmii_tx
      - const: gmac3_sgmii_rx
      - const: osc

  '#clock-cells':
    const: 1
    description:
      See <dt-bindings/clock/starfive,jhb100-crg.h> for valid indices.

  '#reset-cells':
    const: 1
    description:
      See <dt-bindings/reset/starfive,jhb100-crg.h> for valid indices.

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - '#clock-cells'
  - '#reset-cells'

additionalProperties: false

examples:
  - |
    clock-controller@11bc0000 {
      compatible = "starfive,jhb100-per2crg";
      reg = <0x11bc0000 0x1000>;
      clocks = <&sys0crg 52>, <&sys0crg 54>, <&sys0crg 55>,
               <&per2_gmac2_rgmii_rx>, <&per2_gmac2_rmii_ref>,
               <&per2_gmac3_sgmii_tx>, <&per2_gmac3_sgmii_rx>,
               <&osc>;
      clock-names = "ncnoc_init", "cfg_400", "cfg_125",
                    "gmac2_rgmii_rx", "gmac2_rmii_ref",
                    "gmac3_sgmii_tx", "gmac3_sgmii_rx",
                    "osc";
      #clock-cells = <1>;
      #reset-cells = <1>;
    };