I decided to try to port RB2011 to ath79. Getting it to boot was actually surprisingly easy, especially since another Mikrotik NAND device is already present in master (SXT). NAND, sysupgrade, wireless and USB works, but I'm struggling with getting switch(es) to work.
The current result is in my GitHub repo: https://github.com/danijelt/openwrt
After deciphering old mach-rb2011 file and some trial and error, both internal switch and AR8237 are initialized, they detect link status, swconfig also correctly shows when something is plugged in, but the packets don't go in or out - I can't even ping my PC.
If I configure wireless, I can connect to the network and it works just fine - that's how I tested sysupgrade.
Here's the full bootlog (NAND boot):
RouterBOOT booter 3.19
RouterBoard 2011UiAS-2HnD
CPU frequency: 600 MHz
Memory speed: 200 MHz
Memory size: 128 MiB
NAND size: 128 MiB
Press any key within 1 seconds to enter setup.
loading kernel from nand... OK
setting up elf image... OK
jumping to kernel code
[ 0.000000] Linux version 5.4.85 (danijel@danijel-pc) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r15350-b9389186b0)) #0 Fri Dec 25 09:38:13 2020
[ 0.000000] printk: bootconsole [early0] enabled
[ 0.000000] CPU0 revision is: 0001974c (MIPS 74Kc)
[ 0.000000] MIPS: machine is MikroTik RouterBOARD 2011
[ 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-0x0000000007ffffff]
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff]
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 32480
[ 0.000000] Kernel command line: console=ttyS0,115200 rootfstype=squashfs,jffs2
[ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 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: 121740K/131072K available (5259K kernel code, 177K rwdata, 1180K rodata, 1184K init, 201K bss, 9332K 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] random: get_random_bytes called from start_kernel+0x32c/0x520 with crng_init=0
[ 0.000000] CPU clock: 600.000 MHz
[ 0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
[ 0.000009] sched_clock: 32 bits at 300MHz, resolution 3ns, wraps every 7158278654ns
[ 0.008861] Calibrating delay loop... 299.26 BogoMIPS (lpj=598528)
[ 0.051856] pid_max: default: 32768 minimum: 301
[ 0.057263] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.065574] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.079269] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 0.090381] futex hash table entries: 256 (order: -1, 3072 bytes, linear)
[ 0.098233] pinctrl core: initialized pinctrl subsystem
[ 0.105231] NET: Registered protocol family 16
[ 0.144085] workqueue: max_active 576 requested for napi_workq is out of range, clamping between 1 and 512
[ 0.158268] clocksource: Switched to clocksource MIPS
[ 0.165279] NET: Registered protocol family 2
[ 0.171062] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.180631] TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.189361] TCP bind hash table entries: 1024 (order: 0, 4096 bytes, linear)
[ 0.197382] TCP: Hash tables configured (established 1024 bind 1024)
[ 0.204736] UDP hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.212209] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 0.220454] NET: Registered protocol family 1
[ 0.225474] PCI: CLS 0 bytes, default 32
[ 0.234010] workingset: timestamp_bits=14 max_order=15 bucket_order=1
[ 0.248504] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.255173] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[ 0.284565] pinctrl-single 1804002c.pinmux: 544 pins, size 68
[ 0.291715] gpio-export gpio-export: 1 gpio(s) exported
[ 0.298611] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
[ 0.306683] printk: console [ttyS0] disabled
[ 0.311630] 18020000.uart: ttyS0 at MMIO 0x18020000 (irq = 9, base_baud = 1562500) is a 16550A
[ 0.321440] printk: console [ttyS0] enabled
[ 0.321440] printk: console [ttyS0] enabled
[ 0.330503] printk: bootconsole [early0] disabled
[ 0.330503] printk: bootconsole [early0] disabled
[ 0.350431] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[ 0.357019] nand: Samsung NAND 128MiB 3,3V 8-bit
[ 0.361805] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 0.369674] Scanning device for bad blocks
[ 0.380173] random: fast init done
[ 0.475392] Bad eraseblock 821 at 0x0000066a0000
[ 0.504048] 3 fixed-partitions partitions found on MTD device ar934x-nand
[ 0.511084] Creating 3 MTD partitions on "ar934x-nand":
[ 0.516495] 0x000000000000-0x000000040000 : "booter"
[ 0.522722] 0x000000040000-0x000000400000 : "kernel"
[ 0.528868] 0x000000400000-0x000008000000 : "ubi"
[ 0.538983] spi-nor spi0.0: mx25l512e (64 Kbytes)
[ 0.543936] 1 fixed-partitions partitions found on MTD device spi0.0
[ 0.550514] Creating 1 MTD partitions on "spi0.0":
[ 0.555492] 0x000000000000-0x000000010000 : "RouterBoot"
[ 0.563353] 4 routerbootpart partitions found on MTD device RouterBoot
[ 0.570148] Creating 4 MTD partitions on "RouterBoot":
[ 0.575484] 0x000000000000-0x00000000c000 : "bootloader1"
[ 0.582081] 0x00000000c000-0x00000000d000 : "hard_config"
[ 0.588714] 0x00000000d000-0x00000000e000 : "bios"
[ 0.594757] 0x00000000e000-0x00000000f000 : "soft_config"
[ 0.602318] libphy: Fixed MDIO Bus: probed
[ 0.612720] ag71xx 19000000.eth: invalid MAC address, using random address
[ 0.936181] libphy: ag71xx_mdio: probed
[ 0.943889] switch0: Atheros AR8327 rev. 4 switch registered on mdio.0
[ 1.534750] ag71xx 19000000.eth: connected to PHY at mdio.0:00 [uid=004dd034, driver=Atheros AR8216/AR8236/AR8316]
[ 1.546113] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode: rgmii
[ 1.552880] ag71xx 1a000000.eth: invalid MAC address, using random address
[ 2.190657] libphy: ag71xx_mdio: probed
[ 2.196236] libphy: ar8xxx-mdio: probed
[ 2.209836] switch1: Atheros AR8229 rev. 1 switch registered on mdio.1
[ 2.258332] ag71xx 1a000000.eth: connected to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[ 2.268268] eth1: Atheros AG71xx at 0xba000000, irq 5, mode: gmii
[ 2.275018] ath79-wdt 18060008.wdt: timeout value must be 0 < timeout < 10, using 10
[ 2.289585] MikroTik RouterBOARD hardware configuration sysfs driver v0.06
[ 2.297980] MikroTik RouterBOARD software configuration sysfs driver v0.03
[ 2.306315] NET: Registered protocol family 10
[ 2.313507] Segment Routing with IPv6
[ 2.317485] NET: Registered protocol family 17
[ 2.322183] 8021q: 802.1Q VLAN Support v1.8
[ 2.330410] UBI: auto-attach mtd2
[ 2.333864] ubi0: attaching mtd2
[ 3.594288] ubi0: scanning is finished
[ 3.615865] ubi0: attached mtd2 (name "ubi", size 124 MiB)
[ 3.621590] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 129024 bytes
[ 3.628711] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 512
[ 3.635643] ubi0: VID header offset: 512 (aligned 512), data offset: 2048
[ 3.642666] ubi0: good PEBs: 991, bad PEBs: 1, corrupted PEBs: 0
[ 3.648876] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
[ 3.656342] ubi0: max/mean erase counter: 5/2, WL threshold: 4096, image sequence number: 2052226221
[ 3.665784] ubi0: available PEBs: 0, total reserved PEBs: 991, PEBs reserved for bad PEB handling: 19
[ 3.675400] ubi0: background thread "ubi_bgt0d" started, PID 385
[ 3.683404] block ubiblock0_1: created from ubi0:1(rootfs)
[ 3.689138] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
[ 3.705124] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[ 3.718106] Freeing unused kernel memory: 1184K
[ 3.722812] This architecture does not have kernel memory protection.
[ 3.729467] Run /sbin/init as init process
[ 4.038340] random: crng init done
[ 4.363938] init: Console is alive
[ 4.367811] init: - watchdog -
[ 5.442519] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[ 5.564910] usbcore: registered new interface driver usbfs
[ 5.570738] usbcore: registered new interface driver hub
[ 5.576350] usbcore: registered new device driver usb
[ 5.588991] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[ 5.604848] SCSI subsystem initialized
[ 5.614788] ehci-fsl: Freescale EHCI Host controller driver
[ 5.622739] ehci-platform: EHCI generic platform driver
[ 5.628456] ehci-platform 1b000000.usb: EHCI Host Controller
[ 5.634377] ehci-platform 1b000000.usb: new USB bus registered, assigned bus number 1
[ 5.642601] ehci-platform 1b000000.usb: irq 3, io mem 0x1b000000
[ 5.662282] ehci-platform 1b000000.usb: USB 2.0 started, EHCI 1.00
[ 5.669621] hub 1-0:1.0: USB hub found
[ 5.673965] hub 1-0:1.0: 1 port detected
[ 5.685837] usbcore: registered new interface driver usb-storage
[ 5.692753] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[ 5.702675] init: - preinit -
[ 8.775529] eth0: link up (1000Mbps/Full duplex)
[ 8.786410] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 8.798417] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
Press the [f] key and hit [enter] to enter failsafe mode
Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level
[ 13.036929] UBIFS (ubi0:2): Mounting in unauthenticated mode
[ 13.043061] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 516
[ 13.128547] UBIFS (ubi0:2): recovery needed
[ 13.307531] UBIFS (ubi0:2): recovery completed
[ 13.312256] UBIFS (ubi0:2): UBIFS: mounted UBI device 0, volume 2, name "rootfs_data"
[ 13.320370] UBIFS (ubi0:2): LEB size: 129024 bytes (126 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[ 13.330620] UBIFS (ubi0:2): FS size: 117669888 bytes (112 MiB, 912 LEBs), journal size 5935104 bytes (5 MiB, 46 LEBs)
[ 13.341580] UBIFS (ubi0:2): reserved for root: 4952683 bytes (4836 KiB)
[ 13.348422] UBIFS (ubi0:2): media format: w5/r0 (latest is w5/r0), UUID E2901872-5BE8-47EA-ADF0-9A0C1826C58B, small LPT model
[ 13.366680] mount_root: switching to ubifs overlay
[ 13.388253] urandom-seed: Seeding with /etc/urandom.seed
[ 13.509478] eth0: link down
[ 13.534310] procd: - early -
[ 13.537415] procd: - watchdog -
[ 14.178388] procd: - watchdog -
[ 14.182239] procd: - ubus -
[ 14.261467] procd: - init -
Please press Enter to activate this console.
[ 15.334826] kmodloader: loading kernel modules from /etc/modules.d/*
[ 15.390311] Loading modules backported from Linux version v5.8.18-0-gab435ce49bd1
[ 15.398066] Backport generated by backports.git v5.8.18-1-0-ga630fd46
[ 15.464052] xt_time: kernel timezone is -0000
[ 15.638425] PPP generic driver version 2.4.2
[ 15.651902] NET: Registered protocol family 24
[ 15.729486] urngd: v1.0.2 started.
[ 15.759763] ath9k 18100000.wmac: Direct firmware load for ath9k-eeprom-ahb-18100000.wmac.bin failed with error -2
[ 15.770431] ath9k 18100000.wmac: Falling back to sysfs fallback for: ath9k-eeprom-ahb-18100000.wmac.bin
[ 16.375493] ieee80211 phy0: Atheros AR9340 Rev:2 mem=0xb8100000, irq=12
[ 16.490720] kmodloader: done loading kernel modules from /etc/modules.d/*
[ 33.194735] eth0: link up (1000Mbps/Full duplex)
[ 33.206574] device eth0 entered promiscuous mode
[ 33.211805] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 33.226641] br-lan: port 1(eth0.1) entered blocking state
[ 33.232399] br-lan: port 1(eth0.1) entered disabled state
[ 33.238382] device eth0.1 entered promiscuous mode
[ 33.262405] br-lan: port 1(eth0.1) entered blocking state
[ 33.268024] br-lan: port 1(eth0.1) entered forwarding state
[ 33.319273] eth1: link up (1000Mbps/Full duplex)
[ 33.344602] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[ 33.356587] device eth1 entered promiscuous mode
[ 33.378866] br-lan: port 2(eth1.1) entered blocking state
[ 33.384518] br-lan: port 2(eth1.1) entered disabled state
[ 33.390598] device eth1.1 entered promiscuous mode
[ 33.395750] br-lan: port 2(eth1.1) entered blocking state
[ 33.401374] br-lan: port 2(eth1.1) entered forwarding state
[ 34.194345] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[ 44.466623] Atheros AR8216/AR8236/AR8316 mdio.0:00: Port 1 is up
[ 48.014276] usb 1-1: new high-speed USB device number 2 using ehci-platform
[ 48.178148] usb-storage 1-1:1.0: USB Mass Storage device detected
[ 48.185940] scsi host0: usb-storage 1-1:1.0
[ 49.203488] scsi 0:0:0:0: Direct-Access USB Flash Memory PMAP PQ: 0 ANSI: 6
[ 49.216428] sd 0:0:0:0: [sda] 60506112 512-byte logical blocks: (31.0 GB/28.9 GiB)
[ 49.224761] sd 0:0:0:0: [sda] Write Protect is off
[ 49.230526] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 49.313379] sda: sda1
[ 49.320270] sd 0:0:0:0: [sda] Attached SCSI removable disk
Interestingly, over time the device builds the ARP database with all devices in my LAN (if I plug it into main router, I just can't ping anything from/to device.
Port 6 (SFP) is always in up state, but nothing is plugged in.
Another problem I have is that during netboot, NAND probe fails occasionally:
[ 5.850307] ar934x-nand 1b000200.nand: read operation failed on page -1
[ 6.442295] ar934x-nand 1b000200.nand: read operation failed on page -1
[ 7.034294] ar934x-nand 1b000200.nand: read operation failed on page -1
[ 7.041148] nand: device found, Manufacturer ID: 0xec, Chip ID: 0xf1
[ 7.047714] nand: Samsung NAND 128MiB 3,3V 8-bit
[ 7.052493] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[ 7.060359] Scanning device for bad blocks
[ 7.650297] ar934x-nand 1b000200.nand: read operation failed on page 0
[ 8.242296] ar934x-nand 1b000200.nand: read operation failed on page 1
[ 8.834296] ar934x-nand 1b000200.nand: read operation failed on page 64
[ 9.426297] ar934x-nand 1b000200.nand: read operation failed on page 65
[ 10.018296] ar934x-nand 1b000200.nand: read operation failed on page 128
[ 10.610296] ar934x-nand 1b000200.nand: read operation failed on page 129
[ 11.202296] ar934x-nand 1b000200.nand: read operation failed on page 192
[ 11.794296] ar934x-nand 1b000200.nand: read operation failed on page 193
[ 12.862296] ar934x-nand 1b000200.nand: read operation failed on page 257
[ 13.454296] ar934x-nand 1b000200.nand: read operation failed on page 320
[ 14.046296] ar934x-nand 1b000200.nand: read operation failed on page 321
...
A few hard reboots fix it. It doesn't happen on NAND boot so I'll dismiss it for now.
Pinging @robimarko hoping that you might know what's going on with the network, but others are welcome too.