Skip to content

Commit

Permalink
mediatek: add support for Acer Predator W6
Browse files Browse the repository at this point in the history
Hardware
--------
SOC:   MediaTek MT7986A
RAM:   1GB DDR4
FLASH: 4GB eMMC
WiFi:  2x2 2.4 GHz 802.11 b/g/n/ax MT7916 DBDC
       4x4 5 GHz   802.11 a/n/ac/ax MT7986
       2x2 6 GHz   802.11ax MT7916 DBDC
ETH:   4x LAN 1Gbit/s (MT7531)
       1x WAN 2.5Gbit/s (GPY211)
BTN:   RESET, WPS
LED:   Antenna LEDs (GPIO)
       Mood-LED (Kinetic KTD2601) - unsupported
UART:  Header nest to USB port - 3V3 115200 8N1
       [BUTTON] GND - RX - TX [USB]

Installation
------------

1. Connect to the device using serial console.

2. Interrupt the Autoboot process when promted by sending '0' twice.

3. Serve the OpenWrt initramfs image using TFTP at 192.168.1.66. Name
   the image "predator.bin" and conenct the TFTP server to the routers
   LAN port.

4. Configure U-Boot to allow loading unsigned images from MMC

   $ setenv bootcmd 'mmc read 0x40000000 0x00004400 0x0010000;
     fdt addr $(fdtcontroladdr); fdt rm /signature; bootm 0x40000000';
     saveenv

5. Transfer the image from U-Boot

   $ setenv serverip 192.168.1.66; setenv ipaddr 192.168.1.1;
     tftpboot 0x46000000 predator.bin; fdt addr $(fdtcontroladdr);
     fdt rm /signature; bootm

6. Wait for OpenWrt to boot

7. Transfer the OpenWrt sysupgrade image to the router using scp.

8. Install OpenWrt using sysupgrade.

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Aug 5, 2023
1 parent 881235c commit 7e7eb53
Show file tree
Hide file tree
Showing 8 changed files with 579 additions and 0 deletions.
503 changes: 503 additions & 0 deletions target/linux/mediatek/dts/mt7986a-acer-predator-w6.dts

Large diffs are not rendered by default.

Expand Up @@ -8,6 +8,9 @@ mediatek_setup_interfaces()
local board="$1"

case $board in
acer,predator-w6)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 game" eth1
;;
asus,tuf-ax4200)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" eth1
;;
Expand Down
Expand Up @@ -7,6 +7,20 @@
board=$(board_name)

case "$FIRMWARE" in
"mediatek/mt7916_eeprom.bin")
case "$board" in
acer,predator-w6)
caldata_extract_mmc "factory" 0xA0000 0x1000
;;
esac
;;
"mediatek/mt7986_eeprom_mt7976.bin")
case "$board" in
acer,predator-w6)
caldata_extract_mmc "factory" 0x0 0x1000
;;
esac
;;
"mediatek/mt7986_eeprom_mt7976_dbdc.bin")
case "$board" in
asus,tuf-ax4200)
Expand Down
Expand Up @@ -10,6 +10,12 @@ PHYNBR=${DEVPATH##*/phy}
board=$(board_name)

case "$board" in
acer,predator-w6)
key_path="/var/qcidata/data"
[ "$PHYNBR" = "0" ] && cat $key_path/2gMAC > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "1" ] && cat $key_path/6gMAC > /sys${DEVPATH}/macaddress
[ "$PHYNBR" = "2" ] && cat $key_path/5gMAC > /sys${DEVPATH}/macaddress
;;
asus,tuf-ax4200)
CI_UBIPART="UBI_DEV"
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
Expand Down
@@ -0,0 +1,25 @@
. /lib/functions/system.sh

predator_w6_factory_extract() {
local mmc_part

mmc_part="$(find_mmc_part qcidata)"

mkdir -p /var/qcidata/data
mkdir -p /var/qcidata/mount

mount -r "$mmc_part" /var/qcidata/mount

cp /var/qcidata/mount/factory/*MAC "/var/qcidata/data/"
umount "/var/qcidata/mount"
}

preinit_extract_factory() {
case $(board_name) in
acer,predator-w6)
predator_w6_factory_extract
;;
esac
}

boot_hook_add preinit_main preinit_extract_factory
Expand Up @@ -2,6 +2,14 @@

preinit_set_mac_address() {
case $(board_name) in
acer,predator-w6)
key_path="/var/qcidata/data"
ip link set dev lan1 address "$(cat $key_path/LANMAC)"
ip link set dev lan2 address "$(cat $key_path/LANMAC)"
ip link set dev lan3 address "$(cat $key_path/LANMAC)"
ip link set dev game address "$(cat $key_path/LANMAC)"
ip link set dev eth1 address "$(cat $key_path/WANMAC)"
;;
asus,tuf-ax4200)
CI_UBIPART="UBI_DEV"
addr=$(mtd_get_mac_binary_ubi "Factory" 0x4)
Expand Down
Expand Up @@ -51,6 +51,11 @@ platform_do_upgrade() {
local board=$(board_name)

case "$board" in
acer,predator-w6)
CI_KERNPART="kernel"
CI_ROOTPART="rootfs"
emmc_do_upgrade "$1"
;;
asus,tuf-ax4200)
CI_UBIPART="UBI_DEV"
CI_KERNPART="linux"
Expand Down
15 changes: 15 additions & 0 deletions target/linux/mediatek/image/filogic.mk
Expand Up @@ -98,6 +98,21 @@ define Device/asus_tuf-ax4200
endef
TARGET_DEVICES += asus_tuf-ax4200

define Device/acer_predator-w6
DEVICE_VENDOR := Acer
DEVICE_MODEL := Predator W6
DEVICE_DTS := mt7986a-acer-predator-w6
DEVICE_DTS_DIR := ../dts
DEVICE_DTS_LOADADDR := 0x47000000
DEVICE_PACKAGES := kmod-usb3 kmod-mt7986-firmware kmod-mt7916-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-w6

define Device/bananapi_bpi-r3
DEVICE_VENDOR := Bananapi
DEVICE_MODEL := BPi-R3
Expand Down

0 comments on commit 7e7eb53

Please sign in to comment.