Skip to content

Commit 5d0ccaf

Browse files
raenyehauke
authored andcommitted
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]> Link: openwrt/openwrt#15777 Signed-off-by: Hauke Mehrtens <[email protected]>
1 parent be71e16 commit 5d0ccaf

File tree

3 files changed

+165
-0
lines changed

3 files changed

+165
-0
lines changed
Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
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+
&gmac0 {
60+
nvmem-cells = <&macaddr_factory_4 1>;
61+
nvmem-cell-names = "mac-address";
62+
};
63+
64+
&pcie {
65+
status = "okay";
66+
};
67+
68+
&pcie1 {
69+
wifi@0,0 {
70+
compatible = "mediatek,mt76";
71+
reg = <0x0000 0 0 0 0>;
72+
nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>;
73+
nvmem-cell-names = "eeprom", "precal";
74+
mediatek,disable-radar-background;
75+
};
76+
};
77+
78+
&spi0 {
79+
status = "okay";
80+
81+
flash@0 {
82+
compatible = "jedec,spi-nor";
83+
reg = <0>;
84+
spi-max-frequency = <50000000>;
85+
86+
partitions {
87+
compatible = "fixed-partitions";
88+
#address-cells = <1>;
89+
#size-cells = <1>;
90+
91+
partition@0 {
92+
label = "u-boot";
93+
reg = <0x00000 0x30000>;
94+
read-only;
95+
};
96+
97+
/* 0x30000-0x4ffff are unused
98+
(flash contents is 0xff) */
99+
100+
partition@50000 {
101+
label = "factory";
102+
reg = <0x50000 0x40000>;
103+
read-only;
104+
105+
nvmem-layout {
106+
compatible = "fixed-layout";
107+
#address-cells = <1>;
108+
#size-cells = <1>;
109+
110+
eeprom_factory_0: eeprom@0 {
111+
reg = <0x0 0xe00>;
112+
};
113+
114+
macaddr_factory_4: macaddr@4 { // wifi 2.4
115+
compatible = "mac-base";
116+
reg = <0x4 0x6>;
117+
#nvmem-cell-cells = <1>;
118+
};
119+
120+
precal_factory_e10: precal@e10 {
121+
reg = <0xe10 0x19c10>;
122+
};
123+
};
124+
};
125+
126+
partition@90000 {
127+
compatible = "denx,uimage";
128+
label = "firmware";
129+
reg = <0x90000 0xf70000>;
130+
};
131+
};
132+
};
133+
};
134+
135+
&state_default {
136+
gpio {
137+
groups = "jtag", "wdt";
138+
function = "gpio";
139+
};
140+
};
141+
142+
&switch0 {
143+
ports {
144+
port@4 {
145+
status = "okay";
146+
label = "lan";
147+
};
148+
};
149+
};
150+
151+
&xhci {
152+
status = "disabled";
153+
};

target/linux/ramips/image/mt7621.mk

Lines changed: 11 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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)