Loading...
1/*
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 {
53 ethernet0 = &gmac;
54 serial0 = &uart0;
55 };
56
57 chosen {
58 stdout-path = "serial0:115200n8";
59 };
60
61 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
72 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
87 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
96 wifi_pwrseq: wifi_pwrseq {
97 compatible = "mmc-pwrseq-simple";
98 reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
99 clocks = <&ccu CLK_OUTA>;
100 clock-names = "ext_clock";
101 };
102};
103
104&ahci {
105 ahci-supply = <®_dldo4>;
106 phy-supply = <®_eldo3>;
107 status = "okay";
108};
109
110&de {
111 status = "okay";
112};
113
114&ehci1 {
115 /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
116 status = "okay";
117};
118
119&gmac {
120 pinctrl-names = "default";
121 pinctrl-0 = <&gmac_rgmii_pins>;
122 phy-handle = <&phy1>;
123 phy-mode = "rgmii-id";
124 phy-supply = <®_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
135&hdmi {
136 status = "okay";
137};
138
139&hdmi_out {
140 hdmi_out_con: endpoint {
141 remote-endpoint = <&hdmi_con_in>;
142 };
143};
144
145&i2c0 {
146 status = "okay";
147
148 axp22x: pmic@34 {
149 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
158&mmc0 {
159 vmmc-supply = <®_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 = <®_dldo2>;
169 vqmmc-supply = <®_dldo1>;
170 mmc-pwrseq = <&wifi_pwrseq>;
171 bus-width = <4>;
172 non-removable;
173 status = "okay";
174};
175
176&pio {
177 pinctrl-names = "default";
178 pinctrl-0 = <&clk_out_a_pin>;
179 vcc-pa-supply = <®_aldo2>;
180 vcc-pc-supply = <®_dcdc1>;
181 vcc-pd-supply = <®_dcdc1>;
182 vcc-pe-supply = <®_eldo1>;
183 vcc-pf-supply = <®_dcdc1>;
184 vcc-pg-supply = <®_dldo1>;
185};
186
187®_aldo2 {
188 regulator-min-microvolt = <2500000>;
189 regulator-max-microvolt = <2500000>;
190 regulator-name = "vcc-pa";
191};
192
193®_aldo3 {
194 regulator-always-on;
195 regulator-min-microvolt = <2700000>;
196 regulator-max-microvolt = <3300000>;
197 regulator-name = "avcc";
198};
199
200®_dc1sw {
201 regulator-min-microvolt = <3300000>;
202 regulator-max-microvolt = <3300000>;
203 regulator-name = "vcc-gmac-phy";
204};
205
206®_dcdc1 {
207 regulator-always-on;
208 regulator-min-microvolt = <3300000>;
209 regulator-max-microvolt = <3300000>;
210 regulator-name = "vcc-3v3";
211};
212
213®_dcdc2 {
214 regulator-always-on;
215 regulator-min-microvolt = <1000000>;
216 regulator-max-microvolt = <1300000>;
217 regulator-name = "vdd-cpu";
218};
219
220®_dcdc3 {
221 regulator-always-on;
222 regulator-min-microvolt = <1000000>;
223 regulator-max-microvolt = <1300000>;
224 regulator-name = "vdd-sys";
225};
226
227®_dcdc5 {
228 regulator-always-on;
229 regulator-min-microvolt = <1500000>;
230 regulator-max-microvolt = <1500000>;
231 regulator-name = "vcc-dram";
232};
233
234®_dldo1 {
235 regulator-min-microvolt = <1800000>;
236 regulator-max-microvolt = <3300000>;
237 regulator-name = "vcc-wifi-io";
238};
239
240/*
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
247®_dldo2 {
248 regulator-always-on;
249 regulator-min-microvolt = <3300000>;
250 regulator-max-microvolt = <3300000>;
251 regulator-name = "vcc-wifi";
252};
253
254®_dldo3 {
255 regulator-always-on;
256 regulator-min-microvolt = <3300000>;
257 regulator-max-microvolt = <3300000>;
258 regulator-name = "vcc-wifi-2";
259};
260
261®_dldo4 {
262 regulator-min-microvolt = <2500000>;
263 regulator-max-microvolt = <2500000>;
264 regulator-name = "vdd2v5-sata";
265};
266
267®_eldo3 {
268 regulator-min-microvolt = <1200000>;
269 regulator-max-microvolt = <1200000>;
270 regulator-name = "vdd1v2-sata";
271};
272
273&tcon_tv0 {
274 status = "okay";
275};
276
277&uart0 {
278 pinctrl-names = "default";
279 pinctrl-0 = <&uart0_pb_pins>;
280 status = "okay";
281};
282
283&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 = <®_dldo2>;
294 vddio-supply = <®_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
302&usbphy {
303 usb1_vbus-supply = <®_vcc5v0>;
304 status = "okay";
305};
1/*
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 {
53 serial0 = &uart0;
54 };
55
56 chosen {
57 stdout-path = "serial0:115200n8";
58 };
59
60 leds {
61 compatible = "gpio-leds";
62
63 pwr-led {
64 label = "bananapi:red:pwr";
65 gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>;
66 default-state = "on";
67 };
68
69 user-led {
70 label = "bananapi:green:user";
71 gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>;
72 };
73 };
74
75 reg_vcc5v0: vcc5v0 {
76 compatible = "regulator-fixed";
77 regulator-name = "vcc5v0";
78 regulator-min-microvolt = <5000000>;
79 regulator-max-microvolt = <5000000>;
80 gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */
81 enable-active-high;
82 };
83
84 wifi_pwrseq: wifi_pwrseq {
85 compatible = "mmc-pwrseq-simple";
86 reset-gpios = <&pio 6 10 GPIO_ACTIVE_LOW>; /* PG10 WIFI_EN */
87 };
88};
89
90&i2c0 {
91 status = "okay";
92
93 axp22x: pmic@68 {
94 compatible = "x-powers,axp221";
95 reg = <0x34>;
96 interrupt-parent = <&nmi_intc>;
97 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
98 };
99};
100
101#include "axp22x.dtsi"
102
103®_aldo3 {
104 regulator-always-on;
105 regulator-min-microvolt = <2700000>;
106 regulator-max-microvolt = <3300000>;
107 regulator-name = "avcc";
108};
109
110®_dcdc1 {
111 regulator-always-on;
112 regulator-min-microvolt = <3000000>;
113 regulator-max-microvolt = <3000000>;
114 regulator-name = "vcc-3v0";
115};
116
117®_dcdc2 {
118 regulator-always-on;
119 regulator-min-microvolt = <1000000>;
120 regulator-max-microvolt = <1300000>;
121 regulator-name = "vdd-cpu";
122};
123
124®_dcdc3 {
125 regulator-always-on;
126 regulator-min-microvolt = <1000000>;
127 regulator-max-microvolt = <1300000>;
128 regulator-name = "vdd-sys";
129};
130
131®_dcdc5 {
132 regulator-always-on;
133 regulator-min-microvolt = <1500000>;
134 regulator-max-microvolt = <1500000>;
135 regulator-name = "vcc-dram";
136};
137
138®_dldo1 {
139 regulator-min-microvolt = <1800000>;
140 regulator-max-microvolt = <3300000>;
141 regulator-name = "vcc-wifi-io";
142};
143
144®_dldo2 {
145 regulator-min-microvolt = <3300000>;
146 regulator-max-microvolt = <3300000>;
147 regulator-name = "vcc-wifi";
148};
149
150&mmc0 {
151 vmmc-supply = <®_dcdc1>;
152 bus-width = <4>;
153 cd-gpios = <&pio 7 13 GPIO_ACTIVE_LOW>; /* PH13 */
154 status = "okay";
155};
156
157&mmc1 {
158 pinctrl-names = "default";
159 pinctrl-0 = <&mmc1_pg_pins>;
160 vmmc-supply = <®_dldo2>;
161 vqmmc-supply = <®_dldo1>;
162 mmc-pwrseq = <&wifi_pwrseq>;
163 bus-width = <4>;
164 non-removable;
165 status = "okay";
166};
167
168&uart0 {
169 pinctrl-names = "default";
170 pinctrl-0 = <&uart0_pb_pins>;
171 status = "okay";
172};