xref: /openbmc/u-boot/arch/arm/dts/sun6i-a31-m9.dts (revision cc49e2bdb8fbd47af28cb7e47696322586e9fff1)
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 "sun6i-a31.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/ {
50da52a4a3SHans de Goede	model = "Mele M9 top set box";
5153ab4af3SHans de Goede	compatible = "mele,m9", "allwinner,sun6i-a31";
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
6153ab4af3SHans de Goede	leds {
6253ab4af3SHans de Goede		compatible = "gpio-leds";
6353ab4af3SHans de Goede		pinctrl-names = "default";
6453ab4af3SHans de Goede		pinctrl-0 = <&led_pins_m9>;
6553ab4af3SHans de Goede
6653ab4af3SHans de Goede		blue {
67860fbdd4SHans de Goede			label = "m9:blue:pwr";
6853ab4af3SHans de Goede			gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>;
69860fbdd4SHans de Goede			default-state = "on";
7053ab4af3SHans de Goede		};
7153ab4af3SHans de Goede	};
7253ab4af3SHans de Goede};
7353ab4af3SHans de Goede
74860fbdd4SHans de Goede&cpu0 {
75860fbdd4SHans de Goede	cpu-supply = <&reg_dcdc3>;
76860fbdd4SHans de Goede};
77860fbdd4SHans de Goede
7853ab4af3SHans de Goede&ehci0 {
7953ab4af3SHans de Goede	status = "okay";
8053ab4af3SHans de Goede};
8153ab4af3SHans de Goede
8253ab4af3SHans de Goede&ehci1 {
8353ab4af3SHans de Goede	status = "okay";
8453ab4af3SHans de Goede};
8553ab4af3SHans de Goede
8653ab4af3SHans de Goede&gmac {
8753ab4af3SHans de Goede	pinctrl-names = "default";
8853ab4af3SHans de Goede	pinctrl-0 = <&gmac_pins_mii_a>;
8953ab4af3SHans de Goede	phy = <&phy1>;
9053ab4af3SHans de Goede	phy-mode = "mii";
91860fbdd4SHans de Goede	phy-supply = <&reg_dldo1>;
9253ab4af3SHans de Goede	status = "okay";
9353ab4af3SHans de Goede
9453ab4af3SHans de Goede	phy1: ethernet-phy@1 {
9553ab4af3SHans de Goede		reg = <1>;
9653ab4af3SHans de Goede	};
9753ab4af3SHans de Goede};
9853ab4af3SHans de Goede
9953ab4af3SHans de Goede&ir {
10053ab4af3SHans de Goede	pinctrl-names = "default";
10153ab4af3SHans de Goede	pinctrl-0 = <&ir_pins_a>;
10253ab4af3SHans de Goede	status = "okay";
10353ab4af3SHans de Goede};
10453ab4af3SHans de Goede
10553ab4af3SHans de Goede&mmc0 {
10653ab4af3SHans de Goede	pinctrl-names = "default";
10753ab4af3SHans de Goede	pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_m9>;
108860fbdd4SHans de Goede	vmmc-supply = <&reg_dcdc1>;
10953ab4af3SHans de Goede	bus-width = <4>;
110*d1d4295aSJagan Teki	cd-gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
11153ab4af3SHans de Goede	status = "okay";
11253ab4af3SHans de Goede};
11353ab4af3SHans de Goede
114860fbdd4SHans de Goede&p2wi {
115860fbdd4SHans de Goede	status = "okay";
116860fbdd4SHans de Goede
117860fbdd4SHans de Goede	axp22x: pmic@68 {
118860fbdd4SHans de Goede		compatible = "x-powers,axp221";
119860fbdd4SHans de Goede		reg = <0x68>;
120860fbdd4SHans de Goede		interrupt-parent = <&nmi_intc>;
121860fbdd4SHans de Goede		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
122860fbdd4SHans de Goede	};
123860fbdd4SHans de Goede};
124860fbdd4SHans de Goede
125860fbdd4SHans de Goede#include "axp22x.dtsi"
126860fbdd4SHans de Goede
12753ab4af3SHans de Goede&pio {
12853ab4af3SHans de Goede	led_pins_m9: led_pins@0 {
129*d1d4295aSJagan Teki		pins = "PH13";
130*d1d4295aSJagan Teki		function = "gpio_out";
13153ab4af3SHans de Goede	};
13253ab4af3SHans de Goede
13353ab4af3SHans de Goede	mmc0_cd_pin_m9: mmc0_cd_pin@0 {
134*d1d4295aSJagan Teki		pins = "PH22";
135*d1d4295aSJagan Teki		function = "gpio_in";
136*d1d4295aSJagan Teki		bias-pull-up;
13753ab4af3SHans de Goede	};
13853ab4af3SHans de Goede
13953ab4af3SHans de Goede	usb1_vbus_pin_m9: usb1_vbus_pin@0 {
140*d1d4295aSJagan Teki		pins = "PC27";
141*d1d4295aSJagan Teki		function = "gpio_out";
14253ab4af3SHans de Goede	};
14353ab4af3SHans de Goede};
14453ab4af3SHans de Goede
145860fbdd4SHans de Goede&reg_aldo1 {
146860fbdd4SHans de Goede	regulator-min-microvolt = <3300000>;
147860fbdd4SHans de Goede	regulator-max-microvolt = <3300000>;
148860fbdd4SHans de Goede	regulator-name = "vcc-wifi";
149860fbdd4SHans de Goede};
150860fbdd4SHans de Goede
151860fbdd4SHans de Goede&reg_aldo3 {
152860fbdd4SHans de Goede	regulator-always-on;
153860fbdd4SHans de Goede	regulator-min-microvolt = <2700000>;
154860fbdd4SHans de Goede	regulator-max-microvolt = <3300000>;
155860fbdd4SHans de Goede	regulator-name = "avcc";
156860fbdd4SHans de Goede};
157860fbdd4SHans de Goede
158860fbdd4SHans de Goede&reg_dc5ldo {
159860fbdd4SHans de Goede	regulator-always-on;
160860fbdd4SHans de Goede	regulator-min-microvolt = <700000>;
161860fbdd4SHans de Goede	regulator-max-microvolt = <1320000>;
162860fbdd4SHans de Goede	regulator-name = "vdd-cpus"; /* This is an educated guess */
163860fbdd4SHans de Goede};
164860fbdd4SHans de Goede
165860fbdd4SHans de Goede&reg_dcdc1 {
166860fbdd4SHans de Goede	regulator-always-on;
167860fbdd4SHans de Goede	regulator-min-microvolt = <3300000>;
168860fbdd4SHans de Goede	regulator-max-microvolt = <3300000>;
169860fbdd4SHans de Goede	regulator-name = "vcc-3v3";
170860fbdd4SHans de Goede};
171860fbdd4SHans de Goede
172860fbdd4SHans de Goede&reg_dcdc2 {
173860fbdd4SHans de Goede	regulator-min-microvolt = <700000>;
174860fbdd4SHans de Goede	regulator-max-microvolt = <1320000>;
175860fbdd4SHans de Goede	regulator-name = "vdd-gpu";
176860fbdd4SHans de Goede};
177860fbdd4SHans de Goede
178860fbdd4SHans de Goede&reg_dcdc3 {
179860fbdd4SHans de Goede	regulator-always-on;
180860fbdd4SHans de Goede	regulator-min-microvolt = <700000>;
181860fbdd4SHans de Goede	regulator-max-microvolt = <1320000>;
182860fbdd4SHans de Goede	regulator-name = "vdd-cpu";
183860fbdd4SHans de Goede};
184860fbdd4SHans de Goede
185860fbdd4SHans de Goede&reg_dcdc4 {
186860fbdd4SHans de Goede	regulator-always-on;
187860fbdd4SHans de Goede	regulator-min-microvolt = <700000>;
188860fbdd4SHans de Goede	regulator-max-microvolt = <1320000>;
189860fbdd4SHans de Goede	regulator-name = "vdd-sys-dll";
190860fbdd4SHans de Goede};
191860fbdd4SHans de Goede
192860fbdd4SHans de Goede&reg_dcdc5 {
193860fbdd4SHans de Goede	regulator-always-on;
194860fbdd4SHans de Goede	regulator-min-microvolt = <1500000>;
195860fbdd4SHans de Goede	regulator-max-microvolt = <1500000>;
196860fbdd4SHans de Goede	regulator-name = "vcc-dram";
197860fbdd4SHans de Goede};
198860fbdd4SHans de Goede
199860fbdd4SHans de Goede&reg_dldo1 {
200860fbdd4SHans de Goede	regulator-min-microvolt = <3300000>;
201860fbdd4SHans de Goede	regulator-max-microvolt = <3300000>;
202860fbdd4SHans de Goede	regulator-name = "vcc-ethernet-phy";
203860fbdd4SHans de Goede};
204860fbdd4SHans de Goede
205860fbdd4SHans de Goede/*
206860fbdd4SHans de Goede * Both reg_usb1_vbus and reg_dldo4 need to be on for the hub attached
207860fbdd4SHans de Goede * to usb1 to work, and we can list only one usb1_vbus-supply, so dldo4 is
208860fbdd4SHans de Goede * marked as regulator-always-on.
209860fbdd4SHans de Goede */
210860fbdd4SHans de Goede&reg_dldo4 {
211860fbdd4SHans de Goede	regulator-always-on;
212860fbdd4SHans de Goede	regulator-min-microvolt = <3300000>;
213860fbdd4SHans de Goede	regulator-max-microvolt = <3300000>;
214860fbdd4SHans de Goede	regulator-name = "vcc-usb-hub";
215860fbdd4SHans de Goede};
216860fbdd4SHans de Goede
21753ab4af3SHans de Goede&reg_usb1_vbus {
21853ab4af3SHans de Goede	pinctrl-names = "default";
21953ab4af3SHans de Goede	pinctrl-0 = <&usb1_vbus_pin_m9>;
22053ab4af3SHans de Goede	gpio = <&pio 2 27 GPIO_ACTIVE_HIGH>;
22153ab4af3SHans de Goede	status = "okay";
22253ab4af3SHans de Goede};
22353ab4af3SHans de Goede
22453ab4af3SHans de Goede&uart0 {
22553ab4af3SHans de Goede	pinctrl-names = "default";
22653ab4af3SHans de Goede	pinctrl-0 = <&uart0_pins_a>;
22753ab4af3SHans de Goede	status = "okay";
22853ab4af3SHans de Goede};
22953ab4af3SHans de Goede
23053ab4af3SHans de Goede&usbphy {
23153ab4af3SHans de Goede	usb1_vbus-supply = <&reg_usb1_vbus>;
232860fbdd4SHans de Goede	usb2_vbus-supply = <&reg_aldo1>;
23353ab4af3SHans de Goede	status = "okay";
23453ab4af3SHans de Goede};
235