Merge tag 'pci-v4.16-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / sun8i-a83t-bananapi-m3.dts
1 /*
2  * Copyright 2017 Chen-Yu Tsai
3  *
4  * Chen-Yu Tsai <wens@csie.org>
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  * Or, alternatively,
22  *
23  *  b) Permission is hereby granted, free of charge, to any person
24  *     obtaining a copy of this software and associated documentation
25  *     files (the "Software"), to deal in the Software without
26  *     restriction, including without limitation the rights to use,
27  *     copy, modify, merge, publish, distribute, sublicense, and/or
28  *     sell copies of the Software, and to permit persons to whom the
29  *     Software is furnished to do so, subject to the following
30  *     conditions:
31  *
32  *     The above copyright notice and this permission notice shall be
33  *     included in all copies or substantial portions of the Software.
34  *
35  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42  *     OTHER DEALINGS IN THE SOFTWARE.
43  */
44
45 /dts-v1/;
46 #include "sun8i-a83t.dtsi"
47
48 #include <dt-bindings/gpio/gpio.h>
49
50 / {
51         model = "Banana Pi BPI-M3";
52         compatible = "sinovoip,bpi-m3", "allwinner,sun8i-a83t";
53
54         aliases {
55                 ethernet0 = &emac;
56                 serial0 = &uart0;
57         };
58
59         chosen {
60                 stdout-path = "serial0:115200n8";
61         };
62
63         reg_usb1_vbus: reg-usb1-vbus {
64                 compatible = "regulator-fixed";
65                 regulator-name = "usb1-vbus";
66                 regulator-min-microvolt = <5000000>;
67                 regulator-max-microvolt = <5000000>;
68                 regulator-boot-on;
69                 enable-active-high;
70                 gpio = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */
71         };
72
73         wifi_pwrseq: wifi_pwrseq {
74                 compatible = "mmc-pwrseq-simple";
75                 clocks = <&ac100_rtc 1>;
76                 clock-names = "ext_clock";
77                 /* The WiFi low power clock must be 32768 Hz */
78                 assigned-clocks = <&ac100_rtc 1>;
79                 assigned-clock-rates = <32768>;
80                 /* enables internal regulator and de-asserts reset */
81                 reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 WL-PMU-EN */
82         };
83 };
84
85 &ehci0 {
86         /* Terminus Tech FE 1.1s 4-port USB 2.0 hub here */
87         status = "okay";
88
89         /* TODO GL830 USB-to-SATA bridge downstream w/ GPIO power controls */
90 };
91
92 &emac {
93         pinctrl-names = "default";
94         pinctrl-0 = <&emac_rgmii_pins>;
95         phy-supply = <&reg_sw>;
96         phy-handle = <&rgmii_phy>;
97         phy-mode = "rgmii";
98         allwinner,rx-delay-ps = <700>;
99         allwinner,tx-delay-ps = <700>;
100         status = "okay";
101 };
102
103 &mdio {
104         rgmii_phy: ethernet-phy@1 {
105                 compatible = "ethernet-phy-ieee802.3-c22";
106                 reg = <1>;
107         };
108 };
109
110 &mmc0 {
111         pinctrl-names = "default";
112         pinctrl-0 = <&mmc0_pins>;
113         vmmc-supply = <&reg_dcdc1>;
114         bus-width = <4>;
115         cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
116         cd-inverted;
117         status = "okay";
118 };
119
120 &mmc1 {
121         vmmc-supply = <&reg_dldo1>;
122         vqmmc-supply = <&reg_dldo1>;
123         mmc-pwrseq = <&wifi_pwrseq>;
124         bus-width = <4>;
125         non-removable;
126         status = "okay";
127
128         brcmf: wifi@1 {
129                 reg = <1>;
130                 compatible = "brcm,bcm4329-fmac";
131                 interrupt-parent = <&r_pio>;
132                 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;
133                 interrupt-names = "host-wake";
134         };
135 };
136
137 &mmc2 {
138         pinctrl-names = "default";
139         pinctrl-0 = <&mmc2_8bit_emmc_pins>;
140         vmmc-supply = <&reg_dcdc1>;
141         vqmmc-supply = <&reg_dcdc1>;
142         bus-width = <8>;
143         non-removable;
144         cap-mmc-hw-reset;
145         status = "okay";
146 };
147
148 &r_rsb {
149         status = "okay";
150
151         axp81x: pmic@3a3 {
152                 compatible = "x-powers,axp813";
153                 reg = <0x3a3>;
154                 interrupt-parent = <&r_intc>;
155                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
156                 eldoin-supply = <&reg_dcdc1>;
157                 fldoin-supply = <&reg_dcdc5>;
158                 swin-supply = <&reg_dcdc1>;
159                 x-powers,drive-vbus-en;
160         };
161
162         ac100: codec@e89 {
163                 compatible = "x-powers,ac100";
164                 reg = <0xe89>;
165
166                 ac100_codec: codec {
167                         compatible = "x-powers,ac100-codec";
168                         interrupt-parent = <&r_pio>;
169                         interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
170                         #clock-cells = <0>;
171                         clock-output-names = "4M_adda";
172                 };
173
174                 ac100_rtc: rtc {
175                         compatible = "x-powers,ac100-rtc";
176                         interrupt-parent = <&r_intc>;
177                         interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
178                         clocks = <&ac100_codec>;
179                         #clock-cells = <1>;
180                         clock-output-names = "cko1_rtc",
181                                              "cko2_rtc",
182                                              "cko3_rtc";
183                 };
184         };
185 };
186
187 #include "axp81x.dtsi"
188
189 &reg_aldo1 {
190         regulator-always-on;
191         regulator-min-microvolt = <1800000>;
192         regulator-max-microvolt = <1800000>;
193         regulator-name = "vcc-1v8";
194 };
195
196 &reg_aldo2 {
197         regulator-always-on;
198         regulator-min-microvolt = <1800000>;
199         regulator-max-microvolt = <1800000>;
200         regulator-name = "dram-pll";
201 };
202
203 &reg_aldo3 {
204         regulator-always-on;
205         regulator-min-microvolt = <3000000>;
206         regulator-max-microvolt = <3000000>;
207         regulator-name = "avcc";
208 };
209
210 &reg_dcdc1 {
211         /* schematics says 3.1V but FEX file says 3.3V */
212         regulator-always-on;
213         regulator-min-microvolt = <3300000>;
214         regulator-max-microvolt = <3300000>;
215         regulator-name = "vcc-3v3";
216 };
217
218 &reg_dcdc2 {
219         regulator-always-on;
220         regulator-min-microvolt = <700000>;
221         regulator-max-microvolt = <1100000>;
222         regulator-name = "vdd-cpua";
223 };
224
225 &reg_dcdc3 {
226         regulator-always-on;
227         regulator-min-microvolt = <700000>;
228         regulator-max-microvolt = <1100000>;
229         regulator-name = "vdd-cpub";
230 };
231
232 &reg_dcdc4 {
233         regulator-min-microvolt = <700000>;
234         regulator-max-microvolt = <1100000>;
235         regulator-name = "vdd-gpu";
236 };
237
238 &reg_dcdc5 {
239         regulator-always-on;
240         regulator-min-microvolt = <1200000>;
241         regulator-max-microvolt = <1200000>;
242         regulator-name = "vcc-dram";
243 };
244
245 &reg_dcdc6 {
246         regulator-always-on;
247         regulator-min-microvolt = <900000>;
248         regulator-max-microvolt = <900000>;
249         regulator-name = "vdd-sys";
250 };
251
252 &reg_dldo1 {
253         /*
254          * This powers both the WiFi/BT module's main power, I/O supply,
255          * and external pull-ups on all the data lines. It should be set
256          * to the same voltage as the I/O supply (DCDC1 in this case) to
257          * avoid any leakage or mismatch.
258          */
259         regulator-min-microvolt = <3300000>;
260         regulator-max-microvolt = <3300000>;
261         regulator-name = "vcc-wifi";
262 };
263
264 &reg_dldo3 {
265         regulator-always-on;
266         regulator-min-microvolt = <2500000>;
267         regulator-max-microvolt = <2500000>;
268         regulator-name = "vcc-pd";
269 };
270
271 &reg_drivevbus {
272         regulator-name = "usb0-vbus";
273         status = "okay";
274 };
275
276 &reg_fldo1 {
277         regulator-min-microvolt = <1080000>;
278         regulator-max-microvolt = <1320000>;
279         regulator-name = "vdd12-hsic";
280 };
281
282 &reg_fldo2 {
283         /*
284          * Despite the embedded CPUs core not being used in any way,
285          * this must remain on or the system will hang.
286          */
287         regulator-always-on;
288         regulator-min-microvolt = <700000>;
289         regulator-max-microvolt = <1100000>;
290         regulator-name = "vdd-cpus";
291 };
292
293 &reg_rtc_ldo {
294         regulator-name = "vcc-rtc";
295 };
296
297 &reg_sw {
298         /*
299          * The PHY requires 20ms after all voltages
300          * are applied until core logic is ready and
301          * 30ms after the reset pin is de-asserted.
302          * Set a 100ms delay to account for PMIC
303          * ramp time and board traces.
304          */
305         regulator-enable-ramp-delay = <100000>;
306         regulator-name = "vcc-ephy";
307 };
308
309 &uart0 {
310         pinctrl-names = "default";
311         pinctrl-0 = <&uart0_pb_pins>;
312         status = "okay";
313 };
314
315 &usbphy {
316         usb1_vbus-supply = <&reg_usb1_vbus>;
317         status = "okay";
318 };