From patchwork Tue Nov 17 12:49:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Miller X-Patchwork-Id: 38630 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 243C5B7B90 for ; Tue, 17 Nov 2009 23:49:21 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752242AbZKQMtN (ORCPT ); Tue, 17 Nov 2009 07:49:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752617AbZKQMtN (ORCPT ); Tue, 17 Nov 2009 07:49:13 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:35949 "EHLO sunset.davemloft.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752242AbZKQMtM (ORCPT ); Tue, 17 Nov 2009 07:49:12 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id 03D41C8C164; Tue, 17 Nov 2009 04:49:29 -0800 (PST) Date: Tue, 17 Nov 2009 04:49:28 -0800 (PST) Message-Id: <20091117.044928.245588641.davem@davemloft.net> To: Hermann.Lauer@iwr.uni-heidelberg.de Cc: sparclinux@vger.kernel.org Subject: Re: [experimental patch] sungem: force serdes dection on buildin V880 fiber gigabit ethernet From: David Miller In-Reply-To: <20091113124350.GA1926@lemon.iwr.uni-heidelberg.de> References: <20091113124350.GA1926@lemon.iwr.uni-heidelberg.de> X-Mailer: Mew version 6.2.51 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org From: Hermann Lauer 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 --- drivers/net/sungem.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) 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) {