Adding support for TP-Link RE190 v4 (AC750 2.4/5GHz Wi-Fi Range Extender)

Here is an example of tools/firmware-utils/patches/001-tplink-safeloader-add-Archer-AX23.patch content:

From a2c80c586b81efc1662fec23202b88e2790e305e Mon Sep 17 00:00:00 2001
From: David Bauer <mail@david-bauer.net>
Date: Tue, 14 Mar 2023 04:04:18 +0100
Subject: [PATCH] tplink-safeloader: add Archer AX23

Original partition alignment
----------------------------

partition fs-uboot base 0x00000 size 0x40000
partition os-image base 0x40000 size 0x400000
partition file-system base 0x440000 size 0xb60000
partition default-mac base 0xfa0000 size 0x00200
partition pin base 0xfa0200 size 0x00100
partition device-id base 0xfa0300 size 0x00100
partition product-info base 0xfa0400 size 0x0fc00
partition default-config base 0xfb0000 size 0x08000
partition ap-def-config base 0xfb8000 size 0x08000
partition user-config base 0xfc0000 size 0x0a000
partition ag-config base 0xfca000 size 0x04000
partition certificate base 0xfce000 size 0x02000
partition ap-config base 0xfd0000 size 0x06000
partition router-config base 0xfd6000 size 0x06000
partition favicon base 0xfdc000 size 0x02000
partition logo base 0xfde000 size 0x02000
partition partition-table base 0xfe0000 size 0x00800
partition soft-version base 0xfe0800 size 0x00100
partition support-list base 0xfe0900 size 0x00200
partition profile base 0xfe0b00 size 0x03000
partition extra-para base 0xfe3b00 size 0x00100
partition radio base 0xff0000 size 0x10000

Vendor image partition-table
----------------------------

partition fs-uboot base 0x00000 size 0x40000
partition os-image base 0x40000 size 0x400000
partition file-system base 0x440000 size 0xb60000
partition default-mac base 0xfa0000 size 0x00200
partition pin base 0xfa0200 size 0x00100
partition device-id base 0xfa0300 size 0x00100
partition product-info base 0xfa0400 size 0x0fc00
partition default-config base 0xfb0000 size 0x08000
partition ap-def-config base 0xfb8000 size 0x08000
partition user-config base 0xfc0000 size 0x0a000
partition ag-config base 0xfca000 size 0x04000
partition certificate base 0xfce000 size 0x02000
partition ap-config base 0xfd0000 size 0x06000
partition router-config base 0xfd6000 size 0x06000
partition favicon base 0xfdc000 size 0x02000
partition logo base 0xfde000 size 0x02000
partition partition-table base 0xfe0000 size 0x00800
partition soft-version base 0xfe0800 size 0x00100
partition support-list base 0xfe0900 size 0x00200
partition profile base 0xfe0b00 size 0x03000
partition extra-para base 0xfe3b00 size 0x00100
partition radio base 0xff0000 size 0x10000

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 src/tplink-safeloader.c | 44 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

--- a/src/tplink-safeloader.c
+++ b/src/tplink-safeloader.c
@@ -874,6 +874,49 @@ static struct device_info boards[] = {
                .last_sysupgrade_partition = "file-system",
        },

