diff mbox

[experimental] sungem: force serdes dection on buildin V880 fiber gigabit ethernet

Message ID 20091117.044928.245588641.davem@davemloft.net
State Accepted
Delegated to: David Miller
Headers show

Commit Message

David Miller Nov. 17, 2009, 12:49 p.m. UTC
From: Hermann Lauer <Hermann.Lauer@iwr.uni-heidelberg.de>
Date: Fri, 13 Nov 2009 13:43:50 +0100

> On a SunFire 880 the internal fibre gigabit interface (gem chip,
> an Agilent HDMP-1636A serdes on board) needs to be detected as
> a serdes and not as a seriallink.
> 
> The appended experimental patch changes this during detection and
> make the interface working (on top of the patches developed with davem for
> the Sun PCI gigabit fibre interface card).
> 
> Please comment and tell if there is a PCI sungem with seriallink and an
> ID of PCI_DEVICE_ID_SUN_GEM(2bad) out there.

It seems there is a special device property that we can use
to detect this properly.

Please try the attached patch on your system, it should fix
the problem too.

Thanks!

sungem: Fix Serdes detection.

We need to look for the 'shared-pins' property to get
this right.

Based upon a patch by Hermann Lauer.

Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/sungem.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

Comments

Hermann Lauer Nov. 20, 2009, 2:28 p.m. UTC | #1
On Tue, Nov 17, 2009 at 04:49:28AM -0800, David Miller wrote:
> It seems there is a special device property that we can use
> to detect this properly.
> 
> Please try the attached patch on your system, it should fix
> the problem too.

Works on the SunFire 880 with internel fibre serdes and on a SunFire 480
with a PCI Card with fibre serdes here.

On the PCI card interrestingly there were initially type phy_mii_mdio1 
or phy_mii_mdio0 detected and only after failing to read the phy_mii 
fall back to type phy_serdes. The 'shared-pins' property would be
available for testing for a serdes on that card, too.

But anyways, all interfaces are working. Thanks.

BTW, are there any new ideas about getting post 2.6.26 kernels booting
on that class of sparc machines ? My last try with 2.6.31.6 still
hangs at the usual point. Anything I could/should try ?

The offer of remote debugging on the SunFire 480 still stands,
if you could find a few spare minutes...

Thanks,
  Hermann
David Miller Nov. 20, 2009, 7:15 p.m. UTC | #2
From: Hermann Lauer <Hermann.Lauer@iwr.uni-heidelberg.de>
Date: Fri, 20 Nov 2009 15:28:03 +0100

> Works on the SunFire 880 with internel fibre serdes and on a SunFire 480
> with a PCI Card with fibre serdes here.
> 
> On the PCI card interrestingly there were initially type phy_mii_mdio1 
> or phy_mii_mdio0 detected and only after failing to read the phy_mii 
> fall back to type phy_serdes. The 'shared-pins' property would be
> available for testing for a serdes on that card, too.

Yes, it seems we could sample that shared-pins property for
all PHY types, not just for handling the serdes case.

> But anyways, all interfaces are working. Thanks.

Thanks for testing.

> BTW, are there any new ideas about getting post 2.6.26 kernels booting
> on that class of sparc machines ? My last try with 2.6.31.6 still
> hangs at the usual point. Anything I could/should try ?
> 
> The offer of remote debugging on the SunFire 480 still stands,
> if you could find a few spare minutes...

Sorry for not getting to this, I'll make a special effort to
do so soon.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 305ec3d..1927b3d 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2062,7 +2062,15 @@  static int gem_check_invariants(struct gem *gp)
 		mif_cfg &= ~MIF_CFG_PSELECT;
 		writel(mif_cfg, gp->regs + MIF_CFG);
 	} else {
-		gp->phy_type = phy_serialink;
+#ifdef CONFIG_SPARC
+		const char *p;
+
+		p = of_get_property(gp->of_node, "shared-pins", NULL);
+		if (p && !strcmp(p, "serdes"))
+			gp->phy_type = phy_serdes;
+		else
+#endif
+			gp->phy_type = phy_serialink;
 	}
 	if (gp->phy_type == phy_mii_mdio1 ||
 	    gp->phy_type == phy_mii_mdio0) {