Ath79 and Mikrotik

Hi,

Currently in 18.06.4 I'm flashing a Mikrotik RB493G with the nand-large image from ar71xx/mikrotik. Everything works great.

My question is what happens for 19.07?

Will something similar appear under ath79?

Am I out of luck?

Thanks!

I believe that there are some Mikrotik-specific features that still need to be supported under ath79 for the boards to be ported. As I understand it, the ar71xx code base will still be present on 19.07, though will be removed from master at some time in the near future.

It is my belief that the Mikrotik boards should be supportable under ath79. Someone with the boards in hand and the skills and desire to port/backport the necessary features will be required.

I have an example of each type of Mikrotik router, nand large, nand 64, and nor. I sent them to a person who was going to do the conversion but he didn't have the time to start at the project. I am willing to send them to someone who can do the conversion once I get them back.

1 Like

Has there been any progress on porting the Mikrotik devices to the ath79 branch?

The big problem for the mikrotik devices is the lack of a nand driver. That might be addressed by https://lists.openwrt.org/pipermail/openwrt-devel/2019-October/019631.html but I don't know for certain.

Current PR is https://github.com/openwrt/openwrt/pull/2184 which I hope to have merged in a couple days.

I don't know enough about the Mikrotik devices to know if their NAND is SPI-attached, would use

commit 758a4d1766
Author: Michal Cieslakiewicz <redacted>
Date:   Fri Oct 11 10:50:11 2019 +0200

    ath79: add AR934x NAND Flash Controller driver

or something else.

Here is my last bootlog. As you can see the SoC is a AR7161 rev 2.

I think the important lines are:

[    3.009597] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[    3.018662] Creating 4 MTD partitions on "spi0.0":
[    3.023508] 0x000000000000-0x00000000b000 : "routerboot"
[    3.030616] 0x00000000b000-0x00000000c000 : "hard_config"
[    3.037844] 0x00000000d000-0x00000000f000 : "bios"
[    3.044555] 0x00000000f000-0x000000010000 : "soft_config"
[    3.052033] NAND flash driver for RouterBoard 4xx series version 0.2.0
[    3.060466] nand: device found, Manufacturer ID: 0x20, Chip ID: 0xf1
[    3.066807] nand: ST Micro NAND01GW3B2CN6
[    3.070825] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    3.078410] Scanning device for bad blocks
[    3.098078] Bad eraseblock 99 at 0x000000c60000
[    3.145806] Bad eraseblock 383 at 0x000002fe0000
[    3.248187] Creating 3 MTD partitions on "NAND01GW3B2CN6":
[    3.253716] 0x000000000000-0x000000040000 : "booter"
[    3.260483] 0x000000040000-0x000000400000 : "kernel"
[    3.267340] 0x000000400000-0x000008000000 : "ubi"

Here is the full log

