]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
mediatek: Add support for Acer Predator Connect W6x 19754/head
authorQing W <ses1er@gmail.com>
Thu, 21 Aug 2025 22:55:42 +0000 (18:55 -0400)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 23 Aug 2025 21:42:12 +0000 (23:42 +0200)
Product name: Acer Predator Connect W6x
link: https://www.acer.com/us-en/predator/networking/wi-fi/predator-connect-w6x/pdp/FF.G2TTA.001
* Specifications:

SOC: MT7986AV
RAM: 1024MB
Flash: 256 MB SPI NAND
Ports: 4 LAN (1G) & 1 WAN (2.5G)
WIFI: MT7976GN + MT7976AN
LED: 1, ws2812b controller

* Installation via UART:

1. Configure TFTP server with IP 192.168.1.66. Copy `openwrt-mediatek-filogic-acer_predator-w6x-initramfs-kernel.bin` to TFTP root and rename to `predator.bin`
2. Interrupt boot by pressing 0 on startup or select `U-Boot Console` in U-Boot Boot Menu.
3. Run setenv `serverip 192.168.1.66; setenv ipaddr 192.168.1.1; tftpboot 0x46000000 predator.bin; fdt addr $(fdtcontroladdr); fdt rm /signature; bootm` in uboot console.
4. Wait for boot complete on Openwrt initramfs env.

** You can back up the MTD partitions at this point. Refer to Backup Instructions section.

5. On client PC, transfer `openwrt-mediatek-filogic-acer_predator-w6x-squashfs-sysupgrade.bin` to /tmp/ - `scp -O openwrt-mediatek-filogic-acer_predator-w6x-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/sysupgrade.bin`
6. On router, run sysupgrade - `sysupgrade -n /tmp/sysupgrade.bin`
Should now boot to Openwrt. Ensure it boots automatically to Openwrt by replugging the power.

* Backup Instructions:

Layout from stock firmware:
```
[    0.968731] Creating 10 MTD partitions on "nmbm_spim_nand":
[    0.974297] 0x000000000000-0x000000100000 : "BL2"
[    0.979424] 0x000000100000-0x000000180000 : "u-boot-env"
[    0.985032] 0x000000180000-0x000000380000 : "Factory"
[    0.990379] 0x000000380000-0x000000580000 : "FIP"
[    0.995378] 0x000000580000-0x000000600000 : "prod"
[    1.000461] 0x000000600000-0x000000700000 : "dual"
[    1.005527] 0x000000700000-0x000000800000 : "pot"
[    1.010516] 0x000000800000-0x000006c00000 : "ubi"
[    1.015626] 0x000006c00000-0x00000d000000 : "ubi1"
[    1.020801] 0x00000d000000-0x00000d800000 : "storage"
```

Mapping in initramfs env:
```
dev:    size   erasesize  name
mtd0: 00100000 00020000 "bl2"
mtd1: 00080000 00020000 "u-boot-env"
mtd2: 00200000 00020000 "factory"
mtd3: 00200000 00020000 "fip"
mtd4: 00020000 00020000 "prod"
mtd5: 00100000 00020000 "dual"
mtd6: 00100000 00020000 "pot"
mtd7: 06400000 00020000 "ubi"
mtd8: 06400000 00020000 "ubi1"
mtd9: 00800000 00020000 "storage"
```
1. While in openwrt initramfs environment, back up all the partitions by running the following:
```
cat /dev/mtd0 > /tmp/bl2.bin
cat /dev/mtd1 > /tmp/u-boot-env.bin
cat /dev/mtd2 > /tmp/factgory.bin
cat /dev/mtd3 > /tmp/fip.bin
cat /dev/mtd4 > /tmp/prod.bin
cat /dev/mtd5 > /tmp/dual.bin
cat /dev/mtd6 > /tmp/pot.bin
cat /dev/mtd7 > /tmp/ubi.bin
cat /dev/mtd8 > /tmp/ubi1.bin
cat /dev/mtd9 > /tmp/storage.bin
```
2. Transfer files to client PC for safekeeping. On client PC, run `scp -O root@192.168.1.1:/tmp/*.bin ./`

* Restore to Stock Firmware:

