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