[WIP] Porting Mikrotik RB2011 to ath79 - testers needed

What model is that? RB2011L... or similar? L stands for Lite edition with a couple of features disabled. These have 64M and I had one once. I never got the serial working from the exposed pins. I figured out the lanes weren't connected properly and you have to patch the lanes from the SOC directly.

But I remember now in which shelf this PCB collects dust, maybe I can get my hands on it again. I'll need to ask a friend.

Edit: Ah, NVM. Just saw now @Leo-PL already successfully tested flashing one of these. @g6094199 Have you tried restoring RouterOS to fixup possible badblocks?

i dont believe in a worn chip cause the unit was never in duty. else the chip would be bad from fractory.
i payed around a bit today but i didnt get the initram version booting correctly. since i got it working in the past i have to figure out whats wrong right now.

anyway looking forward for you PR :heart: :heart: :heart:

there is no problem on ROS. we already discussed this last year ...somewhere above...

1 Like

It might be wise to upgrade routerboot to something more modern, like 6.4x. I wouldn't recommend going for v7.x just yet, I had issues booting OpenWrt on that one on other devices, even using new YAFUT images.

If the time permits, I'll try attaching to my 2011L serial debug header with a pogo clip and figure it out.

As for SFP, I've got the module to probe, but it doesn't look like SGMII SERDES on AR8237 port 6 is transmitting nor receiving anything.

im runnig 6.4. already but i use the 2nd bootloader for dhcp boot, which is 2.x

1 Like

I've submitted a PR:

3 Likes

@Leo-PL
our hero :heavy_heart_exclamation:

@Leo-PL God darnit. I almost replaced the switch. Maybe now I won't :stuck_out_tongue: :heart:

1 Like

I've been digging through threads you linked and I'm coming to conclusion, that the issue is caused by some particular NAND chips reporting different capabilities (subpage write support) while in fact they do not support it. The exact capability I had to enable, to get Meraki MR18 and Z1 off the ground.
For that, there are two options:

  • disable this capability altogether in ath79 NAND controller driver, as it was done before - which is not an option because it will break the Merakis, which have a pre-formatted UBI volume on them after installation,
  • Include a device tree knob - or find one, to ensure the capability remains disabled on RB2011, RB922, and the like - but this is a kludge, if introducing another device tree property is required for that. I've made a fix for this: https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=4f1b2cee3e6795d595ebfe201e0926456783c676 - but apparently setting those properties isn't enough to disable subpage writes. Even as seen on the RB2011, as the nand-ecc-step-size = <2048>; property is included there as well, in addition to nand-ecc-mode = "soft".
  • actually sum up the chips needing the quirks, test them, and submit fixes upstream to the Linux kernel mailing list. And long term, this is the preferred option.

If your device isn't able to function even after a fresh installation, with NAND volume erased and fresh UBI format, then it has to be caused some kind of quirk specific to the NAND chip - because, as I've already mentioned, I have two RB2011, one of which has NAND with subpage writes, other doesn't, and both work fine.
Getting a summary of problematic chips, so I could patch out the quirks, for you to test would be very, very helpful.

Also, @xback, do you still have the RB911/RB922 boards, that the NAND issues conflicting with the patch enabling subpage writes back, to get Merakis supported? I have a suspicion that the root cause may be different - wrong ECC parameters deduced by kernel vs what is currently written on flash, or different ECC parameters. If so, then the actual chip models and kernel logs from problematic models would be very helpful, maybe now we can finally fix that.

1 Like

I've made a test build for @g6094199 to check support of that problematic 64M Samsung NAND, and got this:

Due to id[2] = 0x5a it got misdetected as MLC, which made UBI refuse to operate altogether. But then I started digging into the datasheet, and every parameter returned previously (page size, OOB size, erase size, ECC strength) seems to match the datasheet. So I'm puzzled, as to what causes the issues now, because adding that NAND ID explicitly only worsened the situation.

@g6094199 or @a_sdt, could you dig out the old ar71xx image and provide me with the kernel logs from that one? Just booting initramfs should suffice, as it will show NAND and UBI parameters anyway.

@danijeltudek, do you still have your NAND patches for that 64M Samsung stashed somewhere?

@ReivilO, do you still have your device with that Gigadevice chip? I have a a test image that you can try.

@Leo-PL

OpenWrt kernel loader for AR7XXX/AR9XXX
MCopyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
MDecompressing kernel... done!
MStarting kernel at 80060000...

