• Vladimir Oltean's avatar
    net: dsa: sja1105: the 0x1F0000 SGMII "base address" is actually MDIO_MMD_VEND2 · 4c7ee010
    Vladimir Oltean authored
    Looking at the SGMII PCS from SJA1110, which is accessed indirectly
    through a different base address as can be seen in the next patch, it
    appears odd that the address accessed through indirection still
    references the base address from the SJA1105S register map (first MDIO
    register is at 0x1f0000), when it could index the SGMII registers
    starting from zero.
    
    Except that the 0x1f0000 is not a base address at all, it seems. It is
    0x1f << 16 | 0x0000, and 0x1f is coding for the vendor-specific MMD2.
    So, it turns out, the Synopsys PCS implements all its registers inside
    the vendor-specific MMDs 1 and 2 (0x1e and 0x1f). This explains why the
    PCS has no overlaps (for the other MMDs) with other register regions of
    the switch (because no other MMDs are implemented).
    
    Change the code to remove the SGMII "base address" and explicitly encode
    the MMD for reads/writes. This will become necessary for SJA1110 support.
    
    Cc: Russell King <linux@armlinux.org.uk>
    Cc: Heiner Kallweit <hkallweit1@gmail.com>
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    4c7ee010
sja1105_spi.c 17.7 KB