Merge branch 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / arm / boot / dts / sun9i-a80-optimus.dts
1 /*
2  * Copyright 2014 Chen-Yu Tsai
3  *
4  * Chen-Yu Tsai <wens@csie.org>
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 /dts-v1/;
46 #include "sun9i-a80.dtsi"
47
48 #include <dt-bindings/gpio/gpio.h>
49 #include <dt-bindings/pinctrl/sun4i-a10.h>
50
51 / {
52         model = "Merrii A80 Optimus Board";
53         compatible = "merrii,a80-optimus", "allwinner,sun9i-a80";
54
55         aliases {
56                 serial0 = &uart0;
57                 serial1 = &uart4;
58         };
59
60         chosen {
61                 stdout-path = "serial0:115200n8";
62         };
63
64         leds {
65                 compatible = "gpio-leds";
66                 pinctrl-names = "default";
67                 pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>;
68
69                 /* The LED names match those found on the board */
70
71                 led2 {
72                         label = "optimus:led2:usr";
73                         gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>;
74                 };
75
76                 led3 {
77                         label = "optimus:led3:usr";
78                         gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */
79                 };
80
81                 led4 {
82                         label = "optimus:led4:usr";
83                         gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>;
84                 };
85         };
86
87         reg_usb1_vbus: usb1-vbus {
88                 compatible = "regulator-fixed";
89                 pinctrl-names = "default";
90                 pinctrl-0 = <&usb1_vbus_pin_optimus>;
91                 regulator-name = "usb1-vbus";
92                 regulator-min-microvolt = <5000000>;
93                 regulator-max-microvolt = <5000000>;
94                 enable-active-high;
95                 gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
96         };
97
98         reg_usb3_vbus: usb3-vbus {
99                 compatible = "regulator-fixed";
100                 pinctrl-names = "default";
101                 pinctrl-0 = <&usb3_vbus_pin_optimus>;
102                 regulator-name = "usb3-vbus";
103                 regulator-min-microvolt = <5000000>;
104                 regulator-max-microvolt = <5000000>;
105                 enable-active-high;
106                 gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
107         };
108 };
109
110 &ehci0 {
111         status = "okay";
112 };
113
114 &ehci1 {
115         /* Enable if HSIC peripheral is connected */
116         status = "disabled";
117 };
118
119 &ehci2 {
120         status = "okay";
121 };
122
123 &mmc0 {
124         pinctrl-names = "default";
125         pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_optimus>;
126         vmmc-supply = <&reg_dcdc1>;
127         bus-width = <4>;
128         cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH8 */
129         cd-inverted;
130         status = "okay";
131 };
132
133 &mmc2 {
134         pinctrl-names = "default";
135         pinctrl-0 = <&mmc2_8bit_pins>;
136         vmmc-supply = <&reg_dcdc1>;
137         bus-width = <8>;
138         non-removable;
139         cap-mmc-hw-reset;
140         status = "okay";
141 };
142
143 &mmc2_8bit_pins {
144         /* Increase drive strength for DDR modes */
145         allwinner,drive = <SUN4I_PINCTRL_40_MA>;
146 };
147
148 &ohci0 {
149         status = "okay";
150 };
151
152 &ohci2 {
153         status = "okay";
154 };
155
156 &osc32k {
157         /* osc32k input is from AC100 */
158         clocks = <&ac100_rtc 0>;
159 };
160
161 &pio {
162         led_pins_optimus: led-pins@0 {
163                 allwinner,pins = "PH0", "PH1";
164                 allwinner,function = "gpio_out";
165                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
166                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
167         };
168
169         mmc0_cd_pin_optimus: mmc0_cd_pin@0 {
170                 allwinner,pins = "PH18";
171                 allwinner,function = "gpio_in";
172                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
173                 allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
174         };
175
176         usb1_vbus_pin_optimus: usb1_vbus_pin@1 {
177                 allwinner,pins = "PH4";
178                 allwinner,function = "gpio_out";
179                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
180                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
181         };
182
183         usb3_vbus_pin_optimus: usb3_vbus_pin@1 {
184                 allwinner,pins = "PH5";
185                 allwinner,function = "gpio_out";
186                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
187                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
188         };
189 };
190
191 &r_ir {
192         status = "okay";
193 };
194
195 &r_pio {
196         led_r_pins_optimus: led-pins@1 {
197                 allwinner,pins = "PM15";
198                 allwinner,function = "gpio_out";
199                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
200                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
201         };
202 };
203
204 &r_rsb {
205         status = "okay";
206
207         axp809: pmic@3a3 {
208                 reg = <0x3a3>;
209                 interrupt-parent = <&nmi_intc>;
210                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
211
212                 regulators {
213                         reg_aldo1: aldo1 {
214                                 /*
215                                  * TODO: This should be handled by the
216                                  * USB PHY driver.
217                                  */
218                                 regulator-always-on;
219                                 regulator-min-microvolt = <3000000>;
220                                 regulator-max-microvolt = <3000000>;
221                                 regulator-name = "vcc33-usbh";
222                         };
223
224                         reg_aldo2: aldo2 {
225                                 regulator-min-microvolt = <1800000>;
226                                 regulator-max-microvolt = <1800000>;
227                                 regulator-name = "vcc-pb-io-cam";
228                         };
229
230                         aldo3 {
231                                 /* unused */
232                         };
233
234                         reg_dc5ldo: dc5ldo {
235                                 regulator-always-on;
236                                 regulator-min-microvolt = <800000>;
237                                 regulator-max-microvolt = <1100000>;
238                                 regulator-name = "vdd-cpus-09-usbh";
239                         };
240
241                         reg_dcdc1: dcdc1 {
242                                 regulator-always-on;
243                                 regulator-min-microvolt = <3000000>;
244                                 regulator-max-microvolt = <3000000>;
245                                 regulator-name = "vcc-3v";
246                         };
247
248                         reg_dcdc2: dcdc2 {
249                                 regulator-min-microvolt = <800000>;
250                                 regulator-max-microvolt = <1100000>;
251                                 regulator-name = "vdd-gpu";
252                         };
253
254                         reg_dcdc3: dcdc3 {
255                                 regulator-always-on;
256                                 regulator-min-microvolt = <800000>;
257                                 regulator-max-microvolt = <1100000>;
258                                 regulator-name = "vdd-cpua";
259                         };
260
261                         reg_dcdc4: dcdc4 {
262                                 regulator-always-on;
263                                 regulator-min-microvolt = <800000>;
264                                 regulator-max-microvolt = <1100000>;
265                                 regulator-name = "vdd-sys-usb0-hdmi";
266                         };
267
268                         reg_dcdc5: dcdc5 {
269                                 regulator-always-on;
270                                 regulator-min-microvolt = <1425000>;
271                                 regulator-max-microvolt = <1575000>;
272                                 regulator-name = "vcc-dram";
273                         };
274
275                         reg_dldo1: dldo1 {
276                                 /*
277                                  * The WiFi chip supports a wide range
278                                  * (3.0 ~ 4.8V) of voltages, and so does
279                                  * this regulator (3.0 ~ 4.2V), but
280                                  * Allwinner SDK always sets it to 3.3V.
281                                  */
282                                 regulator-min-microvolt = <3300000>;
283                                 regulator-max-microvolt = <3300000>;
284                                 regulator-name = "vcc-wifi";
285                         };
286
287                         reg_dldo2: dldo2 {
288                                 regulator-always-on;
289                                 regulator-min-microvolt = <3000000>;
290                                 regulator-max-microvolt = <3000000>;
291                                 regulator-name = "vcc-pl";
292                         };
293
294                         reg_eldo1: eldo1 {
295                                 regulator-min-microvolt = <1200000>;
296                                 regulator-max-microvolt = <1200000>;
297                                 regulator-name = "vcc-dvdd-cam";
298                         };
299
300                         reg_eldo2: eldo2 {
301                                 regulator-min-microvolt = <1800000>;
302                                 regulator-max-microvolt = <1800000>;
303                                 regulator-name = "vcc-pe";
304                         };
305
306                         reg_eldo3: eldo3 {
307                                 regulator-always-on;
308                                 regulator-min-microvolt = <3000000>;
309                                 regulator-max-microvolt = <3000000>;
310                                 regulator-name = "vcc-pm-codec-io1";
311                         };
312
313                         reg_ldo_io0: ldo_io0 {
314                                 regulator-always-on;
315                                 regulator-min-microvolt = <3000000>;
316                                 regulator-max-microvolt = <3000000>;
317                                 regulator-name = "vcc-pg";
318                         };
319
320                         reg_ldo_io1: ldo_io1 {
321                                 regulator-min-microvolt = <2500000>;
322                                 regulator-max-microvolt = <2500000>;
323                                 regulator-name = "vcc-pa-gmac-2v5";
324                         };
325
326                         reg_rtc_ldo: rtc_ldo {
327                                 regulator-name = "vcc-rtc-vdd1v8-io";
328                         };
329
330                         sw {
331                                 /* unused */
332                         };
333                 };
334         };
335
336         axp806: pmic@745 {
337                 compatible = "x-powers,axp806";
338                 reg = <0x745>;
339                 interrupt-parent = <&nmi_intc>;
340                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
341                 interrupt-controller;
342                 #interrupt-cells = <1>;
343                 bldoin-supply = <&reg_dcdce>;
344
345                 regulators {
346                         reg_s_aldo1: aldo1 {
347                                 regulator-always-on;
348                                 regulator-min-microvolt = <3000000>;
349                                 regulator-max-microvolt = <3000000>;
350                                 regulator-name = "avcc";
351                         };
352
353                         aldo2 {
354                                 /*
355                                  * unused, but use a different name to
356                                  * avoid name clash with axp809's aldo's
357                                  */
358                                 regulator-name = "s_aldo2";
359                         };
360
361                         aldo3 {
362                                 /*
363                                  * unused, but use a different name to
364                                  * avoid name clash with axp809's aldo's
365                                  */
366                                 regulator-name = "s_aldo3";
367                         };
368
369                         reg_bldo1: bldo1 {
370                                 regulator-always-on;
371                                 regulator-min-microvolt = <1700000>;
372                                 regulator-max-microvolt = <1900000>;
373                                 regulator-name = "vcc18-efuse-adc-display-csi";
374                         };
375
376                         reg_bldo2: bldo2 {
377                                 regulator-always-on;
378                                 regulator-min-microvolt = <1700000>;
379                                 regulator-max-microvolt = <1900000>;
380                                 regulator-name =
381                                         "vdd18-drampll-vcc18-pll-cpvdd";
382                         };
383
384                         bldo3 {
385                                 /* unused */
386                         };
387
388                         reg_bldo4: bldo4 {
389                                 regulator-min-microvolt = <1100000>;
390                                 regulator-max-microvolt = <1300000>;
391                                 regulator-name = "vcc12-hsic";
392                         };
393
394                         reg_cldo1: cldo1 {
395                                 /*
396                                  * This was 3V in the original design, but
397                                  * 3.3V is the recommended supply voltage
398                                  * for the Ethernet PHY.
399                                  */
400                                 regulator-min-microvolt = <3300000>;
401                                 regulator-max-microvolt = <3300000>;
402                                 regulator-name = "vcc-gmac-phy";
403                         };
404
405                         reg_cldo2: cldo2 {
406                                 regulator-min-microvolt = <2800000>;
407                                 regulator-max-microvolt = <2800000>;
408                                 regulator-name = "afvcc-cam";
409                         };
410
411                         reg_cldo3: cldo3 {
412                                 regulator-min-microvolt = <3000000>;
413                                 regulator-max-microvolt = <3000000>;
414                                 regulator-name = "vcc-io-wifi-codec-io2";
415                         };
416
417                         reg_dcdca: dcdca {
418                                 regulator-always-on;
419                                 regulator-min-microvolt = <800000>;
420                                 regulator-max-microvolt = <1100000>;
421                                 regulator-name = "vdd-cpub";
422                         };
423
424                         reg_dcdcd: dcdcd {
425                                 regulator-always-on;
426                                 regulator-min-microvolt = <800000>;
427                                 regulator-max-microvolt = <1100000>;
428                                 regulator-name = "vdd-vpu";
429                         };
430
431                         reg_dcdce: dcdce {
432                                 regulator-always-on;
433                                 regulator-min-microvolt = <2100000>;
434                                 regulator-max-microvolt = <2100000>;
435                                 regulator-name = "vcc-bldo-codec-ldoin";
436                         };
437
438                         sw {
439                                 /*
440                                  * unused, but use a different name to
441                                  * avoid name clash with axp809's sw
442                                  */
443                                 regulator-name = "s_sw";
444                         };
445                 };
446         };
447
448         ac100: codec@e89 {
449                 compatible = "x-powers,ac100";
450                 reg = <0xe89>;
451
452                 ac100_codec: codec {
453                         compatible = "x-powers,ac100-codec";
454                         interrupt-parent = <&r_pio>;
455                         interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
456                         #clock-cells = <0>;
457                         clock-output-names = "4M_adda";
458                 };
459
460                 ac100_rtc: rtc {
461                         compatible = "x-powers,ac100-rtc";
462                         interrupt-parent = <&nmi_intc>;
463                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
464                         clocks = <&ac100_codec>;
465                         #clock-cells = <1>;
466                         clock-output-names = "cko1_rtc",
467                                              "cko2_rtc",
468                                              "cko3_rtc";
469                 };
470         };
471 };
472
473 #include "axp809.dtsi"
474
475 &uart0 {
476         pinctrl-names = "default";
477         pinctrl-0 = <&uart0_pins_a>;
478         status = "okay";
479 };
480
481 &usbphy1 {
482         phy-supply = <&reg_usb1_vbus>;
483         status = "okay";
484 };
485
486 &usbphy2 {
487         phy-supply = <&reg_bldo4>;
488         /* Enable if HSIC peripheral is connected */
489         status = "disabled";
490 };
491
492 &usbphy3 {
493         phy-supply = <&reg_usb3_vbus>;
494         status = "okay";
495 };