Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun8i-a83t-cubietruck-plus.dts
1 /*
2  * Copyright 2015 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 "sun8i-a83t.dtsi"
47
48 #include <dt-bindings/gpio/gpio.h>
49
50 / {
51         model = "Cubietech Cubietruck Plus";
52         compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t";
53
54         aliases {
55                 serial0 = &uart0;
56         };
57
58         chosen {
59                 stdout-path = "serial0:115200n8";
60         };
61
62         leds {
63                 compatible = "gpio-leds";
64
65                 blue {
66                         label = "cubietruck-plus:blue:usr";
67                         gpios = <&pio 3 25 GPIO_ACTIVE_HIGH>; /* PD25 */
68                 };
69
70                 orange {
71                         label = "cubietruck-plus:orange:usr";
72                         gpios = <&pio 3 26 GPIO_ACTIVE_HIGH>; /* PD26 */
73                 };
74
75                 white {
76                         label = "cubietruck-plus:white:usr";
77                         gpios = <&pio 3 27 GPIO_ACTIVE_HIGH>; /* PD27 */
78                 };
79
80                 green {
81                         label = "cubietruck-plus:green:usr";
82                         gpios = <&pio 4 4 GPIO_ACTIVE_HIGH>; /* PE4 */
83                 };
84         };
85
86         usb-hub {
87                 /* I2C is not connected */
88                 compatible = "smsc,usb3503";
89                 initial-mode = <1>; /* initialize in HUB mode */
90                 disabled-ports = <1>;
91                 intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
92                 reset-gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */
93                 connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
94                 refclk-frequency = <19200000>;
95         };
96
97         reg_usb1_vbus: reg-usb1-vbus {
98                 compatible = "regulator-fixed";
99                 regulator-name = "usb1-vbus";
100                 regulator-min-microvolt = <5000000>;
101                 regulator-max-microvolt = <5000000>;
102                 regulator-boot-on;
103                 enable-active-high;
104                 gpio = <&pio 3 29 GPIO_ACTIVE_HIGH>; /* PD29 */
105         };
106
107         reg_usb2_vbus: reg-usb2-vbus {
108                 compatible = "regulator-fixed";
109                 regulator-name = "usb2-vbus";
110                 regulator-min-microvolt = <5000000>;
111                 regulator-max-microvolt = <5000000>;
112                 regulator-boot-on;
113                 enable-active-high;
114                 gpio = <&r_pio 0 6 GPIO_ACTIVE_HIGH>; /* PL6 */
115         };
116
117         sound {
118                 compatible = "simple-audio-card";
119                 simple-audio-card,name = "On-board SPDIF";
120
121                 simple-audio-card,cpu {
122                         sound-dai = <&spdif>;
123                 };
124
125                 simple-audio-card,codec {
126                         sound-dai = <&spdif_out>;
127                 };
128         };
129
130         spdif_out: spdif-out {
131                 #sound-dai-cells = <0>;
132                 compatible = "linux,spdif-dit";
133         };
134
135         wifi_pwrseq: wifi_pwrseq {
136                 compatible = "mmc-pwrseq-simple";
137                 clocks = <&ac100_rtc 1>;
138                 clock-names = "ext_clock";
139                 /* The WiFi low power clock must be 32768 Hz */
140                 assigned-clocks = <&ac100_rtc 1>;
141                 assigned-clock-rates = <32768>;
142                 /* enables internal regulator and de-asserts reset */
143                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
144         };
145 };
146
147 &ehci0 {
148         /* GL830 USB-to-SATA bridge here */
149         status = "okay";
150 };
151
152 &ehci1 {
153         /* USB3503 HSIC USB 2.0 hub here */
154         status = "okay";
155 };
156
157 &mmc0 {
158         pinctrl-names = "default";
159         pinctrl-0 = <&mmc0_pins>;
160         vmmc-supply = <&reg_dcdc1>;
161         bus-width = <4>;
162         cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
163         cd-inverted;
164         status = "okay";
165 };
166
167 &mmc1 {
168         vmmc-supply = <&reg_dcdc1>;
169         vqmmc-supply = <&reg_sw>;
170         mmc-pwrseq = <&wifi_pwrseq>;
171         bus-width = <4>;
172         non-removable;
173         status = "okay";
174 };
175
176 &mmc2 {
177         pinctrl-names = "default";
178         pinctrl-0 = <&mmc2_8bit_emmc_pins>;
179         vmmc-supply = <&reg_dcdc1>;
180         bus-width = <8>;
181         non-removable;
182         cap-mmc-hw-reset;
183         status = "okay";
184 };
185
186 &r_rsb {
187         status = "okay";
188
189         axp81x: pmic@3a3 {
190                 compatible = "x-powers,axp818", "x-powers,axp813";
191                 reg = <0x3a3>;
192                 interrupt-parent = <&r_intc>;
193                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
194                 eldoin-supply = <&reg_dcdc1>;
195                 swin-supply = <&reg_dcdc1>;
196                 x-powers,drive-vbus-en;
197         };
198
199         ac100: codec@e89 {
200                 compatible = "x-powers,ac100";
201                 reg = <0xe89>;
202
203                 ac100_codec: codec {
204                         compatible = "x-powers,ac100-codec";
205                         interrupt-parent = <&r_pio>;
206                         interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
207                         #clock-cells = <0>;
208                         clock-output-names = "4M_adda";
209                 };
210
211                 ac100_rtc: rtc {
212                         compatible = "x-powers,ac100-rtc";
213                         interrupt-parent = <&r_intc>;
214                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
215                         clocks = <&ac100_codec>;
216                         #clock-cells = <1>;
217                         clock-output-names = "cko1_rtc",
218                                              "cko2_rtc",
219                                              "cko3_rtc";
220                 };
221         };
222 };
223
224 #include "axp81x.dtsi"
225
226 &reg_aldo1 {
227         regulator-always-on;
228         regulator-min-microvolt = <1800000>;
229         regulator-max-microvolt = <1800000>;
230         regulator-name = "vcc-1v8";
231 };
232
233 &reg_aldo2 {
234         regulator-always-on;
235         regulator-min-microvolt = <1800000>;
236         regulator-max-microvolt = <1800000>;
237         regulator-name = "dram-pll";
238 };
239
240 &reg_aldo3 {
241         regulator-always-on;
242         regulator-min-microvolt = <3000000>;
243         regulator-max-microvolt = <3000000>;
244         regulator-name = "avcc";
245 };
246
247 &reg_dcdc1 {
248         /*
249          * The schematics say this should be 3.3V, but the FEX file says
250          * it should be 3V. The latter makes sense, as the WiFi module's
251          * I/O is indirectly powered from DCDC1, through SW. It is rated
252          * at 2.98V maximum.
253          */
254         regulator-always-on;
255         regulator-min-microvolt = <3000000>;
256         regulator-max-microvolt = <3000000>;
257         regulator-name = "vcc-3v";
258 };
259
260 &reg_dcdc2 {
261         regulator-always-on;
262         regulator-min-microvolt = <700000>;
263         regulator-max-microvolt = <1100000>;
264         regulator-name = "vdd-cpua";
265 };
266
267 &reg_dcdc3 {
268         regulator-always-on;
269         regulator-min-microvolt = <700000>;
270         regulator-max-microvolt = <1100000>;
271         regulator-name = "vdd-cpub";
272 };
273
274 &reg_dcdc4 {
275         regulator-min-microvolt = <700000>;
276         regulator-max-microvolt = <1100000>;
277         regulator-name = "vdd-gpu";
278 };
279
280 &reg_dcdc5 {
281         regulator-always-on;
282         regulator-min-microvolt = <1500000>;
283         regulator-max-microvolt = <1500000>;
284         regulator-name = "vcc-dram";
285 };
286
287 &reg_dcdc6 {
288         regulator-always-on;
289         regulator-min-microvolt = <900000>;
290         regulator-max-microvolt = <900000>;
291         regulator-name = "vdd-sys";
292 };
293
294 &reg_dldo2 {
295         regulator-min-microvolt = <3300000>;
296         regulator-max-microvolt = <3300000>;
297         regulator-name = "dp-pwr";
298 };
299
300 &reg_dldo3 {
301         regulator-always-on;
302         regulator-min-microvolt = <2500000>;
303         regulator-max-microvolt = <2500000>;
304         regulator-name = "ephy-io";
305 };
306
307 &reg_dldo4 {
308         /*
309          * The PHY requires 20ms after all voltages are applied until core
310          * logic is ready and 30ms after the reset pin is de-asserted.
311          * Set a 100ms delay to account for PMIC ramp time and board traces.
312          */
313         regulator-enable-ramp-delay = <100000>;
314         regulator-min-microvolt = <3300000>;
315         regulator-max-microvolt = <3300000>;
316         regulator-name = "ephy";
317 };
318
319 &reg_drivevbus {
320         regulator-name = "usb0-vbus";
321         status = "okay";
322 };
323
324 &reg_eldo1 {
325         regulator-min-microvolt = <1200000>;
326         regulator-max-microvolt = <1200000>;
327         regulator-name = "dp-bridge-1";
328 };
329
330 &reg_eldo2 {
331         regulator-min-microvolt = <1200000>;
332         regulator-max-microvolt = <1200000>;
333         regulator-name = "dp-bridge-2";
334 };
335
336 &reg_fldo1 {
337         /* TODO should be handled by USB PHY */
338         regulator-always-on;
339         regulator-min-microvolt = <1080000>;
340         regulator-max-microvolt = <1320000>;
341         regulator-name = "vdd12-hsic";
342 };
343
344 &reg_fldo2 {
345         /*
346          * Despite the embedded CPUs core not being used in any way,
347          * this must remain on or the system will hang.
348          */
349         regulator-always-on;
350         regulator-min-microvolt = <700000>;
351         regulator-max-microvolt = <1100000>;
352         regulator-name = "vdd-cpus";
353 };
354
355 &reg_rtc_ldo {
356         regulator-name = "vcc-rtc";
357 };
358
359 &reg_sw {
360         regulator-name = "vcc-wifi-io";
361 };
362
363 &spdif {
364         status = "okay";
365 };
366
367 &uart0 {
368         pinctrl-names = "default";
369         pinctrl-0 = <&uart0_pb_pins>;
370         status = "okay";
371 };
372
373 &usbphy {
374         usb1_vbus-supply = <&reg_usb1_vbus>;
375         usb2_vbus-supply = <&reg_usb2_vbus>;
376         status = "okay";
377 };