sungem: Fix Serdes detection.
authorDavid S. Miller <davem@davemloft.net>
Tue, 17 Nov 2009 12:46:18 +0000 (04:46 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Nov 2009 12:46:18 +0000 (04:46 -0800)
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

index 305ec3d783dba30dd396b2fcfb6df9ce12913384..1927b3de9eec1f183ca4f787310f82eb0e4fe84f 100644 (file)
@@ -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) {