TRENDnet TEW-691GR stuck in kernel panic loop after switching to OpenWrt

It is Wednesday my dudes! Hello!
I’ve had this rather old router lying around doing nothing — TEW-691GR — and I thought maybe it’s the perfect specimen to try my newbie OpenWrt skills on.
The firmware selector told me that release 23.05.5 is compatible, so I downloaded that. The wiki page did not contain any custom instructions on how to do the preliminary flashing, so I went the generic way: logged into the stock web UI and uploaded openwrt-23.05.5-ramips-rt3883-trendnet_tew-691gr-squashfs-factory.bin on the firmware update page.
The upload process went OK (or so it seemed), the router rebooted itself... and has been stuck in the reboot loop ever since.
Thank the balls the router has TTL-UART (3.3V, 57600 8-N-1). The photo on the wiki page contains the pinout. I’ve obtained the boot log, which contains the following (infinitely repeated) info:

Boot log
Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fac000
 Set info->start[0]=BC000000
flash_protect ON: from 0xBC000000 to 0xBC01F2EB
flash_protect ON: from 0xBC030000 to 0xBC030FFF
*** Warning - bad CRC, using default environment
============================================
Ralink UBoot Version: 3.4.0.0
--------------------------------------------
ASIC 3883_MP (MAC to VITESSE Mode)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: NOR Flash
Date:Sep 29 2010  Time:10:49:55
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768
 ##### The CPU freq = 480 MHZ ####
 SDRAM bus set to 32 bit
 SDRAM size =64 Mbytes
Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFT
4 3 2 1 0

3: System Boot system code via Flash.
## Booting image at bc050000 ...
   Image Name:   MIPS OpenWrt Linux-
   Created:      2024-09-23  12:34:46 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1837916 Bytes =  1.8 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64
