summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2005-04-23 04:55:45 +0000
committerBrad Smith <brad@cvs.openbsd.org>2005-04-23 04:55:45 +0000
commita91e9a603383eea341667d62f0620a02e119687c (patch)
tree51a3f52aadde0be10653e2b64ebe32112869d054
parent7eba95bc106037646fe98cb3ec27e5d439b261af (diff)
Fix newer Xircom CBE2-100 cards.
We have to enable the connection to the MII first. Doing so fixes the problem cards without breaking the older, working cards. From FreeBSD
-rw-r--r--sys/dev/ic/dc.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/sys/dev/ic/dc.c b/sys/dev/ic/dc.c
index 4c7dfff31b2..519e64972bc 100644
--- a/sys/dev/ic/dc.c
+++ b/sys/dev/ic/dc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dc.c,v 1.81 2005/03/31 15:38:15 brad Exp $ */
+/* $OpenBSD: dc.c,v 1.82 2005/04/23 04:55:44 brad Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -1785,6 +1785,20 @@ hasmac:
sc->dc_pmode = DC_PMODE_MII;
}
+ /*
+ * Setup General Purpose port mode and data so the tulip can talk
+ * to the MII. This needs to be done before mii_attach so that
+ * we can actually see them.
+ */
+ if (DC_IS_XIRCOM(sc)) {
+ CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN |
+ DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
+ DELAY(10);
+ CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_INT1_EN |
+ DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
+ DELAY(10);
+ }
+
sc->sc_mii.mii_ifp = ifp;
sc->sc_mii.mii_readreg = dc_miibus_readreg;
sc->sc_mii.mii_writereg = dc_miibus_writereg;
@@ -1821,19 +1835,6 @@ hasmac:
if (DC_IS_DAVICOM(sc) && sc->dc_revision >= DC_REVISION_DM9102A)
ifmedia_add(&sc->sc_mii.mii_media, IFM_ETHER|IFM_HPNA_1,0,NULL);
- if (DC_IS_XIRCOM(sc)) {
- /*
- * setup General Purpose Port mode and data so the tulip
- * can talk to the MII.
- */
- CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_WRITE_EN | DC_SIAGP_INT1_EN |
- DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
- DELAY(10);
- CSR_WRITE_4(sc, DC_SIAGP, DC_SIAGP_INT1_EN |
- DC_SIAGP_MD_GP2_OUTPUT | DC_SIAGP_MD_GP0_OUTPUT);
- DELAY(10);
- }
-
if (DC_IS_ADMTEK(sc)) {
/*
* Set automatic TX underrun recovery for the ADMtek chips