Skip to content

Commit 8db7b6f

Browse files
srt19hauke
authored andcommitted
mediatek: filogic: add support for Totolink X6000R
Specification : - SOC : Mediatek MT7981B (1.3GHz) - RAM : 256MB - Flash : 16MB SPI NOR - Ports : 4 LAN (1G) & 1 WAN (1G) - WIFI : MediaTek dual-band WiFi 6 - 2.4 GHz : b/g/n/ax, MIMO 2x2 - 5 GHz : a/n/ac/ax, MIMO 2x2 - Buttons : Reset & WPS/Mesh - LEDS : WAN (Green), Status (Red & Blue) - Power : 12V1A Install via OEM web ui: Upload the sysupgrade image to firmware upgrade page on OEM web ui Install via recovery / revert to stock firmware: 1. Unplug from power 2. Download the Sysupgrade (for openwrt installation) or OEM Factory image (for revert to stock firmware) 3. Set your computer ethernet IP to 192.168.1.X, subnet 255.255.255.0 (X=your chosen ip number ranging from 2-254) 4. Press and hold reset button while turn on / plug power adapter to the router. Wait untill ALL LAN green LED turn on, then release the reset button. 5. Plug the LAN cable from your computer into LAN 1 port then open web browser, and type in the address column : 192.168.1.1 6. Upload the sysupgrade / oem factory image 7. Wait until the router finished flashing (the router will reboot) 8. Set ethernet ip to dhcp 9. Open 192.168.1.1 (for openwrt install) / 192.168.0.1 (for OEM firmware) Signed-off-by: Ari Kurniawan <noobhek@gmail.com> Link: openwrt/openwrt#20035 (cherry picked from commit 7cd10ad) Signed-off-by: Ari Kurniawan <noobhek@gmail.com> Link: openwrt/openwrt#20674 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
1 parent 454fd69 commit 8db7b6f

File tree

3 files changed

+268
-0
lines changed

3 files changed

