Hi everybody!
Looking to get help and help in getting this device supported.
Mandatory I'm 100% new and I have no idea what I'm doing disclaimer.
All the advances I made so far with this device has been thanks to the amazing posts of the community
The TL;DR of current status: booting fine through a generated initramfs image, LAN ports and Wifi seem to be working (thankfully it has very similar hardware to other devices). Currently finding ways to flash to NAND but it will probably require a U-boot rewrite as the stock U-boot seems to do some firmware checks. Details below.
Hardware:
CPU: MediaTek MT7621AT
NAND Flash: 128 MiB (ESMT F59L1G81MA-25T)
RAM: 256 MiB (Nanya NT5CC128M16IP-DI)
1x USB 3.0 port
Wireless: 5G MediaTek MT7615N, 2.4G MediaTek MT7615N
ETH1 chip: MediaTek MT7621AT
Network ports: 1-WAN, 4-1GbE-LAN
There seem to be 2 variants of the A10 which are A10 and A10 Pro. The only difference seems to be the USB 3.0 port on the Pro version.
The device on my hands was bought in Japan and on the inside it has a tag that says "Archer A2600 Pro(JP)Ver:1.0". I've seen this model ambiguously refered to as the A2600 and A10 (Pro and non Pro versions).
The TP-Link GPL source code for this model also includes sections for/from the Archer C2300 v2 and partially the Archer C6U (couldn't identify the version).
This device is also incredibly similar to the TP-Link EC330-G5u perhaps only with RAM variations, I'm linking to a 4pda forum post where they already took quite a deep dive on the EC330-G5u and that's from where I learned most of the info on how to work on my device:
https://4pda.to/forum/index.php?showtopic=1030035
In fact the A10 is mentioned in this thread and they note the A10 is super similar but has more RAM and no SkyWorks amplifiers. Hopefully by uniting efforts we can get OpenWRT support on several similar devices.
I recently revisited this thread and saw there was some work with the GPL sources but they are not really complete.
With some tweaks I managed to have it partially work but pretty much it only outputs U-boot images, no kernel images.
I saw some targets to make an image but the GPL sources definitely don't have everything needed to create one. In particular some tools which will be mentioned below.
The board has easily accesible UART pins which leads to a console with root access.
Information regarding the flash layout is as follows:
root@Akronite:/proc/sys# cat /proc/mtd
dev: size erasesize name offset
mtd0: 00100000 00020000 "uboot" 00000000
mtd1: 00100000 00020000 "ubootenv" 00100000
mtd2: 03000000 00020000 "os0" 00200000
mtd3: 03000000 00020000 "os1" 03200000
mtd4: 00800000 00020000 "tp_data" 06200000
mtd5: 00400000 00020000 "radio" 06a00000
mtd6: 01180000 00020000 "data" 06e00000
mtd7: 07f80000 00020000 "wholeflash" 00000000
mtd8: 00100000 00020000 "nvram" 00100000
mtd9: 03000000 00020000 "rootfs" 00200000
mtd10: 03000000 00020000 "backup" 03200000
console boot log shows the following:
Creating 11 MTD partitions on "MT7621-NAND":
[ 2.412000] 0x000000000000-0x000000100000 : "uboot"
[ 2.416000] 0x000000100000-0x000000200000 : "ubootenv"
[ 2.424000] 0x000000200000-0x000003200000 : "os0"
[ 2.440000] 0x000003200000-0x000006200000 : "os1"
[ 2.460000] 0x000006200000-0x000006a00000 : "tp_data"
[ 2.468000] 0x000006a00000-0x000006e00000 : "radio"
[ 2.476000] 0x000006e00000-0x000007f80000 : "data"
[ 2.488000] 0x000000000000-0x000007f80000 : "wholeflash"
[ 2.528000] 0x000000100000-0x000000200000 : "nvram"
[ 2.532000] 0x000000200000-0x000003200000 : "rootfs"
[ 2.552000] 0x000003200000-0x000006200000 : "backup"
I have a backup of the wholeflash just in case.
From what I can gather, the rootfs, kernel, and final bootloader, all are inside a jffs2 filesystem. However the kernel and final bootloader are uncompressed within the fs with what I assume is a custom tool.
on the /bootfs/ dir there are three files: vmlinuz, tag_kernel and the confusingly named cferam.000
I can see CFE ram is related to the bootloader of Broadcom devices so I guess these devices are mostly running patched code from the C2300 v1.
However, when comparing the cferam.000 file of this device, it looks nothing like the cferam.000 of a broadcom device. It seems rather to be the final bootloader ("image bootloader"):
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0x51F87DAE, created: 2020-04-21 01:57:26, image size: 146544 bytes, Data Address: 0xA01FB040, Entry Point: 0xA0200000, data CRC: 0xF6571FE5, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: none, image name: "NAND Flash I"
121124 0x1D924 CRC32 polynomial table, little endian
122148 0x1DD24 U-Boot version string, "U-Boot 1.1.3 (Apr 21 2020 - 09:57:19)"
The sources suggest there are 3 bootloaders: the first U-boot, the main U-boot and the image u-boot (which is apparently the one that lives in cferam.000)
The image U-boot is not in the Uboot partition but in the jffs2 filsystem, uncompressed.
In the source the makefile shows the following section:
echo "build firmware..."
#@$(CONFIG_DIR)/buildFs $(IMAGE_DIR) $(CONFIG_DIR) $(SDK_ROOT_DIR)
cp -f $(SDK_BIN_DIR)/linux.7z $(IMAGE_DIR)/vmlinuz
cp -f $(CONFIG_DIR)/imageuboot.bin $(IMAGE_DIR)/uboot.bin
@# prepare bootfs
[ -d $(IMAGE_DIR)/bootfs ] || mkdir -p $(IMAGE_DIR)/bootfs
@cp $(IMAGE_DIR)/uboot.bin $(IMAGE_DIR)/bootfs/cferam.000
@cp $(IMAGE_DIR)/vmlinuz $(IMAGE_DIR)/bootfs/
@dd if=/dev/zero of=$(IMAGE_DIR)/bootfs/tag_kernel bs=512 count=1
@cp -pf $(IMAGE_DIR)/bootfs/* $(IMAGE_ROOTFS_DIR)/
@echo "/cferam.000" > $(IMAGE_DIR)/nocomprlist
@echo "/vmlinuz" >> $(IMAGE_DIR)/nocomprlist
@echo "/tag_kernel" >> $(IMAGE_DIR)/nocomprlist
@mkdir -p $(IMAGE_ROOTFS_DIR)/data
@mkdir -p $(IMAGE_ROOTFS_DIR)/tp_data
@mkdir -p $(IMAGE_ROOTFS_DIR)/radio
@ln -sf /tag_kernel $(IMAGE_ROOTFS_DIR)/etc/tag_kernel
@$(HOSTTOOLS_DIR)/fakeroot $(HOSTTOOLS_DIR)/mkfs.jffs2 -l -p -n -e 131072 -r $(IMAGE_ROOTFS_DIR)/ -o $(IMAGE_DIR)/rootfs.jffs2 -N $(IMAGE_DIR)/nocomprlist
@$(HOSTTOOLS_DIR)/fakeroot $(HOSTTOOLS_DIR)/mktag_jffs2 -E 1 -s 48 -f $(IMAGE_DIR)/rootfs.jffs2 -o $(IMAGE_DIR)/rootfs.img
@rm -rf $(IMAGE_DIR)/nocomprlist
I was unable to find a mkfs.jffs2 version that accepts the -N option to keep some files uncompressed and I didn't find the mktag_jffs2 binary anywhere.
The U-boot partition is looking like this. I am guessing it contains the first U-boot and 3 copies of the main U-boot, each with its own copy of the recovery webpage:
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 uImage header, header size: 64 bytes, header CRC: 0x84C4E28, created: 2020-04-21 01:57:07, image size: 109480 bytes, Data Address: 0xA0200000, Entry Point: 0xA0200000, data CRC: 0x98F1E723, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: none, image name: "NAND Flash I"
86872 0x15358 U-Boot version string, "U-Boot 1.1.3 (Apr 21 2020 - 09:57:01)"
131072 0x20000 uImage header, header size: 64 bytes, header CRC: 0x12E54695, created: 2020-04-21 01:57:17, image size: 205892 bytes, Data Address: 0xA01FC040, Entry Point: 0xA0200000, data CRC: 0x2F0122FD, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: none, image name: "NAND Flash I"
287068 0x4615C CRC32 polynomial table, little endian
288092 0x4655C U-Boot version string, "U-Boot 1.1.3 (Apr 21 2020 - 09:57:10)"
312819 0x4C5F3 HTML document header
332423 0x51287 HTML document footer
393216 0x60000 uImage header, header size: 64 bytes, header CRC: 0x12E54695, created: 2020-04-21 01:57:17, image size: 205892 bytes, Data Address: 0xA01FC040, Entry Point: 0xA0200000, data CRC: 0x2F0122FD, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: none, image name: "NAND Flash I"
549212 0x8615C CRC32 polynomial table, little endian
550236 0x8655C U-Boot version string, "U-Boot 1.1.3 (Apr 21 2020 - 09:57:10)"
574963 0x8C5F3 HTML document header
594567 0x91287 HTML document footer
655360 0xA0000 uImage header, header size: 64 bytes, header CRC: 0x12E54695, created: 2020-04-21 01:57:17, image size: 205892 bytes, Data Address: 0xA01FC040, Entry Point: 0xA0200000, data CRC: 0x2F0122FD, OS: Linux, CPU: MIPS, image type: Standalone Program, compression type: none, image name: "NAND Flash I"
811356 0xC615C CRC32 polynomial table, little endian
812380 0xC655C U-Boot version string, "U-Boot 1.1.3 (Apr 21 2020 - 09:57:10)"
837107 0xCC5F3 HTML document header
856711 0xD1287 HTML document footer
If I remember correctly (this was a while ago) I was able to modify the image U-boot in the "cferam.000" and modify the tag_kernel but the U-boot still checks the filesystem integrity as I got the following error:
CRC of rootfs is wrong(original 0xab426777 calculated 0x13938054)
I guess I'm going on the wrong path and it requires a U-boot partition rewrite but I was avoiding that route as to avoid bricking my device without knowing what I'm exactly doing although I'm very aware that's the risk.
The boot section of the console logs look like this (redacted a couple of parts):
U-Boot 1.1.3 (Apr 21 2020 - 09:57:10)
Board: Ralink APSoC DRAM: 256 MB
relocate_code Pointer at: 8ff84000
Config XHCI 40M PLL
Allocate 16 byte aligned buffer: 8ffca770
Enable NFI Clock
# MTK NAND # : Use HW ECC
NAND ID [REDACTED]
Device found in MTK table, ID: c8d1, EXT_ID: 809540
Support this Device in MTK table! c8d1
select_chip
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
Signature matched and data read!
load_fact_bbt success 1023
load fact bbt success
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[mtk_nand] probe successfully!
mtd->writesize=2048 mtd->oobsize=64, mtd->erasesize=131072 devinfo.iowidth=8
.
partable is:
uboot:0x100000@0x0
ubootenv:0x100000@0x100000
os0:0x3000000@0x200000
os1:0x3000000@0x3200000
tp_data:0x800000@0x6200000
radio:0x400000@0x6a00000
data:0x1180000@0x6e00000
.============================================
Ralink UBoot Version: 5.0.0.0
--------------------------------------------
ASIC MT7621A DualCore (MAC to MT7530 Mode)
DRAM_CONF_FROM: Auto-Detection
DRAM_TYPE: DDR3
DRAM bus: 16 bit
Xtal Mode=3 OCP Ratio=1/3
Flash component: NAND Flash
Date:Apr 21 2020 Time:09:57:10
============================================
THIS IS Main Uboot: Including recovery webserver.
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:256, ways:4, linesz:32 ,total:32768
##### The CPU freq = 880 MHZ ####
estimate memory size =256 Mbytes
this uboot is loaded from 0xbc020000
Press '4' or 't' to break the booting process
Press 'x' to enter recovery web server 0
3: System Boot system code via Flash.
boot rootfs from os0 image 0.
........found kernel tag, fslen = 33030144, bincrc = ab426777
........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................copy kernel len 3663359 fs_len 33030144
## Booting image at 89100000 ...
Image Name: NAND Flash I
Image Type: MIPS Linux Standalone Program (uncompressed)
Data Size: 146544 Bytes = 143.1 kB
Load Address: a01fb040
Entry Point: a0200000
Verifying Checksum ... OK
data copied to 0xa01fb040
OK
jump to memory 0xa0200000
U-Boot 1.1.3 (Apr 21 2020 - 09:57:19)
Board: Ralink APSoC DRAM: 256 MB
relocate_code Pointer at: 8ff94000
Config XHCI 40M PLL
Allocate 16 byte aligned buffer: 8ffcaf70
Enable NFI Clock
# MTK NAND # : Use HW ECC
NAND ID [REDACTED]
Device found in MTK table, ID: c8d1, EXT_ID: 809540
Support this Device in MTK table! c8d1
select_chip
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
Signature matched and data read!
load_fact_bbt success 1023
load fact bbt success
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[mtk_nand] probe successfully!
mtd->writesize=2048 mtd->oobsize=64, mtd->erasesize=131072 devinfo.iowidth=8
.
partable is:
uboot:0x100000@0x0
ubootenv:0x100000@0x100000
os0:0x3000000@0x200000
os1:0x3000000@0x3200000
tp_data:0x800000@0x6200000
radio:0x400000@0x6a00000
data:0x1180000@0x6e00000
.============================================
Ralink UBoot Version: 5.0.0.0
--------------------------------------------
ASIC MT7621A DualCore (MAC to MT7530 Mode)
DRAM_CONF_FROM: Auto-Detection
DRAM_TYPE: DDR3
DRAM bus: 16 bit
Xtal Mode=3 OCP Ratio=1/3
Flash component: NAND Flash
Date:Apr 21 2020 Time:09:57:19
============================================
THIS IS Image Uboot: Uboot included in upgrade image.
icache: sets:256, ways:4, linesz:32 ,total:32768
dcache: sets:256, ways:4, linesz:32 ,total:32768
##### The CPU freq = 880 MHZ ####
estimate memory size =256 Mbytes
this uboot is loaded from 0x89100000
Press '2' or 't' to break the booting process
3: System Boot system code via Flash.
[get]mem environment not init yet.
[get]mem environment not init yet.
checking mem environment needn't save
try kernel boot addr 89200000 length 0x03000000
## Booting image at 89200000 ...
Image Name: Linux Kernel Image
Image Type: MIPS Linux Kernel Image (lzma compressed)
Data Size: 3663295 Bytes = 3.5 MB
Load Address: 81001000
Entry Point: 816a4980
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 816a4980) ...
## Giving linux memsize in MB, 256
Starting kernel ...
To get to build the initramfs to test, I used the following parameters (I referred to it as the A2600 Pro but it would likely be better to write A10 instead)
mt7621.mk file:
define Device/tplink_a2600pro-v1
$(Device/dsa-migration)
$(Device/tplink-safeloader)
DEVICE_MODEL := A2600PRO
DEVICE_VARIANT := v1
DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware \
kmod-usb3 kmod-usb-ledtrig-usbport
TPLINK_BOARD_ID := A2600PRO-V1
KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma
IMAGE_SIZE := 15744k
endef
TARGET_DEVICES += tplink_a2600pro-v1
mt7621_tplink_archer-a2600pro-v1.dts file:
#include "mt7621_tplink_archer-a2600pro-v1.dtsi"
/ {
model = "TP-Link Archer A2600 Pro v1";
compatible = "tplink,a2600pro-v1", "mediatek,mt7621-soc";
};
mt7621_tplink_archer-a2600pro-v1.dtsi file: (I tested the leds and buttons and most if not all are correct, they are also listed on the source. I have not yet been able to retrieve the MAC address from flash, details below.)
https://paste.c-net.org/MarryingStylist
01_leds file:
tplink,a2600pro-v1)
ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "white:wifi2G" "wlan0"
ucidef_set_led_netdev "wifi5g" "Wifi 5G" "white:wifi5G" "wlan1"
ucidef_set_led_netdev "eth_link" "LAN link" "white:lan" "lan" "link"
ucidef_set_led_netdev "wan" "WAN" "white:wan" "wan"
ucidef_set_led_netdev "wan" "WAN" "orange:wan" "wan"
;;
The tp_data partition contains the 2 eeprom files for the radios and a file named default-mac which has the MAC address of the system surprisingly instead of on the radio partition. MAC addresses are then used as follows:
eth0, the 2.4GHz radio and the switch ports get their MAC address straight form default-mac
The 5 GHz radio MAC address is the default-mac address minus one.
That's all I've got for now. Thank you very much in advance everyone!