# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/clock/zte,zx297520v3-lspcrm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ZTE zx297520v3 SoC LSP clock and reset controller

maintainers:
  - Stefan Dösinger <stefandoesinger@gmail.com>

description: |
  This clock and reset controller controls low speed peripherals on the board.
  This is a relatively isolated subsystem containing UART, I2C, I2S and SPI
  devices. The controller is responsible for bringing the devices out of reset
  and enabling their clocks as needed.

  The controller receives its clock signals from the matrix controller, and
  these signals need to be declared as clock inputs.

  All available clocks are defined as preprocessor macros in the
  "include/dt-bindings/clock/zte,zx297520v3-clk.h" header. Resets are defined in
  the "include/dt-bindings/reset/zte,zx297520v3-reset.h" header.

properties:
  compatible:
    const: zte,zx297520v3-lspcrm

  reg:
    maxItems: 1

  clocks:
    items:
      - description: Main PLL divided by 5 output from matrixcrm (124.8 MHz)
      - description: Main PLL divided by 4 output from matrixcrm (156 MHz)
      - description: Main PLL divided by 6 output from matrixcrm (104 MHz)
      - description: Main PLL divided by 8 output from matrixcrm (78 MHz)
      - description: Main PLL divided by 12 output from matrixcrm (52 MHz)
      - description: Main oscillator output from matrixcrm (26 MHz)
      - description: Timer oscillator output from matrixcrm (32 kHz)
      - description: LSP pclk output from matrixcrm (26 MHz)
      - description: TDM wclk mux output from matrixcrm
      - description: DPLL divided by 4 output from matrixcrm (122.88 MHz)

  clock-names:
    items:
      - const: mpll-d5
      - const: mpll-d4
      - const: mpll-d6
      - const: mpll-d8
      - const: mpll-d12
      - const: osc26m
      - const: osc32k
      - const: pclk
      - const: tdm-wclk
      - const: dpll-d4

  resets:
    maxItems: 1

  "#clock-cells":
    const: 1

  "#reset-cells":
    const: 1

required:
  - compatible
  - reg
  - clocks
  - clock-names
  - resets
  - "#clock-cells"
  - "#reset-cells"

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/zte,zx297520v3-clk.h>
    #include <dt-bindings/reset/zte,zx297520v3-reset.h>

    clock-controller@1400000 {
        compatible = "zte,zx297520v3-lspcrm";
        reg = <0x01400000 0x100>;
        #clock-cells = <1>;
        clocks = <&matrixcrm ZX297520V3_LSP_MPLL_D5_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_MPLL_D4_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_MPLL_D6_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_MPLL_D8_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_MPLL_D12_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_OSC26M_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_OSC32K_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_PCLK>,
                 <&matrixcrm ZX297520V3_LSP_TDM_WCLK>,
                 <&matrixcrm ZX297520V3_LSP_DPLL_D4_WCLK>;
        clock-names = "mpll-d5", "mpll-d4", "mpll-d6", "mpll-d8", "mpll-d12",
                      "osc26m", "osc32k", "pclk", "tdm-wclk", "dpll-d4";
        #reset-cells = <1>;
        resets = <&matrixcrm ZX297520V3_LSP_RESET>;
    };