[WIP] Porting Mikrotik RB2011 to ath79 - testers needed

@g6094199 - Please tell me, which model of RB2011 do you have? I could not find RB2011 models with 64MB flash memory on the Mikrotik website. For all it is 128 MB.

I have two of these RB2011, all three have 64mb RAM

RB2011iL(S)-IN version with 64MB NAND (early revisoins from 2013 or so)

as i gave some info above some time ago, with a possible fix 2 comments down

2 Likes

Okay, I've made a dynamic determination of the size of the flash memory:

	partition@400000 {
			label = "ubi";
			reg = <0x0400000 0>; /* dynamic size: 64Mb || 128Mb */
		};
1 Like

Okay, I've finished all work on RB2011 support. Now you can try the firmware: https://github.com/adron-s/openwrt-rb2011/releases/tag/OpenWrt-22.03.3-rb2011

1 Like

sorry @adron for the delay. it doesnt seem to boot ok with 64mb. this is my current dmesg from your initfs where are many badblocks are shown. but i cant believe this is right. havent had this with other builds (see above). also the flashing of the sysupgrade file (5mb) is very fast (<15 sec) ....much to fast imho...so i guess the process gets interrupted....to bad i havnt serial access.

BusyBox v1.35.0 (2023-01-03 00:24:21 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 22.03.3, r20028-43d71ad93e
 -----------------------------------------------------
=== 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:~# dmesg 
[    0.000000] Linux version 5.10.161 (root@adron-dev-srw1) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r20028-43d71ad93e) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 Tue Jan 3 00:24:21 2023
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is MikroTik RouterBOARD 2011UiAS
[    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] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    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: 16240
[    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] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 52452K/65536K available (6134K kernel code, 593K rwdata, 1300K rodata, 4124K init, 205K bss, 13084K 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.000011] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.008938] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.086062] pid_max: default: 32768 minimum: 301
[    0.091485] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.099789] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.111126] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.124168] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.135392] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.143253] pinctrl core: initialized pinctrl subsystem
[    0.150995] NET: Registered protocol family 16
[    0.233976] clocksource: Switched to clocksource MIPS
[    0.241160] NET: Registered protocol family 2
[    0.246451] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.255456] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.265106] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.273816] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.281862] TCP: Hash tables configured (established 1024 bind 1024)
[    0.289256] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.296756] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.305049] NET: Registered protocol family 1
[    0.310033] PCI: CLS 0 bytes, default 32
[    5.064522] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    5.076378] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    5.083001] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    5.099052] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    5.106501] gpio-export gpio-export: 3 gpio(s) exported
[    5.113549] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    5.121716] printk: console [ttyS0] disabled
[    5.126723] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    5.136555] printk: console [ttyS0] enabled
[    5.145629] printk: bootconsole [early0] disabled
[    5.174723] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    5.181303] nand: Samsung NAND 64MiB 3,3V 8-bit
[    5.186025] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    5.193657] Scanning device for bad blocks
[    5.235533] Bad eraseblock 17 at 0x000000044000
[    5.240259] Bad eraseblock 18 at 0x000000048000
[    5.244997] Bad eraseblock 19 at 0x00000004c000
[    5.249709] Bad eraseblock 20 at 0x000000050000
[    5.254445] Bad eraseblock 21 at 0x000000054000
[    5.259161] Bad eraseblock 22 at 0x000000058000
[    5.263874] Bad eraseblock 23 at 0x00000005c000
[    5.268610] Bad eraseblock 24 at 0x000000060000
[    5.273327] Bad eraseblock 25 at 0x000000064000
[    5.278071] Bad eraseblock 26 at 0x000000068000
[    5.282789] Bad eraseblock 27 at 0x00000006c000
[    5.287526] Bad eraseblock 28 at 0x000000070000
[    5.292242] Bad eraseblock 29 at 0x000000074000
[    5.296977] Bad eraseblock 30 at 0x000000078000
[    5.301694] Bad eraseblock 31 at 0x00000007c000
[    5.306447] Bad eraseblock 32 at 0x000000080000
[    5.311165] Bad eraseblock 33 at 0x000000084000
[    5.315915] Bad eraseblock 34 at 0x000000088000
[    5.320626] Bad eraseblock 35 at 0x00000008c000
[    5.325364] Bad eraseblock 36 at 0x000000090000
[    5.330079] Bad eraseblock 37 at 0x000000094000
[    5.334816] Bad eraseblock 38 at 0x000000098000
[    5.339531] Bad eraseblock 39 at 0x00000009c000
[    5.344268] Bad eraseblock 40 at 0x0000000a0000
[    5.348985] Bad eraseblock 41 at 0x0000000a4000
[    5.353698] Bad eraseblock 42 at 0x0000000a8000
[    5.358442] Bad eraseblock 43 at 0x0000000ac000
[    5.363161] Bad eraseblock 44 at 0x0000000b0000
[    5.367896] Bad eraseblock 45 at 0x0000000b4000
[    5.372611] Bad eraseblock 46 at 0x0000000b8000
[    5.377348] Bad eraseblock 47 at 0x0000000bc000
[    5.382064] Bad eraseblock 48 at 0x0000000c0000
[    5.386801] Bad eraseblock 49 at 0x0000000c4000
[    5.391518] Bad eraseblock 50 at 0x0000000c8000
[    5.396260] Bad eraseblock 51 at 0x0000000cc000
[    5.400979] Bad eraseblock 52 at 0x0000000d0000
[    5.405717] Bad eraseblock 53 at 0x0000000d4000
[    5.410432] Bad eraseblock 54 at 0x0000000d8000
[    5.415168] Bad eraseblock 55 at 0x0000000dc000
[    5.419885] Bad eraseblock 56 at 0x0000000e0000
[    5.424632] Bad eraseblock 57 at 0x0000000e4000
[    5.429347] Bad eraseblock 58 at 0x0000000e8000
[    5.434084] Bad eraseblock 59 at 0x0000000ec000
[    5.438799] Bad eraseblock 60 at 0x0000000f0000
[    5.443512] Bad eraseblock 61 at 0x0000000f4000
[    5.448248] Bad eraseblock 62 at 0x0000000f8000
[    5.452965] Bad eraseblock 63 at 0x0000000fc000
[    5.457702] Bad eraseblock 64 at 0x000000100000
[    5.462418] Bad eraseblock 65 at 0x000000104000
[    5.467160] Bad eraseblock 66 at 0x000000108000
[    5.471871] Bad eraseblock 67 at 0x00000010c000
[    5.476607] Bad eraseblock 68 at 0x000000110000
[    5.481324] Bad eraseblock 69 at 0x000000114000
[    5.486059] Bad eraseblock 70 at 0x000000118000
[    5.490776] Bad eraseblock 71 at 0x00000011c000
[    5.495513] Bad eraseblock 72 at 0x000000120000
[    5.500228] Bad eraseblock 73 at 0x000000124000
[    5.504971] Bad eraseblock 74 at 0x000000128000
[    5.509682] Bad eraseblock 75 at 0x00000012c000
[    5.514418] Bad eraseblock 76 at 0x000000130000
[    5.519135] Bad eraseblock 77 at 0x000000134000
[    5.523848] Bad eraseblock 78 at 0x000000138000
[    5.528584] Bad eraseblock 79 at 0x00000013c000
[    5.533301] Bad eraseblock 80 at 0x000000140000
[    5.538047] Bad eraseblock 81 at 0x000000144000
[    5.542762] Bad eraseblock 82 at 0x000000148000
[    5.547501] Bad eraseblock 83 at 0x00000014c000
[    5.552214] Bad eraseblock 84 at 0x000000150000
[    5.556951] Bad eraseblock 85 at 0x000000154000
[    5.561668] Bad eraseblock 86 at 0x000000158000
[    5.566405] Bad eraseblock 87 at 0x00000015c000
[    5.571120] Bad eraseblock 88 at 0x000000160000
[    5.575865] Bad eraseblock 89 at 0x000000164000
[    5.580582] Bad eraseblock 90 at 0x000000168000
[    5.585320] Bad eraseblock 91 at 0x00000016c000
[    5.590035] Bad eraseblock 92 at 0x000000170000
[    5.594772] Bad eraseblock 93 at 0x000000174000
[    5.599487] Bad eraseblock 94 at 0x000000178000
[    5.604225] Bad eraseblock 95 at 0x00000017c000
[    5.608941] Bad eraseblock 96 at 0x000000180000
[    5.613653] Bad eraseblock 97 at 0x000000184000
[    5.618397] Bad eraseblock 98 at 0x000000188000
[    5.623117] Bad eraseblock 99 at 0x00000018c000
[    5.627853] Bad eraseblock 100 at 0x000000190000
[    5.632657] Bad eraseblock 101 at 0x000000194000
[    5.637485] Bad eraseblock 102 at 0x000000198000
[    5.642290] Bad eraseblock 103 at 0x00000019c000
[    5.647127] Bad eraseblock 104 at 0x0000001a0000
[    5.651931] Bad eraseblock 105 at 0x0000001a4000
[    5.656759] Bad eraseblock 106 at 0x0000001a8000
[    5.661563] Bad eraseblock 107 at 0x0000001ac000
[    5.666389] Bad eraseblock 108 at 0x0000001b0000
[    5.671195] Bad eraseblock 109 at 0x0000001b4000
[    5.676021] Bad eraseblock 110 at 0x0000001b8000
[    5.680827] Bad eraseblock 111 at 0x0000001bc000
[    5.685660] Bad eraseblock 112 at 0x0000001c0000
[    5.690468] Bad eraseblock 113 at 0x0000001c4000
[    5.695295] Bad eraseblock 114 at 0x0000001c8000
[    5.700100] Bad eraseblock 115 at 0x0000001cc000
[    5.704926] Bad eraseblock 116 at 0x0000001d0000
[    5.709732] Bad eraseblock 117 at 0x0000001d4000
[    5.714558] Bad eraseblock 118 at 0x0000001d8000
[    5.719363] Bad eraseblock 119 at 0x0000001dc000
[    5.724197] Bad eraseblock 120 at 0x0000001e0000
[    5.729006] Bad eraseblock 121 at 0x0000001e4000
[    5.733807] Bad eraseblock 122 at 0x0000001e8000
[    5.738635] Bad eraseblock 123 at 0x0000001ec000
[    5.743439] Bad eraseblock 124 at 0x0000001f0000
[    5.748265] Bad eraseblock 125 at 0x0000001f4000
[    5.753072] Bad eraseblock 126 at 0x0000001f8000
[    5.757908] Bad eraseblock 127 at 0x0000001fc000
[    5.762713] Bad eraseblock 128 at 0x000000200000
[    5.767539] Bad eraseblock 129 at 0x000000204000
[    5.772344] Bad eraseblock 130 at 0x000000208000
[    5.777170] Bad eraseblock 131 at 0x00000020c000
[    5.781977] Bad eraseblock 132 at 0x000000210000
[    5.786803] Bad eraseblock 133 at 0x000000214000
[    5.791609] Bad eraseblock 134 at 0x000000218000
[    5.796441] Bad eraseblock 135 at 0x00000021c000
[    5.801241] Bad eraseblock 136 at 0x000000220000
[    5.806068] Bad eraseblock 137 at 0x000000224000
[    5.810873] Bad eraseblock 138 at 0x000000228000
[    5.815709] Bad eraseblock 139 at 0x00000022c000
[    5.820514] Bad eraseblock 140 at 0x000000230000
[    5.825342] Bad eraseblock 141 at 0x000000234000
[    5.830145] Bad eraseblock 142 at 0x000000238000
[    5.834972] Bad eraseblock 143 at 0x00000023c000
[    5.839778] Bad eraseblock 144 at 0x000000240000
[    5.844604] Bad eraseblock 145 at 0x000000244000
[    5.849410] Bad eraseblock 146 at 0x000000248000
[    5.854242] Bad eraseblock 147 at 0x00000024c000
[    5.859050] Bad eraseblock 148 at 0x000000250000
[    5.863852] Bad eraseblock 149 at 0x000000254000
[    5.868690] Bad eraseblock 150 at 0x000000258000
[    5.873496] Bad eraseblock 151 at 0x00000025c000
[    5.878323] Bad eraseblock 152 at 0x000000260000
[    5.883126] Bad eraseblock 153 at 0x000000264000
[    5.887952] Bad eraseblock 154 at 0x000000268000
[    5.892759] Bad eraseblock 155 at 0x00000026c000
[    5.897584] Bad eraseblock 156 at 0x000000270000
[    5.902390] Bad eraseblock 157 at 0x000000274000
[    5.907224] Bad eraseblock 158 at 0x000000278000
[    5.912032] Bad eraseblock 159 at 0x00000027c000
[    5.916857] Bad eraseblock 160 at 0x000000280000
[    5.921662] Bad eraseblock 161 at 0x000000284000
[    5.926488] Bad eraseblock 162 at 0x000000288000
[    5.931295] Bad eraseblock 163 at 0x00000028c000
[    5.936121] Bad eraseblock 164 at 0x000000290000
[    6.168541] 3 fixed-partitions partitions found on MTD device ar934x-nand
[    6.175588] Creating 3 MTD partitions on "ar934x-nand":
[    6.181015] 0x000000000000-0x000000040000 : "booter"
[    6.187348] 0x000000040000-0x000000400000 : "kernel"
[    6.195744] 0x000000400000-0x000004000000 : "ubi"
[    6.211432] spi-nor spi0.0: w25x10 (128 Kbytes)
[    6.216240] 1 fixed-partitions partitions found on MTD device spi0.0
[    6.222854] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    6.229768] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    6.238063] Creating 1 MTD partitions on "spi0.0":
[    6.243035] 0x000000000000-0x000000010000 : "RouterBoot"
[    6.251508] 4 routerbootpart partitions found on MTD device RouterBoot
[    6.258411] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    6.266927] Creating 4 MTD partitions on "RouterBoot":
[    6.272255] 0x000000000000-0x00000000b000 : "bootloader1"
[    6.281165] 0x00000000b000-0x00000000c000 : "hard_config"
[    6.288037] 0x00000000c000-0x00000000d000 : "bios"
[    6.296171] 0x00000000f000-0x000000010000 : "soft_config"
[    6.311055] ag71xx 19000000.eth: invalid MAC address, using random address
[    6.793377] ag71xx 19000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    6.803438] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii-rxid
[    6.813592] ag71xx 1a000000.eth: invalid MAC address, using random address
[    7.519920] ag71xx 1a000000.eth: connected to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    7.529956] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    7.544526] MikroTik RouterBOARD hardware configuration sysfs driver v0.07
[    7.553749] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    7.561805] NET: Registered protocol family 10
[    7.568380] Segment Routing with IPv6
[    7.572313] NET: Registered protocol family 17
[    7.577360] 8021q: 802.1Q VLAN Support v1.8
[    7.686706] qca8k mdio.0:10: configuring for fixed/rgmii link mode
[    7.696513] qca8k mdio.0:10: Link is Up - 1Gbps/Full - flow control off
[    7.774880] qca8k mdio.0:10 port1 (uninitialized): PHY [mdio.0:00] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.864874] qca8k mdio.0:10 port2 (uninitialized): PHY [mdio.0:01] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.954907] qca8k mdio.0:10 port3 (uninitialized): PHY [mdio.0:02] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    8.044884] qca8k mdio.0:10 port4 (uninitialized): PHY [mdio.0:03] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    8.134895] qca8k mdio.0:10 port5 (uninitialized): PHY [mdio.0:04] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    8.152728] DSA: tree 0 setup
[    8.204085] random: crng init done
[    8.320505] ar9331_switch mdio.1:10: configuring for fixed/gmii link mode
[    8.329934] ar9331_switch mdio.1:10: Link is Up - 1Gbps/Full - flow control off
[    8.405365] ar9331_switch mdio.1:10 port10 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:00] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.495364] ar9331_switch mdio.1:10 port9 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:01] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.585409] ar9331_switch mdio.1:10 port8 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:02] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.675345] ar9331_switch mdio.1:10 port7 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:03] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.765366] ar9331_switch mdio.1:10 port6 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:04] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.782484] DSA: tree 1 setup
[    8.788703] UBI: auto-attach mtd2
[    8.792181] ubi0: attaching mtd2
[    9.500779] ubi0: scanning is finished
[    9.526046] ubi0: attached mtd2 (name "ubi", size 60 MiB)
[    9.531639] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
[    9.538536] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
[    9.545304] ubi0: VID header offset: 256 (aligned 256), data offset: 512
[    9.552223] ubi0: good PEBs: 3840, bad PEBs: 0, corrupted PEBs: 0
[    9.558528] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 92
[    9.565910] ubi0: max/mean erase counter: 3/2, WL threshold: 4096, image sequence number: 551662777
[    9.575262] ubi0: available PEBs: 0, total reserved PEBs: 3840, PEBs reserved for bad PEB handling: 80
[    9.584984] ubi0: background thread "ubi_bgt0d" started, PID 396
[    9.593337] block ubiblock0_0: created from ubi0:0(rootfs)
[    9.599094] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    9.634741] Freeing unused kernel memory: 4124K
[    9.639432] This architecture does not have kernel memory protection.
[    9.646144] Run /init as init process
[    9.649929]   with arguments:
[    9.649935]     /init
[    9.649940]   with environment:
[    9.649946]     HOME=/
[    9.649950]     TERM=linux
[   10.315687] init: Console is alive
[   10.319767] init: - watchdog -
[   10.344987] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[   10.358962] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   10.377053] init: - preinit -
[   11.396764] eth0: link up (1000Mbps/Full duplex)
[   11.401839] qca8k mdio.0:10 port2: configuring for phy/ link mode
[   11.484103] 8021q: adding VLAN 0 to HW filter on device port2
[   11.490960] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.713615] procd: - early -
[   15.717169] procd: - watchdog -
[   16.353306] procd: - watchdog -
[   16.357099] procd: - ubus -
[   16.415420] procd: - init -
[   17.259105] kmodloader: loading kernel modules from /etc/modules.d/*
[   17.464366] PPP generic driver version 2.4.2
[   17.476210] NET: Registered protocol family 24
[   17.517870] kmodloader: done loading kernel modules from /etc/modules.d/*
[   17.589154] urngd: v1.0.2 started.
[   53.152159] eth0: link down
[   53.185358] eth0: link up (1000Mbps/Full duplex)
[   53.190170] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   53.216797] device eth0 entered promiscuous mode
[   53.229951] qca8k mdio.0:10 port2: configuring for phy/ link mode
[   53.314230] 8021q: adding VLAN 0 to HW filter on device port2
[   53.328529] br-lan: port 1(port2) entered blocking state
[   53.334103] br-lan: port 1(port2) entered disabled state
[   53.339988] device port2 entered promiscuous mode
[   53.505260] qca8k mdio.0:10 port3: configuring for phy/ link mode

is see the unit is rebooting after a while. so i guess its still the old image. so there might be something wrong in the flashing process. btw flashed from web-gui and from cli with -f....

1 Like

@hecatae: do u have a unit with working serial port and 64mb?? could you post us a serial log while flashing it?

I have two rb2011 128mb NAND with 64mb RAM, and two rb2011 128mb NAND with 128mb RAM.

None with 64mb NAND like yours.

You have half of the 4 MB partition for the kernel full of bad blocks! The kernel simply does not fit into the remaining 2 megabytes of space. It is necessary to reformat the flash memory (via RouterBoot).

try to download this module to your rb2011 and do:

insmod bb_eraser part=kernel
mtd erase kernel
insmod bb_eraser part=ubi
mtd erase ubi
reboot

the bad blocks should be gone and the sysupgrade process should be fine.

you link has typo? its a 404.

try this one

will do in the next hours and report back :+1:

@adron : FYI

the inserting of bb_eraser fails with

failed to insert bb_eraser.ko

but log tells me

[ 1019.459464] test_m_module_init: mtd->name: kernel, mtd->parent: 0x81423880
[ 1019.466671] chip = 0x3c5e133f
[ 1019.469740] Go to sleep...grace time for protect old bbt
[ 1024.504001] Sleep done. Freeing old bbt
[ 1024.507988] reset chip->bbt done. Now you can do: mtd erase kernel
[ 1030.803601] test_m_module_init: mtd->name: kernel, mtd->parent: 0x81423880
[ 1030.810781] chip = 0x3c5e133f
[ 1030.813853] Go to sleep...grace time for protect old bbt
[ 1035.864004] Sleep done. Freeing old bbt
[ 1035.867985] reset chip->bbt done. Now you can do: mtd erase kernel

but i can erase kernel

and now the bad block erros are gone.

BusyBox v1.35.0 (2023-01-03 00:24:21 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 22.03.3, r20028-43d71ad93e
 -----------------------------------------------------
=== 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:~# dmesg 
[    0.000000] Linux version 5.10.161 (root@adron-dev-srw1) (mips-openwrt-linux-musl-gcc (OpenWrt GCC 11.2.0 r20028-43d71ad93e) 11.2.0, GNU ld (GNU Binutils) 2.37) #0 Tue Jan 3 00:24:21 2023
[    0.000000] printk: bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[    0.000000] MIPS: machine is MikroTik RouterBOARD 2011UiAS
[    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] On node 0 totalpages: 16384
[    0.000000]   Normal zone: 144 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    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: 16240
[    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] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 52452K/65536K available (6134K kernel code, 593K rwdata, 1300K rodata, 4124K init, 205K bss, 13084K 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.000010] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[    0.008942] Calibrating delay loop... 299.82 BogoMIPS (lpj=1499136)
[    0.086063] pid_max: default: 32768 minimum: 301
[    0.091486] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.099789] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.111128] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build
[    0.124164] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.135392] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[    0.143253] pinctrl core: initialized pinctrl subsystem
[    0.150996] NET: Registered protocol family 16
[    0.234035] clocksource: Switched to clocksource MIPS
[    0.241216] NET: Registered protocol family 2
[    0.246514] IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.255520] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.265168] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.273879] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.281925] TCP: Hash tables configured (established 1024 bind 1024)
[    0.289320] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.296820] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.305111] NET: Registered protocol family 1
[    0.310087] PCI: CLS 0 bytes, default 32
[    5.064184] workingset: timestamp_bits=14 max_order=14 bucket_order=0
[    5.076032] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    5.082661] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    5.098567] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[    5.106012] gpio-export gpio-export: 3 gpio(s) exported
[    5.113056] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[    5.121216] printk: console [ttyS0] disabled
[    5.126220] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    5.136053] printk: console [ttyS0] enabled
[    5.145119] printk: bootconsole [early0] disabled
[    5.174024] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    5.180670] nand: Samsung NAND 64MiB 3,3V 8-bit
[    5.185371] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    5.192997] Scanning device for bad blocks
[    5.471670] 3 fixed-partitions partitions found on MTD device ar934x-nand
[    5.478725] Creating 3 MTD partitions on "ar934x-nand":
[    5.484164] 0x000000000000-0x000000040000 : "booter"
[    5.490473] 0x000000040000-0x000000400000 : "kernel"
[    5.498847] 0x000000400000-0x000004000000 : "ubi"
[    5.514687] spi-nor spi0.0: w25x10 (128 Kbytes)
[    5.519433] 1 fixed-partitions partitions found on MTD device spi0.0
[    5.526106] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    5.532967] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    5.541287] Creating 1 MTD partitions on "spi0.0":
[    5.546306] 0x000000000000-0x000000010000 : "RouterBoot"
[    5.554754] 4 routerbootpart partitions found on MTD device RouterBoot
[    5.561593] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    5.570139] Creating 4 MTD partitions on "RouterBoot":
[    5.575528] 0x000000000000-0x00000000b000 : "bootloader1"
[    5.584480] 0x00000000b000-0x00000000c000 : "hard_config"
[    5.591273] 0x00000000c000-0x00000000d000 : "bios"
[    5.599402] 0x00000000f000-0x000000010000 : "soft_config"
[    5.613567] ag71xx 19000000.eth: invalid MAC address, using random address
[    6.093483] ag71xx 19000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    6.103545] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii-rxid
[    6.113719] ag71xx 1a000000.eth: invalid MAC address, using random address
[    6.484082] random: crng init done
[    6.820034] ag71xx 1a000000.eth: connected to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    6.830074] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    6.844713] MikroTik RouterBOARD hardware configuration sysfs driver v0.07
[    6.853942] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    6.862008] NET: Registered protocol family 10
[    6.868521] Segment Routing with IPv6
[    6.872455] NET: Registered protocol family 17
[    6.877490] 8021q: 802.1Q VLAN Support v1.8
[    6.986724] qca8k mdio.0:10: configuring for fixed/rgmii link mode
[    6.996553] qca8k mdio.0:10: Link is Up - 1Gbps/Full - flow control off
[    7.074958] qca8k mdio.0:10 port1 (uninitialized): PHY [mdio.0:00] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.164932] qca8k mdio.0:10 port2 (uninitialized): PHY [mdio.0:01] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.254976] qca8k mdio.0:10 port3 (uninitialized): PHY [mdio.0:02] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.344953] qca8k mdio.0:10 port4 (uninitialized): PHY [mdio.0:03] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.434943] qca8k mdio.0:10 port5 (uninitialized): PHY [mdio.0:04] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.452774] DSA: tree 0 setup
[    7.617050] ar9331_switch mdio.1:10: configuring for fixed/gmii link mode
[    7.626397] ar9331_switch mdio.1:10: Link is Up - 1Gbps/Full - flow control off
[    7.705415] ar9331_switch mdio.1:10 port10 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:00] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    7.795424] ar9331_switch mdio.1:10 port9 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:01] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    7.885492] ar9331_switch mdio.1:10 port8 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:02] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    7.975419] ar9331_switch mdio.1:10 port7 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:03] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.065494] ar9331_switch mdio.1:10 port6 (uninitialized): PHY [!ahb!eth@1a000000!mdio!switch@10:04] driver [Qualcomm Atheros AR9XXX built-in PHY] (irq=17)
[    8.082693] DSA: tree 1 setup
[    8.088909] UBI: auto-attach mtd2
[    8.092386] ubi0: attaching mtd2
[    8.800807] ubi0: scanning is finished
[    8.825262] ubi0: attached mtd2 (name "ubi", size 60 MiB)
[    8.830860] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
[    8.837761] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
[    8.844525] ubi0: VID header offset: 256 (aligned 256), data offset: 512
[    8.851445] ubi0: good PEBs: 3840, bad PEBs: 0, corrupted PEBs: 0
[    8.857750] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 92
[    8.865131] ubi0: max/mean erase counter: 2/1, WL threshold: 4096, image sequence number: 405459256
[    8.874493] ubi0: available PEBs: 0, total reserved PEBs: 3840, PEBs reserved for bad PEB handling: 80
[    8.884236] ubi0: background thread "ubi_bgt0d" started, PID 396
[    8.892586] block ubiblock0_0: created from ubi0:0(rootfs)
[    8.898342] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    8.933965] Freeing unused kernel memory: 4124K
[    8.938699] This architecture does not have kernel memory protection.
[    8.945404] Run /init as init process
[    8.949186]   with arguments:
[    8.949192]     /init
[    8.949197]   with environment:
[    8.949203]     HOME=/
[    8.949208]     TERM=linux
[    9.614191] init: Console is alive
[    9.618276] init: - watchdog -
[    9.643626] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    9.657335] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    9.675439] init: - preinit -
[   10.694069] eth0: link up (1000Mbps/Full duplex)
[   10.699175] qca8k mdio.0:10 port2: configuring for phy/ link mode
[   10.784161] 8021q: adding VLAN 0 to HW filter on device port2
[   10.791011] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.013603] procd: - early -
[   15.017148] procd: - watchdog -
[   15.650924] procd: - watchdog -
[   15.654725] procd: - ubus -
[   15.712845] procd: - init -
[   16.557604] kmodloader: loading kernel modules from /etc/modules.d/*
[   16.765059] PPP generic driver version 2.4.2
[   16.786243] NET: Registered protocol family 24
[   16.824886] kmodloader: done loading kernel modules from /etc/modules.d/*
[   16.894003] urngd: v1.0.2 started.
[   55.175590] eth0: link down
[   55.201464] eth0: link up (1000Mbps/Full duplex)
[   55.224180] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   55.235816] device eth0 entered promiscuous mode
[   55.262743] qca8k mdio.0:10 port2: configuring for phy/ link mode
[   55.344286] 8021q: adding VLAN 0 to HW filter on device port2

i have also successfully flashed the sysupgrade image (to 2 min or so) but the doesnt boot correctly.
again after a few minutes the unit reboots (bootloop).

This is normal. The module does all its work and returns an error code.

Try to use nandtest - after bad blocks cleanaup && reboot. This is necessary to re-mark really bad sectors of the flash memory.

ok

but i want to verify that the boot setting is not the problem. rbcfg is deprecated and replaced by rb_softconfig but i cant find a howto to use it.
can you give me a hint howto check and set the boot mode with rb_softconf?

thx!

ok. i checked the rb_softconfig code. the config can be found in

/sys/firmware/mikrotik/soft_config
cat boot_device 
eth [flasheth] ethonce flash cfg cfgonce

which means: "boot from NAND, if fail then Ethernet"
right?!
this semms to be ok. and confirms the current behaviour.

Yes, sure:

cat /sys/firmware/mikrotik/soft_config/boot_device
echo eth > /sys/firmware/mikrotik/soft_config/boot_device
cat /sys/firmware/mikrotik/soft_config/commit
echo 1 > /sys/firmware/mikrotik/soft_config/commit
cat /sys/firmware/mikrotik/soft_config/commit
1 Like

edited my post to slow ..... :wink:

for reference nandtest is in: nand-utils

root@OpenWrt:/tmp# nandtest -m -p 3 /dev/mtd1
ECC corrections: 0
ECC failures   : 0
Bad blocks     : 0
BBT blocks     : 0
003bc000: checking...of 4)...
Finished pass 1 successfully
003bc000: checking...of 4)...
Finished pass 2 successfully
003bc000: checking...of 4)...
Finished pass 3 successfully
root@OpenWrt:/tmp# nandtest -m -p 3 /dev/mtd2
ECC corrections: 0
ECC failures   : 0
Bad blocks     : 0
BBT blocks     : 0
03bfc000: checking...of 4)...
Finished pass 1 successfully
03bfc000: checking...of 4)...
Finished pass 2 successfully
03bfc000: checking...of 4)...
Finished pass 3 successfully

still flashes ok, but no successfull booting.

Right. It must boot from the nand-flash. According to your dmesg, we can see that nand and nor flash drives are successfully detected. There are no bad blocks - that means they were all soft and in fact the flash drive is in perfect state.
Also please show the result of:
cat /sys/firmware/mikrotik/hard_config/booter_version