net: mvpp2: fix 10 Mbit/s usage
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 27 Jul 2014 21:21:35 +0000 (23:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Jul 2014 23:47:43 +0000 (16:47 -0700)
This commit is similar to commit 4d12bc63ab5e ("net: mvneta: fix
operation in 10 Mbit/s mode"), but this time for the mvpp2 driver. The
driver was properly taking into account the 1 Gbit/s and 100 Mbit/s
speeds, but not the 10 Mbit/s, which was handled as 100
Mbit/s. However, the MVPP2_GMAC_CONFIG_MII_SPEED bit in the
MVPP2_GMAC_AUTONEG_CONFIG register must remain cleared to allow 10
Mbit/s operation. This commit therefore fixes 10 Mbit/s operation.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2.c

index 3193a7de7197cee39b4738477926a3693b74edad..3cae3d2abe7e3e18dce3600d89820f32a6ee4e48 100644 (file)
@@ -4842,7 +4842,7 @@ static void mvpp2_link_event(struct net_device *dev)
 
                        if (phydev->speed == SPEED_1000)
                                val |= MVPP2_GMAC_CONFIG_GMII_SPEED;
-                       else
+                       else if (phydev->speed == SPEED_100)
                                val |= MVPP2_GMAC_CONFIG_MII_SPEED;
 
                        writel(val, port->base + MVPP2_GMAC_AUTONEG_CONFIG);