blob: 434871040aca00b07d74f42eae522b5d05ff6239 [file] [log] [blame]
Jagan Tekicb0f3a52018-04-27 17:33:42 +05301/*
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"
Andre Przywarafa15e502022-09-13 00:52:52 +010045#include "sun8i-r40-cpu-opp.dtsi"
Jagan Tekicb0f3a52018-04-27 17:33:42 +053046
47#include <dt-bindings/gpio/gpio.h>
48
49/ {
50 model = "Banana Pi M2 Berry";
51 compatible = "sinovoip,bpi-m2-berry", "allwinner,sun8i-r40";
52
53 aliases {
Andre Przywaraa17d02d2020-01-01 23:44:46 +000054 ethernet0 = &gmac;
Jagan Tekicb0f3a52018-04-27 17:33:42 +053055 serial0 = &uart0;
56 };
57
58 chosen {
59 stdout-path = "serial0:115200n8";
60 };
Jagan Teki9e913002018-08-05 00:40:13 +053061
Andre Przywaraa17d02d2020-01-01 23:44:46 +000062 connector {
63 compatible = "hdmi-connector";
64 type = "a";
65
66 port {
67 hdmi_con_in: endpoint {
68 remote-endpoint = <&hdmi_out_con>;
69 };
70 };
71 };
72
Jagan Teki9e913002018-08-05 00:40:13 +053073 leds {
74 compatible = "gpio-leds";
75
76 pwr-led {
77 label = "bananapi:red:pwr";
78 gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
79 default-state = "on";
80 };
81
82 user-led {
83 label = "bananapi:green:user";
84 gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
85 };
86 };
87
88 reg_vcc5v0: vcc5v0 {
89 compatible = "regulator-fixed";
90 regulator-name = "vcc5v0";
91 regulator-min-microvolt = <5000000>;
92 regulator-max-microvolt = <5000000>;
93 gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
94 enable-active-high;
95 };
96
97 wifi_pwrseq: wifi_pwrseq {
98 compatible = "mmc-pwrseq-simple";
99 reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000100 clocks = <&ccu CLK_OUTA>;
101 clock-names = "ext_clock";
Jagan Teki9e913002018-08-05 00:40:13 +0530102 };
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530103};
104
Jagan Teki2ccc8a32019-04-15 11:42:32 +0530105&ahci {
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000106 ahci-supply = <&reg_dldo4>;
107 phy-supply = <&reg_eldo3>;
108 status = "okay";
109};
110
Andre Przywarafa15e502022-09-13 00:52:52 +0100111&cpu0 {
112 cpu-supply = <&reg_dcdc2>;
113};
114
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000115&de {
Jagan Teki2ccc8a32019-04-15 11:42:32 +0530116 status = "okay";
117};
118
Jagan Teki9e913002018-08-05 00:40:13 +0530119&ehci1 {
120 /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
121 status = "okay";
122};
123
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000124&gmac {
125 pinctrl-names = "default";
126 pinctrl-0 = <&gmac_rgmii_pins>;
127 phy-handle = <&phy1>;
Ivan Uvarovc7875122021-04-19 12:30:57 +0300128 phy-mode = "rgmii-id";
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000129 phy-supply = <&reg_dc1sw>;
130 status = "okay";
131};
132
133&gmac_mdio {
134 phy1: ethernet-phy@1 {
135 compatible = "ethernet-phy-ieee802.3-c22";
136 reg = <1>;
137 };
138};
139
140&hdmi {
141 status = "okay";
142};
143
144&hdmi_out {
145 hdmi_out_con: endpoint {
146 remote-endpoint = <&hdmi_con_in>;
147 };
148};
149
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530150&i2c0 {
151 status = "okay";
152
Jagan Teki6fa00892019-04-09 15:08:51 +0530153 axp22x: pmic@34 {
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530154 compatible = "x-powers,axp221";
155 reg = <0x34>;
156 interrupt-parent = <&nmi_intc>;
157 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
158 };
159};
160
161#include "axp22x.dtsi"
162
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000163&mmc0 {
164 vmmc-supply = <&reg_dcdc1>;
165 bus-width = <4>;
166 cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
167 status = "okay";
168};
169
170&mmc1 {
171 pinctrl-names = "default";
172 pinctrl-0 = <&mmc1_pg_pins>;
173 vmmc-supply = <&reg_dldo2>;
174 vqmmc-supply = <&reg_dldo1>;
175 mmc-pwrseq = <&wifi_pwrseq>;
176 bus-width = <4>;
177 non-removable;
178 status = "okay";
179};
180
181&pio {
182 pinctrl-names = "default";
183 pinctrl-0 = <&clk_out_a_pin>;
184 vcc-pa-supply = <&reg_aldo2>;
185 vcc-pc-supply = <&reg_dcdc1>;
186 vcc-pd-supply = <&reg_dcdc1>;
187 vcc-pe-supply = <&reg_eldo1>;
188 vcc-pf-supply = <&reg_dcdc1>;
189 vcc-pg-supply = <&reg_dldo1>;
190};
191
192&reg_aldo2 {
193 regulator-min-microvolt = <2500000>;
194 regulator-max-microvolt = <2500000>;
195 regulator-name = "vcc-pa";
196};
197
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530198&reg_aldo3 {
199 regulator-always-on;
200 regulator-min-microvolt = <2700000>;
201 regulator-max-microvolt = <3300000>;
202 regulator-name = "avcc";
203};
204
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000205&reg_dc1sw {
Ivan Uvarovc7875122021-04-19 12:30:57 +0300206 regulator-min-microvolt = <3300000>;
207 regulator-max-microvolt = <3300000>;
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000208 regulator-name = "vcc-gmac-phy";
209};
210
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530211&reg_dcdc1 {
212 regulator-always-on;
Ivan Uvarovc7875122021-04-19 12:30:57 +0300213 regulator-min-microvolt = <3300000>;
214 regulator-max-microvolt = <3300000>;
215 regulator-name = "vcc-3v3";
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530216};
217
218&reg_dcdc2 {
219 regulator-always-on;
220 regulator-min-microvolt = <1000000>;
221 regulator-max-microvolt = <1300000>;
222 regulator-name = "vdd-cpu";
223};
224
225&reg_dcdc3 {
226 regulator-always-on;
227 regulator-min-microvolt = <1000000>;
228 regulator-max-microvolt = <1300000>;
229 regulator-name = "vdd-sys";
230};
231
232&reg_dcdc5 {
233 regulator-always-on;
234 regulator-min-microvolt = <1500000>;
235 regulator-max-microvolt = <1500000>;
236 regulator-name = "vcc-dram";
237};
238
239&reg_dldo1 {
240 regulator-min-microvolt = <1800000>;
241 regulator-max-microvolt = <3300000>;
242 regulator-name = "vcc-wifi-io";
243};
244
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000245/*
246 * Our WiFi chip needs both DLDO2 and DLDO3 to be powered at the same
247 * time, with the two being in sync, to be able to meet maximum power
248 * consumption during transmits. Since this is not really supported
249 * right now, just use the two as always on, and we will fix it later.
250 */
251
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530252&reg_dldo2 {
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000253 regulator-always-on;
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530254 regulator-min-microvolt = <3300000>;
255 regulator-max-microvolt = <3300000>;
256 regulator-name = "vcc-wifi";
257};
258
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000259&reg_dldo3 {
260 regulator-always-on;
261 regulator-min-microvolt = <3300000>;
262 regulator-max-microvolt = <3300000>;
263 regulator-name = "vcc-wifi-2";
264};
265
Jagan Teki2ccc8a32019-04-15 11:42:32 +0530266&reg_dldo4 {
267 regulator-min-microvolt = <2500000>;
268 regulator-max-microvolt = <2500000>;
269 regulator-name = "vdd2v5-sata";
270};
271
272&reg_eldo3 {
273 regulator-min-microvolt = <1200000>;
274 regulator-max-microvolt = <1200000>;
275 regulator-name = "vdd1v2-sata";
276};
277
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000278&tcon_tv0 {
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530279 status = "okay";
280};
281
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000282&uart0 {
Jagan Teki9e913002018-08-05 00:40:13 +0530283 pinctrl-names = "default";
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000284 pinctrl-0 = <&uart0_pb_pins>;
Jagan Teki9e913002018-08-05 00:40:13 +0530285 status = "okay";
286};
287
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000288&uart3 {
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530289 pinctrl-names = "default";
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000290 pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_cts_pg_pins>;
291 uart-has-rtscts;
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530292 status = "okay";
Andre Przywaraa17d02d2020-01-01 23:44:46 +0000293
294 bluetooth {
295 compatible = "brcm,bcm43438-bt";
296 clocks = <&ccu CLK_OUTA>;
297 clock-names = "lpo";
298 vbat-supply = <&reg_dldo2>;
299 vddio-supply = <&reg_dldo1>;
300 device-wakeup-gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
301 /* TODO host wake line connected to PMIC GPIO pins */
302 shutdown-gpios = <&pio 7 12 GPIO_ACTIVE_HIGH>; /* PH12 */
303 max-speed = <1500000>;
304 };
Jagan Tekicb0f3a52018-04-27 17:33:42 +0530305};
Jagan Teki9e913002018-08-05 00:40:13 +0530306
307&usbphy {
308 usb1_vbus-supply = <&reg_vcc5v0>;
309 status = "okay";
310};