Loading...
1/*
2 * Copyright 2015 Hans de Goede <hdegoede@redhat.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 library 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 library 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 "sun6i-a31s.dtsi"
45#include <dt-bindings/gpio/gpio.h>
46
47/ {
48 model = "Sinovoip BPI-M2";
49 compatible = "sinovoip,bpi-m2", "allwinner,sun6i-a31s";
50
51 aliases {
52 serial0 = &uart0;
53 };
54
55 chosen {
56 stdout-path = "serial0:115200n8";
57 };
58
59 leds {
60 compatible = "gpio-leds";
61 pinctrl-names = "default";
62 pinctrl-0 = <&led_pins_bpi_m2>;
63
64 blue {
65 label = "bpi-m2:blue:usr";
66 gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
67 };
68
69 green {
70 label = "bpi-m2:green:usr";
71 gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10 */
72 };
73
74 red {
75 label = "bpi-m2:red:usr";
76 gpios = <&pio 6 5 GPIO_ACTIVE_HIGH>; /* PG5 */
77 };
78 };
79
80 mmc2_pwrseq: mmc2_pwrseq {
81 compatible = "mmc-pwrseq-simple";
82 pinctrl-names = "default";
83 pinctrl-0 = <&mmc2_pwrseq_pin_bpi_m2>;
84 reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 WIFI_EN */
85 };
86};
87
88&cpu0 {
89 cpu-supply = <®_dcdc3>;
90};
91
92&ehci0 {
93 status = "okay";
94};
95
96&gmac {
97 pinctrl-names = "default";
98 pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_bpi_m2>;
99 phy = <&phy1>;
100 phy-mode = "rgmii";
101 phy-supply = <®_dldo1>;
102 snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; /* PA21 */
103 snps,reset-active-low;
104 snps,reset-delays-us = <0 10000 30000>;
105 status = "okay";
106
107 phy1: ethernet-phy@1 {
108 reg = <1>;
109 };
110};
111
112&ir {
113 pinctrl-names = "default";
114 pinctrl-0 = <&ir_pins_a>;
115 status = "okay";
116};
117
118&mmc0 {
119 pinctrl-names = "default";
120 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bpi_m2>;
121 vmmc-supply = <®_dcdc1>;
122 bus-width = <4>;
123 cd-gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
124 status = "okay";
125};
126
127&mmc0_pins_a {
128 bias-pull-up;
129};
130
131&mmc2 {
132 pinctrl-names = "default";
133 pinctrl-0 = <&mmc2_pins_a>;
134 vmmc-supply = <®_aldo1>;
135 mmc-pwrseq = <&mmc2_pwrseq>;
136 bus-width = <4>;
137 non-removable;
138 status = "okay";
139
140 brcmf: wifi@1 {
141 reg = <1>;
142 compatible = "brcm,bcm4329-fmac";
143 interrupt-parent = <&r_pio>;
144 interrupts = <0 5 IRQ_TYPE_LEVEL_LOW>; /* PL5 */
145 interrupt-names = "host-wake";
146 };
147};
148
149&mmc2_pins_a {
150 bias-pull-up;
151};
152
153&ohci0 {
154 status = "okay";
155};
156
157&p2wi {
158 status = "okay";
159
160 axp22x: pmic@68 {
161 compatible = "x-powers,axp221";
162 reg = <0x68>;
163 interrupt-parent = <&nmi_intc>;
164 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
165 eldoin-supply = <®_dcdc1>;
166 x-powers,drive-vbus-en;
167 };
168};
169
170&pio {
171 gmac_phy_reset_pin_bpi_m2: gmac_phy_reset_pin@0 {
172 pins = "PA21";
173 function = "gpio_out";
174 };
175
176 led_pins_bpi_m2: led_pins@0 {
177 pins = "PG5", "PG10", "PG11";
178 function = "gpio_out";
179 };
180
181 mmc0_cd_pin_bpi_m2: mmc0_cd_pin@0 {
182 pins = "PA4";
183 function = "gpio_in";
184 bias-pull-up;
185 };
186};
187
188&r_pio {
189 mmc2_pwrseq_pin_bpi_m2: mmc2_pwrseq_pin@0 {
190 pins = "PL8";
191 function = "gpio_out";
192 };
193};
194
195#include "axp22x.dtsi"
196
197®_aldo1 {
198 regulator-min-microvolt = <3300000>;
199 regulator-max-microvolt = <3300000>;
200 regulator-name = "vcc-wifi";
201};
202
203®_aldo2 {
204 regulator-always-on;
205 regulator-min-microvolt = <2500000>;
206 regulator-max-microvolt = <2500000>;
207 regulator-name = "vcc-gmac";
208};
209
210®_aldo3 {
211 regulator-always-on;
212 regulator-min-microvolt = <3000000>;
213 regulator-max-microvolt = <3000000>;
214 regulator-name = "avcc";
215};
216
217®_dc5ldo {
218 regulator-always-on;
219 regulator-min-microvolt = <700000>;
220 regulator-max-microvolt = <1320000>;
221 regulator-name = "vdd-cpus";
222};
223
224®_dcdc1 {
225 regulator-always-on;
226 regulator-min-microvolt = <3000000>;
227 regulator-max-microvolt = <3000000>;
228 regulator-name = "vdd-3v0";
229};
230
231®_dcdc2 {
232 regulator-min-microvolt = <700000>;
233 regulator-max-microvolt = <1320000>;
234 regulator-name = "vdd-gpu";
235};
236
237®_dcdc3 {
238 regulator-always-on;
239 regulator-min-microvolt = <700000>;
240 regulator-max-microvolt = <1320000>;
241 regulator-name = "vdd-cpu";
242};
243
244®_dcdc4 {
245 regulator-always-on;
246 regulator-min-microvolt = <700000>;
247 regulator-max-microvolt = <1320000>;
248 regulator-name = "vdd-sys-dll";
249};
250
251®_dcdc5 {
252 regulator-always-on;
253 regulator-min-microvolt = <1500000>;
254 regulator-max-microvolt = <1500000>;
255 regulator-name = "vcc-dram";
256};
257
258®_dldo1 {
259 regulator-min-microvolt = <3000000>;
260 regulator-max-microvolt = <3000000>;
261 regulator-name = "vcc-mac";
262};
263
264®_dldo2 {
265 regulator-min-microvolt = <2800000>;
266 regulator-max-microvolt = <2800000>;
267 regulator-name = "avdd-csi";
268};
269
270®_dldo3 {
271 regulator-always-on;
272 regulator-min-microvolt = <3300000>;
273 regulator-max-microvolt = <3300000>;
274 regulator-name = "vcc-pb";
275};
276
277®_eldo1 {
278 regulator-min-microvolt = <1800000>;
279 regulator-max-microvolt = <1800000>;
280 regulator-name = "vdd-csi";
281 status = "okay";
282};
283
284®_ldo_io1 {
285 regulator-always-on;
286 regulator-min-microvolt = <1800000>;
287 regulator-max-microvolt = <1800000>;
288 regulator-name = "vcc-pm-cpus";
289 status = "okay";
290};
291
292&uart0 {
293 pinctrl-names = "default";
294 pinctrl-0 = <&uart0_pins_a>;
295 status = "okay";
296};
297
298&usbphy {
299 status = "okay";
300};
1/*
2 * Copyright 2015 Hans de Goede <hdegoede@redhat.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 library 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 library 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 "sun6i-a31s.dtsi"
45#include <dt-bindings/gpio/gpio.h>
46
47/ {
48 model = "Sinovoip BPI-M2";
49 compatible = "sinovoip,bpi-m2", "allwinner,sun6i-a31s";
50
51 aliases {
52 serial0 = &uart0;
53 };
54
55 chosen {
56 stdout-path = "serial0:115200n8";
57 };
58
59 leds {
60 compatible = "gpio-leds";
61
62 led-0 {
63 label = "bpi-m2:blue:usr";
64 gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
65 };
66
67 led-1 {
68 label = "bpi-m2:green:usr";
69 gpios = <&pio 6 10 GPIO_ACTIVE_HIGH>; /* PG10 */
70 };
71
72 led-2 {
73 label = "bpi-m2:red:usr";
74 gpios = <&pio 6 5 GPIO_ACTIVE_HIGH>; /* PG5 */
75 };
76 };
77
78 mmc2_pwrseq: mmc2_pwrseq {
79 compatible = "mmc-pwrseq-simple";
80 reset-gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 WIFI_EN */
81 };
82};
83
84&cpu0 {
85 cpu-supply = <®_dcdc3>;
86};
87
88&ehci0 {
89 status = "okay";
90};
91
92&gmac {
93 pinctrl-names = "default";
94 pinctrl-0 = <&gmac_rgmii_pins>;
95 phy-handle = <&phy1>;
96 phy-mode = "rgmii";
97 phy-supply = <®_dldo1>;
98 status = "okay";
99};
100
101&ir {
102 pinctrl-names = "default";
103 pinctrl-0 = <&s_ir_rx_pin>;
104 status = "okay";
105};
106
107&mdio {
108 phy1: ethernet-phy@1 {
109 reg = <1>;
110 reset-gpios = <&pio 0 21 GPIO_ACTIVE_LOW>; /* PA21 */
111 reset-assert-us = <10000>;
112 reset-deassert-us = <30000>;
113 };
114};
115
116&mmc0 {
117 vmmc-supply = <®_dcdc1>;
118 bus-width = <4>;
119 cd-gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
120 status = "okay";
121};
122
123&mmc2 {
124 pinctrl-names = "default";
125 pinctrl-0 = <&mmc2_4bit_pins>;
126 vmmc-supply = <®_aldo1>;
127 mmc-pwrseq = <&mmc2_pwrseq>;
128 bus-width = <4>;
129 non-removable;
130 status = "okay";
131
132 brcmf: wifi@1 {
133 reg = <1>;
134 compatible = "brcm,bcm4329-fmac";
135 interrupt-parent = <&r_pio>;
136 interrupts = <0 5 IRQ_TYPE_LEVEL_LOW>; /* PL5 */
137 interrupt-names = "host-wake";
138 };
139};
140
141&ohci0 {
142 status = "okay";
143};
144
145&p2wi {
146 status = "okay";
147
148 axp22x: pmic@68 {
149 compatible = "x-powers,axp221";
150 reg = <0x68>;
151 interrupt-parent = <&r_intc>;
152 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
153 eldoin-supply = <®_dcdc1>;
154 x-powers,drive-vbus-en;
155 };
156};
157
158#include "axp22x.dtsi"
159
160®_aldo1 {
161 regulator-min-microvolt = <3300000>;
162 regulator-max-microvolt = <3300000>;
163 regulator-name = "vcc-wifi";
164};
165
166®_aldo2 {
167 regulator-always-on;
168 regulator-min-microvolt = <2500000>;
169 regulator-max-microvolt = <2500000>;
170 regulator-name = "vcc-gmac";
171};
172
173®_aldo3 {
174 regulator-always-on;
175 regulator-min-microvolt = <3000000>;
176 regulator-max-microvolt = <3000000>;
177 regulator-name = "avcc";
178};
179
180®_dc5ldo {
181 regulator-always-on;
182 regulator-min-microvolt = <700000>;
183 regulator-max-microvolt = <1320000>;
184 regulator-name = "vdd-cpus";
185};
186
187®_dcdc1 {
188 regulator-always-on;
189 regulator-min-microvolt = <3000000>;
190 regulator-max-microvolt = <3000000>;
191 regulator-name = "vdd-3v0";
192};
193
194®_dcdc2 {
195 regulator-min-microvolt = <700000>;
196 regulator-max-microvolt = <1320000>;
197 regulator-name = "vdd-gpu";
198};
199
200®_dcdc3 {
201 regulator-always-on;
202 regulator-min-microvolt = <700000>;
203 regulator-max-microvolt = <1320000>;
204 regulator-name = "vdd-cpu";
205};
206
207®_dcdc4 {
208 regulator-always-on;
209 regulator-min-microvolt = <700000>;
210 regulator-max-microvolt = <1320000>;
211 regulator-name = "vdd-sys-dll";
212};
213
214®_dcdc5 {
215 regulator-always-on;
216 regulator-min-microvolt = <1500000>;
217 regulator-max-microvolt = <1500000>;
218 regulator-name = "vcc-dram";
219};
220
221®_dldo1 {
222 regulator-min-microvolt = <3000000>;
223 regulator-max-microvolt = <3000000>;
224 regulator-name = "vcc-mac";
225};
226
227®_dldo2 {
228 regulator-min-microvolt = <2800000>;
229 regulator-max-microvolt = <2800000>;
230 regulator-name = "avdd-csi";
231};
232
233®_dldo3 {
234 regulator-always-on;
235 regulator-min-microvolt = <3300000>;
236 regulator-max-microvolt = <3300000>;
237 regulator-name = "vcc-pb";
238};
239
240®_eldo1 {
241 regulator-min-microvolt = <1800000>;
242 regulator-max-microvolt = <1800000>;
243 regulator-name = "vdd-csi";
244 status = "okay";
245};
246
247®_ldo_io1 {
248 regulator-always-on;
249 regulator-min-microvolt = <1800000>;
250 regulator-max-microvolt = <1800000>;
251 regulator-name = "vcc-pm-cpus";
252 status = "okay";
253};
254
255&uart0 {
256 pinctrl-names = "default";
257 pinctrl-0 = <&uart0_ph_pins>;
258 status = "okay";
259};
260
261&usbphy {
262 status = "okay";
263};
264
265&pio {
266 gpio-line-names =
267 /* PA */
268 "ETXD0", "ETXD1", "ETXD2", "ETXD3", "SDC0-DET", "", "",
269 "", "ETXCLK", "ETXEN", "EGTXCLK", "ERXD0", "ERXD1",
270 "ERXD2", "ERXD3", "", "", "", "", "ERXDV", "ERXCK",
271 "ETXERR", "ERXERR", "ECOL", "ECRS", "ECLKIN", "EMDC",
272 "EMDIO", "", "", "", "",
273
274 /* PB */
275 "CN7-P29", "CN7-P31", "CN7-P33", "CN7-P35", "CN7-P37",
276 "CN7-P28", "CN7-P27", "CN7-P32", "", "", "", "", "", "",
277 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
278 "", "", "", "",
279
280 /* PC */
281 "", "", "", "", "", "", "WL-SDIO-CMD", "WL-SDIO-CLK",
282 "WL-SDIO-D0", "WL-SDIO-D2", "WL-SDIO-D2", "WL-SDIO-D3",
283 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
284 "", "USB-DRV", "", "", "", "",
285
286 /* PD */
287 "CN9-P09", "CN9-P11", "CN9-P13", "CN9-P15", "CN9-P17",
288 "CN9-P19", "CN9-P21", "CN9-P23", "CN9-P25", "CN9-P27",
289 "CN9-P29", "CN9-P31", "CN9-P33", "CN9-P35", "CN9-P37",
290 "CN9-P39", "CN9-P40", "CN9-P38", "CN9-P36", "CN9-P34",
291 "CN9-P32", "CN9-P30", "CN9-P28", "CN9-P26", "CN9-P22",
292 "CN9-P14", "CN9-P18", "CN9-P16", "", "", "", "",
293
294 /* PE */
295 "CN6-P20", "CN6-P24", "CN6-P30", "CN6-P28", "CN7-P08",
296 "CN7-P10", "CN7-P36", "CN7-P38", "CN6-P17", "CN6-P19",
297 "CN6-P21", "CN6-P23", "CN6-P25", "CN6-P27", "CN6-P29",
298 "CN6-P31", "", "", "", "", "", "", "", "", "", "", "",
299 "", "", "", "", "",
300
301 /* PF */
302 "SDC0-D1", "SDC0-D0", "SDC0-CLK", "SDC0-CMD", "SDC0-D3",
303 "SDC0-D2", "", "", "", "", "", "", "", "", "", "", "",
304 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
305 "",
306
307 /* PG */
308 "CN9-P06", "CN9-P08", "CN9-P20", "CN9-P12", "CN9-P07",
309 "LED-PWR", "CN7-P13", "CN7-P11", "CN7-P22", "CN7-P15",
310 "LED-G", "LED-B", "CN7-P26", "CN7-P24", "CN7-P23",
311 "CN7-P19", "CN7-P21", "HCEC", "CN6-P22", "", "", "", "",
312 "", "", "", "", "", "", "", "", "",
313
314 /* PH */
315 "", "", "", "", "", "", "", "", "", "CN7-P07",
316 "CN7-P12", "CN7-P16", "CN7-P18", "CN9-P10", "CN6-P16",
317 "CN6-P14", "CN9-P04", "CN9-P02", "CN7-P05", "CN7-P03",
318 "CN8-P03", "CN8-P02", "", "", "CN6-P34", "CN6-P32",
319 "CN6-P26", "CN6-P18", "", "", "", "";
320};
321
322&r_pio {
323 gpio-line-names =
324 /* PL */
325 "PMU-SCK", "PMU-SDA", "VBAT-EN", "", "IR-RX",
326 "WL-WAKE-HOST", "BT-WAKE_HOST", "BT-ENABLE",
327 "WL-PMU-EN", "", "", "", "", "", "", "", "", "", "", "",
328 "", "", "", "", "", "", "", "", "", "", "", "",
329
330 /* PM */
331 "CN6-P12", "CN6-P35", "CN7-P40", "", "", "", "", "", "",
332 "", "", "", "", "", "", "", "", "", "", "", "", "", "",
333 "", "", "", "", "", "", "", "", "";
334};