Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun7i-a20-lamobo-r1.dts
1 /*
2  * Copyright 2015 Jelle de Jong <jelledejong@powercraft.nl>
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44 #include "sun7i-a20.dtsi"
45 #include "sunxi-common-regulators.dtsi"
46
47 #include <dt-bindings/gpio/gpio.h>
48 #include <dt-bindings/interrupt-controller/irq.h>
49
50 / {
51         model = "Lamobo R1";
52         compatible = "lamobo,lamobo-r1", "allwinner,sun7i-a20";
53
54         aliases {
55                 serial0 = &uart0;
56                 serial1 = &uart3;
57                 serial2 = &uart7;
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_lamobo_r1>;
68
69                 green {
70                         label = "lamobo_r1:green:usr";
71                         gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
72                 };
73         };
74
75         reg_gmac_3v3: gmac-3v3 {
76                 compatible = "regulator-fixed";
77                 pinctrl-names = "default";
78                 pinctrl-0 = <&gmac_power_pin_lamobo_r1>;
79                 regulator-name = "gmac-3v3";
80                 regulator-min-microvolt = <3300000>;
81                 regulator-max-microvolt = <3300000>;
82                 startup-delay-us = <100000>;
83                 enable-active-high;
84                 gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
85         };
86 };
87
88 &ahci_pwr_pin_a {
89         pins = "PB3";
90 };
91
92 &ahci {
93         target-supply = <&reg_ahci_5v>;
94         status = "okay";
95 };
96
97 &codec {
98         status = "okay";
99 };
100
101 &cpu0 {
102         cpu-supply = <&reg_dcdc2>;
103 };
104
105 &ehci0 {
106         status = "okay";
107 };
108
109 &ehci1 {
110         status = "okay";
111 };
112
113 &gmac {
114         pinctrl-names = "default";
115         pinctrl-0 = <&gmac_pins_rgmii_a>;
116         phy-mode = "rgmii";
117         phy-supply = <&reg_gmac_3v3>;
118         status = "okay";
119
120         fixed-link {
121                 speed = <1000>;
122                 full-duplex;
123         };
124
125         mdio {
126                 compatible = "snps,dwmac-mdio";
127                 #address-cells = <1>;
128                 #size-cells = <0>;
129
130                 switch: ethernet-switch@1e {
131                         compatible = "brcm,bcm53125";
132                         reg = <30>;
133                         #address-cells = <1>;
134                         #size-cells = <0>;
135
136                         ports {
137                                 #address-cells = <1>;
138                                 #size-cells = <0>;
139
140                                 port0: port@0 {
141                                         reg = <0>;
142                                         label = "lan2";
143                                 };
144
145                                 port1: port@1 {
146                                         reg = <1>;
147                                         label = "lan3";
148                                 };
149
150                                 port2: port@2 {
151                                         reg = <2>;
152                                         label = "lan4";
153                                 };
154
155                                 port3: port@3 {
156                                         reg = <3>;
157                                         label = "wan";
158                                 };
159
160                                 port4: port@4 {
161                                         reg = <4>;
162                                         label = "lan1";
163                                 };
164
165                                 port8: port@8 {
166                                         reg = <8>;
167                                         label = "cpu";
168                                         ethernet = <&gmac>;
169                                         phy-mode = "rgmii-txid";
170                                         fixed-link {
171                                                 speed = <1000>;
172                                                 full-duplex;
173                                         };
174                                 };
175                         };
176                 };
177         };
178 };
179
180 &i2c0 {
181         pinctrl-names = "default";
182         pinctrl-0 = <&i2c0_pins_a>;
183         status = "okay";
184
185         axp209: pmic@34 {
186                 reg = <0x34>;
187                 interrupt-parent = <&nmi_intc>;
188                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
189         };
190 };
191
192 &i2c2 {
193         pinctrl-names = "default";
194         pinctrl-0 = <&i2c2_pins_a>;
195         status = "okay";
196 };
197
198 &ir0 {
199         pinctrl-names = "default";
200         pinctrl-0 = <&ir0_rx_pins_a>;
201         status = "okay";
202 };
203
204 &mmc0 {
205         pinctrl-names = "default";
206         pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>;
207         vmmc-supply = <&reg_vcc3v3>;
208         bus-width = <4>;
209         cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
210         cd-inverted;
211         status = "okay";
212 };
213
214 &ohci0 {
215         status = "okay";
216 };
217
218 &otg_sram {
219         status = "okay";
220 };
221
222 &pio {
223         usb0_id_detect_pin: usb0_id_detect_pin@0 {
224                 pins = "PH4";
225                 function = "gpio_in";
226                 bias-pull-up;
227         };
228
229         mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 {
230                 pins = "PH10";
231                 function = "gpio_in";
232                 bias-pull-up;
233         };
234
235         gmac_power_pin_lamobo_r1: gmac_power_pin@0 {
236                 pins = "PH23";
237                 function = "gpio_out";
238         };
239
240         led_pins_lamobo_r1: led_pins@0 {
241                 pins = "PH24";
242                 function = "gpio_out";
243         };
244 };
245
246 #include "axp209.dtsi"
247
248 &reg_ahci_5v {
249         gpio = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
250         status = "okay";
251 };
252
253 &reg_dcdc2 {
254         regulator-always-on;
255         regulator-min-microvolt = <1000000>;
256         regulator-max-microvolt = <1400000>;
257         regulator-name = "vdd-cpu";
258 };
259
260 &reg_dcdc3 {
261         regulator-always-on;
262         regulator-min-microvolt = <1000000>;
263         regulator-max-microvolt = <1400000>;
264         regulator-name = "vdd-int-dll";
265 };
266
267 &reg_ldo1 {
268         regulator-name = "vdd-rtc";
269 };
270
271 &reg_ldo2 {
272         regulator-always-on;
273         regulator-min-microvolt = <3000000>;
274         regulator-max-microvolt = <3000000>;
275         regulator-name = "avcc";
276 };
277
278 &reg_usb0_vbus {
279         status = "okay";
280 };
281
282 &reg_usb2_vbus {
283         gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
284         status = "okay";
285 };
286
287 &spi0 {
288         pinctrl-names = "default";
289         pinctrl-0 = <&spi0_pins_a>,
290                     <&spi0_cs0_pins_a>,
291                     <&spi0_cs1_pins_a>;
292         status = "okay";
293 };
294
295 &uart0 {
296         pinctrl-names = "default";
297         pinctrl-0 = <&uart0_pins_a>;
298         status = "okay";
299 };
300
301 &uart3 {
302         pinctrl-names = "default";
303         pinctrl-0 = <&uart3_pins_b>;
304         status = "okay";
305 };
306
307 &uart7 {
308         pinctrl-names = "default";
309         pinctrl-0 = <&uart7_pins_a>;
310         status = "okay";
311 };
312
313 &usb_otg {
314         dr_mode = "otg";
315         status = "okay";
316 };
317
318 &usb_power_supply {
319         status = "okay";
320 };
321
322 &usb2_vbus_pin_a {
323         pins = "PH12";
324 };
325
326 &usbphy {
327         pinctrl-names = "default";
328         pinctrl-0 = <&usb0_id_detect_pin>;
329         usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
330         usb0_vbus_power-supply = <&usb_power_supply>;
331         usb0_vbus-supply = <&reg_usb0_vbus>;
332         usb2_vbus-supply = <&reg_usb2_vbus>;
333         status = "okay";
334 };