c61189c4bc192781b32e548525e5aa40f6567be9
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_yuncore_fap640.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "yuncore,fap640", "mediatek,mt7621-soc";
10 model = "YunCore FAP640";
11
12 aliases {
13 led-boot = &led_status_blue;
14 led-failsafe = &led_status_red;
15 led-running = &led_status_green;
16 led-upgrade = &led_status_red;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_status_green: status_green {
28 label = "green:status";
29 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
30 };
31
32 led_status_red: status_red {
33 label = "red:status";
34 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
35 };
36
37 led_status_blue: status_blue {
38 label = "blue:status";
39 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
40 };
41
42 wan {
43 label = "green:wan";
44 gpios = <&switch0 12 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "mt7530-0:04:link";
46 };
47
48 lan1 {
49 label = "green:lan1";
50 gpios = <&switch0 9 GPIO_ACTIVE_HIGH>;
51 linux,default-trigger = "mt7530-0:03:link";
52 };
53
54 lan2 {
55 label = "green:lan2";
56 gpios = <&switch0 6 GPIO_ACTIVE_LOW>;
57 linux,default-trigger = "mt7530-0:02:link";
58 };
59
60 lan3 {
61 label = "green:lan3";
62 gpios = <&switch0 3 GPIO_ACTIVE_LOW>;
63 linux,default-trigger = "mt7530-0:01:link";
64 };
65
66 lan4 {
67 label = "green:lan4";
68 gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
69 linux,default-trigger = "mt7530-0:00:link";
70 };
71 };
72
73 watchdog {
74 compatible = "linux,wdt-gpio";
75 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
76 hw_algo = "toggle";
77 hw_margin_ms = <200>;
78 always-running;
79 };
80
81 keys {
82 compatible = "gpio-keys";
83
84 reset {
85 label = "reset";
86 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
87 linux,code = <KEY_RESTART>;
88 };
89 };
90 };
91
92 &spi0 {
93 status = "okay";
94
95 flash@0 {
96 compatible = "jedec,spi-nor";
97 reg = <0>;
98 spi-max-frequency = <80000000>;
99 m25p,fast-read;
100
101 partitions {
102 compatible = "fixed-partitions";
103 #address-cells = <1>;
104 #size-cells = <1>;
105
106 partition@0 {
107 label = "Bootloader";
108 reg = <0x0 0x30000>;
109 read-only;
110 };
111
112 partition@30000 {
113 label = "Config";
114 reg = <0x30000 0x10000>;
115 read-only;
116 };
117
118 /* range 0x40000 to 0x50000 is empty in vendor
119 * firmware, so we do not use it either
120 */
121
122 factory: partition@50000 {
123 label = "Factory";
124 reg = <0x50000 0x40000>;
125 read-only;
126
127 nvmem-layout {
128 compatible = "fixed-layout";
129 #address-cells = <1>;
130 #size-cells = <1>;
131
132 eeprom_factory_0: eeprom@0 {
133 reg = <0x0 0xe00>;
134 };
135
136 precal_factory_e10: precal@e10 {
137 reg = <0xe10 0x19c10>;
138 };
139
140 macaddr_factory_4: macaddr@4 {
141 reg = <0x4 0x6>;
142 };
143
144 macaddr_factory_e006: macaddr@e006 {
145 reg = <0xe006 0x6>;
146 };
147 };
148 };
149
150 partition@90000 {
151 compatible = "denx,uimage";
152 label = "firmware";
153 reg = <0x90000 0xf70000>;
154 };
155 };
156 };
157 };
158
159 &pcie {
160 status = "okay";
161 };
162
163 &pcie1 {
164 wifi@0,0 {
165 compatible = "mediatek,mt76";
166 reg = <0x0000 0 0 0 0>;
167 nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
168 nvmem-cell-names = "eeprom", "precal";
169 mediatek,disable-radar-background;
170 };
171 };
172
173 &gmac0 {
174 nvmem-cells = <&macaddr_factory_e006>;
175 nvmem-cell-names = "mac-address";
176 };
177
178 &gmac1 {
179 status = "okay";
180 label = "wan";
181 phy-handle = <&ethphy4>;
182
183 nvmem-cells = <&macaddr_factory_4>;
184 nvmem-cell-names = "mac-address";
185 };
186
187 &mdio {
188 ethphy4: ethernet-phy@4 {
189 reg = <4>;
190 };
191 };
192
193
194 &switch0 {
195 gpio-controller;
196 #gpio-cells = <2>;
197
198 ports {
199 port@0 {
200 status = "okay";
201 label = "lan4";
202 };
203
204 port@1 {
205 status = "okay";
206 label = "lan3";
207 };
208
209 port@2 {
210 status = "okay";
211 label = "lan2";
212 };
213
214 port@3 {
215 status = "okay";
216 label = "lan1";
217 };
218 };
219 };
220
221 &state_default {
222 gpio {
223 groups = "jtag", "wdt";
224 function = "gpio";
225 };
226 };