1. Boot to openwrt initramfs env.
2. Confirm layout matches as follows by running `cat /proc/mtd`. Ensure dev `mtd7` is named `ubi`:
```
dev:    size   erasesize  name
mtd0: 00100000 00020000 "bl2"
mtd1: 00080000 00020000 "u-boot-env"
mtd2: 00200000 00020000 "factory"
mtd3: 00200000 00020000 "fip"
mtd4: 00020000 00020000 "prod"
mtd5: 00100000 00020000 "dual"
mtd6: 00100000 00020000 "pot"
mtd7: 06400000 00020000 "ubi"
mtd8: 06400000 00020000 "ubi1"
mtd9: 00800000 00020000 "storage"
```
3. Detach `ubi` partition - `ubidetach -p /dev/mtd7`
4. Transfer stock firmware's `ubi.bin` to router from client PC: `scp -O ubi.bin root@192.168.1.1/tmp/`
5. Format and replace with backup `ubiformat /dev/mtd7 -y -f /tmp/ubi.bin`
6. Reboot and you should now be back on stock firmware.

* LEDS:
LED color can be controlled by specifying values in GRB format in `/sys/class/leds/rgb:status/multi_intensity`. Default is `255 255 255` (white).
Example: `echo '75 0 130' > /sys/class/leds/rgb:status/multi_intensity`

LED brightness can be changed by specifying the value from 0-255 in /sys/class/leds/rgb:status/brightness. Default is `255` (full brightness).
Example: `echo 100 > /sys/class/leds/rgb:status/brightness`

For persistence across reboots, put the relevant command(s) in /etc/rc.local.

* Notes:

root access on stock firmware:
Before flashing openwrt, and while in openwrt initramfs env:
1. Mount /dev/ubi0_2: `mkdir /tmp/ubi0_2; mount -t ubifs /dev/ubi0_2 /tmp/ubi0_2`
2. Modify `/tmp/ubi0_2/upper/etc/passwd` and change line with `root:x:0:0...` to `root::0:0...`, remove the `x`.
3. Save and reboot.
4. You should now be able to log in with root and empty password while booted in stock firmware.

While on Openwrt, subsequent upgrades can be made by sysupgrade, or via Luci. UART should not be necessary unless you want to revert to stock firmeware.

Signed-off-by: Qing W <ses1er@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19754
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dts [new file with mode: 0644]
target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
target/linux/mediatek/filogic/base-files/etc/board.d/02_network
target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
target/linux/mediatek/filogic/base-files/lib/preinit/10_fix_eth_mac.sh
target/linux/mediatek/image/filogic.mk

