Adding OpenWrt support for Archer A6 v3

It probably doesn't have a device-tree binary, but even if it does, decompiling it is a pain and it is not necessary or useful anyway.

what you need to do is:

  • find the models of the SOC chip and wireless interface chip
  • find a DTS file in the openwrt project that is "close enough"
  • copy that DTS and remove all device specific things (leds, keys, etc.)
  • build a ramdisk image and load it using serial console + TFTP

from there you can gather more information and fix whatever has errors in the kernel

The pictures are nice so far, but not of the SOC

it looks like the processor is under the aluminum heatsink

Yes processor is with Aluminium heaksink, can feel the heat. Flash size seems to be 16MB.

Trying with re650-v1 example posted earlier, couldn't understand how to update tp-link-safeloader.c, any documentation to refer to?

Also how to identify LED setting?

define Device/tplink_archera6-v3
  $(Device/dsa-migration)
  $(Device/tplink-safeloader)
  DEVICE_MODEL := ArcherA6
  DEVICE_VARIANT := v3
  DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2
  TPLINK_BOARD_ID := ArcherA6-V3
  IMAGE_SIZE := 6016k
  SUPPORTED_DEVICES += archera6-v3
endef
TARGET_DEVICES += tplink_archera6-v3

Built the kernel, looks uimage is missing, got openwrt-ramips-mt7621-tplink_archera6-v3-squashfs-factory.bin

how to test in safe way? TFTP is first preferred method to boot to check issues right?

So what is the processor? If you don't know, remove the aluminum heatsink to see....

I don't know where to get the IDs for tp-link-safeloader.c
this is the last step
LEDs is also one of the last steps

first thing you need is an initramfs-kernel.bin
use make menuconfig to select Target Images --> ramdisk
then load with TFTP using the serial console NOT the reset button

you will not get a "uimage" at the end, it will be:

initramfs-kernel.bin
factory.bin
sysupgrade.bin

AFAIK not supported yet, but is similar to mt7615

I also think it is kind of similar to mt7615, but software engineer from Mediatek said that I should apply mt7663 drivers to work with mt7613 :man_shrugging:

CPU is MT7621

system type             : MT7621
machine                 : Unknown
processor               : 0
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 574.46
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VPE                     : 0
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 1
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 574.46
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 0
VPE                     : 1
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 2
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 574.46
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 1
VPE                     : 0
VCED exceptions         : not available
VCEI exceptions         : not available

processor               : 3
cpu model               : MIPS 1004Kc V2.15
BogoMIPS                : 574.46
wait instruction        : yes
microsecond timers      : yes
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 4, address/irw mask: [0x0ffc, 0x0ffc, 0x0ffb, 0x0ffb]
isa                     : mips1 mips2 mips32r1 mips32r2
ASEs implemented        : mips16 dsp mt
shadow register sets    : 1
kscratch registers      : 0
core                    : 1
VPE                     : 1
VCED exceptions         : not available
VCEI exceptions         : not available


Getting error, while trying the initramfs tftpboot
Bad Magic Number,01000000

tried running mktplinkfw2 on uimage partition dump of original FW. It is reporting header is not v2/v3.
Not sure how to proceed further.

Tell us what you're doing exactly, or post both the commands and the result together

Yes, it is similar to mt7615 but much more similar to mt7613.

Something like mt7612 and mt7602 is here with mt7663 and mt7613

Setup the TFTP server @192.168.0.5. No switch in-between.

Copied the initramfs.bin file generated form Linux build to TFTP folder and named it as as test.bin. Router expects boot file as test.bin.

Then ran following commands form u-boot command prompt:

tftpboot
bootm

@lukasz92 @arktrin Yes, everything here is supported, and MT76x3 use the same driver, see this commit

1 Like

@vrpatil SHOW YOUR LOGS, very hard to help you otherwise

so did it work or no?

bootm command requires you to put the load address from tftpboot, but because you don't share your output, I have no idea what it is. It might be
bootm 0x81000000

also if it doesn't work, you can try to make tftpboot load it at a different address
tftpboot 0x80800000
bootm 0x80800000

Thanks! Sounds inspiring :grinning:


MT7621 # tftpboot

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying Eth0 (10/100-M)

 ETH_STATE_ACTIVE!!
*** Warning: no boot file name; using 'test.bin'
TFTP from server 192.168.0.5; our IP address is 192.168.0.1
Filename 'test.bin'.

 TIMEOUT_COUNT=10,Load address: 0x84000000
Loading: checksum bad
checksum bad
T T T T T T T checksum bad
checksum bad
T Got ARP REPLY, set server/gtwy eth addr (a4:ba:db:b2:5c:08)
Got it
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ########
done
Bytes transferred = 5031914 (4cc7ea hex)
LoadAddr=84000000 NetBootFileXferSize= 004cc7ea
MT7621 # bootm
## Booting image at 84000000 ...
Bad Magic Number,01000000
MT7621 #

Tried with loading at 0x80800000, same as above.

MT7621 # tftpboot 0x80800000

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying Eth0 (10/100-M)

 ETH_STATE_ACTIVE!!
