• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
3 * Copyright 2015 - Karsten Merker <merker@debian.org>
4 *
5 * This file is dual-licensed: you can use it either under the terms
6 * of the GPL or the X11 license, at your option. Note that this dual
7 * licensing only applies to this file, and not this project as a
8 * whole.
9 *
10 *  a) This file is free software; you can redistribute it and/or
11 *     modify it under the terms of the GNU General Public License as
12 *     published by the Free Software Foundation; either version 2 of the
13 *     License, or (at your option) any later version.
14 *
15 *     This file is distributed in the hope that it will be useful,
16 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 *     GNU General Public License for more details.
19 *
20 * Or, alternatively,
21 *
22 *  b) Permission is hereby granted, free of charge, to any person
23 *     obtaining a copy of this software and associated documentation
24 *     files (the "Software"), to deal in the Software without
25 *     restriction, including without limitation the rights to use,
26 *     copy, modify, merge, publish, distribute, sublicense, and/or
27 *     sell copies of the Software, and to permit persons to whom the
28 *     Software is furnished to do so, subject to the following
29 *     conditions:
30 *
31 *     The above copyright notice and this permission notice shall be
32 *     included in all copies or substantial portions of the Software.
33 *
34 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41 *     OTHER DEALINGS IN THE SOFTWARE.
42 */
43
44/dts-v1/;
45#include "sun7i-a20.dtsi"
46#include "sunxi-common-regulators.dtsi"
47
48#include <dt-bindings/gpio/gpio.h>
49#include <dt-bindings/input/input.h>
50#include <dt-bindings/interrupt-controller/irq.h>
51
52/ {
53	model = "Olimex A20-Olimex-SOM-EVB";
54	compatible = "olimex,a20-olimex-som-evb", "allwinner,sun7i-a20";
55
56	aliases {
57		serial0 = &uart0;
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_olimex_som_evb>;
68
69		green {
70			label = "a20-olimex-som-evb:green:usr";
71			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
72			default-state = "on";
73		};
74	};
75};
76
77&ahci {
78	target-supply = <&reg_ahci_5v>;
79	status = "okay";
80};
81
82&ehci0 {
83	status = "okay";
84};
85
86&ehci1 {
87	status = "okay";
88};
89
90&cpu0 {
91	cpu-supply = <&reg_dcdc2>;
92};
93
94&codec {
95	status = "okay";
96};
97
98&gmac {
99	pinctrl-names = "default";
100	pinctrl-0 = <&gmac_pins_rgmii_a>;
101	phy = <&phy1>;
102	phy-mode = "rgmii";
103	status = "okay";
104
105	phy1: ethernet-phy@1 {
106		reg = <1>;
107	};
108};
109
110&i2c0 {
111	pinctrl-names = "default";
112	pinctrl-0 = <&i2c0_pins_a>;
113	status = "okay";
114
115	axp209: pmic@34 {
116		reg = <0x34>;
117		interrupt-parent = <&nmi_intc>;
118		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
119	};
120};
121
122&i2c1 {
123	pinctrl-names = "default";
124	pinctrl-0 = <&i2c1_pins_a>;
125	status = "okay";
126};
127
128&i2c2 {
129	pinctrl-names = "default";
130	pinctrl-0 = <&i2c2_pins_a>;
131	status = "okay";
132};
133
134&lradc {
135	vref-supply = <&reg_vcc3v0>;
136	status = "okay";
137
138	button@190 {
139		label = "Volume Up";
140		linux,code = <KEY_VOLUMEUP>;
141		channel = <0>;
142		voltage = <190000>;
143	};
144
145	button@390 {
146		label = "Volume Down";
147		linux,code = <KEY_VOLUMEDOWN>;
148		channel = <0>;
149		voltage = <390000>;
150	};
151
152	button@600 {
153		label = "Menu";
154		linux,code = <KEY_MENU>;
155		channel = <0>;
156		voltage = <600000>;
157	};
158
159	button@800 {
160		label = "Search";
161		linux,code = <KEY_SEARCH>;
162		channel = <0>;
163		voltage = <800000>;
164	};
165
166	button@980 {
167		label = "Home";
168		linux,code = <KEY_HOMEPAGE>;
169		channel = <0>;
170		voltage = <980000>;
171	};
172
173	button@1180 {
174		label = "Esc";
175		linux,code = <KEY_ESC>;
176		channel = <0>;
177		voltage = <1180000>;
178	};
179
180	button@1400 {
181		label = "Enter";
182		linux,code = <KEY_ENTER>;
183		channel = <0>;
184		voltage = <1400000>;
185	};
186};
187
188&mmc0 {
189	pinctrl-names = "default";
190	pinctrl-0 = <&mmc0_pins_a>;
191	vmmc-supply = <&reg_vcc3v3>;
192	bus-width = <4>;
193	cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
194	cd-inverted;
195	status = "okay";
196};
197
198&mmc3 {
199	pinctrl-names = "default";
200	pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>;
201	vmmc-supply = <&reg_vcc3v3>;
202	bus-width = <4>;
203	cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */
204	cd-inverted;
205	status = "okay";
206};
207
208&ohci0 {
209	status = "okay";
210};
211
212&ohci1 {
213	status = "okay";
214};
215
216&otg_sram {
217	status = "okay";
218};
219
220&pio {
221	ahci_pwr_pin_olimex_som_evb: ahci_pwr_pin@1 {
222		pins = "PC3";
223		function = "gpio_out";
224	};
225
226	led_pins_olimex_som_evb: led_pins@0 {
227		pins = "PH2";
228		function = "gpio_out";
229		drive-strength = <20>;
230	};
231
232	mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 {
233		pins = "PH0";
234		function = "gpio_in";
235		bias-pull-up;
236	};
237
238	usb0_id_detect_pin: usb0_id_detect_pin@0 {
239		pins = "PH4";
240		function = "gpio_in";
241	};
242
243	usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
244		pins = "PH5";
245		function = "gpio_in";
246	};
247};
248
249&reg_ahci_5v {
250	pinctrl-0 = <&ahci_pwr_pin_olimex_som_evb>;
251	gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
252	status = "okay";
253};
254
255#include "axp209.dtsi"
256
257&reg_dcdc2 {
258	regulator-always-on;
259	regulator-min-microvolt = <1000000>;
260	regulator-max-microvolt = <1400000>;
261	regulator-name = "vdd-cpu";
262};
263
264&reg_dcdc3 {
265	regulator-always-on;
266	regulator-min-microvolt = <1000000>;
267	regulator-max-microvolt = <1400000>;
268	regulator-name = "vdd-int-dll";
269};
270
271&reg_ldo1 {
272	regulator-name = "vdd-rtc";
273};
274
275&reg_ldo2 {
276	regulator-always-on;
277	regulator-min-microvolt = <3000000>;
278	regulator-max-microvolt = <3000000>;
279	regulator-name = "avcc";
280};
281
282&reg_usb0_vbus {
283	status = "okay";
284};
285
286&reg_usb1_vbus {
287	status = "okay";
288};
289
290&reg_usb2_vbus {
291	status = "okay";
292};
293
294&spi1 {
295	pinctrl-names = "default";
296	pinctrl-0 = <&spi1_pins_a>,
297		    <&spi1_cs0_pins_a>;
298	status = "okay";
299};
300
301&spi2 {
302	pinctrl-names = "default";
303	pinctrl-0 = <&spi2_pins_a>,
304		    <&spi2_cs0_pins_a>;
305	status = "okay";
306};
307
308&uart0 {
309	pinctrl-names = "default";
310	pinctrl-0 = <&uart0_pins_a>;
311	status = "okay";
312};
313
314&uart6 {
315	pinctrl-names = "default";
316	pinctrl-0 = <&uart6_pins_a>;
317	status = "okay";
318};
319
320&uart7 {
321	pinctrl-names = "default";
322	pinctrl-0 = <&uart7_pins_a>;
323	status = "okay";
324};
325
326&usb_otg {
327	dr_mode = "otg";
328	status = "okay";
329};
330
331&usbphy {
332	pinctrl-names = "default";
333	pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
334	usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */
335	usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */
336	usb0_vbus-supply = <&reg_usb0_vbus>;
337	usb1_vbus-supply = <&reg_usb1_vbus>;
338	usb2_vbus-supply = <&reg_usb2_vbus>;
339	status = "okay";
340};
341