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