ramips: add support for Z-ROUTER ZR-2660
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_sercomm_cpj.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.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 aliases {
11 label-mac-device = &ethernet;
12
13 led-boot = &status_green;
14 led-failsafe = &status_amber;
15 led-running = &status_green;
16 led-upgrade = &status_amber;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 button-0 {
23 label = "reset";
24 linux,code = <KEY_RESTART>;
25 gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
26 debounce-interval = <60>;
27 };
28
29 button-1 {
30 label = "wps";
31 linux,code = <KEY_RESTART>;
32 gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
33 debounce-interval = <60>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 status_green: led-0 {
41 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
42 color = <LED_COLOR_ID_GREEN>;
43 function = LED_FUNCTION_STATUS;
44 };
45
46 status_amber: led-1 {
47 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
48 color = <LED_COLOR_ID_AMBER>;
49 function = LED_FUNCTION_STATUS;
50 };
51
52 led-2 {
53 color = <LED_COLOR_ID_GREEN>;
54 function = LED_FUNCTION_WAN;
55 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
56 };
57
58 led-3 {
59 color = <LED_COLOR_ID_GREEN>;
60 function = LED_FUNCTION_LAN;
61 function-enumerator = <1>;
62 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
63 };
64
65 led-4 {
66 color = <LED_COLOR_ID_GREEN>;
67 function = LED_FUNCTION_LAN;
68 function-enumerator = <2>;
69 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
70 };
71
72 led-5 {
73 color = <LED_COLOR_ID_GREEN>;
74 function = LED_FUNCTION_LAN;
75 function-enumerator = <3>;
76 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
77 };
78
79 led-6 {
80 color = <LED_COLOR_ID_GREEN>;
81 function = LED_FUNCTION_LAN;
82 function-enumerator = <4>;
83 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
84 };
85
86 led-7 {
87 color = <LED_COLOR_ID_GREEN>;
88 function = LED_FUNCTION_WLAN;
89 function-enumerator = <24>;
90 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
91 linux,default-trigger = "phy1tpt";
92 };
93 };
94
95 virtual_flash {
96 compatible = "mtd-concat";
97
98 devices = <&fwconcat0 &fwconcat1>;
99
100 partitions {
101 compatible = "fixed-partitions";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 partition@0 {
106 compatible = "openwrt,uimage";
107 /* sercomm krnl hdr with fw chksums */
108 openwrt,offset = <0x100>;
109 label = "firmware";
110 reg = <0x0 0x0>;
111 };
112 };
113 };
114 };
115
116 &ethernet {
117 nvmem-cells = <&macaddr_label 0>;
118 nvmem-cell-names = "mac-address";
119 };
120
121 &gpio1 {
122 status = "okay";
123 };
124
125 &gpio2 {
126 status = "okay";
127 };
128
129 &gpio3 {
130 status = "okay";
131 };
132
133 &pcie {
134 status = "okay";
135 };
136
137 /* mt7612 */
138 &pcie0 {
139 wifi@0,0 {
140 compatible = "mediatek,mt76";
141 reg = <0x0000 0 0 0 0>;
142 ieee80211-freq-limit = <5000000 6000000>;
143
144 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_label 6>;
145 nvmem-cell-names = "eeprom", "mac-address";
146
147 /* 5 GHz WLAN phy green led */
148 led {
149 led-sources = <2>;
150 led-active-low;
151 };
152 };
153 };
154
155 &spi0 {
156 status = "okay";
157
158 flash@0 {
159 compatible = "jedec,spi-nor";
160 reg = <0>;
161 spi-max-frequency = <70000000>;
162 m25p,fast-read;
163
164 partitions {
165 compatible = "fixed-partitions";
166 #address-cells = <1>;
167 #size-cells = <1>;
168
169 /* whole flash */
170 partition@0_all {
171 label = "ALL";
172 reg = <0x0 0x1000000>;
173 read-only;
174 };
175
176 partition@0 {
177 label = "u-boot";
178 reg = <0x0 0x30000>;
179 read-only;
180 };
181
182 partition@30000 {
183 label = "ftd_and_bootflag";
184 reg = <0x30000 0x20000>;
185 };
186
187 partition@50000 {
188 label = "Factory";
189 reg = <0x50000 0x10000>;
190 read-only;
191
192 nvmem-layout {
193 compatible = "fixed-layout";
194 #address-cells = <1>;
195 #size-cells = <1>;
196
197 eeprom_factory_0: eeprom@0 {
198 reg = <0x0 0x200>;
199 };
200
201 eeprom_factory_8000: eeprom@8000 {
202 reg = <0x8000 0x200>;
203 };
204 };
205 };
206
207 partition@60000 {
208 label = "SC Nvram(permanent data)";
209 reg = <0x60000 0x10000>;
210 read-only;
211
212 nvmem-layout {
213 compatible = "fixed-layout";
214 #address-cells = <1>;
215 #size-cells = <1>;
216
217 macaddr_label: macaddr@0 {
218 compatible = "mac-base";
219 reg = <0x0 0x6>;
220 #nvmem-cell-cells = <1>;
221 };
222 };
223 };
224
225 fwconcat0: partition@70000 {
226 label = "Firmware";
227 reg = <0x70000 0x790000>;
228
229 compatible = "fixed-partitions";
230 #address-cells = <1>;
231 #size-cells = <1>;
232
233 partition@0 {
234 label = "Kernel";
235 reg = <0x0 0x200000>;
236 };
237
238 partition@200000 {
239 label = "RootFS";
240 reg = <0x200000 0x590000>;
241 };
242 };
243
244 fwconcat1: partition@800000 {
245 label = "Firmware2";
246 reg = <0x800000 0x790000>;
247
248 compatible = "fixed-partitions";
249 #address-cells = <1>;
250 #size-cells = <1>;
251
252 partition@0 {
253 label = "Kernel2";
254 reg = <0x0 0x200000>;
255 };
256
257 partition@200000 {
258 label = "RootFS2";
259 reg = <0x200000 0x590000>;
260 };
261 };
262
263 partition@f90000 {
264 label = "MAC IP";
265 reg = <0xf90000 0x10000>;
266 read-only;
267 };
268
269 partition@fa0000 {
270 label = "Critical Log";
271 reg = <0xfa0000 0x10000>;
272 read-only;
273 };
274
275 partition@fb000 {
276 label = "Critical Log Bak";
277 reg = <0xfb0000 0x10000>;
278 read-only;
279 };
280
281 partition@fc0000 {
282 label = "Xml Config";
283 reg = <0xfc0000 0x20000>;
284 read-only;
285 };
286
287 partition@fe0000 {
288 label = "Xml Config Bak";
289 reg = <0xfe0000 0x20000>;
290 read-only;
291 };
292 };
293 };
294 };
295
296 &state_default {
297 gpio {
298 groups = "ephy", "rgmii1", "uartf", "wled";
299 function = "gpio";
300 };
301 };
302
303 /* mt7620 */
304 &wmac {
305 nvmem-cells = <&eeprom_factory_0>, <&macaddr_label 2>;
306 nvmem-cell-names = "eeprom", "mac-address";
307 };