Skip to content

Commit 93b722d

Browse files
committed
ramips: mt7621: add support for Wodesys WD-R1802U
This commit adds support for a dual-band AX1800 wall plug manufactured by Shenzhen Century Xinyang Tech Co., Ltd. CPU: Mediatek MT7621A (2 cores, 4 threads) RAM: 256i MiB DDR3 (Samsung K4B2G1646F-BCNB) ROM: 16 MiB SPI NOR (Winbond W25Q128JVPQ) Wired: one gigabit RJ45 port (with green/yellow non-GPIO LEDs) WiFi: Mediatek MT7905DAN + MT7975DN (DBDC 2x 2T2R) Ant.: four 2 dBi external antennas (two 2.4GHz, two 5 GHz) GPIO: tri-color status LED (GPIO 13, 14, 16); reset button (GPIO 18) Power: 12V 2-pin JST-XH on main PCB 110/220V AC to 12V1A DC on auxiliary PCB UART: 115200 8n1, SMD pads available on the PCB as J4 pinout is [3v3] (Rx) (Tx) (Gnd) MAC: 1C:BF:CE:xx:xx:xx (2.4 GHz, label) 1C:BF:CE:xx:xx:xx + 1 (ethernet [1]) 1C:BF:CE:xx:xx:xx + 2 (5 GHz) Original firmware is LEDE Reboot 17.01-SNAPSHOT (kernel 4.4.198) with a few custom packages and a non-LuCI web interface. Telnet and SSH are enabled, requiring an unknown root password [2]. Root password is also needed to access the router via UART console, but passwordless telnet can be enabled via a trivial web exploit [3] and then the root password can be removed by editing `/etc/shadow`. Installation: First upload `sysupgrade` binary via web interface at `http://192.168.188.1/settings.shtml` and wait until getting back to the home screen (select network to extend). The installation fails since the original firmware uses `swconfig` and recent versions of OpenWrt use DSA. However, the sysupgrade file is uploaded correctly and stored at `/tmp/upgrade.bin`, so it can be written to flash via the web exploit [4] (both `mtd -r write` and `sysupgrade -Fn` work fine). Passwordless telnet/ssh is not needed for installation. Alternatively, use u-boot menu to load image via TFTP. Notes: - Device model in LEDE is "MediaTek MT7621 RFB (802.11ax,SNOR)". - It is sold under several names, among them are Wodesys WD-R1802U, Fenvi F-AX1802U, and EDUP EP-2971; the Wodesys brand was selected since it is referenced in `/etc/banner` and `/etc/hosts`, and the PCB is marked "WD518A V1.0". - Instead of a standard ethernet transformer, the PCB has a few tiny SMD coils. [1] Original firmware sets ethernet MAC to 1C:BF:CE:E7:62:1D based on offset `0x3fff4` in the Factory partition; since this is the same MAC for all units, whereas WiFi MACs stored at offsets 0x6 and 0xc are unique, it was decided to use <label MAC + 1> for ethernet. [2] root:$1$7rmMiPJj$91iv9LWhfkZE/t7aCBdo.0:18388:0:99999:7::: [3] curl -X POST http://192.168.188.1/cgi-bin/adm.cgi \ -d page=Lang -d langType="en;killall telnetd;telnetd -l /bin/sh" [4] curl -X POST http://192.168.188.1/cgi-bin/adm.cgi \ -d page=Lang -d langType="en;mtd -r write /tmp/upgrade.bin firmware" Signed-off-by: Rani Hod <[email protected]>
1 parent 06b37a5 commit 93b722d

File tree

3 files changed

+175
-0
lines changed

3 files changed

