7b3f316a8c4495a3f34903db16f8b99a4049a68e
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_arcadyan_wg4xx223.dtsi
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 aliases {
11 led-boot = &led_status_red;
12 led-failsafe = &led_status_red;
13 led-running = &led_status_green;
14 led-upgrade = &led_status_red;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 led_status_green: led-1 {
21 label = "green:status";
22 color = <LED_COLOR_ID_GREEN>;
23 function = LED_FUNCTION_STATUS;
24 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
25 };
26
27 led_status_red: led-2 {
28 label = "red:status";
29 color = <LED_COLOR_ID_RED>;
30 function = LED_FUNCTION_STATUS;
31 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
32 };
33 };
34
35 keys {
36 compatible = "gpio-keys";
37
38 reset {
39 label = "reset";
40 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_RESTART>;
42 };
43 };
44
45 ubi-concat {
46 compatible = "mtd-concat";
47 devices = <&ubiconcat0 &ubiconcat1>;
48
49 partitions {
50 compatible = "fixed-partitions";
51 #address-cells = <1>;
52 #size-cells = <1>;
53
54 partition@0 {
55 label = "ubi";
56 reg = <0x0 0x5240000>;
57 };
58 };
59 };
60 };
61
62 &nand {
63 status = "okay";
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "u-boot";
72 reg = <0x0 0x100000>;
73 read-only;
74 };
75
76 partition@100000 {
77 label = "u-boot-env";
78 reg = <0x100000 0x100000>;
79 };
80
81 factory: partition@200000 {
82 label = "Factory";
83 reg = <0x200000 0x100000>;
84 read-only;
85
86 nvmem-layout {
87 compatible = "fixed-layout";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 eeprom_factory_0: eeprom@0 {
92 reg = <0x0 0x4da8>;
93 };
94
95 /* We keep the block below to prevent eth0 MAC
96 * from randomization. Unique WAN, LAN, WLAN MACs
97 * are stored in u-boot-env.
98 */
99
100 /* Default Ralink MAC (00:0c:43:28:80:xx) */
101 macaddr_factory_fff0: macaddr@fff0 {
102 reg = <0xfff0 0x6>;
103 };
104 };
105 };
106
107 partition@300000 {
108 label = "firmware";
109 reg = <0x300000 0x2000000>;
110
111 compatible = "fixed-partitions";
112 #address-cells = <1>;
113 #size-cells = <1>;
114
115 partition@0 {
116 label = "kernel";
117 reg = <0x0 0x440000>;
118 };
119
120 ubiconcat0: partition@400000 {
121 label = "ubiconcat0";
122 reg = <0x440000 0x1bc0000>;
123 };
124 };
125
126 partition@2300000 {
127 label = "Firmware2";
128 reg = <0x2300000 0x2000000>;
129 read-only;
130 };
131
132 partition@4300000 {
133 label = "glbcfg";
134 reg = <0x4300000 0x200000>;
135 read-only;
136 };
137
138 partition@4500000 {
139 label = "board_data";
140 reg = <0x4500000 0x100000>;
141 read-only;
142 };
143
144 partition@4600000 {
145 label = "glbcfg2";
146 reg = <0x4600000 0x200000>;
147 read-only;
148 };
149
150 partition@4800000 {
151 label = "board_data2";
152 reg = <0x4800000 0x100000>;
153 read-only;
154 };
155
156 ubiconcat1: partition@4900000 {
157 label = "ubiconcat1";
158 reg = <0x4900000 0x3680000>;
159 };
160 };
161 };
162
163 &pcie {
164 status = "okay";
165 };
166
167 &pcie1 {
168 wifi@0,0 {
169 compatible = "mediatek,mt76";
170 reg = <0x0000 0 0 0 0>;
171 nvmem-cells = <&eeprom_factory_0>;
172 nvmem-cell-names = "eeprom";
173 };
174 };
175
176 &gmac0 {
177 nvmem-cells = <&macaddr_factory_fff0>;
178 nvmem-cell-names = "mac-address";
179 };
180
181 &gmac1 {
182 status = "okay";
183 label = "wan";
184 phy-handle = <&ethphy4>;
185
186 nvmem-cells = <&macaddr_factory_fff0>;
187 nvmem-cell-names = "mac-address";
188 };
189
190 &mdio {
191 ethphy4: ethernet-phy@4 {
192 reg = <4>;
193 };
194 };
195
196 &switch0 {
197 ports {
198 port@2 {
199 status = "okay";
200 label = "lan2";
201 };
202
203 port@3 {
204 status = "okay";
205 label = "lan1";
206 };
207 };
208 };
209
210 &state_default {
211 gpio {
212 groups = "i2c", "jtag";
213 function = "gpio";
214 };
215 };