Skip to contentSkip to conversation

Revert "net: macb: Fixed reading MII_LPA register"

PATCH In review Bin Meng 3 participants 8 messages Aug 14, 2019 – Sep 4, 2019 Network drivers

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

---

 drivers/net/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/macb.c +1 -1
index c99cf66..25f7913 100644
@@ -643,7 +643,7 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
 
 	/* First check for GMAC and that it is GiB capable */
 	if (gem_is_gigabit_capable(macb)) {
-		lpa = macb_mdio_read(macb, MII_LPA);
+		lpa = macb_mdio_read(macb, MII_STAT1000);
 
 		if (lpa & (LPA_1000FULL | LPA_1000HALF | LPA_1000XFULL |
 					LPA_1000XHALF)) {
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

Hi Radu,

Is there something you can switch on to select the correct register on the appropriate platform?

Quoted 8 lines · Bin Meng

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

author
#2 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

Hi Joe,

Quoted 10 lines · Joe Hershberger

Hi Radu,

Is there something you can switch on to select the correct register on the appropriate platform?

Quoted 3 lines · Bin Meng

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Quoted 7 lines
Quoted 5 lines

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

Could you please pick this patch for v2019.10?

Regards,
Bin

#3 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

Hi Bin,

Quoted 18 lines · Bin Meng

Hi Joe,

Quoted 14 lines · Joe Hershberger

Hi Radu,

Is there something you can switch on to select the correct register on the appropriate platform?

Quoted 7 lines · Bin Meng

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Could you please pick this patch for v2019.10?

Yes. It's already build-tested and I will send a PR later today.

Cheers,
-Joe

author
#4 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

Quoted 22 lines · Joe Hershberger

Hi Bin,

Quoted 18 lines · Bin Meng

Hi Joe,

Quoted 14 lines · Joe Hershberger

Hi Radu,

Is there something you can switch on to select the correct register on the appropriate platform?

Quoted 7 lines · Bin Meng

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Could you please pick this patch for v2019.10?

Yes. It's already build-tested and I will send a PR later today.

Thank you Joe!

Regards,
Bin

#5 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

In reply to Bin Meng
Quoted 18 lines · Bin Meng

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

---

 drivers/net/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/macb.c +0 -0
index c99cf66..25f7913 100644

drivers/net/macb.c static int macb_phy_init(struct macb_device *macb, const char *name) · line 646

Quoted 5 lines
drivers/net/macb.c +1 -1
@@ -643,7 +643,7 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
 
        /* First check for GMAC and that it is GiB capable */
        if (gem_is_gigabit_capable(macb)) {
-               lpa = macb_mdio_read(macb, MII_LPA);
+               lpa = macb_mdio_read(macb, MII_STAT1000);

You can do this selectively by having boolean flag in macb_config which is only set for SiFive Unleashed.

Regards,
Anup

Quoted 10 lines
drivers/net/macb.c +0 -1
                if (lpa & (LPA_1000FULL | LPA_1000HALF | LPA_1000XFULL |
                                        LPA_1000XHALF)) {
--

2.7.4

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
https://lists.denx.de/listinfo/u-boot

author
#6 lore raw

PATCH 1/1 Revert "net: macb: Fixed reading MII_LPA register"

Quoted 21 lines · Anup Patel
Quoted 19 lines · Bin Meng

This reverts commit 1b0c9914cc75d1570359181ebd493cd5746cb0ed.

Commit 1b0c9914cc75 ("net: macb: Fixed reading MII_LPA register") causes 100Mbps does not work any more with SiFive FU540 GEM on the HiFive Unleashed board. Revert it.

---

 drivers/net/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/macb.c +0 -0
index c99cf66..25f7913 100644
@@ -643,7 +643,7 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
 
Quoted 7 lines

drivers/net/macb.c static int macb_phy_init(struct macb_device *macb, const char *name) · line 646

Quoted 4 lines
drivers/net/macb.c +1 -1
        /* First check for GMAC and that it is GiB capable */
        if (gem_is_gigabit_capable(macb)) {
-               lpa = macb_mdio_read(macb, MII_LPA);
+               lpa = macb_mdio_read(macb, MII_STAT1000);

You can do this selectively by having boolean flag in macb_config which is only set for SiFive Unleashed.

That does not look clean to me. I actually don't understand what the issue the previous patch was trying to fix.

Maybe until we know that better we need revert to original codes...

Regards,
Bin