Merge tag 'leds-for-5.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anasz...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3288-tinker.dtsi
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
4  */
5
6 #include "rk3288.dtsi"
7 #include <dt-bindings/input/input.h>
8
9 / {
10         chosen {
11                 stdout-path = "serial2:115200n8";
12         };
13
14         memory {
15                 reg = <0x0 0x0 0x0 0x80000000>;
16                 device_type = "memory";
17         };
18
19         ext_gmac: external-gmac-clock {
20                 compatible = "fixed-clock";
21                 #clock-cells = <0>;
22                 clock-frequency = <125000000>;
23                 clock-output-names = "ext_gmac";
24         };
25
26         gpio-keys {
27                 compatible = "gpio-keys";
28                 #address-cells = <1>;
29                 #size-cells = <0>;
30                 autorepeat;
31
32                 pinctrl-names = "default";
33                 pinctrl-0 = <&pwrbtn>;
34
35                 button@0 {
36                         gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
37                         linux,code = <KEY_POWER>;
38                         label = "GPIO Key Power";
39                         linux,input-type = <1>;
40                         wakeup-source;
41                         debounce-interval = <100>;
42                 };
43         };
44
45         gpio-leds {
46                 compatible = "gpio-leds";
47
48                 act-led {
49                         gpios=<&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
50                         linux,default-trigger="mmc0";
51                 };
52
53                 heartbeat-led {
54                         gpios=<&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
55                         linux,default-trigger="heartbeat";
56                 };
57
58                 pwr-led {
59                         gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
60                         linux,default-trigger = "default-on";
61                 };
62         };
63
64         sound {
65                 compatible = "simple-audio-card";
66                 simple-audio-card,format = "i2s";
67                 simple-audio-card,name = "rockchip,tinker-codec";
68                 simple-audio-card,mclk-fs = <512>;
69
70                 simple-audio-card,codec {
71                         sound-dai = <&hdmi>;
72                 };
73
74                 simple-audio-card,cpu {
75                         sound-dai = <&i2s>;
76                 };
77         };
78
79         vcc_sys: vsys-regulator {
80                 compatible = "regulator-fixed";
81                 regulator-name = "vcc_sys";
82                 regulator-min-microvolt = <5000000>;
83                 regulator-max-microvolt = <5000000>;
84                 regulator-always-on;
85                 regulator-boot-on;
86         };
87
88         vcc_sd: sdmmc-regulator {
89                 compatible = "regulator-fixed";
90                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
91                 pinctrl-names = "default";
92                 pinctrl-0 = <&sdmmc_pwr>;
93                 regulator-name = "vcc_sd";
94                 regulator-min-microvolt = <3300000>;
95                 regulator-max-microvolt = <3300000>;
96                 startup-delay-us = <100000>;
97                 vin-supply = <&vcc_io>;
98         };
99 };
100
101 &cpu0 {
102         cpu0-supply = <&vdd_cpu>;
103 };
104
105 &gmac {
106         assigned-clocks = <&cru SCLK_MAC>;
107         assigned-clock-parents = <&ext_gmac>;
108         clock_in_out = "input";
109         phy-mode = "rgmii";
110         phy-supply = <&vcc33_lan>;
111         pinctrl-names = "default";
112         pinctrl-0 = <&rgmii_pins>;
113         snps,reset-gpio = <&gpio4 7 0>;
114         snps,reset-active-low;
115         snps,reset-delays-us = <0 10000 1000000>;
116         tx_delay = <0x30>;
117         rx_delay = <0x10>;
118         status = "ok";
119 };
120
121 &gpu {
122         mali-supply = <&vdd_gpu>;
123         status = "okay";
124 };
125
126 &hdmi {
127         ddc-i2c-bus = <&i2c5>;
128         status = "okay";
129 };
130
131 &i2c0 {
132         clock-frequency = <400000>;
133         status = "okay";
134
135         rk808: pmic@1b {
136                 compatible = "rockchip,rk808";
137                 reg = <0x1b>;
138                 interrupt-parent = <&gpio0>;
139                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
140                 #clock-cells = <1>;
141                 clock-output-names = "xin32k", "rk808-clkout2";
142                 dvs-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
143                                 <&gpio0 12 GPIO_ACTIVE_HIGH>;
144                 pinctrl-names = "default";
145                 pinctrl-0 = <&pmic_int &global_pwroff &dvs_1 &dvs_2>;
146                 rockchip,system-power-controller;
147                 wakeup-source;
148
149                 vcc1-supply = <&vcc_sys>;
150                 vcc2-supply = <&vcc_sys>;
151                 vcc3-supply = <&vcc_sys>;
152                 vcc4-supply = <&vcc_sys>;
153                 vcc6-supply = <&vcc_sys>;
154                 vcc7-supply = <&vcc_sys>;
155                 vcc8-supply = <&vcc_io>;
156                 vcc9-supply = <&vcc_io>;
157                 vcc10-supply = <&vcc_io>;
158                 vcc11-supply = <&vcc_sys>;
159                 vcc12-supply = <&vcc_io>;
160                 vddio-supply = <&vcc_io>;
161
162                 regulators {
163                         vdd_cpu: DCDC_REG1 {
164                                 regulator-always-on;
165                                 regulator-boot-on;
166                                 regulator-min-microvolt = <750000>;
167                                 regulator-max-microvolt = <1350000>;
168                                 regulator-name = "vdd_arm";
169                                 regulator-ramp-delay = <6000>;
170                                 regulator-state-mem {
171                                         regulator-off-in-suspend;
172                                 };
173                         };
174
175                         vdd_gpu: DCDC_REG2 {
176                                 regulator-always-on;
177                                 regulator-boot-on;
178                                 regulator-min-microvolt = <850000>;
179                                 regulator-max-microvolt = <1250000>;
180                                 regulator-name = "vdd_gpu";
181                                 regulator-ramp-delay = <6000>;
182                                 regulator-state-mem {
183                                         regulator-on-in-suspend;
184                                         regulator-suspend-microvolt = <1000000>;
185                                 };
186                         };
187
188                         vcc_ddr: DCDC_REG3 {
189                                 regulator-always-on;
190                                 regulator-boot-on;
191                                 regulator-name = "vcc_ddr";
192                                 regulator-state-mem {
193                                         regulator-on-in-suspend;
194                                 };
195                         };
196
197                         vcc_io: DCDC_REG4 {
198                                 regulator-always-on;
199                                 regulator-boot-on;
200                                 regulator-min-microvolt = <3300000>;
201                                 regulator-max-microvolt = <3300000>;
202                                 regulator-name = "vcc_io";
203                                 regulator-state-mem {
204                                         regulator-on-in-suspend;
205                                         regulator-suspend-microvolt = <3300000>;
206                                 };
207                         };
208
209                         vcc18_ldo1: LDO_REG1 {
210                                 regulator-always-on;
211                                 regulator-boot-on;
212                                 regulator-min-microvolt = <1800000>;
213                                 regulator-max-microvolt = <1800000>;
214                                 regulator-name = "vcc18_ldo1";
215                                 regulator-state-mem {
216                                         regulator-on-in-suspend;
217                                         regulator-suspend-microvolt = <1800000>;
218                                 };
219                         };
220
221                         vcc33_mipi: LDO_REG2 {
222                                 regulator-always-on;
223                                 regulator-boot-on;
224                                 regulator-min-microvolt = <3300000>;
225                                 regulator-max-microvolt = <3300000>;
226                                 regulator-name = "vcc33_mipi";
227                                 regulator-state-mem {
228                                         regulator-off-in-suspend;
229                                 };
230                         };
231
232                         vdd_10: LDO_REG3 {
233                                 regulator-always-on;
234                                 regulator-boot-on;
235                                 regulator-min-microvolt = <1000000>;
236                                 regulator-max-microvolt = <1000000>;
237                                 regulator-name = "vdd_10";
238                                 regulator-state-mem {
239                                         regulator-on-in-suspend;
240                                         regulator-suspend-microvolt = <1000000>;
241                                 };
242                         };
243
244                         vcc18_codec: LDO_REG4 {
245                                 regulator-always-on;
246                                 regulator-boot-on;
247                                 regulator-min-microvolt = <1800000>;
248                                 regulator-max-microvolt = <1800000>;
249                                 regulator-name = "vcc18_codec";
250                                 regulator-state-mem {
251                                         regulator-on-in-suspend;
252                                         regulator-suspend-microvolt = <1800000>;
253                                 };
254                         };
255
256                         vccio_sd: LDO_REG5 {
257                                 regulator-boot-on;
258                                 regulator-min-microvolt = <1800000>;
259                                 regulator-max-microvolt = <3300000>;
260                                 regulator-name = "vccio_sd";
261                                 regulator-state-mem {
262                                         regulator-on-in-suspend;
263                                         regulator-suspend-microvolt = <3300000>;
264                                 };
265                         };
266
267                         vdd10_lcd: LDO_REG6 {
268                                 regulator-always-on;
269                                 regulator-boot-on;
270                                 regulator-min-microvolt = <1000000>;
271                                 regulator-max-microvolt = <1000000>;
272                                 regulator-name = "vdd10_lcd";
273                                 regulator-state-mem {
274                                         regulator-on-in-suspend;
275                                         regulator-suspend-microvolt = <1000000>;
276                                 };
277                         };
278
279                         vcc_18: LDO_REG7 {
280                                 regulator-always-on;
281                                 regulator-boot-on;
282                                 regulator-min-microvolt = <1800000>;
283                                 regulator-max-microvolt = <1800000>;
284                                 regulator-name = "vcc_18";
285                                 regulator-state-mem {
286                                         regulator-on-in-suspend;
287                                         regulator-suspend-microvolt = <1800000>;
288                                 };
289                         };
290
291                         vcc18_lcd: LDO_REG8 {
292                                 regulator-always-on;
293                                 regulator-boot-on;
294                                 regulator-min-microvolt = <1800000>;
295                                 regulator-max-microvolt = <1800000>;
296                                 regulator-name = "vcc18_lcd";
297                                 regulator-state-mem {
298                                         regulator-on-in-suspend;
299                                         regulator-suspend-microvolt = <1800000>;
300                                 };
301                         };
302
303                         vcc33_sd: SWITCH_REG1 {
304                                 regulator-always-on;
305                                 regulator-boot-on;
306                                 regulator-name = "vcc33_sd";
307                                 regulator-state-mem {
308                                         regulator-on-in-suspend;
309                                 };
310                         };
311
312                         vcc33_lan: SWITCH_REG2 {
313                                 regulator-always-on;
314                                 regulator-boot-on;
315                                 regulator-name = "vcc33_lan";
316                                 regulator-state-mem {
317                                         regulator-on-in-suspend;
318                                 };
319                         };
320                 };
321         };
322 };
323
324 &i2c2 {
325         status = "okay";
326 };
327
328 &i2c5 {
329         status = "okay";
330 };
331
332 &i2s {
333         #sound-dai-cells = <0>;
334         status = "okay";
335 };
336
337 &io_domains {
338         status = "okay";
339
340         sdcard-supply = <&vccio_sd>;
341 };
342
343 &pinctrl {
344         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
345                 drive-strength = <8>;
346         };
347
348         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
349                 bias-pull-up;
350                 drive-strength = <8>;
351         };
352
353         backlight {
354                 bl_en: bl-en {
355                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
356                 };
357         };
358
359         buttons {
360                 pwrbtn: pwrbtn {
361                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
362                 };
363         };
364
365         eth_phy {
366                 eth_phy_pwr: eth-phy-pwr {
367                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
368                 };
369         };
370
371         pmic {
372                 pmic_int: pmic-int {
373                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO \
374                                         &pcfg_pull_up>;
375                 };
376
377                 dvs_1: dvs-1 {
378                         rockchip,pins = <RK_GPIO0 11 RK_FUNC_GPIO \
379                                         &pcfg_pull_down>;
380                 };
381
382                 dvs_2: dvs-2 {
383                         rockchip,pins = <RK_GPIO0 12 RK_FUNC_GPIO \
384                                         &pcfg_pull_down>;
385                 };
386         };
387
388         sdmmc {
389                 sdmmc_bus4: sdmmc-bus4 {
390                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
391                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
392                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
393                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
394                 };
395
396                 sdmmc_clk: sdmmc-clk {
397                         rockchip,pins = <6 20 RK_FUNC_1 \
398                                         &pcfg_pull_none_drv_8ma>;
399                 };
400
401                 sdmmc_cmd: sdmmc-cmd {
402                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
403                 };
404
405                 sdmmc_pwr: sdmmc-pwr {
406                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
407                 };
408         };
409
410         usb {
411                 host_vbus_drv: host-vbus-drv {
412                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
413                 };
414
415                 pwr_3g: pwr-3g {
416                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
417                 };
418         };
419 };
420
421 &pwm0 {
422         status = "okay";
423 };
424
425 &saradc {
426         vref-supply = <&vcc18_ldo1>;
427         status ="okay";
428 };
429
430 &sdmmc {
431         bus-width = <4>;
432         cap-mmc-highspeed;
433         cap-sd-highspeed;
434         broken-cd;
435         disable-wp;                     /* wp not hooked up */
436         pinctrl-names = "default";
437         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
438         status = "okay";
439         vmmc-supply = <&vcc33_sd>;
440         vqmmc-supply = <&vccio_sd>;
441 };
442
443 &tsadc {
444         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
445         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
446         status = "okay";
447 };
448
449 &uart0 {
450         status = "okay";
451 };
452
453 &uart1 {
454         status = "okay";
455 };
456
457 &uart2 {
458         status = "okay";
459 };
460
461 &uart3 {
462         status = "okay";
463 };
464
465 &uart4 {
466         status = "okay";
467 };
468
469 &usbphy {
470         status = "okay";
471 };
472
473 &usb_host0_ehci {
474         status = "okay";
475 };
476
477 &usb_host1 {
478         status = "okay";
479 };
480
481 &usb_otg {
482         status= "okay";
483 };
484
485 &vopb {
486         status = "okay";
487 };
488
489 &vopb_mmu {
490         status = "okay";
491 };
492
493 &vopl {
494         status = "okay";
495 };
496
497 &vopl_mmu {
498         status = "okay";
499 };
500
501 &wdt {
502         status = "okay";
503 };