Skip to contentSkip to conversation

net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL

PATCH Applied Daniel Mack 3 participants 4 messages Sep 27, 2012 – Oct 1, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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..fb1a692 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 100Mbps */
+		if (phy->speed == 100)
+			mac_control |= BIT(15);
+
 		*link = true;
 	} else {
 		mac_control = 0;
Signature · 1 line
1.7.11.4
#1 lore raw
Quoted 9 lines · Daniel Mack

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]>

Mugunthan, are you ok with this version? Don't know if it's too late for the 3.7 spin though, given that the merge window just opened.

Daniel

Quoted 21 lines
---
 drivers/net/ethernet/ti/cpsw.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/net/ethernet/ti/cpsw.c +5 -0
index aa78168..fb1a692 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 100Mbps */
+		if (phy->speed == 100)
+			mac_control |= BIT(15);
+
 		*link = true;
 	} else {
 		mac_control = 0;
#2 lore raw
Quoted 21 lines

-----Original Message-----
From: Daniel Mack [mailto:[email protected]]
Sent: Monday, October 01, 2012 2:55 PM
To: Daniel Mack
Cc: [email protected]; N, Mugunthan V; Hiremath, Vaibhav; David S. Miller
Subject: Re: [PATCH v2] net: ti cpsw ethernet: set IFCTL_A bit in MACCONTROL

Quoted 2 lines · Daniel Mack

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

Quoted 7 lines

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]>
Quoted 6 lines

Mugunthan, are you ok with this version? Don't know if it's too late for
the 3.7 spin though, given that the merge window just opened.

Daniel

I am ok with the patch

Regards
Mugunthan V N

Quoted 26 lines

Review

Quoted 7 lines

---
 drivers/net/ethernet/ti/cpsw.c | 5 +++++
 1 file changed, 5 insertions(+)
(quoted diff) +0 -0

b/drivers/net/ethernet/ti/cpsw.c

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

Quoted 4 lines

index aa78168..fb1a692 100644

drivers/net/ethernet/ti/cpsw.c +0 -0
@@ -386,6 +386,11 @@ static void _cpsw_adjust_link(struct cpsw_slave

*slave,

drivers/net/ethernet/ti/cpsw.c static void _cpsw_adjust_link(struct cpsw_slave *slave,

Quoted 5 lines
drivers/net/ethernet/ti/cpsw.c +2 -0
 			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

*/

Quoted 7 lines
drivers/net/ethernet/ti/cpsw.c +3 -0
+		if (phy->speed == 100)
+			mac_control |= BIT(15);
+
 		*link = true;
 	} else {
 		mac_control = 0;