d525dde385b4d921655a374cfc44534c0010b899
[openwrt/staging/jow.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
128 partition@90000 {
129 compatible = "denx,uimage";
130 label = "firmware";
131 reg = <0x90000 0xf70000>;
132 };
133 };
134 };
135 };
136
137 &pcie {
138 status = "okay";
139 };
140
141 &pcie1 {
142 wifi@0,0 {
143 compatible = "mediatek,mt76";
144 reg = <0x0000 0 0 0 0>;
145 mediatek,mtd-eeprom = <&factory 0x0>;
146 mediatek,disable-radar-background;
147 };
148 };
149
150 &gmac0 {
151 nvmem-cells = <&macaddr_factory_e006>;
152 nvmem-cell-names = "mac-address";
153 };
154
155 &gmac1 {
156 status = "okay";
157 label = "wan";
158 phy-handle = <&ethphy4>;
159
160 nvmem-cells = <&macaddr_factory_0004>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &mdio {
165 ethphy4: ethernet-phy@4 {
166 reg = <4>;
167 };
168 };
169
170
171 &switch0 {
172 gpio-controller;
173 #gpio-cells = <2>;
174
175 ports {
176 port@0 {
177 status = "okay";
178 label = "lan4";
179 };
180
181 port@1 {
182 status = "okay";
183 label = "lan3";
184 };
185
186 port@2 {
187 status = "okay";
188 label = "lan2";
189 };
190
191 port@3 {
192 status = "okay";
193 label = "lan1";
194 };
195 };
196 };
197
198 &state_default {
199 gpio {
200 groups = "jtag", "wdt";
201 function = "gpio";
202 };
203 };
204
205 &factory {
206 compatible = "nvmem-cells";
207 #address-cells = <1>;
208 #size-cells = <1>;
209
210 macaddr_factory_0004: macaddr@0004 {
211 reg = <0x0004 0x6>;
212 };
213
214 macaddr_factory_e006: macaddr@e006 {
215 reg = <0xe006 0x6>;
216 };
217 };
218