ARM64: dts: rk3399: gru: enable eDP display nodes
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-gru.dtsi
1 /*
2  * Google Gru (and derivatives) board device tree source
3  *
4  * Copyright 2016 Google, Inc
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  *  Or, alternatively,
22  *
23  *  b) Permission is hereby granted, free of charge, to any person
24  *     obtaining a copy of this software and associated documentation
25  *     files (the "Software"), to deal in the Software without
26  *     restriction, including without limitation the rights to use,
27  *     copy, modify, merge, publish, distribute, sublicense, and/or
28  *     sell copies of the Software, and to permit persons to whom the
29  *     Software is furnished to do so, subject to the following
30  *     conditions:
31  *
32  *     The above copyright notice and this permission notice shall be
33  *     included in all copies or substantial portions of the Software.
34  *
35  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42  *     OTHER DEALINGS IN THE SOFTWARE.
43  */
44
45 #include <dt-bindings/pwm/pwm.h>
46 #include "rk3399.dtsi"
47
48 / {
49         /*
50          * Power Tree
51          *
52          * In general an attempt is made to include all rails called out by
53          * the schematic as long as those rails interact in some way with
54          * the AP.  AKA:
55          * - Rails that only connect to the EC (or devices that the EC talks to)
56          *   are not included.
57          * - Rails _are_ included if the rails go to the AP even if the AP
58          *   doesn't currently care about them / they are always on.  The idea
59          *   here is that it makes it easier to map to the schematic or extend
60          *   later.
61          *
62          * If two rails are substantially the same from the AP's point of
63          * view, though, we won't create a full fixed regulator.  We'll just
64          * put the child rail as an alias of the parent rail.  Sometimes rails
65          * look the same to the AP because one of these is true:
66          * - The EC controls the enable and the EC always enables a rail as
67          *   long as the AP is running.
68          * - The rails are actually connected to each other by a jumper and
69          *   the distinction is just there to add clarity/flexibility to the
70          *   schematic.
71          */
72
73         /* parentless regulators */
74
75         ppvar_sys: ppvar-sys {
76                 compatible = "regulator-fixed";
77                 regulator-name = "ppvar_sys";
78                 regulator-always-on;
79                 regulator-boot-on;
80         };
81
82         /* ppvar_sys children, sorted by name */
83
84         pp900_ap: pp900-ap {
85                 compatible = "regulator-fixed";
86                 regulator-name = "pp900_ap";
87
88                 /* EC turns on w/ pp900_ap_en; always on for AP */
89                 regulator-always-on;
90                 regulator-boot-on;
91
92                 regulator-min-microvolt = <900000>;
93                 regulator-max-microvolt = <900000>;
94
95                 vin-supply = <&ppvar_sys>;
96         };
97
98         pp1200_lpddr: pp1200-lpddr {
99                 compatible = "regulator-fixed";
100                 regulator-name = "pp1200_lpddr";
101
102                 /* EC turns on w/ lpddr_pwr_en; always on for AP */
103                 regulator-always-on;
104                 regulator-boot-on;
105
106                 regulator-min-microvolt = <1200000>;
107                 regulator-max-microvolt = <1200000>;
108
109                 vin-supply = <&ppvar_sys>;
110         };
111
112         pp1800: pp1800 {
113                 compatible = "regulator-fixed";
114                 regulator-name = "pp1800";
115
116                 /* Always on when ppvar_sys shows power good */
117                 regulator-always-on;
118                 regulator-boot-on;
119
120                 regulator-min-microvolt = <1800000>;
121                 regulator-max-microvolt = <1800000>;
122                 vin-supply = <&ppvar_sys>;
123         };
124
125         pp3000: pp3000 {
126                 compatible = "regulator-fixed";
127                 regulator-name = "pp3000";
128                 pinctrl-names = "default";
129                 pinctrl-0 = <&pp3000_en>;
130
131                 enable-active-high;
132                 gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
133
134                 regulator-always-on;
135                 regulator-boot-on;
136
137                 regulator-min-microvolt = <3000000>;
138                 regulator-max-microvolt = <3000000>;
139
140                 vin-supply = <&ppvar_sys>;
141         };
142
143         pp3300: pp3300 {
144                 compatible = "regulator-fixed";
145                 regulator-name = "pp3300";
146
147                 /* Always on; plain and simple */
148                 regulator-always-on;
149                 regulator-boot-on;
150
151                 regulator-min-microvolt = <3300000>;
152                 regulator-max-microvolt = <3300000>;
153
154                 vin-supply = <&ppvar_sys>;
155         };
156
157         pp5000: pp5000 {
158                 compatible = "regulator-fixed";
159                 regulator-name = "pp5000";
160
161                 /* EC turns on w/ pp5000_en; always on for AP */
162                 regulator-always-on;
163                 regulator-boot-on;
164
165                 regulator-min-microvolt = <5000000>;
166                 regulator-max-microvolt = <5000000>;
167
168                 vin-supply = <&ppvar_sys>;
169         };
170
171         ppvar_bigcpu: ppvar-bigcpu {
172                 compatible = "pwm-regulator";
173                 regulator-name = "ppvar_bigcpu";
174                 status = "okay";
175
176                 pwms = <&pwm1 0 1000>;  // TODO: schematics say "FSW 600KHz".  Change these???
177
178                 // TODO: where's the mapping of duty cycle to voltage???
179                 // TODO: we probably need in-flight PWM regulator series?
180
181                 /* EC turns on w/ ap_core_en; always on for AP */
182                 regulator-always-on;
183
184                 regulator-min-microvolt = <800000>;
185                 regulator-max-microvolt = <1500000>;
186
187                 vin-supply = <&ppvar_sys>;
188         };
189
190         ppvar_litcpu: ppvar-litcpu {
191                 compatible = "pwm-regulator";
192                 regulator-name = "ppvar_litcpu";
193                 status = "okay";
194
195                 pwms = <&pwm2 0 1000>;
196
197                 /* EC turns on w/ ap_core_en; always on for AP */
198                 regulator-always-on;
199
200                 regulator-min-microvolt = <800000>;
201                 regulator-max-microvolt = <1500000>;
202
203                 vin-supply = <&ppvar_sys>;
204         };
205
206         ppvar_gpu: ppvar-gpu {
207                 compatible = "pwm-regulator";
208                 regulator-name = "ppvar_gpu";
209                 status = "okay";
210
211                 pwms = <&pwm0 0 1000>;
212
213                 /* EC turns on w/ ap_core_en; always on for AP */
214                 regulator-always-on;
215
216                 regulator-min-microvolt = <800000>;
217                 regulator-max-microvolt = <1500000>;
218
219                 vin-supply = <&ppvar_sys>;
220         };
221
222         ppvar_centerlogic: ppvar-centerlogic {
223                 compatible = "pwm-regulator";
224                 regulator-name = "ppvar_centerlogic";
225                 status = "okay";
226
227                 pwms = <&pwm3 0 1000>;
228
229                 /* EC turns on w/ ppvar_centerlogic_en; always on for AP */
230                 regulator-always-on;
231
232                 regulator-min-microvolt = <800000>;
233                 regulator-max-microvolt = <1500000>;
234
235                 vin-supply = <&ppvar_sys>;
236         };
237
238         /* Schematics call this PPVAR even though it's fixed */
239         ppvar_logic: ppvar-logic {
240                 compatible = "regulator-fixed";
241                 regulator-name = "ppvar_logic";
242
243                 /* EC turns on w/ ppvar_logic_en; always on for AP */
244                 regulator-always-on;
245                 regulator-boot-on;
246
247                 regulator-min-microvolt = <900000>;
248                 regulator-max-microvolt = <900000>;
249
250                 vin-supply = <&ppvar_sys>;
251         };
252
253         /* pp900_ap aliases; these are always on for AP so just use alias */
254
255         /* EC turns on w/ pp900_ddrpll_en */
256         pp900_ddrpll: pp900_ap {
257         };
258
259         /* EC turns on w/ pp900_pcie_en */
260         pp900_pcie: pp900_ap {
261         };
262
263         /* EC turns on w/ pp900_pll_en */
264         pp900_pll: pp900_ap {
265         };
266
267         /* EC turns on w/ pp900_pmu_en */
268         pp900_pmu: pp900_ap {
269         };
270
271         /* EC turns on w/ pp900_usb_en */
272         pp900_usb: pp900_ap {
273         };
274
275         /* pp1800 aliases; these are always on for AP so just use alias */
276
277         /* EC turns on w/ pp1800_s0_en_l */
278         pp1800_ap_io: pp1800_emmc: pp1800_nfc: pp1800_s0: pp1800 {
279         };
280
281         /* EC turns on w/ pp1800_avdd_en_l */
282         pp1800_avdd: pp1800 {
283         };
284
285         /* EC turns on w/ pp1800_lid_en_l */
286         pp1800_lid: pp1800_mic: pp1800 {
287         };
288
289         /* EC turns on w/ lpddr_pwr_en */
290         pp1800_lpddr: pp1800 {
291         };
292
293         /* EC turns on w/ pp1800_pmu_en_l */
294         pp1800_pmu: pp1800 {
295         };
296
297         /* EC turns on w/ pp1800_sensor_en_l */
298         // TODO: Only for EC and things EC talks to I think; remove?
299         pp1800_sensor: pp1800 {
300         };
301
302         /* EC turns on w/ pp1800_usb_en_l */
303         pp1800_usb: pp1800 {
304         };
305
306         /* pp1800 children */
307
308         /* EC turns on w/ pp1200_hsic_en */
309         // TODO: Might be removed in future schematics?
310         pp1200_hsic: pp1200-hsic {
311                 compatible = "regulator-fixed";
312                 regulator-name = "pp1200_hsic";
313
314                 regulator-always-on;
315                 regulator-boot-on;
316                 regulator-min-microvolt = <1200000>;
317                 regulator-max-microvolt = <1200000>;
318
319                 vin-supply = <&pp1800>;
320         };
321
322         pp1500_ap_io: pp1500-ap-io {
323                 compatible = "regulator-fixed";
324                 regulator-name = "pp1500_ap_io";
325                 pinctrl-names = "default";
326                 pinctrl-0 = <&pp1500_en>;
327
328                 enable-active-high;
329                 gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
330
331                 regulator-always-on;
332                 regulator-boot-on;
333                 regulator-min-microvolt = <1500000>;
334                 regulator-max-microvolt = <1500000>;
335
336                 vin-supply = <&pp1800>;                 // TODO: DNS for 3.3??
337         };
338
339         pp1800_audio: pp1800-audio {
340                 compatible = "regulator-fixed";
341                 regulator-name = "pp1800_audio";
342                 pinctrl-names = "default";
343                 pinctrl-0 = <&pp1800_audio_en>;
344
345                 enable-active-high;
346                 gpio = <&gpio0 1 GPIO_ACTIVE_HIGH>;
347
348                 vin-supply = <&pp1800>;
349         };
350
351         pp1800_pcie: pp1800-pcie {
352                 compatible = "regulator-fixed";
353                 regulator-name = "pp1800_pcie";
354                 pinctrl-names = "default";
355                 pinctrl-0 = <&wlan_module_pd_l>;
356
357                 regulator-always-on;                    // TODO: for bringup???
358                 regulator-boot-on;                      // TODO: for bringup???
359                 enable-active-high;
360                 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
361
362                 vin-supply = <&pp1800>;
363         };
364
365         /* pp3000 aliases; these are always on for AP so just use alias */
366
367         /* Always on; plain and simple */
368         pp3000_ap: pp3000_emmc: pp3000 {
369         };
370
371         /* pp3000 children */
372
373         pp3000_sd_slot: pp3000-sd-slot {
374                 compatible = "regulator-fixed";
375                 regulator-name = "pp3000_sd_slot";
376                 pinctrl-names = "default";
377                 pinctrl-0 = <&sd_slot_pwr_en>;
378
379 //              regulator-always-on;    // TODO: for bringup???
380 //              regulator-boot-on;      // TODO: for bringup???
381
382                 enable-active-high;
383                 gpio = <&gpio4 29 GPIO_ACTIVE_HIGH>;
384
385                 vin-supply = <&pp3000>;
386         };
387
388         ppvar_sd_card_io: ppvar-sd-card-io {
389                 compatible = "regulator-gpio";
390                 regulator-name = "ppvar_sd_card_io";
391                 pinctrl-names = "default";
392                 pinctrl-0 = <&sd_io_pwr_en &sd_pwr_1800_sel>;
393
394 //              regulator-always-on;    // TODO: for bringup???
395 //              regulator-boot-on;      // TODO: for bringup???
396
397                 enable-active-high;
398                 enable-gpio = <&gpio2 2 GPIO_ACTIVE_HIGH>;
399                 gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>;
400                 states = <1800000 0x1
401                           3000000 0x0>;
402
403                 regulator-min-microvolt = <1800000>;
404                 regulator-max-microvolt = <3000000>;
405
406                 // TODO: add support in driver for input supplies.
407                 // ...and specify pp3000 and pp1800.
408         };
409
410         /* pp3300 aliases; these are always on for AP so just use alias */
411
412         /* EC turns on w/ pp3300_trackpad_en_l */
413         pp3300_trackpad: pp3300-trackpad {
414         };
415
416         /* EC turns on w/ pp3300_usb_en_l */
417         pp3300_usb: pp3300 {
418         };
419
420         /* pp3300 children */
421
422         pp3300_disp: pp3300-disp {
423                 compatible = "regulator-fixed";
424                 regulator-name = "pp3300_disp";
425                 pinctrl-names = "default";
426                 pinctrl-0 = <&pp3300_disp_en>;
427
428                 enable-active-high;
429                 gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>;
430
431                 vin-supply = <&pp3300>;
432         };
433
434         pp3300_wifi_bt:pp3300-wifi-bt {
435                 compatible = "regulator-fixed";
436                 regulator-name = "pp3300_wifi_bt";
437                 /* NOTE: wlan_module_pd_l pinctrl in pp1800_pcie */
438
439                 regulator-always-on;                    // TODO: for bringup???
440                 regulator-boot-on;                      // TODO: for bringup???
441                 enable-active-high;
442
443                 // TODO: I _think_ it's OK to specify the same GPIO in two
444                 // regulator-fixed regulators.  See pp1800_pcie
445                 gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
446
447                 vin-supply = <&pp3300>;
448         };
449
450
451         /* END REGULATORS */
452
453         io-domains {
454                 compatible = "rockchip,rk3399-io-voltage-domain";
455                 rockchip,grf = <&grf>;
456
457                 bt656-supply = <&pp1800_ap_io>;         /* APIO2_VDD;  2a 2b */
458                 audio-supply = <&pp1800_audio>;         /* APIO5_VDD;  3d 4a */
459                 sdmmc-supply = <&ppvar_sd_card_io>;     /* SDMMC0_VDD; 4b    */
460                 gpio1830-supply = <&pp3000_ap>;         /* APIO4_VDD;  4c 4d */
461         };
462
463         pmu-io-domains {
464                 compatible = "rockchip,rk3399-pmu-io-voltage-domain";
465                 rockchip,grf = <&pmugrf>;
466
467                 pmu1830-supply = <&pp1800_pmu>;         /* PMUIO2_VDD */
468         };
469 };
470
471 &cpu_l0 {
472         cpu-supply = <&ppvar_litcpu>;
473 };
474
475 &cpu_l1 {
476         cpu-supply = <&ppvar_litcpu>;
477 };
478
479 &cpu_l2 {
480         cpu-supply = <&ppvar_litcpu>;
481 };
482
483 &cpu_l3 {
484         cpu-supply = <&ppvar_litcpu>;
485 };
486
487 &cpu_b0 {
488         cpu-supply = <&ppvar_bigcpu>;
489 };
490
491 &cpu_b1 {
492         cpu-supply = <&ppvar_bigcpu>;
493 };
494
495 &emmc_phy {
496         status = "okay";
497 };
498
499 ap_i2c_mic: &i2c1 {
500         status = "okay";
501
502         // TODO: bus speed
503         //       ...with no speed, it should just use 100kHz
504         // TODO: rise / fall times?
505
506         // TODO: This is in mainline, but not the Rockchip private kernel
507         // TODO: Need to hook this into the rest of audio stuff...
508
509         // TODO: any pinctrl needed for this codec???
510         headsetcodec: rt5514@57 {
511                 compatible = "realtek,rt5514";
512                 reg = <0x57>;
513                 pinctrl-names = "default";
514                 pinctrl-0 = <&mic_int>;
515
516                 /*
517                  * NOTE: Interrupts aren't part of the binding and driver
518                  * doesn't support it, but throw it in anyway.
519                  */
520                 interrupt-parent = <&gpio1>;
521                 interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
522         };
523 };
524
525 ap_i2c_ts: &i2c3 {
526         status = "okay";
527
528         // TODO: bus speed
529         //       ...with no speed, it should just use 100kHz
530         // TODO: rise / fall times?
531
532         // TODO: Add the proper touchscreen reference...
533
534
535         // TODO: Might need to go in sub boards????
536 };
537
538 ap_i2c_tp: &i2c5 {
539         /*
540          * Note strange pullup enable.  Apparently this avoids leakage but
541          * still allows us to get nice 4.7K pullups for high speed i2c
542          * transfers.  Basically we want the pullup on whenever the ap is
543          * alive, so the "en" pin just gets set to output high.
544          */
545         pinctrl-0 = <&i2c5_xfer &ap_i2c_tp_pu_en>;
546
547         status = "okay";
548
549         // TODO: bus speed
550         //       ...with no speed, it should just use 100kHz
551         // TODO: rise / fall times?
552
553         // TODO: Add the proper touchpanel reference...
554 };
555
556 ap_i2c_audio: &i2c8 {
557         status = "okay";
558
559         // TODO: bus speed
560         //       ...with no speed, it should just use 100kHz
561         // TODO: rise / fall times?
562         // ...on gru-gru this is on a sub board, so expect bad rise/fall times
563
564         // TODO: copied from sample.  Double-check...
565         codec: da7219@1a {
566                 compatible = "dlg,da7219";
567                 reg = <0x1a>;
568                 pinctrl-names = "default";
569                 pinctrl-0 = <&headset_int_l>;
570
571                 interrupt-parent = <&gpio1>;
572                 interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
573
574                 VDD-supply = <&pp1800>;
575                 VDDMIC-supply = <&pp3300>;
576                 VDDIO-supply = <&pp1800>;
577
578                 // TODO: I THINK this is right, but it's a bit of a guess.
579                 clocks = <&cru SCLK_I2S_8CH_OUT>;
580                 clock-names = "mclk";
581
582 // Below is from bindings; we need to adjust for our SoC / board.
583 //              dlg,ldo-lvl = <1200>;
584 //              dlg,micbias-lvl = <2600>;
585 //              dlg,mic-amp-in-sel = "diff";
586 //
587 //              da7219_aad {
588 //                      dlg,btn-cfg = <50>;
589 //                      dlg,mic-det-thr = <500>;
590 //                      dlg,jack-ins-deb = <20>;
591 //                      dlg,jack-det-rate = "32ms_64ms";
592 //                      dlg,jack-rem-deb = <1>;
593 //
594 //                      dlg,a-d-btn-thr = <0xa>;
595 //                      dlg,d-b-btn-thr = <0x16>;
596 //                      dlg,b-c-btn-thr = <0x21>;
597 //                      dlg,c-mic-btn-thr = <0x3E>;
598 //
599 //                      dlg,btn-avg = <4>;
600 //                      dlg,adc-1bit-rpt = <1>;
601 //              };
602         };
603 };
604
605 &i2s0 {
606         status = "okay";
607 };
608
609 &pwm0 {
610         status = "okay";
611 };
612
613 &pwm1 {
614         status = "okay";
615 };
616
617 &pwm2 {
618         status = "okay";
619 };
620
621 &pwm3 {
622         status = "okay";
623 };
624
625 &sdhci {
626         status = "okay";
627
628         // HACK: supports-emmc is not mainline.
629         supports-emmc;
630
631         // HACK: limit to 50MHz to avoid tuning during bringup.
632         max-frequency = <50000000>;
633
634         // TODO: add caps?
635         //cap-mmc-highspeed;
636         //mmc-hs200-1_8v;
637         //mmc-hs400-1_8v;
638
639         bus-width = <8>;
640         non-removable;
641
642         vmmc-supply = <&pp3000>;
643         vqmmc-supply = <&pp1800_emmc>;
644 };
645
646 &sdmmc {
647         status = "okay";
648
649         /*
650          * Note: configure "sdmmc_cd" as card detect even though it's actually
651          * hooked to ground.  Because we specified "cd-gpios" below dw_mmc
652          * should be ignoring card detect anyway.  Specifying the pin as
653          * sdmmc_cd means that even if you've got GRF_SOC_CON7[12] (force_jtag)
654          * turned on that the system will still make sure the port is
655          * configured as SDMMC and not JTAG.
656          */
657         pinctrl-names = "default";
658         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_cd_gpio
659                      &sdmmc_bus4>;
660
661         // HACK: supports-sd is not in mainline.
662         supports-sd;
663
664         // HACK: Limit freq for now
665         // ...as of 160330 confirmed that things break if you remove this.
666         clock-frequency = <37500000>;
667         clock-freq-min-max = <400000 37500000>;
668
669         bus-width = <4>;
670         cd-gpios = <&gpio4 26 GPIO_ACTIVE_LOW>;
671         disable-wp;
672         rockchip,default-sample-phase = <90>;
673
674         cap-mmc-highspeed;
675         cap-sd-highspeed;
676
677         // TODO: enable once tested...
678         //sd-uhs-sdr12;
679         //sd-uhs-sdr25;
680         //sd-uhs-sdr50;
681         //sd-uhs-sdr104;
682
683         // Comment out until we turn on gpio-regulator config
684         vmmc-supply = <&pp3000_sd_slot>;
685         vqmmc-supply = <&ppvar_sd_card_io>;
686 };
687
688 &spi0 {
689         status = "okay";
690
691         // TODO: more properly.  Hacky spidev for now???
692         // A few notes:
693         // - We either have a Haven here or a Infineon SLB9670.  The SLB9670
694         //   is supposed to be a fallback if Haven is broken.
695         // - Either TPM is supposed to be TPM 2.0 hooked up to SPI.  I see some
696         //   kernel support for TPM 2.0 on x86 (hooked up with ACPI) but no
697         //   generic way to say "we have a SPI TPM 2.0".  We'll need to add
698         //   a driver for whichever way we go.
699         // - wfrichar@ says that for Haven if it has gone to sleep we might
700         //   need to add a delay after asserting chip select.  Presumably
701         //   haven-specific driver will need to handle this logic (keeping
702         //   track when we last talked and adding an extra delay if it's been
703         //   a while).
704         tpm@0 {
705                 compatible = "spidev";
706                 // TODO: can run faster once verified.
707                 // TODO: add rx-sample-delay-ns.
708                 spi-max-frequency = <10000000>;
709                 reg = <0>;
710         };
711 };
712
713 &spi1 {
714         status = "okay";
715
716         // TODO: Ideally we want to use MTD for this, but presumably
717         // we'll wait until we can test it and also bring it up in our
718         // kernel tree.
719         spiflash@0 {
720                 compatible = "spidev";
721                 // TODO: can run faster once verified.
722                 // TODO: add rx-sample-delay-ns.
723                 spi-max-frequency = <10000000>;
724                 reg = <0>;
725         };
726 };
727
728 &spi2 {
729         status = "okay";
730
731         // TODO: more properly.  Hacky spidev for now???
732         wacky_spi_audio@0 {
733                 compatible = "spidev";
734
735                 // TODO: can run faster once verified.
736                 // TODO: add rx-sample-delay-ns.
737                 spi-max-frequency = <10000000>;
738                 reg = <0>;
739         };
740 };
741
742 &spi5 {
743         status = "okay";
744
745         cros_ec: ec@0 {
746                 compatible = "google,cros-ec-spi";
747                 reg = <0>;
748                 pinctrl-names = "default";
749                 pinctrl-0 = <&ec_ap_int_l>;
750
751                 google,cros-ec-spi-pre-delay = <30>;    // TODO: check
752                 interrupt-parent = <&gpio0>;
753                 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
754                 spi-max-frequency = <3000000>;          // TODO: check; TODO: rx-sample-delay-ns?
755
756                 i2c_tunnel: i2c-tunnel {
757                         compatible = "google,cros-ec-i2c-tunnel";
758                         google,remote-bus = <0>;
759                         #address-cells = <1>;
760                         #size-cells = <0>;
761                 };
762         };
763 };
764
765 // TODO:
766 // - double-check that hw-tshut-mode is same as EVB
767 // - double check that hw-tshut-polarity is the same as EVB
768 &tsadc {
769         status = "okay";
770
771         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
772         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
773 };
774
775 &uart2 {
776         status = "okay";
777 };
778
779 &usb_host0_echi {
780         status = "okay";
781 };
782
783 &usb_host0_ohci {
784         status = "okay";
785 };
786
787 &usb_host1_echi {
788         status = "okay";
789 };
790
791 &usb_host1_ohci {
792         status = "okay";
793 };
794
795 &usbdrd3_0 {
796         status = "okay";
797 };
798
799 &usbdrd_dwc3_0 {
800         status = "okay";
801         dr_mode = "host";       // TODO: needed?
802 };
803
804 &usbdrd3_1 {
805         status = "okay";
806 };
807
808 &usbdrd_dwc3_1 {
809         status = "okay";
810         dr_mode = "host";       // TODO: needed?
811 };
812
813 &edp {
814         status = "okay";
815 };
816
817 &vopb {
818         status = "okay";
819 };
820
821 &vopb_mmu {
822         status = "okay";
823 };
824
825 &vopl {
826         status = "okay";
827 };
828
829 &vopl_mmu {
830         status = "okay";
831 };
832
833 &display_subsystem {
834         status = "okay";
835 };
836
837 /* PINCTRL: always below everything else */
838
839 &pinctrl {
840         pcfg_output_high: pcfg-output-high {
841                 output-high;
842         };
843
844         cros-ec {
845                 ec_ap_int_l: ec-ap-int-l {
846                         rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
847                 };
848         };
849
850         discrete-regulators {
851                 pp1500_en: pp1500-en {
852                         rockchip,pins = <RK_GPIO1 11 RK_FUNC_GPIO
853                                          &pcfg_pull_none>;
854                 };
855
856                 pp1800_audio_en: pp1800-audio-en {
857                         rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO
858                                          &pcfg_pull_none>;
859                 };
860
861                 pp3300_disp_en: pp3300-disp-en {
862                         rockchip,pins = <RK_GPIO4 27 RK_FUNC_GPIO
863                                          &pcfg_pull_none>;
864                 };
865
866                 pp3000_en: pp3000-en {
867                         rockchip,pins = <RK_GPIO1 12 RK_FUNC_GPIO
868                                          &pcfg_pull_none>;
869                 };
870
871                 sd_io_pwr_en: sd-io-pwr-en {
872                         rockchip,pins = <RK_GPIO2 2 RK_FUNC_GPIO
873                                          &pcfg_pull_none>;
874                 };
875
876                 sd_pwr_1800_sel: sd-pwr-1800-sel {
877                         rockchip,pins = <RK_GPIO2 28 RK_FUNC_GPIO
878                                          &pcfg_pull_none>;
879                 };
880
881                 sd_slot_pwr_en: sd-slot-pwr-en {
882                         rockchip,pins = <RK_GPIO4 29 RK_FUNC_GPIO
883                                          &pcfg_pull_none>;
884                 };
885
886                 wlan_module_pd_l: wlan-module-pd-l {
887                         rockchip,pins = <RK_GPIO0 8 RK_FUNC_GPIO
888                                          &pcfg_pull_none>;
889                 };
890         };
891
892         codec {
893                 /* Has external pullup */
894                 headset_int_l: headset-int-l {
895                         rockchip,pins = <1 23 RK_FUNC_GPIO &pcfg_pull_none>;
896                 };
897
898                 // TODO: check pull.  From signal name assume active high.
899                 mic_int: mic-int {
900                         rockchip,pins = <1 13 RK_FUNC_GPIO &pcfg_pull_down>;
901                 };
902         };
903
904         sdmmc {
905                 /*
906                  * We have external pulls on SDMMC, so diable internals
907                  *
908                  * TODO:
909                  * - On veyron we found that we needed to drive at 8mA.  Do we
910                  *   need to that here?  If so, 8mA or 12mA?
911                  */
912                 sdmmc_bus4: sdmmc-bus4 {
913                         rockchip,pins =
914                                 <4 8 RK_FUNC_1 &pcfg_pull_none>,
915                                 <4 9 RK_FUNC_1 &pcfg_pull_none>,
916                                 <4 10 RK_FUNC_1 &pcfg_pull_none>,
917                                 <4 11 RK_FUNC_1 &pcfg_pull_none>;
918                 };
919
920                 sdmmc_clk: sdmmc-clk {
921                         rockchip,pins =
922                                 <4 12 RK_FUNC_1 &pcfg_pull_none>;
923                 };
924
925                 sdmmc_cmd: sdmmc-cmd {
926                         rockchip,pins =
927                                 <4 13 RK_FUNC_1 &pcfg_pull_none>;
928                 };
929
930                 /*
931                  * In our case the official card detect is hooked to ground
932                  * to avoid getting access to JTAG just by sticking something
933                  * in the SD card slot (see the force_jtag bit in the TRM).
934                  *
935                  * We still configure it as card detect because it doesn't
936                  * hurt and dw_mmc will ignore it.  We make sure to disable
937                  * the pull though so we don't burn needless power.
938                  */
939                 sdmmc_cd: sdmcc-cd {
940                         rockchip,pins =
941                                 <0 7 RK_FUNC_1 &pcfg_pull_none>;
942                 };
943
944                 /* This is where we actually hook up CD; has external pull */
945                 sdmmc_cd_gpio: sdmmc-cd-gpio {
946                         rockchip,pins = <4 26 RK_FUNC_GPIO &pcfg_pull_none>;
947                 };
948         };
949
950         touchpanel {
951                 ap_i2c_tp_pu_en: ap-i2c-tp-pu-en {
952                         rockchip,pins = <3 12 RK_FUNC_GPIO &pcfg_output_high>;
953                 };
954         };
955 };
956
957 /* DON'T PUT ANYTHING BELOW HERE.  PUT IT ABOVE PINCTRL */
958 /* DON'T PUT ANYTHING BELOW HERE.  PUT IT ABOVE PINCTRL */
959 /* DON'T PUT ANYTHING BELOW HERE.  PUT IT ABOVE PINCTRL */
960