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