xref: /freebsd/sys/contrib/device-tree/src/arm/allwinner/sun8i-v40-bananapi-m2-berry.dts (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1f126890aSEmmanuel Vadot/*
2f126890aSEmmanuel Vadot * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
3f126890aSEmmanuel Vadot *
4f126890aSEmmanuel Vadot * This file is dual-licensed: you can use it either under the terms
5f126890aSEmmanuel Vadot * of the GPL or the X11 license, at your option. Note that this dual
6f126890aSEmmanuel Vadot * licensing only applies to this file, and not this project as a
7f126890aSEmmanuel Vadot * whole.
8f126890aSEmmanuel Vadot *
9f126890aSEmmanuel Vadot *  a) This file is free software; you can redistribute it and/or
10f126890aSEmmanuel Vadot *     modify it under the terms of the GNU General Public License as
11f126890aSEmmanuel Vadot *     published by the Free Software Foundation; either version 2 of the
12f126890aSEmmanuel Vadot *     License, or (at your option) any later version.
13f126890aSEmmanuel Vadot *
14f126890aSEmmanuel Vadot *     This file is distributed in the hope that it will be useful,
15f126890aSEmmanuel Vadot *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16f126890aSEmmanuel Vadot *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17f126890aSEmmanuel Vadot *     GNU General Public License for more details.
18f126890aSEmmanuel Vadot *
19f126890aSEmmanuel Vadot * Or, alternatively,
20f126890aSEmmanuel Vadot *
21f126890aSEmmanuel Vadot *  b) Permission is hereby granted, free of charge, to any person
22f126890aSEmmanuel Vadot *     obtaining a copy of this software and associated documentation
23f126890aSEmmanuel Vadot *     files (the "Software"), to deal in the Software without
24f126890aSEmmanuel Vadot *     restriction, including without limitation the rights to use,
25f126890aSEmmanuel Vadot *     copy, modify, merge, publish, distribute, sublicense, and/or
26f126890aSEmmanuel Vadot *     sell copies of the Software, and to permit persons to whom the
27f126890aSEmmanuel Vadot *     Software is furnished to do so, subject to the following
28f126890aSEmmanuel Vadot *     conditions:
29f126890aSEmmanuel Vadot *
30f126890aSEmmanuel Vadot *     The above copyright notice and this permission notice shall be
31f126890aSEmmanuel Vadot *     included in all copies or substantial portions of the Software.
32f126890aSEmmanuel Vadot *
33f126890aSEmmanuel Vadot *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34f126890aSEmmanuel Vadot *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35f126890aSEmmanuel Vadot *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36f126890aSEmmanuel Vadot *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37f126890aSEmmanuel Vadot *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38f126890aSEmmanuel Vadot *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39f126890aSEmmanuel Vadot *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40f126890aSEmmanuel Vadot *     OTHER DEALINGS IN THE SOFTWARE.
41f126890aSEmmanuel Vadot */
42f126890aSEmmanuel Vadot
43f126890aSEmmanuel Vadot/dts-v1/;
44f126890aSEmmanuel Vadot#include "sun8i-r40.dtsi"
45f126890aSEmmanuel Vadot#include "sun8i-r40-cpu-opp.dtsi"
46f126890aSEmmanuel Vadot
47f126890aSEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
48f126890aSEmmanuel Vadot
49f126890aSEmmanuel Vadot/ {
50f126890aSEmmanuel Vadot	model = "Banana Pi M2 Berry";
51f126890aSEmmanuel Vadot	compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
52f126890aSEmmanuel Vadot
53f126890aSEmmanuel Vadot	aliases {
54f126890aSEmmanuel Vadot		ethernet0 = &gmac;
55f126890aSEmmanuel Vadot		serial0 = &uart0;
56f126890aSEmmanuel Vadot	};
57f126890aSEmmanuel Vadot
58f126890aSEmmanuel Vadot	chosen {
59f126890aSEmmanuel Vadot		stdout-path = "serial0:115200n8";
60f126890aSEmmanuel Vadot	};
61f126890aSEmmanuel Vadot
62f126890aSEmmanuel Vadot	connector {
63f126890aSEmmanuel Vadot		compatible = "hdmi-connector";
64f126890aSEmmanuel Vadot		type = "a";
65f126890aSEmmanuel Vadot
66f126890aSEmmanuel Vadot		port {
67f126890aSEmmanuel Vadot			hdmi_con_in: endpoint {
68f126890aSEmmanuel Vadot				remote-endpoint = <&hdmi_out_con>;
69f126890aSEmmanuel Vadot			};
70f126890aSEmmanuel Vadot		};
71f126890aSEmmanuel Vadot	};
72f126890aSEmmanuel Vadot
73f126890aSEmmanuel Vadot	leds {
74f126890aSEmmanuel Vadot		compatible = "gpio-leds";
75f126890aSEmmanuel Vadot
76f126890aSEmmanuel Vadot		pwr-led {
77f126890aSEmmanuel Vadot			label = "bananapi:red:pwr";
78f126890aSEmmanuel Vadot			gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
79f126890aSEmmanuel Vadot			default-state = "on";
80f126890aSEmmanuel Vadot		};
81f126890aSEmmanuel Vadot
82f126890aSEmmanuel Vadot		user-led {
83f126890aSEmmanuel Vadot			label = "bananapi:green:user";
84f126890aSEmmanuel Vadot			gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
85f126890aSEmmanuel Vadot		};
86f126890aSEmmanuel Vadot	};
87f126890aSEmmanuel Vadot
88f126890aSEmmanuel Vadot	reg_vcc5v0: vcc5v0 {
89f126890aSEmmanuel Vadot		compatible = "regulator-fixed";
90f126890aSEmmanuel Vadot		regulator-name = "vcc5v0";
91f126890aSEmmanuel Vadot		regulator-min-microvolt = <5000000>;
92f126890aSEmmanuel Vadot		regulator-max-microvolt = <5000000>;
93f126890aSEmmanuel Vadot		gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
94f126890aSEmmanuel Vadot		enable-active-high;
95f126890aSEmmanuel Vadot	};
96f126890aSEmmanuel Vadot
97*7d0873ebSEmmanuel Vadot	wifi_pwrseq: pwrseq {
98f126890aSEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
99f126890aSEmmanuel Vadot		reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
100f126890aSEmmanuel Vadot		clocks = <&ccu CLK_OUTA>;
101f126890aSEmmanuel Vadot		clock-names = "ext_clock";
102f126890aSEmmanuel Vadot	};
103f126890aSEmmanuel Vadot};
104f126890aSEmmanuel Vadot
105f126890aSEmmanuel Vadot&ahci {
106f126890aSEmmanuel Vadot	ahci-supply = <&reg_dldo4>;
107f126890aSEmmanuel Vadot	phy-supply = <&reg_eldo3>;
108f126890aSEmmanuel Vadot	status = "okay";
109f126890aSEmmanuel Vadot};
110f126890aSEmmanuel Vadot
111f126890aSEmmanuel Vadot&cpu0 {
112f126890aSEmmanuel Vadot	cpu-supply = <&reg_dcdc2>;
113f126890aSEmmanuel Vadot};
114f126890aSEmmanuel Vadot
115f126890aSEmmanuel Vadot&de {
116f126890aSEmmanuel Vadot	status = "okay";
117f126890aSEmmanuel Vadot};
118f126890aSEmmanuel Vadot
119f126890aSEmmanuel Vadot&ehci1 {
120f126890aSEmmanuel Vadot	/* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
121f126890aSEmmanuel Vadot	status = "okay";
122f126890aSEmmanuel Vadot};
123f126890aSEmmanuel Vadot
124f126890aSEmmanuel Vadot&gmac {
125f126890aSEmmanuel Vadot	pinctrl-names = "default";
126f126890aSEmmanuel Vadot	pinctrl-0 = <&gmac_rgmii_pins>;
127f126890aSEmmanuel Vadot	phy-handle = <&phy1>;
128f126890aSEmmanuel Vadot	phy-mode = "rgmii-id";
129f126890aSEmmanuel Vadot	phy-supply = <&reg_dc1sw>;
130f126890aSEmmanuel Vadot	status = "okay";
131f126890aSEmmanuel Vadot};
132f126890aSEmmanuel Vadot
133f126890aSEmmanuel Vadot&gmac_mdio {
134f126890aSEmmanuel Vadot	phy1: ethernet-phy@1 {
135f126890aSEmmanuel Vadot		compatible = "ethernet-phy-ieee802.3-c22";
136f126890aSEmmanuel Vadot		reg = <1>;
137f126890aSEmmanuel Vadot	};
138f126890aSEmmanuel Vadot};
139f126890aSEmmanuel Vadot
140f126890aSEmmanuel Vadot&hdmi {
141f126890aSEmmanuel Vadot	status = "okay";
142f126890aSEmmanuel Vadot};
143f126890aSEmmanuel Vadot
144f126890aSEmmanuel Vadot&hdmi_out {
145f126890aSEmmanuel Vadot	hdmi_out_con: endpoint {
146f126890aSEmmanuel Vadot		remote-endpoint = <&hdmi_con_in>;
147f126890aSEmmanuel Vadot	};
148f126890aSEmmanuel Vadot};
149f126890aSEmmanuel Vadot
150f126890aSEmmanuel Vadot&i2c0 {
151f126890aSEmmanuel Vadot	status = "okay";
152f126890aSEmmanuel Vadot
153f126890aSEmmanuel Vadot	axp22x: pmic@34 {
154f126890aSEmmanuel Vadot		compatible = "x-powers,axp221";
155f126890aSEmmanuel Vadot		reg = <0x34>;
156f126890aSEmmanuel Vadot		interrupt-parent = <&nmi_intc>;
157f126890aSEmmanuel Vadot		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
158f126890aSEmmanuel Vadot	};
159f126890aSEmmanuel Vadot};
160f126890aSEmmanuel Vadot
161f126890aSEmmanuel Vadot#include "axp22x.dtsi"
162f126890aSEmmanuel Vadot
163f126890aSEmmanuel Vadot&mmc0 {
164f126890aSEmmanuel Vadot	vmmc-supply = <&reg_dcdc1>;
165f126890aSEmmanuel Vadot	bus-width = <4>;
166f126890aSEmmanuel Vadot	cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
167f126890aSEmmanuel Vadot	status = "okay";
168f126890aSEmmanuel Vadot};
169f126890aSEmmanuel Vadot
170f126890aSEmmanuel Vadot&mmc1 {
171f126890aSEmmanuel Vadot	pinctrl-names = "default";
172f126890aSEmmanuel Vadot	pinctrl-0 = <&mmc1_pg_pins>;
173f126890aSEmmanuel Vadot	vmmc-supply = <&reg_dldo2>;
174f126890aSEmmanuel Vadot	vqmmc-supply = <&reg_dldo1>;
175f126890aSEmmanuel Vadot	mmc-pwrseq = <&wifi_pwrseq>;
176f126890aSEmmanuel Vadot	bus-width = <4>;
177f126890aSEmmanuel Vadot	non-removable;
178f126890aSEmmanuel Vadot	status = "okay";
179f126890aSEmmanuel Vadot};
180f126890aSEmmanuel Vadot
181f126890aSEmmanuel Vadot&pio {
182f126890aSEmmanuel Vadot	pinctrl-names = "default";
183f126890aSEmmanuel Vadot	pinctrl-0 = <&clk_out_a_pin>;
184f126890aSEmmanuel Vadot	vcc-pa-supply = <&reg_aldo2>;
185f126890aSEmmanuel Vadot	vcc-pc-supply = <&reg_dcdc1>;
186f126890aSEmmanuel Vadot	vcc-pd-supply = <&reg_dcdc1>;
187f126890aSEmmanuel Vadot	vcc-pe-supply = <&reg_eldo1>;
188f126890aSEmmanuel Vadot	vcc-pf-supply = <&reg_dcdc1>;
189f126890aSEmmanuel Vadot	vcc-pg-supply = <&reg_dldo1>;
190f126890aSEmmanuel Vadot};
191f126890aSEmmanuel Vadot
192f126890aSEmmanuel Vadot&reg_aldo2 {
193f126890aSEmmanuel Vadot	regulator-min-microvolt = <2500000>;
194f126890aSEmmanuel Vadot	regulator-max-microvolt = <2500000>;
195f126890aSEmmanuel Vadot	regulator-name = "vcc-pa";
196f126890aSEmmanuel Vadot};
197f126890aSEmmanuel Vadot
198f126890aSEmmanuel Vadot&reg_aldo3 {
199f126890aSEmmanuel Vadot	regulator-always-on;
200f126890aSEmmanuel Vadot	regulator-min-microvolt = <2700000>;
201f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
202f126890aSEmmanuel Vadot	regulator-name = "avcc";
203f126890aSEmmanuel Vadot};
204f126890aSEmmanuel Vadot
205f126890aSEmmanuel Vadot&reg_dc1sw {
206f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
207f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
208f126890aSEmmanuel Vadot	regulator-name = "vcc-gmac-phy";
209f126890aSEmmanuel Vadot};
210f126890aSEmmanuel Vadot
211f126890aSEmmanuel Vadot&reg_dcdc1 {
212f126890aSEmmanuel Vadot	regulator-always-on;
213f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
214f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
215f126890aSEmmanuel Vadot	regulator-name = "vcc-3v3";
216f126890aSEmmanuel Vadot};
217f126890aSEmmanuel Vadot
218f126890aSEmmanuel Vadot&reg_dcdc2 {
219f126890aSEmmanuel Vadot	regulator-always-on;
220f126890aSEmmanuel Vadot	regulator-min-microvolt = <1000000>;
221f126890aSEmmanuel Vadot	regulator-max-microvolt = <1300000>;
222f126890aSEmmanuel Vadot	regulator-name = "vdd-cpu";
223f126890aSEmmanuel Vadot};
224f126890aSEmmanuel Vadot
225f126890aSEmmanuel Vadot&reg_dcdc3 {
226f126890aSEmmanuel Vadot	regulator-always-on;
227f126890aSEmmanuel Vadot	regulator-min-microvolt = <1000000>;
228f126890aSEmmanuel Vadot	regulator-max-microvolt = <1300000>;
229f126890aSEmmanuel Vadot	regulator-name = "vdd-sys";
230f126890aSEmmanuel Vadot};
231f126890aSEmmanuel Vadot
232f126890aSEmmanuel Vadot&reg_dcdc5 {
233f126890aSEmmanuel Vadot	regulator-always-on;
234f126890aSEmmanuel Vadot	regulator-min-microvolt = <1500000>;
235f126890aSEmmanuel Vadot	regulator-max-microvolt = <1500000>;
236f126890aSEmmanuel Vadot	regulator-name = "vcc-dram";
237f126890aSEmmanuel Vadot};
238f126890aSEmmanuel Vadot
239f126890aSEmmanuel Vadot&reg_dldo1 {
240f126890aSEmmanuel Vadot	regulator-min-microvolt = <1800000>;
241f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
242f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi-io";
243f126890aSEmmanuel Vadot};
244f126890aSEmmanuel Vadot
245f126890aSEmmanuel Vadot/*
246f126890aSEmmanuel Vadot * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
247f126890aSEmmanuel Vadot * time, with the two being in sync, to be able to meet maximum power
248f126890aSEmmanuel Vadot * consumption during transmits. Since this is not really supported
249f126890aSEmmanuel Vadot * right now, just use the two as always on, and we will fix it later.
250f126890aSEmmanuel Vadot */
251f126890aSEmmanuel Vadot
252f126890aSEmmanuel Vadot&reg_dldo2 {
253f126890aSEmmanuel Vadot	regulator-always-on;
254f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
255f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
256f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi";
257f126890aSEmmanuel Vadot};
258f126890aSEmmanuel Vadot
259f126890aSEmmanuel Vadot&reg_dldo3 {
260f126890aSEmmanuel Vadot	regulator-always-on;
261f126890aSEmmanuel Vadot	regulator-min-microvolt = <3300000>;
262f126890aSEmmanuel Vadot	regulator-max-microvolt = <3300000>;
263f126890aSEmmanuel Vadot	regulator-name = "vcc-wifi-2";
264f126890aSEmmanuel Vadot};
265f126890aSEmmanuel Vadot
266f126890aSEmmanuel Vadot&reg_dldo4 {
267f126890aSEmmanuel Vadot	regulator-min-microvolt = <2500000>;
268f126890aSEmmanuel Vadot	regulator-max-microvolt = <2500000>;
269f126890aSEmmanuel Vadot	regulator-name = "vdd2v5-sata";
270f126890aSEmmanuel Vadot};
271f126890aSEmmanuel Vadot
272f126890aSEmmanuel Vadot&reg_eldo3 {
273f126890aSEmmanuel Vadot	regulator-min-microvolt = <1200000>;
274f126890aSEmmanuel Vadot	regulator-max-microvolt = <1200000>;
275f126890aSEmmanuel Vadot	regulator-name = "vdd1v2-sata";
276f126890aSEmmanuel Vadot};
277f126890aSEmmanuel Vadot
278f126890aSEmmanuel Vadot&tcon_tv0 {
279f126890aSEmmanuel Vadot	status = "okay";
280f126890aSEmmanuel Vadot};
281f126890aSEmmanuel Vadot
282f126890aSEmmanuel Vadot&uart0 {
283f126890aSEmmanuel Vadot	pinctrl-names = "default";
284f126890aSEmmanuel Vadot	pinctrl-0 = <&uart0_pb_pins>;
285f126890aSEmmanuel Vadot	status = "okay";
286f126890aSEmmanuel Vadot};
287f126890aSEmmanuel Vadot
288f126890aSEmmanuel Vadot&uart3 {
289f126890aSEmmanuel Vadot	pinctrl-names = "default";
290f126890aSEmmanuel Vadot	pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
291f126890aSEmmanuel Vadot	uart-has-rtscts;
292f126890aSEmmanuel Vadot	status = "okay";
293f126890aSEmmanuel Vadot
294f126890aSEmmanuel Vadot	bluetooth {
295f126890aSEmmanuel Vadot		compatible = "brcm,bcm43438-bt";
296f126890aSEmmanuel Vadot		clocks = <&ccu CLK_OUTA>;
297f126890aSEmmanuel Vadot		clock-names = "lpo";
298f126890aSEmmanuel Vadot		vbat-supply = <&reg_dldo2>;
299f126890aSEmmanuel Vadot		vddio-supply = <&reg_dldo1>;
300f126890aSEmmanuel Vadot		device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
301f126890aSEmmanuel Vadot		/* TODO host wake line connected to PMIC GPIO pins */
302f126890aSEmmanuel Vadot		shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
303f126890aSEmmanuel Vadot		max-speed = <1500000>;
304f126890aSEmmanuel Vadot	};
305f126890aSEmmanuel Vadot};
306f126890aSEmmanuel Vadot
307f126890aSEmmanuel Vadot&usbphy {
308f126890aSEmmanuel Vadot	usb1_vbus-supply = <&reg_vcc5v0>;
309f126890aSEmmanuel Vadot	status = "okay";
310f126890aSEmmanuel Vadot};
311