Merge tag 'samsung-dt64-4.21' of https://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun7i-a20-cubietruck.dts
1 /*
2  * Copyright 2013 Oliver Schinagl
3  *
4  * Oliver Schinagl <oliver@schinagl.nl>
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 "sun7i-a20.dtsi"
47 #include "sunxi-common-regulators.dtsi"
48
49 #include <dt-bindings/gpio/gpio.h>
50 #include <dt-bindings/interrupt-controller/irq.h>
51
52 / {
53         model = "Cubietech Cubietruck";
54         compatible = "cubietech,cubietruck", "allwinner,sun7i-a20";
55
56         aliases {
57                 serial0 = &uart0;
58         };
59
60         chosen {
61                 stdout-path = "serial0:115200n8";
62         };
63
64         hdmi-connector {
65                 compatible = "hdmi-connector";
66                 type = "a";
67
68                 port {
69                         hdmi_con_in: endpoint {
70                                 remote-endpoint = <&hdmi_out_con>;
71                         };
72                 };
73         };
74
75         leds {
76                 compatible = "gpio-leds";
77
78                 blue {
79                         label = "cubietruck:blue:usr";
80                         gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
81                 };
82
83                 orange {
84                         label = "cubietruck:orange:usr";
85                         gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
86                 };
87
88                 white {
89                         label = "cubietruck:white:usr";
90                         gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>;
91                 };
92
93                 green {
94                         label = "cubietruck:green:usr";
95                         gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>;
96                 };
97         };
98
99         mmc3_pwrseq: mmc3_pwrseq {
100                 compatible = "mmc-pwrseq-simple";
101                 reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
102         };
103
104         sound {
105                 compatible = "simple-audio-card";
106                 simple-audio-card,name = "On-board SPDIF";
107
108                 simple-audio-card,cpu {
109                         sound-dai = <&spdif>;
110                 };
111
112                 simple-audio-card,codec {
113                         sound-dai = <&spdif_out>;
114                 };
115         };
116
117         spdif_out: spdif-out {
118                 #sound-dai-cells = <0>;
119                 compatible = "linux,spdif-dit";
120         };
121 };
122
123 &ahci {
124         target-supply = <&reg_ahci_5v>;
125         status = "okay";
126 };
127
128 &codec {
129         status = "okay";
130 };
131
132 &cpu0 {
133         cpu-supply = <&reg_dcdc2>;
134 };
135
136 &de {
137         status = "okay";
138 };
139
140 &ehci0 {
141         status = "okay";
142 };
143
144 &ehci1 {
145         status = "okay";
146 };
147
148 &gmac {
149         pinctrl-names = "default";
150         pinctrl-0 = <&gmac_rgmii_pins>;
151         phy = <&phy1>;
152         phy-mode = "rgmii";
153         status = "okay";
154
155         phy1: ethernet-phy@1 {
156                 reg = <1>;
157         };
158 };
159
160 &hdmi {
161         status = "okay";
162 };
163
164 &hdmi_out {
165         hdmi_out_con: endpoint {
166                 remote-endpoint = <&hdmi_con_in>;
167         };
168 };
169
170 &i2c0 {
171         status = "okay";
172
173         axp209: pmic@34 {
174                 reg = <0x34>;
175                 interrupt-parent = <&nmi_intc>;
176                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
177         };
178 };
179
180 &i2c1 {
181         pinctrl-names = "default";
182         status = "okay";
183 };
184
185 &i2c2 {
186         status = "okay";
187 };
188
189 &ir0 {
190         pinctrl-names = "default";
191         pinctrl-0 = <&ir0_rx_pin>;
192         status = "okay";
193 };
194
195 &mmc0 {
196         vmmc-supply = <&reg_vcc3v3>;
197         bus-width = <4>;
198         cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
199         status = "okay";
200 };
201
202 &mmc3 {
203         vmmc-supply = <&reg_vcc3v3>;
204         mmc-pwrseq = <&mmc3_pwrseq>;
205         bus-width = <4>;
206         non-removable;
207         status = "okay";
208
209         brcmf: wifi@1 {
210                 reg = <1>;
211                 compatible = "brcm,bcm4329-fmac";
212                 interrupt-parent = <&pio>;
213                 interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
214                 interrupt-names = "host-wake";
215         };
216 };
217
218 &ohci0 {
219         status = "okay";
220 };
221
222 &ohci1 {
223         status = "okay";
224 };
225
226 &otg_sram {
227         status = "okay";
228 };
229
230 &pwm {
231         pinctrl-names = "default";
232         pinctrl-0 = <&pwm0_pin>, <&pwm1_pin>;
233         status = "okay";
234 };
235
236 &reg_ahci_5v {
237         gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>;
238         status = "okay";
239 };
240
241 #include "axp209.dtsi"
242
243 &ac_power_supply {
244         status = "okay";
245 };
246
247 &battery_power_supply {
248         status = "okay";
249 };
250
251 &reg_dcdc2 {
252         regulator-always-on;
253         regulator-min-microvolt = <1000000>;
254         regulator-max-microvolt = <1450000>;
255         regulator-name = "vdd-cpu";
256 };
257
258 &reg_dcdc3 {
259         regulator-always-on;
260         regulator-min-microvolt = <1000000>;
261         regulator-max-microvolt = <1400000>;
262         regulator-name = "vdd-int-dll";
263 };
264
265 &reg_ldo1 {
266         regulator-name = "vdd-rtc";
267 };
268
269 &reg_ldo2 {
270         regulator-always-on;
271         regulator-min-microvolt = <3000000>;
272         regulator-max-microvolt = <3000000>;
273         regulator-name = "avcc";
274 };
275
276 &reg_usb0_vbus {
277         gpio = <&pio 7 17 GPIO_ACTIVE_HIGH>;
278         status = "okay";
279 };
280
281 &reg_usb1_vbus {
282         status = "okay";
283 };
284
285 &reg_usb2_vbus {
286         status = "okay";
287 };
288
289 &spdif {
290         pinctrl-names = "default";
291         pinctrl-0 = <&spdif_tx_pin>;
292         status = "okay";
293 };
294
295 &uart0 {
296         pinctrl-names = "default";
297         pinctrl-0 = <&uart0_pb_pins>;
298         status = "okay";
299 };
300
301 &usb_otg {
302         dr_mode = "otg";
303         status = "okay";
304 };
305
306 &usb_power_supply {
307         status = "okay";
308 };
309
310 &usbphy {
311         usb0_id_det-gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>; /* PH19 */
312         usb0_vbus_det-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
313         usb0_vbus_power-supply = <&usb_power_supply>;
314         usb0_vbus-supply = <&reg_usb0_vbus>;
315         usb1_vbus-supply = <&reg_usb1_vbus>;
316         usb2_vbus-supply = <&reg_usb2_vbus>;
317         status = "okay";
318 };