Skip to content

Commit d9eb01a

Browse files
juncaixingchi2026hauke
authored andcommitted
ramips: add support for Z-ROUTER ZR-2662
This commit adds support for Z-ROUTER ZR-2662 (also known as Routerich AX1800 V2) wireless WiFi 6 router. Hardware specification --------------------- - SoC : MediaTek MT7621AT, MIPS, 880 MHz - RAM : 256 MiB - Flash : NAND 128 MiB (AMD/Spansion S34ML01G2) - WLAN : - 2.4 GHz : MediaTek MT7905D/MT7975 (14c3:7916), b/g/n/ax, MIMO 2x2 - 5 GHz : MediaTek MT7915E (14c3:7915), a/n/ac/ax, MIMO 2x2 - Ethernet : 10/100/1000 Mbps x4 (1x WAN, 3x LAN) - USB : 1x 2.0 - UART : 3.3V, 115200n8, pins are silkscreened on the pcb - Buttons : 1x Reset - LEDs : 1x WiFi 2.4 GHz (green) 1x WiFi 5 GHz (green) 1x LAN (green) 1x WAN (green) 1x WAN no-internet (red) - Power : 12 VDC, 1 A Installation ------------ 1. Run tftp server on your PC (IP: 192.168.2.2) and put OpenWrt initramfs image (initramfs.bin) to the tftp root dir 2. Open the following link in the browser to enable telnet: http://192.168.2.1/cgi-bin/telnet_ssh 3. Connect to the router (default IP: 192.168.2.1) using telnet shell (credentials - user:admin) 4. Run the following commands in the telnet shell (this will install OpenWrt initramfs image on nand flash): cd /tmp tftp -g -r initramfs.bin 192.168.2.2 mtd write initramfs.bin firmware mtd erase firmware_backup reboot 5. Copy OpenWrt sysupgrade image (sysupgrade.bin) to the /tmp dir of the router 6. Connect to the router (IP: 192.168.1.1) using ssh shell and run sysupgrade command: sysupgrade -n /tmp/sysupgrade.bin Return to stock --------------- 1. Copy stock firmware (stock.bin) to the /tmp dir of the router using scp 2. Run following command in the router shell: cd /tmp mtd write stock.bin firmware reboot Recovery -------- Connect uart (pins are silkscreened on the pcb), interrupt boot process by pressing any key, use u-boot menu to flash stock firmware image or OpenWrt initramfs image. MAC addresses ------------- +---------+-------------------+-----------+ | | MAC | Algorithm | +---------+-------------------+-----------+ | LAN | 24:0f:5e:xx:xx:4c | label | | WAN | 24:0f:5e:xx:xx:4d | label+1 | | WLAN 2g | 24:0f:5e:xx:xx:4e | label+2 | | WLAN 5g | 24:0f:5e:xx:xx:4f | label+3 | +---------+-------------------+-----------+ The WLAN 2.4 MAC was found in 'factory', 0x4 The LAN MAC was found in 'factory', 0xfff4 The WAN MAC was found in 'factory', 0xfffa Note: This device is similar to Z-ROUTER ZR-2660, but with minor hardware revisions. The firmware and configuration are compatible. Signed-off-by: xingchi <juncaixingchi2026@gmail.com> Link: openwrt#21524 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent b178e05 commit d9eb01a

File tree

5 files changed

+242
-0
lines changed

5 files changed

