Merge tag 'lsk-v4.4-16.06-android'
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-popmetal.dts
1 /*
2  * Copyright (c) 2014, 2015 Andy Yan <andy.yan@rock-chips.com>
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 /dts-v1/;
44
45 #include "rk3288.dtsi"
46
47 / {
48         model = "PopMetal-RK3288";
49         compatible = "chipspark,popmetal-rk3288", "rockchip,rk3288";
50
51         memory{
52                 device_type = "memory";
53                 reg = <0 0x80000000>;
54         };
55
56         ext_gmac: external-gmac-clock {
57                 compatible = "fixed-clock";
58                 clock-frequency = <125000000>;
59                 clock-output-names = "ext_gmac";
60                 #clock-cells = <0>;
61         };
62
63         gpio-keys {
64                 compatible = "gpio-keys";
65                 #address-cells = <1>;
66                 #size-cells = <0>;
67                 autorepeat;
68
69                 pinctrl-names = "default";
70                 pinctrl-0 = <&pwrbtn>;
71
72                 button@0 {
73                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
74                         linux,code = <116>;
75                         label = "GPIO Key Power";
76                         linux,input-type = <1>;
77                         gpio-key,wakeup = <1>;
78                         debounce-interval = <100>;
79                 };
80         };
81
82         io_domains: io-domains {
83                 compatible = "rockchip,rk3288-io-voltage-domain";
84                 rockchip,grf = <&grf>;
85
86                 audio-supply = <&vcca_33>;
87                 bb-supply = <&vcc_io>;
88                 dvp-supply = <&vcc18_dvp>;
89                 flash0-supply = <&vcc_flash>;
90                 flash1-supply = <&vcc_lan>;
91                 gpio30-supply = <&vcc_io>;
92                 gpio1830-supply = <&vcc_io>;
93                 lcdc-supply = <&vcc_io>;
94                 sdcard-supply = <&vccio_sd>;
95                 wifi-supply = <&vccio_wl>;
96         };
97
98         ir: ir-receiver {
99                 compatible = "gpio-ir-receiver";
100                 gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
101                 pinctrl-names = "default";
102                 pinctrl-0 = <&ir_int>;
103         };
104
105         vcc_flash: flash-regulator {
106                 compatible = "regulator-fixed";
107                 regulator-name = "vcc_flash";
108                 regulator-min-microvolt = <1800000>;
109                 regulator-max-microvolt = <1800000>;
110                 vin-supply = <&vcc_io>;
111         };
112
113         vcc_sd: sdmmc-regulator {
114                 compatible = "regulator-fixed";
115                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
116                 pinctrl-names = "default";
117                 pinctrl-0 = <&sdmmc_pwr>;
118                 regulator-name = "vcc_sd";
119                 regulator-min-microvolt = <3300000>;
120                 regulator-max-microvolt = <3300000>;
121                 startup-delay-us = <100000>;
122                 vin-supply = <&vcc_io>;
123         };
124
125         vcc_sys: vsys-regulator {
126                 compatible = "regulator-fixed";
127                 regulator-name = "vcc_sys";
128                 regulator-min-microvolt = <5000000>;
129                 regulator-max-microvolt = <5000000>;
130                 regulator-always-on;
131                 regulator-boot-on;
132         };
133
134         /*
135          * A PT5128 creates both dovdd_1v8 and vcc28_dvp, controlled
136          * by the dvp_pwr pin.
137          */
138         vcc18_dvp: vcc18-dvp-regulator {
139                 compatible = "regulator-fixed";
140                 regulator-name = "vcc18-dvp";
141                 regulator-min-microvolt = <1800000>;
142                 regulator-max-microvolt = <1800000>;
143                 vin-supply = <&vcc28_dvp>;
144         };
145
146         vcc28_dvp: vcc28-dvp-regulator {
147                 compatible = "regulator-fixed";
148                 enable-active-high;
149                 gpio = <&gpio0 17 GPIO_ACTIVE_HIGH>;
150                 pinctrl-names = "default";
151                 pinctrl-0 = <&dvp_pwr>;
152                 regulator-name = "vcc28_dvp";
153                 regulator-min-microvolt = <2800000>;
154                 regulator-max-microvolt = <2800000>;
155                 regulator-always-on;
156                 vin-supply = <&vcc_io>;
157         };
158 };
159
160 &cpu0 {
161         cpu0-supply = <&vdd_cpu>;
162 };
163
164 &emmc {
165         bus-width = <8>;
166         cap-mmc-highspeed;
167         disable-wp;
168         non-removable;
169         num-slots = <1>;
170         pinctrl-names = "default";
171         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
172         vmmc-supply = <&vcc_io>;
173         vqmmc-supply = <&vcc_flash>;
174         status = "okay";
175 };
176
177 &sdmmc {
178         bus-width = <4>;
179         cap-mmc-highspeed;
180         cap-sd-highspeed;
181         card-detect-delay = <200>;
182         disable-wp;                     /* wp not hooked up */
183         num-slots = <1>;
184         pinctrl-names = "default";
185         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
186         vmmc-supply = <&vcc_sd>;
187         vqmmc-supply = <&vccio_sd>;
188         status = "okay";
189 };
190
191 &gmac {
192         phy-supply = <&vcc_lan>;
193         phy-mode = "rgmii";
194         clock_in_out = "input";
195         snps,reset-gpio = <&gpio4 7 0>;
196         snps,reset-active-low;
197         snps,reset-delays-us = <0 10000 1000000>;
198         assigned-clocks = <&cru SCLK_MAC>;
199         assigned-clock-parents = <&ext_gmac>;
200         pinctrl-names = "default";
201         pinctrl-0 = <&rgmii_pins>;
202         tx_delay = <0x30>;
203         rx_delay = <0x10>;
204         status = "ok";
205 };
206
207 &hdmi {
208         ddc-i2c-bus = <&i2c5>;
209         status = "okay";
210 };
211
212 &i2c0 {
213         status = "okay";
214         clock-frequency = <400000>;
215
216         rk808: pmic@1b {
217                 compatible = "rockchip,rk808";
218                 reg = <0x1b>;
219                 interrupt-parent = <&gpio0>;
220                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
221                 pinctrl-names = "default";
222                 pinctrl-0 = <&pmic_int &global_pwroff>;
223                 rockchip,system-power-controller;
224                 wakeup-source;
225                 #clock-cells = <1>;
226                 clock-output-names = "xin32k", "rk808-clkout2";
227
228                 vcc1-supply = <&vcc_sys>;
229                 vcc2-supply = <&vcc_sys>;
230                 vcc3-supply = <&vcc_sys>;
231                 vcc4-supply = <&vcc_sys>;
232                 vcc6-supply = <&vcc_sys>;
233                 vcc7-supply = <&vcc_sys>;
234                 vcc8-supply = <&vcc_18>;
235                 vcc9-supply = <&vcc_io>;
236                 vcc10-supply = <&vcc_io>;
237                 vcc11-supply = <&vcc_sys>;
238                 vcc12-supply = <&vcc_io>;
239                 vddio-supply = <&vcc_io>;
240
241                 regulators {
242                         vdd_cpu: DCDC_REG1 {
243                                 regulator-always-on;
244                                 regulator-boot-on;
245                                 regulator-min-microvolt = <750000>;
246                                 regulator-max-microvolt = <1350000>;
247                                 regulator-name = "vdd_arm";
248                                 regulator-state-mem {
249                                         regulator-off-in-suspend;
250                                 };
251                         };
252
253                         vdd_gpu: DCDC_REG2 {
254                                 regulator-always-on;
255                                 regulator-boot-on;
256                                 regulator-min-microvolt = <850000>;
257                                 regulator-max-microvolt = <1250000>;
258                                 regulator-name = "vdd_gpu";
259                                 regulator-state-mem {
260                                         regulator-on-in-suspend;
261                                         regulator-suspend-microvolt = <1000000>;
262                                 };
263                         };
264
265                         vcc_ddr: DCDC_REG3 {
266                                 regulator-always-on;
267                                 regulator-boot-on;
268                                 regulator-name = "vcc_ddr";
269                                 regulator-state-mem {
270                                         regulator-on-in-suspend;
271                                 };
272                         };
273
274                         vcc_io: DCDC_REG4 {
275                                 regulator-always-on;
276                                 regulator-boot-on;
277                                 regulator-min-microvolt = <3300000>;
278                                 regulator-max-microvolt = <3300000>;
279                                 regulator-name = "vcc_io";
280                                 regulator-state-mem {
281                                         regulator-on-in-suspend;
282                                         regulator-suspend-microvolt = <3300000>;
283                                 };
284                         };
285
286                         vcc_lan: LDO_REG1 {
287                                 regulator-always-on;
288                                 regulator-boot-on;
289                                 regulator-min-microvolt = <3300000>;
290                                 regulator-max-microvolt = <3300000>;
291                                 regulator-name = "vcc_lan";
292                                 regulator-state-mem {
293                                         regulator-on-in-suspend;
294                                         regulator-suspend-microvolt = <3300000>;
295                                 };
296                         };
297
298                         vccio_sd: LDO_REG2 {
299                                 regulator-always-on;
300                                 regulator-boot-on;
301                                 regulator-min-microvolt = <3300000>;
302                                 regulator-max-microvolt = <3300000>;
303                                 regulator-name = "vccio_sd";
304                                 regulator-state-mem {
305                                         regulator-off-in-suspend;
306                                 };
307                         };
308
309                         vdd_10: LDO_REG3 {
310                                 regulator-always-on;
311                                 regulator-boot-on;
312                                 regulator-min-microvolt = <1000000>;
313                                 regulator-max-microvolt = <1000000>;
314                                 regulator-name = "vdd_10";
315                                 regulator-state-mem {
316                                         regulator-on-in-suspend;
317                                         regulator-suspend-microvolt = <1000000>;
318                                 };
319                         };
320
321                         vcc18_lcd: LDO_REG4 {
322                                 regulator-always-on;
323                                 regulator-boot-on;
324                                 regulator-min-microvolt = <1800000>;
325                                 regulator-max-microvolt = <1800000>;
326                                 regulator-name = "vcc18_lcd";
327                                 regulator-state-mem {
328                                         regulator-on-in-suspend;
329                                         regulator-suspend-microvolt = <1800000>;
330                                 };
331                         };
332
333                         ldo5: LDO_REG5 {
334                                 regulator-always-on;
335                                 regulator-min-microvolt = <1800000>;
336                                 regulator-max-microvolt = <3300000>;
337                                 regulator-name = "ldo5";
338                         };
339
340                         vdd10_lcd: LDO_REG6 {
341                                 regulator-always-on;
342                                 regulator-boot-on;
343                                 regulator-min-microvolt = <1000000>;
344                                 regulator-max-microvolt = <1000000>;
345                                 regulator-name = "vdd10_lcd";
346                                 regulator-state-mem {
347                                         regulator-on-in-suspend;
348                                         regulator-suspend-microvolt = <1000000>;
349                                 };
350                         };
351
352                         vcc_18: LDO_REG7 {
353                                 regulator-always-on;
354                                 regulator-boot-on;
355                                 regulator-min-microvolt = <1800000>;
356                                 regulator-max-microvolt = <1800000>;
357                                 regulator-name = "vcc_18";
358                                 regulator-state-mem {
359                                         regulator-on-in-suspend;
360                                         regulator-suspend-microvolt = <1800000>;
361                                 };
362                         };
363
364                         vcca_33: LDO_REG8 {
365                                 regulator-always-on;
366                                 regulator-boot-on;
367                                 regulator-min-microvolt = <3300000>;
368                                 regulator-max-microvolt = <3300000>;
369                                 regulator-name = "vcca_33";
370                                 regulator-state-mem {
371                                         regulator-on-in-suspend;
372                                         regulator-suspend-microvolt = <3300000>;
373                                 };
374                         };
375
376                         vccio_wl: SWITCH_REG1 {
377                                 regulator-always-on;
378                                 regulator-boot-on;
379                                 regulator-name = "vccio_wl";
380                                 regulator-state-mem {
381                                         regulator-on-in-suspend;
382                                 };
383                         };
384
385                         vcc_lcd: SWITCH_REG2 {
386                                 regulator-always-on;
387                                 regulator-boot-on;
388                                 regulator-name = "vcc_lcd";
389                                 regulator-state-mem {
390                                         regulator-on-in-suspend;
391                                 };
392                         };
393                 };
394         };
395 };
396
397 &i2c1 {
398         status = "okay";
399         clock-frequency = <400000>;
400
401         ak8963: ak8963@0d {
402                 compatible = "asahi-kasei,ak8975";
403                 reg = <0x0d>;
404                 interrupt-parent = <&gpio8>;
405                 interrupts = <1 IRQ_TYPE_EDGE_RISING>;
406                 pinctrl-names = "default";
407                 pinctrl-0 = <&comp_int>;
408         };
409
410         l3g4200d: l3g4200d@68 {
411                 compatible = "st,l3g4200d-gyro";
412                 st,drdy-int-pin = <2>;
413                 reg = <0x6b>;
414         };
415
416         mma8452: mma8452@1d {
417                 compatible = "fsl,mma8452";
418                 reg = <0x1d>;
419                 interrupt-parent = <&gpio8>;
420                 interrupts = <0 IRQ_TYPE_EDGE_RISING>;
421                 pinctrl-names = "default";
422                 pinctrl-0 = <&gsensor_int>;
423         };
424 };
425
426 &i2c2 {
427         status = "okay";
428 };
429
430 &i2c3 {
431         status = "okay";
432 };
433
434 &i2c4 {
435         status = "okay";
436 };
437
438 &i2c5 {
439         status = "okay";
440 };
441
442 &pinctrl {
443         ak8963 {
444                 comp_int: comp-int {
445                         rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_up>;
446                 };
447         };
448
449         buttons {
450                 pwrbtn: pwrbtn {
451                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
452                 };
453         };
454
455         dvp {
456                 dvp_pwr: dvp-pwr {
457                         rockchip,pins = <0 17 RK_FUNC_GPIO &pcfg_pull_none>;
458                 };
459         };
460
461         ir {
462                 ir_int: ir-int {
463                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_up>;
464                 };
465         };
466
467         mma8452 {
468                 gsensor_int: gsensor-int {
469                         rockchip,pins = <8 0 RK_FUNC_GPIO &pcfg_pull_up>;
470                 };
471         };
472
473         pmic {
474                 pmic_int: pmic-int {
475                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
476                 };
477         };
478
479         sdmmc {
480                 sdmmc_pwr: sdmmc-pwr {
481                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
482                 };
483         };
484 };
485
486 &tsadc {
487         rockchip,hw-tshut-mode = <0>;
488         rockchip,hw-tshut-polarity = <0>;
489         status = "okay";
490 };
491
492 &vopb {
493         status = "okay";
494 };
495
496 &vopb_mmu {
497         status = "okay";
498 };
499
500 &vopl {
501         status = "okay";
502 };
503
504 &vopl_mmu {
505         status = "okay";
506 };
507
508 &uart0 {
509         status = "okay";
510 };
511
512 &uart1 {
513         status = "okay";
514 };
515
516 &uart2 {
517         status = "okay";
518 };
519
520 &uart3 {
521         status = "okay";
522 };
523
524 &uart4 {
525         status = "okay";
526 };
527
528 &usbphy {
529         status = "okay";
530 };