From owner-svn-src-all@FreeBSD.ORG Mon Oct 27 00:23:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B27C41065675; Mon, 27 Oct 2008 00:23:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A02D58FC08; Mon, 27 Oct 2008 00:23:09 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9R0N9kh009468; Mon, 27 Oct 2008 00:23:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9R0N9sc009467; Mon, 27 Oct 2008 00:23:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <200810270023.m9R0N9sc009467@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 27 Oct 2008 00:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184315 - in releng/6.4/sys: . dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 00:23:09 -0000 Author: yongari Date: Mon Oct 27 00:23:09 2008 New Revision: 184315 URL: http://svn.freebsd.org/changeset/base/184315 Log: MFC r183966: Some 88E1149 PHY's page select is initialized to point to other bank instead of copper/fiber bank which in turn resulted in wrong registers were accessed during PHY operation. It is believed that page 0 should be used for copper PHY so reinitialize E1000_EADR to select default copper PHY. This fixes link establishment issue of nfe(4) on Sun Fire X4140. OpenBSD also has similimar patch but they just reset the E1000_EADR register to page 0. However some Marvell PHYs((88E3082, 88E1000) don't have the extended address register and the meaning of the register is quite different for each PHY model. So selecting copper PHY is limited to 88E1149 PHY which seems to be the only one that exhibits link establishment problem. If parent device know the type of PHY(either copper or fiber) that information should be notified to PHY driver but there is no good way to pass this information yet. Reported by: thompsa Reviewed by: thompsa Approved by: re (kensmith) Modified: releng/6.4/sys/ (props changed) releng/6.4/sys/dev/mii/e1000phy.c Modified: releng/6.4/sys/dev/mii/e1000phy.c ============================================================================== --- releng/6.4/sys/dev/mii/e1000phy.c Mon Oct 27 00:09:14 2008 (r184314) +++ releng/6.4/sys/dev/mii/e1000phy.c Mon Oct 27 00:23:09 2008 (r184315) @@ -153,6 +153,20 @@ e1000phy_attach(device_t dev) if (PHY_READ(sc, E1000_ESSR) & E1000_ESSR_FIBER_LINK) sc->mii_flags |= MIIF_HAVEFIBER; break; + case MII_MODEL_MARVELL_E1149: + /* + * Some 88E1149 PHY's page select is initialized to + * point to other bank instead of copper/fiber bank + * which in turn resulted in wrong registers were + * accessed during PHY operation. It is believed that + * page 0 should be used for copper PHY so reinitialize + * E1000_EADR to select default copper PHY. If parent + * device know the type of PHY(either copper or fiber), + * that information should be used to select default + * type of PHY. + */ + PHY_WRITE(sc, E1000_EADR, 0); + break; case MII_MODEL_MARVELL_E3082: /* 88E3082 10/100 Fast Ethernet PHY. */ sc->mii_anegticks = MII_ANEGTICKS;