• Arun Ramadoss's avatar
    net: dsa: microchip: add common ksz port xmii speed selection function · aa5b8b73
    Arun Ramadoss authored
    This patch adds the function for configuring the 100/10Mbps speed
    selection for the ksz switches. KSZ8795 switch uses Global control 4
    register 0x06 bit 4 for choosing 100/10Mpbs. Other switches uses xMII
    control 1 0xN300 for it.
    For KSZ8795, if the bit is set then 10Mbps is chosen and if bit is
    clear then 100Mbps chosen. For all other switches it is other way
    around, if the bit is set then 100Mbps is chosen.
    So, this patch add the generic function for ksz switch to select the
    100/10Mbps speed selection. While configuring, first it disables the
    gigabit functionality and then configure the respective speed.
    Signed-off-by: default avatarArun Ramadoss <arun.ramadoss@microchip.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    aa5b8b73
ksz_common.c 45.3 KB