M[    0.000000] Linux version 4.14.162 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r10860-a3ffeb413b)) #0 Mon Jan 6 16:47:09 2020
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    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] random: get_random_bytes called from 0x80525740 with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: boot_part_size=4194304 gpio=249403 HZ=300000000 mem=64M kmac=D4:CA:6D:55:15:74 board=2011LS boot=0 mlc=2 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] MIPS: no machine found for id '2011LS', supported machines:
[    0.000000] id                       name
[    0.000000] Generic                  Generic AR71XX/AR724X/AR913X based board
[    0.000000] 2011G                    (null)
[    0.000000] 2011r5                   (null)
[    0.000000] 2011US                   (null)
[    0.000000] 2011L                    (null)
[    0.000000] 493G                     MikroTik RouterBOARD 493G
[    0.000000] 493                      MikroTik RouterBOARD 493/AH
[    0.000000] 450G                     MikroTik RouterBOARD 450G
[    0.000000] 450                      MikroTik RouterBOARD 450
[    0.000000] 435G                     MikroTik RouterBOARD 435G
[    0.000000] 433U                     MikroTik RouterBOARD 433UAH
[    0.000000] 433                      MikroTik RouterBOARD 433/AH
[    0.000000] 411U                     MikroTik RouterBOARD 411U
[    0.000000] 411                      MikroTik RouterBOARD 411/A/AH
[    0.000000] 751g                     MikroTik RouterBOARD 751G
[    0.000000] 751                      MikroTik RouterBOARD 751
[    0.000000] 750Gr3                   MikroTik RouterBOARD 750GL
[    0.000000] 750i                     MikroTik RouterBOARD 750
[    0.000000] 711Gr100                 (null)
[    0.000000] 922gs                    (null)
[    0.000000] 951HnD                   MikroTik RouterBOARD 951Ui-2HnD
[    0.000000] 951G                     MikroTik RouterBOARD 951G-2HnD
[    0.000000] 931                      (null)
[    0.000000] wapg-sc                  (null)
[    0.000000] map2-hb                  (null)
[    0.000000] cap-hb                   (null)
[    0.000000] wap-lte                  (null)
[    0.000000] wap-hb                   (null)
[    0.000000] lhg                      (null)
[    0.000000] 750-hb                   (null)
[    0.000000] 962                      (null)
[    0.000000] 952-hb                   (null)
[    0.000000] 911L                     (null)
[    0.000000] H951L                    (null)
[    0.000000] map-hb                   (null)
[    0.000000] sxt5n                    MikroTik RouterBOARD SXT Lite5
[    0.000000] sxt2n                    MikroTik RouterBOARD SXT Lite2
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 56888K/65536K available (4183K kernel code, 172K rwdata, 520K rodata, 2540K init, 213K bss, 8648K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] Clocks: CPU:600.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000010] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.008878] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.086006] pid_max: default: 32768 minimum: 301
[    0.091486] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.099001] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.109647] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.120872] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.129167] NET: Registered protocol family 16
[    0.135983] MIPS: machine is Generic AR71XX/AR724X/AR913X based board
[    0.162541] clocksource: Switched to clocksource MIPS
[    0.169500] NET: Registered protocol family 2
[    0.175465] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.183454] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.190680] TCP: Hash tables configured (established 1024 bind 1024)
[    0.198069] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.204777] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.212178] NET: Registered protocol family 1
[    2.572557] random: fast init done
[    3.780227] Crashlog allocated RAM at address 0x3f00000
[    3.787871] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    3.800712] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    3.807396] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    3.967851] io scheduler noop registered
[    3.972309] io scheduler deadline registered (default)
[    3.978673] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    3.988213] console [ttyS0] disabled
[    4.012463] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a 16550A
[    4.022278] console [ttyS0] enabled
[    4.022278] console [ttyS0] enabled
[    4.029847] bootconsole [early0] disabled
[    4.029847] bootconsole [early0] disabled
[    4.040563] libphy: Fixed MDIO Bus: probed
[    4.047440] NET: Registered protocol family 10
[    4.067139] Segment Routing with IPv6
[    4.071029] NET: Registered protocol family 17
[    4.075748] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    4.089150] 8021q: 802.1Q VLAN Support v1.8
[    4.093621] rb: no calibration data found
[    4.118153] Freeing unused kernel memory: 2540K
[    4.122877] This architecture does not have kernel memory protection.
[    4.145784] init: Console is alive
[    4.149579] init: - watchdog -
[    4.176423] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    4.185857] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    4.204434] init: - preinit -
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[    7.556700] procd: - early -
[    7.559808] procd: - watchdog -
[    8.120256] procd: - watchdog -
[    8.123939] procd: - ubus -
[    8.134678] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.177681] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.184863] random: ubusd: uninitialized urandom read (4 bytes read)
[    8.192525] procd: - init -
Please press Enter to activate this console.
[    8.725339] kmodloader: loading kernel modules from /etc/modules.d/*
[    8.735767] urngd: v1.0.0 started.
[    8.757872] ip6_tables: (C) 2000-2006 Netfilter Core Team
[    8.780922] Loading modules backported from Linux version v4.19.85-0-gc63ee2939dc1
[    8.788808] Backport generated by backports.git v4.19.85-1-0-g8a8be258
[    8.815269] ip_tables: (C) 2000-2006 Netfilter Core Team
[    8.841897] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[    8.970681] xt_time: kernel timezone is -0000
[    9.075854] random: crng init done
[    9.079383] random: 7 urandom warning(s) missed due to ratelimiting
[    9.092161] PPP generic driver version 2.4.2
[    9.099525] NET: Registered protocol family 24
[    9.147791] kmodloader: done loading kernel modules from /etc/modules.d/*
[   53.517816] do_page_fault(): sending SIGSEGV to uci for invalid read access from 7ff4001c
[   53.526333] epc = 77fbe5c4 in libc.so[77f38000+98000]
[   53.531570] ra  = 77fbe5ac in libc.so[77f38000+98000]
1


BusyBox v1.30.1 () built-in shell (ash)
  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.0, r10860-a3ffeb413b
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/# 

tried 19.07.0 til 9. so 19.x never supported my speciffic model.
its the same with Lede.
so i guess this one was never supported :frowning:

but i found another repo based on @adron 's fork with lots of changes here

[    0.000000] Linux version 4.14.275 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11427-9ce6aa9d8d)) #0 Sat Apr 16 13:13:32 2022
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] SoC: Atheros AR9344 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    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] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 8052bf60, node_mem_map 81000020
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x8052d740 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: no-buzzer parts=1 boot_part_size=4194304 gpio=249403 HZ=375000000 mem=64M kmac=D4:CA:6D:2E:D3:A2 board=2011L ver=7.16 bver=2.39 hw_opt=00000001 boot=1 mlc=12 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 59192K/65536K available (4209K kernel code, 172K rwdata, 524K rodata, 204K init, 213K bss, 6344K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] Clocks: CPU:750.000MHz, DDR:400.000MHz, AHB:400.000MHz, Ref:25.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5096694524 ns
[    0.000009] sched_clock: 32 bits at 375MHz, resolution 2ns, wraps every 5726622718ns
[    0.008875] Calibrating delay loop... 373.55 BogoMIPS (lpj=1867776)
[    0.075993] pid_max: default: 32768 minimum: 301
[    0.081439] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.088951] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.099312] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.110522] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.118685] NET: Registered protocol family 16
[    0.127382] MIPS: machine is Mikrotik RouterBOARD 2011L
[    0.619700] clocksource: Switched to clocksource MIPS
[    0.626535] NET: Registered protocol family 2
[    0.631689] IP idents hash table entries: 2048 (order: 2, 16384 bytes)
[    0.639873] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.647801] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.655067] TCP: Hash tables configured (established 1024 bind 1024)
[    0.662443] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.669083] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.676472] NET: Registered protocol family 1
[    0.681490] PCI: CLS 0 bytes, default 32
[    0.684699] Crashlog allocated RAM at address 0x3f00000
[    0.692092] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    0.704187] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.710861] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.732857] io scheduler noop registered
[    0.737313] io scheduler deadline registered (default)
[    0.743643] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.752957] console [ttyS0] disabled
[    0.777128] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a 16550A
[    0.786936] console [ttyS0] enabled
[    0.794498] bootconsole [early0] disabled
[    0.810134] m25p80 spi0.0: found w25x10, expected m25p80
[    0.825816] m25p80 spi0.0: w25x10 (128 Kbytes)
[    0.830996] Creating 4 MTD partitions on "spi0.0":
[    0.835969] 0x000000000000-0x00000000b000 : "routerboot"
[    0.843262] 0x00000000b000-0x00000000c000 : "hard_config"
[    0.850366] 0x00000000d000-0x00000000e000 : "bios"
[    0.857421] 0x00000000f000-0x000000010000 : "soft_config"
[    0.865800] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    0.872420] nand: Samsung NAND 64MiB 3,3V 8-bit
[    0.877099] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    0.884712] Scanning device for bad blocks
[    0.921398] Bad eraseblock 17 at 0x000000044000
[    0.926112] Bad eraseblock 18 at 0x000000048000
[    0.930850] Bad eraseblock 19 at 0x00000004c000
[    0.935556] Bad eraseblock 20 at 0x000000050000
[    0.941408] random: fast init done
[    0.952367] Bad eraseblock 176 at 0x0000002c0000
[    0.957166] Bad eraseblock 177 at 0x0000002c4000
[    0.961991] Bad eraseblock 178 at 0x0000002c8000
[    0.966789] Bad eraseblock 179 at 0x0000002cc000
[    0.972770] Bad eraseblock 201 at 0x000000324000
[    0.977568] Bad eraseblock 202 at 0x000000328000
[    0.982393] Bad eraseblock 203 at 0x00000032c000
[    0.987194] Bad eraseblock 204 at 0x000000330000
[    1.145878] Bad eraseblock 2990 at 0x000002eb8000
[    1.169020] random: crng init done
[    1.215588] Creating 3 MTD partitions on "ar934x-nfc":
[    1.220964] 0x000000000000-0x000000040000 : "booter"
[    1.227817] 0x000000040000-0x000000400000 : "kernel"
[    1.234945] 0x000000400000-0x000004000000 : "ubi"
[    1.276201] switch0: Atheros AR8327 rev. 2 switch registered on ag71xx-mdio.0
[    2.641162] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd033, driver=Atheros AR8216/AR8236/AR8316]
[    2.652711] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii
[    3.281479] ag71xx-mdio.1: Found an AR934X built-in switch
[    3.333731] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    3.342400] MikroTik RouterBOARD hardware configuration sysfs driver v0.03
[    3.350555] NET: Registered protocol family 10
[    3.359200] Segment Routing with IPv6
[    3.363149] NET: Registered protocol family 17
[    3.367791] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    3.381197] 8021q: 802.1Q VLAN Support v1.8
[    3.389223] UBI: auto-attach mtd6
[    3.392756] ubi0: attaching mtd6
[    4.676475] ubi0: scanning is finished
[    4.698904] ubi0: attached mtd6 (name "ubi", size 60 MiB)
[    4.704545] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15360 bytes
[    4.711394] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 512
[    4.718133] ubi0: VID header offset: 512 (aligned 512), data offset: 1024
[    4.725152] ubi0: good PEBs: 3839, bad PEBs: 1, corrupted PEBs: 0
[    4.731452] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 89
[    4.738816] ubi0: max/mean erase counter: 76/42, WL threshold: 4096, image sequence number: 1975154060
[    4.748442] ubi0: available PEBs: 0, total reserved PEBs: 3839, PEBs reserved for bad PEB handling: 79
[    4.758141] ubi0: background thread "ubi_bgt0d" started, PID 383
[    4.765854] block ubiblock0_1: created from ubi0:1(rootfs)
[    4.771592] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[    4.786386] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    4.795104] Freeing unused kernel memory: 204K
[    4.799735] This architecture does not have kernel memory protection.
[    5.335947] init: Console is alive
[    5.339805] init: - watchdog -
[    6.222523] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    6.280992] usbcore: registered new interface driver usbfs
[    6.286729] usbcore: registered new interface driver hub
[    6.292372] usbcore: registered new device driver usb
[    6.303189] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    6.311651] ehci-platform: EHCI generic platform driver
[    6.319568] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    6.327477] ohci-platform: OHCI generic platform driver
[    6.333604] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    6.351596] init: - preinit -
[    6.929213] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    7.941307] eth0: link up (1000Mbps/Full duplex)
[    7.946292] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   10.151541] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 451
[   10.169339] UBIFS (ubi0:2): recovery needed
[   10.205736] UBIFS (ubi0:2): recovery completed
[   10.210478] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "rootfs_data"
[   10.218640] UBIFS (ubi0:2): LEB size: 15360 bytes (15 KiB), min./max. I/O unit sizes: 512 bytes/512 bytes
[   10.228556] UBIFS (ubi0:2): FS size: 52945920 bytes (50 MiB, 3447 LEBs), journal size 2657280 bytes (2 MiB, 173 LEBs)
[   10.239532] UBIFS (ubi0:2): reserved for root: 2500766 bytes (2442 KiB)
[   10.246382] UBIFS (ubi0:2): media format: w4/r0 (latest is w5/r0), UUID 034461FD-71CB-4B11-AF7B-F6E0E2890EF1, small LPT model
[   10.266230] mount_root: switching to ubifs overlay
[   10.306318] urandom-seed: Seeding with /etc/urandom.seed
[   10.545693] eth0: link down
[   10.561843] procd: - early -
[   10.564939] procd: - watchdog -
[   11.203034] procd: - watchdog -
[   11.206636] procd: - ubus -
[   11.300382] procd: - init -
[   12.258623] urngd: v1.0.2 started.
[   12.282079] kmodloader: loading kernel modules from /etc/modules.d/*
[   12.307513] tun: Universal TUN/TAP device driver, 1.6
[   12.344913] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   12.371761] Netfilter messages via NETLINK v0.30.
[   12.396469] ip_set: protocol 6
[   12.562039] Loading modules backported from Linux version v4.19.237-0-ga6e4a1818efa
[   12.570019] Backport generated by backports.git v4.19.237-1-0-gffb89fd9
[   12.602494] ip_tables: (C) 2000-2006 Netfilter Core Team
[   12.629852] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   12.806415] wireguard: WireGuard 1.0.20200611 loaded. See www.wireguard.com for information.
[   12.815202] wireguard: Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
[   12.906070] xt_time: kernel timezone is -0000
[   13.045710] PPP generic driver version 2.4.2
[   13.060783] NET: Registered protocol family 24
[   13.150471] kmodloader: done loading kernel modules from /etc/modules.d/*
[   27.157814] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   27.183785] IPv6: ADDRCONF(NETDEV_UP): eth1.1: link is not ready
[   28.791900] eth1: link up (1000Mbps/Full duplex)
[   28.796706] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   28.849881] IPv6: ADDRCONF(NETDEV_CHANGE): eth1.1: link becomes ready
[   36.541088] device eth0 entered promiscuous mode
[   36.801331] device eth1 entered promiscuous mode
[   42.011210] device eth1.1 entered promiscuous mode
[18882.183499] eth1: link down
[18882.334303] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[18882.362353] IPv6: ADDRCONF(NETDEV_UP): eth1.1: link is not ready
[18890.673559] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[18890.683984] IPv6: ADDRCONF(NETDEV_UP): eth1.1: link is not ready
[18892.451178] eth1: link up (1000Mbps/Full duplex)
[18892.485956] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[18892.550578] IPv6: ADDRCONF(NETDEV_CHANGE): eth1.1: link becomes ready
[18911.259017] device eth1.1 entered promiscuous mode

its 19.07.10 kernel log @Leo-PL

While you still have that firmware, could you cd /sys/class/mtd/mtd6; tail *?
I'll post another test build shortly. Please try this:
https://drive.google.com/drive/folders/1z6pX0aNGfrkqJsPxPpuMVXhoStOywraW?usp=drive_link
I removed extra entry for Samsung NAND and explicit ECC step size from device tree, and added nand-is-boot-medium. Patch for Gigadevice NAND is still there, so @ReivilO, if you still have the device, please try.

Also, @a_sdt, could you check the exact part number of your NAND chip? It won't be available in the kernel log, sadly - you'll have to disassemble the device and peel up the S/N sticker hiding it.

@Leo-PL this is from your testbuild:

BusyBox v1.37.0 (2025-01-16 17:27:12 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r28607-876704fe5d5b
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# cd /sys/class/mtd/mtd6; tail *
==> bad_blocks <==
0

==> bbt_blocks <==
0

==> bitflip_threshold <==
0

==> corrected_bits <==
0

==> dev <==
90:12

==> device <==
tail: read error: Is a directory

==> ecc_failures <==
0

==> ecc_step_size <==
0

==> ecc_strength <==
0

==> erasesize <==
65536

==> erasesize_minor <==
4096

==> flags <==
0x800

==> mtd6 <==
tail: read error: Is a directory

==> mtdblock6 <==
tail: read error: Is a directory

==> name <==
bios

==> numeraseregions <==
0

==> of_node <==
tail: read error: Is a directory

==> offset <==
49152

==> oobavail <==
0

==> oobsize <==
0

==> size <==
4096

==> subpagesize <==
1

==> subsystem <==
tail: read error: Is a directory

==> type <==
nor

==> uevent <==
MAJOR=90
MINOR=12
DEVNAME=mtd6
DEVTYPE=mtd
OF_NAME=bios
OF_FULLNAME=/ahb/spi@1f000000/flash@0/partitions/bios
OF_COMPATIBLE_N=0

==> writesize <==
1
root@OpenWrt:/sys/class/mtd/mtd6# 

an here the bootlog:

MOpenWrt kernel loader for AR7XXX/AR9XXX
MCopyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
MDecompressing kernel... done!
MStarting kernel at 80060000...

M[    0.000000] Linux version 6.6.71 (builder@buildhost) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r28606+1-63d59e6d02c0) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 Thu Jan 16 20:46:16 2025
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is MikroTik RouterBOARD 2011UiAS-2HnD
[    0.000000] SoC: Atheros AR9344 rev 2
[    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] Kernel command line: console=ttyS0,115200 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] Built 1 zonelists, mobility grouping on.  Total pages: 16240
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 50564K/65536K available (7769K kernel code, 593K rwdata, 984K rodata, 4660K init, 240K bss, 14972K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] CPU clock: 600.000 MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[    0.000003] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.008993] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.086067] pid_max: default: 32768 minimum: 301
[    0.103551] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.111901] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.131606] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1.
[    0.148681] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.159925] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.170913] pinctrl core: initialized pinctrl subsystem
[    0.180979] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.188397] thermal_sys: Registered thermal governor 'step_wise'
[    0.191371] /ahb/apb: Fixed dependency cycle(s) with /ahb/apb/interrupt-controller@18060010
[    0.224407] clocksource: Switched to clocksource MIPS
[    0.243500] NET: Registered PF_INET protocol family
[    0.249419] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.259476] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.269179] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.278041] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
    0.286778] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.294835] TCP: Hash tables configured (established 1024 bind 1024)
[    0.302932] MPTCP token hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.311522] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.319015] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.328107] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.334677] PCI: CLS 0 bytes, default 32
[    0.933452] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.942953] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.949647] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.970143] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.983806] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.992453] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.006420] printk: console [ttyS0] disabled
[    1.011960] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 10, base_baud = 1562500) is a 16550A
[    1.021980] printk: console [ttyS0] enabled
[    1.021980] printk: console [ttyS0] enabled
[    1.031079] printk: bootconsole [early0] disabled
[    1.031079] printk: bootconsole [early0] disabled
[    1.058920] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    1.065567] nand: Samsung NAND 64MiB 3,3V 8-bit
[    1.070251] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    1.077954] Scanning device for bad blocks
[    1.617305] Bad eraseblock 96 at 0x000000180000
[    6.744530] 3 fixed-partitions partitions found on MTD device ar934x-nand
[    6.751590] Creating 3 MTD partitions on "ar934x-nand":
[    6.757019] 0x000000000000-0x000000040000 : "booter"
[    6.763126] 0x000000040000-0x000000400000 : "kernel"
[    6.769291] 0x000000400000-0x000004000000 : "ubi"
[    6.794347] spi-nor spi0.0: w25x10 (128 Kbytes)
[    6.799561] 1 routerbootpart partitions found on MTD device spi0.0
[    6.805998] Creating 1 MTD partitions on "spi0.0":
[    6.810960] 0x000000000000-0x000000020000 : "partitions"
[    6.819823] 4 routerbootpart partitions found on MTD device partitions
[    6.826665] Creating 4 MTD partitions on "partitions":
[    6.831990] 0x000000000000-0x00000000b000 : "routerboot"
[    6.840025] 0x00000000b000-0x00000000c000 : "hard_config"
[    6.848724] 0x00000000c000-0x00000000d000 : "bios"
[    6.856768] 0x00000000f000-0x000000010000 : "soft_config"
[    6.870545] ag71xx-legacy 19000000.eth: invalid MAC address, using random address
[    7.249910] switch0: Atheros AR8327 rev. 2 switch registered on mdio.0
[    7.754461] random: crng init done
[    7.917781] ag71xx-legacy 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd033, driver=Atheros AR8216/AR8236/AR8316]
[    7.930002] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii
[    7.937207] ag71xx-legacy 1a000000.eth: invalid MAC address, using random address
[    8.699529] switch1: Atheros AR8229 rev. 1 switch registered on mdio.1
[    8.785955] ag71xx-legacy 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    8.796764] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    8.807326] MikroTik RouterBOARD hardware configuration sysfs driver v0.08
[    8.816907] MikroTik RouterBOARD software configuration sysfs driver v0.05
    8.824937] NET: Registered PF_INET6 protocol family
[    8.840168] Segment Routing with IPv6
[    8.844036] In-situ OAM (IOAM) with IPv6
[    8.848320] NET: Registered PF_PACKET protocol family
[    8.853603] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    8.867560] 8021q: 802.1Q VLAN Support v1.8
[    8.920425] UBI: auto-attach mtd2
[    8.923914] ubi0: attaching mtd2
[    8.927487] ubi0 error: 0x80507178: bad VID header offset 512, expected 256
[    8.934742] ubi0 error: 0x80507118: bad EC header
[    8.939603] Erase counter header dump:
[    8.943475]  magic          0x55424923
[    8.947365]  version        1
[    8.950427]  ec             0
[    8.953491]  vid_hdr_offset 512
[    8.956745]  data_offset    1024
[    8.960077]  image_seq      1443117909
[    8.963948]  hdr_crc        0x28ab8920
[    8.967827] erase counter header hexdump:
[    8.972008] CPU: 0 PID: 1 Comm: swapper Not tainted 6.6.71 #0
[    8.977955] Stack : 00000000 80852ca4 00000000 55424923 00000000 00000000 00000000 00000000
[    8.986625]         00000000 00000000 00000000 00000000 00000000 00000001 81829c40 51be89dd
[    8.995290]         81829cd8 00000000 00000000 81829b88 00000038 807eed64 00000000 ffffffea
[    9.003954]         00000074 81829b94 00000074 808fb7c0 80807ffc 81829c20 00000000 81b58000
[    9.012619]         00000000 55424923 81bc0714 81bc0a00 00000018 8048c2e4 00000000 80e10000
[    9.021283]         ...
[    9.023819] Call Trace:
[    9.023832] [<807eed64>] 0x807eed64
[    9.029960] [<8048c2e4>] 0x8048c2e4
[    9.033569] [<800661e8>] 0x800661e8
[    9.037179] [<800661f0>] 0x800661f0
[    9.040781] [<807c56e4>] 0x807c56e4
[    9.044393] [<80507128>] 0x80507128
[    9.048004] [<80507dec>] 0x80507dec
[    9.051614] [<80507584>] 0x80507584
[    9.055225] [<8050d8b4>] 0x8050d8b4
[    9.058838] [<801d84bc>] 0x801d84bc
[    9.062449] [<805013bc>] 0x805013bc
[    9.066061] [<8099bd14>] 0x8099bd14
[    9.069670] [<8099ba78>] 0x8099ba78
[    9.073279] [<8006056c>] 0x8006056c
[    9.076891] [<800a4188>] 0x800a4188
[    9.080500] [<80983ec0>] 0x80983ec0
[    9.084106] [<80983f94>] 0x80983f94
[    9.087715] [<80983094>] 0x80983094
[    9.091325] [<807ef2dc>] 0x807ef2dc
[    9.094935] [<807ef2bc>] 0x807ef2bc
[    9.098545] [<800619f8>] 0x800619f8
[    9.102161] 
[    9.103720] ubi0 error: 0x80507e14: validation failed for PEB 0
[    9.109862] ubi0 error: 0x80501890: failed to attach mtd2, error -22
[    9.116487] UBI error: cannot attach mtd2
[    9.120870] clk: Disabling unused clocks
[    9.155416] Freeing unused kernel image (initmem) memory: 4660K
[    9.161564] This architecture does not have kernel memory protection.
[    9.168263] Run /init as init process
[    9.928672] init: Console is alive
[    9.932698] init: - watchdog -
[    9.965411] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    9.993764] usbcore: registered new interface driver usbfs
[    9.999637] usbcore: registered new interface driver hub
[   10.005294] usbcore: registered new device driver usb
[   10.022442] gpio_button_hotplug: loading out-of-tree module taints kernel.
[   10.044297] ehci-platform 1b000000.usb: EHCI Host Controller
[   10.050272] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[   10.058590] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[   10.094519] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[   10.102612] hub 1-0:1.0: USB hub found
[   10.107290] hub 1-0:1.0: 1 port detected
[   10.118436] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   10.136652] init: - preinit -
[   10.404520] usb 1-1: new full-speed USB device number 2 using ehci-platform
[   10.664512] usb 1-1: device descriptor read/64, error -71
[   11.034497] usb 1-1: device descriptor read/64, error -71
[   11.307044] usb 1-1: new full-speed USB device number 3 using ehci-platform
[   11.564515] usb 1-1: device descriptor read/64, error -71
[   11.934651] usb 1-1: device descriptor read/64, error -71
Cannot parse config file '/etc/fw_env.config': No such file or directory
Failed to find NVMEM device
[   12.064561] usb usb1-port1: attempt power cycle
[   12.544526] usb 1-1: new full-speed USB device number 4 using ehci-platform
[   13.065347] usb 1-1: device not accepting address 4, error -71
[   13.214414] usb 1-1: new full-speed USB device number 5 using ehci-platform
[   13.609393] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up
[   13.617883] eth0: link up (1000Mbps/Full duplex)
Press the [f] key and hit [enter] to enter fails[   13.724503] usb 1-1: device not accepting address 5, error -71
afe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[   13.748802] usb usb1-port1: unable to enumerate USB device
[   17.895428] eth0: link down
[   17.927193] procd: - early -
[   17.930595] procd: - watchdog -
[   18.591499] procd: - watchdog -
[   18.595296] procd: - ubus -
[   18.657153] procd: - init -
Please press Enter to activate this console.
[   19.762405] kmodloader: loading kernel modules from /etc/modules.d/*
[   21.056034] input: beeper as /devices/platform/beeper/input/input0
[   21.082691] i2c_dev: i2c /dev entries driver
[   21.106775] i2c-gpio i2c-gpio: using lines 523 (SDA) and 533 (SCL)
[   21.141497] Loading modules backported from Linux version v6.12.6-0-ge9d65b48ce1a
[   21.149317] Backport generated by backports.git v6.1.110-1-35-g410656ef04d2
[   21.210664] sfp sfp: Host maximum power 1.0W
[   21.244824] sfp sfp: No tx_disable pin: SFP modules will always be emitting.
[   21.688817] PPP generic driver version 2.4.2
[   21.715761] NET: Registered PF_PPPOX protocol family
[   21.895388] ath9k 18100000.wmac: Direct firmware load for ath9k-eeprom-ahb-18100000.wmac.bin failed with error -2
[   21.906091] ath9k 18100000.wmac: Falling back to sysfs fallback for: ath9k-eeprom-ahb-18100000.wmac.bin
[   22.085205] urngd: v1.0.2 started.
[   22.536567] sfp sfp: please wait, module slow to respond
[   22.740523] ath: phy0: Unable to initialize hardware; initialization status: -5
[   22.784509] ath9k 18100000.wmac: failed to initialize device
[   22.790432] ath9k: probe of 18100000.wmac failed with error -5
[   22.844934] kmodloader: done loading kernel modules from /etc/modules.d/*
[   51.471416] eth0: link up (1000Mbps/Full duplex)
[   51.484007] ag71xx-legacy 19000000.eth eth0: entered promiscuous mode
[   51.506062] br-lan: port 1(eth0.1) entered blocking state
[   51.511680] br-lan: port 1(eth0.1) entered disabled state
[   51.517386] eth0.1: entered allmulticast mode
[   51.521964] ag71xx-legacy 19000000.eth eth0: entered allmulticast mode
[   51.529130] eth0.1: entered promiscuous mode
[   51.581257] br-lan: port 1(eth0.1) entered blocking state
[   51.586941] br-lan: port 1(eth0.1) entered forwarding state
[   51.631376] eth1: link up (1000Mbps/Full duplex)
[   51.663257] ag71xx-legacy 1a000000.eth eth1: entered promiscuous mode
[   51.699658] br-lan: port 2(eth1.1) entered blocking state
[   51.705336] br-lan: port 2(eth1.1) entered disabled state
[   51.710965] eth1.1: entered allmulticast mode
[   51.715539] ag71xx-legacy 1a000000.eth eth1: entered allmulticast mode
[   51.765773] eth1.1: entered promiscuous mode
[   51.770499] br-lan: port 2(eth1.1) entered blocking state
[   51.776182] br-lan: port 2(eth1.1) entered forwarding state
[   58.086563] do_page_fault(): sending SIGSEGV to utpl for invalid read access from 00000008
[   58.095218] epc = 77db2090 in libc.so[77d7e000+b2000]
[   58.100480] ra  = 77d58b17 in libucode.so.20230711[77d4c000+2f000]
[   72.275083] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is down
[   74.354925] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 2 is up
[   77.954702] sfp sfp: failed to read EEPROM: -ENXIO

its cd /sys/class/mtd/mtd6; tail *and its 19.07.10

root@OpenWrt-222:~# cd /sys/class/mtd/mtd6; tail *
==> bad_blocks <==
1

==> bbt_blocks <==
0

==> bitflip_threshold <==
1

==> corrected_bits <==
0

==> dev <==
90:12

==> ecc_failures <==
0

==> ecc_step_size <==
256

==> ecc_strength <==
1

==> erasesize <==
16384

==> flags <==
0x400

==> mtdblock6 <==
tail: read error: Is a directory

==> name <==
ubi

==> numeraseregions <==
0

==> offset <==
4194304

==> oobsize <==
16

==> size <==
62914560

==> subpagesize <==
512

==> subsystem <==
tail: read error: Is a directory

==> type <==
nand

==> uevent <==
MAJOR=90
MINOR=12
DEVNAME=mtd6
DEVTYPE=mtd

==> writesize <==
512
root@OpenWrt-222:/sys/devices/virtual/mtd/mtd6#

also for part number of nand chip, Do we need to open the device to check? @Leo-PL

Unfortunately, yes. This is legacy NAND which lacked model number information, or ONFI or JEDEC parameter pages which contain it, for that matter.

@g6094199 if checking sysfs under ath79 builds, UBI volume will be under /sys/class/mtd/mtd2, not mtd6. Please gather that as well, so I can compare that head-to-head against ar71xx.

will get the info tomorrow.

btw this is the reference pic ot the RB2011LS(high res pic) from the mtik product site.
its a ST nand01gw3b2cn

@Leo-PL

root@OpenWrt:~# cd /sys/class/mtd/mtd2
root@OpenWrt:/sys/class/mtd/mtd2# tail *
==> bad_blocks <==
0

==> bbt_blocks <==
0

==> bitflip_threshold <==
1

==> corrected_bits <==
0

==> dev <==
90:4

==> device <==
tail: read error: Is a directory

==> ecc_failures <==
0

==> ecc_step_size <==
256
==> ecc_strength <==
1

==> erasesize <==
16384

==> erasesize_minor <==
0

==> flags <==
0x400

==> mtd2 <==
tail: read error: Is a directory

==> mtdblock2 <==
tail: read error: Is a directory

==> name <==
ubi

==> numeraseregions <==
0

==> of_node <==
tail: read error: Is a directory

==> offset <==
4194304

==> oobavail <==
8

==> oobsize <==
16

==> size <==
62914560

==> subpagesize <==
256

==> subsystem <==
tail: read error: Is a directory

==> type <==
nand

==> uevent <==
MAJOR=90
MINOR=4
DEVNAME=mtd2
DEVTYPE=mtd
OF_NAME=partition
OF_FULLNAME=/ahb/nand@1b000200/partitions/partition@400000
OF_COMPATIBLE_N=0

==> writesize <==
512
root@OpenWrt:/sys/class/mtd/mtd2

Okay, I see the difference. Thanks!
On ath79, subpagesize is 256, on ar71xx it is 512, which is incorrect in ath79. I think I know where to patch it, but it'll have to wait a few days.

Okay I take a picture of that that’s it @Leo-PL

1 Like

@a_sdt or @g6094199, could you please try another build? In the same location.

I tried adding this:

diff --git a/drivers/mtd/nand/raw/nand_samsung.c b/drivers/mtd/nand/raw/nand_samsung.c
index 0be6b7563805..feba89dd8370 100644
--- a/drivers/mtd/nand/raw/nand_samsung.c
+++ b/drivers/mtd/nand/raw/nand_samsung.c
@@ -109,6 +109,13 @@ static void samsung_nand_decode_id(struct nand_chip *chip)
                                    (chip->id.data[4] & GENMASK(1, 0)) == 0x1)
                                        chip->options |= NAND_NO_SUBPAGE_WRITE;
                                break;
+                       /* K9F1208U0C doesn't support subpage write */
+                       case 0x76:
+                               if (chip->id.len == 4 &&
+                                               (chip->id.data[2] == 0x5A &&
+                                                chip->id.data[3] == 0x3F))
+                                       chip->options |= NAND_NO_SUBPAGE_WRITE;
+                               break;
                        default:
                                break;
                        }

to disable subpage writes on your NAND.
I've found, that those chips are relatively cheap on Aliexpress, so I might pick one up for testing.