+175
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
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 = "wodesys,wd-r1802u", "mediatek,mt7621-soc";
11+
model = "Wodesys WD-R1802U";
12+
13+
aliases {
14+
label-mac-device = &gmac0;
15+
led-boot = &led_blue;
16+
led-failsafe = &led_red;
17+
led-running = &led_green;
18+
led-upgrade = &led_blue;
19+
};
20+
21+
chosen {
22+
bootargs = "console=ttyS0,115200";
23+
};
24+
25+
gpio-keys {
26+
compatible = "gpio-keys";
27+
28+
key-0 {
29+
label = "reset";
30+
gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31+
linux,code = <KEY_RESTART>;
32+
};
33+
};
34+
35+
gpio-leds {
36+
compatible = "gpio-leds";
37+
38+
led_green: led-0 {
39+
color = <LED_COLOR_ID_GREEN>;
40+
function = LED_FUNCTION_STATUS;
41+
gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
42+
};
43+
44+
led_blue: led-1 {
45+
color = <LED_COLOR_ID_BLUE>;
46+
function = LED_FUNCTION_STATUS;
47+
gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
48+
};
49+
50+
led_red: led-2 {
51+
color = <LED_COLOR_ID_RED>;
52+
function = LED_FUNCTION_STATUS;
53+
gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
54+
panic-indicator;
55+
};
56+
57+
};
58+
};
59+
60+
&gmac0 {
61+
nvmem-cells = <&macaddr_factory_4 1>;
62+
nvmem-cell-names = "mac-address";
63+
};
64+
65+
&pcie {
66+
status = "okay";
67+
};
68+
69+
&pcie1 {
70+
wifi@0,0 {
71+
compatible = "mediatek,mt76";
72+
reg = <0x0000 0 0 0 0>;
73+
nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
74+
nvmem-cell-names = "eeprom", "precal";
75+
mediatek,disable-radar-background;
76+
};
77+
};
78+
79+
&spi0 {
80+
status = "okay";
81+
82+
flash@0 {
83+
compatible = "jedec,spi-nor";
84+
reg = <0>;
85+
spi-max-frequency = <50000000>;
86+
#address-cells = <1>;
87+
#size-cells = <1>;
88+
89+
partitions {
90+
compatible = "fixed-partitions";
91+
92+
partition@0 {
93+
label = "u-boot";
94+
reg = <0x00000 0x30000>;
95+
read-only;
96+
};
97+
98+
partition@30000 { // empty (all FF)
99+
label = "config";
100+
reg = <0x30000 0x10000>;
101+
read-only;
102+
};
103+
104+
partition@40000 { // empty (all FF)
105+
compatible = "u-boot,env";
106+
label = "u-boot-env";
107+
reg = <0x40000 0x10000>;
108+
};
109+
110+
partition@50000 {
111+
label = "factory";
112+
reg = <0x50000 0x40000>;
113+
read-only;
114+
115+
nvmem-layout {
116+
compatible = "fixed-layout";
117+
#address-cells = <1>;
118+
#size-cells = <1>;
119+
120+
eeprom_factory_0: eeprom@0 {
121+
reg = <0x0 0xe00>;
122+
};
123+
124+
macaddr_factory_4: macaddr@4 { // wifi 2.4
125+
compatible = "mac-base";
126+
reg = <0x4 0x6>;
127+
#nvmem-cell-cells = <1>;
128+
};
129+
130+
precal_factory_e10: precal@e10 {
131+
reg = <0xe10 0x19c10>;
132+
};
133+
};
134+
};
135+
136+
partition@90000 {
137+
compatible = "denx,uimage";
138+
label = "firmware";
139+
reg = <0x90000 0xf70000>;
140+
};
141+
};
142+
};
143+
};
144+
145+
&state_default {
146+
gpio {
147+
groups = "i2c", "jtag", "wdt";
148+
function = "gpio";
149+
};
150+
};
151+
152+
&switch0 {
153+
ports {
154+
port@4 {
155+
status = "okay";
156+
label = "lan";
157+
};
158+
};
159+
};
160+
161+
&xhci {
162+
status = "disabled";
163+
};

target/linux/ramips/image/mt7621.mk

+11
Original file line numberDiff line numberDiff line change
@@ -2898,6 +2898,17 @@ define Device/winstars_ws-wn583a6
28982898
endef
28992899
TARGET_DEVICES += winstars_ws-wn583a6
29002900

2901+
define Device/wodesys_wd-r1802u
2902+
$(Device/dsa-migration)
2903+
$(Device/uimage-lzma-loader)
2904+
IMAGE_SIZE := 15808k
2905+
DEVICE_VENDOR := Wodesys
2906+
DEVICE_MODEL := WD-R1802U
2907+
DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools
2908+
SUPPORTED_DEVICES += mt7621-rfb-ax-nor
2909+
endef
2910+
TARGET_DEVICES += wodesys_wd-r1802u
2911+
29012912
define Device/xiaomi_nand_separate
29022913
$(Device/nand)
29032914
$(Device/uimage-lzma-loader)

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

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ ramips_setup_interfaces()
6161
ubnt,unifi-nanohd|\
6262
yuncore,fap690|\
6363
wavlink,wl-wn573hx1|\
64+
wodesys,wd-r1802u|\
6465
zyxel,nwa50ax|\
6566
zyxel,nwa55axe)
6667
ucidef_set_interface_lan "lan"

0 commit comments

Comments
 (0)