Date: Thu, 4 Oct 2007 10:36:22 +0900 From: Pyun YongHyeon <pyunyh@gmail.com> To: freebsd-current@FreeBSD.org Subject: CFT: msk(4)/nfe(4) with 88E1116 PHY Message-ID: <20071004013622.GD30781@cdnetworks.co.kr>
next in thread | raw e-mail | index | archive | help
--bp/iNruPH9dso1Pn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
There had been several complaints that nfe(4) with 88E1116 PHY
doesn't work. The attached patch may fix it by taking the PHY
out of powerdown mode. Because I know that some revisions works
well without any patch I'd like to know whether attached patch
have any effects for those hardwares that had been working
correctly. I think both msk(4) and nfe(4) would be affacted by
the patch so if you're using one of these hardwares please give
it spin and let me know the result.
Thanks.
--
Regards,
Pyun YongHyeon
--bp/iNruPH9dso1Pn
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="e1000phy.88e1116.patch"
Index: e1000phy.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/mii/e1000phy.c,v
retrieving revision 1.18
diff -u -r1.18 e1000phy.c
--- e1000phy.c 11 Dec 2006 11:09:48 -0000 1.18
+++ e1000phy.c 4 Oct 2007 01:35:56 -0000
@@ -235,6 +235,8 @@
/* Disable energy detect mode. */
reg &= ~E1000_SCR_EN_DETECT_MASK;
reg |= E1000_SCR_AUTO_X_MODE;
+ if (esc->mii_model == MII_MODEL_MARVELL_E1116)
+ reg &= ~E1000_SCR_POWER_DOWN;
break;
case MII_MODEL_MARVELL_E3082:
reg |= (E1000_SCR_AUTO_X_MODE >> 1);
@@ -248,6 +250,14 @@
/* Auto correction for reversed cable polarity. */
reg &= ~E1000_SCR_POLARITY_REVERSAL;
PHY_WRITE(sc, E1000_SCR, reg);
+
+ if (esc->mii_model == MII_MODEL_MARVELL_E1116) {
+ PHY_WRITE(sc, E1000_EADR, 2);
+ reg = PHY_READ(sc, E1000_SCR);
+ reg |= E1000_SCR_RGMII_POWER_UP;
+ PHY_WRITE(sc, E1000_SCR, reg);
+ PHY_WRITE(sc, E1000_EADR, 0);
+ }
}
switch (MII_MODEL(esc->mii_model)) {
Index: e1000phyreg.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/mii/e1000phyreg.h,v
retrieving revision 1.4
diff -u -r1.4 e1000phyreg.h
--- e1000phyreg.h 11 Dec 2006 10:43:32 -0000 1.4
+++ e1000phyreg.h 4 Oct 2007 01:35:56 -0000
@@ -244,6 +244,11 @@
#define E1000_SCR_MODE_COPPER 0x0280
#define E1000_SCR_MODE_1000BX 0x0380
+/* 88E1116 page 0 */
+#define E1000_SCR_POWER_DOWN 0x0004
+/* 88E1116 page 2 */
+#define E1000_SCR_RGMII_POWER_UP 0x0008
+
#define E1000_SSR 0x11 /* special status register */
#define E1000_SSR_JABBER 0x0001
#define E1000_SSR_REV_POLARITY 0x0002
--bp/iNruPH9dso1Pn--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071004013622.GD30781>
