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