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