1/*
2 * Copyright 2014 Zoltan HERPAI
3 * Zoltan HERPAI <wigyori@uid0.hu>
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 *     You should have received a copy of the GNU General Public
21 *     License along with this file; if not, write to the Free
22 *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
23 *     MA 02110-1301 USA
24 *
25 * Or, alternatively,
26 *
27 *  b) Permission is hereby granted, free of charge, to any person
28 *     obtaining a copy of this software and associated documentation
29 *     files (the "Software"), to deal in the Software without
30 *     restriction, including without limitation the rights to use,
31 *     copy, modify, merge, publish, distribute, sublicense, and/or
32 *     sell copies of the Software, and to permit persons to whom the
33 *     Software is furnished to do so, subject to the following
34 *     conditions:
35 *
36 *     The above copyright notice and this permission notice shall be
37 *     included in all copies or substantial portions of the Software.
38 *
39 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
40 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
41 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
42 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
43 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
44 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
46 *     OTHER DEALINGS IN THE SOFTWARE.
47 */
48
49/dts-v1/;
50#include "sun4i-a10.dtsi"
51#include "sunxi-common-regulators.dtsi"
52
53#include <dt-bindings/gpio/gpio.h>
54#include <dt-bindings/input/input.h>
55#include <dt-bindings/pinctrl/sun4i-a10.h>
56
57/ {
58	model = "LinkSprite pcDuino";
59	compatible = "linksprite,a10-pcduino", "allwinner,sun4i-a10";
60
61	soc@01c00000 {
62		emac: ethernet@01c0b000 {
63			pinctrl-names = "default";
64			pinctrl-0 = <&emac_pins_a>;
65			phy = <&phy1>;
66			status = "okay";
67		};
68
69		pinctrl@01c20800 {
70			led_pins_pcduino: led_pins@0 {
71				allwinner,pins = "PH15", "PH16";
72				allwinner,function = "gpio_out";
73				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
74				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
75			};
76
77			key_pins_pcduino: key_pins@0 {
78				allwinner,pins = "PH17", "PH18", "PH19";
79				allwinner,function = "gpio_in";
80				allwinner,drive = <SUN4I_PINCTRL_10_MA>;
81				allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
82			};
83		};
84
85		mdio@01c0b080 {
86			status = "okay";
87
88			phy1: ethernet-phy@1 {
89				reg = <1>;
90			};
91		};
92
93		mmc0: mmc@01c0f000 {
94			pinctrl-names = "default";
95			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
96			vmmc-supply = <&reg_vcc3v3>;
97			bus-width = <4>;
98			cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
99			cd-inverted;
100			status = "okay";
101		};
102
103		usbphy: phy@01c13400 {
104			usb1_vbus-supply = <&reg_usb1_vbus>;
105			usb2_vbus-supply = <&reg_usb2_vbus>;
106			status = "okay";
107		};
108
109		ehci0: usb@01c14000 {
110			status = "okay";
111		};
112
113		ohci0: usb@01c14400 {
114			status = "okay";
115		};
116
117		ehci1: usb@01c1c000 {
118			status = "okay";
119		};
120
121		ohci1: usb@01c1c400 {
122			status = "okay";
123		};
124
125		uart0: serial@01c28000 {
126			pinctrl-names = "default";
127			pinctrl-0 = <&uart0_pins_a>;
128			status = "okay";
129		};
130
131		i2c0: i2c@01c2ac00 {
132			pinctrl-names = "default";
133			pinctrl-0 = <&i2c0_pins_a>;
134			status = "okay";
135
136			axp209: pmic@34 {
137				compatible = "x-powers,axp209";
138				reg = <0x34>;
139				interrupts = <0>;
140
141				interrupt-controller;
142				#interrupt-cells = <1>;
143			};
144		};
145	};
146
147	leds {
148		compatible = "gpio-leds";
149		pinctrl-names = "default";
150		pinctrl-0 = <&led_pins_pcduino>;
151
152		tx {
153			label = "pcduino:green:tx";
154			gpios = <&pio 7 15 GPIO_ACTIVE_LOW>;
155		};
156
157		rx {
158			label = "pcduino:green:rx";
159			gpios = <&pio 7 16 GPIO_ACTIVE_LOW>;
160		};
161	};
162
163	gpio_keys {
164		compatible = "gpio-keys";
165		pinctrl-names = "default";
166		pinctrl-0 = <&key_pins_pcduino>;
167		#address-cells = <1>;
168		#size-cells = <0>;
169
170		button@0 {
171			label = "Key Back";
172			linux,code = <KEY_BACK>;
173			gpios = <&pio 7 17 GPIO_ACTIVE_LOW>;
174		};
175
176		button@1 {
177			label = "Key Home";
178			linux,code = <KEY_HOME>;
179			gpios = <&pio 7 18 GPIO_ACTIVE_LOW>;
180		};
181
182		button@2 {
183			label = "Key Menu";
184			linux,code = <KEY_MENU>;
185			gpios = <&pio 7 19 GPIO_ACTIVE_LOW>;
186		};
187	};
188
189	reg_usb1_vbus: usb1-vbus {
190		status = "okay";
191	};
192
193	reg_usb2_vbus: usb2-vbus {
194		status = "okay";
195	};
196};
197