ramips: mt7621-dts: describe switch PHYs and adjust PHY muxing
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_z-router_zr-2660.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 = "z-router,zr-2660", "mediatek,mt7621-soc";
11 model = "Z-ROUTER ZR-2660";
12
13 aliases {
14 label-mac-device = &gmac0;
15
16 led-boot = &led_power_green;
17 led-failsafe = &led_power_green;
18 led-running = &led_power_green;
19 led-upgrade = &led_power_green;
20 };
21
22 chosen {
23 bootargs = "console=ttyS0,115200";
24 };
25
26 keys {
27 compatible = "gpio-keys";
28
29 key-0 {
30 label = "reset";
31 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_RESTART>;
33 debounce-interval = <60>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led-0 {
41 color = <LED_COLOR_ID_GREEN>;
42 function = LED_FUNCTION_WAN;
43 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
44 };
45
46 led-1 {
47 color = <LED_COLOR_ID_GREEN>;
48 function = LED_FUNCTION_WLAN;
49 function-enumerator = <50>;
50 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
51 linux,default-trigger = "phy1tpt";
52 };
53
54 led-2 {
55 color = <LED_COLOR_ID_GREEN>;
56 function = LED_FUNCTION_LAN;
57 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
58 };
59
60 led-3 {
61 color = <LED_COLOR_ID_GREEN>;
62 function = LED_FUNCTION_WLAN;
63 function-enumerator = <24>;
64 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
65 linux,default-trigger = "phy0tpt";
66 };
67
68 led-4 {
69 color = <LED_COLOR_ID_RED>;
70 function = LED_FUNCTION_WAN;
71 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
72 };
73
74 led_power_green: led-5 {
75 color = <LED_COLOR_ID_GREEN>;
76 function = LED_FUNCTION_POWER;
77 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
78 };
79 };
80 };
81
82 &gmac0 {
83 nvmem-cells = <&macaddr_factory_3fff4>;
84 nvmem-cell-names = "mac-address";
85 };
86
87 &gmac1 {
88 status = "okay";
89 label = "wan";
90 phy-handle = <&ethphy4>;
91
92 nvmem-cells = <&macaddr_factory_3fffa>;
93 nvmem-cell-names = "mac-address";
94 };
95
96 &ethphy4 {
97 /delete-property/ interrupts;
98 };
99
100 &nand {
101 status = "okay";
102
103 mediatek,nmbm;
104 mediatek,bmt-max-ratio = <1>;
105 mediatek,bmt-max-reserved-blocks = <64>;
106
107 partitions {
108 compatible = "fixed-partitions";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 partition@0 {
113 label = "u-boot";
114 reg = <0x0 0x80000>;
115 read-only;
116 };
117
118 partition@80000 {
119 label = "Config";
120 reg = <0x80000 0x80000>;
121 read-only;
122 };
123
124 partition@100000 {
125 label = "factory";
126 reg = <0x100000 0x80000>;
127 read-only;
128
129 nvmem-layout {
130 compatible = "fixed-layout";
131 #address-cells = <1>;
132 #size-cells = <1>;
133
134 eeprom_factory_0: eeprom@0 {
135 reg = <0x0 0xe00>;
136 };
137
138 macaddr_factory_3fff4: macaddr@3fff4 {
139 reg = <0x3fff4 0x6>;
140 };
141
142 macaddr_factory_3fffa: macaddr@3fffa {
143 reg = <0x3fffa 0x6>;
144 };
145 };
146 };
147
148 partition@180000 {
149 label = "firmware";
150 reg = <0x180000 0x7680000>;
151
152 compatible = "fixed-partitions";
153 #address-cells = <1>;
154 #size-cells = <1>;
155
156 partition@0 {
157 label = "kernel";
158 reg = <0x0 0x400000>;
159 };
160
161 partition@400000 {
162 label = "ubi";
163 reg = <0x400000 0x7280000>;
164 };
165 };
166 };
167 };
168
169 &pcie {
170 status = "okay";
171 };
172
173 &pcie1 {
174 wifi@0,0 {
175 compatible = "mediatek,mt76";
176 reg = <0x0000 0 0 0 0>;
177
178 mediatek,disable-radar-background;
179
180 nvmem-cells = <&eeprom_factory_0>;
181 nvmem-cell-names = "eeprom";
182 };
183 };
184
185 &state_default {
186 gpio {
187 groups = "i2c", "jtag", "wdt";
188 function = "gpio";
189 };
190 };
191
192 &switch0 {
193 ports {
194 port@1 {
195 status = "okay";
196 label = "lan1";
197 };
198
199 port@2 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@3 {
205 status = "okay";
206 label = "lan3";
207 };
208 };
209 };