ramips: add support for Z-ROUTER ZR-2660
[openwrt/staging/stintel.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 &mdio {
97 ethphy4: ethernet-phy@4 {
98 reg = <4>;
99 };
100 };
101
102 &nand {
103 status = "okay";
104
105 mediatek,nmbm;
106 mediatek,bmt-max-ratio = <1>;
107 mediatek,bmt-max-reserved-blocks = <64>;
108
109 partitions {
110 compatible = "fixed-partitions";
111 #address-cells = <1>;
112 #size-cells = <1>;
113
114 partition@0 {
115 label = "u-boot";
116 reg = <0x0 0x80000>;
117 read-only;
118 };
119
120 partition@80000 {
121 label = "Config";
122 reg = <0x80000 0x80000>;
123 read-only;
124 };
125
126 partition@100000 {
127 label = "factory";
128 reg = <0x100000 0x80000>;
129 read-only;
130
131 nvmem-layout {
132 compatible = "fixed-layout";
133 #address-cells = <1>;
134 #size-cells = <1>;
135
136 eeprom_factory_0: eeprom@0 {
137 reg = <0x0 0xe00>;
138 };
139
140 macaddr_factory_3fff4: macaddr@3fff4 {
141 reg = <0x3fff4 0x6>;
142 };
143
144 macaddr_factory_3fffa: macaddr@3fffa {
145 reg = <0x3fffa 0x6>;
146 };
147 };
148 };
149
150 partition@180000 {
151 label = "firmware";
152 reg = <0x180000 0x7680000>;
153
154 compatible = "fixed-partitions";
155 #address-cells = <1>;
156 #size-cells = <1>;
157
158 partition@0 {
159 label = "kernel";
160 reg = <0x0 0x400000>;
161 };
162
163 partition@400000 {
164 label = "ubi";
165 reg = <0x400000 0x7280000>;
166 };
167 };
168 };
169 };
170
171 &pcie {
172 status = "okay";
173 };
174
175 &pcie1 {
176 wifi@0,0 {
177 compatible = "mediatek,mt76";
178 reg = <0x0000 0 0 0 0>;
179
180 mediatek,disable-radar-background;
181
182 nvmem-cells = <&eeprom_factory_0>;
183 nvmem-cell-names = "eeprom";
184 };
185 };
186
187 &state_default {
188 gpio {
189 groups = "i2c", "jtag", "wdt";
190 function = "gpio";
191 };
192 };
193
194 &switch0 {
195 ports {
196 port@1 {
197 status = "okay";
198 label = "lan1";
199 };
200
201 port@2 {
202 status = "okay";
203 label = "lan2";
204 };
205
206 port@3 {
207 status = "okay";
208 label = "lan3";
209 };
210 };
211 };