Merge tag 'batadv-next-for-davem-20190213' of git://git.open-mesh.org/linux-merge
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3188-bqedison2qc.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (c) 2018 MundoReader S.L.
4  * Author:  Heiko Stuebner <heiko.stuebner@bq.com>
5  */
6
7 /dts-v1/;
8 #include <dt-bindings/i2c/i2c.h>
9 #include <dt-bindings/input/input.h>
10 #include "rk3188.dtsi"
11
12 / {
13         model = "BQ Edison2 Quad-Core";
14         compatible = "mundoreader,bq-edison2qc", "rockchip,rk3188";
15
16         memory@60000000 {
17                 device_type = "memory";
18                 reg = <0x60000000 0x80000000>;
19         };
20
21         backlight: backlight {
22                 compatible = "pwm-backlight";
23                 power-supply = <&vsys>;
24                 pwms = <&pwm1 0 25000>;
25         };
26
27         gpio-keys {
28                 compatible = "gpio-keys";
29                 autorepeat;
30                 pinctrl-names = "default";
31                 pinctrl-0 = <&pwr_key &usb_int>;
32
33                 power {
34                         gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
35                         linux,code = <KEY_POWER>;
36                         label = "GPIO Key Power";
37                         linux,input-type = <1>;
38                         debounce-interval = <100>;
39                         wakeup-source;
40                 };
41
42                 wake_on_usb: wake-on-usb {
43                         label = "Wake-on-USB";
44                         gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
45                         linux,code = <KEY_WAKEUP>;
46                         wakeup-source;
47                 };
48         };
49
50         gpio-poweroff {
51                 compatible = "gpio-poweroff";
52                 gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_LOW>;
53                 pinctrl-names = "default";
54                 pinctrl-0 = <&pwr_hold>;
55                 /* only drive the pin low until device is off */
56                 active-delay-ms = <3000>;
57         };
58
59         lvds-encoder {
60                 compatible = "ti,sn75lvds83", "lvds-encoder";
61                 #address-cells = <1>;
62                 #size-cells = <0>;
63
64                 port@0 {
65                         reg = <0>;
66                         lvds_in_vop0: endpoint {
67                                 remote-endpoint = <&vop0_out_lvds>;
68                         };
69                 };
70
71                 port@1 {
72                         reg = <1>;
73                         lvds_out_panel: endpoint {
74                                 remote-endpoint = <&panel_in_lvds>;
75                         };
76                 };
77         };
78
79         panel {
80                 compatible = "innolux,ee101ia-01d", "panel-lvds";
81                 backlight = <&backlight>;
82
83                 /* pin LCD_CS, Nshtdn input of lvds-encoder */
84                 enable-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>;
85                 pinctrl-names = "default";
86                 pinctrl-0 = <&lcd_cs>;
87                 power-supply = <&vcc_lcd>;
88
89                 data-mapping = "vesa-24";
90                 height-mm = <163>;
91                 width-mm = <261>;
92
93                 panel-timing {
94                         clock-frequency = <72000000>;
95                         hactive = <1280>;
96                         vactive = <800>;
97                         hback-porch = <160>;
98                         hfront-porch = <16>;
99                         hsync-len = <10>;
100                         vback-porch = <23>;
101                         vfront-porch = <12>;
102                         vsync-len = <3>;
103                 };
104
105                 port {
106                         panel_in_lvds: endpoint {
107                                 remote-endpoint = <&lvds_out_panel>;
108                         };
109                 };
110         };
111
112         sdio_pwrseq: sdio-pwrseq {
113                 compatible = "mmc-pwrseq-simple";
114                 clocks = <&hym8563>;
115                 clock-names = "ext_clock";
116                 pinctrl-names = "default";
117                 pinctrl-0 = <&wifi_reg_on>;
118                 reset-gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_LOW>;
119         };
120
121         avdd_cif: cif-avdd-regulator {
122                 compatible = "regulator-fixed";
123                 regulator-name = "avdd-cif";
124                 regulator-min-microvolt = <2800000>;
125                 regulator-max-microvolt = <2800000>;
126                 gpio = <&gpio1 RK_PA6 GPIO_ACTIVE_LOW>;
127                 pinctrl-names = "default";
128                 pinctrl-0 = <&cif_avdd_en>;
129                 startup-delay-us = <100000>;
130                 vin-supply = <&vcc28_cif>;
131         };
132
133         vcc_5v: vcc-5v-regulator {
134                 compatible = "regulator-fixed";
135                 regulator-name = "vcc-5v";
136                 regulator-min-microvolt = <5000000>;
137                 regulator-max-microvolt = <5000000>;
138                 enable-active-high;
139                 gpio = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
140                 pinctrl-names = "default";
141                 pinctrl-0 = <&v5_drv>;
142                 vin-supply = <&vsys>;
143         };
144
145         vcc_lcd: lcd-regulator {
146                 compatible = "regulator-fixed";
147                 regulator-name = "vcc-lcd";
148                 gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_LOW>;
149                 pinctrl-names = "default";
150                 pinctrl-0 = <&lcd_en>;
151                 startup-delay-us = <50000>;
152                 vin-supply = <&vcc_io>;
153         };
154
155         vcc_otg: usb-otg-regulator {
156                 compatible = "regulator-fixed";
157                 regulator-name = "vcc-otg";
158                 regulator-min-microvolt = <5000000>;
159                 regulator-max-microvolt = <5000000>;
160                 enable-active-high;
161                 gpio = <&gpio3 RK_PB1 GPIO_ACTIVE_HIGH>;
162                 pinctrl-names = "default";
163                 pinctrl-0 = <&otg_drv>;
164                 startup-delay-us = <100000>;
165                 vin-supply = <&vcc_5v>;
166         };
167
168         vcc_sd: sdmmc-regulator {
169                 compatible = "regulator-fixed";
170                 regulator-name = "vcc-sd";
171                 regulator-min-microvolt = <3300000>;
172                 regulator-max-microvolt = <3300000>;
173                 gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>;
174                 pinctrl-names = "default";
175                 pinctrl-0 = <&sdmmc_pwr>;
176                 startup-delay-us = <100000>;
177                 vin-supply = <&vcc_io>;
178         };
179
180         vccq_emmc: emmc-vccq-regulator {
181                 compatible = "regulator-fixed";
182                 regulator-name = "vccq-emmc";
183                 regulator-min-microvolt = <2800000>;
184                 regulator-max-microvolt = <2800000>;
185                 vin-supply = <&vcc_io>;
186         };
187
188         /* supplied from the bq24196 */
189         vsys: vsys-regulator {
190                 compatible = "regulator-fixed";
191                 regulator-name = "vsys";
192                 regulator-min-microvolt = <5000000>;
193                 regulator-max-microvolt = <5000000>;
194                 regulator-boot-on;
195         };
196 };
197
198 &cpu0 {
199         cpu-supply = <&vdd_arm>;
200 };
201
202 &cpu1 {
203         cpu-supply = <&vdd_arm>;
204 };
205
206 &cpu2 {
207         cpu-supply = <&vdd_arm>;
208 };
209
210 &cpu3 {
211         cpu-supply = <&vdd_arm>;
212 };
213
214 &cru {
215         assigned-clocks = <&cru PLL_GPLL>, <&cru PLL_CPLL>,
216                           <&cru ACLK_CPU>,
217                           <&cru HCLK_CPU>, <&cru PCLK_CPU>,
218                           <&cru ACLK_PERI>, <&cru HCLK_PERI>,
219                           <&cru PCLK_PERI>;
220         assigned-clock-rates = <594000000>, <504000000>,
221                                <300000000>,
222                                <150000000>, <75000000>,
223                                <300000000>, <150000000>,
224                                <75000000>;
225 };
226
227 &emmc {
228         bus-width = <8>;
229         cap-mmc-highspeed;
230         disable-wp;
231         non-removable;
232         pinctrl-names = "default";
233         pinctrl-0 = <&emmc_clk &emmc_cmd>;
234         vmmc-supply = <&vcc_io>;
235         vqmmc-supply = <&vccq_emmc>;
236         status = "okay";
237 };
238
239 &gpu {
240         status = "okay";
241 };
242
243 &i2c0 {
244         clock-frequency = <400000>;
245         status = "okay";
246
247         lis3de: accelerometer@29 {
248                 compatible = "st,lis3de";
249                 reg = <0x29>;
250                 interrupt-parent = <&gpio0>;
251                 interrupts = <RK_PB7 IRQ_TYPE_EDGE_RISING>;
252                 pinctrl-names = "default";
253                 pinctrl-0 = <&gsensor_int>;
254                 rotation-matrix = "1", "0", "0",
255                                   "0", "-1", "0",
256                                   "0", "0", "1";
257                 vdd-supply = <&vcc_io>;
258         };
259 };
260
261 &i2c1 {
262         clock-frequency = <400000>;
263         status = "okay";
264
265         tmp108@48 {
266                 compatible = "ti,tmp108";
267                 reg = <0x48>;
268                 interrupt-parent = <&gpio1>;
269                 interrupts = <RK_PA7 IRQ_TYPE_LEVEL_LOW>;
270                 pinctrl-names = "default";
271                 pinctrl-0 = <&tmp_alrt>;
272                 #thermal-sensor-cells = <0>;
273         };
274
275         hym8563: rtc@51 {
276                 compatible = "haoyu,hym8563";
277                 reg = <0x51>;
278                 interrupt-parent = <&gpio0>;
279                 interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
280                 pinctrl-names = "default";
281                 pinctrl-0 = <&rtc_int>;
282                 #clock-cells = <0>;
283                 clock-output-names = "xin32k";
284         };
285
286         bat: battery@55 {
287                 compatible = "ti,bq27541";
288                 reg = <0x55>;
289                 power-supplies = <&bq24196>;
290         };
291
292         act8846: pmic@5a {
293                 compatible = "active-semi,act8846";
294                 reg = <0x5a>;
295                 pinctrl-names = "default";
296                 pinctrl-0 = <&dvs0_ctl &pmic_int>;
297
298                 vp1-supply = <&vsys>;
299                 vp2-supply = <&vsys>;
300                 vp3-supply = <&vsys>;
301                 vp4-supply = <&vsys>;
302                 inl1-supply = <&vcc_io>;
303                 inl2-supply = <&vsys>;
304                 inl3-supply = <&vsys>;
305
306                 regulators {
307                         vcc_ddr: REG1 {
308                                 regulator-name = "VCC_DDR";
309                                 regulator-min-microvolt = <1200000>;
310                                 regulator-max-microvolt = <1200000>;
311                                 regulator-always-on;
312                         };
313
314                         vdd_log: REG2 {
315                                 regulator-name = "VDD_LOG";
316                                 regulator-min-microvolt = <1000000>;
317                                 regulator-max-microvolt = <1200000>;
318                                 regulator-always-on;
319                         };
320
321                         vdd_arm: REG3 {
322                                 regulator-name = "VDD_ARM";
323                                 regulator-min-microvolt = <875000>;
324                                 regulator-max-microvolt = <1350000>;
325                                 regulator-always-on;
326                         };
327
328                         vcc_io: vcc_hdmi: REG4 {
329                                 regulator-name = "VCC_IO";
330                                 regulator-min-microvolt = <3000000>;
331                                 regulator-max-microvolt = <3000000>;
332                                 regulator-always-on;
333                         };
334
335                         vdd_10: REG5 {
336                                 regulator-name = "VDD_10";
337                                 regulator-min-microvolt = <1000000>;
338                                 regulator-max-microvolt = <1000000>;
339                                 regulator-always-on;
340                         };
341
342                         vdd_12: REG6 {
343                                 regulator-name = "VDD_12";
344                                 regulator-min-microvolt = <1200000>;
345                                 regulator-max-microvolt = <1200000>;
346                                 regulator-always-on;
347                         };
348
349                         vcc18_cif: REG7 {
350                                 regulator-name = "VCC18_CIF";
351                                 regulator-min-microvolt = <1800000>;
352                                 regulator-max-microvolt = <1800000>;
353                                 regulator-always-on;
354                         };
355
356                         vcca_33: REG8 {
357                                 regulator-name = "VCCA_33";
358                                 regulator-min-microvolt = <3300000>;
359                                 regulator-max-microvolt = <3300000>;
360                                 regulator-always-on;
361                         };
362
363                         vcc_tp: REG9 {
364                                 regulator-name = "VCC_TP";
365                                 regulator-min-microvolt = <3300000>;
366                                 regulator-max-microvolt = <3300000>;
367                                 regulator-always-on;
368                         };
369
370                         vccio_wl: REG10 {
371                                 regulator-name = "VCCIO_WL";
372                                 regulator-min-microvolt = <2800000>;
373                                 regulator-max-microvolt = <2800000>;
374                                 regulator-always-on;
375                         };
376
377                         vcc_18: REG11 {
378                                 regulator-name = "VCC_18";
379                                 regulator-min-microvolt = <1800000>;
380                                 regulator-max-microvolt = <1800000>;
381                                 regulator-always-on;
382                         };
383
384                         vcc28_cif: REG12 {
385                                 regulator-name = "VCC28_CIF";
386                                 regulator-min-microvolt = <2800000>;
387                                 regulator-max-microvolt = <2800000>;
388                                 regulator-always-on;
389                         };
390                 };
391         };
392
393         bq24196: charger@6b {
394                 compatible = "ti,bq24196";
395                 reg = <0x6b>;
396                 interrupt-parent = <&gpio0>;
397                 interrupts = <RK_PD7 IRQ_TYPE_EDGE_FALLING>;
398                 pinctrl-names = "default";
399                 pinctrl-0 = <&charger_int &chg_ctl &otg_en>;
400                 ti,system-minimum-microvolt = <3200000>;
401                 monitored-battery = <&bat>;
402                 omit-battery-class;
403
404                 usb_otg_vbus: usb-otg-vbus { };
405         };
406 };
407
408 &i2c2 {
409         clock-frequency = <400000>;
410         status = "okay";
411 };
412
413 &i2c3 {
414         clock-frequency = <400000>;
415         status = "okay";
416 };
417
418 &i2c4 {
419         clock-frequency = <400000>;
420         status = "okay";
421
422         rt5616: codec@1b {
423                 compatible = "realtek,rt5616";
424                 reg = <0x1b>;
425                 clocks = <&cru SCLK_I2S0>;
426                 clock-names = "mclk";
427                 #sound-dai-cells = <0>;
428         };
429 };
430
431 &i2s0 {
432         status = "okay";
433 };
434
435 &mmc0 {
436         bus-width = <4>;
437         cap-mmc-highspeed;
438         cap-sd-highspeed;
439         disable-wp;
440         pinctrl-names = "default";
441         pinctrl-0 = <&sd0_clk>, <&sd0_cmd>, <&sd0_cd>, <&sd0_bus4>;
442         vmmc-supply = <&vcc_sd>;
443         status = "okay";
444 };
445
446 &mmc1 {
447         bus-width = <4>;
448         cap-sd-highspeed;
449         cap-mmc-highspeed;
450         keep-power-in-suspend;
451         mmc-pwrseq = <&sdio_pwrseq>;
452         non-removable;
453         pinctrl-names = "default";
454         pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_bus4>;
455         vmmcq-supply = <&vccio_wl>;
456         status = "okay";
457
458         brcmf: wifi@1 {
459                 compatible = "brcm,bcm4329-fmac";
460                 interrupt-parent = <&gpio3>;
461                 interrupts = <RK_PD2 GPIO_ACTIVE_HIGH>;
462                 interrupt-names = "host-wake";
463                 brcm,drive-strength = <5>;
464                 pinctrl-names = "default";
465                 pinctrl-0 = <&wifi_host_wake>;
466         };
467 };
468
469 &pwm1 {
470         status = "okay";
471 };
472
473 &pinctrl {
474         pcfg_output_high: pcfg-output-high {
475                 output-high;
476         };
477
478         pcfg_output_low: pcfg-output-low {
479                 output-low;
480         };
481
482         act8846 {
483                 dvs0_ctl: dvs0-ctl {
484                         rockchip,pins = <3 RK_PD3 RK_FUNC_GPIO &pcfg_output_low>;
485                 };
486
487                 pmic_int: pmic-int {
488                         rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>;
489                 };
490         };
491
492         bq24196 {
493                 charger_int: charger-int {
494                         rockchip,pins = <0 RK_PD7 RK_FUNC_GPIO &pcfg_pull_up>;
495                 };
496
497                 /* pin hog to make it select usb profile */
498                 chg_ctl: chg-ctl {
499                         rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_output_high>;
500                 };
501
502                 /* low: charging, high: complete, fault: blinking */
503                 chg_det: chg-det {
504                         rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
505                 };
506
507                 /* charging enabled when pin low and register set */
508                 chg_en: chg-en {
509                         rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_output_low>;
510                 };
511
512                 /* bq29196 powergood (when low) signal */
513                 dc_det: dc-det {
514                         rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
515                 };
516
517                 /* wire bq24196 otg pin to high, to enable 500mA charging */
518                 otg_en: otg-en {
519                         rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_output_high>;
520                 };
521         };
522
523         camera {
524                 cif0_pdn: cif0-pdn {
525                         rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
526                 };
527
528                 cif1_pdn: cif1-pdn {
529                         rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
530                 };
531
532                 cif_avdd_en: cif-avdd-en {
533                         rockchip,pins = <1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
534                 };
535         };
536
537         display {
538                 lcd_cs: lcd-cs {
539                         rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
540                 };
541
542                 lcd_en: lcd-en {
543                         rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
544                 };
545         };
546
547         ft5606 {
548                 tp_int: tp-int {
549                         rockchip,pins = <1 RK_PB7 RK_FUNC_GPIO &pcfg_pull_up>;
550                 };
551
552                 tp_rst: tp-rst {
553                         rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
554                 };
555         };
556
557         hdmi {
558                 hdmi_int: hdmi-int {
559                         rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
560                 };
561
562                 hdmi_rst: hdmi-rst {
563                         rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
564                 };
565         };
566
567         hym8563 {
568                 rtc_int: rtc-int {
569                         rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
570                 };
571         };
572
573         keys {
574                 pwr_hold: pwr-hold {
575                         rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_up>;
576                 };
577
578                 pwr_key: pwr-key {
579                         rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>;
580                 };
581         };
582
583         lis3de {
584                 gsensor_int: gsensor-int {
585                         rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
586                 };
587         };
588
589         mmc {
590                 sdmmc_pwr: sdmmc-pwr {
591                         rockchip,pins = <3 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
592                 };
593         };
594
595         tmp108 {
596                 tmp_alrt: tmp-alrt {
597                         rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
598                 };
599         };
600
601         usb {
602                 v5_drv: v5-drv {
603                         rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
604                 };
605
606                 otg_drv: otg-drv {
607                         rockchip,pins = <3 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
608                 };
609
610                 usb_int: usb-int {
611                         rockchip,pins = <0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
612                 };
613         };
614
615         rk903 {
616                 bt_host_wake: bt-host-wake {
617                         rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
618                 };
619
620                 bt_reg_on: bt-reg-on {
621                         rockchip,pins = <3 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
622                 };
623
624                 /* pin hog to pull the reset high */
625                 bt_rst: bt-rst {
626                         rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_output_high>;
627                 };
628
629                 bt_wake: bt-wake {
630                         rockchip,pins = <3 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
631                 };
632
633                 wifi_host_wake: wifi-host-wake {
634                         rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
635                 };
636
637                 wifi_reg_on: wifi-reg-on {
638                         rockchip,pins = <3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
639                 };
640         };
641 };
642
643 &saradc {
644         vref-supply = <&vcc_18>;
645         status = "okay";
646 };
647
648 &spdif {
649         status = "okay";
650 };
651
652 &uart0 {
653         pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
654         status = "okay";
655
656         bluetooth {
657                 compatible = "brcm,bcm43438-bt";
658                 max-speed = <2000000>;
659                 device-wakeup-gpios = <&gpio3 RK_PC6 GPIO_ACTIVE_HIGH>;
660                 host-wakeup-gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
661                 shutdown-gpios = <&gpio3 RK_PC7 GPIO_ACTIVE_HIGH>;
662                 pinctrl-names = "default";
663                 pinctrl-0 = <&bt_host_wake &bt_reg_on &bt_rst &bt_wake>;
664         };
665 };
666
667 &uart1 {
668         status = "okay";
669 };
670
671 &uart2 {
672         status = "okay";
673 };
674
675 &uart3 {
676         pinctrl-0 = <&uart3_xfer &uart3_cts &uart3_rts>;
677         status = "okay";
678 };
679
680 &usbphy {
681         status = "okay";
682 };
683
684 &usb_host {
685         status = "okay";
686 };
687
688 &usb_otg {
689         status = "okay";
690 };
691
692 &vop0 {
693         status = "okay";
694 };
695
696 &vop0_out {
697         vop0_out_lvds: endpoint {
698                 remote-endpoint = <&lvds_in_vop0>;
699         };
700 };
701
702 &vop1 {
703         pinctrl-names = "default";
704         pinctrl-0 = <&lcdc1_dclk &lcdc1_den &lcdc1_hsync
705                      &lcdc1_vsync &lcdc1_rgb24>;
706         status = "okay";
707 };
708
709 &wdt {
710         status = "okay";
711 };