• Lukasz Majewski's avatar
    net: dsa: microchip: Enable HSR offloading for KSZ9477 · 2d61298f
    Lukasz Majewski authored
    This patch adds functions for providing in KSZ9477 switch HSR
    (High-availability Seamless Redundancy) hardware offloading.
    
    According to AN3474 application note following features are provided:
    - TX packet duplication from host to switch (NETIF_F_HW_HSR_DUP)
    - RX packet duplication discarding
    - Prevention of packet loop
    
    For last two ones - there is a probability that some packets will not
    be filtered in HW (in some special cases - described in AN3474).
    Hence, the HSR core code shall be used to discard those not caught frames.
    
    Moreover, some switch registers adjustments are required - like setting
    MAC address of HSR network interface.
    
    Additionally, the KSZ9477 switch has been configured to forward frames
    between HSR ports (e.g. 1,2) members to provide support for
    NETIF_F_HW_HSR_FWD flag.
    
    Join and leave functions are written in a way, that are executed with
    single port - i.e. configuration is NOT done only when second HSR port
    is configured.
    Co-developed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
    Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    2d61298f
ksz9477.h 4.16 KB