Starting kernel ...
[    0.000000] Linux version 5.15.167 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24106-10cc5fcd00) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Mon Sep 23 12:34:46 2024
[    0.000000] SoC Type: Ralink RT3883 ver:1 eco:5
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is TRENDnet TEW-691GR
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 57648K/65536K available (4534K kernel code, 581K rwdata, 700K rodata, 1216K init, 206K bss, 7888K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 480MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7963585194 ns
[    0.000003] sched_clock: 32 bits at 240MHz, resolution 4ns, wraps every 8947848189ns
[    0.015597] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[    0.097846] pid_max: default: 32768 minimum: 301
[    0.108021] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.122476] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.147269] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.166796] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.180333] pinctrl core: initialized pinctrl subsystem
[    0.192883] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.205542] thermal_sys: Registered thermal governor 'step_wise'
[    0.223843] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.246836] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.259728] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.274403] clocksource: Switched to clocksource MIPS
[    0.286764] NET: Registered PF_INET protocol family
[    0.296741] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.312560] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.329369] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.344685] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.359924] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.373937] TCP: Hash tables configured (established 1024 bind 1024)
[    0.386809] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.399835] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.414145] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.425425] PCI: CLS 0 bytes, default 32
[    0.433462] rt-timer 10000100.timer: maximum frequency is 4882Hz
[    0.451621] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.470877] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.482439] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.503927] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.521756] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.539040] printk: console [ttyS0] disabled
[    0.547620] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.567302] printk: console [ttyS0] enabled
[    0.567302] printk: console [ttyS0] enabled
[    0.583857] printk: bootconsole [early0] disabled
[    0.583857] printk: bootconsole [early0] disabled
[    0.604861] physmap-flash 1c000000.flash: physmap platform flash device: [mem 0x1c000000-0x1c7fffff]
[    0.623240] 1c000000.flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022a7
[    0.643618] Amd/Fujitsu Extended Query Table at 0x0040
[    0.653911]   Amd/Fujitsu Extended Query version 1.1.
[    0.664000] 1c000000.flash: Swapping erase regions for top-boot CFI table.
[    0.677719] number of CFI chips: 1
[    0.708567] 4 fixed-partitions partitions found on MTD device 1c000000.flash
[    0.723919] Creating 4 MTD partitions on "1c000000.flash":
[    0.735056] 0x000000000000-0x000000030000 : "u-boot"
[    0.750003] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.762393] 0x000000040000-0x000000050000 : "factory"
[    0.776894] 0x000000050000-0x000000800000 : "firmware"
[    0.787275] mtd: partition "firmware" extends beyond the end of device "1c000000.flash" -- size truncated to 0x3b0000
[    0.811486] 2 uimage-fw partitions found on MTD device firmware
[    0.823396] Creating 2 MTD partitions on "firmware":
[    0.833408] 0x000000000000-0x0000001c0b9c : "kernel"
[    0.843340] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.862637] 0x0000001c0b9c-0x0000003b0000 : "rootfs"
[    0.872664] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.892623] mtd: setting mtd5 (rootfs) as root device
[    0.902825] mtdsplit: squashfs has invalid size in "rootfs"
[    0.939153] switch0: Atheros AR8316 rev. 1 switch registered on mdio-bus
[    0.952938] ar8316: Using port 4 as switch port
[    1.002723] mtk_soc_eth 10100000.ethernet: connected port 0 to PHY at mdio-bus:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]
[    1.027728] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.045556] rt2880_wdt 10000120.watchdog: Initialized
[    1.058027] NET: Registered PF_INET6 protocol family
[    1.077573] Segment Routing with IPv6
[    1.085182] In-situ OAM (IOAM) with IPv6
[    1.093252] NET: Registered PF_PACKET protocol family
[    1.103476] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.129784] 8021q: 802.1Q VLAN Support v1.8
[    1.141031] clk: Disabling unused clocks
[    1.150886] Flash size not aligned to erasesize, reducing to 1920KiB
[    1.163906] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x7368 instead
[    1.182937] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0x052a instead
[    1.201886] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0x6066 instead
[    1.220807] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x000f instead
[    1.239723] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x0004 instead
[    1.258673] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0x02c0 instead
[    1.277601] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x0004 instead
[    1.296524] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0x09fb instead
[    1.315450] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028: 0x8914 instead
[    1.334369] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000030: 0x890c instead
[    1.353296] jffs2: Further such events for this erase block will not be printed
[    1.368165] jffs2: Empty flash at 0x00000038 ends at 0x00000040
[    1.390165] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00010000: 0x2393 instead
...(a hundred more messages like this)...
[    4.991952] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00110020: 0x55dc instead
[    5.010876] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00110024: 0xf8fe instead
[    5.029794] jffs2: Further such events for this erase block will not be printed
[    5.046146] jffs2: Old JFFS2 bitmask found at 0x00112bcc
[    5.056742] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[    5.073740] jffs2: Old JFFS2 bitmask found at 0x001174c4
[    5.084339] jffs2: You cannot use older JFFS2 filesystems with newer kernels
[    5.103590] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00120000: 0x538b instead
[    5.122519] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00120004: 0x6655 instead
...
[    7.653166] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x001d0024: 0x10ec instead
[    7.672082] jffs2: Further such events for this erase block will not be printed
[    7.697103] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[    7.713932] jffs2: empty_blocks 0, bad_blocks 0, c->nr_blocks 30
[    7.726029] VFS: Cannot open root device "(null)" or unknown-block(31,5): error -5
[    7.741155] Please append a correct "root=" boot option; here are the available partitions:
[    7.757826] 1f00             192 mtdblock0
[    7.757846]  (driver?)
[    7.770877] 1f01              64 mtdblock1
[    7.770893]  (driver?)
[    7.783920] 1f02              64 mtdblock2
[    7.783937]  (driver?)
[    7.796976] 1f03            3776 mtdblock3
[    7.796993]  (driver?)
[    7.810018] 1f04            1794 mtdblock4
[    7.810035]  (driver?)
[    7.823060] 1f05            1981 mtdblock5
[    7.823076]  (driver?)
[    7.836112] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,5)
[    7.852761] Rebooting in 1 seconds..

It seems to me that flash memory is faulty, but I might be wrong. U-Boot is working, but not much else. Can somebody knowledgeable tell me what’s happening please?
And one more thing — from what I’ve gathered online, it seems that TEW-691GR is not a good candidate to be converted to OpenWrt, so it would be wise just go back to the stock firmware and forget the whole thing. Can anybody provide the necessary steps?
Thank you.

