Skip to contentSkip to conversation

net/designware: do explicit port selection for 1Gb mode

PATCH New Alexey Brodkin 2 participants 3 messages Dec 23, 2015 – Jan 11, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/designware: do explicit port selection for 1Gb mode

Current implementation only sets "port select" bit for non-1Gb mode. That works fine if GMAC has just exited reset state but we may as well change connection mode in runtime. Then we'll need to reprogram GMAC for that new mode of operation and if previous mode was 10 or 100 Mb and new one is 1 Gb we'll need to reset port mode bit.

Cc Bin Meng <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Sonic Zhang <[email protected]>
cc Simon Glass <[email protected]>
---
 drivers/net/designware.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/designware.c +2 -0
index a6c39c3..58c6d36 100644
@@ -200,6 +200,8 @@ static void dw_adjust_link(struct eth_mac_regs *mac_p,
 
 	if (phydev->speed != 1000)
 		conf |= MII_PORTSELECT;
+	else
+		conf &= ~MII_PORTSELECT;
 
 	if (phydev->speed == 100)
 		conf |= FES_100;
Signature · 1 line
2.4.3
#1 lore raw

PATCH 1/1 net/designware: do explicit port selection for 1Gb mode

Quoted 6 lines · Alexey Brodkin

Current implementation only sets "port select" bit for non-1Gb mode. That works fine if GMAC has just exited reset state but we may as well change connection mode in runtime. Then we'll need to reprogram GMAC for that new mode of operation and if previous mode was 10 or 100 Mb and new one is 1 Gb we'll need to reset port mode bit.

Quoted 9 lines
Cc Bin Meng <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Sonic Zhang <[email protected]>
cc Simon Glass <[email protected]>
---
 drivers/net/designware.c | 2 ++
 1 file changed, 2 insertions(+)
#2 lore raw

PATCH 1/1 net/designware: do explicit port selection for 1Gb mode

In reply to Alexey Brodkin

Hi Joe,

Quoted 20 lines · Alexey Brodkin

Current implementation only sets "port select" bit for non-1Gb mode. That works fine if GMAC has just exited reset state but we may as well change connection mode in runtime. Then we'll need to reprogram GMAC for that new mode of operation and if previous mode was 10 or 100 Mb and new one is 1 Gb we'll need to reset port mode bit.

Cc Bin Meng <[email protected]>
Cc Joe Hershberger <[email protected]>
Cc Sonic Zhang <[email protected]>
cc Simon Glass <[email protected]>
---
 drivers/net/designware.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/designware.c +0 -0
index a6c39c3..58c6d36 100644

drivers/net/designware.c static void dw_adjust_link(struct eth_mac_regs *mac_p, · line 207

Quoted 8 lines
drivers/net/designware.c +2 -0
@@ -200,6 +200,8 @@ static void dw_adjust_link(struct eth_mac_regs *mac_p,
 
 	if (phydev->speed != 1000)
 		conf |= MII_PORTSELECT;
+	else
+		conf &= ~MII_PORTSELECT;
 
 	if (phydev->speed == 100)
 		conf |= FES_100;

Any chance for that one to be applied?

-Alexey