xref: /openbmc/linux/Documentation/devicetree/bindings/clock/rockchip,px30-cru.yaml (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1*fffa0fa4SJohan Jonker# SPDX-License-Identifier: (GPL-2.0+ OR MIT)
22ab8e118SJohan Jonker%YAML 1.2
32ab8e118SJohan Jonker---
42ab8e118SJohan Jonker$id: http://devicetree.org/schemas/clock/rockchip,px30-cru.yaml#
52ab8e118SJohan Jonker$schema: http://devicetree.org/meta-schemas/core.yaml#
62ab8e118SJohan Jonker
72ab8e118SJohan Jonkertitle: Rockchip PX30 Clock and Reset Unit (CRU)
82ab8e118SJohan Jonker
92ab8e118SJohan Jonkermaintainers:
102ab8e118SJohan Jonker  - Elaine Zhang <zhangqing@rock-chips.com>
112ab8e118SJohan Jonker  - Heiko Stuebner <heiko@sntech.de>
122ab8e118SJohan Jonker
132ab8e118SJohan Jonkerdescription: |
142ab8e118SJohan Jonker  The PX30 clock controller generates and supplies clocks to various
152ab8e118SJohan Jonker  controllers within the SoC and also implements a reset controller for SoC
162ab8e118SJohan Jonker  peripherals.
172ab8e118SJohan Jonker  Each clock is assigned an identifier and client nodes can use this identifier
182ab8e118SJohan Jonker  to specify the clock which they consume. All available clocks are defined as
192ab8e118SJohan Jonker  preprocessor macros in the dt-bindings/clock/px30-cru.h headers and can be
202ab8e118SJohan Jonker  used in device tree sources. Similar macros exist for the reset sources in
212ab8e118SJohan Jonker  these files.
222ab8e118SJohan Jonker  There are several clocks that are generated outside the SoC. It is expected
232ab8e118SJohan Jonker  that they are defined using standard clock bindings with following
242ab8e118SJohan Jonker  clock-output-names:
252ab8e118SJohan Jonker    - "xin24m"     - crystal input       - required
262ab8e118SJohan Jonker    - "xin32k"     - rtc clock           - optional
272ab8e118SJohan Jonker    - "i2sx_clkin" - external I2S clock  - optional
282ab8e118SJohan Jonker    - "gmac_clkin" - external GMAC clock - optional
292ab8e118SJohan Jonker
302ab8e118SJohan Jonkerproperties:
312ab8e118SJohan Jonker  compatible:
322ab8e118SJohan Jonker    enum:
332ab8e118SJohan Jonker      - rockchip,px30-cru
342ab8e118SJohan Jonker      - rockchip,px30-pmucru
352ab8e118SJohan Jonker
362ab8e118SJohan Jonker  reg:
372ab8e118SJohan Jonker    maxItems: 1
382ab8e118SJohan Jonker
392ab8e118SJohan Jonker  "#clock-cells":
402ab8e118SJohan Jonker    const: 1
412ab8e118SJohan Jonker
422ab8e118SJohan Jonker  "#reset-cells":
432ab8e118SJohan Jonker    const: 1
442ab8e118SJohan Jonker
452ab8e118SJohan Jonker  clocks:
462ab8e118SJohan Jonker    minItems: 1
472ab8e118SJohan Jonker    items:
482ab8e118SJohan Jonker      - description: Clock for both PMUCRU and CRU
492ab8e118SJohan Jonker      - description: Clock for CRU (sourced from PMUCRU)
502ab8e118SJohan Jonker
512ab8e118SJohan Jonker  clock-names:
522ab8e118SJohan Jonker    minItems: 1
532ab8e118SJohan Jonker    items:
542ab8e118SJohan Jonker      - const: xin24m
552ab8e118SJohan Jonker      - const: gpll
562ab8e118SJohan Jonker
572ab8e118SJohan Jonker  rockchip,grf:
582ab8e118SJohan Jonker    $ref: /schemas/types.yaml#/definitions/phandle
592ab8e118SJohan Jonker    description:
602ab8e118SJohan Jonker      Phandle to the syscon managing the "general register files" (GRF),
612ab8e118SJohan Jonker      if missing pll rates are not changeable, due to the missing pll
622ab8e118SJohan Jonker      lock status.
632ab8e118SJohan Jonker
642ab8e118SJohan Jonkerrequired:
652ab8e118SJohan Jonker  - compatible
662ab8e118SJohan Jonker  - reg
672ab8e118SJohan Jonker  - clocks
682ab8e118SJohan Jonker  - clock-names
692ab8e118SJohan Jonker  - "#clock-cells"
702ab8e118SJohan Jonker  - "#reset-cells"
712ab8e118SJohan Jonker
722ab8e118SJohan JonkerallOf:
732ab8e118SJohan Jonker  - if:
742ab8e118SJohan Jonker      properties:
752ab8e118SJohan Jonker        compatible:
762ab8e118SJohan Jonker          contains:
772ab8e118SJohan Jonker            const: rockchip,px30-cru
782ab8e118SJohan Jonker
792ab8e118SJohan Jonker    then:
802ab8e118SJohan Jonker      properties:
812ab8e118SJohan Jonker        clocks:
822ab8e118SJohan Jonker          minItems: 2
832ab8e118SJohan Jonker
842ab8e118SJohan Jonker        clock-names:
852ab8e118SJohan Jonker          minItems: 2
862ab8e118SJohan Jonker
872ab8e118SJohan Jonker    else:
882ab8e118SJohan Jonker      properties:
892ab8e118SJohan Jonker        clocks:
902ab8e118SJohan Jonker          maxItems: 1
912ab8e118SJohan Jonker
922ab8e118SJohan Jonker        clock-names:
932ab8e118SJohan Jonker          maxItems: 1
942ab8e118SJohan Jonker
952ab8e118SJohan JonkeradditionalProperties: false
962ab8e118SJohan Jonker
972ab8e118SJohan Jonkerexamples:
982ab8e118SJohan Jonker  - |
992ab8e118SJohan Jonker    #include <dt-bindings/clock/px30-cru.h>
1002ab8e118SJohan Jonker
1012ab8e118SJohan Jonker    pmucru: clock-controller@ff2bc000 {
1022ab8e118SJohan Jonker      compatible = "rockchip,px30-pmucru";
1032ab8e118SJohan Jonker      reg = <0xff2bc000 0x1000>;
1042ab8e118SJohan Jonker      clocks = <&xin24m>;
1052ab8e118SJohan Jonker      clock-names = "xin24m";
1062ab8e118SJohan Jonker      rockchip,grf = <&grf>;
1072ab8e118SJohan Jonker      #clock-cells = <1>;
1082ab8e118SJohan Jonker      #reset-cells = <1>;
1092ab8e118SJohan Jonker    };
1102ab8e118SJohan Jonker
1112ab8e118SJohan Jonker    cru: clock-controller@ff2b0000 {
1122ab8e118SJohan Jonker      compatible = "rockchip,px30-cru";
1132ab8e118SJohan Jonker      reg = <0xff2b0000 0x1000>;
1142ab8e118SJohan Jonker      clocks = <&xin24m>, <&pmucru PLL_GPLL>;
1152ab8e118SJohan Jonker      clock-names = "xin24m", "gpll";
1162ab8e118SJohan Jonker      rockchip,grf = <&grf>;
1172ab8e118SJohan Jonker      #clock-cells = <1>;
1182ab8e118SJohan Jonker      #reset-cells = <1>;
1192ab8e118SJohan Jonker    };
120