If you check the git commits, it was added in 2012, altered in 2016 and last updated in 2019:

https://git.openwrt.org/?p=openwrt%2Fopenwrt.git&a=search&h=HEAD&st=commit&s=TEW-691GR

I would try loading 23.05.4 via TFTP, while the TEW-691GR is supported, it does not have a huge userbase.

You can use bootloader option 1: Load system code to SDRAM via TFTP. to load initramfs image and then upload sysupgrade image.

Thanks for the replies guys! I’m gonna try to follow your suggestions and will report back.

Okay. Here’s what I have so far.
First, I tried the boot command line interface. And I found myself inside some custom U-Boot version with a limited set of commands and weird environment variables:

UART log for operation mode 4
U-Boot 1.1.3 (Sep 29 2010 - 10:49:55)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fac000

 Set info->start[0]=BC000000
flash_protect ON: from 0xBC000000 to 0xBC01F2EB
flash_protect ON: from 0xBC030000 to 0xBC030FFF
============================================
Ralink UBoot Version: 3.4.0.0
--------------------------------------------
ASIC 3883_MP (MAC to VITESSE Mode)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: NOR Flash
Date:Sep 29 2010  Time:10:49:55
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 480 MHZ ####

 SDRAM bus set to 32 bit
 SDRAM size =64 Mbytes

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
4

You choosed 4

 0


4: System Enter Boot Command Line Interface.

U-Boot 1.1.3 (Sep 29 2010 - 10:49:55)

RT3883 # help
?       - alias for 'help'
bootm   - boot application image from memory
cp      - memory copy
erase   - erase FLASH memory
go      - start application at address 'addr'
help    - print online help
loadb   - load binary file over serial line (kermit mode)
md      - memory display
mdio   - Ralink PHY register R/W command !!
mm      - memory modify (auto-incrementing)
mw      - memory write (fill)
nm      - memory modify (constant address)
ping   - kaiker,send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
reset   - Perform RESET of the CPU
rf      - read/write rf register
saveenv - save environment variables to persistent storage
setenv  - set environment variables
spicmd - read/write data from/to eeprom or vtss
tftpboot- boot image via network using TFTP protocol
version - print monitor version

RT3883 # printenv
bootcmd=tftp
bootdelay=5
baudrate=57600
ethaddr="00:AA:BB:CC:DD:10"
ipaddr=10.10.10.123
serverip=10.10.10.3
ramargs=setenv bootargs root=/dev/ram rw
addip=setenv bootargs $(bootargs) ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask):$(hostname):$(netdev):off
addmisc=setenv bootargs $(bootargs) console=ttyS0,$(baudrate) ethaddr=$(ethaddr) panic=1
flash_self=run ramargs addip addmisc;bootm $(kernel_addr) $(ramdisk_addr)
kernel_addr=BFC40000
u-boot=u-boot.bin
load=tftp 8A100000 $(u-boot)
u_b=protect off 1:0-1;era 1:0-1;cp.b 8A100000 BC400000 $(filesize)
loadfs=tftp 8A100000 root.cramfs
u_fs=era bc540000 bc83ffff;cp.b 8A100000 BC540000 $(filesize)
test_tftp=tftp 8A100000 root.cramfs;run test_tftp
stdin=serial
stdout=serial
stderr=serial
ethact=Eth0 (10/100-M)
Environment size: 765/4092 bytes

