1// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2/*
3 * Copyright (C) 2021 MediaTek Inc.
4 * Author: Sam.Shih <sam.shih@mediatek.com>
5 */
6
7/dts-v1/;
8#include "mt7986a.dtsi"
9
10/ {
11	model = "MediaTek MT7986a RFB";
12	compatible = "mediatek,mt7986a-rfb", "mediatek,mt7986a";
13
14	aliases {
15		serial0 = &uart0;
16	};
17
18	chosen {
19		stdout-path = "serial0:115200n8";
20	};
21
22	memory@40000000 {
23		device_type = "memory";
24		reg = <0 0x40000000 0 0x40000000>;
25	};
26};
27
28&crypto {
29	status = "okay";
30};
31
32&eth {
33	status = "okay";
34
35	gmac0: mac@0 {
36		compatible = "mediatek,eth-mac";
37		reg = <0>;
38		phy-mode = "2500base-x";
39
40		fixed-link {
41			speed = <2500>;
42			full-duplex;
43			pause;
44		};
45	};
46
47	mdio: mdio-bus {
48		#address-cells = <1>;
49		#size-cells = <0>;
50	};
51};
52
53&mdio {
54	switch: switch@0 {
55		compatible = "mediatek,mt7531";
56		reg = <31>;
57		reset-gpios = <&pio 5 0>;
58	};
59};
60
61&pio {
62	spi_flash_pins: spi-flash-pins {
63		mux {
64			function = "spi";
65			groups = "spi0", "spi0_wp_hold";
66		};
67	};
68
69	spic_pins: spic-pins {
70		mux {
71			function = "spi";
72			groups = "spi1_2";
73		};
74	};
75
76	uart1_pins: uart1-pins {
77		mux {
78			function = "uart";
79			groups = "uart1";
80		};
81	};
82
83	uart2_pins: uart2-pins {
84		mux {
85			function = "uart";
86			groups = "uart2";
87		};
88	};
89
90	wf_2g_5g_pins: wf-2g-5g-pins {
91		mux {
92			function = "wifi";
93			groups = "wf_2g", "wf_5g";
94		};
95		conf {
96			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
97			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
98			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
99			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
100			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
101			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
102			       "WF1_TOP_CLK", "WF1_TOP_DATA";
103			drive-strength = <4>;
104		};
105	};
106
107	wf_dbdc_pins: wf-dbdc-pins {
108		mux {
109			function = "wifi";
110			groups = "wf_dbdc";
111		};
112		conf {
113			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
114			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
115			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
116			       "WF0_TOP_CLK", "WF0_TOP_DATA";
117			drive-strength = <4>;
118		};
119	};
120};
121
122&spi0 {
123	pinctrl-names = "default";
124	pinctrl-0 = <&spi_flash_pins>;
125	cs-gpios = <0>, <0>;
126	status = "okay";
127	spi_nand: spi_nand@0 {
128		compatible = "spi-nand";
129		reg = <0>;
130		spi-max-frequency = <10000000>;
131		spi-tx-buswidth = <4>;
132		spi-rx-buswidth = <4>;
133	};
134};
135
136&spi1 {
137	pinctrl-names = "default";
138	pinctrl-0 = <&spic_pins>;
139	cs-gpios = <0>, <0>;
140	status = "okay";
141};
142
143&ssusb {
144	status = "okay";
145};
146
147&switch {
148	ports {
149		#address-cells = <1>;
150		#size-cells = <0>;
151
152		port@0 {
153			reg = <0>;
154			label = "lan0";
155		};
156
157		port@1 {
158			reg = <1>;
159			label = "lan1";
160		};
161
162		port@2 {
163			reg = <2>;
164			label = "lan2";
165		};
166
167		port@3 {
168			reg = <3>;
169			label = "lan3";
170		};
171
172		port@4 {
173			reg = <4>;
174			label = "lan4";
175		};
176
177		port@6 {
178			reg = <6>;
179			label = "cpu";
180			ethernet = <&gmac0>;
181			phy-mode = "2500base-x";
182
183			fixed-link {
184				speed = <2500>;
185				full-duplex;
186				pause;
187			};
188		};
189	};
190};
191
192&uart0 {
193	status = "okay";
194};
195
196&uart1 {
197	pinctrl-names = "default";
198	pinctrl-0 = <&uart1_pins>;
199	status = "okay";
200};
201
202&uart2 {
203	pinctrl-names = "default";
204	pinctrl-0 = <&uart2_pins>;
205	status = "okay";
206};
207
208&usb_phy {
209	status = "okay";
210};
211
212&wifi {
213	status = "okay";
214	pinctrl-names = "default", "dbdc";
215	pinctrl-0 = <&wf_2g_5g_pins>;
216	pinctrl-1 = <&wf_dbdc_pins>;
217};
218