Merge tag 'hsi-for-4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun6i-a31s-sinovoip-bpi-m2.dts
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 = <&reg_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 = <&reg_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 = <&reg_dcdc1>;
122         bus-width = <4>;
123         cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */
124         cd-inverted;
125         status = "okay";
126 };
127
128 &mmc0_pins_a {
129         bias-pull-up;
130 };
131
132 &mmc2 {
133         pinctrl-names = "default";
134         pinctrl-0 = <&mmc2_pins_a>;
135         vmmc-supply = <&reg_aldo1>;
136         mmc-pwrseq = <&mmc2_pwrseq>;
137         bus-width = <4>;
138         non-removable;
139         status = "okay";
140
141         brcmf: wifi@1 {
142                 reg = <1>;
143                 compatible = "brcm,bcm4329-fmac";
144                 interrupt-parent = <&r_pio>;
145                 interrupts = <0 5 IRQ_TYPE_LEVEL_LOW>; /* PL5 */
146                 interrupt-names = "host-wake";
147         };
148 };
149
150 &mmc2_pins_a {
151         bias-pull-up;
152 };
153
154 &ohci0 {
155         status = "okay";
156 };
157
158 &p2wi {
159         status = "okay";
160
161         axp22x: pmic@68 {
162                 compatible = "x-powers,axp221";
163                 reg = <0x68>;
164                 interrupt-parent = <&nmi_intc>;
165                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
166                 eldoin-supply = <&reg_dcdc1>;
167                 x-powers,drive-vbus-en;
168         };
169 };
170
171 &pio {
172         gmac_phy_reset_pin_bpi_m2: gmac_phy_reset_pin@0 {
173                 pins = "PA21";
174                 function = "gpio_out";
175         };
176
177         led_pins_bpi_m2: led_pins@0 {
178                 pins = "PG5", "PG10", "PG11";
179                 function = "gpio_out";
180         };
181
182         mmc0_cd_pin_bpi_m2: mmc0_cd_pin@0 {
183                 pins = "PA4";
184                 function = "gpio_in";
185                 bias-pull-up;
186         };
187 };
188
189 &r_pio {
190         mmc2_pwrseq_pin_bpi_m2: mmc2_pwrseq_pin@0 {
191                 pins = "PL8";
192                 function = "gpio_out";
193         };
194 };
195
196 #include "axp22x.dtsi"
197
198 &reg_aldo1 {
199         regulator-min-microvolt = <3300000>;
200         regulator-max-microvolt = <3300000>;
201         regulator-name = "vcc-wifi";
202 };
203
204 &reg_aldo2 {
205         regulator-always-on;
206         regulator-min-microvolt = <2500000>;
207         regulator-max-microvolt = <2500000>;
208         regulator-name = "vcc-gmac";
209 };
210
211 &reg_aldo3 {
212         regulator-always-on;
213         regulator-min-microvolt = <3000000>;
214         regulator-max-microvolt = <3000000>;
215         regulator-name = "avcc";
216 };
217
218 &reg_dc5ldo {
219         regulator-always-on;
220         regulator-min-microvolt = <700000>;
221         regulator-max-microvolt = <1320000>;
222         regulator-name = "vdd-cpus";
223 };
224
225 &reg_dcdc1 {
226         regulator-always-on;
227         regulator-min-microvolt = <3000000>;
228         regulator-max-microvolt = <3000000>;
229         regulator-name = "vdd-3v0";
230 };
231
232 &reg_dcdc2 {
233         regulator-min-microvolt = <700000>;
234         regulator-max-microvolt = <1320000>;
235         regulator-name = "vdd-gpu";
236 };
237
238 &reg_dcdc3 {
239         regulator-always-on;
240         regulator-min-microvolt = <700000>;
241         regulator-max-microvolt = <1320000>;
242         regulator-name = "vdd-cpu";
243 };
244
245 &reg_dcdc4 {
246         regulator-always-on;
247         regulator-min-microvolt = <700000>;
248         regulator-max-microvolt = <1320000>;
249         regulator-name = "vdd-sys-dll";
250 };
251
252 &reg_dcdc5 {
253         regulator-always-on;
254         regulator-min-microvolt = <1500000>;
255         regulator-max-microvolt = <1500000>;
256         regulator-name = "vcc-dram";
257 };
258
259 &reg_dldo1 {
260         regulator-min-microvolt = <3000000>;
261         regulator-max-microvolt = <3000000>;
262         regulator-name = "vcc-mac";
263 };
264
265 &reg_dldo2 {
266         regulator-min-microvolt = <2800000>;
267         regulator-max-microvolt = <2800000>;
268         regulator-name = "avdd-csi";
269 };
270
271 &reg_dldo3 {
272         regulator-always-on;
273         regulator-min-microvolt = <3300000>;
274         regulator-max-microvolt = <3300000>;
275         regulator-name = "vcc-pb";
276 };
277
278 &reg_eldo1 {
279         regulator-min-microvolt = <1800000>;
280         regulator-max-microvolt = <1800000>;
281         regulator-name = "vdd-csi";
282         status = "okay";
283 };
284
285 &reg_ldo_io1 {
286         regulator-always-on;
287         regulator-min-microvolt = <1800000>;
288         regulator-max-microvolt = <1800000>;
289         regulator-name = "vcc-pm-cpus";
290         status = "okay";
291 };
292
293 &uart0 {
294         pinctrl-names = "default";
295         pinctrl-0 = <&uart0_pins_a>;
296         status = "okay";
297 };
298
299 &usbphy {
300         status = "okay";
301 };