RT3883 # ping 10.10.10.3
NetTxPacket = 0x83FE3580
KSEG1ADDR(NetTxPacket) = 0xA3FE3580
NetLoop,call eth_halt !
NetLoop,call eth_init !
Trying Eth0 (10/100-M)
Detecting to PHY address
Find PHY at address 0x00, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x01, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x02, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x03, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x04, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x05, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x06, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x07, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x08, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x09, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0A, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0B, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0C, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0D, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0E, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0F, PHY ID0=0xFFFF, PHY ID1=0x
Waiting for RX_DMA_BUSY status Start... done
Vitesse giga Mac support 2
GPIO pin 24 reset to switch
Init AR8316
phyUnit=0,phyBase=0,phyAddr=0,phyHwStatus =0xbc5c
eth0: Phy Specific Status=bc5c
phyUnit=1,phyBase=0,phyAddr=1,phyHwStatus =0x10
eth0: Phy Specific Status=0010
phyUnit=2,phyBase=0,phyAddr=2,phyHwStatus =0x10
eth0: Phy Specific Status=0010
phyUnit=3,phyBase=0,phyAddr=3,phyHwStatus =0x10
eth0: Phy Specific Status=0010
Livelinks=1
Header Payload scatter function is Disable !!
ETH_STATE_ACTIVE!!
Ping,nothing!
Using Eth0 (10/100-M) device
kaiker,PingSend, sending ARP for 640a0a0a
Got ARP REPLY, set server/gtwy eth addr (00:AA:BB:CC:DD:20)
Got it
ping failed; host 10.10.10.3 is not alive

Then I set the netmask variable to 255.255.255.0, just to be safe, and saved it to flash.

Then I launched Tftpd64 on my computer, made sure that OpenWrt 23.05.4 factory.bin is being shared, and rebooted the router. The boot menu came up, I chose 1. Load system code to SDRAM via TFTP and entered the correct filename at the prompt. TFTP session went OK, the image started to boot, but unfortunately the output from the kernel was almost exactly the same as in my original post:

UART log for flashing of 23.05.4
U-Boot 1.1.3 (Sep 29 2010 - 10:49:55)

Board: Ralink APSoC DRAM:  64 MB
relocate_code Pointer at: 83fac000

 Set info->start[0]=BC000000
flash_protect ON: from 0xBC000000 to 0xBC01F2EB
flash_protect ON: from 0xBC030000 to 0xBC030FFF
============================================
Ralink UBoot Version: 3.4.0.0
--------------------------------------------
ASIC 3883_MP (MAC to VITESSE Mode)
DRAM component: 512 Mbits DDR, width 16
DRAM bus: 16 bit
Total memory: 64 MBytes
Flash component: NOR Flash
Date:Sep 29 2010  Time:10:49:55
============================================
icache: sets:512, ways:4, linesz:32 ,total:65536
dcache: sets:256, ways:4, linesz:32 ,total:32768

 ##### The CPU freq = 480 MHZ ####

 SDRAM bus set to 32 bit
 SDRAM size =64 Mbytes

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.
 1
1
You choosed 1

 0


1: System Load Linux to SDRAM via TFTP.
 Please Input new ones /or Ctrl-C to discard
    Input device IP (10.10.10.123) ==:10.10.10.123
    Input server IP (10.10.10.3) ==:10.10.10.3
    Input Linux Kernel filename (factory.bin) ==:factory.bin

 netboot_common, argc= 3

 NetTxPacket = 0x83FE3580

 KSEG1ADDR(NetTxPacket) = 0xA3FE3580

 NetLoop,call eth_halt !

 NetLoop,call eth_init !
Trying Eth0 (10/100-M)
Detecting to PHY address
Find PHY at address 0x00, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x01, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x02, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x03, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x04, PHY ID0=0x004D, PHY ID1=0xD041
Find PHY at address 0x05, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x06, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x07, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x08, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x09, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0A, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0B, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0C, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0D, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0E, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x0F, PHY ID0=0xFFFF, PHY ID1=0xFFFF
Find PHY at address 0x10, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x11, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x12, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x13, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x14, PHY ID0=0x4004, PHY ID1=0x0000
Find PHY at address 0x15, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x16, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x17, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x18, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x19, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x1A, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x1B, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x1C, PHY ID0=0x4004, PHY ID1=0x0000
Find PHY at address 0x1D, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x1E, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x1F, PHY ID0=0x0000, PHY ID1=0x0000
Find PHY at address 0x20, PHY ID0=0x004D, PHY ID1=0xD041

 Waiting for RX_DMA_BUSY status Start... done

 Vitesse giga Mac support 2

 GPIO pin 24 reset to switch
