Loading...
1/*
2 * Copyright (c) 2017 Free Electrons <maxime.ripard@free-electrons.com>
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-a33.dtsi"
45
46#include <dt-bindings/gpio/gpio.h>
47
48/ {
49 model = "BananaPi M2 Magic";
50 compatible = "sinovoip,bananapi-m2m", "allwinner,sun8i-a33";
51
52 aliases {
53 i2c0 = &i2c0;
54 i2c1 = &i2c1;
55 i2c2 = &i2c2;
56 serial0 = &uart0;
57 serial1 = &uart1;
58 };
59
60 chosen {
61 stdout-path = "serial0:115200n8";
62 };
63
64 leds {
65 compatible = "gpio-leds";
66
67 blue {
68 label = "bpi-m2m:blue:usr";
69 gpios = <&pio 2 7 GPIO_ACTIVE_LOW>;
70 };
71
72 green {
73 label = "bpi-m2m:green:usr";
74 gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>;
75 };
76
77 red {
78 label = "bpi-m2m:red:power";
79 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
80 default-state = "on";
81 };
82 };
83
84 reg_vcc5v0: vcc5v0 {
85 compatible = "regulator-fixed";
86 regulator-name = "vcc5v0";
87 regulator-min-microvolt = <5000000>;
88 regulator-max-microvolt = <5000000>;
89 };
90
91 wifi_pwrseq: wifi_pwrseq {
92 compatible = "mmc-pwrseq-simple";
93 reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
94 };
95};
96
97&codec {
98 status = "okay";
99};
100
101&cpu0 {
102 cpu-supply = <®_dcdc3>;
103};
104
105&cpu0_opp_table {
106 opp@1104000000 {
107 opp-hz = /bits/ 64 <1104000000>;
108 opp-microvolt = <1320000>;
109 clock-latency-ns = <244144>; /* 8 32k periods */
110 };
111
112 opp@1200000000 {
113 opp-hz = /bits/ 64 <1200000000>;
114 opp-microvolt = <1320000>;
115 clock-latency-ns = <244144>; /* 8 32k periods */
116 };
117};
118
119&dai {
120 status = "okay";
121};
122
123&ehci0 {
124 status = "okay";
125};
126
127/* This is the i2c bus exposed on the DSI connector for the touch panel */
128&i2c0 {
129 pinctrl-names = "default";
130 pinctrl-0 = <&i2c0_pins_a>;
131 status = "disabled";
132};
133
134/* This is the i2c bus exposed on the GPIO header */
135&i2c1 {
136 pinctrl-names = "default";
137 pinctrl-0 = <&i2c1_pins_a>;
138 status = "disabled";
139};
140
141/* This is the i2c bus exposed on the CSI connector to control the sensor */
142&i2c2 {
143 pinctrl-names = "default";
144 pinctrl-0 = <&i2c2_pins_a>;
145 status = "disabled";
146};
147
148&mmc0 {
149 pinctrl-names = "default";
150 pinctrl-0 = <&mmc0_pins_a>;
151 vmmc-supply = <®_dcdc1>;
152 bus-width = <4>;
153 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
154 status = "okay";
155};
156
157&mmc1 {
158 pinctrl-names = "default";
159 pinctrl-0 = <&mmc1_pins_a>;
160 vmmc-supply = <®_aldo1>;
161 mmc-pwrseq = <&wifi_pwrseq>;
162 bus-width = <4>;
163 non-removable;
164 status = "okay";
165};
166
167&mmc2 {
168 pinctrl-names = "default";
169 pinctrl-0 = <&mmc2_8bit_pins>;
170 vmmc-supply = <®_dcdc1>;
171 bus-width = <8>;
172 non-removable;
173 cap-mmc-hw-reset;
174 status = "okay";
175};
176
177&ohci0 {
178 status = "okay";
179};
180
181&r_rsb {
182 status = "okay";
183
184 axp22x: pmic@3a3 {
185 compatible = "x-powers,axp223";
186 reg = <0x3a3>;
187 interrupt-parent = <&nmi_intc>;
188 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
189 eldoin-supply = <®_dcdc1>;
190 x-powers,drive-vbus-en;
191 };
192};
193
194#include "axp223.dtsi"
195
196&ac_power_supply {
197 status = "okay";
198};
199
200®_aldo1 {
201 regulator-always-on;
202 regulator-min-microvolt = <3000000>;
203 regulator-max-microvolt = <3000000>;
204 regulator-name = "vcc-io";
205};
206
207®_aldo2 {
208 regulator-always-on;
209 regulator-min-microvolt = <2500000>;
210 regulator-max-microvolt = <2500000>;
211 regulator-name = "vdd-dll";
212};
213
214®_aldo3 {
215 regulator-always-on;
216 regulator-min-microvolt = <3000000>;
217 regulator-max-microvolt = <3000000>;
218 regulator-name = "avcc";
219};
220
221®_dc1sw {
222 regulator-name = "vcc-lcd";
223};
224
225®_dc5ldo {
226 regulator-always-on;
227 regulator-min-microvolt = <900000>;
228 regulator-max-microvolt = <1400000>;
229 regulator-name = "vdd-cpus";
230};
231
232®_dcdc1 {
233 regulator-always-on;
234 regulator-min-microvolt = <3000000>;
235 regulator-max-microvolt = <3000000>;
236 regulator-name = "vcc-3v0";
237};
238
239®_dcdc2 {
240 regulator-always-on;
241 regulator-min-microvolt = <900000>;
242 regulator-max-microvolt = <1400000>;
243 regulator-name = "vdd-sys";
244};
245
246®_dcdc3 {
247 regulator-always-on;
248 regulator-min-microvolt = <900000>;
249 regulator-max-microvolt = <1400000>;
250 regulator-name = "vdd-cpu";
251};
252
253®_dcdc5 {
254 regulator-always-on;
255 regulator-min-microvolt = <1500000>;
256 regulator-max-microvolt = <1500000>;
257 regulator-name = "vcc-dram";
258};
259
260/*
261 * Our WiFi chip needs both DLDO1 and DLDO2 to be powered at the same
262 * time, with the two being in sync. Since this is not really
263 * supported right now, just use the two as always on, and we will fix
264 * it later.
265 */
266®_dldo1 {
267 regulator-always-on;
268 regulator-min-microvolt = <3300000>;
269 regulator-max-microvolt = <3300000>;
270 regulator-name = "vcc-wifi0";
271};
272
273®_dldo2 {
274 regulator-always-on;
275 regulator-min-microvolt = <3300000>;
276 regulator-max-microvolt = <3300000>;
277 regulator-name = "vcc-wifi1";
278};
279
280®_drivevbus {
281 regulator-name = "usb0-vbus";
282 status = "okay";
283};
284
285®_rtc_ldo {
286 regulator-name = "vcc-rtc";
287};
288
289&sound {
290 status = "okay";
291};
292
293&uart0 {
294 pinctrl-names = "default";
295 pinctrl-0 = <&uart0_pins_b>;
296 status = "okay";
297};
298
299&uart1 {
300 pinctrl-names = "default";
301 pinctrl-0 = <&uart1_pins_a>, <&uart1_pins_cts_rts_a>;
302 status = "okay";
303};
304
305&usb_otg {
306 dr_mode = "otg";
307 status = "okay";
308};
309
310&usb_power_supply {
311 status = "okay";
312};
313
314&usbphy {
315 usb0_id_det-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
316 usb0_vbus_power-supply = <&usb_power_supply>;
317 usb0_vbus-supply = <®_drivevbus>;
318 usb1_vbus-supply = <®_vcc5v0>;
319 status = "okay";
320};
1/*
2 * Copyright (c) 2017 Free Electrons <maxime.ripard@free-electrons.com>
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-a33.dtsi"
45
46#include <dt-bindings/gpio/gpio.h>
47
48/ {
49 model = "BananaPi M2 Magic";
50 compatible = "sinovoip,bananapi-m2m", "allwinner,sun8i-a33";
51
52 aliases {
53 i2c0 = &i2c0;
54 i2c1 = &i2c1;
55 i2c2 = &i2c2;
56 serial0 = &uart0;
57 serial1 = &uart1;
58 };
59
60 chosen {
61 stdout-path = "serial0:115200n8";
62 };
63
64 leds {
65 compatible = "gpio-leds";
66
67 blue {
68 label = "bpi-m2m:blue:usr";
69 gpios = <&pio 2 7 GPIO_ACTIVE_LOW>;
70 };
71
72 green {
73 label = "bpi-m2m:green:usr";
74 gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>;
75 };
76
77 red {
78 label = "bpi-m2m:red:power";
79 gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
80 default-state = "on";
81 };
82 };
83
84 reg_vcc5v0: vcc5v0 {
85 compatible = "regulator-fixed";
86 regulator-name = "vcc5v0";
87 regulator-min-microvolt = <5000000>;
88 regulator-max-microvolt = <5000000>;
89 };
90
91 wifi_pwrseq: wifi_pwrseq {
92 compatible = "mmc-pwrseq-simple";
93 reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL06 */
94 clocks = <&rtc 1>;
95 clock-names = "ext_clock";
96 };
97};
98
99&codec {
100 status = "okay";
101};
102
103&cpu0 {
104 cpu-supply = <®_dcdc3>;
105};
106
107&cpu0_opp_table {
108 opp-1104000000 {
109 opp-hz = /bits/ 64 <1104000000>;
110 opp-microvolt = <1320000>;
111 clock-latency-ns = <244144>; /* 8 32k periods */
112 };
113
114 opp-1200000000 {
115 opp-hz = /bits/ 64 <1200000000>;
116 opp-microvolt = <1320000>;
117 clock-latency-ns = <244144>; /* 8 32k periods */
118 };
119};
120
121&dai {
122 status = "okay";
123};
124
125&ehci0 {
126 status = "okay";
127};
128
129&mmc0 {
130 vmmc-supply = <®_dcdc1>;
131 bus-width = <4>;
132 cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
133 status = "okay";
134};
135
136&mmc1 {
137 pinctrl-names = "default";
138 pinctrl-0 = <&mmc1_pg_pins>;
139 vmmc-supply = <®_aldo1>;
140 mmc-pwrseq = <&wifi_pwrseq>;
141 bus-width = <4>;
142 non-removable;
143 status = "okay";
144};
145
146&mmc2 {
147 pinctrl-names = "default";
148 pinctrl-0 = <&mmc2_8bit_pins>;
149 vmmc-supply = <®_dcdc1>;
150 bus-width = <8>;
151 non-removable;
152 cap-mmc-hw-reset;
153 status = "okay";
154};
155
156&ohci0 {
157 status = "okay";
158};
159
160&r_rsb {
161 status = "okay";
162
163 axp22x: pmic@3a3 {
164 compatible = "x-powers,axp223";
165 reg = <0x3a3>;
166 interrupt-parent = <&nmi_intc>;
167 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
168 eldoin-supply = <®_dcdc1>;
169 x-powers,drive-vbus-en;
170 };
171};
172
173#include "axp223.dtsi"
174
175&ac_power_supply {
176 status = "okay";
177};
178
179®_aldo1 {
180 regulator-always-on;
181 regulator-min-microvolt = <3000000>;
182 regulator-max-microvolt = <3000000>;
183 regulator-name = "vcc-io";
184};
185
186®_aldo2 {
187 regulator-always-on;
188 regulator-min-microvolt = <2500000>;
189 regulator-max-microvolt = <2500000>;
190 regulator-name = "vdd-dll";
191};
192
193®_aldo3 {
194 regulator-always-on;
195 regulator-min-microvolt = <3000000>;
196 regulator-max-microvolt = <3000000>;
197 regulator-name = "avcc";
198};
199
200®_dc1sw {
201 regulator-name = "vcc-lcd";
202};
203
204®_dc5ldo {
205 regulator-always-on;
206 regulator-min-microvolt = <900000>;
207 regulator-max-microvolt = <1400000>;
208 regulator-name = "vdd-cpus";
209};
210
211®_dcdc1 {
212 regulator-always-on;
213 regulator-min-microvolt = <3000000>;
214 regulator-max-microvolt = <3000000>;
215 regulator-name = "vcc-3v0";
216};
217
218®_dcdc2 {
219 regulator-always-on;
220 regulator-min-microvolt = <900000>;
221 regulator-max-microvolt = <1400000>;
222 regulator-name = "vdd-sys";
223};
224
225®_dcdc3 {
226 regulator-always-on;
227 regulator-min-microvolt = <900000>;
228 regulator-max-microvolt = <1400000>;
229 regulator-name = "vdd-cpu";
230};
231
232®_dcdc5 {
233 regulator-always-on;
234 regulator-min-microvolt = <1500000>;
235 regulator-max-microvolt = <1500000>;
236 regulator-name = "vcc-dram";
237};
238
239/*
240 * Our WiFi chip needs both DLDO1 and DLDO2 to be powered at the same
241 * time, with the two being in sync. Since this is not really
242 * supported right now, just use the two as always on, and we will fix
243 * it later.
244 */
245®_dldo1 {
246 regulator-always-on;
247 regulator-min-microvolt = <3300000>;
248 regulator-max-microvolt = <3300000>;
249 regulator-name = "vcc-wifi0";
250};
251
252®_dldo2 {
253 regulator-always-on;
254 regulator-min-microvolt = <3300000>;
255 regulator-max-microvolt = <3300000>;
256 regulator-name = "vcc-wifi1";
257};
258
259®_drivevbus {
260 regulator-name = "usb0-vbus";
261 status = "okay";
262};
263
264®_rtc_ldo {
265 regulator-name = "vcc-rtc";
266};
267
268&sound {
269 status = "okay";
270};
271
272&uart0 {
273 pinctrl-names = "default";
274 pinctrl-0 = <&uart0_pb_pins>;
275 status = "okay";
276};
277
278&uart1 {
279 pinctrl-names = "default";
280 pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pg_pins>;
281 uart-has-rtscts;
282 status = "okay";
283
284 bluetooth {
285 compatible = "brcm,bcm43438-bt";
286 clocks = <&rtc 1>;
287 clock-names = "lpo";
288 vbat-supply = <®_dldo1>;
289 vddio-supply = <®_aldo3>;
290 device-wakeup-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
291 host-wakeup-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
292 shutdown-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
293 };
294};
295
296&usb_otg {
297 dr_mode = "otg";
298 status = "okay";
299};
300
301&usb_power_supply {
302 status = "okay";
303};
304
305&usbphy {
306 usb0_id_det-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
307 usb0_vbus_power-supply = <&usb_power_supply>;
308 usb0_vbus-supply = <®_drivevbus>;
309 usb1_vbus-supply = <®_vcc5v0>;
310 status = "okay";
311};