• Arınç ÜNAL's avatar
    net: dsa: mt7530: get rid of priv->info->cpu_port_config() · 22fa1017
    Arınç ÜNAL authored
    priv->info->cpu_port_config() is used for MT7531 and the switch on the
    MT7988 SoC. It sets up the ports described as a CPU port earlier than the
    phylink code path would do.
    
    This function is useless as:
    - Configuring the MACs can be done from the phylink_mac_config code path
      instead.
    - All the link configuration it does on the CPU ports are later undone with
      the port_enable, phylink_mac_config, and then phylink_mac_link_up code
      path [1].
    
    priv->p5_interface and priv->p6_interface were being used to prevent
    configuring the MACs from the phylink_mac_config code path. Remove them now
    that they hold no purpose.
    
    Remove priv->info->cpu_port_config(). On mt753x_phylink_mac_config, switch
    to if statements to simplify the code.
    
    Remove the overwriting of the speed and duplex interfaces for certain
    interface modes. Phylink already provides the speed and duplex variables
    with proper values. Phylink already sets the max speed of TRGMII to
    SPEED_1000. Add SPEED_2500 for PHY_INTERFACE_MODE_2500BASEX to where the
    speed and EEE bits are set instead.
    
    On the switch on the MT7988 SoC, PHY_INTERFACE_MODE_INTERNAL is being used
    to describe the interface mode of the 10G MAC, which is of port 6. On
    mt7988_cpu_port_config() PMCR_FORCE_SPEED_1000 was set via the
    PMCR_CPU_PORT_SETTING() mask. Add SPEED_10000 case to where the speed bits
    are set to cover this. No need to add it to where the EEE bits are set as
    the "MT7988A Wi-Fi 7 Generation Router Platform: Datasheet (Open Version)
    v0.1" document shows that these bits don't exist on the MT7530_PMCR_P(6)
    register.
    
    Remove the definition of PMCR_CPU_PORT_SETTING() now that it holds no
    purpose.
    
    Change mt753x_cpu_port_enable() to void now that there're no error cases
    left.
    
    Link: https://lore.kernel.org/netdev/ZHy2jQLesdYFMQtO@shell.armlinux.org.uk/ [1]
    Suggested-by: default avatarRussell King (Oracle) <linux@armlinux.org.uk>
    Signed-off-by: default avatarArınç ÜNAL <arinc.unal@arinc9.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    22fa1017
mt7530.h 24 KB