1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/clock/ingenic,cgu.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Ingenic SoCs CGU devicetree bindings
8
9description: |
10  The CGU in an Ingenic SoC provides all the clocks generated on-chip. It
11  typically includes a variety of PLLs, multiplexers, dividers & gates in order
12  to provide many different clock signals derived from only 2 external source
13  clocks.
14
15maintainers:
16  - Paul Cercueil <paul@crapouillou.net>
17
18select:
19  properties:
20    compatible:
21      contains:
22        enum:
23          - ingenic,jz4740-cgu
24          - ingenic,jz4725b-cgu
25          - ingenic,jz4760-cgu
26          - ingenic,jz4760b-cgu
27          - ingenic,jz4770-cgu
28          - ingenic,jz4780-cgu
29          - ingenic,x1000-cgu
30          - ingenic,x1830-cgu
31  required:
32    - compatible
33
34properties:
35  $nodename:
36    pattern: "^clock-controller@[0-9a-f]+$"
37
38  "#address-cells":
39    const: 1
40
41  "#size-cells":
42    const: 1
43
44  "#clock-cells":
45    const: 1
46
47  ranges: true
48
49  compatible:
50    items:
51      - enum:
52          - ingenic,jz4740-cgu
53          - ingenic,jz4725b-cgu
54          - ingenic,jz4760-cgu
55          - ingenic,jz4760b-cgu
56          - ingenic,jz4770-cgu
57          - ingenic,jz4780-cgu
58          - ingenic,x1000-cgu
59          - ingenic,x1830-cgu
60      - const: simple-mfd
61    minItems: 1
62
63  reg:
64    maxItems: 1
65
66  clocks:
67    items:
68      - description: External oscillator clock
69      - description: Internal 32 kHz RTC clock
70
71  clock-names:
72    items:
73      - const: ext
74      - enum:
75          - rtc
76          - osc32k # Different name, same clock
77
78  assigned-clocks:
79    minItems: 1
80    maxItems: 64
81
82  assigned-clock-parents:
83    minItems: 1
84    maxItems: 64
85
86  assigned-clock-rates:
87    minItems: 1
88    maxItems: 64
89
90required:
91  - "#clock-cells"
92  - compatible
93  - reg
94  - clocks
95  - clock-names
96
97patternProperties:
98  "^usb-phy@[a-f0-9]+$":
99    allOf: [ $ref: "../phy/ingenic,phy-usb.yaml#" ]
100  "^mac-phy-ctrl@[a-f0-9]+$":
101    allOf: [ $ref: "../net/ingenic,mac.yaml#" ]
102
103additionalProperties: false
104
105examples:
106  - |
107    #include <dt-bindings/clock/ingenic,jz4770-cgu.h>
108    cgu: clock-controller@10000000 {
109      compatible = "ingenic,jz4770-cgu", "simple-mfd";
110      reg = <0x10000000 0x100>;
111      #address-cells = <1>;
112      #size-cells = <1>;
113      ranges = <0x0 0x10000000 0x100>;
114
115      clocks = <&ext>, <&osc32k>;
116      clock-names = "ext", "osc32k";
117
118      #clock-cells = <1>;
119
120      otg_phy: usb-phy@3c {
121        compatible = "ingenic,jz4770-phy";
122        reg = <0x3c 0x10>;
123
124        clocks = <&cgu JZ4770_CLK_OTG_PHY>;
125
126        vcc-supply = <&ldo5>;
127
128        #phy-cells = <0>;
129      };
130    };
131