Add support for MikroTik RB5009UG

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

Looks like the PHY is managing to negotiate 2500baseT ok. I wonder if it's something about how the PHY<>switch phylink is working; if you change the phy-mode of port@9 from sgmii to 2500base-x does that make 2.5Gb/s work? (Even if it does I suspect it'll mean the sub 2.5Gb/s speed don't.)

Phy mode needs to be 2500base-x but with in-band negotiation, cause if its SGMII then 2.5G wont work obviously

I was able to recover the routerOS with netinstall thank you!

1 Like

@noodles With the DTS looking like this:

port@9 {
				reg = <9>;
				label = "p1";
				phy-mode = "2500base-x";
				phy-handle = <&switch0phy9>;
				managed = "in-band-status";
				nvmem-cells = <&macaddr_hard>;
				nvmem-cell-names = "mac-address";
				mac-address-increment = <0>;
			};

ethtool p1 output looks worse now, at least to my untrained eye:

# ethtool p1
Settings for p1:
	Supported ports: [ MII ]
	Supported link modes:   2500baseX/Full 
	Supported pause frame use: Symmetric
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  2500baseX/Full 
	Advertised pause frame use: Symmetric
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Unknown! (255)
	Port: MII
	PHYAD: 0
	Transceiver: internal
	Auto-negotiation: on
	Supports Wake-on: d
	Wake-on: d
	Link detected: no

dmesg looks like this:

# dmesg |grep p1
[    0.000000] arch_timer: cp15 timer(s) running at 25.00MHz (phys).
[    0.027615] armada-cp110-pinctrl f2440000.system-controller:pinctrl: registered pinctrl driver
[   20.649284] mv88e6085 f212a200.mdio-mii:00 p1: configuring for inband/2500base-x link mode
[   20.759776] 8021q: adding VLAN 0 to HW filter on device p1
[   20.802427] br-lan: port 1(p1) entered blocking state
[   20.807512] br-lan: port 1(p1) entered disabled state
[   20.813416] device p1 entered promiscuous mode

@robimarko I am not familiar with the inner workings, but looking at the kernel documentation it seems managed = "in-band-status"; means in-band negotiation?

Yeah, managed = "in-band-status"

I am not so sure whether this is possible. At least I found the following discussion:

But it seems that in Amethyst (88E6393X) the AN registers are unavailable (always 0xffff) when in 2500base-x mode.

https://www.mail-archive.com/u-boot@lists.denx.de/msg402374.html

Maybe some of the very latest work on the mv88e6xxx DSA driver actually fix this I guess. Not sure whether we already do have those in those builds though.

Hm, so then it looks like we are out of options.

Interesting discussion that you linked, so basically it doesnt work on Amethyst only.

Now this is intriguing, will drag my CN9130 CRB board that has 2.5G port and see what can be done

1 Like

Yeah, but then some of the latest mv88e6xxx DSA work seems to have found some errata workarounds. Not sure...

I can also see if thats listed as an errata at all or its just not supposed to work

2 Likes

Maybe that is needed:

net: dsa: mv88e6xxx: Fix inband AN for 2500base-x on 88E6393X family

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/dsa/mv88e6xxx?id=163000dbc772c1eae9bdfe7c8fe30155db1efd74

Ah, funny workarounds :rofl:.

If you do have access to the docs you might even confirm his findings...

Its already backported to 5.15.19, will give it a go tommorow and see whether that actually works

3 Likes

From what I can see when checking drivers/net/dsa/mv88e6xxx/serdes.c with adron's 5.10 port, the inband AN fix is already there:

For anyone interested in contributing to the wiki, I've started a device data page to build on.

4 Likes

It looks like the USB 3 port can be used for serial access as well - with two USB to serial adapters and a serial cable in between.

1 Like

Now that is a really neat trick, though I suppose it only works in ROS itself

You're probably right, just tried to hook up an Adafruit FTDI Friend connected to my RS-232 to USB serial cable, Minicom says 'offline'. Was worth a shot :slight_smile:.

Rebooted with the setup attached, RouterBOOT clearly doesn't seem to pick up on it either. I reckon it's merely for emergency access to RouterOS itself.

Its just registering a virtual console in the kernel, its not a native USB feature

1 Like