net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL
authorDaniel Mack <zonque@gmail.com>
Thu, 27 Sep 2012 09:19:34 +0000 (09:19 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Oct 2012 21:09:07 +0000 (17:09 -0400)
For RMII/RGMII mode operation in 100Mbps, the CPSW needs to set the
IFCTL_A bits in the MACCONTROL register. For all other PHY modes, this
bit is unused, so setting it unconditionally shouldn't cause any
trouble.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Cc: Vaibhav Hiremath <hvaibhav@ti.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/cpsw.c

index 0cbc0e59252c52ebdc00daeec1ca7e97cd539492..df55e240374646e2f076d9b4764fab6dc0a07bab 100644 (file)
@@ -386,6 +386,11 @@ static void _cpsw_adjust_link(struct cpsw_slave *slave,
                        mac_control |= BIT(7);  /* GIGABITEN    */
                if (phy->duplex)
                        mac_control |= BIT(0);  /* FULLDUPLEXEN */
+
+               /* set speed_in input in case RMII mode is used in 100Mbps */
+               if (phy->speed == 100)
+                       mac_control |= BIT(15);
+
                *link = true;
        } else {
                mac_control = 0;