Add support for MikroTik RB5009UG

@adron I just added 2,5Gbps port (p1) to the LAN bridge, and hooked it up to my multigig XGS1250-12 here. The XGS1250-12 shows a 2,5G connection, but I cannot reach the RB5009. When I switch ports and log into it, I am not seeing anything about p1 in dmesg or logread. It's a short pesky CAT5 cable, but if the switch on the other end is saying it's 2,5G, then I reckon the issue must be at the end of the RB5009. If you need me to test anything, let me know.

As an aside for everyone building their own images and starting with their own config (and not adron's :crazy_face:): make sure you have the following bits set correctly. The first will default to 16 on mvebu, which basically breaks your image since the NOR flash is 16 MB by itself already (and the kernel goes on the NOR). The rootfs goes on the NAND so there the default size (1024) shouldn't be an issue.

CONFIG_TARGET_KERNEL_PARTSIZE=5
CONFIG_TARGET_ROOTFS_PARTSIZE=10

In fact, there are only 15 megabytes for the kernel. the first megabyte is occupied by the bootloader.

2 Likes

@adron I just tested on a gigabit port, when I connect the 2,5G port on the MikroTik to a plain gigabit one at the other end the interface does come up. Looks like 2,5G is not working.

hello to all, thank you for your excellent work, I would like to flash, however the procedure is greatly simplified to the point where I do not know which program or which configuration is necessary for the process.. could you guide me?

Can you provide the dmesg and ethtool p1 outputs. Thanks.

Hello, do you have a download link for tftp boot please ?

Both binaries you need are here.

Install as follows:

  • Pull the power plug from the RB5009UG
  • Set up dnsmasq as per post #548 and make it serve openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-fit-uImage.elf.
  • Plug the cable into port 1 (so the 2,5G port), keep the RESET button pressed, power up the router.
  • You'll see the green LED at the bottom right of the SFP+ port light up at some point and then blink (might be the other way around). As soon as the light goes out (about 20 seconds after powering up the router), let go of the RESET button.
  • After a few seconds you should see the image getting loaded by the router with the following message: dnsmasq-tftp: sent /srv/tftp/openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-fit-uImage.elf to 192.168.88.163
  • Unplug the network cable and stop dnsmasq on your computer.
  • Plug the network cable into one of the 'LAN' ports (2-8), have some patience until OpenWrt is booted. If you set your computer to acquire an address by DHCP, that helps (it won't work until OpenWrt is fully booted)
  • Once you are logged into OpenWrt you can follow the instructions lined out in adron's README.

Apart from the dnsmasq setup, the process is thoroughly documented.

3 Likes

@adron This is what the following scenarios yield. I've tested with CAT5E cables (I have no CAT6 or higher so far), but those CAT5E cables have been confirmed working on 10G connections (X550-AT2 with XGS1250-12).

  • 2,5G port hotplugged, multigig at other end

    Note: the XGS1250-12 at the other end will show the 10G is active at 2,5Gbps. On the RB5009UG, the 2,5G LED is blinking so something is happening there as well.

    dmesg -w: nothing about p1

    Last messages before 2,5G interface is connected are these, nothing printed when it gets connected:

    [   24.403161] mv88e6085 f212a200.mdio-mii:00 p7: Link is Up - 1Gbps/Full - flow control rx/tx
    [   24.411614] br-lan: port 7(p7) entered blocking state
    [   24.416705] br-lan: port 7(p7) entered forwarding state
    

    ethtool: no link detected

    Summary
    # ethtool p1
    Settings for p1:
    	Supported ports: [ TP MII ]
    	Supported link modes:   10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Full 
    	                        1000baseX/Full 
    	                        2500baseT/Full 
    	Supported pause frame use: Symmetric
    	Supports auto-negotiation: Yes
    	Supported FEC modes: Not reported
    	Advertised link modes:  10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Full 
    	                        1000baseX/Full 
    	                        2500baseT/Full 
    	Advertised pause frame use: Symmetric
    	Advertised auto-negotiation: Yes
    	Advertised FEC modes: Not reported
    	Link partner advertised link modes:  100baseT/Half 100baseT/Full 
    	                                     1000baseT/Full 
    	                                     2500baseT/Full 
    	Link partner advertised pause frame use: No
    	Link partner advertised auto-negotiation: Yes
    	Link partner advertised FEC modes: Not reported
    	Speed: 2500Mb/s
    	Duplex: Full
    	Port: Twisted Pair
    	PHYAD: 0
    	Transceiver: external
    	Auto-negotiation: on
    	MDI-X: on (auto)
    	Supports Wake-on: g
    	Wake-on: d
    	Link detected: no
    
  • 2,5G port hotplugged, 1G at other end

    dmesg -w

    [18282.687290] mv88e6085 f212a200.mdio-mii:00 p1: Link is Up - 1Gbps/Full - flow control off
    [18282.695580] br-lan: port 1(p1) entered blocking state
    [18282.700801] br-lan: port 1(p1) entered forwarding state
    

    ethtool

    Summary
    # ethtool p1
    Settings for p1:
    	Supported ports: [ TP MII ]
    	Supported link modes:   10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Full 
    	                        1000baseX/Full 
    	                        2500baseT/Full 
    	Supported pause frame use: Symmetric
    	Supports auto-negotiation: Yes
    	Supported FEC modes: Not reported
    	Advertised link modes:  10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Full 
    	                        1000baseX/Full 
    	                        2500baseT/Full 
    	Advertised pause frame use: Symmetric
    	Advertised auto-negotiation: Yes
    	Advertised FEC modes: Not reported
    	Link partner advertised link modes:  10baseT/Half 10baseT/Full 
    	                                     100baseT/Half 100baseT/Full 
    	                                     1000baseT/Full 
    	Link partner advertised pause frame use: No
    	Link partner advertised auto-negotiation: Yes
    	Link partner advertised FEC modes: Not reported
    	Speed: 1000Mb/s
    	Duplex: Full
    	Port: Twisted Pair
    	PHYAD: 0
    	Transceiver: external
    	Auto-negotiation: on
    	MDI-X: on (auto)
    	Supports Wake-on: g
    	Wake-on: d
    	Link detected: yes 
    
  • 2,5G port plugged in at boot time, multigig at other end

    dmesg -w: P1 seems to be up ('entered forwarding state')?

    [18282.687290] mv88e6085 f212a200.mdio-mii:00 p1: Link is Up - 1Gbps/Full - flow control off
    [18282.695580] br-lan: port 1(p1) entered blocking state
    [18282.700801] br-lan: port 1(p1) entered forwarding state
    

    ethtool: no link detected

    Summary
    # ethtool p1
    Settings for p1:
    	Supported ports: [ TP MII ]
    	Supported link modes:   10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Full 
    	                        1000baseX/Full 
    	                        2500baseT/Full 
    	Supported pause frame use: Symmetric
    	Supports auto-negotiation: Yes
    	Supported FEC modes: Not reported
    	Advertised link modes:  10baseT/Half 10baseT/Full 
    	                        100baseT/Half 100baseT/Full 
    	                        1000baseT/Full 
    	                        1000baseX/Full 
    	                        2500baseT/Full 
    	Advertised pause frame use: Symmetric
    	Advertised auto-negotiation: Yes
    	Advertised FEC modes: Not reported
    	Link partner advertised link modes:  100baseT/Half 100baseT/Full 
    	                                     1000baseT/Full 
    	                                     2500baseT/Full 
    	Link partner advertised pause frame use: No
    	Link partner advertised auto-negotiation: Yes
    	Link partner advertised FEC modes: Not reported
    	Speed: 2500Mb/s
    	Duplex: Full
    	Port: Twisted Pair
    	PHYAD: 0
    	Transceiver: external
    	Auto-negotiation: on
    	MDI-X: off (auto)
    	Supports Wake-on: g
    	Wake-on: d
    	Link detected: no
    

After some (expected) struggling around I was able to follow the complete readme, finished by a:

Cannot save config while running from ramdisk.
Wed Jan  8 09:37:16 UTC 2003 upgrade: Commencing upgrade. Closing all shell sessions.
Command failed: Connection failed

After that I's going back to BOOTP instead of booting OpenWrt What am I missing?
I was starting with RouterOS 7.1.1 downgrading to routeros-arm64-6.49.3.npk did not work for some reason. Reinstalling 7.1.1 worked however. Any further hints?

Did your replace the bootloader as per the instructions?

RouterOS 6.x won't work on this hardware btw, AFAIK, the RB5009UG was 7.x from the start.

As far a the mtd write - RouterBOOT part goes, Yes I did. the whole session was like:

BusyBox v1.35.0 (2022-02-14 04:50:56 UTC) built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt SNAPSHOT, r18617-7c5826afd2
 -----------------------------------------------------
=== 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:~# wget http://192.168.1.10:8000/rbt-with-aux-for-mtd5.bin -O- | mtd write - RouterBOOT
Downloading 'http://192.168.1.10:8000/rbt-with-aux-for-mtd5.bin'
Connecting to 192.168.1.10:8000
Writing to stdout
Unlocking RouterBOOT ...

-                    100% |*******************************| 65536   0:00:00 ETA
Download completed (65536 bytes)

root@OpenWrt:~# echo cfg > /sys/firmware/mikrotik/soft_config/boot_device
root@OpenWrt:~# echo 1 > /sys/firmware/mikrotik/soft_config/commit
root@OpenWrt:~# wget http://192.168.1.10:8000/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin -O- > /tmp/fw.bin
Downloading 'http://192.168.1.10:8000/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin'
Connecting to 192.168.1.10:8000
Writing to stdout
-                    100% |*******************************|  7980k  0:00:00 ETA
Download completed (8172325 bytes)
root@OpenWrt:~# sysupgrade /tmp/fw.bin
Cannot save config while running from ramdisk.
Sat Nov 25 14:45:08 UTC 2000 upgrade: Commencing upgrade. Closing all shell sessions.
Command failed: Connection failed
root@OpenWrt:~# Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

I got mine with 7.0.5 delivered but online I only got 7.1+

No idea what's going on there. The modified RouterBOOT should allow you to use serial though, hopefully that could give some pointers. I've upgraded from 7.1 RC4 in the end I believe.

thank you for your guide, I download 2 files, an .elf and a .bin…. explain to you where to put .elf but not the bin… when I follow the instructions described in the Adron readme and I paste in OpenWrt the commands .. unfortunately I have this message which appears:

Cannot save config while running from ramdisk

Did you actually change the assets from the tag rb5009-20220209?
May I suggest to create new releases on such occasions? It's always good to have alternatives.

@adron I am blocked, the router does not start either on os7.05 or on OpenWrt .. when I do tftp I find OpenWrt image but I always have the error message: Cannot save config while running from ramdisk

After the steps from the readme Routeros is gone. You have to reinstall it via netinstall.
https://wiki.mikrotik.com/wiki/Manual:Netinstall also 7.0.5 will not be available.
Its basicly the same dhcp-bootp-tftp procedure but for mikrotik's NPK format.

1 Like

If needed you can manually change the download links, e.g. 7.1RC4 is not available on the download page anymore but you can modify the URL, e.g.:

  • Actual RC image: https://download.mikrotik.com/routeros/7.2rc3/routeros-7.2rc3-arm64.npk
  • Modified link: https://download.mikrotik.com/routeros/7.1rc4/routeros-7.1rc4-arm64.npk
2 Likes

@clayface I've been reading up on the CESA crypto engine the Marvell SoCs come with. It seems performance is a mixed bag. I also found an older topic on the forum here where it more or less seems to boil down to AES-NI (if available) being more performant in most cases than more exotic hardware crypto engines when both are available.

1 Like

Could you compare the md5sums?

4d88c1c7a9f2182fcbdaa4a37c331a98  openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
61c6e5d993e32d6136be12b92b4fdf76  rbt-with-aux-for-mtd5.bin

SHA256 hash of the ELF file that worked for me was this one: 4c4eefea7d5031e23cabaeef61c22b77a255ce64165658bf3c062988b247a09a

1 Like