summaryrefslogtreecommitdiffstats
path: root/sys/pci/if_sis.c
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2003-08-19 16:57:00 +0000
committersam <sam@FreeBSD.org>2003-08-19 16:57:00 +0000
commitf8075fb80bc69f6f88970b9a22bf64710b8f5be1 (patch)
treebed693238aa6c23cf5aa392c3da94dba48b859b8 /sys/pci/if_sis.c
parent923b177486d23c3a3252d45a3ac8a413bad664c3 (diff)
downloadFreeBSD-src-f8075fb80bc69f6f88970b9a22bf64710b8f5be1.zip
FreeBSD-src-f8075fb80bc69f6f88970b9a22bf64710b8f5be1.tar.gz
"short cable" fix for DP8315
Derived from: netbsd and tech note at soekris web site MFC after: 1 week
Diffstat (limited to 'sys/pci/if_sis.c')
-rw-r--r--sys/pci/if_sis.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c
index 204e2a5..9f3cf71 100644
--- a/sys/pci/if_sis.c
+++ b/sys/pci/if_sis.c
@@ -2146,6 +2146,29 @@ sis_init(xsc)
SIS_CLRBIT(sc, SIS_RX_CFG, SIS_RXCFG_RX_TXPKTS);
}
+ if (sc->sis_type == SIS_TYPE_83815 &&
+ IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) {
+ uint32_t reg;
+
+ /*
+ * Some DP83815s experience problems when used with short
+ * (< 30m/100ft) Ethernet cables in 100BaseTX mode. This
+ * sequence adjusts the DSP's signal attenuation to fix the
+ * problem.
+ */
+ CSR_WRITE_4(sc, NS_PHY_PAGE, 0x0001);
+
+ reg = CSR_READ_4(sc, NS_PHY_DSPCFG);
+ CSR_WRITE_4(sc, NS_PHY_DSPCFG, (reg & 0xfff) | 0x1000);
+ DELAY(100);
+ reg = CSR_READ_4(sc, NS_PHY_TDATA);
+ if ((reg & 0x0080) == 0 || (reg & 0xff) >= 0xd8) {
+ CSR_WRITE_4(sc, NS_PHY_TDATA, 0x00e8);
+ SIS_SETBIT(sc, NS_PHY_DSPCFG, 0x20);
+ }
+ CSR_WRITE_4(sc, NS_PHY_PAGE, 0);
+ }
+
/*
* Enable interrupts.
*/
OpenPOWER on IntegriCloud