Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

if_sis(DP83815) short cable patch

From: Willem Dijkstra <wpd(at)xs4all.nl>
Date: Thu Feb 27 2003 - 02:09:16 EST


Hi All,

I ported the NatSemi patch for the short cable problem in some DP83815's to OpenBSD. Most of the registers that are written to are reported to be "reserved", so it would be nice if people experiencing this problem could try this out.

(The DP83815 is used on the Soekris boards).

Cheers,

Willem

diff -ruN orig/dev/pci/if_sis.c sys/dev/pci/if_sis.c

--- orig/dev/pci/if_sis.c	Fri Jan  3 05:14:43 2003
+++ sys/dev/pci/if_sis.c	Fri Jan  3 04:58:39 2003
@@ -1445,6 +1445,7 @@
 	struct ifnet		*ifp = &sc->arpcom.ac_if;
 	struct mii_data		*mii;
 	int			s;

+ int tmp;
s = splnet(); @@ -1588,6 +1589,32 @@ CSR_WRITE_4(sc, NS_PHY_TDATA, 0x0000); CSR_WRITE_4(sc, NS_PHY_DSPCFG, 0x5040); CSR_WRITE_4(sc, NS_PHY_SDCFG, 0x008C);
+
+ /*
+ * A small number of DP83815's will have excessive receive
+ * errors when using short cables (<30m/100feet) in 100Base-TX
+ * mode. This patch was taken from the National Semiconductor
+ * linux driver and (supposedly - no mention of this in any NS
+ * docs) modifies the dsp's signal attenuation.
+ */
+ if (IFM_SUBTYPE(mii->mii_media_active) != IFM_10_T) {
+ CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001);
+ tmp = CSR_READ_4(sc, NS_PHY_DSPCFG);
+ tmp &= 0xFFF;
+ CSR_WRITE_4(sc, NS_PHY_DSPCFG, (tmp | 0x1000));
+ DELAY(100);
+ tmp = CSR_READ_4(sc, NS_PHY_TDATA);
+ tmp &= 0xFF;
+ if (!(tmp & 0x80) || (tmp >= 0xD8)) {
+ printf("sis%d: short cable detected - changing dsp attenuation",
+ sc->unit);
+ CSR_WRITE_4(sc, NS_PHY_TDATA, 0xE8);
+ tmp = CSR_READ_4(sc, DP_PHY_DSPCFG);
+ CSR_WRITE_4(sc, NS_PHY_DSPCFG, (tmp | 0x20));
+ } else {
+ CSR_WRITE_4(sc, NS_PHY_PAGE, 0);
+ }
+ }
} ifp->if_flags |= IFF_RUNNING;
Received on Thu Feb 27 02:14:54 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:48:30 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library