]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: filogic: add support for Totolink X6000R 20035/head
authorAri Kurniawan <noobhek@gmail.com>
Mon, 15 Sep 2025 13:13:29 +0000 (20:13 +0700)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 21 Sep 2025 13:49:15 +0000 (15:49 +0200)
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: https://github.com/openwrt/openwrt/pull/20035
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7981b-totolink-x6000r.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7981b-totolink-x6000r.dts b/target/linux/mediatek/dts/mt7981b-totolink-x6000r.dts
new file mode 100644 (file)
index 0000000..aebb3b9
--- /dev/null
@@ -0,0 +1,254 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+
+#include "mt7981b.dtsi"
+
+/ {
+       model = "TOTOLINK X6000R";
+       compatible = "totolink,x6000r", "mediatek,mt7981";
+
+       aliases {
+               label-mac-device = &gmac0;
+               led-boot = &led_status;
+               led-failsafe = &led_status_red;
+               led-running = &led_status;
+               led-upgrade = &led_status;
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+               
+       memory@40000000 {
+               reg = <0 0x40000000 0 0x10000000>;
+               device_type = "memory";
+       };
+       
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "reset";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "wps";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       gpio-leds {
+               compatible = "gpio-leds";
+
+               led-0 {
+                       function = LED_FUNCTION_WAN;
+                       color = <LED_COLOR_ID_GREEN>;
+                       gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+               };
+
+               led_status_red: led-1 {
+                       color = <LED_COLOR_ID_RED>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               led_status: led-2 {
+                       color = <LED_COLOR_ID_BLUE>;
+                       function = LED_FUNCTION_STATUS;
+                       gpios = <&pio 15 GPIO_ACTIVE_LOW>;
+                       default-state = "on";
+               };
+       };
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&eth {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mdio_pins &gbe_led0_pins &gbe_led1_pins>;
+       status = "okay";
+
+       gmac0: mac@0 {
+               compatible = "mediatek,eth-mac";
+               reg = <0>;
+               phy-mode = "2500base-x";
+
+               nvmem-cells = <&macaddr_factory_14>;
+               nvmem-cell-names = "mac-address";
+               
+               fixed-link {
+                       speed = <2500>;
+                       full-duplex;
+                       pause;
+               };
+       };
+
+       mac@1 {
+               compatible = "mediatek,eth-mac";
+               reg = <1>;
+               phy-mode = "gmii";
+               phy-handle = <&int_gbe_phy>;
+               label = "wan";
+
+               nvmem-cells = <&macaddr_factory_1a>;
+               nvmem-cell-names = "mac-address";
+       };
+};
+
+&mdio_bus {
+       switch: switch@1f {
+               compatible = "mediatek,mt7531";
+               reg = <31>;
+               reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+               interrupt-controller;
+               #interrupt-cells = <1>;
+               interrupt-parent = <&pio>;
+               interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+
+               ports {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       port@0 {
+                               reg = <0>;
+                               label = "lan4";
+                       };
+
+                       port@1 {
+                               reg = <1>;
+                               label = "lan3";
+                       };
+
+                       port@2 {
+                               reg = <2>;
+                               label = "lan2";
+                       };
+
+                       port@3 {
+                               reg = <3>;
+                               label = "lan1";
+                       };
+                       
+                       port@6 {
+                               reg = <6>;
+                               label = "cpu";
+                               ethernet = <&gmac0>;
+                               phy-mode = "2500base-x";
+
+                               fixed-link {
+                                       speed = <2500>;
+                                       full-duplex;
+                                       pause;
+                               };
+                       };
+               };
+       };
+};
+
+&spi2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi2_flash_pins>;
+       status = "okay";
+
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+
+               spi-max-frequency = <52000000>;
+               spi-tx-bus-width = <4>;
+               spi-rx-bus-width = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "BL2";
+                               reg = <0x00000 0x40000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               label = "u-boot-env";
+                               reg = <0x40000 0x10000>;
+                               read-only;
+                       };
+
+                       partition@50000 {
+                               label = "Factory";
+                               reg = <0x50000 0xb0000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x1000>;
+                                       };
+
+                                       macaddr_factory_14: macaddr@14 {
+                                               reg = <0x14 0x6>;
+                                       };
+
+                                       macaddr_factory_1a: macaddr@1a {
+                                               reg = <0x1a 0x6>;
+                                       };
+                               };
+                       };
+
+                       partition@100000 {
+                               label = "FIP";
+                               reg = <0x100000 0x80000>;
+                               read-only;
+                       };
+
+                       partition@180000 {
+                               compatible = "denx,fit";
+                               label = "firmware";
+                               reg = <0x180000 0xe00000>;
+                       };
+               };
+       };
+};
+
+&pio {
+       spi2_flash_pins: spi2-pins {
+               mux {
+                       function = "spi";
+                       groups = "spi2", "spi2_wp_hold";
+               };
+
+               conf-pu {
+                       pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+                       drive-strength = <MTK_DRIVE_8mA>;
+                       bias-pull-up = <MTK_PUPD_SET_R1R0_11>;
+               };
+
+               conf-pd {
+                       pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+                       drive-strength = <MTK_DRIVE_8mA>;
+                       bias-pull-down = <MTK_PUPD_SET_R1R0_11>;
+               };
+       };
+};
+
+&wifi {
+       status = "okay";
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
+};
index 203f460aa21cc4710c4756c14b2178e58d25b535..7e4512f30f86526a668b6ec6a4f10ca6fbdcc243 100644 (file)
@@ -207,6 +207,9 @@ teltonika,rutc50)
        ucidef_set_led_netdev "wan-green" "WAN" "mdio-bus:00:green:wan" "wan" "link_1000 tx rx"
        ucidef_set_led_netdev "wan-amber" "WAN" "mdio-bus:00:amber:wan" "wan" "link_100 link_10 tx rx"
        ;;
+totolink,x6000r)
+       ucidef_set_led_netdev "wan" "wan" "green:wan" "wan" "link tx rx"
+       ;;
 tplink,fr365-v1)
        ucidef_set_led_netdev "port2-green-act" "port-2" "green:port2_act" "port2" "link tx rx"
        ucidef_set_led_netdev "port1-green-act" "port-1" "green:sfp" "port1" "link tx rx"
index b97586e0948eb00278273ef85a654bc59b7372ef..6cd12bc3004132ba38a7803ab60ebd4859735aef 100644 (file)
@@ -2012,6 +2012,17 @@ define Device/tenbay_wr3000k
 endef
 TARGET_DEVICES += tenbay_wr3000k
 
+define Device/totolink_x6000r
+  DEVICE_VENDOR := TOTOLINK
+  DEVICE_MODEL := X6000R
+  DEVICE_DTS := mt7981b-totolink-x6000r
+  DEVICE_DTS_DIR := ../dts
+  IMAGES := sysupgrade.bin
+  IMAGE_SIZE := 14336k
+  DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware
+endef
+TARGET_DEVICES += totolink_x6000r
+
 define Device/tplink_archer-ax80-v1
   DEVICE_VENDOR := TP-Link
   DEVICE_MODEL := Archer AX80V1