180e5f83cSHans de Goede/*
280e5f83cSHans de Goede * Copyright 2015 - Marcus Cooper <codekipper@gmail.com>
380e5f83cSHans de Goede *
480e5f83cSHans de Goede * This file is dual-licensed: you can use it either under the terms
580e5f83cSHans de Goede * of the GPL or the X11 license, at your option. Note that this dual
680e5f83cSHans de Goede * licensing only applies to this file, and not this project as a
780e5f83cSHans de Goede * whole.
880e5f83cSHans de Goede *
980e5f83cSHans de Goede *  a) This file is free software; you can redistribute it and/or
1080e5f83cSHans de Goede *     modify it under the terms of the GNU General Public License as
1180e5f83cSHans de Goede *     published by the Free Software Foundation; either version 2 of the
1280e5f83cSHans de Goede *     License, or (at your option) any later version.
1380e5f83cSHans de Goede *
1480e5f83cSHans de Goede *     This file is distributed in the hope that it will be useful,
1580e5f83cSHans de Goede *     but WITHOUT ANY WARRANTY; without even the implied warranty of
1680e5f83cSHans de Goede *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1780e5f83cSHans de Goede *     GNU General Public License for more details.
1880e5f83cSHans de Goede *
1980e5f83cSHans de Goede * Or, alternatively,
2080e5f83cSHans de Goede *
2180e5f83cSHans de Goede *  b) Permission is hereby granted, free of charge, to any person
2280e5f83cSHans de Goede *     obtaining a copy of this software and associated documentation
2380e5f83cSHans de Goede *     files (the "Software"), to deal in the Software without
2480e5f83cSHans de Goede *     restriction, including without limitation the rights to use,
2580e5f83cSHans de Goede *     copy, modify, merge, publish, distribute, sublicense, and/or
2680e5f83cSHans de Goede *     sell copies of the Software, and to permit persons to whom the
2780e5f83cSHans de Goede *     Software is furnished to do so, subject to the following
2880e5f83cSHans de Goede *     conditions:
2980e5f83cSHans de Goede *
3080e5f83cSHans de Goede *     The above copyright notice and this permission notice shall be
3180e5f83cSHans de Goede *     included in all copies or substantial portions of the Software.
3280e5f83cSHans de Goede *
3380e5f83cSHans de Goede *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
3480e5f83cSHans de Goede *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
3580e5f83cSHans de Goede *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
3680e5f83cSHans de Goede *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
3780e5f83cSHans de Goede *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
3880e5f83cSHans de Goede *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
3980e5f83cSHans de Goede *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
4080e5f83cSHans de Goede *     OTHER DEALINGS IN THE SOFTWARE.
4180e5f83cSHans de Goede */
4280e5f83cSHans de Goede
4380e5f83cSHans de Goede/dts-v1/;
4480e5f83cSHans de Goede#include "sun7i-a20.dtsi"
4580e5f83cSHans de Goede#include "sunxi-itead-core-common.dtsi"
4680e5f83cSHans de Goede
4780e5f83cSHans de Goede/ {
4880e5f83cSHans de Goede	model = "Itead Ibox A20";
4980e5f83cSHans de Goede	compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20";
5080e5f83cSHans de Goede
5180e5f83cSHans de Goede	leds {
5280e5f83cSHans de Goede		compatible = "gpio-leds";
5380e5f83cSHans de Goede		pinctrl-names = "default";
5480e5f83cSHans de Goede		pinctrl-0 = <&led_pins_itead_core>;
5580e5f83cSHans de Goede
5680e5f83cSHans de Goede		green {
5780e5f83cSHans de Goede			label = "itead_core:green:usr";
5880e5f83cSHans de Goede			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
5980e5f83cSHans de Goede			default-state = "on";
6080e5f83cSHans de Goede		};
6180e5f83cSHans de Goede
6280e5f83cSHans de Goede		blue {
6380e5f83cSHans de Goede			label = "itead_core:blue:usr";
6480e5f83cSHans de Goede			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
6580e5f83cSHans de Goede			default-state = "on";
6680e5f83cSHans de Goede		};
6780e5f83cSHans de Goede	};
68860fbdd4SHans de Goede
69860fbdd4SHans de Goede	sound {
70860fbdd4SHans de Goede		compatible = "simple-audio-card";
71860fbdd4SHans de Goede		simple-audio-card,name = "On-board SPDIF";
72860fbdd4SHans de Goede
73860fbdd4SHans de Goede		simple-audio-card,cpu {
74860fbdd4SHans de Goede			sound-dai = <&spdif>;
75860fbdd4SHans de Goede		};
76860fbdd4SHans de Goede
77860fbdd4SHans de Goede		simple-audio-card,codec {
78860fbdd4SHans de Goede			sound-dai = <&spdif_out>;
79860fbdd4SHans de Goede		};
80860fbdd4SHans de Goede	};
81860fbdd4SHans de Goede
82860fbdd4SHans de Goede	spdif_out: spdif-out {
83860fbdd4SHans de Goede		#sound-dai-cells = <0>;
84860fbdd4SHans de Goede		compatible = "linux,spdif-dit";
85860fbdd4SHans de Goede	};
8680e5f83cSHans de Goede};
8780e5f83cSHans de Goede
8880e5f83cSHans de Goede&ahci {
8980e5f83cSHans de Goede	target-supply = <&reg_ahci_5v>;
9080e5f83cSHans de Goede	status = "okay";
9180e5f83cSHans de Goede};
9280e5f83cSHans de Goede
9380e5f83cSHans de Goede&codec {
9480e5f83cSHans de Goede	status = "okay";
9580e5f83cSHans de Goede};
9680e5f83cSHans de Goede
9780e5f83cSHans de Goede&gmac {
9880e5f83cSHans de Goede	pinctrl-names = "default";
9980e5f83cSHans de Goede	pinctrl-0 = <&gmac_pins_mii_a>;
10080e5f83cSHans de Goede	phy = <&phy1>;
10180e5f83cSHans de Goede	phy-mode = "mii";
10280e5f83cSHans de Goede	status = "okay";
10380e5f83cSHans de Goede
10480e5f83cSHans de Goede	phy1: ethernet-phy@1 {
10580e5f83cSHans de Goede		reg = <1>;
10680e5f83cSHans de Goede	};
10780e5f83cSHans de Goede};
10880e5f83cSHans de Goede
10980e5f83cSHans de Goede&i2c0 {
11080e5f83cSHans de Goede	axp209: pmic@34 {
11180e5f83cSHans de Goede		interrupt-parent = <&nmi_intc>;
11280e5f83cSHans de Goede		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
11380e5f83cSHans de Goede	};
11480e5f83cSHans de Goede};
11580e5f83cSHans de Goede
11680e5f83cSHans de Goede&ir0 {
11780e5f83cSHans de Goede	pinctrl-names = "default";
11880e5f83cSHans de Goede	pinctrl-0 = <&ir0_rx_pins_a>;
11980e5f83cSHans de Goede	status = "okay";
12080e5f83cSHans de Goede};
12180e5f83cSHans de Goede
12280e5f83cSHans de Goede&mmc0 {
12380e5f83cSHans de Goede	pinctrl-names = "default";
124*b9d59d08SJagan Teki	pinctrl-0 = <&mmc0_pins_a>;
12580e5f83cSHans de Goede	vmmc-supply = <&reg_vcc3v3>;
12680e5f83cSHans de Goede	bus-width = <4>;
127*b9d59d08SJagan Teki	cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
12880e5f83cSHans de Goede	status = "okay";
12980e5f83cSHans de Goede};
13080e5f83cSHans de Goede
13180e5f83cSHans de Goede&pio {
13280e5f83cSHans de Goede	led_pins_itead_core: led_pins@0 {
133*b9d59d08SJagan Teki		pins = "PH20","PH21";
134*b9d59d08SJagan Teki		function = "gpio_out";
135*b9d59d08SJagan Teki		drive-strength = <20>;
13680e5f83cSHans de Goede	};
13780e5f83cSHans de Goede};
13880e5f83cSHans de Goede
13980e5f83cSHans de Goede&reg_ahci_5v {
14080e5f83cSHans de Goede	status = "okay";
14180e5f83cSHans de Goede};
142860fbdd4SHans de Goede
143860fbdd4SHans de Goede&spdif {
144860fbdd4SHans de Goede	pinctrl-names = "default";
145860fbdd4SHans de Goede	pinctrl-0 = <&spdif_tx_pins_a>;
146860fbdd4SHans de Goede	status = "okay";
147860fbdd4SHans de Goede};
148