/*
 * Copyright 2012 Stefan Roese
 * Stefan Roese <sr@denx.de>
 *
 * This file is dual-licensed: you can use it either under the terms
 * of the GPL or the X11 license, at your option. Note that this dual
 * licensing only applies to this file, and not this project as a
 * whole.
 *
 *  a) This file is free software; you can redistribute it and/or
 *     modify it under the terms of the GNU General Public License as
 *     published by the Free Software Foundation; either version 2 of the
 *     License, or (at your option) any later version.
 *
 *     This file is distributed in the hope that it will be useful,
 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *     GNU General Public License for more details.
 *
 *     You should have received a copy of the GNU General Public
 *     License along with this file; if not, write to the Free
 *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
 *     MA 02110-1301 USA
 *
 * Or, alternatively,
 *
 *  b) Permission is hereby granted, free of charge, to any person
 *     obtaining a copy of this software and associated documentation
 *     files (the "Software"), to deal in the Software without
 *     restriction, including without limitation the rights to use,
 *     copy, modify, merge, publish, distribute, sublicense, and/or
 *     sell copies of the Software, and to permit persons to whom the
 *     Software is furnished to do so, subject to the following
 *     conditions:
 *
 *     The above copyright notice and this permission notice shall be
 *     included in all copies or substantial portions of the Software.
 *
 *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *     OTHER DEALINGS IN THE SOFTWARE.
 */

/dts-v1/;
/include/ "sun4i-a10.dtsi"
/include/ "sunxi-common-regulators.dtsi"

/ {
	model = "Cubietech Cubieboard";
	compatible = "cubietech,a10-cubieboard", "allwinner,sun4i-a10";

	soc@01c00000 {
		emac: ethernet@01c0b000 {
			pinctrl-names = "default";
			pinctrl-0 = <&emac_pins_a>;
			phy = <&phy1>;
			status = "okay";
		};

		mdio@01c0b080 {
			status = "okay";

			phy1: ethernet-phy@1 {
				reg = <1>;
			};
		};

		mmc0: mmc@01c0f000 {
			pinctrl-names = "default";
			pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
			vmmc-supply = <&reg_vcc3v3>;
			bus-width = <4>;
			cd-gpios = <&pio 7 1 0>; /* PH1 */
			cd-inverted;
			status = "okay";
		};

		usbphy: phy@01c13400 {
			usb1_vbus-supply = <&reg_usb1_vbus>;
			usb2_vbus-supply = <&reg_usb2_vbus>;
			status = "okay";
		};

		ehci0: usb@01c14000 {
			status = "okay";
		};

		ohci0: usb@01c14400 {
			status = "okay";
		};

		ahci: sata@01c18000 {
			target-supply = <&reg_ahci_5v>;
			status = "okay";
		};

		ehci1: usb@01c1c000 {
			status = "okay";
		};

		ohci1: usb@01c1c400 {
			status = "okay";
		};

		pinctrl@01c20800 {
			led_pins_cubieboard: led_pins@0 {
				allwinner,pins = "PH20", "PH21";
				allwinner,function = "gpio_out";
				allwinner,drive = <1>;
				allwinner,pull = <0>;
			};
		};

		ir0: ir@01c21800 {
			pinctrl-names = "default";
			pinctrl-0 = <&ir0_pins_a>;
			status = "okay";
		};

		uart0: serial@01c28000 {
			pinctrl-names = "default";
			pinctrl-0 = <&uart0_pins_a>;
			status = "okay";
		};

		i2c0: i2c@01c2ac00 {
			pinctrl-names = "default";
			pinctrl-0 = <&i2c0_pins_a>;
			status = "okay";

			axp209: pmic@34 {
				compatible = "x-powers,axp209";
				reg = <0x34>;
				interrupts = <0>;

				interrupt-controller;
				#interrupt-cells = <1>;
			};
		};

		i2c1: i2c@01c2b000 {
			pinctrl-names = "default";
			pinctrl-0 = <&i2c1_pins_a>;
			status = "okay";
		};
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&led_pins_cubieboard>;

		blue {
			label = "cubieboard:blue:usr";
			gpios = <&pio 7 21 0>; /* LED1 */
		};

		green {
			label = "cubieboard:green:usr";
			gpios = <&pio 7 20 0>; /* LED2 */
			linux,default-trigger = "heartbeat";
		};
	};

	reg_ahci_5v: ahci-5v {
		status = "okay";
	};

	reg_usb1_vbus: usb1-vbus {
		status = "okay";
	};

	reg_usb2_vbus: usb2-vbus {
		status = "okay";
	};
};
