xref: /linux/arch/arm/boot/dts/allwinner/sun7i-a20-bananapi.dts (revision e7e86d7697c6ed1dbbde18d7185c35b6967945ed)
1/*
2 * Copyright 2014 Hans de Goede <hdegoede@redhat.com>
3 *
4 * Hans de Goede <hdegoede@redhat.com>
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#include <dt-bindings/leds/common.h>
52
53/ {
54	model = "LeMaker Banana Pi";
55	compatible = "lemaker,bananapi", "allwinner,sun7i-a20";
56
57	aliases {
58		serial0 = &uart0;
59		serial1 = &uart3;
60		serial2 = &uart7;
61	};
62
63	chosen {
64		stdout-path = "serial0:115200n8";
65	};
66
67	hdmi-connector {
68		compatible = "hdmi-connector";
69		type = "a";
70
71		port {
72			hdmi_con_in: endpoint {
73				remote-endpoint = <&hdmi_out_con>;
74			};
75		};
76	};
77
78	leds {
79		compatible = "gpio-leds";
80
81		led {
82			label = "bananapi:green:usr";
83			gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>;
84		};
85	};
86
87	reg_gmac_3v3: gmac-3v3 {
88		compatible = "regulator-fixed";
89		regulator-name = "gmac-3v3";
90		regulator-min-microvolt = <3300000>;
91		regulator-max-microvolt = <3300000>;
92		startup-delay-us = <100000>;
93		enable-active-high;
94		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>;
95	};
96};
97
98&ahci {
99	status = "okay";
100};
101
102&codec {
103	status = "okay";
104};
105
106&cpu0 {
107	cpu-supply = <&reg_dcdc2>;
108	operating-points =
109		/* kHz	  uV */
110		<960000	1400000>,
111		<912000	1400000>,
112		<864000	1350000>,
113		<720000	1250000>,
114		<528000	1150000>,
115		<312000	1100000>,
116		<144000	1050000>;
117};
118
119&de {
120	status = "okay";
121};
122
123&ehci0 {
124	status = "okay";
125};
126
127&ehci1 {
128	status = "okay";
129};
130
131&gmac {
132	pinctrl-names = "default";
133	pinctrl-0 = <&gmac_rgmii_pins>;
134	phy-handle = <&phy1>;
135	phy-mode = "rgmii-id";
136	phy-supply = <&reg_gmac_3v3>;
137	status = "okay";
138};
139
140&hdmi {
141	status = "okay";
142};
143
144&hdmi_out {
145	hdmi_out_con: endpoint {
146		remote-endpoint = <&hdmi_con_in>;
147	};
148};
149
150&i2c0 {
151	status = "okay";
152
153	axp209: pmic@34 {
154		reg = <0x34>;
155		interrupt-parent = <&nmi_intc>;
156		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
157	};
158};
159
160&i2c2 {
161	status = "okay";
162};
163
164&ir0 {
165	pinctrl-names = "default";
166	pinctrl-0 = <&ir0_rx_pin>;
167	status = "okay";
168};
169
170&gmac_mdio {
171	phy1: ethernet-phy@1 {
172		reg = <1>;
173
174		leds {
175			#address-cells = <1>;
176			#size-cells = <0>;
177
178			led@0 {
179				reg = <0>;
180				color = <LED_COLOR_ID_GREEN>;
181				function = LED_FUNCTION_LAN;
182				linux,default-trigger = "netdev";
183			};
184
185			led@1 {
186				reg = <1>;
187				color = <LED_COLOR_ID_AMBER>;
188				function = LED_FUNCTION_LAN;
189				linux,default-trigger = "netdev";
190			};
191
192			led@2 {
193				reg = <2>;
194				color = <LED_COLOR_ID_BLUE>;
195				function = LED_FUNCTION_LAN;
196				linux,default-trigger = "netdev";
197			};
198		};
199	};
200};
201
202&mmc0 {
203	vmmc-supply = <&reg_vcc3v3>;
204	bus-width = <4>;
205	cd-gpios = <&pio 7 10 GPIO_ACTIVE_LOW>; /* PH10 */
206	status = "okay";
207};
208
209&ohci0 {
210	status = "okay";
211};
212
213&ohci1 {
214	status = "okay";
215};
216
217&otg_sram {
218	status = "okay";
219};
220
221&pio {
222	vcc-pa-supply = <&reg_vcc3v3>;
223	vcc-pc-supply = <&reg_vcc3v3>;
224	vcc-pe-supply = <&reg_vcc3v3>;
225	vcc-pf-supply = <&reg_vcc3v3>;
226	vcc-pg-supply = <&reg_vcc3v3>;
227	gpio-line-names =
228		/* PA */
229		"ERXD3", "ERXD2", "ERXD1", "ERXD0", "ETXD3",
230			"ETXD2", "ETXD1", "ETXD0",
231		"ERXCK", "ERXERR", "ERXDV", "EMDC", "EMDIO",
232			"ETXEN", "ETXCK", "ECRS",
233		"ECOL", "ETXERR", "", "", "", "", "", "",
234		"", "", "", "", "", "", "", "",
235		/* PB */
236		"PMU-SCK", "PMU-SDA", "", "", "", "", "", "",
237		"", "USB0-DRV", "", "", "", "", "", "",
238		"", "", "", "", "SCL", "SDA", "", "",
239		"", "", "", "", "", "", "", "",
240		/* PC */
241		"", "", "", "", "", "", "", "",
242		"", "", "", "", "", "", "", "",
243		"", "", "", "", "", "", "", "",
244		"", "", "", "", "", "", "", "",
245		/* PD */
246		"", "", "", "", "", "", "", "",
247		"", "", "", "", "", "", "", "",
248		"", "", "", "", "", "", "", "",
249		"", "", "", "", "", "", "", "",
250		/* PE */
251		"", "", "", "", "", "", "", "",
252		"", "", "", "", "", "", "", "",
253		"", "", "", "", "", "", "", "",
254		"", "", "", "", "", "", "", "",
255		/* PF */
256		"SD0-D1", "SD0-D0", "SD0-CLK", "SD0-CMD", "SD0-D3",
257			"SD0-D2", "", "",
258		"", "", "", "", "", "", "", "",
259		"", "", "", "", "", "", "", "",
260		"", "", "", "", "", "", "", "",
261		/* PG */
262		"", "", "", "", "", "", "", "",
263		"", "", "", "", "", "", "", "",
264		"", "", "", "", "", "", "", "",
265		"", "", "", "", "", "", "", "",
266		/* PH */
267		"TXD0", "RXD0", "IO-1", "PH3", "USB0-IDDET", "PH5", "", "",
268		"", "", "SD0-DET", "", "", "", "", "",
269		"", "", "", "", "IO-4", "IO-5", "", "EMAC-PWR-EN",
270		"LED1", "", "", "", "", "", "", "",
271		/* PI */
272		"", "", "", "IO-GCLK", "", "", "", "",
273		"", "", "SPI-CE0", "SPI-CLK", "SPI-MOSI",
274			"SPI-MISO", "SPI-CE1", "",
275		"IO-6", "IO-3", "IO-2", "IO-0", "", "", "", "",
276		"", "", "", "", "", "", "", "";
277};
278
279#include "axp209.dtsi"
280
281&reg_dcdc2 {
282	regulator-always-on;
283	regulator-min-microvolt = <1000000>;
284	regulator-max-microvolt = <1400000>;
285	regulator-name = "vdd-cpu";
286};
287
288&reg_dcdc3 {
289	regulator-always-on;
290	regulator-min-microvolt = <1000000>;
291	regulator-max-microvolt = <1400000>;
292	regulator-name = "vdd-int-dll";
293};
294
295&reg_ldo1 {
296	regulator-name = "vdd-rtc";
297};
298
299&reg_ldo2 {
300	regulator-always-on;
301	regulator-min-microvolt = <3000000>;
302	regulator-max-microvolt = <3000000>;
303	regulator-name = "avcc";
304};
305
306&reg_usb0_vbus {
307	status = "okay";
308};
309
310&reg_usb1_vbus {
311	status = "okay";
312};
313
314&reg_usb2_vbus {
315	status = "okay";
316};
317
318&spi0 {
319	pinctrl-names = "default";
320	pinctrl-0 = <&spi0_pi_pins>,
321		    <&spi0_cs0_pi_pin>,
322		    <&spi0_cs1_pi_pin>;
323	status = "okay";
324};
325
326&uart0 {
327	pinctrl-names = "default";
328	pinctrl-0 = <&uart0_pb_pins>;
329	status = "okay";
330};
331
332&uart3 {
333	pinctrl-names = "default";
334	pinctrl-0 = <&uart3_ph_pins>;
335	status = "okay";
336};
337
338&uart7 {
339	pinctrl-names = "default";
340	pinctrl-0 = <&uart7_pi_pins>;
341	status = "okay";
342};
343
344&usb_otg {
345	dr_mode = "otg";
346	status = "okay";
347};
348
349&usb_power_supply {
350	status = "okay";
351};
352
353&usbphy {
354	usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
355	usb0_vbus_power-supply = <&usb_power_supply>;
356	usb0_vbus-supply = <&reg_usb0_vbus>;
357	usb1_vbus-supply = <&reg_usb1_vbus>;
358	usb2_vbus-supply = <&reg_usb2_vbus>;
359	status = "okay";
360};
361