Init AR8316
phyUnit=0,phyBase=0,phyAddr=0,phyHwStatus =0xbc5c
eth0: Phy Specific Status=bc5c
phyUnit=1,phyBase=0,phyAddr=1,phyHwStatus =0x10
eth0: Phy Specific Status=0010
phyUnit=2,phyBase=0,phyAddr=2,phyHwStatus =0x10
eth0: Phy Specific Status=0010
phyUnit=3,phyBase=0,phyAddr=3,phyHwStatus =0x10
eth0: Phy Specific Status=0010
Livelinks=1

 Header Payload scatter function is Disable !!

 ETH_STATE_ACTIVE!!
Using Eth0 (10/100-M) device
TFTP from server 10.10.10.3; our IP address is 10.10.10.123
Filename 'factory.bin'.

 TIMEOUT_COUNT=10,Load address: 0x80800000
Loading: Got ARP REPLY, set server/gtwy eth addr (00:AA:BB:CC:DD:20)
Got it
#################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #################################################################
     #####################################
done
Bytes transferred = 5177348 (4f0004 hex)
NetBootFileXferSize= 004f0004
File: env_flash.c, Func: saveenv, Line: 302
copy old content: sect_addr: BC030000  env_addr: BC030000  offset: 00000000
Protect off BC030000 ... BC03FFFF

 b_end =BC7FFFFF
Un-Protecting sectors 3..3 in bank 1
Un-Protected 1 sectors
Erasing Flash...
 b_end =BC7FFFFF
Erase Flash from 0xbc030000 to 0xbc03ffff in Bank # 1

 erase sector  = 3
sect = 3,s_last = 3,erase poll = 1200344
 done
Erased 1 sectors
Writing to Flash... done

 b_end =BC7FFFFF
Protecting sectors 3..3 in bank 1
Protected 1 sectors
Automatic boot of image at addr 0x80800000 ...
## Booting image at 80800000 ...
   Image Name:   MIPS OpenWrt Linux-
   Created:      2024-07-15  22:14:18 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1836925 Bytes =  1.8 MB
   Load Address: 80000000
   Entry Point:  80000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
No initrd
## Transferring control to Linux (at address 80000000) ...
## Giving linux memsize in MB, 64

Starting kernel ...