[    0.000000] Linux version 4.9.184 (buildbot@c2c312384f99) (gcc version 7.3.0 (OpenWrt GCC 7.3.0 r7808-ef686b7292) ) #0 Thu Jun 27 12:18:52 2019
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 revision is: 00019374 (MIPS 24Kc)
[    0.000000] SoC: Atheros AR7161 rev 2
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 10000000 @ 00000000 (usable)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 10000000 @ 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-0x000000000fffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x000000000fffffff]
[    0.000000] On node 0 totalpages: 65536
[    0.000000] free_area_init_node: node 0, pgdat 8047fbb4, node_mem_map 81000020
[    0.000000]   Normal zone: 512 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 65536 pages, LIFO batch:15
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: boot_part_size=4194304 gpio=4031 HZ=340000000 mem=256M kmac=D4:CA:6D:xx:yy:zz board=493G boot=1 mlc=3 console=ttyS0,115200 rootfstype=squashfs noinitrd
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Writing ErrCtl register=00000000
[    0.000000] Readback ErrCtl register=00000000
[    0.000000] Memory: 254760K/262144K available (3608K kernel code, 163K rwdata, 456K rodata, 244K init, 209K bss, 7384K 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:680.000MHz, DDR:340.000MHz, AHB:170.000MHz, Ref:40.000MHz
[    0.000000] clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 5621354254 ns
[    0.000008] sched_clock: 32 bits at 340MHz, resolution 2ns, wraps every 6316128254ns
[    0.007815] Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)
[    0.070524] pid_max: default: 32768 minimum: 301
[    0.075239] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.081847] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.091414] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.101279] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.108495] NET: Registered protocol family 16
[    0.114379] MIPS: machine is MikroTik RouterBOARD 493G
[    2.574133] random: fast init done
[    2.792824] registering PCI controller with io_map_base unset
[    2.807800] rb4xx-spi rb4xx-spi: master is unqueued, this is deprecated
[    2.815394] PCI host bridge to bus 0000:00
[    2.819496] pci_bus 0000:00: root bus resource [mem 0x10000000-0x16ffffff]
[    2.826390] pci_bus 0000:00: root bus resource [io  0x0000]
[    2.831949] pci_bus 0000:00: root bus resource [??? 0x00000000 flags 0x0]
[    2.838728] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff]
[    2.846679] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00
[    2.849956] clocksource: Switched to clocksource MIPS
[    2.855925] NET: Registered protocol family 2
[    2.861179] TCP established hash table entries: 2048 (order: 1, 8192 bytes)
[    2.868169] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    2.874587] TCP: Hash tables configured (established 2048 bind 2048)
[    2.881047] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    2.886886] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    2.893405] NET: Registered protocol family 1
[    2.897777] PCI: CLS 0 bytes, default 32
[    2.900381] Crashlog allocated RAM at address 0x3f00000
[    2.906606] workingset: timestamp_bits=30 max_order=16 bucket_order=0
[    2.919205] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    2.925069] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
[    2.943180] io scheduler noop registered
[    2.947098] io scheduler deadline registered (default)
[    2.952639] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled
[    2.961322] console [ttyS0] disabled
[    2.984952] serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11, base_baud = 10625000) is a 16550A
[    2.993667] console [ttyS0] enabled
[    3.000631] bootconsole [early0] disabled
[    3.009597] m25p80 spi0.0: pm25lv512 (64 Kbytes)
[    3.018662] Creating 4 MTD partitions on "spi0.0":
[    3.023508] 0x000000000000-0x00000000b000 : "routerboot"
[    3.030616] 0x00000000b000-0x00000000c000 : "hard_config"
[    3.037844] 0x00000000d000-0x00000000f000 : "bios"
[    3.044555] 0x00000000f000-0x000000010000 : "soft_config"
[    3.052033] NAND flash driver for RouterBoard 4xx series version 0.2.0
[    3.060466] nand: device found, Manufacturer ID: 0x20, Chip ID: 0xf1
[    3.066807] nand: ST Micro NAND01GW3B2CN6
[    3.070825] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    3.078410] Scanning device for bad blocks
[    3.098078] Bad eraseblock 99 at 0x000000c60000
[    3.145806] Bad eraseblock 383 at 0x000002fe0000
[    3.248187] Creating 3 MTD partitions on "NAND01GW3B2CN6":
[    3.253716] 0x000000000000-0x000000040000 : "booter"
[    3.260483] 0x000000040000-0x000000400000 : "kernel"
[    3.267340] 0x000000400000-0x000008000000 : "ubi"
[    3.281297] switch0: Atheros AR8316 rev. 1 switch registered on gpio
[    3.287659] libphy: GPIO Bitbanged MDIO: probed
[    3.292617] libphy: Fixed MDIO Bus: probed
[    3.302032] switch1: Atheros AR8316 rev. 1 switch registered on ag71xx-mdio.0
[    3.309167] libphy: ag71xx_mdio: probed
[    3.651334] ar8316: Using port 4 as switch port
[    3.711867] ag71xx ag71xx.1: connected to PHY at gpio:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]
[    3.722322] eth0: Atheros AG71xx at 0xba000000, irq 5, mode:RGMII
[    4.061307] ar8316: Using port 4 as switch port
[    4.105977] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.0:00 [uid=004dd041, driver=Atheros AR8216/AR8236/AR8316]
[    4.117234] eth1: Atheros AG71xx at 0xb9000000, irq 4, mode:RGMII
[    4.125185] NET: Registered protocol family 10
[    4.133351] NET: Registered protocol family 17
[    4.137834] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    4.150811] 8021q: 802.1Q VLAN Support v1.8
[    4.155122] rb: no calibration data found
[    4.162417] UBI: auto-attach mtd6
[    4.165753] ubi0: attaching mtd6
[    5.012104] ubi0: scanning is finished
[    5.075108] ubi0: attached mtd6 (name "ubi", size 124 MiB)
[    5.080644] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[    5.087501] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[    5.094285] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
[    5.101246] ubi0: good PEBs: 990, bad PEBs: 2, corrupted PEBs: 0
[    5.107242] ubi0: user volume: 4, internal volumes: 1, max. volumes count: 128
[    5.114462] ubi0: max/mean erase counter: 3/1, WL threshold: 4096, image sequence number: 3354704082
[    5.123586] ubi0: available PEBs: 0, total reserved PEBs: 990, PEBs reserved for bad PEB handling: 18
[    5.132916] ubi0: background thread "ubi_bgt0d" started, PID 336
[    5.140842] block ubiblock0_2: created from ubi0:2(rootfs)
[    5.146331] ubiblock: device ubiblock0_2 (rootfs) set to be root filesystem
[    5.169240] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
[    5.177452] Freeing unused kernel memory: 244K
[    5.181921] This architecture does not have kernel memory protection.
[    6.182482] init: Console is alive
[    6.186094] init: - watchdog -
[    7.653162] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    7.709587] usbcore: registered new interface driver usbfs
[    7.715226] usbcore: registered new interface driver hub
[    7.720641] usbcore: registered new device driver usb
[    7.730406] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.738339] ehci-platform: EHCI generic platform driver
[    7.743703] ehci-platform ehci-platform: EHCI Host Controller
[    7.749478] ehci-platform ehci-platform: new USB bus registered, assigned bus number 1
[    7.757507] ehci-platform ehci-platform: irq 3, io mem 0x1b000000
[    7.789974] ehci-platform ehci-platform: USB 2.0 started, EHCI 1.00
[    7.797048] hub 1-0:1.0: USB hub found
[    7.801165] hub 1-0:1.0: 2 ports detected
[    7.807668] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    7.815063] ohci-platform: OHCI generic platform driver
[    7.820431] ohci-platform ohci-platform: Generic Platform OHCI controller
[    7.827227] ohci-platform ohci-platform: new USB bus registered, assigned bus number 2
[    7.835233] ohci-platform ohci-platform: irq 14, io mem 0x1c000000
[    7.914843] hub 2-0:1.0: USB hub found
[    7.918903] hub 2-0:1.0: 2 ports detected
[    7.923770] kmodloader: done loading kernel modules from /etc/modules-boot.d/*
[    7.941452] init: - preinit -
[    8.774528] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[    9.790573] ar71xx: pll_reg 0xb8050014: 0x110000
[    9.790587] eth0: link up (1000Mbps/Full duplex)
[    9.795312] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   11.974638] random: procd: uninitialized urandom read (4 bytes read)
[   11.986775] UBIFS (ubi0:3): background thread "ubifs_bgt0_3" started, PID 403
[   12.305471] UBIFS (ubi0:3): recovery needed
[   12.922467] UBIFS (ubi0:3): recovery completed
[   12.927000] UBIFS (ubi0:3): UBIFS: mounted UBI device 0, volume 3, name "rootfs_data"
[   12.934845] UBIFS (ubi0:3): LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes
[   12.944753] UBIFS (ubi0:3): FS size: 115675136 bytes (110 MiB, 911 LEBs), journal size 5840896 bytes (5 MiB, 46 LEBs)
[   12.955345] UBIFS (ubi0:3): reserved for root: 4952683 bytes (4836 KiB)
[   12.961965] UBIFS (ubi0:3): media format: w4/r0 (latest is w4/r0), UUID A34B4291-2D40-4294-94C9-470243CF5BD6, small LPT model
[   12.979511] mount_root: switching to ubifs overlay
[   13.015619] urandom-seed: Seeding with /etc/urandom.seed
[   13.236660] eth0: link down
[   13.250712] procd: - early -
[   13.253684] procd: - watchdog -
[   13.876956] procd: - watchdog -
[   13.880389] procd: - ubus -
[   14.042312] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.054154] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.060972] random: ubusd: uninitialized urandom read (4 bytes read)
[   14.068081] procd: - init -
[   14.484401] kmodloader: loading kernel modules from /etc/modules.d/*
[   14.495158] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   14.514853] Loading modules backported from Linux version wt-2017-11-01-0-gfe248fc2c180
[   14.522902] Backport generated by backports.git v4.14-rc2-1-31-g86cf0e5d
[   14.532310] ip_tables: (C) 2000-2006 Netfilter Core Team
[   14.545438] nf_conntrack version 0.5.0 (4096 buckets, 16384 max)
[   14.602585] xt_time: kernel timezone is -0000
[   14.653721] PPP generic driver version 2.4.2
[   14.660321] NET: Registered protocol family 24
[   14.694801] kmodloader: done loading kernel modules from /etc/modules.d/*
[   16.294388] urandom_read: 5 callbacks suppressed
[   16.294396] random: jshn: uninitialized urandom read (4 bytes read)
[   24.631110] br-lan: port 1(eth0) entered blocking state
[   24.636338] br-lan: port 1(eth0) entered disabled state
[   24.641957] device eth0 entered promiscuous mode
[   24.658329] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
[   24.833204] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready
[   24.853717] br-lan: port 2(eth1.1) entered blocking state
[   24.859122] br-lan: port 2(eth1.1) entered disabled state
[   24.864950] device eth1.1 entered promiscuous mode
[   24.869741] device eth1 entered promiscuous mode
[   24.965305] IPv6: ADDRCONF(NETDEV_UP): eth1.2: link is not ready
[   25.630865] ar71xx: pll_reg 0xb8050014: 0x110000
[   25.635491] eth0: link up (1000Mbps/Full duplex)
[   25.655107] br-lan: port 1(eth0) entered blocking state
[   25.660393] br-lan: port 1(eth0) entered forwarding state
[   25.740767] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[   25.870429] ar71xx: pll_reg 0xb8050010: 0x110000
[   25.875054] eth1: link up (1000Mbps/Full duplex)
[   25.879698] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[   25.928462] br-lan: port 2(eth1.1) entered blocking state
[   25.933918] br-lan: port 2(eth1.1) entered forwarding state
[   25.939646] IPv6: ADDRCONF(NETDEV_CHANGE): eth1.2: link becomes ready
[  125.270006] random: crng init done

I see that in GitHub someone is working on one Mikrotik device

Yes, but that device uses nor flash. @robimarco has a nand flash driver that works on mikrotik nand devices. I am hoping he will post it.

There has been progress
Have a look at this PR

FYI, I'm now have a spare board, so thought I'd have a go at making a really simple ath79 image and booting it up.

It didn't work... :frowning: