Skip to content

Commit 40da0c3

Browse files
Russell King (Oracle)davem330
authored andcommitted
net: dsa: mv88e6xxx: remove handling for DSA and CPU ports
As we now always use a fixed-link for DSA and CPU ports, we no longer need the hack in the Marvell code to make this work. Remove it. This is especially important with the conversion of DSA drivers to phylink_pcs, as the PCS code only gets called if we are using phylink for the port. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e6a4570 commit 40da0c3

File tree

1 file changed

+5
-43
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+5
-43
lines changed

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3315,56 +3315,17 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
33153315
{
33163316
struct device_node *phy_handle = NULL;
33173317
struct dsa_switch *ds = chip->ds;
3318-
phy_interface_t mode;
33193318
struct dsa_port *dp;
3320-
int tx_amp, speed;
3319+
int tx_amp;
33213320
int err;
33223321
u16 reg;
33233322

33243323
chip->ports[port].chip = chip;
33253324
chip->ports[port].port = port;
33263325

3327-
dp = dsa_to_port(ds, port);
3328-
3329-
/* MAC Forcing register: don't force link, speed, duplex or flow control
3330-
* state to any particular values on physical ports, but force the CPU
3331-
* port and all DSA ports to their maximum bandwidth and full duplex.
3332-
*/
3333-
if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) {
3334-
struct phylink_config pl_config = {};
3335-
unsigned long caps;
3336-
3337-
chip->info->ops->phylink_get_caps(chip, port, &pl_config);
3338-
3339-
caps = pl_config.mac_capabilities;
3340-
3341-
if (chip->info->ops->port_max_speed_mode)
3342-
mode = chip->info->ops->port_max_speed_mode(chip, port);
3343-
else
3344-
mode = PHY_INTERFACE_MODE_NA;
3345-
3346-
if (caps & MAC_10000FD)
3347-
speed = SPEED_10000;
3348-
else if (caps & MAC_5000FD)
3349-
speed = SPEED_5000;
3350-
else if (caps & MAC_2500FD)
3351-
speed = SPEED_2500;
3352-
else if (caps & MAC_1000)
3353-
speed = SPEED_1000;
3354-
else if (caps & MAC_100)
3355-
speed = SPEED_100;
3356-
else
3357-
speed = SPEED_10;
3358-
3359-
err = mv88e6xxx_port_setup_mac(chip, port, LINK_FORCED_UP,
3360-
speed, DUPLEX_FULL,
3361-
PAUSE_OFF, mode);
3362-
} else {
3363-
err = mv88e6xxx_port_setup_mac(chip, port, LINK_UNFORCED,
3364-
SPEED_UNFORCED, DUPLEX_UNFORCED,
3365-
PAUSE_ON,
3366-
PHY_INTERFACE_MODE_NA);
3367-
}
3326+
err = mv88e6xxx_port_setup_mac(chip, port, LINK_UNFORCED,
3327+
SPEED_UNFORCED, DUPLEX_UNFORCED,
3328+
PAUSE_ON, PHY_INTERFACE_MODE_NA);
33683329
if (err)
33693330
return err;
33703331

@@ -3541,6 +3502,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
35413502
}
35423503

35433504
if (chip->info->ops->serdes_set_tx_amplitude) {
3505+
dp = dsa_to_port(ds, port);
35443506
if (dp)
35453507
phy_handle = of_parse_phandle(dp->dn, "phy-handle", 0);
35463508

0 commit comments

Comments
 (0)