[    0.000000] Linux version 5.15.162 (builder@buildhost) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 12.3.0 r24012-d8dd03c46f) 12.3.0, GNU ld (GNU Binutils) 2.40.0) #0 Mon Jul 15 22:14:18 2024
[    0.000000] SoC Type: Ralink RT3883 ver:1 eco:5
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is TRENDnet TEW-691GR
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,57600 rootfstype=squashfs,jffs2
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes, linear)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 57648K/65536K available (4531K kernel code, 575K rwdata, 700K rodata, 1224K init, 206K bss, 7888K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 256
[    0.000000] CPU Clock: 480MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7963585194 ns
[    0.000002] sched_clock: 32 bits at 240MHz, resolution 4ns, wraps every 8947848189ns
[    0.015593] Calibrating delay loop... 239.61 BogoMIPS (lpj=1198080)
[    0.097845] pid_max: default: 32768 minimum: 301
[    0.108036] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.122497] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.147637] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.167168] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.180705] pinctrl core: initialized pinctrl subsystem
[    0.193262] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.205917] thermal_sys: Registered thermal governor 'step_wise'
[    0.224702] rt2880_gpio 10000600.gpio: registering 24 gpios
[    0.247696] rt2880_gpio 10000600.gpio: registering 24 irq handlers
[    0.260591] rt2880_gpio 10000638.gpio: registering 16 gpios
[    0.275308] clocksource: Switched to clocksource MIPS
[    0.287688] NET: Registered PF_INET protocol family
[    0.297661] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.313472] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.330285] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.345594] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.360837] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.374852] TCP: Hash tables configured (established 1024 bind 1024)
[    0.387723] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.400749] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.415068] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.426347] PCI: CLS 0 bytes, default 32
[    0.434375] rt-timer 10000100.timer: maximum frequency is 4882Hz
[    0.452540] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.471835] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.483398] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.504916] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.522819] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.540223] printk: console [ttyS0] disabled
[    0.548800] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20, base_baud = 2500000) is a Palmchip BK-3103
[    0.568480] printk: console [ttyS0] enabled
[    0.568480] printk: console [ttyS0] enabled
[    0.585034] printk: bootconsole [early0] disabled
[    0.585034] printk: bootconsole [early0] disabled
[    0.606068] physmap-flash 1c000000.flash: physmap platform flash device: [mem 0x1c000000-0x1c7fffff]
[    0.624473] 1c000000.flash: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0022a7
[    0.644838] Amd/Fujitsu Extended Query Table at 0x0040
[    0.655128]   Amd/Fujitsu Extended Query version 1.1.
[    0.665214] 1c000000.flash: Swapping erase regions for top-boot CFI table.
[    0.678929] number of CFI chips: 1
[    0.710051] 4 fixed-partitions partitions found on MTD device 1c000000.flash
[    0.725514] Creating 4 MTD partitions on "1c000000.flash":
[    0.736587] 0x000000000000-0x000000030000 : "u-boot"
[    0.751588] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.763985] 0x000000040000-0x000000050000 : "factory"
[    0.778559] 0x000000050000-0x000000800000 : "firmware"
[    0.788917] mtd: partition "firmware" extends beyond the end of device "1c000000.flash" -- size truncated to 0x3b0000
[    0.811896] 2 uimage-fw partitions found on MTD device firmware
[    0.823804] Creating 2 MTD partitions on "firmware":
[    0.833787] 0x000000000000-0x0000001c0b9c : "kernel"
[    0.843707] mtd: partition "kernel" doesn't end on an erase/write block -- force read-only
[    0.864131] 0x0000001c0b9c-0x0000003b0000 : "rootfs"
[    0.874157] mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only
[    0.894144] mtd: setting mtd5 (rootfs) as root device
[    0.904346] mtdsplit: squashfs has invalid size in "rootfs"
[    0.941065] switch0: Atheros AR8316 rev. 1 switch registered on mdio-bus
[    0.954846] ar8316: Using port 4 as switch port
[    1.003616] mtk_soc_eth 10100000.ethernet: connected port 0 to PHY at mdio-bus:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]
[    1.028634] mtk_soc_eth 10100000.ethernet eth0: mediatek frame engine at 0xb0100000, irq 5
[    1.046473] rt2880_wdt 10000120.watchdog: Initialized
[    1.058988] NET: Registered PF_INET6 protocol family
[    1.078644] Segment Routing with IPv6
[    1.086248] In-situ OAM (IOAM) with IPv6
[    1.094309] NET: Registered PF_PACKET protocol family
[    1.104529] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.130843] 8021q: 802.1Q VLAN Support v1.8
[    1.142098] clk: Disabling unused clocks
[    1.151967] Flash size not aligned to erasesize, reducing to 1920KiB
[    1.164984] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x7368 instead
...1000 more of these...
[    7.645822] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x001d0024: 0x10ec instead
[    7.664743] jffs2: Further such events for this erase block will not be printed
[    7.689352] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
[    7.706182] jffs2: empty_blocks 0, bad_blocks 0, c->nr_blocks 30
[    7.718277] VFS: Cannot open root device "(null)" or unknown-block(31,5): error -5
[    7.733389] Please append a correct "root=" boot option; here are the available partitions:
[    7.750053] 1f00             192 mtdblock0
[    7.750074]  (driver?)
[    7.763101] 1f01              64 mtdblock1
[    7.763116]  (driver?)
[    7.776161] 1f02              64 mtdblock2
[    7.776178]  (driver?)
[    7.789199] 1f03            3776 mtdblock3
[    7.789216]  (driver?)
[    7.802237] 1f04            1794 mtdblock4
[    7.802253]  (driver?)
[    7.815275] 1f05            1981 mtdblock5
[    7.815303]  (driver?)
[    7.828324] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,5)
[    7.844972] Rebooting in 1 seconds..

After that, I tried repeating the same process with the oldest OpenWrt version I could find (19.07.4), and it also was unsuccessful. Same things came up in the log.

Am I missing something? Do I need to alter the variables somehow before trying to boot anything again?