BPI-R2 slow ethernet speed

I’ve got three R2 boards and I’m working with a number of your Kernel versions Frank - I’ll do some testing with the discussed setup this weekend - sorry I keep on disappearing! I know we need all hands on deck but I’ve had health issues - all resolved now :slight_smile:

I was recently digging through OpenWRT kernel patches for BPiR2 and stumbled upon this one:

Interesting lines are these:

+	if (!dsa_is_cpu_port(ds, 5)) {
+		val |= MHWTRAP_P5_DIS;
+		val |= MHWTRAP_P5_MAC_SEL;
+		val |= MHWTRAP_P5_RGMII_MODE;
+	}

What seems to be done here is the initialization of the port 5 of the switch to use RGMII mode no matter what is set in the DTS, but only in case this port was marked as a cpu port in DTS.

Right…port5 (eth1=wan) is rgmi only, i don’t know why it is only working if set to trgmii. Port6=eth0=lan supports trgmii. Imho trgmii was not setup the right way so it causes issues if adding the second gmac with another mode.

The code I cited means that the mode you set for port5 in DTS is essentially ignored andit hardcoded to always be rgmii. Probably there’s some other place where the value of the port mode from DTS is being used for something and that’s why we see differences (i.e. malformed packets) when set DTS port mode to rgmii.

You have 2 ends of gmac,switch and soc…imho this setting affects only switch-side. But the code you’ve found also sets switch-side…maybe it is overridden with dts-value? I meam that this code is only an initialization value

That’s it. :blush: We both do not know enough about the code in a whole to be sure. Then again when I seen the the patch above I thought that it might be a good explanation for the fact that we’ve got GMAC2 set to the mode it doesn’t support but still works. Might be a co-incidence though.

i looked again over the code-snippet above.

have you seen the “!” in the condition? so only if port 5 is no cpu-port (imho it can be used as external port) the lines below are used (trgmii-mode makes no sense for external port).

so it should be right and does not affect our trgmii-setting on r2 where p5 is a cpu-port if activated by 2nd-gmac-patches, else it not used and then it does not matter in which mode it is :slight_smile:

Maybe you want to try new phylink. Olser code was reported to have not this issue

Anyone here for trying actual phylink-code?

Can’t open link. GH said 404

it’s because 5.3-rc is released and we have updated phylink

1 Like