Hello,
been using OpenWrt 19.07 on a TL-MR3020 for quite a while, and would like to upgrade to the latest 21.02, but I can't get a custom build to work.
First of all, yes, I know it is a 4/32 router and shouldn't be supported, but long ago I soldered in an 8MB SPI flash and rebuilt uboot, it's been working with 19.07 ever since.
Now, to build openwrt I am applying the following patch (basically the same I was using with 19.07):
diff --git a/target/linux/ath79/image/tiny-tp-link.mk b/target/linux/ath79/image/tiny-tp-link.mk
index c918c6baa6..a123a3a8bd 100644
--- a/target/linux/ath79/image/tiny-tp-link.mk
+++ b/target/linux/ath79/image/tiny-tp-link.mk
@@ -11,8 +11,7 @@ endef
TARGET_DEVICES += tplink_tl-mr10u
define Device/tplink_tl-mr3020-v1
- $(Device/tplink-4mlzma)
- IMAGE_SIZE := 3840k
+ $(Device/tplink-8mlzma)
SOC := ar9331
DEVICE_MODEL := TL-MR3020
DEVICE_VARIANT := v1
but the resulting firmware enters a bootloop trying to find the start of the jffs2 partition, here's an excerpt of the bootlogs taken via serial port:
[ 0.321141] spi-nor spi0.0: s25fl064k (8192 Kbytes)
[ 0.324666] 4 fixed-partitions partitions found on MTD device spi0.0
[ 0.330925] Creating 4 MTD partitions on "spi0.0":
[ 0.335713] 0x000000000000-0x000000020000 : "u-boot"
[ 0.342249] 0x000000020000-0x0000003e0000 : "firmware"
[ 0.350243] 2 tplink-fw partitions found on MTD device firmware
[ 0.354807] Creating 2 MTD partitions on "firmware":
[ 0.359692] 0x000000000000-0x000000174330 : "kernel"
[ 0.366123] 0x000000174330-0x0000003c0000 : "rootfs"
[ 0.371249] mtd: device 3 (rootfs) set to be root filesystem
[ 0.378182] mtdsplit: squashfs has invalid size in "rootfs"
[ 0.382466] 0x0000003e0000-0x0000003f0000 : "config"
[ 0.388813] 0x0000003f0000-0x000000400000 : "art"
...
[ 1.127925] Flash size not aligned to erasesize, reducing to 2348KiB
[ 1.133403] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000000: 0x6873 instead
[ 1.142353] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000004: 0xf504 instead
[ 1.151772] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000008: 0xef20 instead
[ 1.161233] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000010: 0x0c00 instead
[ 1.170695] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000014: 0x0400 instead
[ 1.180156] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000018: 0xc004 instead
[ 1.189619] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0000001c: 0x0400 instead
[ 1.199081] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000020: 0xcb03 instead
[ 1.208541] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000028: 0xcea2 instead
[ 1.218003] jffs2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00000030: 0xc6a2 instead
[ 1.227458] jffs2: Further such events for this erase block will not be printed
[ 1.235820] jffs2: Empty flash at 0x00000038 ends at 0x00000040
[ 1.241145] jffs2: Old JFFS2 bitmask found at 0x00000fc8
[ 1.245945] jffs2: You cannot use older JFFS2 filesystems with newer kernels
for comparison, here's the bootlogs of the previous openwrt 19.07 I reinstalled while i figure out how to fix this (this is the first boot after flashing):
[ 0.564319] m25p80 spi0.0: found s25fl064k, expected m25p80
[ 0.580728] m25p80 spi0.0: s25fl064k (8192 Kbytes)
[ 0.584442] 5 tp-link partitions found on MTD device spi0.0
[ 0.589667] Creating 5 MTD partitions on "spi0.0":
[ 0.594410] 0x000000000000-0x000000020000 : "u-boot"
[ 0.601391] 0x000000020000-0x000000164628 : "kernel"
[ 0.608070] 0x000000164628-0x0000007f0000 : "rootfs"
[ 0.612760] mtd: device 2 (rootfs) set to be root filesystem
[ 0.617363] 1 squashfs-split partitions found on MTD device rootfs
[ 0.623406] 0x0000003b0000-0x0000007f0000 : "rootfs_data"
[ 0.632152] 0x0000007f0000-0x000000800000 : "art"
[ 0.637554] 0x000000020000-0x0000007f0000 : "firmware"
...
[ 58.004393] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[ 58.016717] jffs2_build_filesystem(): unlocking the mtd device...
[ 58.016800] done.
[ 58.023435] jffs2_build_filesystem(): erasing all blocks after the end marker...
it's as-if the partitions in the new build are wrong and still refer to the 4MB flash size despite my attempt to tell the build system we have 8MB flash... any idea how to fix this?