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