[WIP] Porting Mikrotik RB2011 to ath79 - testers needed


BusyBox v1.37.0 (2025-01-27 23:43:05 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r28606+1-63d59e6d02c0
 -----------------------------------------------------
=== 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:~#
root@OpenWrt:~#
root@OpenWrt:~#
root@OpenWrt:~# dmes^Mroot@OpenWrt:~# dmesg ^[[J
[    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 Mon Jan 27 23:43:05 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] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    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: 50244K/65536K available (7769K kernel code, 593K rwdata, 984K rodata, 4980K init, 240K bss, 15292K 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.000002] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.008997] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.086067] pid_max: default: 32768 minimum: 301
[    0.103589] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.111939] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.131781] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1.
[    0.148959] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.160204] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.171195] pinctrl core: initialized pinctrl subsystem
[    0.181294] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.188727] thermal_sys: Registered thermal governor 'step_wise'
[    0.191768] /ahb/apb: Fixed dependency cycle(s) with /ahb/apb/interrupt-controller@18060010
[    0.224952] clocksource: Switched to clocksource MIPS
[    0.244081] NET: Registered PF_INET protocol family
[    0.250000] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.260081] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.269788] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.278652] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.287396] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.295452] TCP: Hash tables configured (established 1024 bind 1024)
[    0.303552] MPTCP token hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.312154] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.319641] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.328742] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.335312] PCI: CLS 0 bytes, default 32
[    0.935476] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.944911] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.951622] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.972149] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.985889] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.994468] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    1.008453] printk: console [ttyS0] disabled
[    1.013992] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 10, base_baud = 1562500) is a 16550A
[    1.024012] printk: console [ttyS0] enabled
[    1.033113] printk: bootconsole [early0] disabled
[    1.061210] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    1.067860] nand: Samsung NAND 64MiB 3,3V 8-bit
[    1.072545] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    1.080243] Scanning device for bad blocks
[    1.613942] Bad eraseblock 96 at 0x000000180000
[    7.436759] 3 fixed-partitions partitions found on MTD device ar934x-nand
[    7.443813] Creating 3 MTD partitions on "ar934x-nand":
[    7.449242] 0x000000000000-0x000000040000 : "booter"
[    7.455416] 0x000000040000-0x000000400000 : "kernel"
[    7.461517] 0x000000400000-0x000004000000 : "ubi"
[    7.486560] spi-nor spi0.0: w25x10 (128 Kbytes)
[    7.491754] 1 routerbootpart partitions found on MTD device spi0.0
[    7.498226] Creating 1 MTD partitions on "spi0.0":
[    7.503183] 0x000000000000-0x000000020000 : "partitions"
[    7.512058] 4 routerbootpart partitions found on MTD device partitions
[    7.518918] Creating 4 MTD partitions on "partitions":
[    7.524239] 0x000000000000-0x00000000b000 : "routerboot"
[    7.532271] 0x00000000b000-0x00000000c000 : "hard_config"
[    7.540976] 0x00000000c000-0x00000000d000 : "bios"
[    7.549003] 0x00000000f000-0x000000010000 : "soft_config"
[    7.562811] ag71xx-legacy 19000000.eth: invalid MAC address, using random address
[    7.941140] switch0: Atheros AR8327 rev. 2 switch registered on mdio.0
[    8.445009] random: crng init done
[    8.608407] ag71xx-legacy 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd033, driver=Atheros AR8216/AR8236/AR8316]
[    8.620609] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii
[    8.627823] ag71xx-legacy 1a000000.eth: invalid MAC address, using random address
[    9.391434] switch1: Atheros AR8229 rev. 1 switch registered on mdio.1
[    9.477786] ag71xx-legacy 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    9.488626] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    9.499131] MikroTik RouterBOARD hardware configuration sysfs driver v0.08
[    9.508645] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    9.516680] NET: Registered PF_INET6 protocol family
[    9.531892] Segment Routing with IPv6
[    9.535834] In-situ OAM (IOAM) with IPv6
[    9.540058] NET: Registered PF_PACKET protocol family
[    9.545381] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    9.559338] 8021q: 802.1Q VLAN Support v1.8
[    9.611843] UBI: auto-attach mtd2
[    9.615391] ubi0: attaching mtd2
[    9.618918] ubi0 error: 0x805071b0: bad VID header offset 512, expected 256
[    9.626168] ubi0 error: 0x80507150: bad EC header
[    9.631029] Erase counter header dump:
[    9.634900]  magic          0x55424923
[    9.638781]  version        1
[    9.641844]  ec             0
[    9.644908]  vid_hdr_offset 512
[    9.648165]  data_offset    1024
[    9.651493]  image_seq      1443117909
[    9.655373]  hdr_crc        0x28ab8920
[    9.659244] erase counter header hexdump:
[    9.663390] 00000000: 55 42 49 23 01 00 00 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 04 00 56 04 3b 55 00 00 00 00  UBI#....................V.;U....
[    9.663408] 00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 ab 89 20  ............................(..
[    9.663425] CPU: 0 PID: 1 Comm: swapper Not tainted 6.6.71 #0
[    9.669370] Stack : 00000000 80852ca4 00000000 55424923 00000000 00000000 00000000 00000000
[    9.678042]         00000000 00000000 00000000 00000000 00000000 00000001 81829c40 704307ff
[    9.686706]         81829cd8 00000000 00000000 81829b88 00000038 807eed84 00000000 ffffffea
[    9.695371]         00000074 81829b94 00000074 808fb7c0 80807ffc 81829c20 00000000 81b74000
[    9.704035]         00000000 55424923 81992214 81992d00 00000018 8048c2e4 00000000 80e60000
[    9.712699]         ...
[    9.715235] Call Trace:
[    9.715248] [<807eed84>] 0x807eed84
[    9.721377] [<8048c2e4>] 0x8048c2e4
[    9.724985] [<800661e8>] 0x800661e8
[    9.728595] [<800661f0>] 0x800661f0
[    9.732198] [<807c571c>] 0x807c571c
[    9.735809] [<80507160>] 0x80507160
[    9.739420] [<80507e24>] 0x80507e24
[    9.743030] [<805075bc>] 0x805075bc
[    9.746633] [<8050d8ec>] 0x8050d8ec
[    9.750245] [<801d84bc>] 0x801d84bc
[    9.753856] [<805013f4>] 0x805013f4
[    9.757469] [<8099bd14>] 0x8099bd14
[    9.761078] [<8099ba78>] 0x8099ba78
[    9.764687] [<8006056c>] 0x8006056c
[    9.768298] [<800a4188>] 0x800a4188
[    9.771908] [<80983ec0>] 0x80983ec0
[    9.775514] [<80983f94>] 0x80983f94
[    9.779121] [<80983094>] 0x80983094
[    9.782732] [<807ef2fc>] 0x807ef2fc
[    9.786342] [<807ef2dc>] 0x807ef2dc
[    9.789943] [<800619f8>] 0x800619f8
[    9.793559]
[    9.795120] ubi0 error: 0x80507e4c: validation failed for PEB 0
[    9.801248] ubi0 error: 0x805018c8: failed to attach mtd2, error -22
[    9.807881] UBI error: cannot attach mtd2
[    9.812270] clk: Disabling unused clocks
[    9.848897] Freeing unused kernel image (initmem) memory: 4980K
[    9.855073] This architecture does not have kernel memory protection.
[    9.861739] Run /init as init process
[    9.865532]   with arguments:
[    9.865538]     /init
[    9.865545]   with environment:
[    9.865551]     HOME=/
[    9.865557]     TERM=linux
[   10.835525] init: Console is alive
[   10.839567] init: - watchdog -
[   10.872624] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[   10.901279] usbcore: registered new interface driver usbfs
[   10.907129] usbcore: registered new interface driver hub
[   10.912764] usbcore: registered new device driver usb
[   10.930105] gpio_button_hotplug: loading out-of-tree module taints kernel.
[   10.951930] ehci-platform 1b000000.usb: EHCI Host Controller
[   10.957902] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[   10.966221] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[   10.994972] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[   11.003110] hub 1-0:1.0: USB hub found
[   11.007991] hub 1-0:1.0: 1 port detected
[   11.019230] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   11.038467] init: - preinit -
[   11.295058] usb 1-1: new full-speed USB device number 2 using ehci-platform
[   11.565051] usb 1-1: device descriptor read/64, error -71
[   11.925043] usb 1-1: device descriptor read/64, error -71
[   12.205041] usb 1-1: new full-speed USB device number 3 using ehci-platform
[   12.465068] usb 1-1: device descriptor read/64, error -71
[   12.835051] usb 1-1: device descriptor read/64, error -71
[   12.955109] usb usb1-port1: attempt power cycle
[   13.435065] usb 1-1: new full-speed USB device number 4 using ehci-platform
[   13.944962] usb 1-1: device not accepting address 4, error -71
[   14.094959] usb 1-1: new full-speed USB device number 5 using ehci-platform
[   14.545289] eth0: link up (1000Mbps/Full duplex)
[   14.615061] usb 1-1: device not accepting address 5, error -71
[   14.621243] usb usb1-port1: unable to enumerate USB device
[   18.827298] eth0: link down
[   18.859339] procd: - early -
[   18.862742] procd: - watchdog -
[   19.524590] procd: - watchdog -
[   19.528378] procd: - ubus -
[   19.590027] procd: - init -
[   20.716626] kmodloader: loading kernel modules from /etc/modules.d/*
[   21.484105] jitterentropy: Initialization failed with host not compliant with requirements: 9
[   21.870442] input: beeper as /devices/platform/beeper/input/input0
[   21.903297] i2c_dev: i2c /dev entries driver
[   21.921024] i2c-gpio i2c-gpio: using lines 523 (SDA) and 533 (SCL)
[   21.952387] Loading modules backported from Linux version v6.12.6-0-ge9d65b48ce1a
[   21.960207] Backport generated by backports.git v6.1.110-1-35-g410656ef04d2
[   22.038178] sfp sfp: Host maximum power 1.0W
[   22.065105] sfp sfp: No tx_disable pin: SFP modules will always be emitting.
[   22.459329] PPP generic driver version 2.4.2
[   22.486339] NET: Registered PF_PPPOX protocol family
[   22.665961] ath9k 18100000.wmac: Direct firmware load for ath9k-eeprom-ahb-18100000.wmac.bin failed with error -2
[   22.676665] ath9k 18100000.wmac: Falling back to sysfs fallback for: ath9k-eeprom-ahb-18100000.wmac.bin
[   23.038239] urngd: v1.0.2 started.
[   23.366579] sfp sfp: please wait, module slow to respond
[   23.510563] ath: phy0: Unable to initialize hardware; initialization status: -5
[   23.554996] ath9k 18100000.wmac: failed to initialize device
[   23.560925] ath9k: probe of 18100000.wmac failed with error -5
[   24.965423] kmodloader: done loading kernel modules from /etc/modules.d/*
root@OpenWrt:~# root@OpenWrt

flashing

BusyBox v1.37.0 (2025-01-27 23:43:05 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r28606+1-63d59e6d02c0
 -----------------------------------------------------
=== 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:~# Watchdog handover: fd=3
- watchdog -
Watchdog did not previously reset the system
[  294.477329] killall invoked oom-killer: gfp_mask=0x40cd0(GFP_KERNEL|__GFP_COMP|__GFP_RECLAIMABLE), order=0, oom_score_adj=0
[  294.488927] CPU: 0 PID: 2953 Comm: killall Tainted: G           O       6.6.71 #0
[  294.496664] Stack : 00000000 80852ca4 00000000 00000840 00000000 00000000 00000000 00000000
[  294.505334]         00000000 00000000 00000000 00000000 00000000 00000001 83c459d0 d114ed21
[  294.513999]         83c45a68 00000000 00000000 83c45918 00000038 807eed84 00000000 ffffffea
[  294.522663]         000000e9 83c45924 000000e9 808fb7c0 80807ffc 83c459b0 81c9b480 00000800
[  294.531327]         00000001 00000840 00000000 00000011 00000018 8048c2e4 00000000 80e60000
[  294.539992]         ...
[  294.542528] Call Trace:
[  294.542541] [<807eed84>] 0x807eed84
[  294.548732] [<8048c2e4>] 0x8048c2e4
[  294.552340] [<800661e8>] 0x800661e8
[  294.555951] [<800661f0>] 0x800661f0
[  294.559561] [<807c571c>] 0x807c571c
[  294.563211] [<80189fe8>] 0x80189fe8
[  294.566915] [<8018a950>] 0x8018a950
[  294.570522] [<8018aef0>] 0x8018aef0
[  294.574131] [<801de268>] 0x801de268
[  294.577797] [<801ecf8c>] 0x801ecf8c
[  294.581452] [<80239764>] 0x80239764
[  294.585064] [<801eea3c>] 0x801eea3c
[  294.588673] [<80239b28>] 0x80239b28
[  294.592284] [<800bbf0c>] 0x800bbf0c
[  294.595935] [<801effc8>] 0x801effc8
[  294.599542] [<80106370>] 0x80106370
[  294.603342] [<80281f8c>] 0x80281f8c
[  294.607092] [<8022a1c0>] 0x8022a1c0
[  294.610695] [<80224f14>] 0x80224f14
[  294.614344] [<8028512c>] 0x8028512c
[  294.618001] [<8022a294>] 0x8022a294
[  294.621657] [<80287178>] 0x80287178
[  294.625312] [<80225064>] 0x80225064
[  294.628968] [<80287504>] 0x80287504
[  294.632623] [<802177d4>] 0x802177d4
[  294.636280] [<802876d4>] 0x802876d4
[  294.639936] [<8021be7c>] 0x8021be7c
[  294.643544] [<80219b38>] 0x80219b38
[  294.647227] [<8383fbf8>] 0x8383fbf8 [mac80211@b88c9fff+0x8a000]
[  294.653391] [<8021d12c>] 0x8021d12c
[  294.657246] [<802046dc>] 0x802046dc
[  294.660952] [<80204a04>] 0x80204a04
[  294.664565] [<8006d420>] 0x8006d420
[  294.668281]
[  294.669863] Mem-Info:
[  294.672218] active_anon:7110 inactive_anon:0 isolated_anon:0
[  294.672218]  active_file:0 inactive_file:0 isolated_file:0
[  294.672218]  unevictable:0 dirty:0 writeback:0
[  294.672218]  slab_reclaimable:263 slab_unreclaimable:1231
[  294.672218]  mapped:468 shmem:7001 pagetables:13
[  294.672218]  sec_pagetables:0 bounce:0
[  294.672218]  kernel_misc_reclaimable:0
[  294.672218]  free:2123 free_pcp:1404 free_cma:0
[  294.711011] Node 0 active_anon:28440kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB mapped:1872kB dirty:0kB writeback:0kB shmem:28004kB writeback_tm>
[  294.737600] Normal free:8492kB boost:8192kB min:16384kB low:18432kB high:20480kB reserved_highatomic:0KB active_anon:28440kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB writepending:0kB>
[  294.765898] lowmem_reserve[]: 0 0
[  294.769333] Normal: 1*4kB (U) 1*8kB (E) 2*16kB (UE) 0*32kB 2*64kB (UE) 1*128kB (E) 0*256kB 0*512kB 2*1024kB (UE) 1*2048kB (U) 1*4096kB (E) 0*8192kB = 8492kB
[  294.783930] 7001 total pagecache pages
[  294.787811] 0 pages in swap cache
[  294.791231] Free swap  = 0kB
[  294.794205] Total swap = 0kB
[  294.797190] 16384 pages RAM
[  294.800073] 0 pages HighMem/MovableOnly
[  294.804034] 2578 pages reserved
[  294.807286] Tasks state (memory values in pages):
[  294.812142] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
[  294.821064] [   2913]     0  2913      427      360    16384        0             0 stage2
[  294.829618] [   2953]     0  2953      352      253    20480        0             0 killall
[  294.838261] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),global_oom,task_memcg=/,task=stage2,pid=2913,uid=0
[  294.849011] Out of memory: Killed process 2913 (stage2) total-vm:1708kB, anon-rss:336kB, file-rss:4kB, shmem-rss:1100kB, UID:0 pgtables:16kB oom_score_adj:0
sysupgrade abort[  294.870199] reboot: Restarting system
ed with return c



This is promising. I will rebuild initramfs without LuCI, so you can try to flash.
You'll need to erase and run ubiformat, because minimum write size changed (as I wanted to).

Edit @g6094199, please try once more. I've rebuilt the initramfs.
While at that, I adapter AR8327 LED support to use color/function properties. So another little step further to getting this supported properly.

it does flash. no errors but doesnt boot. no serial output

root@OpenWrt:~# mtd erase ubi
Unlocking ubi ...
Erasing ubi ...
root@OpenWrt:~# Mroot@OpenWr
root@OpenWrt:/tmp# M
root@OpenWrt:/tmp# sysupgrade [[J-F opMroot@OpenWrt:/tmp# sysupgrade -F openwrt-ath79-mikrotik-mikrotik_routerboard-201M
1uias-2hnd-squashfs-sysupgrade-testing.bin [[J
Cannot save config while running from ramdisk.
Thu Jan  1 00:08:30 GMT 1970 upgrade: Commencing upgrade. Closing all shell sessions.
Watchdog handover: fd=3
- watchdog -
Watchdog did not previously reset the system
Thu Jan  1 00:08:32 GMT 1970 upgrade: Sending TERM to remaining processes ...
Thu Jan  1 00:08:36 GMT 1970 upgrade: Sending KILL to remaining processes ...
[  522.319772] stage2 (2516): drop_caches: 3
Thu Jan  1 00:08:42 GMT 1970 upgrade: Switching to ramdisk...
Thu Jan  1 00:08:46 UTC 1970 upgrade: Performing system upgrade...
verifying sysupgrade tar file integrity
[  530.986686] ubi0: attaching mtd2
[  531.698469] ubi0: scanning is finished
[  531.702383] ubi0: empty MTD device detected
[  531.736606] ubi0: attached mtd2 (name "ubi", size 60 MiB)
[  531.742227] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
[  531.749123] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
[  531.755882] ubi0: VID header offset: 256 (aligned 256), data offset: 512
[  531.762804] ubi0: good PEBs: 3840, bad PEBs: 0, corrupted PEBs: 0
[  531.769113] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 92
[  531.776495] ubi0: max/mean erase counter: 0/0, WL threshold: 4096, image sequence number: 1505543289
[  531.785939] ubi0: available PEBs: 3756, total reserved PEBs: 84, PEBs reserved for bad PEB handling: 80
[  531.795676] ubi0: background thread "ubi_bgt0d" started, PID 3222
UBI device number 0, total 3840 LEBs (60948480 bytes, 58.1 MiB), available 3756 LEBs (59615232 bytes, 56.8 MiB), LEB size 15872 bytes (15.5 KiB)
[  531.970020] block ubiblock0_0: created from ubi0:0(rootfs)
[  531.975788] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
Volume ID 0, size 259 LEBs (4110848 bytes, 3.9 MiB), LEB size 15872 bytes (15.5 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 55504384
Volume ID 1, size 3497 LEBs (55504384 bytes, 52.9 MiB), LEB size 15872 bytes (15.5 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
[  540.911784] reboot: Restarting system
@

watchdog reboots continously.

Can you cd /sys/class/mtd/mtd2; tail * again please?
I think my fix changed something - but didn't actually disable subpage writes.

root@OpenWrt:~# cd /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

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

==> 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

1 Like

I'm thinking about picking up that NAND at Aliexpress - I guess a double-check is needed if my patch is correct - it's in this branch:

The patch itself:

--- a/drivers/mtd/nand/raw/nand_ids.c
+++ b/drivers/mtd/nand/raw/nand_ids.c
@@ -64,6 +64,10 @@ struct nand_flash_dev nand_flash_ids[] =
 	{"TH58NVG3S0HBAI4 8G 3.3V 8-bit",
 		{ .id = {0x98, 0xd3, 0x91, 0x26, 0x76} },
 		  SZ_4K, SZ_1K, SZ_256K, 0, 5, 256, NAND_ECC_INFO(8, SZ_512)},
+	{"GD9FU1G8F3A 1G 3.3V 8-bit",
+		{ .id = {0xc8, 0xf1, 0x80, 0x19, 0x42} },
+		  SZ_2K, SZ_128, SZ_128K, 0, 5, 64, NAND_ECC_INFO(0,0) },
+
 
 	LEGACY_ID_NAND("NAND 4MiB 5V 8-bit",   0x6B, 4, SZ_8K, SP_OPTIONS),
 	LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS),
--- 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(struc
 				    (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;
 			}

Edit: I found the older patch: https://penta.snel.it/~rsnel/mikrotik/0001-mtd-samsung-Disable-subpage-writes-on-E-die-NAND.patch - only just now. I'll try to integrate it soon. And perhaps upstream it to LKML.

Also, some interesting discoveries w.r.t to LCD and touchscreen there. I identified the touchscreen controller chip as well - but again, its auxiliary GPIOs are unknown. It's Zilltek ZT2046Q, which seems to be a clone of TI ADS2046.

I haven't managed to extract the LCD panel from it's mount yet, the space there is very tight. Does anyone has its markings, hidden under that black plastic?

1 Like

Another day, another firmware to test.
@g6094199 do you recall, that @rsnel's fix from here: ECC errors in UBI RB2011UiAS-2HnD-IN (and solution) - #5 by PisemNet worked for you in the past? I cherry picked it - merged without any conflicts, and built the test firmware, dropping my previous attempt.
Build is in the same location again, in case you'd like to test it.

BusyBox v1.37.0 (2025-02-06 12:13:45 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r28608+1-ec0a7d43da12
 -----------------------------------------------------
=== 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.
--------------------------------------------------

 OpenWrt recently switched to the "apk" package manager!

 OPKG Command           APK Equivalent      Description
 ------------------------------------------------------------------
 opkg install <pkg>     apk add <pkg>       Install a package
 opkg remove <pkg>      apk del <pkg>       Remove a package
 opkg upgrade           apk upgrade         Upgrade all packages
 opkg files <pkg>       apk info -L <pkg>   List package contents
 opkg list-installed    apk info            List installed packages
 opkg update            apk update          Update package lists
 opkg search <pkg>      apk search <pkg>    Search for packages
 ------------------------------------------------------------------

For more https://openwrt.org/docs/guide-user/additional-software/opkg-to-apk-cheatsheet

root@OpenWrt:~# dmesg 
[    0.000000] Linux version 6.6.71 (builder@buildhost) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 13.3.0 r28608+1-ec0a7d43da12) 13.3.0, GNU ld (GNU Binutils) 2.42) #0 Thu Feb  6 12:13:45 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] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    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: 49476K/65536K available (7900K kernel code, 633K rwdata, 1804K rodata, 4760K init, 240K bss, 16060K 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.000002] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.008987] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.086058] pid_max: default: 32768 minimum: 301
[    0.103479] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.111824] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.131454] RCU Tasks Trace: Setting shift to 0 and lim to 1 rcu_task_cb_adjust=1 rcu_task_cpu_ids=1.
[    0.149394] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.160646] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.171598] pinctrl core: initialized pinctrl subsystem
[    0.181641] NET: Registered PF_NETLINK/PF_ROUTE protocol family
[    0.189021] thermal_sys: Registered thermal governor 'step_wise'
[    0.192411] /ahb/apb: Fixed dependency cycle(s) with /ahb/apb/interrupt-controller@18060010
[    0.225632] clocksource: Switched to clocksource MIPS
[    0.244753] NET: Registered PF_INET protocol family
[    0.250688] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.260758] tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.270460] Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.279287] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.288013] TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.296073] TCP: Hash tables configured (established 1024 bind 1024)
[    0.304156] MPTCP token hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.312742] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.320236] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.329354] NET: Registered PF_UNIX/PF_LOCAL protocol family
[    0.335925] PCI: CLS 0 bytes, default 32
[    0.912858] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    0.922323] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.929023] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    0.950289] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.963219] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    0.971835] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    0.986327] printk: console [ttyS0] disabled
[    0.991837] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 10, base_baud = 1562500) is a 16550A
[    1.001853] printk: console [ttyS0] enabled
[    1.010946] printk: bootconsole [early0] disabled
[    1.037632] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    1.044227] nand: Samsung NAND 64MiB 3,3V 8-bit
[    1.048963] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    1.056689] Scanning device for bad blocks
[    1.591605] Bad eraseblock 96 at 0x000000180000
[    6.900390] 3 fixed-partitions partitions found on MTD device ar934x-nand
[    6.907479] Creating 3 MTD partitions on "ar934x-nand":
[    6.912889] 0x000000000000-0x000000040000 : "booter"
[    6.919021] 0x000000040000-0x000000400000 : "kernel"
[    6.925138] 0x000000400000-0x000004000000 : "ubi"
[    6.950203] spi-nor spi0.0: w25x10 (128 Kbytes)
[    6.955333] 1 routerbootpart partitions found on MTD device spi0.0
[    6.961798] Creating 1 MTD partitions on "spi0.0":
[    6.966780] 0x000000000000-0x000000020000 : "partitions"
[    6.975582] 4 routerbootpart partitions found on MTD device partitions
[    6.982429] Creating 4 MTD partitions on "partitions":
[    6.987765] 0x000000000000-0x00000000b000 : "routerboot"
[    6.995933] 0x00000000b000-0x00000000c000 : "hard_config"
[    7.004478] 0x00000000c000-0x00000000d000 : "bios"
[    7.012491] 0x00000000f000-0x000000010000 : "soft_config"
[    7.026356] ag71xx-legacy 19000000.eth: invalid MAC address, using random address
[    7.370732] switch0: Atheros AR8327 rev. 2 switch registered on mdio.0
[    7.915684] random: crng init done
[    8.067620] ag71xx-legacy 19000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    8.078393] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii
[    8.085551] ag71xx-legacy 1a000000.eth: invalid MAC address, using random address
[    8.840381] switch1: Atheros AR8229 rev. 1 switch registered on mdio.1
[    8.926764] ag71xx-legacy 1a000000.eth: connected to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    8.937587] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    8.948135] MikroTik RouterBOARD hardware configuration sysfs driver v0.08
[    8.957734] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    8.965753] NET: Registered PF_INET6 protocol family
[    8.980898] Segment Routing with IPv6
[    8.984764] In-situ OAM (IOAM) with IPv6
[    8.989063] NET: Registered PF_PACKET protocol family
[    8.994350] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    9.008299] 8021q: 802.1Q VLAN Support v1.8
[    9.061832] UBI error: no valid UBI magic found inside mtd2
[    9.067942] clk: Disabling unused clocks
[    9.103147] Freeing unused kernel image (initmem) memory: 4760K
[    9.109327] This architecture does not have kernel memory protection.
[    9.116000] Run /init as init process
[    9.119783]   with arguments:
[    9.119794]     /init
[    9.119803]   with environment:
[    9.119811]     HOME=/
[    9.119819]     TERM=linux
[    9.758481] init: Console is alive
[    9.762507] init: - watchdog -
[    9.794463] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    9.826143] usbcore: registered new interface driver usbfs
[    9.831937] usbcore: registered new interface driver hub
[    9.837634] usbcore: registered new device driver usb
[    9.855129] gpio_button_hotplug: loading out-of-tree module taints kernel.
[    9.879352] ehci-platform 1b000000.usb: EHCI Host Controller
[    9.885304] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[    9.893634] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[    9.925655] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[    9.933945] hub 1-0:1.0: USB hub found
[    9.938629] hub 1-0:1.0: 1 port detected
[    9.949994] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    9.968201] init: - preinit -
[   10.235861] usb 1-1: new full-speed USB device number 2 using ehci-platform
[   10.495753] usb 1-1: device descriptor read/64, error -71
[   10.865728] usb 1-1: device descriptor read/64, error -71
[   11.145743] usb 1-1: new full-speed USB device number 3 using ehci-platform
[   11.395784] usb 1-1: device descriptor read/64, error -71
[   11.765743] usb 1-1: device descriptor read/64, error -71
[   11.886063] usb usb1-port1: attempt power cycle
[   12.365751] usb 1-1: new full-speed USB device number 4 using ehci-platform
[   12.885641] usb 1-1: device not accepting address 4, error -71
[   13.035641] usb 1-1: new full-speed USB device number 5 using ehci-platform
[   13.552505] usb 1-1: device not accepting address 5, error -71
[   13.559802] usb usb1-port1: unable to enumerate USB device
[   13.576226] eth0: link up (1000Mbps/Full duplex)
[   17.866593] eth0: link down
[   17.898635] procd: - early -
[   17.902031] procd: - watchdog -
[   18.564947] procd: - watchdog -
[   18.568755] procd: - ubus -
[   18.631026] procd: - init -
[   19.749902] kmodloader: loading kernel modules from /etc/modules.d/*
[   21.030447] input: beeper as /devices/platform/beeper/input/input0
[   21.067402] i2c_dev: i2c /dev entries driver
[   21.088147] i2c-gpio i2c-gpio: using lines 523 (SDA) and 533 (SCL)
[   21.112834] Loading modules backported from Linux version v6.12.6-0-ge9d65b48ce1a
[   21.120653] Backport generated by backports.git v6.1.110-1-35-g410656ef04d2
[   21.195063] sfp sfp: Host maximum power 1.0W
[   21.216153] sfp sfp: No tx_disable pin: SFP modules will always be emitting.
[   21.683675] PPP generic driver version 2.4.2
[   21.717130] NET: Registered PF_PPPOX protocol family
[   21.896777] ath9k 18100000.wmac: Direct firmware load for ath9k-eeprom-ahb-18100000.wmac.bin failed with error -2
[   21.907475] ath9k 18100000.wmac: Falling back to sysfs fallback for: ath9k-eeprom-ahb-18100000.wmac.bin
[   22.060035] urngd: v1.0.2 started.
[   22.505803] sfp sfp: please wait, module slow to respond
[   22.741924] ath: phy0: Unable to initialize hardware; initialization status: -5
[   22.805689] ath9k 18100000.wmac: failed to initialize device
[   22.811613] ath9k: probe of 18100000.wmac failed with error -5
[   22.856119] kmodloader: done loading kernel modules from /etc/modules.d/*
[   65.251364] eth0: link up (1000Mbps/Full duplex)
[   65.267625] ag71xx-legacy 19000000.eth eth0: entered promiscuous mode
[   65.288002] br-lan: port 1(eth0.1) entered blocking state
[   65.293621] br-lan: port 1(eth0.1) entered disabled state
[   65.299320] eth0.1: entered allmulticast mode
[   65.303845] ag71xx-legacy 19000000.eth eth0: entered allmulticast mode
[   65.310978] eth0.1: entered promiscuous mode
[   65.361351] br-lan: port 1(eth0.1) entered blocking state
[   65.367026] br-lan: port 1(eth0.1) entered forwarding state
[   65.391575] eth1: link up (1000Mbps/Full duplex)
[   65.446134] ag71xx-legacy 1a000000.eth eth1: entered promiscuous mode
[   65.476571] br-lan: port 2(eth1.1) entered blocking state
[   65.482192] br-lan: port 2(eth1.1) entered disabled state
[   65.487906] eth1.1: entered allmulticast mode
[   65.492426] ag71xx-legacy 1a000000.eth eth1: entered allmulticast mode
[   65.535864] eth1.1: entered promiscuous mode
[   65.540608] br-lan: port 2(eth1.1) entered blocking state
[   65.546281] br-lan: port 2(eth1.1) entered forwarding state
[   77.955910] sfp sfp: failed to read EEPROM: -ENXIO
root@OpenWrt:~# 


flashes ok. doenst boot


root@OpenWrt:/tmp# mtd erase ubi
Unlocking ubi ...
Erasing ubi ...
root@OpenWrt:/tmp# systGH[[JGMroot@OpenWrt:/tmp# sys[[JupMroot@OpenWrt:/tmp# sysupgrade [[JG
.uci/
.ujailnoafile
TZ
ath9k-eeprom-ahb-18100000.wmac.bin
board.json
dhcp.leases
dnsmasq.cfg01411c.d/
etc/
hosts/
lib/
lock/
log/
openwrt-ath79-mikrotik-mikrotik_routerboard-2011uias-2hnd-squashfs-sysupgrade-testing.bin
resolv.conf
resolv.conf.d/
run/
shm/
state/
sysinfo/
tmp/
Mroot@OpenWrt:/tmp# sysupgrade [[JopMroot@OpenWrt:/tmp# sysupgrade openwrt-ath79-mikrotik-mikrotik_routerboard-2011uiM
as-2hnd-squashfs-sysupgrade-testing.bin [[J
Cannot save config while running from ramdisk.
Thu Jan  1 00:05:50 GMT 1970 upgrade: Commencing upgrade. Closing all shell sessions.
Command failed: Connection failed
Watchdog handover: fd=3
- watchdog -
Watchdog did not previously reset the system
Thu Jan  1 00:05:51 GMT 1970 upgrade: Sending TERM to remaining processes ...
Thu Jan  1 00:05:55 GMT 1970 upgrade: Sending KILL to remaining processes ...
[  361.761384] stage2 (2465): drop_caches: 3
Thu Jan  1 00:06:01 GMT 1970 upgrade: Switching to ramdisk...
Thu Jan  1 00:06:05 UTC 1970 upgrade: Performing system upgrade...
verifying sysupgrade tar file integrity
[  370.644214] block ubiblock0_0: released
[  371.174885] block ubiblock0_0: created from ubi0:0(rootfs)
Volume ID 0, size 243 LEBs (3856896 bytes, 3.6 MiB), LEB size 15872 bytes (15.5 KiB), dynamic, name "rootfs", alignment 1
Set volume size to 55758336
Volume ID 1, size 3513 LEBs (55758336 bytes, 53.1 MiB), LEB size 15872 bytes (15.5 KiB), dynamic, name "rootfs_data", alignment 1
sysupgrade successful
umount: can't unmount /dev: Resource busy
umount: can't unmount /tmp: Resource busy
[  373.637476] reboot: Restarting system

Could you check the sysfs (again) first, to see if subpage_size equals 512 now?

nope

root@OpenWrt:~# cd /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# 


I've got RB2011UiAS-2HnD-IN, so if help is needed I can test new builds.
I saw Leo-PL submitted a PR but then it was closed so does that mean that there is a snapshot?

The pull request https://github.com/openwrt/openwrt/pull/17617 still appears to be open.

Leo-PL marked this pull request as ready for review last week

I don't have SFP's lying around. So I can't test that.

AFAI can figure out, i'm with the 128 samsung nand. Which should be working.

I'll figure out how to build this particular PR and if I can - test it.

I built @Leo-PL 's pull request and tried to install openwrt-ath79-mikrotik-mikrotik_routerboard-2011uias-2hnd-squashfs-sysupgrade.bin, but:

Text from image:

Flash image?

The flash image was uploaded. Below is the checksum and file size listed, compare them with the original file to ensure data integrity.
Click 'Continue' below to start the flash procedure.

    Size: 6.61 MB
    MD5: 3ed2439039cedaf183a45f1138ee80fe
    SHA256: 6f56630455ae37e1495d77e96191c7dd13f5e726682255f6065eaf931d361fe0

Keep settings and retain the current configuration?
Device rb-2011uias-2hnd not supported by this image Supported devices: mikrotik,routerboard-2011uias-2hnd rb-2011l rb-2011il rb-2011ils rb-2011uas rb-2011uas-2hnd rb-2011uias rb-2011uias-2hnd rb-2011uias-2hnd-r2 - Image version mismatch: image 1.1, device 1.0. Please wipe config during upgrade (force required) or reinstall. Reason: NAND images switched to yafut. If running older image, reinstall from initramfs. Invalid sysupgrade file. Image check failed.

The uploaded image file does not contain a supported format. Make sure that you choose the generic image format for your platform.
 Force upgrade

Select 'Force upgrade' to flash the image even if the image format check fails. Use only if you are sure that the firmware is correct and meant for your device!

It seems my device is supported, by image is 1.1, device is 1.0. I don't know what that means and whether it's save to continue.

I also tried the openwrt-ath79-mikrotik-mikrotik_routerboard-2011uias-2hnd-squashfs-sysupgrade.bin from the same pull request, but still:

I'll wait until someone confirms I can flash either the initramfs or the sysupgrade image and if yes - which one of those.

if you are comming from an 19.07 install or similar upgrading might brick you device.

best is to tftp boot the initramfs and then flash the sysupgrade.

I probably forgot to set the compat_version in uci_defaults in one of older builds.
I can't guarantee upgrade from ar71xx at this time either - I had quite a busy time recently.

yes, from OpenWrt 19.07.10 r11427-9ce6aa9d8d / LuCI openwrt-19.07 branch git-22.099.58928-786ebc9.

upgrading might brick you device

Documentation says that "The MikroTik bootloader is preserved even after OpenWrt is installed into NAND or NOR flash. " - this means I can always unbrick a routerboard?

Documentation says several things:

Since an initramfs image is just a temporary image (only loaded into RAM), it is safe to test a particular version of OpenWrt by netbooting (using DHCP/BOOTP/TFTP) and downloading the initramfs image.

@g6094199, I guess you were saying just that.

# cat /sys/firmware/mikrotik/hard_config/booter_version
6.47.10

I managed to boot from BOOTP /TFTP, following the instructions:


dnsmasq-dhcp: 517058572 available DHCP range: 192.168.1.100 -- 192.168.1.200
dnsmasq-dhcp: 517058572 vendor class: Mips_boot
dnsmasq-dhcp: 517058572 tags: bootp, enp0s13f0u4u4
dnsmasq-dhcp: 517058572 BOOTP(enp0s13f0u4u4) 192.168.1.161 dc:2c:6e:74:36:0c 
dnsmasq-dhcp: 517058572 bootfile name: openwrt-ath79-mikrotik-mikrotik_routerboard-2011uias-2hnd-initramfs-kernel.bin
dnsmasq-dhcp: 517058572 next server: 192.168.1.10
dnsmasq-dhcp: 517058572 sent size:  4 option:  1 netmask  255.255.255.0
dnsmasq-dhcp: 517058572 sent size:  4 option: 28 broadcast  192.168.1.255
dnsmasq-dhcp: 517058572 sent size:  4 option:  3 router  192.168.1.10
dnsmasq-tftp: sent /src/openwrt/openwrt-mikrotik-rb2011/bin/targets/ath79/mikrotik/openwrt-ath79-mikrotik-mikrotik_routerboard-2011uias-2hnd-initramfs-kernel.bin to 192.168.1.161

Later it said:

dnsmasq-dhcp: 182527990 vendor class: udhcp 1.37.0
dnsmasq-dhcp: 182527990 client provides name: OpenWrt

Which means it booted. After that I connected to a lan port, got an IP, but that was it - no ping, no ssh, no nothing, nmap returns nothing.

Later i tried it again and same result. Even before disconnecting the wan port I tried to scan it with nmap - I got nothing.

While booting it gets 192.168.1.161, then after it boots it presents itself as Openwrt:

dnsmasq-dhcp: 1843128298 client provides name: OpenWrt
dnsmasq-dhcp: 1843128298 DHCPDISCOVER(enp0s13f0u3u4) dc:2c:6e:74:36:0d 
dnsmasq-dhcp: 1843128298 tags: enp0s13f0u3u4
dnsmasq-dhcp: 1843128298 DHCPOFFER(enp0s13f0u3u4) 192.168.1.162 dc:2c:6e:74:36:0d 
dnsmasq-dhcp: 1843128298 requested options: 1:netmask, 3:router, 6:dns-server, 12:hostname, 
dnsmasq-dhcp: 1843128298 requested options: 15:domain-name, 28:broadcast, 42:ntp-server, 
dnsmasq-dhcp: 1843128298 requested options: 121:classless-static-route
dnsmasq-dhcp: 1843128298 bootfile name: openwrt-ath79-mikrotik-mikrotik_routerboard-2011uias-2hnd-initramfs-kernel.bin

Yet, nothing works on the wan - ping shouldn't work, because by default it's disabled.
It responds to arp requests:

Also some dhcp:

image

Even dhcpv6:

So it seems it booted successfully, but I can't get inside.


Second time I connected on a lan port I started sniffing immediately:

$ ip r g 192.168.1.1
192.168.1.1 dev enp0s13f0u4u4 src 192.168.1.162 uid 1000 
    cache 
$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.162 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: No route to host
From 192.168.1.162 icmp_seq=2 Destination Host Unreachable
From 192.168.1.162 icmp_seq=3 Destination Host Unreachable
From 192.168.1.162 icmp_seq=5 Destination Host Unreachable
ping: sendmsg: No route to host
From 192.168.1.162 icmp_seq=6 Destination Host Unreachable
From 192.168.1.162 icmp_seq=7 Destination Host Unreachable
From 192.168.1.162 icmp_seq=9 Destination Host Unreachable
From 192.168.1.162 icmp_seq=10 Destination Host Unreachable
From 192.168.1.162 icmp_seq=11 Destination Host Unreachable

while pinging I don't see the icmp requests I just see arp requests (first to the router, then broadcast, no responses):

Also, some ipv6 stuff:

Ideas?

I realized, that my previous patch was completely wrong. I made a new one, tailored to our problematic NAND. Please try booting initramfs, and check MTD files as previously - don't install yet, because it'll probably OOM again.