Merge branch 'work.splice_read' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / arch / arm / boot / dts / sun9i-a80-cubieboard4.dts
1 /*
2  * Copyright 2015 Tyler Baker
3  *
4  * Tyler Baker <tyler.baker@linaro.org>
5  * Chen-Yu Tsai <wens@csie.org>
6  *
7  * This file is dual-licensed: you can use it either under the terms
8  * of the GPL or the X11 license, at your option. Note that this dual
9  * licensing only applies to this file, and not this project as a
10  * whole.
11  *
12  *  a) This file is free software; you can redistribute it and/or
13  *     modify it under the terms of the GNU General Public License as
14  *     published by the Free Software Foundation; either version 2 of the
15  *     License, or (at your option) any later version.
16  *
17  *     This file is distributed in the hope that it will be useful,
18  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  *     GNU General Public License for more details.
21  *
22  * Or, alternatively,
23  *
24  *  b) Permission is hereby granted, free of charge, to any person
25  *     obtaining a copy of this software and associated documentation
26  *     files (the "Software"), to deal in the Software without
27  *     restriction, including without limitation the rights to use,
28  *     copy, modify, merge, publish, distribute, sublicense, and/or
29  *     sell copies of the Software, and to permit persons to whom the
30  *     Software is furnished to do so, subject to the following
31  *     conditions:
32  *
33  *     The above copyright notice and this permission notice shall be
34  *     included in all copies or substantial portions of the Software.
35  *
36  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
37  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
38  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
39  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
40  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
41  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
42  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
43  *     OTHER DEALINGS IN THE SOFTWARE.
44  */
45
46 /dts-v1/;
47 #include "sun9i-a80.dtsi"
48
49 #include <dt-bindings/gpio/gpio.h>
50 #include <dt-bindings/pinctrl/sun4i-a10.h>
51
52 / {
53         model = "Cubietech Cubieboard4";
54         compatible = "cubietech,a80-cubieboard4", "allwinner,sun9i-a80";
55
56         aliases {
57                 serial0 = &uart0;
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_cubieboard4>;
68
69                 green {
70                         label = "cubieboard4:green:usr";
71                         gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */
72                 };
73
74                 red {
75                         label = "cubieboard4:red:usr";
76                         gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */
77                 };
78         };
79 };
80
81 &mmc0 {
82         pinctrl-names = "default";
83         pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_cubieboard4>;
84         vmmc-supply = <&reg_dcdc1>;
85         bus-width = <4>;
86         cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */
87         cd-inverted;
88         status = "okay";
89 };
90
91 &mmc2 {
92         pinctrl-names = "default";
93         pinctrl-0 = <&mmc2_8bit_pins>;
94         vmmc-supply = <&reg_dcdc1>;
95         bus-width = <8>;
96         non-removable;
97         cap-mmc-hw-reset;
98         status = "okay";
99 };
100
101 &mmc2_8bit_pins {
102         /* Increase drive strength for DDR modes */
103         allwinner,drive = <SUN4I_PINCTRL_40_MA>;
104 };
105
106 &osc32k {
107         /* osc32k input is from AC100 */
108         clocks = <&ac100_rtc 0>;
109 };
110
111 &pio {
112         led_pins_cubieboard4: led-pins@0 {
113                 allwinner,pins = "PH6", "PH17";
114                 allwinner,function = "gpio_out";
115                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
116                 allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
117         };
118
119         mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 {
120                 allwinner,pins = "PH18";
121                 allwinner,function = "gpio_in";
122                 allwinner,drive = <SUN4I_PINCTRL_10_MA>;
123                 allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
124         };
125 };
126
127 &r_ir {
128         status = "okay";
129 };
130
131 &r_rsb {
132         status = "okay";
133
134         axp809: pmic@3a3 {
135                 reg = <0x3a3>;
136                 interrupt-parent = <&nmi_intc>;
137                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
138
139                 regulators {
140                         reg_aldo1: aldo1 {
141                                 /*
142                                  * TODO: This should be handled by the
143                                  * USB PHY driver.
144                                  */
145                                 regulator-always-on;
146                                 regulator-min-microvolt = <3000000>;
147                                 regulator-max-microvolt = <3000000>;
148                                 regulator-name = "vcc33-usbh";
149                         };
150
151                         reg_aldo2: aldo2 {
152                                 regulator-min-microvolt = <1800000>;
153                                 regulator-max-microvolt = <1800000>;
154                                 regulator-name = "vcc-pb-io-cam";
155                         };
156
157                         aldo3 {
158                                 /* unused */
159                         };
160
161                         reg_dc5ldo: dc5ldo {
162                                 regulator-always-on;
163                                 regulator-min-microvolt = <800000>;
164                                 regulator-max-microvolt = <1100000>;
165                                 regulator-name = "vdd-cpus-09-usbh";
166                         };
167
168                         reg_dcdc1: dcdc1 {
169                                 regulator-always-on;
170                                 regulator-min-microvolt = <3000000>;
171                                 regulator-max-microvolt = <3000000>;
172                                 regulator-name = "vcc-3v";
173                         };
174
175                         reg_dcdc2: dcdc2 {
176                                 regulator-min-microvolt = <800000>;
177                                 regulator-max-microvolt = <1100000>;
178                                 regulator-name = "vdd-gpu";
179                         };
180
181                         reg_dcdc3: dcdc3 {
182                                 regulator-always-on;
183                                 regulator-min-microvolt = <800000>;
184                                 regulator-max-microvolt = <1100000>;
185                                 regulator-name = "vdd-cpua";
186                         };
187
188                         reg_dcdc4: dcdc4 {
189                                 regulator-always-on;
190                                 regulator-min-microvolt = <800000>;
191                                 regulator-max-microvolt = <1100000>;
192                                 regulator-name = "vdd-sys-usb0-hdmi";
193                         };
194
195                         reg_dcdc5: dcdc5 {
196                                 regulator-always-on;
197                                 regulator-min-microvolt = <1425000>;
198                                 regulator-max-microvolt = <1575000>;
199                                 regulator-name = "vcc-dram";
200                         };
201
202                         reg_dldo1: dldo1 {
203                                 /*
204                                  * The WiFi chip supports a wide range
205                                  * (3.0 ~ 4.8V) of voltages, and so does
206                                  * this regulator (3.0 ~ 4.2V), but
207                                  * Allwinner SDK always sets it to 3.3V.
208                                  */
209                                 regulator-min-microvolt = <3300000>;
210                                 regulator-max-microvolt = <3300000>;
211                                 regulator-name = "vcc-wifi";
212                         };
213
214                         reg_dldo2: dldo2 {
215                                 regulator-always-on;
216                                 regulator-min-microvolt = <3000000>;
217                                 regulator-max-microvolt = <3000000>;
218                                 regulator-name = "vcc-pl";
219                         };
220
221                         reg_eldo1: eldo1 {
222                                 regulator-min-microvolt = <1200000>;
223                                 regulator-max-microvolt = <1200000>;
224                                 regulator-name = "vcc-dvdd-cam";
225                         };
226
227                         reg_eldo2: eldo2 {
228                                 regulator-min-microvolt = <1800000>;
229                                 regulator-max-microvolt = <1800000>;
230                                 regulator-name = "vcc-pe";
231                         };
232
233                         reg_eldo3: eldo3 {
234                                 regulator-always-on;
235                                 regulator-min-microvolt = <3000000>;
236                                 regulator-max-microvolt = <3000000>;
237                                 regulator-name = "vcc-pm-codec-io1";
238                         };
239
240                         reg_ldo_io0: ldo_io0 {
241                                 regulator-always-on;
242                                 regulator-min-microvolt = <3000000>;
243                                 regulator-max-microvolt = <3000000>;
244                                 regulator-name = "vcc-pg";
245                         };
246
247                         reg_ldo_io1: ldo_io1 {
248                                 regulator-min-microvolt = <2500000>;
249                                 regulator-max-microvolt = <2500000>;
250                                 regulator-name = "vcc-pa-gmac-2v5";
251                         };
252
253                         reg_rtc_ldo: rtc_ldo {
254                                 regulator-name = "vcc-rtc-vdd1v8-io";
255                         };
256
257                         sw {
258                                 /* unused */
259                         };
260                 };
261         };
262
263         axp806: pmic@745 {
264                 compatible = "x-powers,axp806";
265                 reg = <0x745>;
266                 interrupt-parent = <&nmi_intc>;
267                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
268                 interrupt-controller;
269                 #interrupt-cells = <1>;
270                 bldoin-supply = <&reg_dcdce>;
271
272                 regulators {
273                         reg_s_aldo1: aldo1 {
274                                 regulator-always-on;
275                                 regulator-min-microvolt = <3000000>;
276                                 regulator-max-microvolt = <3000000>;
277                                 regulator-name = "avcc";
278                         };
279
280                         aldo2 {
281                                 /*
282                                  * unused, but use a different name to
283                                  * avoid name clash with axp809's aldo's
284                                  */
285                                 regulator-name = "s_aldo2";
286                         };
287
288                         aldo3 {
289                                 /*
290                                  * unused, but use a different name to
291                                  * avoid name clash with axp809's aldo's
292                                  */
293                                 regulator-name = "s_aldo3";
294                         };
295
296                         reg_bldo1: bldo1 {
297                                 regulator-always-on;
298                                 regulator-min-microvolt = <1700000>;
299                                 regulator-max-microvolt = <1900000>;
300                                 regulator-name = "vcc18-efuse-adc-display-csi";
301                         };
302
303                         reg_bldo2: bldo2 {
304                                 regulator-always-on;
305                                 regulator-min-microvolt = <1700000>;
306                                 regulator-max-microvolt = <1900000>;
307                                 regulator-name =
308                                         "vdd18-drampll-vcc18-pll-cpvdd";
309                         };
310
311                         bldo3 {
312                                 /* unused */
313                         };
314
315                         reg_bldo4: bldo4 {
316                                 regulator-min-microvolt = <1100000>;
317                                 regulator-max-microvolt = <1300000>;
318                                 regulator-name = "vcc12-hsic";
319                         };
320
321                         reg_cldo1: cldo1 {
322                                 /*
323                                  * This was 3V in the original design, but
324                                  * 3.3V is the recommended supply voltage
325                                  * for the Ethernet PHY.
326                                  */
327                                 regulator-min-microvolt = <3300000>;
328                                 regulator-max-microvolt = <3300000>;
329                                 regulator-name = "vcc-gmac-phy";
330                         };
331
332                         reg_cldo2: cldo2 {
333                                 regulator-min-microvolt = <2800000>;
334                                 regulator-max-microvolt = <2800000>;
335                                 regulator-name = "afvcc-cam";
336                         };
337
338                         reg_cldo3: cldo3 {
339                                 regulator-min-microvolt = <3000000>;
340                                 regulator-max-microvolt = <3000000>;
341                                 regulator-name = "vcc-io-wifi-codec-io2";
342                         };
343
344                         reg_dcdca: dcdca {
345                                 regulator-always-on;
346                                 regulator-min-microvolt = <800000>;
347                                 regulator-max-microvolt = <1100000>;
348                                 regulator-name = "vdd-cpub";
349                         };
350
351                         reg_dcdcd: dcdcd {
352                                 regulator-always-on;
353                                 regulator-min-microvolt = <800000>;
354                                 regulator-max-microvolt = <1100000>;
355                                 regulator-name = "vdd-vpu";
356                         };
357
358                         reg_dcdce: dcdce {
359                                 regulator-always-on;
360                                 regulator-min-microvolt = <2100000>;
361                                 regulator-max-microvolt = <2100000>;
362                                 regulator-name = "vcc-bldo-codec-ldoin";
363                         };
364
365                         sw {
366                                 /*
367                                  * unused, but use a different name to
368                                  * avoid name clash with axp809's sw
369                                  */
370                                 regulator-name = "s_sw";
371                         };
372                 };
373         };
374
375         ac100: codec@e89 {
376                 compatible = "x-powers,ac100";
377                 reg = <0xe89>;
378
379                 ac100_codec: codec {
380                         compatible = "x-powers,ac100-codec";
381                         interrupt-parent = <&r_pio>;
382                         interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
383                         #clock-cells = <0>;
384                         clock-output-names = "4M_adda";
385                 };
386
387                 ac100_rtc: rtc {
388                         compatible = "x-powers,ac100-rtc";
389                         interrupt-parent = <&nmi_intc>;
390                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
391                         clocks = <&ac100_codec>;
392                         #clock-cells = <1>;
393                         clock-output-names = "cko1_rtc",
394                                              "cko2_rtc",
395                                              "cko3_rtc";
396                 };
397         };
398 };
399
400 #include "axp809.dtsi"
401
402 &uart0 {
403         pinctrl-names = "default";
404         pinctrl-0 = <&uart0_pins_a>;
405         status = "okay";
406 };