sungem: force serdes dection on buildin V880 fiber gigabit ethernet
PATCH 1/1 sungem: force serdes dection on buildin V880 fiber gigabit ethernet
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.
BTW, the patch is against debian lenny kernel sources (2.6.26-2-sparc64-smp), as since 2.6.27rcX the kernel did not run anymore on this hardware (will try 2.6.31.6 when compile finished).
Thanks,
Hermann
Signature · 4 lines
Netzwerkadministration/Zentrale Dienste, Interdiziplinaeres Zentrum fuer wissenschaftliches Rechnen der Universitaet Heidelberg IWR; INF 368; 69120 Heidelberg; Tel: (06221)54-8236 Fax: -5224 Email: [email protected]
drivers/net/sungem.c renamed from drivers/net/sungem.c.detect +5 -1
@@ -2062,7 +2062,11 @@ static int gem_check_invariants(struct g mif_cfg &= ~MIF_CFG_PSELECT ;writel (mif_cfg, gp->regs +MIF_CFG ); }else { - gp->phy_type = phy_serialink; +if (pdev->device ==PCI_DEVICE_ID_SUN_GEM ) { + printk(KERN_INFO PFX "SUNGEM phy_serdes forced.\n"); + gp->phy_type = phy_serdes; + }else + gp->phy_type = phy_serialink; }if (gp->phy_type == phy_mii_mdio1 || gp->phy_type == phy_mii_mdio0) {
David Miller
maintainerRe: [experimental patch] sungem: force serdes dection on buildin
From: Hermann Lauer <[email protected]>
Date: Fri, 13 Nov 2009 13:43:50 +0100
Quoted 10 lines
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.
Thanks a lot for this patch, I'll take a close look at it soon.
David Miller
maintainerRe: [experimental patch] sungem: force serdes dection on buildin
In reply to Hermann LauerFrom: Hermann Lauer <[email protected]>
Date: Fri, 13 Nov 2009 13:43:50 +0100
Quoted 10 lines
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.
--- drivers/net/sungem.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-)
drivers/net/sungem.c +9 -1
@@ -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) {
Signature · 1 line
1.6.5.3
Quoted 5 lines · David Miller
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
Signature · 4 lines
Netzwerkadministration/Zentrale Dienste, Interdiziplinaeres Zentrum fuer wissenschaftliches Rechnen der Universitaet Heidelberg IWR; INF 368; 69120 Heidelberg; Tel: (06221)54-8236 Fax: -5224 Email: [email protected]
David Miller
maintainerRe: [experimental patch] sungem: force serdes dection on buildin
In reply to Hermann LauerFrom: Hermann Lauer <[email protected]>
Date: Fri, 20 Nov 2009 15:28:03 +0100
Quoted 7 lines
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_mdio1orphy_mii_mdio0detected and only after failing to read thephy_miifall back to typephy_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.
Quoted 1 line
But anyways, all interfaces are working. Thanks.
Thanks for testing.
Quoted 6 lines
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.