Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi...
[sfrench/cifs-2.6.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         wifi_pwrseq: wifi_pwrseq {
81                 compatible = "mmc-pwrseq-simple";
82                 clocks = <&ac100_rtc 1>;
83                 clock-names = "ext_clock";
84                 /* enables internal regulator and de-asserts reset */
85                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
86         };
87 };
88
89 &mmc0 {
90         pinctrl-names = "default";
91         pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin_cubieboard4>;
92         vmmc-supply = <&reg_dcdc1>;
93         bus-width = <4>;
94         cd-gpios = <&pio 7 18 GPIO_ACTIVE_HIGH>; /* PH18 */
95         cd-inverted;
96         status = "okay";
97 };
98
99 &mmc1 {
100         pinctrl-names = "default";
101         pinctrl-0 = <&mmc1_pins>, <&wifi_en_pin_cubieboard4>;
102         vmmc-supply = <&reg_dldo1>;
103         vqmmc-supply = <&reg_cldo3>;
104         mmc-pwrseq = <&wifi_pwrseq>;
105         bus-width = <4>;
106         non-removable;
107         status = "okay";
108 };
109
110 &mmc1_pins {
111         bias-pull-up;
112 };
113
114 &mmc2 {
115         pinctrl-names = "default";
116         pinctrl-0 = <&mmc2_8bit_pins>;
117         vmmc-supply = <&reg_dcdc1>;
118         bus-width = <8>;
119         non-removable;
120         cap-mmc-hw-reset;
121         status = "okay";
122 };
123
124 &mmc2_8bit_pins {
125         /* Increase drive strength for DDR modes */
126         drive-strength = <40>;
127 };
128
129 &osc32k {
130         /* osc32k input is from AC100 */
131         clocks = <&ac100_rtc 0>;
132 };
133
134 &pio {
135         led_pins_cubieboard4: led-pins@0 {
136                 pins = "PH6", "PH17";
137                 function = "gpio_out";
138         };
139
140         mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 {
141                 pins = "PH18";
142                 function = "gpio_in";
143                 bias-pull-up;
144         };
145 };
146
147 &r_ir {
148         status = "okay";
149 };
150
151 &r_pio {
152         wifi_en_pin_cubieboard4: wifi_en_pin@0 {
153                 pins = "PL2";
154                 function = "gpio_out";
155         };
156 };
157
158 &r_rsb {
159         status = "okay";
160
161         axp809: pmic@3a3 {
162                 reg = <0x3a3>;
163                 interrupt-parent = <&nmi_intc>;
164                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
165
166                 regulators {
167                         reg_aldo1: aldo1 {
168                                 /*
169                                  * TODO: This should be handled by the
170                                  * USB PHY driver.
171                                  */
172                                 regulator-always-on;
173                                 regulator-min-microvolt = <3000000>;
174                                 regulator-max-microvolt = <3000000>;
175                                 regulator-name = "vcc33-usbh";
176                         };
177
178                         reg_aldo2: aldo2 {
179                                 regulator-min-microvolt = <1800000>;
180                                 regulator-max-microvolt = <1800000>;
181                                 regulator-name = "vcc-pb-io-cam";
182                         };
183
184                         aldo3 {
185                                 /* unused */
186                         };
187
188                         reg_dc5ldo: dc5ldo {
189                                 regulator-always-on;
190                                 regulator-min-microvolt = <800000>;
191                                 regulator-max-microvolt = <1100000>;
192                                 regulator-name = "vdd-cpus-09-usbh";
193                         };
194
195                         reg_dcdc1: dcdc1 {
196                                 regulator-always-on;
197                                 regulator-min-microvolt = <3000000>;
198                                 regulator-max-microvolt = <3000000>;
199                                 regulator-name = "vcc-3v";
200                         };
201
202                         reg_dcdc2: dcdc2 {
203                                 regulator-min-microvolt = <800000>;
204                                 regulator-max-microvolt = <1100000>;
205                                 regulator-name = "vdd-gpu";
206                         };
207
208                         reg_dcdc3: dcdc3 {
209                                 regulator-always-on;
210                                 regulator-min-microvolt = <800000>;
211                                 regulator-max-microvolt = <1100000>;
212                                 regulator-name = "vdd-cpua";
213                         };
214
215                         reg_dcdc4: dcdc4 {
216                                 regulator-always-on;
217                                 regulator-min-microvolt = <800000>;
218                                 regulator-max-microvolt = <1100000>;
219                                 regulator-name = "vdd-sys-usb0-hdmi";
220                         };
221
222                         reg_dcdc5: dcdc5 {
223                                 regulator-always-on;
224                                 regulator-min-microvolt = <1425000>;
225                                 regulator-max-microvolt = <1575000>;
226                                 regulator-name = "vcc-dram";
227                         };
228
229                         reg_dldo1: dldo1 {
230                                 /*
231                                  * The WiFi chip supports a wide range
232                                  * (3.0 ~ 4.8V) of voltages, and so does
233                                  * this regulator (3.0 ~ 4.2V), but
234                                  * Allwinner SDK always sets it to 3.3V.
235                                  */
236                                 regulator-min-microvolt = <3300000>;
237                                 regulator-max-microvolt = <3300000>;
238                                 regulator-name = "vcc-wifi";
239                         };
240
241                         reg_dldo2: dldo2 {
242                                 regulator-always-on;
243                                 regulator-min-microvolt = <3000000>;
244                                 regulator-max-microvolt = <3000000>;
245                                 regulator-name = "vcc-pl";
246                         };
247
248                         reg_eldo1: eldo1 {
249                                 regulator-min-microvolt = <1200000>;
250                                 regulator-max-microvolt = <1200000>;
251                                 regulator-name = "vcc-dvdd-cam";
252                         };
253
254                         reg_eldo2: eldo2 {
255                                 regulator-min-microvolt = <1800000>;
256                                 regulator-max-microvolt = <1800000>;
257                                 regulator-name = "vcc-pe";
258                         };
259
260                         reg_eldo3: eldo3 {
261                                 regulator-always-on;
262                                 regulator-min-microvolt = <3000000>;
263                                 regulator-max-microvolt = <3000000>;
264                                 regulator-name = "vcc-pm-codec-io1";
265                         };
266
267                         reg_ldo_io0: ldo_io0 {
268                                 regulator-always-on;
269                                 regulator-min-microvolt = <3000000>;
270                                 regulator-max-microvolt = <3000000>;
271                                 regulator-name = "vcc-pg";
272                         };
273
274                         reg_ldo_io1: ldo_io1 {
275                                 regulator-min-microvolt = <2500000>;
276                                 regulator-max-microvolt = <2500000>;
277                                 regulator-name = "vcc-pa-gmac-2v5";
278                         };
279
280                         reg_rtc_ldo: rtc_ldo {
281                                 regulator-name = "vcc-rtc-vdd1v8-io";
282                         };
283
284                         sw {
285                                 /* unused */
286                         };
287                 };
288         };
289
290         axp806: pmic@745 {
291                 compatible = "x-powers,axp806";
292                 reg = <0x745>;
293                 interrupt-parent = <&nmi_intc>;
294                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
295                 interrupt-controller;
296                 #interrupt-cells = <1>;
297                 bldoin-supply = <&reg_dcdce>;
298
299                 regulators {
300                         reg_s_aldo1: aldo1 {
301                                 regulator-always-on;
302                                 regulator-min-microvolt = <3000000>;
303                                 regulator-max-microvolt = <3000000>;
304                                 regulator-name = "avcc";
305                         };
306
307                         aldo2 {
308                                 /*
309                                  * unused, but use a different name to
310                                  * avoid name clash with axp809's aldo's
311                                  */
312                                 regulator-name = "s_aldo2";
313                         };
314
315                         aldo3 {
316                                 /*
317                                  * unused, but use a different name to
318                                  * avoid name clash with axp809's aldo's
319                                  */
320                                 regulator-name = "s_aldo3";
321                         };
322
323                         reg_bldo1: bldo1 {
324                                 regulator-always-on;
325                                 regulator-min-microvolt = <1700000>;
326                                 regulator-max-microvolt = <1900000>;
327                                 regulator-name = "vcc18-efuse-adc-display-csi";
328                         };
329
330                         reg_bldo2: bldo2 {
331                                 regulator-always-on;
332                                 regulator-min-microvolt = <1700000>;
333                                 regulator-max-microvolt = <1900000>;
334                                 regulator-name =
335                                         "vdd18-drampll-vcc18-pll-cpvdd";
336                         };
337
338                         bldo3 {
339                                 /* unused */
340                         };
341
342                         reg_bldo4: bldo4 {
343                                 regulator-min-microvolt = <1100000>;
344                                 regulator-max-microvolt = <1300000>;
345                                 regulator-name = "vcc12-hsic";
346                         };
347
348                         reg_cldo1: cldo1 {
349                                 /*
350                                  * This was 3V in the original design, but
351                                  * 3.3V is the recommended supply voltage
352                                  * for the Ethernet PHY.
353                                  */
354                                 regulator-min-microvolt = <3300000>;
355                                 regulator-max-microvolt = <3300000>;
356                                 regulator-name = "vcc-gmac-phy";
357                         };
358
359                         reg_cldo2: cldo2 {
360                                 regulator-min-microvolt = <2800000>;
361                                 regulator-max-microvolt = <2800000>;
362                                 regulator-name = "afvcc-cam";
363                         };
364
365                         reg_cldo3: cldo3 {
366                                 regulator-min-microvolt = <3000000>;
367                                 regulator-max-microvolt = <3000000>;
368                                 regulator-name = "vcc-io-wifi-codec-io2";
369                         };
370
371                         reg_dcdca: dcdca {
372                                 regulator-always-on;
373                                 regulator-min-microvolt = <800000>;
374                                 regulator-max-microvolt = <1100000>;
375                                 regulator-name = "vdd-cpub";
376                         };
377
378                         reg_dcdcd: dcdcd {
379                                 regulator-always-on;
380                                 regulator-min-microvolt = <800000>;
381                                 regulator-max-microvolt = <1100000>;
382                                 regulator-name = "vdd-vpu";
383                         };
384
385                         reg_dcdce: dcdce {
386                                 regulator-always-on;
387                                 regulator-min-microvolt = <2100000>;
388                                 regulator-max-microvolt = <2100000>;
389                                 regulator-name = "vcc-bldo-codec-ldoin";
390                         };
391
392                         sw {
393                                 /*
394                                  * unused, but use a different name to
395                                  * avoid name clash with axp809's sw
396                                  */
397                                 regulator-name = "s_sw";
398                         };
399                 };
400         };
401
402         ac100: codec@e89 {
403                 compatible = "x-powers,ac100";
404                 reg = <0xe89>;
405
406                 ac100_codec: codec {
407                         compatible = "x-powers,ac100-codec";
408                         interrupt-parent = <&r_pio>;
409                         interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
410                         #clock-cells = <0>;
411                         clock-output-names = "4M_adda";
412                 };
413
414                 ac100_rtc: rtc {
415                         compatible = "x-powers,ac100-rtc";
416                         interrupt-parent = <&nmi_intc>;
417                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
418                         clocks = <&ac100_codec>;
419                         #clock-cells = <1>;
420                         clock-output-names = "cko1_rtc",
421                                              "cko2_rtc",
422                                              "cko3_rtc";
423                 };
424         };
425 };
426
427 #include "axp809.dtsi"
428
429 &uart0 {
430         pinctrl-names = "default";
431         pinctrl-0 = <&uart0_pins_a>;
432         status = "okay";
433 };