Merge tag 'soc-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / soc / rockchip / grf.yaml
1 # SPDX-License-Identifier: GPL-2.0
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/soc/rockchip/grf.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Rockchip General Register Files (GRF)
8
9 maintainers:
10   - Heiko Stuebner <heiko@sntech.de>
11
12 properties:
13   compatible:
14     oneOf:
15       - items:
16           - enum:
17               - rockchip,rk3288-sgrf
18               - rockchip,rv1108-pmugrf
19               - rockchip,rv1108-usbgrf
20           - const: syscon
21       - items:
22           - enum:
23               - rockchip,px30-grf
24               - rockchip,px30-pmugrf
25               - rockchip,px30-usb2phy-grf
26               - rockchip,rk3036-grf
27               - rockchip,rk3066-grf
28               - rockchip,rk3188-grf
29               - rockchip,rk3228-grf
30               - rockchip,rk3288-grf
31               - rockchip,rk3308-core-grf
32               - rockchip,rk3308-detect-grf
33               - rockchip,rk3308-grf
34               - rockchip,rk3308-usb2phy-grf
35               - rockchip,rk3328-grf
36               - rockchip,rk3328-usb2phy-grf
37               - rockchip,rk3368-grf
38               - rockchip,rk3368-pmugrf
39               - rockchip,rk3399-grf
40               - rockchip,rk3399-pmugrf
41               - rockchip,rk3568-grf
42               - rockchip,rk3568-pmugrf
43               - rockchip,rv1108-grf
44           - const: syscon
45           - const: simple-mfd
46
47   reg:
48     maxItems: 1
49
50   "#address-cells":
51     const: 1
52
53   "#size-cells":
54     const: 1
55
56 required:
57   - compatible
58   - reg
59
60 additionalProperties:
61   type: object
62
63 allOf:
64   - if:
65       properties:
66         compatible:
67           contains:
68             const: rockchip,px30-grf
69
70     then:
71       properties:
72         lvds:
73           description:
74             Documentation/devicetree/bindings/display/rockchip/rockchip-lvds.txt
75
76   - if:
77       properties:
78         compatible:
79           contains:
80             const: rockchip,rk3288-grf
81
82     then:
83       properties:
84         edp-phy:
85           description:
86             Documentation/devicetree/bindings/phy/rockchip-dp-phy.txt
87
88   - if:
89       properties:
90         compatible:
91           contains:
92             enum:
93               - rockchip,rk3066-grf
94               - rockchip,rk3188-grf
95               - rockchip,rk3288-grf
96
97     then:
98       properties:
99         usbphy:
100           type: object
101
102           $ref: "/schemas/phy/rockchip-usb-phy.yaml#"
103
104           unevaluatedProperties: false
105
106   - if:
107       properties:
108         compatible:
109           contains:
110             const: rockchip,rk3328-grf
111
112     then:
113       properties:
114         gpio:
115           type: object
116
117           $ref: "/schemas/gpio/rockchip,rk3328-grf-gpio.yaml#"
118
119           unevaluatedProperties: false
120
121         power-controller:
122           type: object
123
124           $ref: "/schemas/power/rockchip,power-controller.yaml#"
125
126           unevaluatedProperties: false
127
128   - if:
129       properties:
130         compatible:
131           contains:
132             const: rockchip,rk3399-grf
133
134     then:
135       properties:
136         mipi-dphy-rx0:
137           type: object
138
139           $ref: "/schemas/phy/rockchip-mipi-dphy-rx0.yaml#"
140
141           unevaluatedProperties: false
142
143         pcie-phy:
144           description:
145             Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt
146
147       patternProperties:
148         "phy@[0-9a-f]+$":
149           description:
150             Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
151
152   - if:
153       properties:
154         compatible:
155           contains:
156             enum:
157               - rockchip,px30-pmugrf
158               - rockchip,rk3036-grf
159               - rockchip,rk3308-grf
160               - rockchip,rk3368-pmugrf
161
162     then:
163       properties:
164         reboot-mode:
165           type: object
166
167           $ref: "/schemas/power/reset/syscon-reboot-mode.yaml#"
168
169           unevaluatedProperties: false
170
171   - if:
172       properties:
173         compatible:
174           contains:
175             enum:
176               - rockchip,px30-usb2phy-grf
177               - rockchip,rk3228-grf
178               - rockchip,rk3308-usb2phy-grf
179               - rockchip,rk3328-usb2phy-grf
180               - rockchip,rk3399-grf
181               - rockchip,rv1108-grf
182
183     then:
184       required:
185         - "#address-cells"
186         - "#size-cells"
187
188       patternProperties:
189         "usb2phy@[0-9a-f]+$":
190           type: object
191
192           $ref: "/schemas/phy/phy-rockchip-inno-usb2.yaml#"
193
194           unevaluatedProperties: false
195
196   - if:
197       properties:
198         compatible:
199           contains:
200             enum:
201               - rockchip,px30-pmugrf
202               - rockchip,px30-grf
203               - rockchip,rk3228-grf
204               - rockchip,rk3288-grf
205               - rockchip,rk3328-grf
206               - rockchip,rk3368-pmugrf
207               - rockchip,rk3368-grf
208               - rockchip,rk3399-pmugrf
209               - rockchip,rk3399-grf
210
211     then:
212       properties:
213         io-domains:
214           description:
215             Documentation/devicetree/bindings/power/rockchip-io-domain.txt
216
217 examples:
218   - |
219     #include <dt-bindings/clock/rk3399-cru.h>
220     #include <dt-bindings/interrupt-controller/arm-gic.h>
221     #include <dt-bindings/power/rk3399-power.h>
222     grf: syscon@ff770000 {
223       compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
224       reg = <0xff770000 0x10000>;
225       #address-cells = <1>;
226       #size-cells = <1>;
227
228       mipi_dphy_rx0: mipi-dphy-rx0 {
229         compatible = "rockchip,rk3399-mipi-dphy-rx0";
230         clocks = <&cru SCLK_MIPIDPHY_REF>,
231                  <&cru SCLK_DPHY_RX0_CFG>,
232                  <&cru PCLK_VIO_GRF>;
233         clock-names = "dphy-ref", "dphy-cfg", "grf";
234         power-domains = <&power RK3399_PD_VIO>;
235         #phy-cells = <0>;
236       };
237
238       u2phy0: usb2phy@e450 {
239         compatible = "rockchip,rk3399-usb2phy";
240         reg = <0xe450 0x10>;
241         clocks = <&cru SCLK_USB2PHY0_REF>;
242         clock-names = "phyclk";
243         #clock-cells = <0>;
244         clock-output-names = "clk_usbphy0_480m";
245
246         u2phy0_host: host-port {
247           #phy-cells = <0>;
248           interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH 0>;
249           interrupt-names = "linestate";
250          };
251
252         u2phy0_otg: otg-port {
253           #phy-cells = <0>;
254           interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH 0>,
255                        <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH 0>,
256                        <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH 0>;
257           interrupt-names = "otg-bvalid", "otg-id",
258                             "linestate";
259         };
260       };
261     };