*** Warning: no boot file name; using 'test.bin'
TFTP from server 192.168.0.5; our IP address is 192.168.0.1
Filename 'test.bin'.

 TIMEOUT_COUNT=10,Load address: 0x80800000
Loading: Got ARP REQUEST, return our IP
Got ARP REQUEST, return our IP
Got ARP REQUEST, return our IP
Got ARP REPLY, set server/gtwy eth addr (a4:ba:db:b2:5c:08)
Got it
#################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ########
done
Bytes transferred = 5031914 (4cc7ea hex)
LoadAddr=80800000 NetBootFileXferSize= 004cc7ea
MT7621 # bootm 0x80800000
## Booting image at 80800000 ...
Bad Magic Number,01000000

can you show us result of the command printenv?

Here it goes

MT7621 # printenv
bootargs=console=ttyS1,115200 root=/dev/mtdblock2 rootfstype=squashfs init=/etc/preinit mtdparts=raspi:256k(uboot),2048k(uImage),14016k@0x240000(rootfs),64k@0xff0000(ART) mem=128M
bootcmd=tftp
bootdelay=0x1
baudrate=115200
ethaddr="00:00:00:00:00:00"
ipaddr=192.168.0.1
serverip=192.168.0.5
stdin=serial
stdout=serial
stderr=serial

Environment size: 332/4092 bytes



Did you get anywhere with booting?

I did some work on this back in July, but run into a couple of issues which I don't have the time to fix:

  1. When booting from the SPI flash, the mt7530 bus fails on probe with reset timeout. This doesn't happen when booting with initramfs image.
root@OpenWrt:/# dmesg |grep mt7530
[    0.723634] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module
[    0.771977] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module
[    1.781927] mt7530 mdio-bus:1f: reset timeout
[    1.786342] mt7530: probe of mdio-bus:1f failed with error -145
root@OpenWrt:/# 

Booting with initramfs:

root@OpenWrt:/# dmesg |grep mt7530
[    3.787005] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module
[    3.835438] mt7530 mdio-bus:1f: MT7530 adapts as multi-chip module
[    3.923005] mt7530 mdio-bus:1f wan (uninitialized): PHY [dsa-0.0:00] driver [Generic PHY]
[    3.932567] mt7530 mdio-bus:1f lan1 (uninitialized): PHY [dsa-0.0:01] driver [Generic PHY]
[    3.942168] mt7530 mdio-bus:1f lan2 (uninitialized): PHY [dsa-0.0:02] driver [Generic PHY]
[    3.951787] mt7530 mdio-bus:1f lan3 (uninitialized): PHY [dsa-0.0:03] driver [Generic PHY]
[    3.961443] mt7530 mdio-bus:1f lan4 (uninitialized): PHY [dsa-0.0:04] driver [Generic PHY]
[    3.971133] mt7530 mdio-bus:1f: configuring for fixed/rgmii link mode
[    4.636601] mt7530 mdio-bus:1f: Link is Up - 1Gbps/Full - flow control off
[    5.852953] mt7530 mdio-bus:1f lan1: configuring for phy/gmii link mode
[    9.965767] mt7530 mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
[   10.007372] mt7530 mdio-bus:1f lan1: Link is Down
[   20.586521] mt7530 mdio-bus:1f lan1: configuring for phy/gmii link mode
[   20.659958] mt7530 mdio-bus:1f lan2: configuring for phy/gmii link mode
[   20.705903] mt7530 mdio-bus:1f lan3: configuring for phy/gmii link mode
[   20.750361] mt7530 mdio-bus:1f lan4: configuring for phy/gmii link mode
[   20.803864] mt7530 mdio-bus:1f wan: configuring for phy/gmii link mode
[   23.661665] mt7530 mdio-bus:1f lan1: Link is Up - 1Gbps/Full - flow control rx/tx
root@OpenWrt:/# 

  1. The TX power for the mt7613 is limited to 3 dBm.
root@OpenWrt:/# iwinfo 
wlan0     ESSID: unknown
          Access Point: D8:07:B6:BF:D7:84
          Mode: Client  Channel: unknown (unknown)
          Tx-Power: 22 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11bgn
          Hardware: 14C3:7603 14C3:7603 [MediaTek MT7603E]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy0

wlan1     ESSID: "OpenWrt"
          Access Point: D8:07:B6:BF:D7:83
          Mode: Master  Channel: 36 (5.180 GHz)
          Tx-Power: 3 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: -92 dBm
          Bit Rate: unknown
          Encryption: none
          Type: nl80211  HW Mode(s): 802.11nac
          Hardware: 14C3:7663 14C3:7663 [Generic MAC80211]
          TX power offset: unknown
          Frequency offset: unknown
          Supports VAPs: yes  PHY name: phy1

root@OpenWrt:/# 

I can submit a WIP PR if someone is interested to test and fix these problems.

It may be possible that these issues are now fixed in master, since if it was so long ago that you did this. The transition to DSA switch driver in ramips target was apparently pretty messy...

I believe MT7615 is the firmware to use for 7613 ? The last commit I can see for it was in June. This thing takes ages to boot and the stock firmware performance is kind of poor but hardware on paper seems all supported and decent for the price. Wonder what's holding it back ...