This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DP83869HM: Linux PHY Driver bug defining the mode.

Part Number: DP83869HM
Other Parts Discussed in Thread: DP83869

I am using a Linux 5.15 kernel and trying to get my Ethernet link with a DP83869 PHY running in a SGMII (SGMII to copper) configuration.  

I have the straps set for this configuration.  I did not explicitly set the mode in the device tree as the documentation indicates:

ti,op-mode
description:
       Operational mode for the PHY.  If this is not set then the operational
       mode is set by the straps. see dt-bindings/net/ti-dp83869.h for values

However, when I first loaded the driver it came up in RGMII mode.  It turns out the the driver function dp83869_set_strapped_mode reads the STRAP_STS register but looks for the mode in bits 0-2 instead of the proper bits 9-11.  

    val = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_STRAP_STS1);
    if (val < 0)
        return val;

    dp83869->mode = val & DP83869_STRAP_OP_MODE_MASK;  // val & 0x7

This looks like a kernel bug or am I missing something?
I noticed that it is still like this in the 6.x kernel.  Are there any plans to fix this bug?

 
(I can get around this by explicitly setting the mode but could have saved a bunch of time if it were correct.)