+       /** Firmware layout for the Archer AX23 v1 */
+       {
+               .id     = "ARCHER-AX23-V1",
+               .vendor = "",
+               .support_list =
+                       "SupportList:\n"
+                       "{product_name:Archer AX23,product_ver:1.0,special_id:45550000}\n"
+                       "{product_name:Archer AX23,product_ver:1.20,special_id:45550000}\n"
+                       "{product_name:Archer AX23,product_ver:1.0,special_id:4A500000}\n"
+                       "{product_name:Archer AX23,product_ver:1.20,special_id:4A500000}\n"
+                       "{product_name:Archer AX23,product_ver:1.0,special_id:4B520000}\n"
+                       "{product_name:Archer AX23,product_ver:1.0,special_id:52550000}\n"
+                       "{product_name:Archer AX1800,product_ver:1.20,special_id:52550000}\n",
+               .part_trail = 0x00,
+               .soft_ver = SOFT_VER_TEXT("soft_ver:3.0.3\n"),
+
+               .partitions = {
+                       {"fs-uboot", 0x00000, 0x40000},
+                       {"firmware", 0x40000, 0xf60000},
+                       {"default-mac", 0xfa0000, 0x00200},
+                       {"pin", 0xfa0200, 0x00100},
+                       {"device-id", 0xfa0300, 0x00100},
+                       {"product-info", 0xfa0400, 0x0fc00},
+                       {"default-config", 0xfb0000, 0x08000},
+                       {"ap-def-config", 0xfb8000, 0x08000},
+                       {"user-config", 0xfc0000, 0x0a000},
+                       {"ag-config", 0xfca000, 0x04000},
+                       {"certificate", 0xfce000, 0x02000},
+                       {"ap-config", 0xfd0000, 0x06000},
+                       {"router-config", 0xfd6000, 0x06000},
+                       {"favicon", 0xfdc000, 0x02000},
+                       {"logo", 0xfde000, 0x02000},
+                       {"partition-table", 0xfe0000, 0x00800},
+                       {"soft-version", 0xfe0800, 0x00100},
+                       {"support-list", 0xfe0900, 0x00200},
+                       {"profile", 0xfe0b00, 0x03000},
+                       {"extra-para", 0xfe3b00, 0x00100},
+                       {"radio", 0xff0000, 0x10000},
+                       {NULL, 0, 0}
+               },
+               .first_sysupgrade_partition = "os-image",
+               .last_sysupgrade_partition = "file-system",
+       },
        /** Firmware layout for the C2v3 */
        {
                .id     = "ARCHER-C2-V3",
@@ -3353,6 +3396,7 @@ static void build_image(const char *outp
        if (strcasecmp(info->id, "ARCHER-A6-V3") == 0 ||
            strcasecmp(info->id, "ARCHER-A7-V5") == 0 ||
            strcasecmp(info->id, "ARCHER-A9-V6") == 0 ||
+           strcasecmp(info->id, "ARCHER-AX23-V1") == 0 ||
            strcasecmp(info->id, "ARCHER-C2-V3") == 0 ||
            strcasecmp(info->id, "ARCHER-C7-V4") == 0 ||
            strcasecmp(info->id, "ARCHER-C7-V5") == 0 ||

It seems that the least hacky way, and actually the most recommended method of modifying packages (or tools in this case) is to create & apply such patches (using Quilt tool or manually)...
If we look at the patch date, we can notice that it is somewhat recent (dates after the migration of firmware-utils into a separate repo), which makes me believe that this is the more recent approach to integrating modifications of external packages & tools...

You are right, that's option four. Sorry, I forgot about this one. But before being able to create the patch, you still need to check out and build the source code.

@andyboeh This device does not seem to have a RJ45 (LAN) port connector like RE200 does.
Also, the OpenWrt does not seem to recognize the 802.11ac (5GHz) module.
The only WiFi interface (2.4GHz) is displayed as Generic 802.11bgn.
MT76 seems to be kinda problematic, but I don't believe 802.11ac should be completely unavailable, like in my case...
Any advice on how could I troubleshoot the potential hardware issues (incorrect kmod driver or DT mappings)?

What is your current status?

How do you TFTP then? Recovery? Configuration? All via WiFi? Looks like a pain to support, that also means you need working WiFi from the beginning - this is something OpenWrt does not support (at least not by default).

Do you already have a working OpenWrt for this device? The post before this was still about getting the build system up and running.

Please provide a bit more information:

  • Do you have a bootlog from the stock firmware?
  • OpenWrt boot log?
  • Output of lspci -n?

@edupaag If you decide to open device and add serial, here are some pics of RE220. I think it is impossible to open without breaking the case.

Successfully set up the build system as instructed by the wiki. Modified tplink-safeloader.c (inside firmware-utils). Built the image as described above. Made an additional modification - modified default config files to enable WiFi by default.

At the moment, I don't have access to the recovery mode nor the serial port. So the room for error & experimentation is small.

I will try to pry it open & connect to serial. Also, I will post the lspci -n output. It is provided by pciutils package?

Thanks. I will take a look into this. Yes, it looks like I will have to sacrifice this unit & break the plastic casing.

@andyboeh @jedboy Hey guys, this is the output of lspci:

root@OpenWrt:~# lspci
00:00.0 PCI bridge: MEDIATEK Corp. Device 0801 (rev 01)
01:00.0 Network controller: MEDIATEK Corp. Device 7650
01:00.1 Bluetooth: MEDIATEK Corp. Device 8650
root@OpenWrt:~# lspci -n
00:00.0 0604: 14c3:0801 (rev 01)
01:00.0 0280: 14c3:7650
01:00.1 0d11: 14c3:8650

The device is powered by MT7650 module.

You've got the same WiFi devices as the Archer C20 v5. The MT7650 is the switch, your SoC is probably MT7628. I would check the C20v5 build recipe for the required kernel modules for WiFi support.

Are you sure? What about the similarity to RE200v4? Wouldn't it make more sense for it to have the same SoC as RE200v4? Also, it does get all the same kernel modules as RE200v4... But still, 802.11ac is not properly detected...

I did a search for the PCI IDs you mentioned to check which kmods are supported. The C20v5 lists them in its boot log. The SoC seems to be the same as in the RE200v4 as well, but the 5GHz WiFi is a separate chip not included in the SoC.

There could be other issues like a missing or invalid EEPROM, that's why I asked you about the boot log which you didn't provide (just run logread directly after boot, no need for serial console).

Here is the captured boot process log - an output of logread (among others, contains kernel log - same as produced by dmesg):

{Timestamp redacted} kern.notice kernel: [    0.000000] Linux version 5.10.176 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r20134-5f15225c1e) 11.2.0, GNU ld (GNU Binutils) 2.37)
{Timestamp redacted} kern.info kernel: [    0.000000] Board has DDR2
{Timestamp redacted} kern.info kernel: [    0.000000] Analog PMU set to hw control
{Timestamp redacted} kern.info kernel: [    0.000000] Digital PMU set to hw control
{Timestamp redacted} kern.info kernel: [    0.000000] SoC Type: MediaTek MT7628AN ver:1 eco:2
{Timestamp redacted} kern.info kernel: [    0.000000] printk: bootconsole [early0] enabled
{Timestamp redacted} kern.info kernel: [    0.000000] CPU0 revision is: 00019655 (MIPS 24KEc)
{Timestamp redacted} kern.info kernel: [    0.000000] MIPS: machine is TP-Link RE190 v4
{Timestamp redacted} kern.info kernel: [    0.000000] Initrd not found or empty - disabling initrd
{Timestamp redacted} kern.info kernel: [    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
{Timestamp redacted} kern.info kernel: [    0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes
{Timestamp redacted} kern.info kernel: [    0.000000] Zone ranges:
{Timestamp redacted} kern.info kernel: [    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
{Timestamp redacted} kern.info kernel: [    0.000000] Movable zone start for each node
{Timestamp redacted} kern.info kernel: [    0.000000] Early memory node ranges
{Timestamp redacted} kern.info kernel: [    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
{Timestamp redacted} kern.info kernel: [    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
{Timestamp redacted} kern.debug kernel: [    0.000000] On node 0 totalpages: 16384
{Timestamp redacted} kern.debug kernel: [    0.000000]   Normal zone: 144 pages used for memmap
{Timestamp redacted} kern.debug kernel: [    0.000000]   Normal zone: 0 pages reserved
{Timestamp redacted} kern.debug kernel: [    0.000000]   Normal zone: 16384 pages, LIFO batch:3
{Timestamp redacted} kern.debug kernel: [    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
{Timestamp redacted} kern.debug kernel: [    0.000000] pcpu-alloc: [0] 0
{Timestamp redacted} kern.info kernel: [    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16240
{Timestamp redacted} kern.notice kernel: [    0.000000] Kernel command line: console=ttyS0,57600n8 rootfstype=squashfs,jffs2
{Timestamp redacted} kern.info kernel: [    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.000000] Writing ErrCtl register=0002948b
{Timestamp redacted} kern.info kernel: [    0.000000] Readback ErrCtl register=0002948b
{Timestamp redacted} kern.info kernel: [    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
{Timestamp redacted} kern.info kernel: [    0.000000] Memory: 56348K/65536K available (5702K kernel code, 619K rwdata, 696K rodata, 1228K init, 210K bss, 9188K reserved, 0K cma-reserved)
{Timestamp redacted} kern.info kernel: [    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
{Timestamp redacted} kern.info kernel: [    0.000000] NR_IRQS: 256
{Timestamp redacted} kern.info kernel: [    0.000000] intc: using register map from devicetree
{Timestamp redacted} kern.info kernel: [    0.000000] CPU Clock: 580MHz
{Timestamp redacted} kern.crit kernel: [    0.000000] timer_probe: no matching timers found
{Timestamp redacted} kern.info kernel: [    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6590553264 ns
{Timestamp redacted} kern.info kernel: [    0.000010] sched_clock: 32 bits at 290MHz, resolution 3ns, wraps every 7405115902ns
{Timestamp redacted} kern.info kernel: [    0.015487] Calibrating delay loop... 385.84 BogoMIPS (lpj=1929216)
{Timestamp redacted} kern.info kernel: [    0.087668] pid_max: default: 32768 minimum: 301
{Timestamp redacted} kern.info kernel: [    0.096973] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.111307] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.129024] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
{Timestamp redacted} kern.info kernel: [    0.148122] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
{Timestamp redacted} kern.info kernel: [    0.167506] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.181009] pinctrl core: initialized pinctrl subsystem
{Timestamp redacted} kern.info kernel: [    0.196275] NET: Registered protocol family 16
{Timestamp redacted} kern.info kernel: [    0.205888] thermal_sys: Registered thermal governor 'step_wise'
{Timestamp redacted} kern.err kernel: [    0.316092] mt7620-pci 10140000.pcie: Port 0 N_FTS = 1b105000
{Timestamp redacted} kern.info kernel: [    0.488970] PCI host bridge /pcie@10140000 ranges:
{Timestamp redacted} kern.info kernel: [    0.498317]  MEM 0x0000000020000000..0x000000002fffffff
{Timestamp redacted} kern.info kernel: [    0.508619]   IO 0x0000000010160000..0x000000001016ffff
{Timestamp redacted} kern.info kernel: [    0.570925] PCI host bridge to bus 0000:00
{Timestamp redacted} kern.info kernel: [    0.578901] pci_bus 0000:00: root bus resource [mem 0x20000000-0x2fffffff]
{Timestamp redacted} kern.info kernel: [    0.592561] pci_bus 0000:00: root bus resource [io  0x10160000-0x1016ffff]
{Timestamp redacted} kern.info kernel: [    0.606073] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
{Timestamp redacted} kern.info kernel: [    0.619483] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
{Timestamp redacted} kern.info kernel: [    0.635192] pci 0000:00:00.0: [14c3:0801] type 01 class 0x060400
{Timestamp redacted} kern.info kernel: [    0.647022] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
{Timestamp redacted} kern.info kernel: [    0.659394] pci 0000:00:00.0: reg 0x14: [mem 0x00000000-0x0000ffff]
{Timestamp redacted} kern.info kernel: [    0.671847] pci 0000:00:00.0: supports D1
{Timestamp redacted} kern.info kernel: [    0.679677] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
{Timestamp redacted} kern.info kernel: [    0.692696] pci 0000:00:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
{Timestamp redacted} kern.info kernel: [    0.708651] pci 0000:01:00.0: [14c3:7650] type 00 class 0x028000
{Timestamp redacted} kern.info kernel: [    0.720439] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
{Timestamp redacted} kern.info kernel: [    0.732923] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
{Timestamp redacted} kern.info kernel: [    0.745325] pci 0000:01:00.1: [14c3:8650] type 00 class 0x0d1100
{Timestamp redacted} kern.info kernel: [    0.757129] pci 0000:01:00.1: reg 0x10: [mem 0x00000000-0x000fffff]
{Timestamp redacted} kern.info kernel: [    0.769593] pci 0000:01:00.1: supports D1
{Timestamp redacted} kern.info kernel: [    0.777367] pci 0000:01:00.1: PME# supported from D0 D1 D3hot D3cold
{Timestamp redacted} kern.info kernel: [    0.791432] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
{Timestamp redacted} kern.info kernel: [    0.804414] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 01
{Timestamp redacted} kern.info kernel: [    0.817490] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
{Timestamp redacted} kern.info kernel: [    0.830526] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
{Timestamp redacted} kern.info kernel: [    0.844285] pci 0000:00:00.0: BAR 8: assigned [mem 0x20000000-0x201fffff]
{Timestamp redacted} kern.info kernel: [    0.857700] pci 0000:00:00.0: BAR 1: assigned [mem 0x20200000-0x2020ffff]
{Timestamp redacted} kern.info kernel: [    0.871126] pci 0000:01:00.0: BAR 0: assigned [mem 0x20000000-0x200fffff]
{Timestamp redacted} kern.info kernel: [    0.884538] pci 0000:01:00.1: BAR 0: assigned [mem 0x20100000-0x201fffff]
{Timestamp redacted} kern.info kernel: [    0.897952] pci 0000:00:00.0: PCI bridge to [bus 01]
{Timestamp redacted} kern.info kernel: [    0.907746] pci 0000:00:00.0:   bridge window [mem 0x20000000-0x201fffff]
{Timestamp redacted} kern.info kernel: [    0.928877] clocksource: Switched to clocksource MIPS
{Timestamp redacted} kern.info kernel: [    0.940265] NET: Registered protocol family 2
{Timestamp redacted} kern.info kernel: [    0.949139] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.964290] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.980824] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    0.995867] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    1.009785] TCP: Hash tables configured (established 1024 bind 1024)
{Timestamp redacted} kern.info kernel: [    1.022510] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    1.035356] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
{Timestamp redacted} kern.info kernel: [    1.049438] NET: Registered protocol family 1
{Timestamp redacted} kern.info kernel: [    1.058001] PCI: CLS 0 bytes, default 32
{Timestamp redacted} kern.info kernel: [    1.073526] workingset: timestamp_bits=14 max_order=14 bucket_order=0
{Timestamp redacted} kern.info kernel: [    1.091539] squashfs: version 4.0 (2009/01/31) Phillip Lougher
{Timestamp redacted} kern.info kernel: [    1.103006] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
{Timestamp redacted} kern.info kernel: [    1.124502] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
{Timestamp redacted} kern.info kernel: [    1.141683] mt7621_gpio 10000600.gpio: registering 32 gpios
{Timestamp redacted} kern.info kernel: [    1.152918] mt7621_gpio 10000600.gpio: registering 32 gpios
{Timestamp redacted} kern.info kernel: [    1.164152] mt7621_gpio 10000600.gpio: registering 32 gpios
{Timestamp redacted} kern.info kernel: [    1.175432] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
{Timestamp redacted} kern.info kernel: [    1.191039] printk: console [ttyS0] disabled
{Timestamp redacted} kern.info kernel: [    1.199517] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 28, base_baud = 2500000) is a 16550A
{Timestamp redacted} kern.info kernel: [    1.217317] printk: console [ttyS0] enabled
{Timestamp redacted} kern.info kernel: [    1.233813] printk: bootconsole [early0] disabled
{Timestamp redacted} kern.info kernel: [    1.253919] spi-mt7621 10000b00.spi: sys_freq: 193333333
{Timestamp redacted} kern.info kernel: [    1.284094] spi-nor spi0.0: XM25QH64A (8192 Kbytes)
{Timestamp redacted} kern.notice kernel: [    1.293914] 4 fixed-partitions partitions found on MTD device spi0.0
{Timestamp redacted} kern.err kernel: [    1.306557] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
{Timestamp redacted} kern.err kernel: [    1.321065] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
{Timestamp redacted} kern.err kernel: [    1.336019] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
{Timestamp redacted} kern.err kernel: [    1.350563] OF: Bad cell count for /palmbus@10000000/spi@b00/flash@0/partitions
{Timestamp redacted} kern.notice kernel: [    1.365931] Creating 4 MTD partitions on "spi0.0":
{Timestamp redacted} kern.notice kernel: [    1.375492] 0x000000000000-0x000000020000 : "u-boot"
{Timestamp redacted} kern.notice kernel: [    1.390263] 0x000000020000-0x0000007c0000 : "firmware"
{Timestamp redacted} kern.notice kernel: [    1.402925] 2 tplink-fw partitions found on MTD device firmware
{Timestamp redacted} kern.notice kernel: [    1.414732] Creating 2 MTD partitions on "firmware":
{Timestamp redacted} kern.notice kernel: [    1.424590] 0x000000000000-0x00000021b684 : "kernel"
{Timestamp redacted} kern.warn kernel: [    1.434423] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
{Timestamp redacted} kern.notice kernel: [    1.453573] 0x000000220000-0x0000007a0000 : "rootfs"
{Timestamp redacted} kern.info kernel: [    1.464587] mtd: setting mtd3 (rootfs) as root device
{Timestamp redacted} kern.notice kernel: [    1.475752] 1 squashfs-split partitions found on MTD device rootfs
{Timestamp redacted} kern.notice kernel: [    1.488095] 0x0000005a0000-0x0000007a0000 : "rootfs_data"
{Timestamp redacted} kern.notice kernel: [    1.500138] 0x0000007c0000-0x0000007f0000 : "config"
{Timestamp redacted} kern.notice kernel: [    1.513134] 0x0000007f0000-0x000000800000 : "radio"
{Timestamp redacted} kern.info kernel: [    1.577029] rt3050-esw 10110000.esw: mediatek esw at 0xb0110000, irq 25 initialized
{Timestamp redacted} kern.info kernel: [    1.593096] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
{Timestamp redacted} kern.info kernel: [    1.611434] NET: Registered protocol family 10
{Timestamp redacted} kern.info kernel: [    1.626206] Segment Routing with IPv6
{Timestamp redacted} kern.info kernel: [    1.633682] NET: Registered protocol family 17
{Timestamp redacted} kern.info kernel: [    1.642647] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
{Timestamp redacted} kern.info kernel: [    1.668332] 8021q: 802.1Q VLAN Support v1.8
{Timestamp redacted} kern.info kernel: [    1.684141] VFS: Mounted root (squashfs filesystem) readonly on device 31:3.
{Timestamp redacted} kern.info kernel: [    1.705112] Freeing unused kernel memory: 1228K
{Timestamp redacted} kern.warn kernel: [    1.714106] This architecture does not have kernel memory protection.
{Timestamp redacted} kern.info kernel: [    1.726871] Run /sbin/init as init process
{Timestamp redacted} kern.debug kernel: [    1.734985]   with arguments:
{Timestamp redacted} kern.debug kernel: [    1.734991]     /sbin/init
{Timestamp redacted} kern.debug kernel: [    1.734996]   with environment:
{Timestamp redacted} kern.debug kernel: [    1.735001]     HOME=/
{Timestamp redacted} kern.debug kernel: [    1.735006]     TERM=linux
{Timestamp redacted} user.info kernel: [    2.405913] init: Console is alive
{Timestamp redacted} user.info kernel: [    2.413364] init: - watchdog -
{Timestamp redacted} user.info kernel: [    3.376450] kmodloader: loading kernel modules from /etc/modules-boot.d/*
{Timestamp redacted} user.info kernel: [    3.493610] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
{Timestamp redacted} user.info kernel: [    3.518632] init: - preinit -
{Timestamp redacted} kern.notice kernel: [    4.718579] random: jshn: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [    4.841679] random: jshn: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [    4.914540] random: jshn: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [    9.858686] jffs2: notice: (397) jffs2_build_xattr_subsystem: complete building xattr subsystem, 40 of xdatum (3 unchecked, 31 orphan) and 50 of xref (8 dead, 31 orphan) found.
{Timestamp redacted} user.info kernel: [    9.891799] mount_root: switching to jffs2 overlay
{Timestamp redacted} kern.warn kernel: [    9.906742] overlayfs: upper fs does not support tmpfile.
{Timestamp redacted} user.warn kernel: [    9.924386] urandom-seed: Seeding with /etc/urandom.seed
{Timestamp redacted} user.info kernel: [   10.063610] procd: - early -
{Timestamp redacted} user.info kernel: [   10.069841] procd: - watchdog -
{Timestamp redacted} user.info kernel: [   10.819037] procd: - watchdog -
{Timestamp redacted} user.info kernel: [   10.825986] procd: - ubus -
{Timestamp redacted} kern.notice kernel: [   10.922544] random: ubusd: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [   10.938664] random: ubusd: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [   10.957134] random: ubusd: uninitialized urandom read (4 bytes read)
{Timestamp redacted} user.info kernel: [   10.977798] procd: - init -
{Timestamp redacted} kern.notice kernel: [   12.135828] random: jshn: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [   12.219422] random: ubusd: uninitialized urandom read (4 bytes read)
{Timestamp redacted} kern.notice kernel: [   12.259334] random: ubus: uninitialized urandom read (4 bytes read)
{Timestamp redacted} user.info kernel: [   12.288231] kmodloader: loading kernel modules from /etc/modules.d/*
{Timestamp redacted} kern.info kernel: [   12.897556] Loading modules backported from Linux version v5.15.92-0-ge515b9902f5f
{Timestamp redacted} kern.info kernel: [   12.912658] Backport generated by backports.git v5.15.92-1-0-gdfe0f60c
{Timestamp redacted} user.info kernel: [   13.053099] urngd: v1.0.2 started.
{Timestamp redacted} kern.info kernel: [   13.102339] mt76_wmac 10300000.wmac: ASIC revision: 76280001
{Timestamp redacted} kern.notice kernel: [   13.354760] random: crng init done
{Timestamp redacted} kern.notice kernel: [   13.361556] random: 23 urandom warning(s) missed due to ratelimiting
{Timestamp redacted} kern.info kernel: [   14.151542] mt76_wmac 10300000.wmac: Firmware Version: 20151201
{Timestamp redacted} kern.info kernel: [   14.163357] mt76_wmac 10300000.wmac: Build Time: 20151201183641
{Timestamp redacted} kern.info kernel: [   14.188883] mt76_wmac 10300000.wmac: firmware init done
{Timestamp redacted} kern.debug kernel: [   14.368977] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
{Timestamp redacted} kern.info kernel: [   14.554855] PPP generic driver version 2.4.2
{Timestamp redacted} kern.info kernel: [   14.568607] NET: Registered protocol family 24
{Timestamp redacted} user.info kernel: [   14.599728] kmodloader: done loading kernel modules from /etc/modules.d/*
{Timestamp redacted} user.notice dnsmasq: DNS rebinding protection is active, will discard upstream RFC1918 responses!
{Timestamp redacted} user.notice dnsmasq: Allowing 127.0.0.0/8 responses
{Timestamp redacted} daemon.info dnsmasq[1]: started, version 2.86 cachesize 150
{Timestamp redacted} daemon.info dnsmasq[1]: DNS service limited to local subnets
{Timestamp redacted} daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
{Timestamp redacted} daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for test
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for onion
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for localhost
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for local
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for invalid
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for bind
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for lan
{Timestamp redacted} daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
{Timestamp redacted} daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
{Timestamp redacted} daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 0 addresses
{Timestamp redacted} authpriv.info dropbear[1029]: Not backgrounding
{Timestamp redacted} daemon.notice wpa_supplicant[1137]: Successfully initialized wpa_supplicant
{Timestamp redacted} user.notice : Added device handler type: bonding
{Timestamp redacted} user.notice : Added device handler type: 8021ad
{Timestamp redacted} user.notice : Added device handler type: 8021q
{Timestamp redacted} user.notice : Added device handler type: macvlan
{Timestamp redacted} user.notice : Added device handler type: veth
{Timestamp redacted} user.notice : Added device handler type: bridge
{Timestamp redacted} user.notice : Added device handler type: Network device
{Timestamp redacted} user.notice : Added device handler type: tunnel
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/dhcp reload dependency on /etc/config/network
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/network reload dependency on /etc/config/wireless
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/luci-splash reload dependency on /etc/config/firewall
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/qos reload dependency on /etc/config/firewall
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/miniupnpd reload dependency on /etc/config/firewall
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/odhcpd reload dependency on /etc/config/dhcp
{Timestamp redacted} user.notice ucitrack: Setting up non-init /etc/config/fstab reload handler: /sbin/block mount
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/system reload trigger for non-procd /etc/init.d/led
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/luci_statistics reload dependency on /etc/config/system
{Timestamp redacted} user.notice ucitrack: Setting up /etc/config/dhcp reload dependency on /etc/config/system
{Timestamp redacted} daemon.notice procd: /etc/rc.d/S96led: setting up led lan
{Timestamp redacted} kern.info kernel: [   33.523899] br-lan: port 1(eth0) entered blocking state
{Timestamp redacted} kern.info kernel: [   33.534356] br-lan: port 1(eth0) entered disabled state
{Timestamp redacted} kern.info kernel: [   33.545090] device eth0 entered promiscuous mode
{Timestamp redacted} daemon.notice netifd: Interface 'lan' is enabled
{Timestamp redacted} daemon.notice netifd: Interface 'lan' is setting up now
{Timestamp redacted} daemon.notice netifd: Interface 'lan' is now up
{Timestamp redacted} daemon.notice netifd: Interface 'loopback' is enabled
{Timestamp redacted} daemon.notice netifd: Interface 'loopback' is setting up now
{Timestamp redacted} daemon.notice netifd: Interface 'loopback' is now up
{Timestamp redacted} daemon.notice netifd: Network device 'lo' link is up
{Timestamp redacted} daemon.notice netifd: Interface 'loopback' has link connectivity
{Timestamp redacted} daemon.err odhcpd[1258]: Failed to send to ff02::1%lan@br-lan (Address not available)
{Timestamp redacted} daemon.info procd: - init complete -
{Timestamp redacted} user.notice firewall: Reloading firewall due to ifup of lan (br-lan)
{Timestamp redacted} daemon.notice hostapd: Configuration file: /var/run/hostapd-phy0.conf (phy wlan0) --> new PHY
{Timestamp redacted} kern.info kernel: [   37.445597] br-lan: port 2(wlan0) entered blocking state
{Timestamp redacted} kern.info kernel: [   37.456220] br-lan: port 2(wlan0) entered disabled state
{Timestamp redacted} kern.info kernel: [   37.467162] device wlan0 entered promiscuous mode
{Timestamp redacted} kern.info kernel: [   37.597174] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
{Timestamp redacted} kern.info kernel: [   37.610090] br-lan: port 2(wlan0) entered blocking state
{Timestamp redacted} kern.info kernel: [   37.620664] br-lan: port 2(wlan0) entered forwarding state
{Timestamp redacted} daemon.notice hostapd: wlan0: interface state UNINITIALIZED->ENABLED
{Timestamp redacted} daemon.notice hostapd: wlan0: AP-ENABLED
{Timestamp redacted} daemon.notice netifd: bridge 'br-lan' link is up
{Timestamp redacted} daemon.notice netifd: Interface 'lan' has link connectivity
{Timestamp redacted} kern.info kernel: [   37.857326] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
{Timestamp redacted} daemon.err odhcpd[1258]: Failed to send to ff02::1%lan@br-lan (Address not available)
{Timestamp redacted} daemon.notice netifd: Wireless device 'radio0' is now up
{Timestamp redacted} daemon.notice netifd: Network device 'wlan0' link is up
{Timestamp redacted} daemon.info dnsmasq[1]: exiting on receipt of SIGTERM
{Timestamp redacted} daemon.info dnsmasq[1]: started, version 2.86 cachesize 150
{Timestamp redacted} daemon.info dnsmasq[1]: DNS service limited to local subnets
{Timestamp redacted} daemon.info dnsmasq[1]: compile time options: IPv6 GNU-getopt no-DBus UBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-cryptohash no-DNSSEC no-ID loop-detect inotify dumpfile
{Timestamp redacted} daemon.info dnsmasq[1]: UBus support enabled: connected to system bus
{Timestamp redacted} daemon.info dnsmasq-dhcp[1]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for test
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for onion
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for localhost
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for local
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for invalid
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for bind
{Timestamp redacted} daemon.info dnsmasq[1]: using only locally-known addresses for lan
{Timestamp redacted} daemon.warn dnsmasq[1]: no servers found in /tmp/resolv.conf.d/resolv.conf.auto, will retry
{Timestamp redacted} daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
{Timestamp redacted} daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
{Timestamp redacted} daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses
{Timestamp redacted} daemon.info dnsmasq[1]: read /etc/hosts - 4 addresses
{Timestamp redacted} daemon.info dnsmasq[1]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
{Timestamp redacted} daemon.info dnsmasq-dhcp[1]: read /etc/ethers - 0 addresses

I did a search for the PCI IDs you mentioned to check which kmods are supported. The C20v5 lists them in its boot log. The SoC seems to be the same as in the RE200v4 as well, but the 5GHz WiFi is a separate chip not included in the SoC.

How can I get a list of such relevant kmods? I already tried installing bunch of different mt76xx packages via opkg without any success... Should I check C20v5 makefile?

Yeah, but the Makefile only mentions the kmod-mt760xe which you already have. However, we don't know whether your dts is correct, you didn't post it yet (as there is no mention of the 5GHz WiFi, it is likely not enabled in the dts). And according to the boot log, there is something wrong with your kernel partition setup!

Contents of target/linux/ramips/dts/mt7628an_tplink_re190-v4.dts (based on RE200v4 with minor string-replaces):

#include "mt7628an_tplink_re190.dtsi"

/ {
	compatible = "tplink,re190-v4", "mediatek,mt7628an-soc";
	model = "TP-Link RE190 v4";

	leds {
		wifi_red {
			label = "red:wifi";
			gpios = <&gpio 40 GPIO_ACTIVE_LOW>;
		};
	};
};

&led_power {
	gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
};

Contents of target/linux/ramips/dts/mt7628an_tplink_re190.dtsi (again, based on RE200v4):

#include "mt7628an.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

/ {
	aliases {
		label-mac-device = &ethernet;
		led-boot = &led_power;
		led-failsafe = &led_power;
		led-running = &led_power;
		led-upgrade = &led_power;
	};

	chosen {
		bootargs = "console=ttyS0,57600n8";
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_RESTART>;
		};

		wps {
			label = "wps";
			gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
			linux,code = <KEY_WPS_BUTTON>;
		};
	};

	leds {
		compatible = "gpio-leds";

		wps {
			label = "green:wps";
			gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
		};

		wifi {
			label = "green:wifi";
			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
		};

		lan {
			label = "green:lan";
			gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
		};

		led_power: power {
			label = "green:power";
		};

		wifi2g_green {
			label = "green:wifi2g";
			gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy0tpt";
		};

		wifi5g_green {
			label = "green:wifi5g";
			gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
			linux,default-trigger = "phy1tpt";
		};
	};
};

&spi0 {
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "u-boot";
				reg = <0x0 0x20000>;
				read-only;
			};

			partition@20000 {
				compatible = "tplink,firmware";
				label = "firmware";
				reg = <0x20000 0x7a0000>;
			};

			config: partition@7c0000 {
				label = "config";
				reg = <0x7c0000 0x30000>;
				read-only;
			};

			radio: partition@7f0000 {
				label = "radio";
				reg = <0x7f0000 0x10000>;
				read-only;
			};
		};
	};
};

&state_default {
	gpio {
		groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an",
				"p0led_an", "wled_an", "i2c", "wdt", "refclk";
		function = "gpio";
	};
};

&ethernet {
	nvmem-cells = <&macaddr_config_2008>;
	nvmem-cell-names = "mac-address";
};

&wmac {
	status = "okay";

	mediatek,mtd-eeprom = <&radio 0x0>;

	nvmem-cells = <&macaddr_config_2008>;
	nvmem-cell-names = "mac-address";
	mac-address-increment = <1>;
};

&pcie {
	status = "okay";
};

&pcie0 {
	mt76@0,0 {
		reg = <0x0000 0 0 0 0>;
		mediatek,mtd-eeprom = <&radio 0x8000>;
		ieee80211-freq-limit = <5000000 6000000>;
		nvmem-cells = <&macaddr_config_2008>;
		nvmem-cell-names = "mac-address";
		mac-address-increment = <2>;
	};
};

&config {
	compatible = "nvmem-cells";
	#address-cells = <1>;
	#size-cells = <1>;

	macaddr_config_2008: macaddr@2008 {
		reg = <0x2008 0x6>;
	};
};

Hm, I can't spot anything obviously wrong...
Could you check if you really have the module mt76x0e in your firmware (lsmod and/or in/lib/modules/5.*)

When experimenting with the build system, it often happens that the kernel modules selected in the image Makefile are not built. I always run make menuconfig to make sure that the correct kernel modules are included in the build.

This was the culprit. So, even though I already troubleshooted missing kmods by installing all the mt-related opkg packages, I am not sure why it didn't work the last time. Anyhow, installed kmod-mt76x0e, rebooted & 802.11ac module appeared.
Thank you for your efforts in helping me (and any other future community member who will be an owner of this device model) troubleshoot the device support.
Now, everything needs to be documented, wiki docs written, PR created (containing updated makefile(s), DTS(I) & tplink-safeloader), and the device will become supported.
Also, how would I go about fixing the kernel partition layout, as indicated by a warning / error message in the boot log?

2 Likes

Hm, I'm not sure: the dynamic rootfs split is calculated by the build system and I don't know exactly what causes this.

1 Like

@edupaag I'm curious, were you able to get the build working without ever hooking up serial?