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