Support for Mikrotik RBwAP2nDr3

Dear all,

I have a problem running OpenWrt (19.07.7) on RBwAP2nDr3. Image https://downloads.openwrt.org/releases/19.07.7/targets/ar71xx/mikrotik/openwrt-19.07.7-ar71xx-mikrotik-rb-nor-flash-16M-initramfs-kernel.bin starts correctly from bootp. But sysupgrade -v -n with https://downloads.openwrt.org/releases/19.07.7/targets/ar71xx/mikrotik/openwrt-19.07.7-ar71xx-mikrotik-rb-nor-flash-16M-squashfs-sysupgrade.bin causes the router to not wake up.

Two devices have gone through the sysupgrade procedure and are now not starts.

Partition dumps for three devices: http://sli.pl/RBwAP2nDr3/

dmesg:

[    0.000000] Linux version 4.14.221 (builder@buildhost) (gcc version 7.5.0 (OpenWrt GCC 7.5.0 r11306-c4a6851c72)) #0 Mon Feb 15 15:22:37 2021
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Qualcomm Atheros QCA9533 ver 2 rev 0
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 04000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000003ffffff]
[    0.000000] On node 0 totalpages: 16384
[    0.000000] free_area_init_node: node 0, pgdat 80525ee0, node_mem_map 81000020
[    0.000000]   Normal zone: 128 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 16384 pages, LIFO batch:3
[    0.000000] random: get_random_bytes called from 0x80529740 with crng_init=0
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: no-uart no-buzzer no-nand parts=1 boot_part_size=16777216 gpio=0 HZ=325000000 mem=64M kmac=08:55:31:E0:F2:75 board=wap-hb board=wap-hb board_rev=r3 bver=6.45.9 hw_opt=00284001 boot=0 mlc=11 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 256 (order: -2, 1024 bytes)
[    0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 56888K/65536K available (4195K kernel code, 173K rwdata, 524K rodata, 2524K init, 213K bss, 8648K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] NR_IRQS: 51
[    0.000000] Clocks: CPU:650.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5880801374 ns
[    0.000009] sched_clock: 32 bits at 325MHz, resolution 3ns, wraps every 6607641598ns
[    0.008892] Calibrating delay loop... 432.53 BogoMIPS (lpj=2162688)
[    0.075994] pid_max: default: 32768 minimum: 301
[    0.081461] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.088971] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.099642] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.110877] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.119312] NET: Registered protocol family 16
[    0.129136] MIPS: machine is MikroTik RouterBOARD wAP 2nD r3
[    0.393671] clocksource: Switched to clocksource MIPS
[    0.400588] NET: Registered protocol family 2
[    0.406517] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.414508] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.421731] TCP: Hash tables configured (established 1024 bind 1024)
[    0.429121] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.435825] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.443225] NET: Registered protocol family 1
[    0.448249] PCI: CLS 0 bytes, default 32
[    2.573683] random: fast init done
[    4.112058] Crashlog allocated RAM at address 0x3f00000
[    4.119641] workingset: timestamp_bits=30 max_order=14 bucket_order=0
[    4.132338] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    4.139021] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    4.302162] io scheduler noop registered
[    4.306689] io scheduler deadline registered (default)
[    4.312986] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    4.322496] console [ttyS0] disabled
[    4.346741] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 1562500) is a 16550A
[    4.356547] console [ttyS0] enabled
[    4.364109] bootconsole [early0] disabled
[    4.380411] m25p80 spi0.0: found w25q128jv, expected m25p80
[    4.395732] m25p80 spi0.0: w25q128jv (16384 Kbytes)
[    4.447839] Creating 6 MTD partitions on "spi0.0":
[    4.452817] 0x000000000000-0x00000000e000 : "routerboot"
[    4.483601] 0x00000000e000-0x00000000f000 : "hard_config"
[    4.514592] 0x00000000f000-0x000000010000 : "bios"
[    4.544809] 0x000000010000-0x00000001f000 : "routerboot2"
[    4.575753] 0x00000001f000-0x000000020000 : "soft_config"
[    4.606524] 0x000000020000-0x000001000000 : "firmware"
[    4.638184] libphy: Fixed MDIO Bus: probed
[    4.783439] libphy: ag71xx_mdio: probed
[    5.416027] ag71xx-mdio.1: Found an AR934X built-in switch
[    5.469475] eth0: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[    5.478991] MikroTik RouterBOARD hardware configuration sysfs driver v0.03
[    5.487242] NET: Registered protocol family 10
[    5.496753] Segment Routing with IPv6
[    5.500635] NET: Registered protocol family 17
[    5.505377] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    5.518783] 8021q: 802.1Q VLAN Support v1.8
[    5.544576] Freeing unused kernel memory: 2524K
[    5.549272] This architecture does not have kernel memory protection.
[    5.572812] init: Console is alive
[    5.576834] init: - watchdog -
[    5.604305] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    5.613861] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    5.632031] init: - preinit -
[    5.863187] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    7.495124] eth0: link up (1000Mbps/Full duplex)
[    7.499938] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    9.043952] eth0: link down
[    9.060087] procd: - early -
[    9.063190] procd: - watchdog -
[    9.647856] procd: - watchdog -
[    9.651479] procd: - ubus -
[    9.662100] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.705206] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.712286] random: ubusd: uninitialized urandom read (4 bytes read)
[    9.720073] procd: - init -
[   10.197105] kmodloader: loading kernel modules from /etc/modules.d/*
[   10.228756] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   10.251838] Loading modules backported from Linux version v4.19.161-0-gdaefdc9eb24b
[   10.259834] Backport generated by backports.git v4.19.161-1-0-g4bb568fe
[   10.286290] ip_tables: (C) 2000-2006 Netfilter Core Team
[   10.312401] nf_conntrack version 0.5.0 (1024 buckets, 4096 max)
[   10.441703] xt_time: kernel timezone is -0000
[   10.569411] PPP generic driver version 2.4.2
[   10.584910] NET: Registered protocol family 24
[   10.675121] ath: EEPROM regdomain: 0x0
[   10.675133] ath: EEPROM indicates default country code should be used
[   10.675136] ath: doing EEPROM country->regdmn map search
[   10.675154] ath: country maps to regdmn code: 0x3a
[   10.675160] ath: Country alpha2 being used: US
[   10.675163] ath: Regpair used: 0x3a
[   10.689177] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
[   10.691358] ieee80211 phy0: Atheros AR9531 Rev:2 mem=0xb8100000, irq=47
[   10.736521] urngd: v1.0.2 started.
[   10.764194] kmodloader: done loading kernel modules from /etc/modules.d/*
[   11.162952] random: crng init done
[   11.166570] random: 7 urandom warning(s) missed due to ratelimiting
[   40.211938] br-lan: port 1(eth0) entered blocking state
[   40.217424] br-lan: port 1(eth0) entered disabled state
[   40.223173] device eth0 entered promiscuous mode
[   40.310994] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   41.835258] eth0: link up (1000Mbps/Full duplex)
[   41.840093] br-lan: port 1(eth0) entered blocking state
[   41.845535] br-lan: port 1(eth0) entered forwarding state
[   41.873743] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready

I am asking for help in running OpenWrt on these devices.

Anyone have partition dumps for older revisions? Maybe the bootloader has been changed?

Hi @karoiz

I haven't use OpenWrt 19.07 with any of my Mikrotik devices.

It should not be too much work to get OpenWrt master (ath79) running on this device, starting from the very similar devices:

The first device I checked from your dumps has RouterBoot 6.45.9 for backup & primary, so this should be fine. There are currently problems with RouterBoot v7 (beta) loading kernel from flash. If you do have RouterBoot v7, you can netinstall a v6 RouterOS, then upgrade (downgrade) RouterBoot from within RouterOS.

sysupgrade on my mipsbe Mikrotik devices does takes a long time (5+ minutes, leave it alone for 10 minutes to make sure). Something you can to do check if this is working: sysupgrade, then if the device does not boot successfully, netboot again and have a look at the firmware (and kernel) partitions. It is also good to note what the LEDs and network (tcpdump or wireshark) are doing during the sysupgrade.

If you can connect to the board console, there is a tag in the hard_config that usually can be changed to have RouterBoot output to console, but this does not provide much information. You should be able to tell if RouterBoot is successfully loading the kernel or not:

Example successful 760igs kernel load:

RouterBOOT booter 6.46.5

RB760iGS

CPU frequency: 880 MHz
  Memory size: 256 MiB
 Storage size:  16 MiB

Press any key within 2 seconds to enter setup..

loading kernel... OK
setting up elf image... OK
jumping to kernel code
[    0.000000] Linux version 5.10.33 (john@media01) (mipsel-openwrt-linux-musl-gcc (OpenWrt GCC 8.4.0 r0+13048-e8ead3f888) 8.4.0, GNU ld (GNU Binutils) 2.34) #0 SMP Mon May 3 06:17:47 2021