GNU Linux-libre 4.19.286-gnu1
[releases.git] / arch / arm / boot / dts / mt7623n-bananapi-bpi-r2.dts
1 /*
2  * Copyright 2017-2018 Sean Wang <sean.wang@mediatek.com>
3  *
4  * SPDX-License-Identifier: (GPL-2.0+ OR MIT)
5  */
6
7 /dts-v1/;
8 #include <dt-bindings/input/input.h>
9 #include "mt7623.dtsi"
10 #include "mt6323.dtsi"
11
12 / {
13         model = "Bananapi BPI-R2";
14         compatible = "bananapi,bpi-r2", "mediatek,mt7623";
15
16         aliases {
17                 serial2 = &uart2;
18         };
19
20         chosen {
21                 stdout-path = "serial2:115200n8";
22         };
23
24         cpus {
25                 cpu@0 {
26                         proc-supply = <&mt6323_vproc_reg>;
27                 };
28
29                 cpu@1 {
30                         proc-supply = <&mt6323_vproc_reg>;
31                 };
32
33                 cpu@2 {
34                         proc-supply = <&mt6323_vproc_reg>;
35                 };
36
37                 cpu@3 {
38                         proc-supply = <&mt6323_vproc_reg>;
39                 };
40         };
41
42         reg_1p8v: regulator-1p8v {
43                 compatible = "regulator-fixed";
44                 regulator-name = "fixed-1.8V";
45                 regulator-min-microvolt = <1800000>;
46                 regulator-max-microvolt = <1800000>;
47                 regulator-boot-on;
48                 regulator-always-on;
49         };
50
51         reg_3p3v: regulator-3p3v {
52                 compatible = "regulator-fixed";
53                 regulator-name = "fixed-3.3V";
54                 regulator-min-microvolt = <3300000>;
55                 regulator-max-microvolt = <3300000>;
56                 regulator-boot-on;
57                 regulator-always-on;
58         };
59
60         reg_5v: regulator-5v {
61                 compatible = "regulator-fixed";
62                 regulator-name = "fixed-5V";
63                 regulator-min-microvolt = <5000000>;
64                 regulator-max-microvolt = <5000000>;
65                 regulator-boot-on;
66                 regulator-always-on;
67         };
68
69         gpio-keys {
70                 compatible = "gpio-keys";
71                 pinctrl-names = "default";
72                 pinctrl-0 = <&key_pins_a>;
73
74                 factory {
75                         label = "factory";
76                         linux,code = <BTN_0>;
77                         gpios = <&pio 256 GPIO_ACTIVE_LOW>;
78                 };
79
80                 wps {
81                         label = "wps";
82                         linux,code = <KEY_WPS_BUTTON>;
83                         gpios = <&pio 257 GPIO_ACTIVE_HIGH>;
84                 };
85         };
86
87         leds {
88                 compatible = "gpio-leds";
89                 pinctrl-names = "default";
90                 pinctrl-0 = <&led_pins_a>;
91
92                 blue {
93                         label = "bpi-r2:pio:blue";
94                         gpios = <&pio 240 GPIO_ACTIVE_LOW>;
95                         default-state = "off";
96                 };
97
98                 green {
99                         label = "bpi-r2:pio:green";
100                         gpios = <&pio 241 GPIO_ACTIVE_LOW>;
101                         default-state = "off";
102                 };
103
104                 red {
105                         label = "bpi-r2:pio:red";
106                         gpios = <&pio 239 GPIO_ACTIVE_LOW>;
107                         default-state = "off";
108                 };
109         };
110
111         memory@80000000 {
112                 device_type = "memory";
113                 reg = <0 0x80000000 0 0x80000000>;
114         };
115 };
116
117 &btif {
118         status = "okay";
119 };
120
121 &cir {
122         pinctrl-names = "default";
123         pinctrl-0 = <&cir_pins_a>;
124         status = "okay";
125 };
126
127 &crypto {
128         status = "okay";
129 };
130
131 &eth {
132         status = "okay";
133
134         gmac0: mac@0 {
135                 compatible = "mediatek,eth-mac";
136                 reg = <0>;
137                 phy-mode = "trgmii";
138
139                 fixed-link {
140                         speed = <1000>;
141                         full-duplex;
142                         pause;
143                 };
144         };
145
146         mdio: mdio-bus {
147                 #address-cells = <1>;
148                 #size-cells = <0>;
149
150                 switch@0 {
151                         compatible = "mediatek,mt7530";
152                         reg = <0>;
153                         reset-gpios = <&pio 33 0>;
154                         core-supply = <&mt6323_vpa_reg>;
155                         io-supply = <&mt6323_vemc3v3_reg>;
156
157                         ports {
158                                 #address-cells = <1>;
159                                 #size-cells = <0>;
160
161                                 port@0 {
162                                         reg = <0>;
163                                         label = "wan";
164                                 };
165
166                                 port@1 {
167                                         reg = <1>;
168                                         label = "lan0";
169                                 };
170
171                                 port@2 {
172                                         reg = <2>;
173                                         label = "lan1";
174                                 };
175
176                                 port@3 {
177                                         reg = <3>;
178                                         label = "lan2";
179                                 };
180
181                                 port@4 {
182                                         reg = <4>;
183                                         label = "lan3";
184                                 };
185
186                                 port@6 {
187                                         reg = <6>;
188                                         label = "cpu";
189                                         ethernet = <&gmac0>;
190                                         phy-mode = "trgmii";
191
192                                         fixed-link {
193                                                 speed = <1000>;
194                                                 full-duplex;
195                                                 pause;
196                                         };
197                                 };
198                         };
199                 };
200         };
201 };
202
203 &i2c0 {
204         pinctrl-names = "default";
205         pinctrl-0 = <&i2c0_pins_a>;
206         status = "okay";
207 };
208
209 &i2c1 {
210         pinctrl-names = "default";
211         pinctrl-0 = <&i2c1_pins_a>;
212         status = "okay";
213 };
214
215 &mmc0 {
216         pinctrl-names = "default", "state_uhs";
217         pinctrl-0 = <&mmc0_pins_default>;
218         pinctrl-1 = <&mmc0_pins_uhs>;
219         status = "okay";
220         bus-width = <8>;
221         max-frequency = <50000000>;
222         cap-mmc-highspeed;
223         vmmc-supply = <&reg_3p3v>;
224         vqmmc-supply = <&reg_1p8v>;
225         non-removable;
226 };
227
228 &mmc1 {
229         pinctrl-names = "default", "state_uhs";
230         pinctrl-0 = <&mmc1_pins_default>;
231         pinctrl-1 = <&mmc1_pins_uhs>;
232         status = "okay";
233         bus-width = <4>;
234         max-frequency = <50000000>;
235         cap-sd-highspeed;
236         cd-gpios = <&pio 261 GPIO_ACTIVE_LOW>;
237         vmmc-supply = <&reg_3p3v>;
238         vqmmc-supply = <&reg_3p3v>;
239 };
240
241 &mt6323_leds {
242         status = "okay";
243
244         led@0 {
245                 reg = <0>;
246                 label = "bpi-r2:isink:green";
247                 default-state = "off";
248         };
249
250         led@1 {
251                 reg = <1>;
252                 label = "bpi-r2:isink:red";
253                 default-state = "off";
254         };
255
256         led@2 {
257                 reg = <2>;
258                 label = "bpi-r2:isink:blue";
259                 default-state = "off";
260         };
261 };
262
263 &pcie {
264         pinctrl-names = "default";
265         pinctrl-0 = <&pcie_default>;
266         status = "okay";
267
268         pcie@0,0 {
269                 status = "okay";
270         };
271
272         pcie@1,0 {
273                 status = "okay";
274         };
275 };
276
277 &pcie0_phy {
278         status = "okay";
279 };
280
281 &pcie1_phy {
282         status = "okay";
283 };
284
285 &pwm {
286         pinctrl-names = "default";
287         pinctrl-0 = <&pwm_pins_a>;
288         status = "okay";
289 };
290
291 &spi0 {
292         pinctrl-names = "default";
293         pinctrl-0 = <&spi0_pins_a>;
294         status = "okay";
295 };
296
297 &uart0 {
298         pinctrl-names = "default";
299         pinctrl-0 = <&uart0_pins_a>;
300         status = "okay";
301 };
302
303 &uart1 {
304         pinctrl-names = "default";
305         pinctrl-0 = <&uart1_pins_a>;
306         status = "okay";
307 };
308
309 &uart2 {
310         pinctrl-names = "default";
311         pinctrl-0 = <&uart2_pins_a>;
312         status = "okay";
313 };
314
315 &usb1 {
316         vusb33-supply = <&reg_3p3v>;
317         vbus-supply = <&reg_5v>;
318         status = "okay";
319 };
320
321 &usb2 {
322         vusb33-supply = <&reg_3p3v>;
323         vbus-supply = <&reg_5v>;
324         status = "okay";
325 };
326
327 &u3phy1 {
328         status = "okay";
329 };
330
331 &u3phy2 {
332         status = "okay";
333 };
334