summaryrefslogtreecommitdiff
path: root/drivers/net/dsa/mv88e6xxx/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/dsa/mv88e6xxx/chip.c')
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 9dc09f53f1e9..13d86143e41c 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -854,6 +854,18 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
*/
if (!mv88e6xxx_port_ppu_updates(chip, port) ||
phylink_mode_fixed(mode)) {
+ /* The link parameters passed in are the media side parameters.
+ * If in RXAUI, XAUI or 10GBASE-R with a rate matching PHY, we
+ * need to operate our link at 10G. Only full duplex is
+ * supported at this speed.
+ */
+ if (interface == PHY_INTERFACE_MODE_RXAUI ||
+ interface == PHY_INTERFACE_MODE_XAUI ||
+ interface == PHY_INTERFACE_MODE_10GBASER) {
+ speed = SPEED_10000;
+ duplex = DUPLEX_FULL;
+ }
+
if (ops->port_set_speed_duplex) {
err = ops->port_set_speed_duplex(chip, port,
speed, duplex);
@@ -2820,6 +2832,20 @@ static int mv88e6xxx_setup_upstream_port(struct mv88e6xxx_chip *chip, int port)
return 0;
}
+static int mv88e6xxx_setup_led(struct mv88e6xxx_chip *chip, int port)
+{
+ int err;
+
+ /* LED0 = link/activity, LED1 = 10/100 */
+ err = mv88e6xxx_wait_bit(chip, chip->info->port_base_addr + port,
+ MV88E6XXX_PORT_LED_CONTROL, 15, 0);
+ if (err)
+ return err;
+
+ return mv88e6xxx_write(chip, chip->info->port_base_addr + port,
+ MV88E6XXX_PORT_LED_CONTROL, 0x80b3);
+}
+
static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
{
struct dsa_switch *ds = chip->ds;
@@ -2875,6 +2901,12 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
if (err)
return err;
+ if (chip->info->num_gpio) {
+ err = mv88e6xxx_setup_led(chip, port);
+ if (err)
+ return err;
+ }
+
/* Port Control 2: don't force a good FCS, set the MTU size to
* 10222 bytes, disable 802.1q tags checking, don't discard tagged or
* untagged frames on this port, do a destination address lookup on all
@@ -3102,8 +3134,13 @@ static int mv88e6390_setup_errata(struct mv88e6xxx_chip *chip)
return mv88e6xxx_software_reset(chip);
}
+#include "mv88e6xxx_debugfs.c"
+
static void mv88e6xxx_teardown(struct dsa_switch *ds)
{
+ struct mv88e6xxx_chip *chip = ds->priv;
+
+ mv88e6xxx_remove_debugfs(chip);
mv88e6xxx_teardown_devlink_params(ds);
dsa_devlink_resources_unregister(ds);
mv88e6xxx_teardown_devlink_regions_global(ds);
@@ -3231,6 +3268,8 @@ static int mv88e6xxx_setup(struct dsa_switch *ds)
if (err)
goto unlock;
+ mv88e6xxx_init_debugfs(chip);
+
unlock:
mv88e6xxx_reg_unlock(chip);