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