64beabea939247ebad8323008e0bf9eaf39a5dc3
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_cudy_wr2100.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 = "cudy,wr2100", "mediatek,mt7621-soc";
10 model = "Cudy WR2100";
11
12 aliases {
13 led-boot = &led_internet_blue;
14 led-failsafe = &led_internet_blue;
15 led-running = &led_internet_blue;
16 led-upgrade = &led_internet_blue;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_internet_blue: internet_blue {
44 label = "blue:internet";
45 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
46 };
47
48 internet_red {
49 label = "red:internet";
50 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
51 };
52
53 wan {
54 label = "green:wan";
55 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
56 };
57
58 lan1 {
59 label = "green:lan1";
60 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
61 };
62
63 lan2 {
64 label = "green:lan2";
65 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
66 };
67
68 lan3 {
69 label = "green:lan3";
70 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
71 };
72
73 lan4 {
74 label = "green:lan4";
75 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
76 };
77 };
78 };
79
80 &gmac0 {
81 nvmem-cells = <&macaddr_bdinfo_de00>;
82 nvmem-cell-names = "mac-address";
83 };
84
85 &pcie {
86 status = "okay";
87 };
88
89 &pcie0 {
90 wifi@0,0 {
91 compatible = "mediatek,mt76";
92 reg = <0x0000 0 0 0 0>;
93 nvmem-cells = <&eeprom_factory_0>;
94 nvmem-cell-names = "eeprom";
95 ieee80211-freq-limit = <2400000 2500000>;
96 };
97 };
98
99 &pcie1 {
100 wifi@1,0 {
101 compatible = "mediatek,mt76";
102 reg = <0x0000 0 0 0 0>;
103 nvmem-cells = <&eeprom_factory_8000>;
104 nvmem-cell-names = "eeprom";
105 ieee80211-freq-limit = <5000000 6000000>;
106 };
107 };
108
109 &spi0 {
110 status = "okay";
111
112 flash@0 {
113 compatible = "jedec,spi-nor";
114 reg = <0>;
115 spi-max-frequency = <50000000>;
116
117 partitions {
118 compatible = "fixed-partitions";
119 #address-cells = <1>;
120 #size-cells = <1>;
121
122 partition@0 {
123 label = "u-boot";
124 reg = <0x0 0x30000>;
125 read-only;
126 };
127
128 partition@30000 {
129 label = "u-boot-env";
130 reg = <0x30000 0x10000>;
131 read-only;
132 };
133
134 factory: partition@40000 {
135 label = "factory";
136 reg = <0x40000 0x10000>;
137 read-only;
138
139 nvmem-layout {
140 compatible = "fixed-layout";
141 #address-cells = <1>;
142 #size-cells = <1>;
143
144 eeprom_factory_0: eeprom@0 {
145 reg = <0x0 0x400>;
146 };
147
148 eeprom_factory_8000: eeprom@8000 {
149 reg = <0x8000 0x4da8>;
150 };
151 };
152 };
153
154 partition@50000 {
155 compatible = "denx,uimage";
156 label = "firmware";
157 reg = <0x50000 0xf80000>;
158 };
159
160 partition@fd0000 {
161 label = "debug";
162 reg = <0xfd0000 0x10000>;
163 read-only;
164 };
165
166 partition@fe0000 {
167 label = "backup";
168 reg = <0xfe0000 0x10000>;
169 read-only;
170 };
171
172 bdinfo: partition@ff0000 {
173 label = "bdinfo";
174 reg = <0xff0000 0x10000>;
175 read-only;
176
177 nvmem-layout {
178 compatible = "fixed-layout";
179 #address-cells = <1>;
180 #size-cells = <1>;
181
182 macaddr_bdinfo_de00: macaddr@de00 {
183 reg = <0xde00 0x6>;
184 };
185 };
186 };
187 };
188 };
189 };
190
191 &state_default {
192 gpio {
193 groups = "i2c", "jtag", "uart2", "uart3", "wdt";
194 function = "gpio";
195 };
196 };
197
198 &gmac1 {
199 status = "okay";
200 label = "wan";
201 phy-handle = <&ethphy4>;
202
203 nvmem-cells = <&macaddr_bdinfo_de00>;
204 nvmem-cell-names = "mac-address";
205 mac-address-increment = <1>;
206 };
207
208 &mdio {
209 ethphy4: ethernet-phy@4 {
210 reg = <4>;
211 };
212 };
213
214 &switch0 {
215 ports {
216 port@0 {
217 status = "okay";
218 label = "lan1";
219 };
220
221 port@1 {
222 status = "okay";
223 label = "lan2";
224 };
225
226 port@2 {
227 status = "okay";
228 label = "lan3";
229 };
230
231 port@3 {
232 status = "okay";
233 label = "lan4";
234 };
235 };
236 };