• Jerry Ray's avatar
    net: dsa: LAN9303: Add early read to sync · 732f374e
    Jerry Ray authored
    Add initial BYTE_ORDER read to sync the 32-bit accesses over the 16-bit
    mdio bus to improve driver robustness.
    
    The lan9303 expects two mdio read transactions back-to-back to read a
    32-bit register. The first read transaction causes the other half of the
    32-bit register to get latched.  The subsequent read returns the latched
    second half of the 32-bit read. The BYTE_ORDER register is an exception to
    this rule. As it is a constant value, there is no need to latch the second
    half. We read this register first in case there were reads during the boot
    loader process that might have occurred prior to this driver taking over
    ownership of accessing this device.
    
    This patch has been tested on the SAMA5D3-EDS with a LAN9303 RMII daughter
    card.
    Signed-off-by: default avatarJerry Ray <jerry.ray@microchip.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    732f374e
lan9303-core.c 39.7 KB