
On Sun, 19 Mar 2023 18:06:45 +0100 Marek Vasut marek.vasut+renesas@mailbox.org wrote:
Replace PHY_INTERFACE_MODE_SGMII_2500 with PHY_INTERFACE_MODE_SGMII and phydev->speed check where applicable. The PHY_INTERFACE_MODE_SGMII_2500 does not exist in Linux, so remove it from U-Boot too.
Signed-off-by: Marek Vasut marek.vasut+renesas@mailbox.org
SGMII cannot operate on 2500mbps. As I explained to the author who added PHY_INTERFACE_MODE_SGMII_2500 to U-Boot (and the conversation didn't lead anywhere then), what I think happened here is that for some reason Marvell sometimes calls 2500base-x mode SGMII_2500. Meaning that they incorrectly interchange the names 2500base-x and sgmii_2500 as if they were the same thing. This is probably due to how 1000base-x and SGMII are similar and they do the same with those.
The thing is, 1000base-x and SGMII are different protocols / interface modes. The difference is that they have different autonegotiation. SGMII allows also for speed autonegotiation, whilst 1000base-x only for flow control. The bits in the clause 37 link ability advertisement word have different meaning for 1000base-x than for sgmii.
When SGMII negotiates lower speed, the actual serdes frequency does not change. The lower speed of 100mbps or 10mbps is achieved by repeating the word 10 or 100 times.
The 2500base-x mode works the same way as 1000base-x mode, but at 2.5x the frequency. Calling it sgmii-2500 is wrong because it would mean that it also allows for lower speeds by repeating the words. In reality it is possible, on many controllers you can set SGMII mode at 2.5x normal frequency and then instead of 1000/100/10mbps speeds achieve 2500/250/25mbps. But this is not standardized anyway.
Marek, your patch does a good thing getting rid of the sgmii-2500 constant, but you are still leaving the possibility of 2500mbps speed in SGMII mode...
Marek