+242
-0
lines changed
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
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-2662", "mediatek,mt7621-soc";
11+
model = "Z-ROUTER ZR-2662";
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 16 GPIO_ACTIVE_HIGH>;
32+
linux,code = <KEY_RESTART>;
33+
debounce-interval = <60>;
34+
};
35+
36+
key-1 {
37+
label = "wps";
38+
gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
39+
linux,code = <KEY_WPS_BUTTON>;
40+
debounce-interval = <60>;
41+
};
42+
};
43+
44+
leds {
45+
compatible = "gpio-leds";
46+
47+
led-0 {
48+
color = <LED_COLOR_ID_GREEN>;
49+
function = LED_FUNCTION_WAN;
50+
gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
51+
};
52+
53+
led-1 {
54+
color = <LED_COLOR_ID_GREEN>;
55+
function = LED_FUNCTION_WLAN;
56+
function-enumerator = <50>;
57+
gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
58+
linux,default-trigger = "phy1tpt";
59+
};
60+
61+
led-2 {
62+
color = <LED_COLOR_ID_RED>;
63+
function = LED_FUNCTION_WAN;
64+
gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
65+
};
66+
67+
led-3 {
68+
color = <LED_COLOR_ID_GREEN>;
69+
function = LED_FUNCTION_WPS;
70+
gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
71+
};
72+
73+
led_power_green: led-4 {
74+
color = <LED_COLOR_ID_GREEN>;
75+
function = LED_FUNCTION_POWER;
76+
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
77+
};
78+
};
79+
};
80+
81+
&gmac0 {
82+
nvmem-cells = <&macaddr_factory_3fff4>;
83+
nvmem-cell-names = "mac-address";
84+
};
85+
86+
&gmac1 {
87+
status = "okay";
88+
label = "wan";
89+
phy-handle = <&ethphy4>;
90+
91+
nvmem-cells = <&macaddr_factory_3fffa>;
92+
nvmem-cell-names = "mac-address";
93+
};
94+
95+
&ethphy4 {
96+
/delete-property/ interrupts;
97+
};
98+
99+
&nand {
100+
status = "okay";
101+
102+
mediatek,nmbm;
103+
mediatek,bmt-max-ratio = <1>;
104+
mediatek,bmt-max-reserved-blocks = <64>;
105+
106+
partitions {
107+
compatible = "fixed-partitions";
108+
#address-cells = <1>;
109+
#size-cells = <1>;
110+
111+
partition@0 {
112+
label = "u-boot";
113+
reg = <0x0 0x80000>;
114+
read-only;
115+
};
116+
117+
partition@80000 {
118+
label = "Config";
119+
reg = <0x80000 0x80000>;
120+
read-only;
121+
};
122+
123+
partition@100000 {
124+
label = "factory";
125+
reg = <0x100000 0x80000>;
126+
read-only;
127+
128+
nvmem-layout {
129+
compatible = "fixed-layout";
130+
#address-cells = <1>;
131+
#size-cells = <1>;
132+
133+
eeprom_factory_0: eeprom@0 {
134+
reg = <0x0 0xe00>;
135+
};
136+
137+
macaddr_factory_4: macaddr@4 {
138+
compatible = "mac-base";
139+
reg = <0x4 0x6>;
140+
#nvmem-cell-cells = <1>;
141+
};
142+
143+
macaddr_factory_3fff4: macaddr@3fff4 {
144+
reg = <0x3fff4 0x6>;
145+
};
146+
147+
macaddr_factory_3fffa: macaddr@3fffa {
148+
reg = <0x3fffa 0x6>;
149+
};
150+
};
151+
};
152+
153+
partition@180000 {
154+
label = "firmware";
155+
reg = <0x180000 0x7680000>;
156+
157+
compatible = "fixed-partitions";
158+
#address-cells = <1>;
159+
#size-cells = <1>;
160+
161+
partition@0 {
162+
label = "kernel";
163+
reg = <0x0 0x400000>;
164+
};
165+
166+
partition@400000 {
167+
label = "ubi";
168+
reg = <0x400000 0x7280000>;
169+
};
170+
};
171+
};
172+
};
173+
174+
&pcie {
175+
status = "okay";
176+
};
177+
178+
&pcie1 {
179+
wifi@0,0 {
180+
compatible = "mediatek,mt76";
181+
reg = <0x0000 0 0 0 0>;
182+
183+
mediatek,disable-radar-background;
184+
185+
nvmem-cells = <&eeprom_factory_0>;
186+
nvmem-cell-names = "eeprom";
187+
188+
#address-cells = <1>;
189+
#size-cells = <0>;
190+
191+
band@1 {
192+
reg = <1>;
193+
nvmem-cells = <&macaddr_factory_4 1>;
194+
nvmem-cell-names = "mac-address";
195+
};
196+
};
197+
};
198+
199+
&state_default {
200+
gpio {
201+
groups = "i2c", "uart3", "jtag", "wdt";
202+
function = "gpio";
203+
};
204+
};
205+
206+
&switch0 {
207+
ports {
208+
port@1 {
209+
status = "okay";
210+
label = "lan1";
211+
};
212+
213+
port@2 {
214+
status = "okay";
215+
label = "lan2";
216+
};
217+
218+
port@3 {
219+
status = "okay";
220+
label = "lan3";
221+
};
222+
};
223+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3606,6 +3606,19 @@ define Device/z-router_zr-2660
36063606
endef
36073607
TARGET_DEVICES += z-router_zr-2660
36083608

3609+
define Device/z-router_zr-2662
3610+
$(Device/dsa-migration)
3611+
$(Device/nand)
3612+
DEVICE_VENDOR := Z-ROUTER
3613+
DEVICE_MODEL := ZR-2662
3614+
IMAGE_SIZE := 121344k
3615+
KERNEL_LOADADDR := 0x82000000
3616+
KERNEL := kernel-bin | relocate-kernel $(loadaddr-y) | lzma | \
3617+
fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
3618+
DEVICE_PACKAGES += kmod-mt7915-firmware kmod-usb3 -uboot-envtools
3619+
endef
3620+
TARGET_DEVICES += z-router_zr-2662
3621+
36093622
define Device/zbtlink_zbt-we1326
36103623
$(Device/dsa-migration)
36113624
$(Device/uimage-lzma-loader)

target/linux/ramips/mt7621/base-files/etc/board.d/01_leds

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ z-router,zr-2660)
277277
ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
278278
ucidef_set_led_netdev "wan-off" "wan-off" "red:wan" "wan" "link"
279279
;;
280+
z-router,zr-2662)
281+
ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
282+
ucidef_set_led_netdev "wan-off" "wan-off" "red:wan" "wan" "link"
283+
;;
280284
zyxel,lte3301-plus)
281285
ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0"
282286
;;

target/linux/ramips/mt7621/base-files/etc/board.d/02_network

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ ramips_setup_interfaces()
3333
xiaomi,mi-router-cr6609|\
3434
xiaomi,redmi-router-ac2100|\
3535
z-router,zr-2660|\
36+
z-router,zr-2662|\
3637
zyxel,wsm20)
3738
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
3839
;;

target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ platform_do_upgrade() {
156156
xiaomi,mi-router-cr6609|\
157157
xiaomi,redmi-router-ac2100|\
158158
z-router,zr-2660|\
159+
z-router,zr-2662|\
159160
zyxel,nwa50ax|\
160161
zyxel,nwa55axe)
161162
nand_do_upgrade "$1"

0 commit comments

Comments
 (0)