svn commit: r183966 - head/sys/dev/mii
Pyun YongHyeon
yongari at FreeBSD.org
Fri Oct 17 05:26:52 UTC 2008
Author: yongari
Date: Fri Oct 17 05:26:51 2008
New Revision: 183966
URL: http://svn.freebsd.org/changeset/base/183966
Log:
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
Modified:
head/sys/dev/mii/e1000phy.c
Modified: head/sys/dev/mii/e1000phy.c
==============================================================================
--- head/sys/dev/mii/e1000phy.c Fri Oct 17 03:59:25 2008 (r183965)
+++ head/sys/dev/mii/e1000phy.c Fri Oct 17 05:26:51 2008 (r183966)
@@ -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;
More information about the svn-src-all
mailing list