Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev For Cobalt Networks 21143's, always use store-and-fo...



details:   https://anonhg.NetBSD.org/src/rev/e370bd0bdd50
branches:  trunk
changeset: 484128:e370bd0bdd50
user:      soren <soren%NetBSD.org@localhost>
date:      Sun Mar 26 10:53:39 2000 +0000

description:
For Cobalt Networks 21143's, always use store-and-forward and toggle
a GPIO line to fully reset the PHY.

diffstat:

 sys/dev/ic/tulipreg.h    |   7 +++++--
 sys/dev/pci/if_tlp_pci.c |  26 +++++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 3 deletions(-)

diffs (67 lines):

diff -r 81b5760b6f7c -r e370bd0bdd50 sys/dev/ic/tulipreg.h
--- a/sys/dev/ic/tulipreg.h     Sun Mar 26 10:32:51 2000 +0000
+++ b/sys/dev/ic/tulipreg.h     Sun Mar 26 10:53:39 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulipreg.h,v 1.16 2000/02/02 17:09:48 thorpej Exp $    */
+/*     $NetBSD: tulipreg.h,v 1.17 2000/03/26 10:53:40 soren Exp $      */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -780,7 +780,10 @@
 #define        SIAGEN_LV2              0x00008000      /* LED 2 value (21041) */
 #define        SIAGEN_HCKR             0x00008000      /* hacker (21143) */
 #define        SIAGEN_MD               0x000f0000      /* general purpose mode/data */
-#define        SIAGEN_LGS              0x00f00000      /* LED/GEP select */
+#define        SIAGEN_LGS0             0x00100000      /* LED/GEP 0 select */
+#define        SIAGEN_LGS1             0x00200000      /* LED/GEP 1 select */
+#define        SIAGEN_LGS2             0x00400000      /* LED/GEP 2 select */
+#define        SIAGEN_LGS3             0x00800000      /* LED/GEP 3 select */
 #define        SIAGEN_GEI0             0x01000000      /* GEP pin 0 intr enable */
 #define        SIAGEN_GEI1             0x02000000      /* GEP pin 1 intr enable */
 #define        SIAGEN_RME              0x04000000      /* receive match enable */
diff -r 81b5760b6f7c -r e370bd0bdd50 sys/dev/pci/if_tlp_pci.c
--- a/sys/dev/pci/if_tlp_pci.c  Sun Mar 26 10:32:51 2000 +0000
+++ b/sys/dev/pci/if_tlp_pci.c  Sun Mar 26 10:53:39 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_pci.c,v 1.35 2000/03/23 22:23:03 mycroft Exp $  */
+/*     $NetBSD: if_tlp_pci.c,v 1.36 2000/03/26 10:53:39 soren Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -1081,6 +1081,8 @@
        TULIP_WRITE(sc, CSR_GPP, 0);
 }
 
+void   tlp_pci_cobalt_21142_reset __P((struct tulip_softc *));
+
 void
 tlp_pci_cobalt_21142_quirks(psc, enaddr)
        struct tulip_pci_softc *psc;
@@ -1091,5 +1093,27 @@
        /*
         * Cobalt Networks interfaces are just MII-on-SIO.
         */
+       sc->sc_reset = tlp_pci_cobalt_21142_reset;
        sc->sc_mediasw = &tlp_sio_mii_mediasw;
+
+       /*
+        * The Cobalt systems tend to fall back to store-and-forward
+        * pretty quickly, so we select that from the beginning to
+        * avoid initial timeouts.
+        */
+#define TXTH_SF                4
+       sc->sc_txthresh = TXTH_SF;
 }
+
+void
+tlp_pci_cobalt_21142_reset(sc)
+       struct tulip_softc *sc;
+{
+       /*
+        * Reset PHY.
+        */
+       TULIP_WRITE(sc, CSR_SIAGEN, SIAGEN_CWE | (1 << 16));
+       delay(10);
+       TULIP_WRITE(sc, CSR_SIAGEN, SIAGEN_CWE);
+       delay(10);
+}



Home | Main Index | Thread Index | Old Index