[WIP] Porting Mikrotik RB2011 to ath79 - testers needed

2.39

shiny....old shit :wink:

Ohoho...please upgrade to 6.x or 7.x using NetInstall.

ok

i switched from backup to regular booter via rb_softconf (love it :wink: ) and there i already had 6.48.2 which should be ok, right?

i booted initramfs and the bad blocks complains are back

[    5.089919] printk: console [ttyS0] disabled
[    5.094852] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[    5.104714] printk: console [ttyS0] enabled
[    5.113787] printk: bootconsole [early0] disabled
[    5.143407] nand: device found, Manufacturer ID: 0xec, Chip ID: 0x76
[    5.150045] nand: Samsung NAND 64MiB 3,3V 8-bit
[    5.154730] nand: 64 MiB, SLC, erase size: 16 KiB, page size: 512, OOB size: 16
[    5.162374] Scanning device for bad blocks
[    5.199912] Bad eraseblock 17 at 0x000000044000
[    5.204644] Bad eraseblock 18 at 0x000000048000
[    5.209380] Bad eraseblock 19 at 0x00000004c000
[    5.214092] Bad eraseblock 20 at 0x000000050000
[    5.218829] Bad eraseblock 21 at 0x000000054000
[    5.223545] Bad eraseblock 22 at 0x000000058000
[    5.228258] Bad eraseblock 23 at 0x00000005c000
[    5.232994] Bad eraseblock 24 at 0x000000060000
[    5.237710] Bad eraseblock 25 at 0x000000064000
[    5.242452] Bad eraseblock 26 at 0x000000068000
[    5.247164] Bad eraseblock 27 at 0x00000006c000
[    5.251899] Bad eraseblock 28 at 0x000000070000
[    5.256616] Bad eraseblock 29 at 0x000000074000
[    5.261351] Bad eraseblock 30 at 0x000000078000
[    5.266069] Bad eraseblock 31 at 0x00000007c000
[    5.270820] Bad eraseblock 32 at 0x000000080000
[    5.275532] Bad eraseblock 33 at 0x000000084000
[    5.280269] Bad eraseblock 34 at 0x000000088000
[    5.284985] Bad eraseblock 35 at 0x00000008c000
[    5.289718] Bad eraseblock 36 at 0x000000090000
[    5.294428] Bad eraseblock 37 at 0x000000094000
[    5.299162] Bad eraseblock 38 at 0x000000098000
[    5.303872] Bad eraseblock 39 at 0x00000009c000
[    5.308619] Bad eraseblock 40 at 0x0000000a0000
[    5.313334] Bad eraseblock 41 at 0x0000000a4000
[    5.318046] Bad eraseblock 42 at 0x0000000a8000
[    5.322783] Bad eraseblock 43 at 0x0000000ac000
[    5.327499] Bad eraseblock 44 at 0x0000000b0000
[    5.332234] Bad eraseblock 45 at 0x0000000b4000
[    5.336943] Bad eraseblock 46 at 0x0000000b8000
[    5.341677] Bad eraseblock 47 at 0x0000000bc000
[    5.346387] Bad eraseblock 48 at 0x0000000c0000
[    5.351129] Bad eraseblock 49 at 0x0000000c4000
[    5.355840] Bad eraseblock 50 at 0x0000000c8000
[    5.360574] Bad eraseblock 51 at 0x0000000cc000
[    5.365283] Bad eraseblock 52 at 0x0000000d0000
[    5.370017] Bad eraseblock 53 at 0x0000000d4000
[    5.374728] Bad eraseblock 54 at 0x0000000d8000
[    5.379460] Bad eraseblock 55 at 0x0000000dc000
[    5.384171] Bad eraseblock 56 at 0x0000000e0000
[    5.388912] Bad eraseblock 57 at 0x0000000e4000
[    5.393624] Bad eraseblock 58 at 0x0000000e8000
[    5.398355] Bad eraseblock 59 at 0x0000000ec000
[    5.403068] Bad eraseblock 60 at 0x0000000f0000
[    5.407780] Bad eraseblock 61 at 0x0000000f4000
[    5.412516] Bad eraseblock 62 at 0x0000000f8000
[    5.417225] Bad eraseblock 63 at 0x0000000fc000
[    5.421970] Bad eraseblock 64 at 0x000000100000
[    5.426686] Bad eraseblock 65 at 0x000000104000
[    5.431422] Bad eraseblock 66 at 0x000000108000
[    5.436129] Bad eraseblock 67 at 0x00000010c000
[    5.440863] Bad eraseblock 68 at 0x000000110000
[    5.445574] Bad eraseblock 69 at 0x000000114000
[    5.450308] Bad eraseblock 70 at 0x000000118000
[    5.455018] Bad eraseblock 71 at 0x00000011c000
[    5.459760] Bad eraseblock 72 at 0x000000120000
[    5.464471] Bad eraseblock 73 at 0x000000124000
[    5.469205] Bad eraseblock 74 at 0x000000128000
[    5.473915] Bad eraseblock 75 at 0x00000012c000
[    5.478647] Bad eraseblock 76 at 0x000000130000
[    5.483358] Bad eraseblock 77 at 0x000000134000
[    5.488071] Bad eraseblock 78 at 0x000000138000
[    5.492806] Bad eraseblock 79 at 0x00000013c000
[    5.497515] Bad eraseblock 80 at 0x000000140000
[    5.502256] Bad eraseblock 81 at 0x000000144000
[    5.506968] Bad eraseblock 82 at 0x000000148000
[    5.511703] Bad eraseblock 83 at 0x00000014c000
[    5.516412] Bad eraseblock 84 at 0x000000150000
[    5.521145] Bad eraseblock 85 at 0x000000154000
[    5.525855] Bad eraseblock 86 at 0x000000158000
[    5.530600] Bad eraseblock 87 at 0x00000015c000
[    5.535317] Bad eraseblock 88 at 0x000000160000
[    5.540053] Bad eraseblock 89 at 0x000000164000
[    5.544760] Bad eraseblock 90 at 0x000000168000
[    5.549495] Bad eraseblock 91 at 0x00000016c000
[    5.554204] Bad eraseblock 92 at 0x000000170000
[    5.558939] Bad eraseblock 93 at 0x000000174000
[    5.563648] Bad eraseblock 94 at 0x000000178000
[    5.568391] Bad eraseblock 95 at 0x00000017c000
[    5.573101] Bad eraseblock 96 at 0x000000180000
[    5.577814] Bad eraseblock 97 at 0x000000184000
[    5.582550] Bad eraseblock 98 at 0x000000188000
[    5.587257] Bad eraseblock 99 at 0x00000018c000
[    5.591992] Bad eraseblock 100 at 0x000000190000
[    5.596790] Bad eraseblock 101 at 0x000000194000
[    5.601616] Bad eraseblock 102 at 0x000000198000
[    5.606414] Bad eraseblock 103 at 0x00000019c000
[    5.611247] Bad eraseblock 104 at 0x0000001a0000
[    5.616047] Bad eraseblock 105 at 0x0000001a4000
[    5.620872] Bad eraseblock 106 at 0x0000001a8000
[    5.625678] Bad eraseblock 107 at 0x0000001ac000
[    5.630503] Bad eraseblock 108 at 0x0000001b0000
[    5.635301] Bad eraseblock 109 at 0x0000001b4000
[    5.640138] Bad eraseblock 110 at 0x0000001b8000
[    5.644941] Bad eraseblock 111 at 0x0000001bc000
[    5.649769] Bad eraseblock 112 at 0x0000001c0000
[    5.654574] Bad eraseblock 113 at 0x0000001c4000
[    5.659400] Bad eraseblock 114 at 0x0000001c8000
[    5.664206] Bad eraseblock 115 at 0x0000001cc000
[    5.669032] Bad eraseblock 116 at 0x0000001d0000
[    5.673830] Bad eraseblock 117 at 0x0000001d4000
[    5.678663] Bad eraseblock 118 at 0x0000001d8000
[    5.683461] Bad eraseblock 119 at 0x0000001dc000
[    5.688263] Bad eraseblock 120 at 0x0000001e0000
[    5.693091] Bad eraseblock 121 at 0x0000001e4000
[    5.697896] Bad eraseblock 122 at 0x0000001e8000
[    5.702721] Bad eraseblock 123 at 0x0000001ec000
[    5.707528] Bad eraseblock 124 at 0x0000001f0000
[    5.712353] Bad eraseblock 125 at 0x0000001f4000
[    5.717160] Bad eraseblock 126 at 0x0000001f8000
[    5.721990] Bad eraseblock 127 at 0x0000001fc000
[    5.726792] Bad eraseblock 128 at 0x000000200000
[    5.731618] Bad eraseblock 129 at 0x000000204000
[    5.736424] Bad eraseblock 130 at 0x000000208000
[    5.741250] Bad eraseblock 131 at 0x00000020c000
[    5.746056] Bad eraseblock 132 at 0x000000210000
[    5.750890] Bad eraseblock 133 at 0x000000214000
[    5.755697] Bad eraseblock 134 at 0x000000218000
[    5.760523] Bad eraseblock 135 at 0x00000021c000
[    5.765329] Bad eraseblock 136 at 0x000000220000
[    5.770155] Bad eraseblock 137 at 0x000000224000
[    5.774960] Bad eraseblock 138 at 0x000000228000
[    5.779800] Bad eraseblock 139 at 0x00000022c000
[    5.784602] Bad eraseblock 140 at 0x000000230000
[    5.789429] Bad eraseblock 141 at 0x000000234000
[    5.794234] Bad eraseblock 142 at 0x000000238000
[    5.799059] Bad eraseblock 143 at 0x00000023c000
[    5.803857] Bad eraseblock 144 at 0x000000240000
[    5.808681] Bad eraseblock 145 at 0x000000244000
[    5.813480] Bad eraseblock 146 at 0x000000248000
[    5.818283] Bad eraseblock 147 at 0x00000024c000
[    5.823114] Bad eraseblock 148 at 0x000000250000
[    5.827915] Bad eraseblock 149 at 0x000000254000
[    5.832741] Bad eraseblock 150 at 0x000000258000
[    5.837547] Bad eraseblock 151 at 0x00000025c000
[    5.842373] Bad eraseblock 152 at 0x000000260000
[    5.847179] Bad eraseblock 153 at 0x000000264000
[    5.852004] Bad eraseblock 154 at 0x000000268000
[    5.856811] Bad eraseblock 155 at 0x00000026c000
[    5.861647] Bad eraseblock 156 at 0x000000270000
[    5.866452] Bad eraseblock 157 at 0x000000274000
[    5.871279] Bad eraseblock 158 at 0x000000278000
[    5.876084] Bad eraseblock 159 at 0x00000027c000
[    5.880909] Bad eraseblock 160 at 0x000000280000
[    5.885716] Bad eraseblock 161 at 0x000000284000
[    5.890541] Bad eraseblock 162 at 0x000000288000
[    5.895348] Bad eraseblock 163 at 0x00000028c000
[    5.900181] Bad eraseblock 164 at 0x000000290000
[    5.904980] Bad eraseblock 165 at 0x000000294000
[    5.909807] Bad eraseblock 166 at 0x000000298000
[    5.914611] Bad eraseblock 167 at 0x00000029c000
[    5.919437] Bad eraseblock 168 at 0x0000002a0000
[    5.924243] Bad eraseblock 169 at 0x0000002a4000
[    5.929070] Bad eraseblock 170 at 0x0000002a8000
[    5.933875] Bad eraseblock 171 at 0x0000002ac000
[    5.938709] Bad eraseblock 172 at 0x0000002b0000
[    5.943508] Bad eraseblock 173 at 0x0000002b4000
[    5.948310] Bad eraseblock 174 at 0x0000002b8000
[    5.953136] Bad eraseblock 175 at 0x0000002bc000
[    6.186768] 3 fixed-partitions partitions found on MTD device ar934x-nand
[    6.193820] Creating 3 MTD partitions on "ar934x-nand":
[    6.199260] 0x000000000000-0x000000040000 : "booter"
[    6.205483] 0x000000040000-0x000000400000 : "kernel"
[    6.213678] 0x000000400000-0x000004000000 : "ubi"
[    6.228992] spi-nor spi0.0: w25x10 (128 Kbytes)
[    6.233729] 1 fixed-partitions partitions found on MTD device spi0.0
[    6.240398] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    6.247259] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    6.255540] Creating 1 MTD partitions on "spi0.0":
[    6.260554] 0x000000000000-0x000000010000 : "RouterBoot"
[    6.268823] 4 routerbootpart partitions found on MTD device RouterBoot
[    6.275656] OF: Bad cell count for /ahb/spi@1f000000/flash@0/partitions
[    6.284140] Creating 4 MTD partitions on "RouterBoot":
[    6.289533] 0x000000000000-0x00000000b000 : "bootloader1"
[    6.298187] 0x00000000b000-0x00000000c000 : "hard_config"
[    6.304942] 0x00000000c000-0x00000000d000 : "bios"
[    6.312869] 0x00000000f000-0x000000010000 : "soft_config"
[    6.326407] ag71xx 19000000.eth: invalid MAC address, using random address
[    6.799338] ag71xx 19000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    6.809348] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii-rxid
[    6.819236] ag71xx 1a000000.eth: invalid MAC address, using random address
[    7.208374] random: crng init done
[    7.522651] ag71xx 1a000000.eth: connected to PHY at fixed-0:01 [uid=00000000, driver=Generic PHY]
[    7.532645] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    7.546614] MikroTik RouterBOARD hardware configuration sysfs driver v0.07
[    7.555839] MikroTik RouterBOARD software configuration sysfs driver v0.05
[    7.563865] NET: Registered protocol family 10
[    7.570300] Segment Routing with IPv6
[    7.574217] NET: Registered protocol family 17
[    7.579216] 8021q: 802.1Q VLAN Support v1.8
[    7.686841] qca8k mdio.0:10: configuring for fixed/rgmii link mode
[    7.696594] qca8k mdio.0:10: Link is Up - 1Gbps/Full - flow control off
[    7.769248] qca8k mdio.0:10 port1 (uninitialized): PHY [mdio.0:00] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.859229] qca8k mdio.0:10 port2 (uninitialized): PHY [mdio.0:01] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    7.949264] qca8k mdio.0:10 port3 (uninitialized): PHY [mdio.0:02] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    8.039231] qca8k mdio.0:10 port4 (uninitialized): PHY [mdio.0:03] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    8.129249] qca8k mdio.0:10 port5 (uninitialized): PHY [mdio.0:04] driver [Qualcomm Atheros 8327-A internal PHY] (irq=POLL)
[    8.146984] DSA: tree 0 setup
[    8.299363] ar9331_switch mdio.1:10: configuring for fixed/gmii link mode
[    8.308629] ar9331_switch mdio.1:10: Link is Up - 1Gbps/Full - flow control off
[    8.379720] 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.469741] 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.559776] 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.649741] 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.749705] 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.766731] DSA: tree 1 setup
[    8.772750] UBI: auto-attach mtd2
[    8.776220] ubi0: attaching mtd2
[    9.455444] ubi0: scanning is finished
[    9.479261] ubi0: attached mtd2 (name "ubi", size 60 MiB)
[    9.484859] ubi0: PEB size: 16384 bytes (16 KiB), LEB size: 15872 bytes
[    9.491754] ubi0: min./max. I/O unit sizes: 512/512, sub-page size 256
[    9.498526] ubi0: VID header offset: 256 (aligned 256), data offset: 512
[    9.505445] ubi0: good PEBs: 3840, bad PEBs: 0, corrupted PEBs: 0
[    9.511748] ubi0: user volume: 2, internal volumes: 1, max. volumes count: 92
[    9.519131] ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 1941041562
[    9.528572] ubi0: available PEBs: 0, total reserved PEBs: 3840, PEBs reserved for bad PEB handling: 80
[    9.538274] ubi0: background thread "ubi_bgt0d" started, PID 397
[    9.546464] block ubiblock0_0: created from ubi0:0(rootfs)
[    9.552207] ubiblock: device ubiblock0_0 (rootfs) set to be root filesystem
[    9.584927] Freeing unused kernel memory: 4124K
[    9.589666] This architecture does not have kernel memory protection.
[    9.596329] Run /init as init process
[    9.600121]   with arguments:
[    9.600128]     /init
[    9.600132]   with environment:
[    9.600138]     HOME=/
[    9.600143]     TERM=linux
[   10.222174] init: Console is alive
[   10.226218] init: - watchdog -
[   10.250125] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[   10.263694] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[   10.281747] init: - preinit -
[   11.268153] eth0: link up (1000Mbps/Full duplex)
[   11.273252] qca8k mdio.0:10 port2: configuring for phy/ link mode
[   11.358464] 8021q: adding VLAN 0 to HW filter on device port2
[   11.365316] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   15.574569] procd: - early -
[   15.577957] procd: - watchdog -
[   16.204431] procd: - watchdog -
[   16.208149] procd: - ubus -
[   16.266173] procd: - init -
[   17.027413] kmodloader: loading kernel modules from /etc/modules.d/*
[   17.260415] PPP generic driver version 2.4.2
[   17.269323] NET: Registered protocol family 24
[   17.303189] kmodloader: done loading kernel modules from /etc/modules.d/*
[   17.414036] urngd: v1.0.2 started.
[   61.115994] eth0: link down

1 Like

ooh rb2011 support!

I have nearly all models available and can test this on them if anyone has need for that.

Let me know :slight_smile:

1 Like

Yes, this is Ok.

Try clearing the flash drive from bad blocks again. if it does not help, then the flash memory is really damaged and nothing can be done about it.

will try tomorrow. but i cant beleave in a broken nand...this unit has less then 100 hours of uptime in its lifetime. is was for 8 years on the shelf before i decided to install/upgrade directly to openwrt.

also i remember so discussion about a problem with bad blocks on nand some years ago....related to rb2011, afaik. will see if i can find it again.....

maybe i should try this hint 1st....

i would be nice if you could test the image with a 64mb nand unit with serial access and post the bootlog here.

1 Like

Are there any issues? If not, maybe you should make pull request on github?

I'll prep some hardware tomorrow so I can test it early next week or so

today i had some time to look into this again. i flashed the unit back to ROS 6.48 and 6.49 and the bad blocks are gone .....this is ROS telling me when i do the check:

and

so i guess some software is lying on us here......the OpenWRT or the RouterOS code.

1 Like

@g6094199 @adron I had the same issue with my RB2011 when I was porting it to ath79. No idea why it happens, it's OK for a few boots, then it throws bad block errors for a few boots. There's no difference between reboots and power cycles. I never figured out why it happens.

i remind me on Mtik bad blocks issue in ...hmm....lede or OpenWRT 18 or so....but cant find the issue topic anymore....even if there was i fix....maybe its related to that problem again....

hi

today i had some sparetime i tried to install this build on a 128MB machine...it also wont flash!

bootet initramfs, erases root and ubi

[  650.163934] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[  912.458452] test_m_module_init: mtd->name: kernel, mtd->parent: 0x8141f880
[  912.465636] chip = 0xca98c1b5
[  912.468705] Go to sleep...grace time for protect old bbt
[  917.541382] Sleep done. Freeing old bbt
[  917.545365] reset chip->bbt done. Now you can do: mtd erase kernel
[  953.988728] test_m_module_init: mtd->name: kernel, mtd->parent: 0x8141f880
[  953.995938] chip = 0xca98c1b5
[  953.999011] Go to sleep...grace time for protect old bbt
[  959.060961] Sleep done. Freeing old bbt
[  959.064945] reset chip->bbt done. Now you can do: mtd erase kernel
[  984.181499] test_m_module_init: mtd->name: ubi, mtd->parent: 0x8141f880
[  984.188347] chip = 0xca98c1b5
[  984.191465] Go to sleep...grace time for protect old bbt
[  989.220601] Sleep done. Freeing old bbt
[  989.224583] reset chip->bbt done. Now you can do: mtd erase ubi

rebootet iniramfs and tried to sysupgrade...after 12 sec it rebooted not successfully .

has someone successfully installed this build?!?

1 Like

I tried it on RB2011UAS-2HnD-IN 128Mb with last routerboot version, flash and boot work.
Wireless is not working

1 Like

maybe just the drivers are missing.

install the ath9k and a prefered ap and station software

1 Like

My RB2011 does not have WiFi. So I did not support it. You need to take the source code and add support for the WiFi model. It's not difficult at all.

Thanks to all for the hard work. Thanks to a combination of the work by @danijeltudek and @adron I was able to build 22.03.3 with support for wireless. You can download it here: https://github.com/agreenbhm/openwrt-rb2011/releases

3 Likes

@adron

so that the build is verified to work you should start a pr to get this going!

the 64mb stuff can be fixed later, since there are just a few devices out there (including one of mine).

1 Like

The PR is great, but in this case it's just not realistic. For rb2011, I transferred ath79 to DSA (100 megabit and 1gigabit switches). In order for such a PR to be accepted, we will have to transfer the entire target ath79 to DSA. This is a huge job and I'm not ready to do it. I posted my research for RB2011 to show how ath79 works with DSA and nothing more.

Perhaps someone from the OpenWrt team will pick up my work and continue. I successfully use DSA for RB960/962, and even for RB750-r2/mAP/mAPL, GL-AR300M, etc...

Yesterday I found another bug in the rb2011 gigabit switch phy driver. Here is the fix.

2 Likes