diff --git a/target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dts b/target/linux/mediatek/dts/mt7986a-acer-predator-w6x.dts
new file mode 100644 (file)
index 0000000..d46497e
--- /dev/null
@@ -0,0 +1,352 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+#include "mt7986a.dtsi"
+
+/ {
+       model = "Acer Predator Connect W6x";
+       compatible = "acer,predator-w6x", "mediatek,mt7986a";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+    chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       memory@0 {
+               reg = <0 0x40000000 0 0x20000000>;
+       };
+
+       reg_1p8v: regulator-1p8v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-1.8V";
+               regulator-min-microvolt = <1800000>;
+               regulator-max-microvolt = <1800000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       reg_3p3v: regulator-3p3v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-3.3V";
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       reg_5v: regulator-5v {
+               compatible = "regulator-fixed";
+               regulator-name = "fixed-5V";
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
+               regulator-always-on;
+       };
+
+       gpio-keys {
+               compatible = "gpio-keys";
+
+               factory {
+                       label = "factory";
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+               };
+
+               wps {
+                       label = "wps";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&pio 10 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&crypto {
+       status = "okay";
+};
+
+&eth {
+       status = "okay";
+
+       gmac0: mac@0 {
+               compatible = "mediatek,eth-mac";
+               reg = <0>;
+               phy-mode = "2500base-x";
+
+               fixed-link {
+                       speed = <2500>;
+                       full-duplex;
+                       pause;
+               };
+       };
+       gmac1: mac@1 {
+               compatible = "mediatek,eth-mac";
+               reg = <1>;
+               phy-mode = "2500base-x";
+               phy-handle = <&phy6>;
+       };
+
+       mdio-bus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               switch@1f {
+                       compatible = "mediatek,mt7531";
+                       reg = <31>;
+                       reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
+                       reset-assert-us = <10000>;
+                       reset-deassert-us = <10000>;
+
+                       ports {
+                               #address-cells = <1>;
+                               #size-cells = <0>;
+
+                               port@1 {
+                                       reg = <1>;
+                                       label = "lan1";
+                               };
+
+                               port@2 {
+                                       reg = <2>;
+                                       label = "lan2";
+                               };
+
+                               port@3 {
+                                       reg = <3>;
+                                       label = "lan3";
+                               };
+
+                               port@4 {
+                                       reg = <4>;
+                                       label = "lan4";
+                               };
+
+                               port@6 {
+                                       reg = <6>;
+                                       label = "cpu";
+                                       ethernet = <&gmac0>;
+                                       phy-mode = "2500base-x";
+
+                                       fixed-link {
+                                               speed = <2500>;
+                                               full-duplex;
+                                               pause;
+                                       };
+                               };
+                       };
+               };
+
+               phy6: phy@6 {
+                       compatible = "ethernet-phy-ieee802.3-c45";
+                       reg = <6>;
+
+               };
+       };
+};
+
+&pio {
+       spi_flash_pins: spi-flash-pins-33-to-38 {
+               mux {
+                       function = "spi";
+                       groups = "spi0", "spi0_wp_hold";
+               };
+               conf-pu {
+                       pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP";
+                       drive-strength = <8>;
+                       mediatek,pull-up-adv = <0>; /* bias-disable */
+               };
+               conf-pd {
+                       pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO";
+                       drive-strength = <8>;
+                       mediatek,pull-down-adv = <0>; /* bias-disable */
+               };
+       };
+
+       spi_led_pins: spic-pins-29-to-32 {
+               mux {
+                       function = "spi";
+                       groups = "spi1_2";
+               };
+       };
+
+       wf_2g_5g_pins: wf_2g_5g-pins {
+               mux {
+                       function = "wifi";
+                       groups = "wf_2g", "wf_5g";
+               };
+               conf {
+                       pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+                                  "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+                                  "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+                                  "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+                                  "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+                                  "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+                                  "WF1_TOP_CLK", "WF1_TOP_DATA";
+                       drive-strength = <4>;
+               };
+       };
+
+       wf_dbdc_pins: wf-dbdc-pins {
+               mux {
+                       function = "wifi";
+                       groups = "wf_dbdc";
+               };
+               conf {
+                       pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
+                               "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
+                               "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
+                               "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
+                               "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
+                               "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
+                               "WF1_TOP_CLK", "WF1_TOP_DATA";
+                       drive-strength = <4>;
+               };
+       };
+};
+
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_flash_pins>;
+       status = "okay";
+
+       spi_nand@0 {
+               compatible = "spi-nand";
+               #address-cells = <1>;
+               #size-cells = <1>;
+               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 = <0x0 0x100000>;
+                               read-only;
+                       };
+
+                       partition@100000 {
+                               label = "u-boot-env";
+                               reg = <0x100000 0x80000>;
+                       };
+
+                       partition@180000 {
+                               label = "factory";
+                               reg = <0x180000 0x200000>;
+                               read-only;
+
+                               nvmem-layout {
+                                       compatible = "fixed-layout";
+                                       #address-cells = <1>;
+                                       #size-cells = <1>;
+
+                                       eeprom_factory_0: eeprom@0 {
+                                               reg = <0x0 0x1000>;
+                                       };
+                               };
+                       };
+
+                       partition@380000 {
+                               label = "fip";
+                               reg = <0x380000 0x200000>;
+                               read-only;
+                       };
+
+                       partition@580000 {
+                               label = "prod";
+                               reg = <0x580000 0x20000>;
+                               read-only;
+                       };
+
+                       partition@600000 {
+                               label = "dual";
+                               reg = <0x600000 0x100000>;
+                               read-only;
+                       };
+
+                       partition@700000 {
+                               label = "pot";
+                               reg = <0x700000 0x100000>;
+                               read-only;
+                       };
+
+                       partition@800000 {
+                               label = "ubi";
+                               reg = <0x800000 0x6400000>;
+                       };
+
+                       partition@6C00000 {
+                               label = "ubi1";
+                               reg = <0x6C00000 0x6400000>;
+                       };
+
+                       partition@D000000 {
+                               label = "storage";
+                               reg = <0xD000000 0x800000>;
+                       };
+               };
+       };
+};
+
+&spi1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi_led_pins>;
+       status = "okay";
+
+       ws2812b@0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "worldsemi,ws2812b";
+               reg = <0>;
+               spi-max-frequency = <3000000>;
+
+               led_status_rgb: led@0 {
+                       reg = <0>;
+                       function = LED_FUNCTION_STATUS;
+                       color = <LED_COLOR_ID_RGB>;
+                       color-index = <LED_COLOR_ID_RED LED_COLOR_ID_GREEN LED_COLOR_ID_BLUE>;
+               };
+       };
+};
+
+&ssusb {
+       vusb33-supply = <&reg_3p3v>;
+       vbus-supply = <&reg_5v>;
+       status = "okay";
+};
+
+&trng {
+       status = "okay";
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb_phy {
+       status = "okay";
+};
+
+&watchdog {
+       status = "okay";
+};
+
+&wifi {
+       nvmem-cells = <&eeprom_factory_0>;
+       nvmem-cell-names = "eeprom";
+       pinctrl-names = "default", "dbdc";
+       pinctrl-0 = <&wf_2g_5g_pins>;
+       pinctrl-1 = <&wf_dbdc_pins>;
+       status = "okay";
+};
index 62a01612862b31b08d6556fd203b4d43e62438a0..f2b773636cfb208bb1541aba491e6469f676cb5f 100644 (file)
@@ -16,6 +16,9 @@ acer,predator-w6d)
        ucidef_set_led_netdev "internet" "INTERNET" "mdio-bus:06:amber:wan" "eth1" "link_10 link_100 link_1000 tx rx"
        ucidef_set_led_netdev "internet" "INTERNET" "mdio-bus:06:green:wan" "eth1" "link_2500 tx rx"
        ;;
