ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iodata_wn-dx1200gr.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 = "iodata,wn-dx1200gr", "mediatek,mt7621-soc";
11 model = "I-O DATA WN-DX1200GR";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac1;
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 wps {
25 function = LED_FUNCTION_WPS;
26 color = <LED_COLOR_ID_BLUE>;
27 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
28 };
29
30 led_power: power {
31 function = LED_FUNCTION_POWER;
32 color = <LED_COLOR_ID_GREEN>;
33 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
34 };
35 };
36
37 keys {
38 compatible = "gpio-keys";
39
40 reset {
41 label = "reset";
42 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
43 linux,code = <KEY_RESTART>;
44 };
45
46 repeater {
47 label = "repeater";
48 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
49 linux,code = <BTN_0>;
50 linux,input-type = <EV_SW>;
51 };
52
53 wps {
54 label = "wps";
55 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
56 linux,code = <KEY_WPS_BUTTON>;
57 };
58 };
59 };
60
61 &nand {
62 status = "okay";
63
64 mediatek,bbt;
65 mediatek,bmt-remap-range =
66 <0x0000000 0x0800000>,
67 <0x3600000 0x4980000>;
68
69 partitions {
70 compatible = "fixed-partitions";
71 #address-cells = <1>;
72 #size-cells = <1>;
73
74 partition@0 {
75 label = "u-boot";
76 reg = <0x0 0x100000>;
77 read-only;
78 };
79
80 partition@100000 {
81 label = "u-boot-env";
82 reg = <0x100000 0x100000>;
83 read-only;
84 };
85
86 partition@200000 {
87 label = "factory";
88 reg = <0x200000 0x200000>;
89
90 nvmem-layout {
91 compatible = "fixed-layout";
92 #address-cells = <1>;
93 #size-cells = <1>;
94
95 eeprom_factory_0: eeprom@0 {
96 reg = <0x0 0x400>;
97 };
98
99 eeprom_factory_8000: eeprom@8000 {
100 reg = <0x8000 0x4da8>;
101 };
102
103 macaddr_factory_1e000: macaddr@1e000 {
104 reg = <0x1e000 0x6>;
105 };
106
107 macaddr_factory_1e006: macaddr@1e006 {
108 reg = <0x1e006 0x6>;
109 };
110 };
111 };
112
113 partition@400000 {
114 label = "kernel";
115 reg = <0x400000 0x400000>;
116 };
117
118 partition@800000 {
119 label = "ubi";
120 reg = <0x800000 0x2e00000>;
121 };
122
123 partition@3600000 {
124 label = "Config";
125 reg = <0x3600000 0x100000>;
126 read-only;
127 };
128
129 partition@3700000 {
130 label = "firmware_2";
131 reg = <0x3700000 0x3200000>;
132 };
133
134 partition@6900000 {
135 label = "Config_2";
136 reg = <0x6900000 0x100000>;
137 read-only;
138 };
139
140 partition@6a00000 {
141 label = "persist";
142 reg = <0x6a00000 0x100000>;
143 };
144
145 partition@6b00000 {
146 label = "idmkey";
147 reg = <0x6b00000 0x100000>;
148 read-only;
149 };
150
151 partition@6c00000 {
152 label = "Backup";
153 reg = <0x6c00000 0x1380000>;
154 read-only;
155 };
156 };
157 };
158
159 &gmac0 {
160 nvmem-cells = <&macaddr_factory_1e000>;
161 nvmem-cell-names = "mac-address";
162 };
163
164 &gmac1 {
165 status = "okay";
166 label = "wan";
167 phy-handle = <&ethphy0>;
168
169 nvmem-cells = <&macaddr_factory_1e006>;
170 nvmem-cell-names = "mac-address";
171 };
172
173 &ethphy0 {
174 /delete-property/ interrupts;
175 };
176
177 &switch0 {
178 ports {
179 port@1 {
180 status = "okay";
181 label = "lan4";
182 };
183
184 port@2 {
185 status = "okay";
186 label = "lan3";
187 };
188
189 port@3 {
190 status = "okay";
191 label = "lan2";
192 };
193
194 port@4 {
195 status = "okay";
196 label = "lan1";
197 };
198 };
199 };
200
201 &pcie {
202 status = "okay";
203 };
204
205 &pcie0 {
206 wifi@0,0 {
207 compatible = "mediatek,mt76";
208 reg = <0x0000 0 0 0 0>;
209 ieee80211-freq-limit = <2400000 2500000>;
210
211 nvmem-cells = <&eeprom_factory_0>;
212 nvmem-cell-names = "eeprom";
213 };
214 };
215
216 &pcie1 {
217 wifi@0,0 {
218 compatible = "mediatek,mt76";
219 reg = <0x0000 0 0 0 0>;
220 ieee80211-freq-limit = <5000000 6000000>;
221
222 nvmem-cells = <&eeprom_factory_8000>;
223 nvmem-cell-names = "eeprom";
224 };
225 };
226
227 &state_default {
228 gpio {
229 groups = "uart2", "uart3", "wdt";
230 function = "gpio";
231 };
232 };
233
234 &xhci {
235 status = "disabled";
236 };