+268
-0
lines changed
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
// SPDX-License-Identifier: (GPL-2.0 OR MIT)
2+
3+
/dts-v1/;
4+
5+
#include <dt-bindings/leds/common.h>
6+
7+
#include "mt7981.dtsi"
8+
9+
/ {
10+
model = "TOTOLINK X6000R";
11+
compatible = "totolink,x6000r", "mediatek,mt7981";
12+
13+
aliases {
14+
label-mac-device = &gmac0;
15+
led-boot = &led_status;
16+
led-failsafe = &led_status_red;
17+
led-running = &led_status;
18+
led-upgrade = &led_status;
19+
serial0 = &uart0;
20+
};
21+
22+
chosen {
23+
stdout-path = "serial0:115200n8";
24+
};
25+
26+
memory@40000000 {
27+
reg = <0 0x40000000 0 0x10000000>;
28+
device_type = "memory";
29+
};
30+
31+
gpio-keys {
32+
compatible = "gpio-keys";
33+
34+
reset {
35+
label = "reset";
36+
linux,code = <KEY_RESTART>;
37+
gpios = <&pio 0 GPIO_ACTIVE_LOW>;
38+
};
39+
40+
wps {
41+
label = "wps";
42+
linux,code = <KEY_WPS_BUTTON>;
43+
gpios = <&pio 1 GPIO_ACTIVE_LOW>;
44+
};
45+
};
46+
47+
gpio-leds {
48+
compatible = "gpio-leds";
49+
50+
led-0 {
51+
function = LED_FUNCTION_WAN;
52+
color = <LED_COLOR_ID_GREEN>;
53+
gpios = <&pio 8 GPIO_ACTIVE_LOW>;
54+
};
55+
56+
led_status_red: led-1 {
57+
color = <LED_COLOR_ID_RED>;
58+
function = LED_FUNCTION_STATUS;
59+
gpios = <&pio 13 GPIO_ACTIVE_LOW>;
60+
};
61+
62+
led_status: led-2 {
63+
color = <LED_COLOR_ID_BLUE>;
64+
function = LED_FUNCTION_STATUS;
65+
gpios = <&pio 15 GPIO_ACTIVE_LOW>;
66+
default-state = "on";
67+
};
68+
};
69+
};
70+
71+
&uart0 {
72+
status = "okay";
73+
};
74+
75+
&eth {
76+
pinctrl-names = "default";
77+
pinctrl-0 = <&mdio_pins &gbe_led0_pins &gbe_led1_pins>;
78+
status = "okay";
79+
80+
gmac0: mac@0 {
81+
compatible = "mediatek,eth-mac";
82+
reg = <0>;
83+
phy-mode = "2500base-x";
84+
85+
nvmem-cells = <&macaddr_factory_14>;
86+
nvmem-cell-names = "mac-address";
87+
88+
fixed-link {
89+
speed = <2500>;
90+
full-duplex;
91+
pause;
92+
};
93+
};
94+
95+
mac@1 {
96+
compatible = "mediatek,eth-mac";
97+
reg = <1>;
98+
phy-mode = "gmii";
99+
phy-handle = <&int_gbe_phy>;
100+
label = "wan";
101+
102+
nvmem-cells = <&macaddr_factory_1a>;
103+
nvmem-cell-names = "mac-address";
104+
};
105+
};
106+
107+
&mdio_bus {
108+
switch: switch@1f {
109+
compatible = "mediatek,mt7531";
110+
reg = <31>;
111+
reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
112+
interrupt-controller;
113+
#interrupt-cells = <1>;
114+
interrupt-parent = <&pio>;
115+
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
116+
117+
ports {
118+
#address-cells = <1>;
119+
#size-cells = <0>;
120+
121+
port@0 {
122+
reg = <0>;
123+
label = "lan4";
124+
};
125+
126+
port@1 {
127+
reg = <1>;
128+
label = "lan3";
129+
};
130+
131+
port@2 {
132+
reg = <2>;
133+
label = "lan2";
134+
};
135+
136+
port@3 {
137+
reg = <3>;
138+
label = "lan1";
139+
};
140+
141+
port@6 {
142+
reg = <6>;
143+
label = "cpu";
144+
ethernet = <&gmac0>;
145+
phy-mode = "2500base-x";
146+
147+
fixed-link {
148+
speed = <2500>;
149+
full-duplex;
150+
pause;
151+
};
152+
};
153+
};
154+
};
155+
};
156+
157+
&spi2 {
158+
pinctrl-names = "default";
159+
pinctrl-0 = <&spi2_flash_pins>;
160+
status = "okay";
161+
162+
flash@0 {
163+
#address-cells = <1>;
164+
#size-cells = <1>;
165+
166+
compatible = "jedec,spi-nor";
167+
reg = <0>;
168+
169+
spi-max-frequency = <52000000>;
170+
spi-tx-bus-width = <4>;
171+
spi-rx-bus-width = <4>;
172+
173+
partitions {
174+
compatible = "fixed-partitions";
175+
#address-cells = <1>;
176+
#size-cells = <1>;
177+
178+
partition@0 {
179+
label = "BL2";
180+
reg = <0x00000 0x40000>;
181+
read-only;
182+
};
183+
184+
partition@40000 {
185+
label = "u-boot-env";
186+
reg = <0x40000 0x10000>;
187+
read-only;
188+
};
189+
190+
partition@50000 {
191+
label = "Factory";
192+
reg = <0x50000 0xb0000>;
193+
read-only;
194+
195+
nvmem-layout {
196+
compatible = "fixed-layout";
197+
#address-cells = <1>;
198+
#size-cells = <1>;
199+
200+
eeprom_factory_0: eeprom@0 {
201+
reg = <0x0 0x1000>;
202+
};
203+
204+
macaddr_factory_14: macaddr@14 {
205+
reg = <0x14 0x6>;
206+
};
207+
208+
macaddr_factory_1a: macaddr@1a {
209+
reg = <0x1a 0x6>;
210+
};
211+
};
212+
};
213+
214+
partition@100000 {
215+
label = "FIP";
216+
reg = <0x100000 0x80000>;
217+
read-only;
218+
};
219+
220+
partition@180000 {
221+
compatible = "denx,fit";
222+
label = "firmware";
223+
reg = <0x180000 0xe00000>;
224+
};
225+
};
226+
};
227+
};
228+
229+
&pio {
230+
spi2_flash_pins: spi2-pins {
231+
mux {
232+
function = "spi";
233+
groups = "spi2", "spi2_wp_hold";
234+
};
235+
236+
conf-pu {
237+
pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
238+
drive-strength = <MTK_DRIVE_8mA>;
239+
bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
240+
};
241+
242+
conf-pd {
243+
pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
244+
drive-strength = <MTK_DRIVE_8mA>;
245+
bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
246+
};
247+
};
248+
};
249+
250+
&wifi {
251+
status = "okay";
252+
nvmem-cells = <&eeprom_factory_0>;
253+
nvmem-cell-names = "eeprom";
254+
};

target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,9 @@ smartrg,sdg-8733a)
153153
ucidef_set_led_netdev "wan-orange" "WAN" "mdio-bus:08:orange:wan" "wan" "link_100 link_1000"
154154
ucidef_set_led_netdev "wan-white" "WAN" "mdio-bus:08:white:wan" "wan" "link_10000"
155155
;;
156+
totolink,x6000r)
157+
ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
158+
;;
156159
tplink,re6000xd)
157160
ucidef_set_led_netdev "lan-1" "lan-1" "blue:lan-0" "lan1" "link tx rx"
158161
ucidef_set_led_netdev "lan-2" "lan-2" "blue:lan-1" "lan2" "link tx rx"

target/linux/mediatek/image/filogic.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,17 @@ define Device/ruijie_rg-x60-pro
17611761
endef
17621762
TARGET_DEVICES += ruijie_rg-x60-pro
17631763

1764+
define Device/totolink_x6000r
1765+
DEVICE_VENDOR := TOTOLINK
1766+
DEVICE_MODEL := X6000R
1767+
DEVICE_DTS := mt7981b-totolink-x6000r
1768+
DEVICE_DTS_DIR := ../dts
1769+
IMAGES := sysupgrade.bin
1770+
IMAGE_SIZE := 14336k
1771+
DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
1772+
endef
1773+
TARGET_DEVICES += totolink_x6000r
1774+
17641775
define Device/tplink_archer-ax80-v1
17651776
DEVICE_VENDOR := TP-Link
17661777
DEVICE_MODEL := Archer AX80V1

0 commit comments

Comments
 (0)