GNU Linux-libre 4.14.324-gnu1
[releases.git] / arch / arm64 / boot / dts / rockchip / rk3399-puma.dtsi
1 /*
2  * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 #include <dt-bindings/pwm/pwm.h>
44 #include "rk3399.dtsi"
45 #include "rk3399-opp.dtsi"
46
47 / {
48         leds {
49                 compatible = "gpio-leds";
50                 pinctrl-names = "default";
51                 pinctrl-0 = <&led_pin_module>;
52
53                 module-led {
54                         label = "module_led";
55                         gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>;
56                         linux,default-trigger = "heartbeat";
57                         panic-indicator;
58                 };
59         };
60
61         /*
62          * Overwrite the opp-table for CPUB as this board uses a different
63          * regulator (FAN53555) that only allows 10mV steps and therefore
64          * can't reach the operation point target voltages from rk3399-opp.dtsi
65          */
66         /delete-node/ opp-table1;
67         cluster1_opp: opp-table1 {
68                 compatible = "operating-points-v2";
69                 opp-shared;
70
71                 opp00 {
72                         opp-hz = /bits/ 64 <408000000>;
73                         opp-microvolt = <800000>;
74                         clock-latency-ns = <40000>;
75                 };
76                 opp01 {
77                         opp-hz = /bits/ 64 <600000000>;
78                         opp-microvolt = <800000>;
79                 };
80                 opp02 {
81                         opp-hz = /bits/ 64 <816000000>;
82                         opp-microvolt = <830000>;
83                         opp-suspend;
84                 };
85                 opp03 {
86                         opp-hz = /bits/ 64 <1008000000>;
87                         opp-microvolt = <880000>;
88                 };
89                 opp04 {
90                         opp-hz = /bits/ 64 <1200000000>;
91                         opp-microvolt = <950000>;
92                 };
93                 opp05 {
94                         opp-hz = /bits/ 64 <1416000000>;
95                         opp-microvolt = <1030000>;
96                 };
97                 opp06 {
98                         opp-hz = /bits/ 64 <1608000000>;
99                         opp-microvolt = <1100000>;
100                 };
101                 opp07 {
102                         opp-hz = /bits/ 64 <1800000000>;
103                         opp-microvolt = <1200000>;
104                 };
105                 opp08 {
106                         opp-hz = /bits/ 64 <1992000000>;
107                         opp-microvolt = <1230000>;
108                         turbo-mode;
109                 };
110         };
111
112         clkin_gmac: external-gmac-clock {
113                 compatible = "fixed-clock";
114                 clock-frequency = <125000000>;
115                 clock-output-names = "clkin_gmac";
116                 #clock-cells = <0>;
117         };
118
119         vcc1v2_phy: vcc1v2-phy {
120                 compatible = "regulator-fixed";
121                 regulator-name = "vcc1v2_phy";
122                 regulator-always-on;
123                 regulator-boot-on;
124                 regulator-min-microvolt = <1200000>;
125                 regulator-max-microvolt = <1200000>;
126                 vin-supply = <&vcc5v0_sys>;
127         };
128
129         vcc3v3_sys: vcc3v3-sys {
130                 compatible = "regulator-fixed";
131                 regulator-name = "vcc3v3_sys";
132                 regulator-always-on;
133                 regulator-boot-on;
134                 regulator-min-microvolt = <3300000>;
135                 regulator-max-microvolt = <3300000>;
136                 vin-supply = <&vcc5v0_sys>;
137         };
138
139         vcc5v0_host: vcc5v0-host-regulator {
140                 compatible = "regulator-fixed";
141                 gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
142                 pinctrl-names = "default";
143                 pinctrl-0 = <&vcc5v0_host_en>;
144                 regulator-name = "vcc5v0_host";
145                 regulator-always-on;
146                 vin-supply = <&vcc5v0_sys>;
147         };
148
149         vcc5v0_sys: vcc5v0-sys {
150                 compatible = "regulator-fixed";
151                 regulator-name = "vcc5v0_sys";
152                 regulator-always-on;
153                 regulator-boot-on;
154                 regulator-min-microvolt = <5000000>;
155                 regulator-max-microvolt = <5000000>;
156         };
157 };
158
159 &cpu_b0 {
160         cpu-supply = <&vdd_cpu_b>;
161 };
162
163 &cpu_b1 {
164         cpu-supply = <&vdd_cpu_b>;
165 };
166
167 &cpu_l0 {
168         cpu-supply = <&vdd_cpu_l>;
169 };
170
171 &cpu_l1 {
172         cpu-supply = <&vdd_cpu_l>;
173 };
174
175 &cpu_l2 {
176         cpu-supply = <&vdd_cpu_l>;
177 };
178
179 &cpu_l3 {
180         cpu-supply = <&vdd_cpu_l>;
181 };
182
183 &emmc_phy {
184         status = "okay";
185 };
186
187 &gmac {
188         assigned-clocks = <&cru SCLK_RMII_SRC>;
189         assigned-clock-parents = <&clkin_gmac>;
190         clock_in_out = "input";
191         phy-supply = <&vcc1v2_phy>;
192         phy-mode = "rgmii";
193         pinctrl-names = "default";
194         pinctrl-0 = <&rgmii_pins>;
195         snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
196         snps,reset-active-low;
197         snps,reset-delays-us = <0 10000 50000>;
198         tx_delay = <0x10>;
199         rx_delay = <0x10>;
200         status = "okay";
201 };
202
203 &i2c0 {
204         status = "okay";
205         i2c-scl-rising-time-ns = <168>;
206         i2c-scl-falling-time-ns = <4>;
207         clock-frequency = <400000>;
208
209         rk808: pmic@1b {
210                 compatible = "rockchip,rk808";
211                 reg = <0x1b>;
212                 interrupt-parent = <&gpio1>;
213                 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
214                 #clock-cells = <1>;
215                 clock-output-names = "xin32k", "rk808-clkout2";
216                 pinctrl-names = "default";
217                 pinctrl-0 = <&pmic_int_l>;
218                 rockchip,system-power-controller;
219                 wakeup-source;
220
221                 vcc1-supply = <&vcc5v0_sys>;
222                 vcc2-supply = <&vcc5v0_sys>;
223                 vcc3-supply = <&vcc5v0_sys>;
224                 vcc4-supply = <&vcc5v0_sys>;
225                 vcc6-supply = <&vcc5v0_sys>;
226                 vcc7-supply = <&vcc5v0_sys>;
227                 vcc8-supply = <&vcc3v3_sys>;
228                 vcc9-supply = <&vcc5v0_sys>;
229                 vcc10-supply = <&vcc5v0_sys>;
230                 vcc11-supply = <&vcc5v0_sys>;
231                 vcc12-supply = <&vcc3v3_sys>;
232                 vddio-supply = <&vcc1v8_pmu>;
233
234                 regulators {
235                         vdd_center: DCDC_REG1 {
236                                 regulator-name = "vdd_center";
237                                 regulator-min-microvolt = <750000>;
238                                 regulator-max-microvolt = <1350000>;
239                                 regulator-ramp-delay = <6001>;
240                                 regulator-always-on;
241                                 regulator-boot-on;
242                                 regulator-state-mem {
243                                         regulator-off-in-suspend;
244                                 };
245                         };
246
247                         vdd_cpu_l: DCDC_REG2 {
248                                 regulator-name = "vdd_cpu_l";
249                                 regulator-min-microvolt = <750000>;
250                                 regulator-max-microvolt = <1350000>;
251                                 regulator-ramp-delay = <6001>;
252                                 regulator-always-on;
253                                 regulator-boot-on;
254                                 regulator-state-mem {
255                                         regulator-off-in-suspend;
256                                 };
257                         };
258
259                         vcc_ddr: DCDC_REG3 {
260                                 regulator-name = "vcc_ddr";
261                                 regulator-always-on;
262                                 regulator-boot-on;
263                                 regulator-state-mem {
264                                         regulator-on-in-suspend;
265                                 };
266                         };
267
268                         vcc_1v8: DCDC_REG4 {
269                                 regulator-name = "vcc_1v8";
270                                 regulator-min-microvolt = <1800000>;
271                                 regulator-max-microvolt = <1800000>;
272                                 regulator-always-on;
273                                 regulator-boot-on;
274                                 regulator-state-mem {
275                                         regulator-on-in-suspend;
276                                         regulator-suspend-microvolt = <1800000>;
277                                 };
278                         };
279
280                         vcc_ldo1: LDO_REG1 {
281                                 regulator-name = "vcc_ldo1";
282                                 regulator-min-microvolt = <1800000>;
283                                 regulator-max-microvolt = <1800000>;
284                                 regulator-boot-on;
285                                 regulator-state-mem {
286                                         regulator-off-in-suspend;
287                                 };
288                         };
289
290                         vcc1v8_hdmi: LDO_REG2 {
291                                 regulator-name = "vcc1v8_hdmi";
292                                 regulator-min-microvolt = <1800000>;
293                                 regulator-max-microvolt = <1800000>;
294                                 regulator-always-on;
295                                 regulator-boot-on;
296                                 regulator-state-mem {
297                                         regulator-off-in-suspend;
298                                 };
299                         };
300
301                         vcc1v8_pmu: LDO_REG3 {
302                                 regulator-name = "vcc1v8_pmu";
303                                 regulator-min-microvolt = <1800000>;
304                                 regulator-max-microvolt = <1800000>;
305                                 regulator-always-on;
306                                 regulator-boot-on;
307                                 regulator-state-mem {
308                                         regulator-on-in-suspend;
309                                         regulator-suspend-microvolt = <1800000>;
310                                 };
311                         };
312
313                         vcc_sd: LDO_REG4 {
314                                 regulator-name = "vcc_sd";
315                                 regulator-min-microvolt = <1800000>;
316                                 regulator-max-microvolt = <3000000>;
317                                 regulator-always-on;
318                                 regulator-boot-on;
319                                 regulator-state-mem {
320                                         regulator-on-in-suspend;
321                                         regulator-suspend-microvolt = <3000000>;
322                                 };
323                         };
324
325                         vcc_ldo5: LDO_REG5 {
326                                 regulator-name = "vcc_ldo5";
327                                 regulator-min-microvolt = <3000000>;
328                                 regulator-max-microvolt = <3000000>;
329                                 regulator-boot-on;
330                                 regulator-state-mem {
331                                         regulator-off-in-suspend;
332                                 };
333                         };
334
335                         vcc_ldo6: LDO_REG6 {
336                                 regulator-name = "vcc_ldo6";
337                                 regulator-min-microvolt = <1500000>;
338                                 regulator-max-microvolt = <1500000>;
339                                 regulator-boot-on;
340                                 regulator-state-mem {
341                                         regulator-off-in-suspend;
342                                 };
343                         };
344
345                         vcc0v9_hdmi: LDO_REG7 {
346                                 regulator-name = "vcc0v9_hdmi";
347                                 regulator-min-microvolt = <900000>;
348                                 regulator-max-microvolt = <900000>;
349                                 regulator-always-on;
350                                 regulator-boot-on;
351                                 regulator-state-mem {
352                                         regulator-off-in-suspend;
353                                 };
354                         };
355
356                         vcc_efuse: LDO_REG8 {
357                                 regulator-name = "vcc_efuse";
358                                 regulator-min-microvolt = <1800000>;
359                                 regulator-max-microvolt = <1800000>;
360                                 regulator-always-on;
361                                 regulator-boot-on;
362                                 regulator-state-mem {
363                                         regulator-off-in-suspend;
364                                 };
365                         };
366
367                         vcc3v3_s3: SWITCH_REG1 {
368                                 regulator-name = "vcc3v3_s3";
369                                 regulator-always-on;
370                                 regulator-boot-on;
371                                 regulator-state-mem {
372                                         regulator-off-in-suspend;
373                                 };
374                         };
375
376                         vcc3v3_s0: SWITCH_REG2 {
377                                 regulator-name = "vcc3v3_s0";
378                                 regulator-always-on;
379                                 regulator-boot-on;
380                                 regulator-state-mem {
381                                         regulator-off-in-suspend;
382                                 };
383                         };
384                 };
385         };
386
387         vdd_gpu: regulator@60 {
388                 compatible = "fcs,fan53555";
389                 reg = <0x60>;
390                 fcs,suspend-voltage-selector = <1>;
391                 regulator-name = "vdd_gpu";
392                 regulator-min-microvolt = <600000>;
393                 regulator-max-microvolt = <1230000>;
394                 regulator-ramp-delay = <1000>;
395                 regulator-always-on;
396                 regulator-boot-on;
397                 vin-supply = <&vcc5v0_sys>;
398         };
399 };
400
401 &i2c7 {
402         status = "okay";
403         clock-frequency = <400000>;
404
405         fan: fan@18 {
406                 compatible = "ti,amc6821";
407                 reg = <0x18>;
408                 cooling-min-state = <0>;
409                 cooling-max-state = <9>;
410                 #cooling-cells = <2>;
411         };
412
413         rtc_twi: rtc@6f {
414                 compatible = "isil,isl1208";
415                 reg = <0x6f>;
416         };
417 };
418
419 &i2c8 {
420         status = "okay";
421         clock-frequency = <400000>;
422
423         vdd_cpu_b: regulator@60 {
424                 compatible = "fcs,fan53555";
425                 reg = <0x60>;
426                 vin-supply = <&vcc5v0_sys>;
427                 regulator-name = "vdd_cpu_b";
428                 regulator-min-microvolt = <600000>;
429                 regulator-max-microvolt = <1230000>;
430                 regulator-ramp-delay = <1000>;
431                 fcs,suspend-voltage-selector = <1>;
432                 regulator-always-on;
433                 regulator-boot-on;
434         };
435 };
436
437 &io_domains {
438         status = "okay";
439         bt656-supply = <&vcc_1v8>;
440         audio-supply = <&vcc_1v8>;
441         sdmmc-supply = <&vcc_sd>;
442         gpio1830-supply = <&vcc_1v8>;
443 };
444
445 &pmu_io_domains {
446         status = "okay";
447         pmu1830-supply = <&vcc_1v8>;
448 };
449
450 &pwm2 {
451         status = "okay";
452 };
453
454 &pinctrl {
455         i2c8 {
456                 i2c8_xfer_a: i2c8-xfer {
457                         rockchip,pins =
458                           <RK_GPIO1 RK_PC4 RK_FUNC_1 &pcfg_pull_up>,
459                           <RK_GPIO1 RK_PC5 RK_FUNC_1 &pcfg_pull_up>;
460                 };
461         };
462
463         leds {
464                 led_pin_module: led-module-gpio {
465                         rockchip,pins =
466                           <RK_GPIO2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
467                 };
468         };
469
470         pmic {
471                 pmic_int_l: pmic-int-l {
472                         rockchip,pins =
473                           <RK_GPIO1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
474                 };
475         };
476
477         usb2 {
478                 vcc5v0_host_en: vcc5v0-host-en {
479                         rockchip,pins =
480                           <RK_GPIO4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
481                 };
482         };
483 };
484
485 &sdhci {
486         /*
487          * Signal integrity isn't great at 200MHz but 100MHz has proven stable
488          * enough.
489          */
490         max-frequency = <100000000>;
491
492         bus-width = <8>;
493         mmc-hs400-1_8v;
494         mmc-hs400-enhanced-strobe;
495         non-removable;
496         status = "okay";
497 };
498
499 &sdmmc {
500         vqmmc = <&vcc_sd>;
501 };
502
503 &spi1 {
504         status = "okay";
505
506         norflash: flash@0 {
507                 compatible = "jedec,spi-nor";
508                 reg = <0>;
509                 spi-max-frequency = <50000000>;
510         };
511 };
512
513 &u2phy1 {
514         status = "okay";
515
516         u2phy1_otg: otg-port {
517                 status = "okay";
518         };
519
520         u2phy1_host: host-port {
521                 phy-supply = <&vcc5v0_host>;
522                 status = "okay";
523         };
524 };
525
526 &usbdrd3_1 {
527         status = "okay";
528 };
529
530 &usbdrd_dwc3_1 {
531         status = "okay";
532         dr_mode = "host";
533 };
534
535 &usb_host1_ehci {
536         status = "okay";
537 };
538
539 &usb_host1_ohci {
540         status = "okay";
541 };