1/*
2 * Copyright 2015 Aleksei Mamlin
3 * Aleksei Mamlin <mamlinav@gmail.com>
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/pinctrl/sun4i-a10.h>
55
56/ {
57	model = "HAOYU Electronics Marsboard A10";
58	compatible = "haoyu,a10-marsboard", "allwinner,sun4i-a10";
59
60	leds {
61		compatible = "gpio-leds";
62		pinctrl-names = "default";
63		pinctrl-0 = <&led_pins_marsboard>;
64
65		red1 {
66			label = "marsboard:red1:usr";
67			gpios = <&pio 1 5 GPIO_ACTIVE_HIGH>;
68		};
69
70		red2 {
71			label = "marsboard:red2:usr";
72			gpios = <&pio 1 6 GPIO_ACTIVE_HIGH>;
73		};
74
75		red3 {
76			label = "marsboard:red3:usr";
77			gpios = <&pio 1 7 GPIO_ACTIVE_HIGH>;
78		};
79
80		red4 {
81			label = "marsboard:red4:usr";
82			gpios = <&pio 1 8 GPIO_ACTIVE_HIGH>;
83		};
84	};
85};
86
87&ahci {
88	status = "okay";
89};
90
91&ehci0 {
92	status = "okay";
93};
94
95&ehci1 {
96	status = "okay";
97};
98
99&emac {
100	pinctrl-names = "default";
101	pinctrl-0 = <&emac_pins_a>;
102	phy = <&phy1>;
103	status = "okay";
104};
105
106&i2c0 {
107	pinctrl-names = "default";
108	pinctrl-0 = <&i2c0_pins_a>;
109	status = "okay";
110};
111
112&i2c1 {
113	pinctrl-names = "default";
114	pinctrl-0 = <&i2c1_pins_a>;
115	status = "okay";
116};
117
118&i2c2 {
119	pinctrl-names = "default";
120	pinctrl-0 = <&i2c2_pins_a>;
121	status = "okay";
122};
123
124&mdio {
125	status = "okay";
126
127	phy1: ethernet-phy@1 {
128		reg = <1>;
129	};
130};
131
132&mmc0 {
133	pinctrl-names = "default";
134	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
135	vmmc-supply = <&reg_vcc3v3>;
136	bus-width = <4>;
137	cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
138	cd-inverted;
139	status = "okay";
140};
141
142&ohci0 {
143	status = "okay";
144};
145
146&ohci1 {
147	status = "okay";
148};
149
150&pio {
151	led_pins_marsboard: led_pins@0 {
152		allwinner,pins = "PB5", "PB6", "PB7", "PB8";
153		allwinner,function = "gpio_out";
154		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
155		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
156	};
157};
158
159&reg_usb1_vbus {
160	status = "okay";
161};
162
163&reg_usb2_vbus {
164	status = "okay";
165};
166
167&spi0 {
168	pinctrl-names = "default";
169	pinctrl-0 = <&spi0_pins_a>;
170	status = "okay";
171};
172
173&uart0 {
174	pinctrl-names = "default";
175	pinctrl-0 = <&uart0_pins_a>;
176	status = "okay";
177};
178
179&usbphy {
180	usb1_vbus-supply = <&reg_usb1_vbus>;
181	usb2_vbus-supply = <&reg_usb2_vbus>;
182	status = "okay";
183};
184