153ab4af3SHans de Goede/*
253ab4af3SHans de Goede * Copyright 2014 Zoltan HERPAI
353ab4af3SHans de Goede * Zoltan HERPAI <wigyori@uid0.hu>
453ab4af3SHans de Goede *
553ab4af3SHans de Goede * This file is dual-licensed: you can use it either under the terms
653ab4af3SHans de Goede * of the GPL or the X11 license, at your option. Note that this dual
753ab4af3SHans de Goede * licensing only applies to this file, and not this project as a
853ab4af3SHans de Goede * whole.
953ab4af3SHans de Goede *
1053ab4af3SHans de Goede *  a) This file is free software; you can redistribute it and/or
1153ab4af3SHans de Goede *     modify it under the terms of the GNU General Public License as
1253ab4af3SHans de Goede *     published by the Free Software Foundation; either version 2 of the
1353ab4af3SHans de Goede *     License, or (at your option) any later version.
1453ab4af3SHans de Goede *
1553ab4af3SHans de Goede *     This file is distributed in the hope that it will be useful,
1653ab4af3SHans de Goede *     but WITHOUT ANY WARRANTY; without even the implied warranty of
1753ab4af3SHans de Goede *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1853ab4af3SHans de Goede *     GNU General Public License for more details.
1953ab4af3SHans de Goede *
2053ab4af3SHans de Goede * Or, alternatively,
2153ab4af3SHans de Goede *
2253ab4af3SHans de Goede *  b) Permission is hereby granted, free of charge, to any person
2353ab4af3SHans de Goede *     obtaining a copy of this software and associated documentation
2453ab4af3SHans de Goede *     files (the "Software"), to deal in the Software without
2553ab4af3SHans de Goede *     restriction, including without limitation the rights to use,
2653ab4af3SHans de Goede *     copy, modify, merge, publish, distribute, sublicense, and/or
2753ab4af3SHans de Goede *     sell copies of the Software, and to permit persons to whom the
2853ab4af3SHans de Goede *     Software is furnished to do so, subject to the following
2953ab4af3SHans de Goede *     conditions:
3053ab4af3SHans de Goede *
3153ab4af3SHans de Goede *     The above copyright notice and this permission notice shall be
3253ab4af3SHans de Goede *     included in all copies or substantial portions of the Software.
3353ab4af3SHans de Goede *
3453ab4af3SHans de Goede *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3553ab4af3SHans de Goede *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3653ab4af3SHans de Goede *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3753ab4af3SHans de Goede *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3853ab4af3SHans de Goede *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3953ab4af3SHans de Goede *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4053ab4af3SHans de Goede *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4153ab4af3SHans de Goede *     OTHER DEALINGS IN THE SOFTWARE.
4253ab4af3SHans de Goede */
4353ab4af3SHans de Goede
4453ab4af3SHans de Goede/dts-v1/;
4553ab4af3SHans de Goede#include "sun4i-a10.dtsi"
4653ab4af3SHans de Goede#include "sunxi-common-regulators.dtsi"
4753ab4af3SHans de Goede
4853ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h>
4953ab4af3SHans de Goede#include <dt-bindings/input/input.h>
5053ab4af3SHans de Goede#include <dt-bindings/pinctrl/sun4i-a10.h>
5153ab4af3SHans de Goede
5253ab4af3SHans de Goede/ {
5353ab4af3SHans de Goede	model = "LinkSprite pcDuino";
5453ab4af3SHans de Goede	compatible = "linksprite,a10-pcduino", "allwinner,sun4i-a10";
5553ab4af3SHans de Goede
5653ab4af3SHans de Goede	aliases {
5753ab4af3SHans de Goede		serial0 = &uart0;
5853ab4af3SHans de Goede	};
5953ab4af3SHans de Goede
6053ab4af3SHans de Goede	chosen {
6153ab4af3SHans de Goede		stdout-path = "serial0:115200n8";
6253ab4af3SHans de Goede	};
6353ab4af3SHans de Goede
6453ab4af3SHans de Goede	leds {
6553ab4af3SHans de Goede		compatible = "gpio-leds";
6653ab4af3SHans de Goede		pinctrl-names = "default";
6753ab4af3SHans de Goede		pinctrl-0 = <&led_pins_pcduino>;
6853ab4af3SHans de Goede
6953ab4af3SHans de Goede		tx {
7053ab4af3SHans de Goede			label = "pcduino:green:tx";
7153ab4af3SHans de Goede			gpios = <&pio 7 15 GPIO_ACTIVE_LOW>;
7253ab4af3SHans de Goede		};
7353ab4af3SHans de Goede
7453ab4af3SHans de Goede		rx {
7553ab4af3SHans de Goede			label = "pcduino:green:rx";
7653ab4af3SHans de Goede			gpios = <&pio 7 16 GPIO_ACTIVE_LOW>;
7753ab4af3SHans de Goede		};
7853ab4af3SHans de Goede	};
7953ab4af3SHans de Goede
8053ab4af3SHans de Goede	gpio_keys {
8153ab4af3SHans de Goede		compatible = "gpio-keys";
8253ab4af3SHans de Goede		pinctrl-names = "default";
8353ab4af3SHans de Goede		pinctrl-0 = <&key_pins_pcduino>;
8453ab4af3SHans de Goede		#address-cells = <1>;
8553ab4af3SHans de Goede		#size-cells = <0>;
8653ab4af3SHans de Goede
8753ab4af3SHans de Goede		button@0 {
8853ab4af3SHans de Goede			label = "Key Back";
8953ab4af3SHans de Goede			linux,code = <KEY_BACK>;
9053ab4af3SHans de Goede			gpios = <&pio 7 17 GPIO_ACTIVE_LOW>;
9153ab4af3SHans de Goede		};
9253ab4af3SHans de Goede
9353ab4af3SHans de Goede		button@1 {
9453ab4af3SHans de Goede			label = "Key Home";
9553ab4af3SHans de Goede			linux,code = <KEY_HOME>;
9653ab4af3SHans de Goede			gpios = <&pio 7 18 GPIO_ACTIVE_LOW>;
9753ab4af3SHans de Goede		};
9853ab4af3SHans de Goede
9953ab4af3SHans de Goede		button@2 {
10053ab4af3SHans de Goede			label = "Key Menu";
10153ab4af3SHans de Goede			linux,code = <KEY_MENU>;
10253ab4af3SHans de Goede			gpios = <&pio 7 19 GPIO_ACTIVE_LOW>;
10353ab4af3SHans de Goede		};
10453ab4af3SHans de Goede	};
10553ab4af3SHans de Goede};
10653ab4af3SHans de Goede
107*80e5f83cSHans de Goede&cpu0 {
108*80e5f83cSHans de Goede	cpu-supply = <&reg_dcdc2>;
109*80e5f83cSHans de Goede};
110*80e5f83cSHans de Goede
11153ab4af3SHans de Goede&ehci0 {
11253ab4af3SHans de Goede	status = "okay";
11353ab4af3SHans de Goede};
11453ab4af3SHans de Goede
11553ab4af3SHans de Goede&ehci1 {
11653ab4af3SHans de Goede	status = "okay";
11753ab4af3SHans de Goede};
11853ab4af3SHans de Goede
11953ab4af3SHans de Goede&emac {
12053ab4af3SHans de Goede	pinctrl-names = "default";
12153ab4af3SHans de Goede	pinctrl-0 = <&emac_pins_a>;
12253ab4af3SHans de Goede	phy = <&phy1>;
12353ab4af3SHans de Goede	status = "okay";
12453ab4af3SHans de Goede};
12553ab4af3SHans de Goede
1268b1ba941SHans de Goede&emac_sram {
1278b1ba941SHans de Goede	status = "okay";
1288b1ba941SHans de Goede};
1298b1ba941SHans de Goede
13053ab4af3SHans de Goede&i2c0 {
13153ab4af3SHans de Goede	pinctrl-names = "default";
13253ab4af3SHans de Goede	pinctrl-0 = <&i2c0_pins_a>;
13353ab4af3SHans de Goede	status = "okay";
13453ab4af3SHans de Goede
13553ab4af3SHans de Goede	axp209: pmic@34 {
13653ab4af3SHans de Goede		reg = <0x34>;
13753ab4af3SHans de Goede		interrupts = <0>;
13853ab4af3SHans de Goede	};
13953ab4af3SHans de Goede};
14053ab4af3SHans de Goede
14153ab4af3SHans de Goede&mdio {
14253ab4af3SHans de Goede	status = "okay";
14353ab4af3SHans de Goede
14453ab4af3SHans de Goede	phy1: ethernet-phy@1 {
14553ab4af3SHans de Goede		reg = <1>;
14653ab4af3SHans de Goede	};
14753ab4af3SHans de Goede};
14853ab4af3SHans de Goede
14953ab4af3SHans de Goede&mmc0 {
15053ab4af3SHans de Goede	pinctrl-names = "default";
15153ab4af3SHans de Goede	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
15253ab4af3SHans de Goede	vmmc-supply = <&reg_vcc3v3>;
15353ab4af3SHans de Goede	bus-width = <4>;
15453ab4af3SHans de Goede	cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
15553ab4af3SHans de Goede	cd-inverted;
15653ab4af3SHans de Goede	status = "okay";
15753ab4af3SHans de Goede};
15853ab4af3SHans de Goede
15953ab4af3SHans de Goede&ohci0 {
16053ab4af3SHans de Goede	status = "okay";
16153ab4af3SHans de Goede};
16253ab4af3SHans de Goede
16353ab4af3SHans de Goede&ohci1 {
16453ab4af3SHans de Goede	status = "okay";
16553ab4af3SHans de Goede};
16653ab4af3SHans de Goede
167*80e5f83cSHans de Goede&otg_sram {
168*80e5f83cSHans de Goede	status = "okay";
169*80e5f83cSHans de Goede};
170*80e5f83cSHans de Goede
17153ab4af3SHans de Goede&pio {
17253ab4af3SHans de Goede	led_pins_pcduino: led_pins@0 {
17353ab4af3SHans de Goede		allwinner,pins = "PH15", "PH16";
17453ab4af3SHans de Goede		allwinner,function = "gpio_out";
17553ab4af3SHans de Goede		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
17653ab4af3SHans de Goede		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
17753ab4af3SHans de Goede	};
17853ab4af3SHans de Goede
17953ab4af3SHans de Goede	key_pins_pcduino: key_pins@0 {
18053ab4af3SHans de Goede		allwinner,pins = "PH17", "PH18", "PH19";
18153ab4af3SHans de Goede		allwinner,function = "gpio_in";
18253ab4af3SHans de Goede		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
18353ab4af3SHans de Goede		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
18453ab4af3SHans de Goede	};
185*80e5f83cSHans de Goede
186*80e5f83cSHans de Goede	usb0_id_detect_pin: usb0_id_detect_pin@0 {
187*80e5f83cSHans de Goede		allwinner,pins = "PH4";
188*80e5f83cSHans de Goede		allwinner,function = "gpio_in";
189*80e5f83cSHans de Goede		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
190*80e5f83cSHans de Goede		allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
191*80e5f83cSHans de Goede	};
19253ab4af3SHans de Goede};
19353ab4af3SHans de Goede
194*80e5f83cSHans de Goede#include "axp209.dtsi"
195*80e5f83cSHans de Goede
196*80e5f83cSHans de Goede&reg_dcdc2 {
197*80e5f83cSHans de Goede	regulator-always-on;
198*80e5f83cSHans de Goede	regulator-min-microvolt = <1000000>;
199*80e5f83cSHans de Goede	regulator-max-microvolt = <1400000>;
200*80e5f83cSHans de Goede	regulator-name = "vdd-cpu";
20153ab4af3SHans de Goede};
20253ab4af3SHans de Goede
203*80e5f83cSHans de Goede&reg_dcdc3 {
204*80e5f83cSHans de Goede	regulator-always-on;
205*80e5f83cSHans de Goede	regulator-min-microvolt = <1000000>;
206*80e5f83cSHans de Goede	regulator-max-microvolt = <1400000>;
207*80e5f83cSHans de Goede	regulator-name = "vdd-int-dll";
208*80e5f83cSHans de Goede};
209*80e5f83cSHans de Goede
210*80e5f83cSHans de Goede&reg_ldo1 {
211*80e5f83cSHans de Goede	regulator-name = "vdd-rtc";
212*80e5f83cSHans de Goede};
213*80e5f83cSHans de Goede
214*80e5f83cSHans de Goede&reg_ldo2 {
215*80e5f83cSHans de Goede	regulator-always-on;
216*80e5f83cSHans de Goede	regulator-min-microvolt = <3000000>;
217*80e5f83cSHans de Goede	regulator-max-microvolt = <3000000>;
218*80e5f83cSHans de Goede	regulator-name = "avcc";
21953ab4af3SHans de Goede};
22053ab4af3SHans de Goede
22153ab4af3SHans de Goede&uart0 {
22253ab4af3SHans de Goede	pinctrl-names = "default";
22353ab4af3SHans de Goede	pinctrl-0 = <&uart0_pins_a>;
22453ab4af3SHans de Goede	status = "okay";
22553ab4af3SHans de Goede};
22653ab4af3SHans de Goede
227*80e5f83cSHans de Goede&usb_otg {
228*80e5f83cSHans de Goede	dr_mode = "otg";
229*80e5f83cSHans de Goede	status = "okay";
230*80e5f83cSHans de Goede};
231*80e5f83cSHans de Goede
23253ab4af3SHans de Goede&usbphy {
233*80e5f83cSHans de Goede	pinctrl-names = "default";
234*80e5f83cSHans de Goede	pinctrl-0 = <&usb0_id_detect_pin>;
235*80e5f83cSHans de Goede	usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
236*80e5f83cSHans de Goede	usb1_vbus-supply = <&reg_vcc5v0>; /* USB1 VBUS is always on */
237*80e5f83cSHans de Goede	usb2_vbus-supply = <&reg_vcc5v0>; /* USB2 VBUS is always on */
23853ab4af3SHans de Goede	status = "okay";
23953ab4af3SHans de Goede};
240