Merge tag 'drm-misc-next-2023-03-07' of git://anongit.freedesktop.org/drm/drm-misc...
[sfrench/cifs-2.6.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,rk3566-pipe-grf
19               - rockchip,rk3568-pcie3-phy-grf
20               - rockchip,rk3568-pipe-grf
21               - rockchip,rk3568-pipe-phy-grf
22               - rockchip,rk3568-usb2phy-grf
23               - rockchip,rk3588-bigcore0-grf
24               - rockchip,rk3588-bigcore1-grf
25               - rockchip,rk3588-ioc
26               - rockchip,rk3588-php-grf
27               - rockchip,rk3588-sys-grf
28               - rockchip,rk3588-pcie3-phy-grf
29               - rockchip,rk3588-pcie3-pipe-grf
30               - rockchip,rv1108-usbgrf
31           - const: syscon
32       - items:
33           - enum:
34               - rockchip,px30-grf
35               - rockchip,px30-pmugrf
36               - rockchip,px30-usb2phy-grf
37               - rockchip,rk3036-grf
38               - rockchip,rk3066-grf
39               - rockchip,rk3128-grf
40               - rockchip,rk3188-grf
41               - rockchip,rk3228-grf
42               - rockchip,rk3288-grf
43               - rockchip,rk3308-core-grf
44               - rockchip,rk3308-detect-grf
45               - rockchip,rk3308-grf
46               - rockchip,rk3308-usb2phy-grf
47               - rockchip,rk3328-grf
48               - rockchip,rk3328-usb2phy-grf
49               - rockchip,rk3368-grf
50               - rockchip,rk3368-pmugrf
51               - rockchip,rk3399-grf
52               - rockchip,rk3399-pmugrf
53               - rockchip,rk3568-grf
54               - rockchip,rk3568-pmugrf
55               - rockchip,rv1108-grf
56               - rockchip,rv1108-pmugrf
57               - rockchip,rv1126-grf
58               - rockchip,rv1126-pmugrf
59           - const: syscon
60           - const: simple-mfd
61
62   reg:
63     maxItems: 1
64
65   "#address-cells":
66     const: 1
67
68   "#size-cells":
69     const: 1
70
71 required:
72   - compatible
73   - reg
74
75 additionalProperties:
76   type: object
77
78 allOf:
79   - if:
80       properties:
81         compatible:
82           contains:
83             enum:
84               - rockchip,px30-grf
85
86     then:
87       properties:
88         lvds:
89           type: object
90
91           $ref: /schemas/display/rockchip/rockchip,lvds.yaml#
92
93           unevaluatedProperties: false
94
95   - if:
96       properties:
97         compatible:
98           contains:
99             const: rockchip,rk3288-grf
100
101     then:
102       properties:
103         edp-phy:
104           type: object
105           $ref: /schemas/phy/rockchip,rk3288-dp-phy.yaml#
106           unevaluatedProperties: false
107
108   - if:
109       properties:
110         compatible:
111           contains:
112             enum:
113               - rockchip,rk3066-grf
114               - rockchip,rk3188-grf
115               - rockchip,rk3288-grf
116
117     then:
118       properties:
119         usbphy:
120           type: object
121
122           $ref: "/schemas/phy/rockchip-usb-phy.yaml#"
123
124           unevaluatedProperties: false
125
126   - if:
127       properties:
128         compatible:
129           contains:
130             const: rockchip,rk3328-grf
131
132     then:
133       properties:
134         gpio:
135           type: object
136
137           $ref: "/schemas/gpio/rockchip,rk3328-grf-gpio.yaml#"
138
139           unevaluatedProperties: false
140
141         power-controller:
142           type: object
143
144           $ref: "/schemas/power/rockchip,power-controller.yaml#"
145
146           unevaluatedProperties: false
147
148   - if:
149       properties:
150         compatible:
151           contains:
152             const: rockchip,rk3399-grf
153
154     then:
155       properties:
156         mipi-dphy-rx0:
157           type: object
158
159           $ref: "/schemas/phy/rockchip-mipi-dphy-rx0.yaml#"
160
161           unevaluatedProperties: false
162
163         pcie-phy:
164           description:
165             Documentation/devicetree/bindings/phy/rockchip-pcie-phy.txt
166
167       patternProperties:
168         "phy@[0-9a-f]+$":
169           description:
170             Documentation/devicetree/bindings/phy/rockchip-emmc-phy.txt
171
172   - if:
173       properties:
174         compatible:
175           contains:
176             enum:
177               - rockchip,px30-pmugrf
178               - rockchip,rk3036-grf
179               - rockchip,rk3308-grf
180               - rockchip,rk3368-pmugrf
181
182     then:
183       properties:
184         reboot-mode:
185           type: object
186
187           $ref: "/schemas/power/reset/syscon-reboot-mode.yaml#"
188
189           unevaluatedProperties: false
190
191   - if:
192       properties:
193         compatible:
194           contains:
195             enum:
196               - rockchip,px30-usb2phy-grf
197               - rockchip,rk3128-grf
198               - rockchip,rk3228-grf
199               - rockchip,rk3308-usb2phy-grf
200               - rockchip,rk3328-usb2phy-grf
201               - rockchip,rk3399-grf
202               - rockchip,rv1108-grf
203
204     then:
205       required:
206         - "#address-cells"
207         - "#size-cells"
208
209       patternProperties:
210         "usb2phy@[0-9a-f]+$":
211           type: object
212
213           $ref: /schemas/phy/rockchip,inno-usb2phy.yaml#
214
215           unevaluatedProperties: false
216
217   - if:
218       properties:
219         compatible:
220           contains:
221             enum:
222               - rockchip,px30-grf
223               - rockchip,px30-pmugrf
224               - rockchip,rk3188-grf
225               - rockchip,rk3228-grf
226               - rockchip,rk3288-grf
227               - rockchip,rk3328-grf
228               - rockchip,rk3368-grf
229               - rockchip,rk3368-pmugrf
230               - rockchip,rk3399-grf
231               - rockchip,rk3399-pmugrf
232               - rockchip,rk3568-pmugrf
233               - rockchip,rv1108-grf
234               - rockchip,rv1108-pmugrf
235
236     then:
237       properties:
238         io-domains:
239           type: object
240
241           $ref: "/schemas/power/rockchip-io-domain.yaml#"
242
243           unevaluatedProperties: false
244
245 examples:
246   - |
247     #include <dt-bindings/clock/rk3399-cru.h>
248     #include <dt-bindings/interrupt-controller/arm-gic.h>
249     #include <dt-bindings/power/rk3399-power.h>
250     grf: syscon@ff770000 {
251       compatible = "rockchip,rk3399-grf", "syscon", "simple-mfd";
252       reg = <0xff770000 0x10000>;
253       #address-cells = <1>;
254       #size-cells = <1>;
255
256       mipi_dphy_rx0: mipi-dphy-rx0 {
257         compatible = "rockchip,rk3399-mipi-dphy-rx0";
258         clocks = <&cru SCLK_MIPIDPHY_REF>,
259                  <&cru SCLK_DPHY_RX0_CFG>,
260                  <&cru PCLK_VIO_GRF>;
261         clock-names = "dphy-ref", "dphy-cfg", "grf";
262         power-domains = <&power RK3399_PD_VIO>;
263         #phy-cells = <0>;
264       };
265
266       u2phy0: usb2phy@e450 {
267         compatible = "rockchip,rk3399-usb2phy";
268         reg = <0xe450 0x10>;
269         clocks = <&cru SCLK_USB2PHY0_REF>;
270         clock-names = "phyclk";
271         #clock-cells = <0>;
272         clock-output-names = "clk_usbphy0_480m";
273
274         u2phy0_host: host-port {
275           #phy-cells = <0>;
276           interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH 0>;
277           interrupt-names = "linestate";
278          };
279
280         u2phy0_otg: otg-port {
281           #phy-cells = <0>;
282           interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH 0>,
283                        <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH 0>,
284                        <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH 0>;
285           interrupt-names = "otg-bvalid", "otg-id",
286                             "linestate";
287         };
288       };
289     };