+acer,predator-w6x)
+       ucidef_set_led_netdev "wan" "wan" "rgb:status" "eth1"
+       ;;
 asus,rt-ax52|\
 snr,snr-cpe-ax2)
        ucidef_set_led_netdev "wan" "wan" "blue:wan" "wan" "link tx rx"
index 64efde9155df6abeae421b2dec7f888327f2f2b4..c5709f74f4d013401778a4f4183232c6b22cf48c 100644 (file)
@@ -25,6 +25,9 @@ mediatek_setup_interfaces()
        acer,predator-w6d)
                ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1
                ;;
+       acer,predator-w6x)
+               ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
+               ;;
        acer,vero-w6m)
                ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" internet
                ;;
@@ -179,6 +182,11 @@ mediatek_setup_macs()
                wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
                lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)
                ;;
+       acer,predator-w6x)
+               wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
+               lan_mac=$(macaddr_add "$wan_mac" 1)
+               label_mac=$wan_mac
+               ;;
        bananapi,bpi-r3|\
        bananapi,bpi-r3-mini|\
        bananapi,bpi-r4)
index 02ae06a4ab0a1eb14614cfe83c686853b573c981..e54056d165d35e77657534be753b12881a31fd78 100644 (file)
@@ -27,6 +27,11 @@ case "$board" in
                [ "$PHYNBR" = "0" ] && mmc_get_mac_ascii u-boot-env 2gMAC > /sys${DEVPATH}/macaddress
                [ "$PHYNBR" = "1" ] && mmc_get_mac_ascii u-boot-env 5gMAC > /sys${DEVPATH}/macaddress
                ;;
+       acer,predator-w6x)
+               hw_mac_addr="$(mtd_get_mac_ascii u-boot-env ethaddr)"
+               [ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
+               [ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
+               ;;
        asus,rt-ax59u)
                CI_UBIPART="UBI_DEV"
                addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
index 5b9e5bd7ad79bdd5dda732a8a74527b977219692..f5032a2a369fc3ce997c261b31bd5b4118a920ae 100644 (file)
@@ -12,6 +12,15 @@ preinit_set_mac_address() {
                ip link set dev game address "$lan_mac"
                ip link set dev eth1 address "$wan_mac"
                ;;
+       acer,predator-w6x)
+               wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
+               lan_mac=$(macaddr_add "$wan_mac" 1)
+               ip link set dev lan1 address "$lan_mac"
+               ip link set dev lan2 address "$lan_mac"
+               ip link set dev lan3 address "$lan_mac"
+               ip link set dev lan4 address "$lan_mac"
+               ip link set dev eth1 address "$wan_mac"
+               ;;
        acer,vero-w6m)
                wan_mac=$(mmc_get_mac_ascii u-boot-env WANMAC)
                lan_mac=$(mmc_get_mac_ascii u-boot-env LANMAC)
index b1c3398014f60de874fa0f0a8dda5d9dfa64a2ea..434ae115761ba2cda9508f66c678684cdc6c84b2 100644 (file)
@@ -191,6 +191,23 @@ define Device/acer_predator-w6d
 endef
 TARGET_DEVICES += acer_predator-w6d
 
+define Device/acer_predator-w6x
+  DEVICE_VENDOR := Acer
+  DEVICE_MODEL := Predator Connect W6x
+  DEVICE_DTS := mt7986a-acer-predator-w6x
+  DEVICE_DTS_DIR := ../dts
+  DEVICE_DTS_LOADADDR := 0x47000000
+  KERNEL_IN_UBI := 1
+  UBOOTENV_IN_UBI := 1
+  DEVICE_PACKAGES := kmod-usb3 kmod-leds-ws2812b kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware
+  IMAGES := sysupgrade.bin
+  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  KERNEL_INITRAMFS := kernel-bin | lzma | \
+       fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += acer_predator-w6x
+
 define Device/acer_vero-w6m
   DEVICE_VENDOR := Acer
   DEVICE_MODEL := Connect Vero W6m