xref: /linux/scripts/dtc/include-prefixes/arm/allwinner/sun8i-r16-bananapi-m2m.dts (revision 621cde16e49b3ecf7d59a8106a20aaebfb4a59a9)
1724ba675SRob Herring/*
2724ba675SRob Herring * Copyright (c) 2017 Free Electrons <maxime.ripard@free-electrons.com>
3724ba675SRob Herring *
4724ba675SRob Herring * This file is dual-licensed: you can use it either under the terms
5724ba675SRob Herring * of the GPL or the X11 license, at your option. Note that this dual
6724ba675SRob Herring * licensing only applies to this file, and not this project as a
7724ba675SRob Herring * whole.
8724ba675SRob Herring *
9724ba675SRob Herring *  a) This file is free software; you can redistribute it and/or
10724ba675SRob Herring *     modify it under the terms of the GNU General Public License as
11724ba675SRob Herring *     published by the Free Software Foundation; either version 2 of the
12724ba675SRob Herring *     License, or (at your option) any later version.
13724ba675SRob Herring *
14724ba675SRob Herring *     This file is distributed in the hope that it will be useful,
15724ba675SRob Herring *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16724ba675SRob Herring *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17724ba675SRob Herring *     GNU General Public License for more details.
18724ba675SRob Herring *
19724ba675SRob Herring * Or, alternatively,
20724ba675SRob Herring *
21724ba675SRob Herring *  b) Permission is hereby granted, free of charge, to any person
22724ba675SRob Herring *     obtaining a copy of this software and associated documentation
23724ba675SRob Herring *     files (the "Software"), to deal in the Software without
24724ba675SRob Herring *     restriction, including without limitation the rights to use,
25724ba675SRob Herring *     copy, modify, merge, publish, distribute, sublicense, and/or
26724ba675SRob Herring *     sell copies of the Software, and to permit persons to whom the
27724ba675SRob Herring *     Software is furnished to do so, subject to the following
28724ba675SRob Herring *     conditions:
29724ba675SRob Herring *
30724ba675SRob Herring *     The above copyright notice and this permission notice shall be
31724ba675SRob Herring *     included in all copies or substantial portions of the Software.
32724ba675SRob Herring *
33724ba675SRob Herring *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34724ba675SRob Herring *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35724ba675SRob Herring *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36724ba675SRob Herring *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37724ba675SRob Herring *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38724ba675SRob Herring *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39724ba675SRob Herring *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40724ba675SRob Herring *     OTHER DEALINGS IN THE SOFTWARE.
41724ba675SRob Herring */
42724ba675SRob Herring
43724ba675SRob Herring/dts-v1/;
44724ba675SRob Herring#include "sun8i-a33.dtsi"
45724ba675SRob Herring
46724ba675SRob Herring#include <dt-bindings/gpio/gpio.h>
47724ba675SRob Herring
48724ba675SRob Herring/ {
49724ba675SRob Herring	model = "BananaPi M2 Magic";
50724ba675SRob Herring	compatible = "sinovoip,bananapi-m2m", "allwinner,sun8i-a33";
51724ba675SRob Herring
52724ba675SRob Herring	aliases {
53724ba675SRob Herring		i2c0 = &i2c0;
54724ba675SRob Herring		i2c1 = &i2c1;
55724ba675SRob Herring		i2c2 = &i2c2;
56724ba675SRob Herring		serial0 = &uart0;
57724ba675SRob Herring		serial1 = &uart1;
58724ba675SRob Herring	};
59724ba675SRob Herring
60724ba675SRob Herring	chosen {
61724ba675SRob Herring		stdout-path = "serial0:115200n8";
62724ba675SRob Herring	};
63724ba675SRob Herring
64724ba675SRob Herring	leds {
65724ba675SRob Herring		compatible = "gpio-leds";
66724ba675SRob Herring
67724ba675SRob Herring		led-0 {
68724ba675SRob Herring			label = "bpi-m2m:blue:usr";
69724ba675SRob Herring			gpios = <&pio 2 7 GPIO_ACTIVE_LOW>;
70724ba675SRob Herring		};
71724ba675SRob Herring
72724ba675SRob Herring		led-1 {
73724ba675SRob Herring			label = "bpi-m2m:green:usr";
74724ba675SRob Herring			gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>;
75724ba675SRob Herring		};
76724ba675SRob Herring
77724ba675SRob Herring		led-2 {
78724ba675SRob Herring			label = "bpi-m2m:red:power";
79724ba675SRob Herring			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
80724ba675SRob Herring			default-state = "on";
81724ba675SRob Herring		};
82724ba675SRob Herring	};
83724ba675SRob Herring
84724ba675SRob Herring	reg_vcc5v0: vcc5v0 {
85724ba675SRob Herring		compatible = "regulator-fixed";
86724ba675SRob Herring		regulator-name = "vcc5v0";
87724ba675SRob Herring		regulator-min-microvolt = <5000000>;
88724ba675SRob Herring		regulator-max-microvolt = <5000000>;
89724ba675SRob Herring	};
90724ba675SRob Herring
91*0f47ef3fSKrzysztof Kozlowski	wifi_pwrseq: pwrseq {
92724ba675SRob Herring		compatible = "mmc-pwrseq-simple";
93724ba675SRob Herring		reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
94724ba675SRob Herring		clocks = <&rtc CLK_OSC32K_FANOUT>;
95724ba675SRob Herring		clock-names = "ext_clock";
96724ba675SRob Herring	};
97724ba675SRob Herring};
98724ba675SRob Herring
99724ba675SRob Herring&codec {
100724ba675SRob Herring	status = "okay";
101724ba675SRob Herring};
102724ba675SRob Herring
103724ba675SRob Herring&cpu0 {
104724ba675SRob Herring	cpu-supply = <&reg_dcdc3>;
105724ba675SRob Herring};
106724ba675SRob Herring
107724ba675SRob Herring&cpu0_opp_table {
108724ba675SRob Herring	opp-1104000000 {
109724ba675SRob Herring		opp-hz = /bits/ 64 <1104000000>;
110724ba675SRob Herring		opp-microvolt = <1320000>;
111724ba675SRob Herring		clock-latency-ns = <244144>; /* 8 32k periods */
112724ba675SRob Herring	};
113724ba675SRob Herring
114724ba675SRob Herring	opp-1200000000 {
115724ba675SRob Herring		opp-hz = /bits/ 64 <1200000000>;
116724ba675SRob Herring		opp-microvolt = <1320000>;
117724ba675SRob Herring		clock-latency-ns = <244144>; /* 8 32k periods */
118724ba675SRob Herring	};
119724ba675SRob Herring};
120724ba675SRob Herring
121724ba675SRob Herring&dai {
122724ba675SRob Herring	status = "okay";
123724ba675SRob Herring};
124724ba675SRob Herring
125724ba675SRob Herring&ehci0 {
126724ba675SRob Herring	status = "okay";
127724ba675SRob Herring};
128724ba675SRob Herring
129724ba675SRob Herring&mmc0 {
130724ba675SRob Herring	vmmc-supply = <&reg_dcdc1>;
131724ba675SRob Herring	bus-width = <4>;
132724ba675SRob Herring	cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
133724ba675SRob Herring	status = "okay";
134724ba675SRob Herring};
135724ba675SRob Herring
136724ba675SRob Herring&mmc1 {
137724ba675SRob Herring	pinctrl-names = "default";
138724ba675SRob Herring	pinctrl-0 = <&mmc1_pg_pins>;
139724ba675SRob Herring	vmmc-supply = <&reg_aldo1>;
140724ba675SRob Herring	mmc-pwrseq = <&wifi_pwrseq>;
141724ba675SRob Herring	bus-width = <4>;
142724ba675SRob Herring	non-removable;
143724ba675SRob Herring	status = "okay";
144724ba675SRob Herring};
145724ba675SRob Herring
146724ba675SRob Herring&mmc2 {
147724ba675SRob Herring	pinctrl-names = "default";
148724ba675SRob Herring	pinctrl-0 = <&mmc2_8bit_pins>;
149724ba675SRob Herring	vmmc-supply = <&reg_dcdc1>;
150724ba675SRob Herring	bus-width = <8>;
151724ba675SRob Herring	non-removable;
152724ba675SRob Herring	cap-mmc-hw-reset;
153724ba675SRob Herring	status = "okay";
154724ba675SRob Herring};
155724ba675SRob Herring
156724ba675SRob Herring&ohci0 {
157724ba675SRob Herring	status = "okay";
158724ba675SRob Herring};
159724ba675SRob Herring
160724ba675SRob Herring&r_rsb {
161724ba675SRob Herring	status = "okay";
162724ba675SRob Herring
163724ba675SRob Herring	axp22x: pmic@3a3 {
164724ba675SRob Herring		compatible = "x-powers,axp223";
165724ba675SRob Herring		reg = <0x3a3>;
166724ba675SRob Herring		interrupt-parent = <&r_intc>;
167724ba675SRob Herring		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
168724ba675SRob Herring		eldoin-supply = <&reg_dcdc1>;
169724ba675SRob Herring		x-powers,drive-vbus-en;
170724ba675SRob Herring	};
171724ba675SRob Herring};
172724ba675SRob Herring
173724ba675SRob Herring#include "axp223.dtsi"
174724ba675SRob Herring
175724ba675SRob Herring&ac_power_supply {
176724ba675SRob Herring	status = "okay";
177724ba675SRob Herring};
178724ba675SRob Herring
179724ba675SRob Herring&reg_aldo1 {
180724ba675SRob Herring	regulator-always-on;
181724ba675SRob Herring	regulator-min-microvolt = <3000000>;
182724ba675SRob Herring	regulator-max-microvolt = <3000000>;
183724ba675SRob Herring	regulator-name = "vcc-io";
184724ba675SRob Herring};
185724ba675SRob Herring
186724ba675SRob Herring&reg_aldo2 {
187724ba675SRob Herring	regulator-always-on;
188724ba675SRob Herring	regulator-min-microvolt = <2500000>;
189724ba675SRob Herring	regulator-max-microvolt = <2500000>;
190724ba675SRob Herring	regulator-name = "vdd-dll";
191724ba675SRob Herring};
192724ba675SRob Herring
193724ba675SRob Herring&reg_aldo3 {
194724ba675SRob Herring	regulator-always-on;
195724ba675SRob Herring	regulator-min-microvolt = <3000000>;
196724ba675SRob Herring	regulator-max-microvolt = <3000000>;
197724ba675SRob Herring	regulator-name = "avcc";
198724ba675SRob Herring};
199724ba675SRob Herring
200724ba675SRob Herring&reg_dc1sw {
201724ba675SRob Herring	regulator-name = "vcc-lcd";
202724ba675SRob Herring};
203724ba675SRob Herring
204724ba675SRob Herring&reg_dc5ldo {
205724ba675SRob Herring	regulator-always-on;
206724ba675SRob Herring	regulator-min-microvolt = <900000>;
207724ba675SRob Herring	regulator-max-microvolt = <1400000>;
208724ba675SRob Herring	regulator-name = "vdd-cpus";
209724ba675SRob Herring};
210724ba675SRob Herring
211724ba675SRob Herring&reg_dcdc1 {
212724ba675SRob Herring	regulator-always-on;
213724ba675SRob Herring	regulator-min-microvolt = <3000000>;
214724ba675SRob Herring	regulator-max-microvolt = <3000000>;
215724ba675SRob Herring	regulator-name = "vcc-3v0";
216724ba675SRob Herring};
217724ba675SRob Herring
218724ba675SRob Herring&reg_dcdc2 {
219724ba675SRob Herring	regulator-always-on;
220724ba675SRob Herring	regulator-min-microvolt = <900000>;
221724ba675SRob Herring	regulator-max-microvolt = <1400000>;
222724ba675SRob Herring	regulator-name = "vdd-sys";
223724ba675SRob Herring};
224724ba675SRob Herring
225724ba675SRob Herring&reg_dcdc3 {
226724ba675SRob Herring	regulator-always-on;
227724ba675SRob Herring	regulator-min-microvolt = <900000>;
228724ba675SRob Herring	regulator-max-microvolt = <1400000>;
229724ba675SRob Herring	regulator-name = "vdd-cpu";
230724ba675SRob Herring};
231724ba675SRob Herring
232724ba675SRob Herring&reg_dcdc5 {
233724ba675SRob Herring	regulator-always-on;
234724ba675SRob Herring	regulator-min-microvolt = <1500000>;
235724ba675SRob Herring	regulator-max-microvolt = <1500000>;
236724ba675SRob Herring	regulator-name = "vcc-dram";
237724ba675SRob Herring};
238724ba675SRob Herring
239724ba675SRob Herring/*
240724ba675SRob Herring * Our WiFi chip needs both DLDO1 and DLDO2 to be powered at the same
241724ba675SRob Herring * time, with the two being in sync. Since this is not really
242724ba675SRob Herring * supported right now, just use the two as always on, and we will fix
243724ba675SRob Herring * it later.
244724ba675SRob Herring */
245724ba675SRob Herring&reg_dldo1 {
246724ba675SRob Herring	regulator-always-on;
247724ba675SRob Herring	regulator-min-microvolt = <3300000>;
248724ba675SRob Herring	regulator-max-microvolt = <3300000>;
249724ba675SRob Herring	regulator-name = "vcc-wifi0";
250724ba675SRob Herring};
251724ba675SRob Herring
252724ba675SRob Herring&reg_dldo2 {
253724ba675SRob Herring	regulator-always-on;
254724ba675SRob Herring	regulator-min-microvolt = <3300000>;
255724ba675SRob Herring	regulator-max-microvolt = <3300000>;
256724ba675SRob Herring	regulator-name = "vcc-wifi1";
257724ba675SRob Herring};
258724ba675SRob Herring
259724ba675SRob Herring&reg_drivevbus {
260724ba675SRob Herring	regulator-name = "usb0-vbus";
261724ba675SRob Herring	status = "okay";
262724ba675SRob Herring};
263724ba675SRob Herring
264724ba675SRob Herring&reg_rtc_ldo {
265724ba675SRob Herring	regulator-name = "vcc-rtc";
266724ba675SRob Herring};
267724ba675SRob Herring
268724ba675SRob Herring&sound {
269724ba675SRob Herring	status = "okay";
270724ba675SRob Herring};
271724ba675SRob Herring
272724ba675SRob Herring&uart0 {
273724ba675SRob Herring	pinctrl-names = "default";
274724ba675SRob Herring	pinctrl-0 = <&uart0_pb_pins>;
275724ba675SRob Herring	status = "okay";
276724ba675SRob Herring};
277724ba675SRob Herring
278724ba675SRob Herring&uart1 {
279724ba675SRob Herring	pinctrl-names = "default";
280724ba675SRob Herring	pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pg_pins>;
281724ba675SRob Herring	uart-has-rtscts;
282724ba675SRob Herring	status = "okay";
283724ba675SRob Herring
284724ba675SRob Herring	bluetooth {
285724ba675SRob Herring		compatible = "brcm,bcm43438-bt";
286724ba675SRob Herring		clocks = <&rtc CLK_OSC32K_FANOUT>;
287724ba675SRob Herring		clock-names = "lpo";
288724ba675SRob Herring		vbat-supply = <&reg_dldo1>;
289724ba675SRob Herring		vddio-supply = <&reg_aldo3>;
290724ba675SRob Herring		device-wakeup-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
291724ba675SRob Herring		host-wakeup-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
292724ba675SRob Herring		shutdown-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
293724ba675SRob Herring	};
294724ba675SRob Herring};
295724ba675SRob Herring
296724ba675SRob Herring&usb_otg {
297724ba675SRob Herring	dr_mode = "otg";
298724ba675SRob Herring	status = "okay";
299724ba675SRob Herring};
300724ba675SRob Herring
301724ba675SRob Herring&usb_power_supply {
302724ba675SRob Herring	status = "okay";
303724ba675SRob Herring};
304724ba675SRob Herring
305724ba675SRob Herring&usbphy {
306724ba675SRob Herring	usb0_id_det-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
307724ba675SRob Herring	usb0_vbus_power-supply = <&usb_power_supply>;
308724ba675SRob Herring	usb0_vbus-supply = <&reg_drivevbus>;
309724ba675SRob Herring	usb1_vbus-supply = <&reg_vcc5v0>;
310724ba675SRob Herring	status = "okay";
311724ba675SRob Herring};
312