1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2019 MediaTek Inc.
4 * Author: Ryder Lee <ryder.lee@mediatek.com>
5 */
6
7/dts-v1/;
8#include <dt-bindings/input/input.h>
9#include "mt7629.dtsi"
10
11/ {
12	model = "MediaTek MT7629 reference board";
13	compatible = "mediatek,mt7629-rfb", "mediatek,mt7629";
14
15	aliases {
16		serial0 = &uart0;
17	};
18
19	chosen {
20		stdout-path = "serial0:115200n8";
21	};
22
23	gpio-keys {
24		compatible = "gpio-keys";
25
26		reset {
27			label = "factory";
28			linux,code = <KEY_RESTART>;
29			gpios = <&pio 60 GPIO_ACTIVE_LOW>;
30		};
31
32		wps {
33			label = "wps";
34			linux,code = <KEY_WPS_BUTTON>;
35			gpios = <&pio 58 GPIO_ACTIVE_LOW>;
36		};
37	};
38
39	memory@40000000 {
40		device_type = "memory";
41		reg = <0x40000000 0x10000000>;
42	};
43
44	reg_3p3v: regulator-3p3v {
45		compatible = "regulator-fixed";
46		regulator-name = "fixed-3.3V";
47		regulator-min-microvolt = <3300000>;
48		regulator-max-microvolt = <3300000>;
49		regulator-boot-on;
50		regulator-always-on;
51	};
52
53	reg_5v: regulator-5v {
54		compatible = "regulator-fixed";
55		regulator-name = "fixed-5V";
56		regulator-min-microvolt = <5000000>;
57		regulator-max-microvolt = <5000000>;
58		regulator-boot-on;
59		regulator-always-on;
60	};
61};
62
63&eth {
64	pinctrl-names = "default";
65	pinctrl-0 = <&eth_pins>;
66	pinctrl-1 = <&ephy_leds_pins>;
67	status = "okay";
68
69	gmac0: mac@0 {
70		compatible = "mediatek,eth-mac";
71		reg = <0>;
72		phy-mode = "2500base-x";
73		fixed-link {
74			speed = <2500>;
75			full-duplex;
76			pause;
77		};
78	};
79
80	gmac1: mac@1 {
81		compatible = "mediatek,eth-mac";
82		reg = <1>;
83		phy-mode = "gmii";
84		phy-handle = <&phy0>;
85	};
86
87	mdio: mdio-bus {
88		#address-cells = <1>;
89		#size-cells = <0>;
90
91		phy0: ethernet-phy@0 {
92			reg = <0>;
93		};
94	};
95};
96
97&i2c {
98	pinctrl-names = "default";
99	pinctrl-0 = <&i2c_pins>;
100	status = "okay";
101};
102
103&qspi {
104	pinctrl-names = "default";
105	pinctrl-0 = <&qspi_pins>;
106	status = "okay";
107
108	flash@0 {
109		compatible = "jedec,spi-nor";
110		reg = <0>;
111
112		partitions {
113			compatible = "fixed-partitions";
114			#address-cells = <1>;
115			#size-cells = <1>;
116
117			partition@0 {
118				label = "u-boot";
119				reg = <0x00000 0x60000>;
120				read-only;
121			};
122
123			partition@60000 {
124				label = "u-boot-env";
125				reg = <0x60000 0x10000>;
126				read-only;
127			};
128
129			factory: partition@70000 {
130				label = "factory";
131				reg = <0x70000 0x40000>;
132				read-only;
133			};
134
135			partition@b0000 {
136				label = "kernel";
137				reg = <0xb0000 0xb50000>;
138			};
139		};
140	};
141};
142
143&pcie {
144	pinctrl-names = "default";
145	pinctrl-0 = <&pcie_pins>;
146};
147
148&pciephy1 {
149	status = "okay";
150};
151
152&pio {
153	eth_pins: eth-pins {
154		mux {
155			function = "eth";
156			groups = "mdc_mdio";
157		};
158	};
159
160	ephy_leds_pins: ephy-leds-pins {
161		mux {
162			function = "led";
163			groups = "gphy_leds_0", "ephy_leds";
164		};
165	};
166
167	i2c_pins: i2c-pins {
168		mux {
169			function = "i2c";
170			groups =  "i2c_0";
171		};
172
173		conf {
174			pins = "I2C_SDA", "I2C_SCL";
175			drive-strength = <4>;
176			bias-disable;
177		};
178	};
179
180	pcie_pins: pcie-pins {
181		mux {
182			function = "pcie";
183			groups = "pcie_clkreq",
184				 "pcie_pereset",
185				 "pcie_wake";
186		};
187	};
188
189	pwm_pins: pwm-pins {
190		mux {
191			function = "pwm";
192			groups = "pwm_0";
193		};
194	};
195
196	/* SPI-NOR is shared pin with serial NAND */
197	qspi_pins: qspi-pins {
198		mux {
199			function = "flash";
200			groups = "spi_nor";
201		};
202	};
203
204	/* Serial NAND is shared pin with SPI-NOR */
205	serial_nand_pins: serial-nand-pins {
206		mux {
207			function = "flash";
208			groups = "snfi";
209		};
210	};
211
212	spi_pins: spi-pins {
213		mux {
214			function = "spi";
215			groups = "spi_0";
216		};
217	};
218
219	uart0_pins: uart0-pins {
220		mux {
221			function = "uart";
222			groups = "uart0_txd_rxd" ;
223		};
224	};
225
226	uart1_pins: uart1-pins {
227		mux {
228			function = "uart";
229			groups = "uart1_0_tx_rx" ;
230		};
231	};
232
233	uart2_pins: uart2-pins {
234		mux {
235			function = "uart";
236			groups = "uart2_0_txd_rxd" ;
237		};
238	};
239
240	watchdog_pins: watchdog-pins {
241		mux {
242			function = "watchdog";
243			groups = "watchdog";
244		};
245	};
246};
247
248&spi {
249	pinctrl-names = "default";
250	pinctrl-0 = <&spi_pins>;
251	status = "okay";
252};
253
254&ssusb {
255	vusb33-supply = <&reg_3p3v>;
256	vbus-supply = <&reg_5v>;
257	status = "okay";
258};
259
260&u3phy0 {
261	status = "okay";
262};
263
264&uart0 {
265	pinctrl-names = "default";
266	pinctrl-0 = <&uart0_pins>;
267	status = "okay";
268};
269
270&watchdog {
271	pinctrl-names = "default";
272	pinctrl-0 = <&watchdog_pins>;
273	status = "okay";
274};
275