153ab4af3SHans de Goede/*
253ab4af3SHans de Goede * Copyright 2014 - Hans de Goede <hdegoede@redhat.com>
353ab4af3SHans de Goede *
453ab4af3SHans de Goede * This file is dual-licensed: you can use it either under the terms
553ab4af3SHans de Goede * of the GPL or the X11 license, at your option. Note that this dual
653ab4af3SHans de Goede * licensing only applies to this file, and not this project as a
753ab4af3SHans de Goede * whole.
853ab4af3SHans de Goede *
953ab4af3SHans de Goede *  a) This file is free software; you can redistribute it and/or
1053ab4af3SHans de Goede *     modify it under the terms of the GNU General Public License as
1153ab4af3SHans de Goede *     published by the Free Software Foundation; either version 2 of the
1253ab4af3SHans de Goede *     License, or (at your option) any later version.
1353ab4af3SHans de Goede *
1453ab4af3SHans de Goede *     This file is distributed in the hope that it will be useful,
1553ab4af3SHans de Goede *     but WITHOUT ANY WARRANTY; without even the implied warranty of
1653ab4af3SHans de Goede *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1753ab4af3SHans de Goede *     GNU General Public License for more details.
1853ab4af3SHans de Goede *
1953ab4af3SHans de Goede * Or, alternatively,
2053ab4af3SHans de Goede *
2153ab4af3SHans de Goede *  b) Permission is hereby granted, free of charge, to any person
2253ab4af3SHans de Goede *     obtaining a copy of this software and associated documentation
2353ab4af3SHans de Goede *     files (the "Software"), to deal in the Software without
2453ab4af3SHans de Goede *     restriction, including without limitation the rights to use,
2553ab4af3SHans de Goede *     copy, modify, merge, publish, distribute, sublicense, and/or
2653ab4af3SHans de Goede *     sell copies of the Software, and to permit persons to whom the
2753ab4af3SHans de Goede *     Software is furnished to do so, subject to the following
2853ab4af3SHans de Goede *     conditions:
2953ab4af3SHans de Goede *
3053ab4af3SHans de Goede *     The above copyright notice and this permission notice shall be
3153ab4af3SHans de Goede *     included in all copies or substantial portions of the Software.
3253ab4af3SHans de Goede *
3353ab4af3SHans de Goede *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3453ab4af3SHans de Goede *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3553ab4af3SHans de Goede *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3653ab4af3SHans de Goede *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3753ab4af3SHans de Goede *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3853ab4af3SHans de Goede *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3953ab4af3SHans de Goede *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4053ab4af3SHans de Goede *     OTHER DEALINGS IN THE SOFTWARE.
4153ab4af3SHans de Goede */
4253ab4af3SHans de Goede
4353ab4af3SHans de Goede/dts-v1/;
4453ab4af3SHans de Goede#include "sun4i-a10.dtsi"
4553ab4af3SHans de Goede#include "sunxi-common-regulators.dtsi"
4653ab4af3SHans de Goede
4753ab4af3SHans de Goede#include <dt-bindings/gpio/gpio.h>
4853ab4af3SHans de Goede
4953ab4af3SHans de Goede/ {
5053ab4af3SHans de Goede	model = "Olimex A10-OLinuXino-LIME";
5153ab4af3SHans de Goede	compatible = "olimex,a10-olinuxino-lime", "allwinner,sun4i-a10";
5253ab4af3SHans de Goede
5353ab4af3SHans de Goede	aliases {
5453ab4af3SHans de Goede		serial0 = &uart0;
5553ab4af3SHans de Goede	};
5653ab4af3SHans de Goede
5753ab4af3SHans de Goede	chosen {
5853ab4af3SHans de Goede		stdout-path = "serial0:115200n8";
5953ab4af3SHans de Goede	};
6053ab4af3SHans de Goede
61*3c92cca3SJagan Teki	hdmi-connector {
62*3c92cca3SJagan Teki		compatible = "hdmi-connector";
63*3c92cca3SJagan Teki		type = "a";
64*3c92cca3SJagan Teki
65*3c92cca3SJagan Teki		port {
66*3c92cca3SJagan Teki			hdmi_con_in: endpoint {
67*3c92cca3SJagan Teki				remote-endpoint = <&hdmi_out_con>;
68*3c92cca3SJagan Teki			};
69*3c92cca3SJagan Teki		};
70*3c92cca3SJagan Teki	};
71*3c92cca3SJagan Teki
7253ab4af3SHans de Goede	leds {
7353ab4af3SHans de Goede		compatible = "gpio-leds";
7453ab4af3SHans de Goede		pinctrl-names = "default";
7553ab4af3SHans de Goede		pinctrl-0 = <&led_pins_olinuxinolime>;
7653ab4af3SHans de Goede
7753ab4af3SHans de Goede		green {
7853ab4af3SHans de Goede			label = "a10-olinuxino-lime:green:usr";
7953ab4af3SHans de Goede			gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>;
8053ab4af3SHans de Goede			default-state = "on";
8153ab4af3SHans de Goede		};
8253ab4af3SHans de Goede	};
8353ab4af3SHans de Goede};
8453ab4af3SHans de Goede
8553ab4af3SHans de Goede&ahci {
8653ab4af3SHans de Goede	target-supply = <&reg_ahci_5v>;
8753ab4af3SHans de Goede	status = "okay";
8853ab4af3SHans de Goede};
8953ab4af3SHans de Goede
9053ab4af3SHans de Goede&cpu0 {
9153ab4af3SHans de Goede	/*
9253ab4af3SHans de Goede	 * The A10-Lime is known to be unstable when running at 1008 MHz
9353ab4af3SHans de Goede	 */
9453ab4af3SHans de Goede	operating-points = <
9553ab4af3SHans de Goede		/* kHz    uV */
9653ab4af3SHans de Goede		912000  1350000
9753ab4af3SHans de Goede		864000  1300000
9853ab4af3SHans de Goede		624000  1250000
9953ab4af3SHans de Goede		>;
100*3c92cca3SJagan Teki};
101*3c92cca3SJagan Teki
102*3c92cca3SJagan Teki&de {
103*3c92cca3SJagan Teki	status = "okay";
10453ab4af3SHans de Goede};
10553ab4af3SHans de Goede
10653ab4af3SHans de Goede&ehci0 {
10753ab4af3SHans de Goede	status = "okay";
10853ab4af3SHans de Goede};
10953ab4af3SHans de Goede
11053ab4af3SHans de Goede&ehci1 {
11153ab4af3SHans de Goede	status = "okay";
11253ab4af3SHans de Goede};
11353ab4af3SHans de Goede
11453ab4af3SHans de Goede&emac {
11553ab4af3SHans de Goede	phy = <&phy1>;
11653ab4af3SHans de Goede	status = "okay";
11753ab4af3SHans de Goede};
11853ab4af3SHans de Goede
1198b1ba941SHans de Goede&emac_sram {
1208b1ba941SHans de Goede	status = "okay";
1218b1ba941SHans de Goede};
1228b1ba941SHans de Goede
123*3c92cca3SJagan Teki&hdmi {
124*3c92cca3SJagan Teki	status = "okay";
125*3c92cca3SJagan Teki};
126*3c92cca3SJagan Teki
127*3c92cca3SJagan Teki&hdmi_out {
128*3c92cca3SJagan Teki	hdmi_out_con: endpoint {
129*3c92cca3SJagan Teki		remote-endpoint = <&hdmi_con_in>;
130*3c92cca3SJagan Teki	};
131*3c92cca3SJagan Teki};
132*3c92cca3SJagan Teki
13353ab4af3SHans de Goede&i2c0 {
13453ab4af3SHans de Goede	status = "okay";
13553ab4af3SHans de Goede
13653ab4af3SHans de Goede	axp209: pmic@34 {
13753ab4af3SHans de Goede		compatible = "x-powers,axp209";
13853ab4af3SHans de Goede		reg = <0x34>;
13953ab4af3SHans de Goede		interrupts = <0>;
14053ab4af3SHans de Goede
14153ab4af3SHans de Goede		interrupt-controller;
14253ab4af3SHans de Goede		#interrupt-cells = <1>;
14353ab4af3SHans de Goede	};
14453ab4af3SHans de Goede};
14553ab4af3SHans de Goede
14680e5f83cSHans de Goede&i2c1 {
14780e5f83cSHans de Goede	status = "okay";
14880e5f83cSHans de Goede
14980e5f83cSHans de Goede	eeprom: eeprom@50 {
15080e5f83cSHans de Goede		compatible = "atmel,24c16";
15180e5f83cSHans de Goede		reg = <0x50>;
15280e5f83cSHans de Goede		pagesize = <16>;
15380e5f83cSHans de Goede	};
15480e5f83cSHans de Goede};
15580e5f83cSHans de Goede
15653ab4af3SHans de Goede&mdio {
15753ab4af3SHans de Goede	status = "okay";
15853ab4af3SHans de Goede
15953ab4af3SHans de Goede	phy1: ethernet-phy@1 {
16053ab4af3SHans de Goede		reg = <1>;
16153ab4af3SHans de Goede	};
16253ab4af3SHans de Goede};
16353ab4af3SHans de Goede
16453ab4af3SHans de Goede&mmc0 {
16553ab4af3SHans de Goede	vmmc-supply = <&reg_vcc3v3>;
16653ab4af3SHans de Goede	bus-width = <4>;
167*3c92cca3SJagan Teki	cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
16853ab4af3SHans de Goede	status = "okay";
16953ab4af3SHans de Goede};
17053ab4af3SHans de Goede
17153ab4af3SHans de Goede&ohci0 {
17253ab4af3SHans de Goede	status = "okay";
17353ab4af3SHans de Goede};
17453ab4af3SHans de Goede
17553ab4af3SHans de Goede&ohci1 {
17653ab4af3SHans de Goede	status = "okay";
17753ab4af3SHans de Goede};
17853ab4af3SHans de Goede
179da52a4a3SHans de Goede&otg_sram {
180da52a4a3SHans de Goede	status = "okay";
181da52a4a3SHans de Goede};
182da52a4a3SHans de Goede
18353ab4af3SHans de Goede&pio {
184*3c92cca3SJagan Teki	led_pins_olinuxinolime: led-pin {
185*3c92cca3SJagan Teki		pins = "PH2";
186*3c92cca3SJagan Teki		function = "gpio_out";
187*3c92cca3SJagan Teki		drive-strength = <20>;
18853ab4af3SHans de Goede	};
18953ab4af3SHans de Goede
190*3c92cca3SJagan Teki	usb0_id_detect_pin: usb0-id-detect-pin {
191*3c92cca3SJagan Teki		pins = "PH4";
192*3c92cca3SJagan Teki		function = "gpio_in";
193*3c92cca3SJagan Teki		bias-pull-up;
19453ab4af3SHans de Goede	};
195da52a4a3SHans de Goede
196*3c92cca3SJagan Teki	usb0_vbus_detect_pin: usb0-vbus-detect-pin {
197*3c92cca3SJagan Teki		pins = "PH5";
198*3c92cca3SJagan Teki		function = "gpio_in";
199*3c92cca3SJagan Teki		bias-pull-down;
200da52a4a3SHans de Goede	};
20153ab4af3SHans de Goede};
20253ab4af3SHans de Goede
20353ab4af3SHans de Goede&reg_ahci_5v {
20453ab4af3SHans de Goede	gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
20553ab4af3SHans de Goede	status = "okay";
20653ab4af3SHans de Goede};
20753ab4af3SHans de Goede
208da52a4a3SHans de Goede&reg_usb0_vbus {
209da52a4a3SHans de Goede	status = "okay";
210da52a4a3SHans de Goede};
211da52a4a3SHans de Goede
21253ab4af3SHans de Goede&reg_usb1_vbus {
21353ab4af3SHans de Goede	status = "okay";
21453ab4af3SHans de Goede};
21553ab4af3SHans de Goede
21653ab4af3SHans de Goede&reg_usb2_vbus {
21753ab4af3SHans de Goede	status = "okay";
21853ab4af3SHans de Goede};
21953ab4af3SHans de Goede
22053ab4af3SHans de Goede&uart0 {
22153ab4af3SHans de Goede	pinctrl-names = "default";
222*3c92cca3SJagan Teki	pinctrl-0 = <&uart0_pb_pins>;
22353ab4af3SHans de Goede	status = "okay";
22453ab4af3SHans de Goede};
22553ab4af3SHans de Goede
226da52a4a3SHans de Goede&usb_otg {
227da52a4a3SHans de Goede	dr_mode = "otg";
228da52a4a3SHans de Goede	status = "okay";
229da52a4a3SHans de Goede};
230da52a4a3SHans de Goede
23153ab4af3SHans de Goede&usbphy {
232da52a4a3SHans de Goede	pinctrl-names = "default";
233da52a4a3SHans de Goede	pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
234da52a4a3SHans de Goede	usb0_id_det-gpio   = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
235da52a4a3SHans de Goede	usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
236da52a4a3SHans de Goede	usb0_vbus-supply   = <&reg_usb0_vbus>;
23753ab4af3SHans de Goede	usb1_vbus-supply = <&reg_usb1_vbus>;
23853ab4af3SHans de Goede	usb2_vbus-supply = <&reg_usb2_vbus>;
23953ab4af3SHans de Goede	status = "okay";
24053ab4af3SHans de Goede};
241