blob: 1890d41b7fae57367ef459ee990a1dc2397178c3 [file] [log] [blame]
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +08001/*
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"
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +080047
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 {
Chen-Yu Tsai03935992017-12-08 15:31:57 +080055 ethernet0 = &emac;
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +080056 serial0 = &uart0;
57 };
58
59 chosen {
60 stdout-path = "serial0:115200n8";
61 };
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +080062
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 };
Chen-Yu Tsai337cce72017-10-18 16:31:38 +080072
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 };
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +080083};
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
Chen-Yu Tsai03935992017-12-08 15:31:57 +080092&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
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800110&mmc0 {
111 pinctrl-names = "default";
112 pinctrl-0 = <&mmc0_pins>;
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +0800113 vmmc-supply = <&reg_dcdc1>;
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800114 bus-width = <4>;
Tuomas Tynkkynen45e01f42017-12-22 22:57:37 +0200115 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800116 status = "okay";
117};
118
Chen-Yu Tsai337cce72017-10-18 16:31:38 +0800119&mmc1 {
120 vmmc-supply = <&reg_dldo1>;
121 vqmmc-supply = <&reg_dldo1>;
122 mmc-pwrseq = <&wifi_pwrseq>;
123 bus-width = <4>;
124 non-removable;
125 status = "okay";
126
127 brcmf: wifi@1 {
128 reg = <1>;
129 compatible = "brcm,bcm4329-fmac";
130 interrupt-parent = <&r_pio>;
131 interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>;
132 interrupt-names = "host-wake";
133 };
134};
135
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800136&mmc2 {
137 pinctrl-names = "default";
138 pinctrl-0 = <&mmc2_8bit_emmc_pins>;
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +0800139 vmmc-supply = <&reg_dcdc1>;
140 vqmmc-supply = <&reg_dcdc1>;
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800141 bus-width = <8>;
142 non-removable;
143 cap-mmc-hw-reset;
144 status = "okay";
145};
146
147&r_rsb {
148 status = "okay";
149
150 axp81x: pmic@3a3 {
151 compatible = "x-powers,axp813";
152 reg = <0x3a3>;
153 interrupt-parent = <&r_intc>;
154 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +0800155 eldoin-supply = <&reg_dcdc1>;
156 fldoin-supply = <&reg_dcdc5>;
157 swin-supply = <&reg_dcdc1>;
158 x-powers,drive-vbus-en;
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800159 };
160
161 ac100: codec@e89 {
162 compatible = "x-powers,ac100";
163 reg = <0xe89>;
164
165 ac100_codec: codec {
166 compatible = "x-powers,ac100-codec";
167 interrupt-parent = <&r_pio>;
168 interrupts = <0 11 IRQ_TYPE_LEVEL_LOW>; /* PL11 */
169 #clock-cells = <0>;
170 clock-output-names = "4M_adda";
171 };
172
173 ac100_rtc: rtc {
174 compatible = "x-powers,ac100-rtc";
175 interrupt-parent = <&r_intc>;
176 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
177 clocks = <&ac100_codec>;
178 #clock-cells = <1>;
179 clock-output-names = "cko1_rtc",
180 "cko2_rtc",
181 "cko3_rtc";
182 };
183 };
184};
185
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +0800186#include "axp81x.dtsi"
187
188&reg_aldo1 {
189 regulator-always-on;
190 regulator-min-microvolt = <1800000>;
191 regulator-max-microvolt = <1800000>;
192 regulator-name = "vcc-1v8";
193};
194
195&reg_aldo2 {
196 regulator-always-on;
197 regulator-min-microvolt = <1800000>;
198 regulator-max-microvolt = <1800000>;
199 regulator-name = "dram-pll";
200};
201
202&reg_aldo3 {
203 regulator-always-on;
204 regulator-min-microvolt = <3000000>;
205 regulator-max-microvolt = <3000000>;
206 regulator-name = "avcc";
207};
208
209&reg_dcdc1 {
210 /* schematics says 3.1V but FEX file says 3.3V */
211 regulator-always-on;
212 regulator-min-microvolt = <3300000>;
213 regulator-max-microvolt = <3300000>;
214 regulator-name = "vcc-3v3";
215};
216
217&reg_dcdc2 {
218 regulator-always-on;
219 regulator-min-microvolt = <700000>;
220 regulator-max-microvolt = <1100000>;
221 regulator-name = "vdd-cpua";
222};
223
224&reg_dcdc3 {
225 regulator-always-on;
226 regulator-min-microvolt = <700000>;
227 regulator-max-microvolt = <1100000>;
228 regulator-name = "vdd-cpub";
229};
230
231&reg_dcdc4 {
232 regulator-min-microvolt = <700000>;
233 regulator-max-microvolt = <1100000>;
234 regulator-name = "vdd-gpu";
235};
236
237&reg_dcdc5 {
238 regulator-always-on;
239 regulator-min-microvolt = <1200000>;
240 regulator-max-microvolt = <1200000>;
241 regulator-name = "vcc-dram";
242};
243
244&reg_dcdc6 {
245 regulator-always-on;
246 regulator-min-microvolt = <900000>;
247 regulator-max-microvolt = <900000>;
248 regulator-name = "vdd-sys";
249};
250
251&reg_dldo1 {
252 /*
253 * This powers both the WiFi/BT module's main power, I/O supply,
254 * and external pull-ups on all the data lines. It should be set
255 * to the same voltage as the I/O supply (DCDC1 in this case) to
256 * avoid any leakage or mismatch.
257 */
258 regulator-min-microvolt = <3300000>;
259 regulator-max-microvolt = <3300000>;
260 regulator-name = "vcc-wifi";
261};
262
263&reg_dldo3 {
264 regulator-always-on;
265 regulator-min-microvolt = <2500000>;
266 regulator-max-microvolt = <2500000>;
267 regulator-name = "vcc-pd";
268};
269
270&reg_drivevbus {
271 regulator-name = "usb0-vbus";
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800272 status = "okay";
273};
274
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +0800275&reg_fldo1 {
276 regulator-min-microvolt = <1080000>;
277 regulator-max-microvolt = <1320000>;
278 regulator-name = "vdd12-hsic";
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800279};
280
Chen-Yu Tsaid7c5f682017-10-18 16:31:34 +0800281&reg_fldo2 {
282 /*
283 * Despite the embedded CPUs core not being used in any way,
284 * this must remain on or the system will hang.
285 */
286 regulator-always-on;
287 regulator-min-microvolt = <700000>;
288 regulator-max-microvolt = <1100000>;
289 regulator-name = "vdd-cpus";
290};
291
292&reg_rtc_ldo {
293 regulator-name = "vcc-rtc";
294};
295
296&reg_sw {
297 /*
298 * The PHY requires 20ms after all voltages
299 * are applied until core logic is ready and
300 * 30ms after the reset pin is de-asserted.
301 * Set a 100ms delay to account for PMIC
302 * ramp time and board traces.
303 */
304 regulator-enable-ramp-delay = <100000>;
305 regulator-name = "vcc-ephy";
Chen-Yu Tsai359b5a12017-08-17 11:40:48 +0800306};
307
308&uart0 {
309 pinctrl-names = "default";
310 pinctrl-0 = <&uart0_pb_pins>;
311 status = "okay";
312};
313
314&usbphy {
315 usb1_vbus-supply = <&reg_usb1_vbus>;
316 status = "okay";
317};