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