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