• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 {
89	target-supply = <&reg_ahci_5v>;
90	status = "okay";
91};
92
93&codec {
94	status = "okay";
95};
96
97&cpu0 {
98	cpu-supply = <&reg_dcdc2>;
99};
100
101&ehci0 {
102	status = "okay";
103};
104
105&ehci1 {
106	status = "okay";
107};
108
109&gmac {
110	pinctrl-names = "default";
111	pinctrl-0 = <&gmac_pins_rgmii_a>;
112	phy-mode = "rgmii";
113	phy-supply = <&reg_gmac_3v3>;
114	status = "okay";
115
116	fixed-link {
117		speed = <1000>;
118		full-duplex;
119	};
120
121	mdio {
122		compatible = "snps,dwmac-mdio";
123		#address-cells = <1>;
124		#size-cells = <0>;
125
126		switch: ethernet-switch@1e {
127			compatible = "brcm,bcm53125";
128			reg = <30>;
129			#address-cells = <1>;
130			#size-cells = <0>;
131
132			ports {
133				#address-cells = <1>;
134				#size-cells = <0>;
135
136				port0: port@0 {
137					reg = <0>;
138					label = "lan2";
139				};
140
141				port1: port@1 {
142					reg = <1>;
143					label = "lan3";
144				};
145
146				port2: port@2 {
147					reg = <2>;
148					label = "lan4";
149				};
150
151				port3: port@3 {
152					reg = <3>;
153					label = "wan";
154				};
155
156				port4: port@4 {
157					reg = <4>;
158					label = "lan1";
159				};
160
161				port8: port@8 {
162					reg = <8>;
163					label = "cpu";
164					ethernet = <&gmac>;
165					phy-mode = "rgmii-txid";
166					fixed-link {
167						speed = <1000>;
168						full-duplex;
169					};
170				};
171			};
172		};
173	};
174};
175
176&i2c0 {
177	pinctrl-names = "default";
178	pinctrl-0 = <&i2c0_pins_a>;
179	status = "okay";
180
181	axp209: pmic@34 {
182		reg = <0x34>;
183		interrupt-parent = <&nmi_intc>;
184		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
185	};
186};
187
188&i2c2 {
189	pinctrl-names = "default";
190	pinctrl-0 = <&i2c2_pins_a>;
191	status = "okay";
192};
193
194&ir0 {
195	pinctrl-names = "default";
196	pinctrl-0 = <&ir0_rx_pins_a>;
197	status = "okay";
198};
199
200&mmc0 {
201	pinctrl-names = "default";
202	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>;
203	vmmc-supply = <&reg_vcc3v3>;
204	bus-width = <4>;
205	cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
206	cd-inverted;
207	status = "okay";
208};
209
210&ohci0 {
211	status = "okay";
212};
213
214&otg_sram {
215	status = "okay";
216};
217
218&pio {
219	usb0_id_detect_pin: usb0_id_detect_pin@0 {
220		pins = "PH4";
221		function = "gpio_in";
222		bias-pull-up;
223	};
224
225	mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 {
226		pins = "PH10";
227		function = "gpio_in";
228		bias-pull-up;
229	};
230
231	gmac_power_pin_lamobo_r1: gmac_power_pin@0 {
232		pins = "PH23";
233		function = "gpio_out";
234	};
235
236	led_pins_lamobo_r1: led_pins@0 {
237		pins = "PH24";
238		function = "gpio_out";
239	};
240};
241
242#include "axp209.dtsi"
243
244&reg_ahci_5v {
245	gpio = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
246	status = "okay";
247};
248
249&reg_dcdc2 {
250	regulator-always-on;
251	regulator-min-microvolt = <1000000>;
252	regulator-max-microvolt = <1400000>;
253	regulator-name = "vdd-cpu";
254};
255
256&reg_dcdc3 {
257	regulator-always-on;
258	regulator-min-microvolt = <1000000>;
259	regulator-max-microvolt = <1400000>;
260	regulator-name = "vdd-int-dll";
261};
262
263&reg_ldo1 {
264	regulator-name = "vdd-rtc";
265};
266
267&reg_ldo2 {
268	regulator-always-on;
269	regulator-min-microvolt = <3000000>;
270	regulator-max-microvolt = <3000000>;
271	regulator-name = "avcc";
272};
273
274&reg_usb0_vbus {
275	status = "okay";
276};
277
278&reg_usb2_vbus {
279	gpio = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
280	status = "okay";
281};
282
283&spi0 {
284	pinctrl-names = "default";
285	pinctrl-0 = <&spi0_pins_a>,
286		    <&spi0_cs0_pins_a>,
287		    <&spi0_cs1_pins_a>;
288	status = "okay";
289};
290
291&uart0 {
292	pinctrl-names = "default";
293	pinctrl-0 = <&uart0_pins_a>;
294	status = "okay";
295};
296
297&uart3 {
298	pinctrl-names = "default";
299	pinctrl-0 = <&uart3_pins_b>;
300	status = "okay";
301};
302
303&uart7 {
304	pinctrl-names = "default";
305	pinctrl-0 = <&uart7_pins_a>;
306	status = "okay";
307};
308
309&usb_otg {
310	dr_mode = "otg";
311	status = "okay";
312};
313
314&usb_power_supply {
315	status = "okay";
316};
317
318&usbphy {
319	pinctrl-names = "default";
320	pinctrl-0 = <&usb0_id_detect_pin>;
321	usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
322	usb0_vbus_power-supply = <&usb_power_supply>;
323	usb0_vbus-supply = <&reg_usb0_vbus>;
324	usb2_vbus-supply = <&reg_usb2_vbus>;
325	status = "okay";
326};
327