xref: /linux/scripts/dtc/include-prefixes/arm/allwinner/sun8i-r40-bananapi-m2-ultra.dts (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
1724ba675SRob Herring/*
2724ba675SRob Herring * Copyright (C) 2017 Chen-Yu Tsai <wens@csie.org>
3724ba675SRob Herring * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
4724ba675SRob Herring *
5724ba675SRob Herring * This file is dual-licensed: you can use it either under the terms
6724ba675SRob Herring * of the GPL or the X11 license, at your option. Note that this dual
7724ba675SRob Herring * licensing only applies to this file, and not this project as a
8724ba675SRob Herring * whole.
9724ba675SRob Herring *
10724ba675SRob Herring *  a) This file is free software; you can redistribute it and/or
11724ba675SRob Herring *     modify it under the terms of the GNU General Public License as
12724ba675SRob Herring *     published by the Free Software Foundation; either version 2 of the
13724ba675SRob Herring *     License, or (at your option) any later version.
14724ba675SRob Herring *
15724ba675SRob Herring *     This file is distributed in the hope that it will be useful,
16724ba675SRob Herring *     but WITHOUT ANY WARRANTY; without even the implied warranty of
17724ba675SRob Herring *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18724ba675SRob Herring *     GNU General Public License for more details.
19724ba675SRob Herring *
20724ba675SRob Herring * Or, alternatively,
21724ba675SRob Herring *
22724ba675SRob Herring *  b) Permission is hereby granted, free of charge, to any person
23724ba675SRob Herring *     obtaining a copy of this software and associated documentation
24724ba675SRob Herring *     files (the "Software"), to deal in the Software without
25724ba675SRob Herring *     restriction, including without limitation the rights to use,
26724ba675SRob Herring *     copy, modify, merge, publish, distribute, sublicense, and/or
27724ba675SRob Herring *     sell copies of the Software, and to permit persons to whom the
28724ba675SRob Herring *     Software is furnished to do so, subject to the following
29724ba675SRob Herring *     conditions:
30724ba675SRob Herring *
31724ba675SRob Herring *     The above copyright notice and this permission notice shall be
32724ba675SRob Herring *     included in all copies or substantial portions of the Software.
33724ba675SRob Herring *
34724ba675SRob Herring *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35724ba675SRob Herring *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
36724ba675SRob Herring *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37724ba675SRob Herring *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
38724ba675SRob Herring *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
39724ba675SRob Herring *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40724ba675SRob Herring *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
41724ba675SRob Herring *     OTHER DEALINGS IN THE SOFTWARE.
42724ba675SRob Herring */
43724ba675SRob Herring
44724ba675SRob Herring/dts-v1/;
45724ba675SRob Herring#include "sun8i-r40.dtsi"
46724ba675SRob Herring#include "sun8i-r40-cpu-opp.dtsi"
47724ba675SRob Herring
48724ba675SRob Herring#include <dt-bindings/gpio/gpio.h>
49724ba675SRob Herring
50724ba675SRob Herring/ {
51724ba675SRob Herring	model = "Banana Pi BPI-M2-Ultra";
52724ba675SRob Herring	compatible = "sinovoip,bpi-m2-ultra", "allwinner,sun8i-r40";
53724ba675SRob Herring
54724ba675SRob Herring	aliases {
55724ba675SRob Herring		ethernet0 = &gmac;
56724ba675SRob Herring		serial0 = &uart0;
57724ba675SRob Herring	};
58724ba675SRob Herring
59724ba675SRob Herring	chosen {
60724ba675SRob Herring		stdout-path = "serial0:115200n8";
61724ba675SRob Herring	};
62724ba675SRob Herring
63724ba675SRob Herring	connector {
64724ba675SRob Herring		compatible = "hdmi-connector";
65724ba675SRob Herring		type = "a";
66724ba675SRob Herring
67724ba675SRob Herring		port {
68724ba675SRob Herring			hdmi_con_in: endpoint {
69724ba675SRob Herring				remote-endpoint = <&hdmi_out_con>;
70724ba675SRob Herring			};
71724ba675SRob Herring		};
72724ba675SRob Herring	};
73724ba675SRob Herring
74724ba675SRob Herring	leds {
75724ba675SRob Herring		compatible = "gpio-leds";
76724ba675SRob Herring
77724ba675SRob Herring		pwr-led {
78724ba675SRob Herring			label = "bananapi:red:pwr";
79724ba675SRob Herring			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
80724ba675SRob Herring			default-state = "on";
81724ba675SRob Herring		};
82724ba675SRob Herring
83724ba675SRob Herring		user-led-green {
84724ba675SRob Herring			label = "bananapi:green:user";
85724ba675SRob Herring			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
86724ba675SRob Herring		};
87724ba675SRob Herring
88724ba675SRob Herring		user-led-blue {
89724ba675SRob Herring			label = "bananapi:blue:user";
90724ba675SRob Herring			gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>;
91724ba675SRob Herring		};
92724ba675SRob Herring	};
93724ba675SRob Herring
94724ba675SRob Herring	reg_vcc5v0: vcc5v0 {
95724ba675SRob Herring		compatible = "regulator-fixed";
96724ba675SRob Herring		regulator-name = "vcc5v0";
97724ba675SRob Herring		regulator-min-microvolt = <5000000>;
98724ba675SRob Herring		regulator-max-microvolt = <5000000>;
99724ba675SRob Herring		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
100724ba675SRob Herring		enable-active-high;
101724ba675SRob Herring	};
102724ba675SRob Herring
103*0f47ef3fSKrzysztof Kozlowski	wifi_pwrseq: pwrseq {
104724ba675SRob Herring		compatible = "mmc-pwrseq-simple";
105724ba675SRob Herring		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
106724ba675SRob Herring		clocks = <&ccu CLK_OUTA>;
107724ba675SRob Herring		clock-names = "ext_clock";
108724ba675SRob Herring	};
109724ba675SRob Herring};
110724ba675SRob Herring
111724ba675SRob Herring&ahci {
112724ba675SRob Herring	ahci-supply = <&reg_dldo4>;
113724ba675SRob Herring	phy-supply = <&reg_eldo3>;
114724ba675SRob Herring	status = "okay";
115724ba675SRob Herring};
116724ba675SRob Herring
117724ba675SRob Herring&cpu0 {
118724ba675SRob Herring	cpu-supply = <&reg_dcdc2>;
119724ba675SRob Herring};
120724ba675SRob Herring
121724ba675SRob Herring&de {
122724ba675SRob Herring	status = "okay";
123724ba675SRob Herring};
124724ba675SRob Herring
125724ba675SRob Herring&ehci1 {
126724ba675SRob Herring	status = "okay";
127724ba675SRob Herring};
128724ba675SRob Herring
129724ba675SRob Herring&ehci2 {
130724ba675SRob Herring	status = "okay";
131724ba675SRob Herring};
132724ba675SRob Herring
133724ba675SRob Herring&gmac {
134724ba675SRob Herring	pinctrl-names = "default";
135724ba675SRob Herring	pinctrl-0 = <&gmac_rgmii_pins>;
136724ba675SRob Herring	phy-handle = <&phy1>;
137724ba675SRob Herring	phy-mode = "rgmii-id";
138724ba675SRob Herring	phy-supply = <&reg_dc1sw>;
139724ba675SRob Herring	status = "okay";
140724ba675SRob Herring};
141724ba675SRob Herring
142724ba675SRob Herring&gmac_mdio {
143724ba675SRob Herring	phy1: ethernet-phy@1 {
144724ba675SRob Herring		compatible = "ethernet-phy-ieee802.3-c22";
145724ba675SRob Herring		reg = <1>;
146724ba675SRob Herring	};
147724ba675SRob Herring};
148724ba675SRob Herring
149724ba675SRob Herring&hdmi {
150724ba675SRob Herring	status = "okay";
151724ba675SRob Herring};
152724ba675SRob Herring
153724ba675SRob Herring&hdmi_out {
154724ba675SRob Herring	hdmi_out_con: endpoint {
155724ba675SRob Herring		remote-endpoint = <&hdmi_con_in>;
156724ba675SRob Herring	};
157724ba675SRob Herring};
158724ba675SRob Herring
159724ba675SRob Herring&i2c0 {
160724ba675SRob Herring	status = "okay";
161724ba675SRob Herring
162724ba675SRob Herring	axp22x: pmic@34 {
163724ba675SRob Herring		compatible = "x-powers,axp221";
164724ba675SRob Herring		reg = <0x34>;
165724ba675SRob Herring		interrupt-parent = <&nmi_intc>;
166724ba675SRob Herring		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
167724ba675SRob Herring	};
168724ba675SRob Herring};
169724ba675SRob Herring
170724ba675SRob Herring#include "axp22x.dtsi"
171724ba675SRob Herring
172724ba675SRob Herring&ir0 {
173724ba675SRob Herring	status = "okay";
174724ba675SRob Herring};
175724ba675SRob Herring
176724ba675SRob Herring&mmc0 {
177724ba675SRob Herring	vmmc-supply = <&reg_dcdc1>;
178724ba675SRob Herring	bus-width = <4>;
179724ba675SRob Herring	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
180724ba675SRob Herring	status = "okay";
181724ba675SRob Herring};
182724ba675SRob Herring
183724ba675SRob Herring&mmc1 {
184724ba675SRob Herring	pinctrl-names = "default";
185724ba675SRob Herring	pinctrl-0 = <&mmc1_pg_pins>;
186724ba675SRob Herring	vmmc-supply = <&reg_dldo2>;
187724ba675SRob Herring	vqmmc-supply = <&reg_dldo1>;
188724ba675SRob Herring	mmc-pwrseq = <&wifi_pwrseq>;
189724ba675SRob Herring	bus-width = <4>;
190724ba675SRob Herring	non-removable;
191724ba675SRob Herring	status = "okay";
192724ba675SRob Herring};
193724ba675SRob Herring
194724ba675SRob Herring&mmc2 {
195724ba675SRob Herring	vmmc-supply = <&reg_dcdc1>;
196724ba675SRob Herring	vqmmc-supply = <&reg_dcdc1>;
197724ba675SRob Herring	bus-width = <8>;
198724ba675SRob Herring	non-removable;
199724ba675SRob Herring	status = "okay";
200724ba675SRob Herring};
201724ba675SRob Herring
202724ba675SRob Herring&ohci1 {
203724ba675SRob Herring	status = "okay";
204724ba675SRob Herring};
205724ba675SRob Herring
206724ba675SRob Herring&ohci2 {
207724ba675SRob Herring	status = "okay";
208724ba675SRob Herring};
209724ba675SRob Herring
210724ba675SRob Herring&pio {
211724ba675SRob Herring	pinctrl-names = "default";
212724ba675SRob Herring	pinctrl-0 = <&clk_out_a_pin>;
213724ba675SRob Herring	vcc-pa-supply = <&reg_aldo2>;
214724ba675SRob Herring	vcc-pc-supply = <&reg_dcdc1>;
215724ba675SRob Herring	vcc-pd-supply = <&reg_dcdc1>;
216724ba675SRob Herring	vcc-pe-supply = <&reg_eldo1>;
217724ba675SRob Herring	vcc-pf-supply = <&reg_dcdc1>;
218724ba675SRob Herring	vcc-pg-supply = <&reg_dldo1>;
219724ba675SRob Herring};
220724ba675SRob Herring
221724ba675SRob Herring&reg_aldo2 {
222724ba675SRob Herring	regulator-min-microvolt = <2500000>;
223724ba675SRob Herring	regulator-max-microvolt = <2500000>;
224724ba675SRob Herring	regulator-name = "vcc-pa";
225724ba675SRob Herring};
226724ba675SRob Herring
227724ba675SRob Herring&reg_aldo3 {
228724ba675SRob Herring	regulator-always-on;
229724ba675SRob Herring	regulator-min-microvolt = <2700000>;
230724ba675SRob Herring	regulator-max-microvolt = <3300000>;
231724ba675SRob Herring	regulator-name = "avcc";
232724ba675SRob Herring};
233724ba675SRob Herring
234724ba675SRob Herring&reg_dc1sw {
235724ba675SRob Herring	regulator-min-microvolt = <3300000>;
236724ba675SRob Herring	regulator-max-microvolt = <3300000>;
237724ba675SRob Herring	regulator-name = "vcc-gmac-phy";
238724ba675SRob Herring};
239724ba675SRob Herring
240724ba675SRob Herring&reg_dcdc1 {
241724ba675SRob Herring	regulator-always-on;
242724ba675SRob Herring	regulator-min-microvolt = <3300000>;
243724ba675SRob Herring	regulator-max-microvolt = <3300000>;
244724ba675SRob Herring	regulator-name = "vcc-3v3";
245724ba675SRob Herring};
246724ba675SRob Herring
247724ba675SRob Herring&reg_dcdc2 {
248724ba675SRob Herring	regulator-always-on;
249724ba675SRob Herring	regulator-min-microvolt = <1000000>;
250724ba675SRob Herring	regulator-max-microvolt = <1300000>;
251724ba675SRob Herring	regulator-name = "vdd-cpu";
252724ba675SRob Herring};
253724ba675SRob Herring
254724ba675SRob Herring&reg_dcdc3 {
255724ba675SRob Herring	regulator-always-on;
256724ba675SRob Herring	regulator-min-microvolt = <1000000>;
257724ba675SRob Herring	regulator-max-microvolt = <1300000>;
258724ba675SRob Herring	regulator-name = "vdd-sys";
259724ba675SRob Herring};
260724ba675SRob Herring
261724ba675SRob Herring&reg_dcdc5 {
262724ba675SRob Herring	regulator-always-on;
263724ba675SRob Herring	regulator-min-microvolt = <1500000>;
264724ba675SRob Herring	regulator-max-microvolt = <1500000>;
265724ba675SRob Herring	regulator-name = "vcc-dram";
266724ba675SRob Herring};
267724ba675SRob Herring
268724ba675SRob Herring&reg_dldo1 {
269724ba675SRob Herring	regulator-min-microvolt = <1800000>;
270724ba675SRob Herring	regulator-max-microvolt = <3300000>;
271724ba675SRob Herring	regulator-name = "vcc-wifi-io";
272724ba675SRob Herring};
273724ba675SRob Herring
274724ba675SRob Herring/*
275724ba675SRob Herring * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
276724ba675SRob Herring * time, with the two being in sync, to be able to meet maximum power
277724ba675SRob Herring * consumption during transmits. Since this is not really supported
278724ba675SRob Herring * right now, just use the two as always on, and we will fix it later.
279724ba675SRob Herring */
280724ba675SRob Herring
281724ba675SRob Herring&reg_dldo2 {
282724ba675SRob Herring	regulator-always-on;
283724ba675SRob Herring	regulator-min-microvolt = <3300000>;
284724ba675SRob Herring	regulator-max-microvolt = <3300000>;
285724ba675SRob Herring	regulator-name = "vcc-wifi";
286724ba675SRob Herring};
287724ba675SRob Herring
288724ba675SRob Herring&reg_dldo3 {
289724ba675SRob Herring	regulator-always-on;
290724ba675SRob Herring	regulator-min-microvolt = <3300000>;
291724ba675SRob Herring	regulator-max-microvolt = <3300000>;
292724ba675SRob Herring	regulator-name = "vcc-wifi-2";
293724ba675SRob Herring};
294724ba675SRob Herring
295724ba675SRob Herring&reg_dldo4 {
296724ba675SRob Herring	regulator-min-microvolt = <2500000>;
297724ba675SRob Herring	regulator-max-microvolt = <2500000>;
298724ba675SRob Herring	regulator-name = "vdd2v5-sata";
299724ba675SRob Herring};
300724ba675SRob Herring
301724ba675SRob Herring&reg_eldo3 {
302724ba675SRob Herring	regulator-min-microvolt = <1200000>;
303724ba675SRob Herring	regulator-max-microvolt = <1200000>;
304724ba675SRob Herring	regulator-name = "vdd1v2-sata";
305724ba675SRob Herring};
306724ba675SRob Herring
307724ba675SRob Herring&tcon_tv0 {
308724ba675SRob Herring	status = "okay";
309724ba675SRob Herring};
310724ba675SRob Herring
311724ba675SRob Herring&uart0 {
312724ba675SRob Herring	pinctrl-names = "default";
313724ba675SRob Herring	pinctrl-0 = <&uart0_pb_pins>;
314724ba675SRob Herring	status = "okay";
315724ba675SRob Herring};
316724ba675SRob Herring
317724ba675SRob Herring&uart3 {
318724ba675SRob Herring	pinctrl-names = "default";
319724ba675SRob Herring	pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
320724ba675SRob Herring	uart-has-rtscts;
321724ba675SRob Herring	status = "okay";
322724ba675SRob Herring
323724ba675SRob Herring	bluetooth {
324724ba675SRob Herring		compatible = "brcm,bcm43438-bt";
325724ba675SRob Herring		clocks = <&ccu CLK_OUTA>;
326724ba675SRob Herring		clock-names = "lpo";
327724ba675SRob Herring		vbat-supply = <&reg_dldo2>;
328724ba675SRob Herring		vddio-supply = <&reg_dldo1>;
329724ba675SRob Herring		device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
330724ba675SRob Herring		/* TODO host wake line connected to PMIC GPIO pins */
331724ba675SRob Herring		shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
332724ba675SRob Herring		max-speed = <1500000>;
333724ba675SRob Herring	};
334724ba675SRob Herring};
335724ba675SRob Herring
336724ba675SRob Herring&usbphy {
337724ba675SRob Herring	usb1_vbus-supply = <&reg_vcc5v0>;
338724ba675SRob Herring	usb2_vbus-supply = <&reg_vcc5v0>;
339724ba675SRob Herring	status = "okay";
340724ba675SRob Herring};
341