/proc/mtd messed up with 21.02.02

Hello,
I have modified a TP-Link WDR4300 to use a bigger flash-chip and u-boot_mod.

Until now, this has worked without a problem.

*********************************************
*   U-Boot 1.1.4  (Nov 19 2014, 09:48:01)   *
*********************************************

DB120 (AR9344) U-Boot for TL-WDR3600/43x0

DRAM:   128 MB DDR2 32-bit
FLASH:  Winbond W25Q128 (16 MB)
CLOCKS: 560/450/225/28 MHz (CPU/RAM/AHB/SPI)

The Kernel reads the MTD form flash and uses it (19.07.7):

[    0.660235] 5 tp-link partitions found on MTD device spi0.0
[    0.665888] Creating 5 MTD partitions on "spi0.0":
[    0.670787] 0x000000000000-0x000000020000 : "u-boot"
[    0.677151] 0x000000020000-0x0000001a428c : "kernel"
[    0.684222] 0x0000001a428c-0x000000ff0000 : "rootfs"
[    0.690091] mtd: device 2 (rootfs) set to be root filesystem
[    0.695872] 1 squashfs-split partitions found on MTD device rootfs
[    0.702191] 0x000000410000-0x000000ff0000 : "rootfs_data"
[    0.709946] 0x000000ff0000-0x000001000000 : "art"
[    0.716030] 0x000000020000-0x000000ff0000 : "firmware"

But with 21.02.02 the flash layout is interpreted wrong:

Wed Feb 16 20:29:18 2022 kern.info kernel: [    0.368791] spi-nor spi0.0: w25q128 (16384 Kbytes)
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.373718] 3 fixed-partitions partitions found on MTD device spi0.0
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.380180] Creating 3 MTD partitions on "spi0.0":
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.385073] 0x000000000000-0x000000020000 : "u-boot"
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.391146] 0x000000020000-0x0000007f0000 : "firmware"
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.399368] 2 tplink-fw partitions found on MTD device firmware
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.405437] Creating 2 MTD partitions on "firmware":
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.410502] 0x000000000000-0x0000001f473e : "kernel"
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.416539] 0x0000001f4740-0x0000007d0000 : "rootfs"
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.422535] mtd: device 3 (rootfs) set to be root filesystem
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.430199] 1 squashfs-split partitions found on MTD device rootfs
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.436539] 0x000000520000-0x0000007d0000 : "rootfs_data"
Wed Feb 16 20:29:18 2022 kern.notice kernel: [    0.443039] 0x0000007f0000-0x000000800000 : "art"

Any suggestions how to fix this?

Have you modified the device DTS, where the partition sizes are defined.

I guess that with 19.07 you used ar71xx, and now with 21.02 you have ath79?

2 Likes

Custom hardware means custom firmware, you'll have to build your own patched firmware from source (and keep doing so). The flash partitioning is hardcoded in the dts, it can't be autodetected (which was possible in the mach file based ar71xx).

2 Likes