Skip to contentSkip to conversation

net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL

PATCH Superseded Daniel Mack 2 participants 2 messages Sep 27, 2012

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL

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.

Cc Mugunthan V N <[email protected]>
Cc Vaibhav Hiremath <[email protected]>
Cc David S. Miller <[email protected]>
---
 drivers/net/ethernet/ti/cpsw.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/ti/cpsw.c +5 -0
index aa78168..b764f75 100644
@@ -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 >10Mbps */
+		if (phy->speed > 10)
+			mac_control |= BIT(15);
+
 		*link = true;
 	} else {
 		mac_control = 0;
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 26 lines

-----Original Message-----
From: Daniel Mack [mailto:[email protected]]
Sent: Thursday, September 27, 2012 5:21 PM
To: [email protected]
Cc: Daniel Mack; N, Mugunthan V; Hiremath, Vaibhav; David S. Miller
Subject: [PATCH] net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL

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.

Cc Mugunthan V N <[email protected]>
Cc Vaibhav Hiremath <[email protected]>
Cc David S. Miller <[email protected]>
---
 drivers/net/ethernet/ti/cpsw.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/ti/cpsw.c +0 -0
index aa78168..b764f75 100644

drivers/net/ethernet/ti/cpsw.c static void _cpsw_adjust_link(struct cpsw_slave · line 393

Quoted 8 lines
drivers/net/ethernet/ti/cpsw.c +3 -0
@@ -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 >10Mbps
 */
+		if (phy->speed > 10)

Please change the speed check as == 100 as it is required only for 100Mbps link

Regards
Mugunthan V N

Quoted 7 lines
drivers/net/ethernet/ti/cpsw.c +2 -0
+			mac_control |= BIT(15);
+
 		*link = true;
drivers/net/ethernet/ti/cpsw.c +0 -1
 	} else {
 		mac_control = 0;
--

1.7.11.4