Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3288-miqi.dts
1 /*
2  * Copyright (c) 2016 Heiko Stuebner <heiko@sntech.de>
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 #include <dt-bindings/input/input.h>
45 #include "rk3288.dtsi"
46
47 / {
48         model = "mqmaker MiQi";
49         compatible = "mqmaker,miqi", "rockchip,rk3288";
50
51         chosen {
52                 stdout-path = "serial2:115200n8";
53         };
54
55         memory@0 {
56                 device_type = "memory";
57                 reg = <0 0x80000000>;
58         };
59
60         ext_gmac: external-gmac-clock {
61                 compatible = "fixed-clock";
62                 #clock-cells = <0>;
63                 clock-frequency = <125000000>;
64                 clock-output-names = "ext_gmac";
65         };
66
67         leds {
68                 compatible = "gpio-leds";
69
70                 work {
71                         gpios = <&gpio7 RK_PA2 GPIO_ACTIVE_HIGH>;
72                         label = "miqi:green:user";
73                         linux,default-trigger = "timer";
74                 };
75         };
76
77         vcc_flash: flash-regulator {
78                 compatible = "regulator-fixed";
79                 regulator-name = "vcc_flash";
80                 regulator-min-microvolt = <1800000>;
81                 regulator-max-microvolt = <1800000>;
82                 vin-supply = <&vcc_io>;
83         };
84
85         vcc_host: usb-host-regulator {
86                 compatible = "regulator-fixed";
87                 enable-active-high;
88                 gpio = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
89                 pinctrl-names = "default";
90                 pinctrl-0 = <&host_vbus_drv>;
91                 regulator-name = "vcc_host";
92                 regulator-min-microvolt = <5000000>;
93                 regulator-max-microvolt = <5000000>;
94                 regulator-always-on;
95                 vin-supply = <&vcc_sys>;
96         };
97
98         vcc_sd: sdmmc-regulator {
99                 compatible = "regulator-fixed";
100                 gpio = <&gpio7 RK_PB3 GPIO_ACTIVE_LOW>;
101                 pinctrl-names = "default";
102                 pinctrl-0 = <&sdmmc_pwr>;
103                 regulator-name = "vcc_sd";
104                 regulator-min-microvolt = <3300000>;
105                 regulator-max-microvolt = <3300000>;
106                 startup-delay-us = <100000>;
107                 vin-supply = <&vcc_io>;
108         };
109
110         vcc_sys: vsys-regulator {
111                 compatible = "regulator-fixed";
112                 regulator-name = "vcc_sys";
113                 regulator-min-microvolt = <5000000>;
114                 regulator-max-microvolt = <5000000>;
115                 regulator-always-on;
116                 regulator-boot-on;
117         };
118 };
119
120 &cpu0 {
121         cpu0-supply = <&vdd_cpu>;
122 };
123
124 &emmc {
125         bus-width = <8>;
126         cap-mmc-highspeed;
127         disable-wp;
128         non-removable;
129         num-slots = <1>;
130         pinctrl-names = "default";
131         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
132         vmmc-supply = <&vcc_io>;
133         vqmmc-supply = <&vcc_flash>;
134         status = "okay";
135 };
136
137 &gmac {
138         assigned-clocks = <&cru SCLK_MAC>;
139         assigned-clock-parents = <&ext_gmac>;
140         clock_in_out = "input";
141         pinctrl-names = "default";
142         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
143         phy-supply = <&vcc_lan>;
144         phy-mode = "rgmii";
145         snps,reset-active-low;
146         snps,reset-delays-us = <0 10000 1000000>;
147         snps,reset-gpio = <&gpio4 RK_PB0 GPIO_ACTIVE_LOW>;
148         tx_delay = <0x30>;
149         rx_delay = <0x10>;
150         status = "ok";
151 };
152
153 &hdmi {
154         ddc-i2c-bus = <&i2c5>;
155         status = "okay";
156 };
157
158 &i2c0 {
159         clock-frequency = <400000>;
160         status = "okay";
161
162         vdd_cpu: syr827@40 {
163                 compatible = "silergy,syr827";
164                 fcs,suspend-voltage-selector = <1>;
165                 reg = <0x40>;
166                 regulator-name = "vdd_cpu";
167                 regulator-min-microvolt = <850000>;
168                 regulator-max-microvolt = <1350000>;
169                 regulator-always-on;
170                 regulator-boot-on;
171                 regulator-enable-ramp-delay = <300>;
172                 regulator-ramp-delay = <8000>;
173                 vin-supply = <&vcc_sys>;
174         };
175
176         vdd_gpu: syr828@41 {
177                 compatible = "silergy,syr828";
178                 fcs,suspend-voltage-selector = <1>;
179                 reg = <0x41>;
180                 regulator-name = "vdd_gpu";
181                 regulator-min-microvolt = <850000>;
182                 regulator-max-microvolt = <1350000>;
183                 regulator-always-on;
184                 vin-supply = <&vcc_sys>;
185         };
186
187         hym8563: hym8563@51 {
188                 compatible = "haoyu,hym8563";
189                 reg = <0x51>;
190                 #clock-cells = <0>;
191                 clock-frequency = <32768>;
192                 clock-output-names = "xin32k";
193         };
194
195         act8846: act8846@5a {
196                 compatible = "active-semi,act8846";
197                 reg = <0x5a>;
198                 pinctrl-names = "default";
199                 pinctrl-0 = <&pmic_vsel>;
200                 system-power-controller;
201
202                 vp1-supply = <&vcc_sys>;
203                 vp2-supply = <&vcc_sys>;
204                 vp3-supply = <&vcc_sys>;
205                 vp4-supply = <&vcc_sys>;
206                 inl1-supply = <&vcc_sys>;
207                 inl2-supply = <&vcc_sys>;
208                 inl3-supply = <&vcc_20>;
209
210                 regulators {
211                         vcc_ddr: REG1 {
212                                 regulator-name = "vcc_ddr";
213                                 regulator-always-on;
214                         };
215
216                         vcc_io: REG2 {
217                                 regulator-name = "vcc_io";
218                                 regulator-min-microvolt = <3300000>;
219                                 regulator-max-microvolt = <3300000>;
220                                 regulator-always-on;
221                         };
222
223                         vdd_log: REG3 {
224                                 regulator-name = "vdd_log";
225                                 regulator-min-microvolt = <1100000>;
226                                 regulator-max-microvolt = <1100000>;
227                                 regulator-always-on;
228                         };
229
230                         vcc_20: REG4 {
231                                 regulator-name = "vcc_20";
232                                 regulator-min-microvolt = <2000000>;
233                                 regulator-max-microvolt = <2000000>;
234                                 regulator-always-on;
235                         };
236
237                         vccio_sd: REG5 {
238                                 regulator-name = "vccio_sd";
239                                 regulator-min-microvolt = <3300000>;
240                                 regulator-max-microvolt = <3300000>;
241                                 regulator-always-on;
242                         };
243
244                         vdd10_lcd: REG6 {
245                                 regulator-name = "vdd10_lcd";
246                                 regulator-min-microvolt = <1000000>;
247                                 regulator-max-microvolt = <1000000>;
248                                 regulator-always-on;
249                         };
250
251                         vcca_18: REG7 {
252                                 regulator-name = "vcca_18";
253                                 regulator-min-microvolt = <1800000>;
254                                 regulator-max-microvolt = <1800000>;
255                         };
256
257                         vcca_33: REG8 {
258                                 regulator-name = "vcca_33";
259                                 regulator-min-microvolt = <3300000>;
260                                 regulator-max-microvolt = <3300000>;
261                         };
262
263                         vcc_lan: REG9 {
264                                 regulator-name = "vcc_lan";
265                                 regulator-min-microvolt = <3300000>;
266                                 regulator-max-microvolt = <3300000>;
267                         };
268
269                         vdd_10: REG10 {
270                                 regulator-name = "vdd_10";
271                                 regulator-min-microvolt = <1000000>;
272                                 regulator-max-microvolt = <1000000>;
273                                 regulator-always-on;
274                         };
275
276                         vcc_18: REG11 {
277                                 regulator-name = "vcc_18";
278                                 regulator-min-microvolt = <1800000>;
279                                 regulator-max-microvolt = <1800000>;
280                                 regulator-always-on;
281                         };
282
283                         vcc18_lcd: REG12 {
284                                 regulator-name = "vcc18_lcd";
285                                 regulator-min-microvolt = <1800000>;
286                                 regulator-max-microvolt = <1800000>;
287                                 regulator-always-on;
288                         };
289                 };
290         };
291 };
292
293 &i2c1 {
294         status = "okay";
295 };
296
297 &i2c2 {
298         status = "okay";
299 };
300
301 &i2c4 {
302         status = "okay";
303 };
304
305 &i2c5 {
306         status = "okay";
307 };
308
309 &io_domains {
310         status = "okay";
311
312         audio-supply = <&vcca_33>;
313         flash0-supply = <&vcc_flash>;
314         flash1-supply = <&vcc_lan>;
315         gpio30-supply = <&vcc_io>;
316         gpio1830-supply = <&vcc_io>;
317         lcdc-supply = <&vcc_io>;
318         sdcard-supply = <&vccio_sd>;
319         wifi-supply = <&vcc_18>;
320 };
321
322 &pinctrl {
323         pcfg_output_high: pcfg-output-high {
324                 output-high;
325         };
326
327         pcfg_output_low: pcfg-output-low {
328                 output-low;
329         };
330
331         pcfg_pull_up_drv_12ma: pcfg-pull-up-drv-12ma {
332                 bias-pull-up;
333                 drive-strength = <12>;
334         };
335
336         act8846 {
337                 pmic_int: pmic-int {
338                         rockchip,pins = <0 4 RK_FUNC_GPIO &pcfg_pull_up>;
339                 };
340
341                 pmic_sleep: pmic-sleep {
342                         rockchip,pins = <0 0 RK_FUNC_GPIO &pcfg_output_low>;
343                 };
344
345                 pmic_vsel: pmic-vsel {
346                         rockchip,pins = <7 1 RK_FUNC_GPIO &pcfg_output_low>;
347                 };
348         };
349
350         gmac {
351                 phy_int: phy-int {
352                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
353                 };
354
355                 phy_pmeb: phy-pmeb {
356                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
357                 };
358
359                 phy_rst: phy-rst {
360                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
361                 };
362         };
363
364         sdmmc {
365                 /*
366                  * Default drive strength isn't enough to achieve even
367                  * high-speed mode on firefly board so bump up to 12ma.
368                  */
369                 sdmmc_bus4: sdmmc-bus4 {
370                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_12ma>,
371                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_12ma>,
372                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_12ma>,
373                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_12ma>;
374                 };
375
376                 sdmmc_clk: sdmmc-clk {
377                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_12ma>;
378                 };
379
380                 sdmmc_cmd: sdmmc-cmd {
381                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_12ma>;
382                 };
383
384                 sdmmc_pwr: sdmmc-pwr {
385                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
386                 };
387         };
388
389         usb_host {
390                 host_vbus_drv: host-vbus-drv {
391                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
392                 };
393         };
394 };
395
396 &saradc {
397         vref-supply = <&vcc_18>;
398         status = "okay";
399 };
400
401 &sdmmc {
402         bus-width = <4>;
403         cap-mmc-highspeed;
404         cap-sd-highspeed;
405         card-detect-delay = <200>;
406         disable-wp;
407         num-slots = <1>;
408         pinctrl-names = "default";
409         pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
410         vmmc-supply = <&vcc_sd>;
411         vqmmc-supply = <&vccio_sd>;
412         status = "okay";
413 };
414
415 &tsadc {
416         rockchip,hw-tshut-mode = <0>;
417         rockchip,hw-tshut-polarity = <0>;
418         status = "okay";
419 };
420
421 &uart2 {
422         status = "okay";
423 };
424
425 &uart3 {
426         status = "okay";
427 };
428
429 &usbphy {
430         status = "okay";
431 };
432
433 &usb_host1 {
434         status = "okay";
435 };
436
437 &usb_otg {
438         /*
439          * The otg controller is the only system power source,
440          * so needs to always stay in device mode.
441          */
442         dr_mode = "peripheral";
443         status = "okay";
444 };
445
446 &vopb {
447         status = "okay";
448 };
449
450 &vopb_mmu {
451         status = "okay";
452 };
453
454 &vopl {
455         status = "okay";
456 };
457
458 &vopl_mmu {
459         status = "okay";
460 };
461
462 &wdt {
463         status = "okay";
464 };