Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev Pulling up



details:   https://anonhg.NetBSD.org/src/rev/40f87d90aa0a
branches:  netbsd-1-5
changeset: 488995:40f87d90aa0a
user:      castor <castor%NetBSD.org@localhost>
date:      Wed Aug 09 14:39:02 2000 +0000

description:
Pulling up
        ic/tulipvar.h diffs between 1.36 and 1.37
        ic/tulipreg.h diffs between 1.21 and 1.20
        ic/ tulip.c  diffs between 1.70 and 1.71
        pci/if_tlp_pci.c diffs between 1.43 and 1.46

requested by tls and thorpej, approved by thorpej

>       date: 2000/08/03 03:07:31;  author: castor;  state: Exp;
        lines: +5 -1 Support some differences in the Macronix
        98715AEC-C and E chips from the other 98715* series.

        The MX98715AEC-[C,E] use a different location in the serial eerom for
        LED control, and programming it with the original location's values
        caused unpredictable behavior.

        Also, start integrating fixes where media changes on an adapter
        under load may fail.  There's more work to be done here, but I need
        to sort out our internal changes a little more carefully.

diffstat:

 sys/dev/ic/tulip.c       |  20 ++++++++++++++++++--
 sys/dev/ic/tulipreg.h    |  13 +++++++++++--
 sys/dev/ic/tulipvar.h    |  22 +++++++++++++---------
 sys/dev/pci/if_tlp_pci.c |  14 +++++++++++---
 4 files changed, 53 insertions(+), 16 deletions(-)

diffs (245 lines):

diff -r 6c70eef704aa -r 40f87d90aa0a sys/dev/ic/tulip.c
--- a/sys/dev/ic/tulip.c        Wed Aug 09 14:32:44 2000 +0000
+++ b/sys/dev/ic/tulip.c        Wed Aug 09 14:39:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulip.c,v 1.68.4.1 2000/07/04 04:22:05 thorpej Exp $   */
+/*     $NetBSD: tulip.c,v 1.68.4.2 2000/08/09 14:39:02 castor Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -313,6 +313,7 @@
        case TULIP_CHIP_MX98713A:       /* 21143-like */
        case TULIP_CHIP_MX98715:        /* 21143-like */
        case TULIP_CHIP_MX98715A:       /* 21143-like */
+       case TULIP_CHIP_MX98715AEC_X:   /* 21143-like */
        case TULIP_CHIP_MX98725:        /* 21143-like */
                /*
                 * Run these chips in ring mode.
@@ -1759,6 +1760,7 @@
        case TULIP_CHIP_MX98713A:
        case TULIP_CHIP_MX98715:
        case TULIP_CHIP_MX98715A:
+       case TULIP_CHIP_MX98715AEC_X:
        case TULIP_CHIP_MX98725:
                TULIP_WRITE(sc, CSR_PMAC_TOR, PMAC_TOR_98715);
                break;
@@ -2035,6 +2037,7 @@
        TULIP_WRITE(sc, CSR_INTEN, 0);
 
        /* Stop the transmit and receive processes. */
+       sc->sc_opmode = 0;
        TULIP_WRITE(sc, CSR_OPMODE, 0);
        TULIP_WRITE(sc, CSR_RXLIST, 0);
        TULIP_WRITE(sc, CSR_TXLIST, 0);
@@ -3021,6 +3024,8 @@
 {
        struct tulip_softc *sc = ifp->if_softc;
 
+       if ((ifp->if_flags & IFF_UP) == 0)
+               return (0);
        return ((*sc->sc_mediasw->tmsw_set)(sc));
 }
 
@@ -3568,6 +3573,15 @@
                 */
                TULIP_WRITE(sc, CSR_MIIROM, sc->sc_srom[0x77] << 24);
                break;
+       case TULIP_CHIP_MX98715AEC_X:
+               /*
+                * Set the LED operating mode.  This information is located
+                * in the EEPROM at byte offset 0x76, per the MX98715AEC
+                * application note.
+                */
+               TULIP_WRITE(sc, CSR_MIIROM, ((0xf & sc->sc_srom[0x76]) << 28)
+                   | ((0xf0 & sc->sc_srom[0x76]) << 20));
+               break;
 
        default:
                /* Nothing. */
@@ -3804,6 +3818,7 @@
        case TULIP_CHIP_82C115:
        case TULIP_CHIP_MX98715:
        case TULIP_CHIP_MX98715A:
+       case TULIP_CHIP_MX98715AEC_X:
        case TULIP_CHIP_MX98725:
                tm->tm_sia = tsti->tsti_21142;  /* struct assignment */
                break;
@@ -4023,6 +4038,7 @@
        case TULIP_CHIP_MX98713A:
        case TULIP_CHIP_MX98715:
        case TULIP_CHIP_MX98715A:
+       case TULIP_CHIP_MX98715AEC_X:
        case TULIP_CHIP_MX98725:
                siaconn = PMAC_SIACONN_MASK;
                siatxrx = PMAC_SIATXRX_MASK;
@@ -5440,7 +5456,7 @@
  *     MX98713A                        21143-like MII or SIA/SYM media.
  *
  *     MX98715, MX98715A, MX98725,     21143-like SIA/SYM media.
- *     82C115
+ *     82C115, MX98715AEC-C, -E
  *
  * So, what we do here is fake MII-on-SIO or ISV media info, and
  * use the ISV media switch get/set functions to handle the rest.
diff -r 6c70eef704aa -r 40f87d90aa0a sys/dev/ic/tulipreg.h
--- a/sys/dev/ic/tulipreg.h     Wed Aug 09 14:32:44 2000 +0000
+++ b/sys/dev/ic/tulipreg.h     Wed Aug 09 14:39:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulipreg.h,v 1.20 2000/05/25 22:50:11 thorpej Exp $    */
+/*     $NetBSD: tulipreg.h,v 1.20.4.1 2000/08/09 14:39:07 castor Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -55,6 +55,9 @@
  *       have only GPR media and the NWay block.  The 98715,
  *       98715A, and 98725 support power management.
  *
+ *        The 98715AEC adds 802.3x flow Frame based Flow Control to the
+ *       98715A.
+ *
  *     - Lite-On 82C115 (PNIC II):
  *
  *       A clone of the Macronix MX98725, with the following differences:
@@ -746,6 +749,7 @@
                                                   (21041) */
 #define        SIASTAT_ANS_DIS         0x00000000      /*     disabled */
 #define        SIASTAT_ANS_TXDIS       0x00001000      /*     transmit disabled */
+#define        SIASTAT_ANS_START       0x00001000      /*     (MX98715AEC) */
 #define        SIASTAT_ANS_ABD         0x00002000      /*     ability detect */
 #define        SIASTAT_ANS_ACKD        0x00003000      /*     acknowledge detect */
 #define        SIASTAT_ANS_ACKC        0x00004000      /*     complete acknowledge */
@@ -1059,7 +1063,7 @@
 
 
 /*
- * Macronix 98713, 98713A, 98715, 98715A, 98725 and
+ * Macronix 98713, 98713A, 98715, 98715A, 98715AEC, 98725 and
  * Lite-On 82C115 registers.
  */
 
@@ -1119,7 +1123,12 @@
         * this does not appear to be necessary.  This is probably
         * one of the things that frobbing the Test Operation Register
         * does.
+        *
+        * MX98715AEC uses this register for Auto Compensation.
+        * CSR20<14> and CSR20<9> are called DS130 and DS120
         */
+#define        PMAC_NWAYSTAT_DS120     0x00000200      /* Auto-compensation circ */
+#define        PMAC_NWAYSTAT_DS130     0x00004000      /* Auto-compensation circ */
 #define        PMAC_NWAYSTAT_EQTEST    0x00001000      /* EQ test */
 #define        PMAC_NWAYSTAT_PCITEST   0x00010000      /* PCI test */
 #define        PMAC_NWAYSTAT_10TXH     0x08000000      /* 10t accepted */
diff -r 6c70eef704aa -r 40f87d90aa0a sys/dev/ic/tulipvar.h
--- a/sys/dev/ic/tulipvar.h     Wed Aug 09 14:32:44 2000 +0000
+++ b/sys/dev/ic/tulipvar.h     Wed Aug 09 14:39:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tulipvar.h,v 1.36 2000/05/26 16:38:14 thorpej Exp $    */
+/*     $NetBSD: tulipvar.h,v 1.36.4.1 2000/08/09 14:39:05 castor Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -137,14 +137,15 @@
        TULIP_CHIP_MX98713A  = 12,      /* Macronix 98713A PMAC */
        TULIP_CHIP_MX98715   = 13,      /* Macronix 98715 PMAC */
        TULIP_CHIP_MX98715A  = 14,      /* Macronix 98715A PMAC */
-       TULIP_CHIP_MX98725   = 15,      /* Macronix 98725 PMAC */
-       TULIP_CHIP_WB89C840F = 16,      /* Winbond 89C840F */
-       TULIP_CHIP_DM9102    = 17,      /* Davicom DM9102 */
-       TULIP_CHIP_DM9102A   = 18,      /* Davicom DM9102A */
-       TULIP_CHIP_AL981     = 19,      /* ADMtek AL981 */
-       TULIP_CHIP_AX88140   = 20,      /* ASIX AX88140 */
-       TULIP_CHIP_AX88141   = 21,      /* ASIX AX88141 */
-       TULIP_CHIP_X3201_3   = 22,      /* Xircom X3201-3 */
+       TULIP_CHIP_MX98715AEC_X = 15,   /* Macronix 98715AEC-C, -E PMAC */
+       TULIP_CHIP_MX98725   = 16,      /* Macronix 98725 PMAC */
+       TULIP_CHIP_WB89C840F = 17,      /* Winbond 89C840F */
+       TULIP_CHIP_DM9102    = 18,      /* Davicom DM9102 */
+       TULIP_CHIP_DM9102A   = 19,      /* Davicom DM9102A */
+       TULIP_CHIP_AL981     = 20,      /* ADMtek AL981 */
+       TULIP_CHIP_AX88140   = 21,      /* ASIX AX88140 */
+       TULIP_CHIP_AX88141   = 22,      /* ASIX AX88141 */
+       TULIP_CHIP_X3201_3   = 23,      /* Xircom X3201-3 */
 } tulip_chip_t;
 
 #define        TULIP_CHIP_NAMES                                                \
@@ -164,6 +165,7 @@
        "Macronix MX98713A",                                            \
        "Macronix MX98715",                                             \
        "Macronix MX98715A",                                            \
+       "Macronix MX98715AEC-x",                                        \
        "Macronix MX98725",                                             \
        "Winbond 89C840F",                                              \
        "Davicom DM9102",                                               \
@@ -318,6 +320,7 @@
        u_long          ts_tx_lc;       /* late collision count */
 };
 
+#ifndef _STANDALONE
 /*
  * Software state per device.
  */
@@ -437,6 +440,7 @@
 
        int     sc_rxptr;               /* next ready RX descriptor/descsoft */
 };
+#endif
 
 /* sc_flags */
 #define        TULIPF_WANT_SETUP       0x00000001      /* want filter setup */
diff -r 6c70eef704aa -r 40f87d90aa0a sys/dev/pci/if_tlp_pci.c
--- a/sys/dev/pci/if_tlp_pci.c  Wed Aug 09 14:32:44 2000 +0000
+++ b/sys/dev/pci/if_tlp_pci.c  Wed Aug 09 14:39:02 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tlp_pci.c,v 1.39.2.4 2000/07/16 20:29:08 tron Exp $ */
+/*     $NetBSD: if_tlp_pci.c,v 1.39.2.5 2000/08/09 14:39:15 castor Exp $       */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -406,6 +406,8 @@
        case TULIP_CHIP_MX98715:
                if (sc->sc_rev >= 0x20)
                        sc->sc_chip = TULIP_CHIP_MX98715A;
+               if (sc->sc_rev >= 0x25)
+                       sc->sc_chip = TULIP_CHIP_MX98715AEC_X;
                if (sc->sc_rev >= 0x30)
                        sc->sc_chip = TULIP_CHIP_MX98725;
                break;
@@ -465,6 +467,7 @@
        case TULIP_CHIP_MX98713A:
        case TULIP_CHIP_MX98715:
        case TULIP_CHIP_MX98715A:
+       case TULIP_CHIP_MX98715AEC_X:
        case TULIP_CHIP_MX98725:
        case TULIP_CHIP_DM9102:
        case TULIP_CHIP_DM9102A:
@@ -488,7 +491,9 @@
                case PCI_PMCSR_STATE_D2:
                        printf(": waking up from power state D%d\n%s",
                            reg & PCI_PMCSR_STATE_MASK, sc->sc_dev.dv_xname);
-                       pci_conf_write(pc, pa->pa_tag, pmreg + 4, 0);
+                       pci_conf_write(pc, pa->pa_tag, pmreg + 4,
+                           (reg & ~PCI_PMCSR_STATE_MASK) |
+                           PCI_PMCSR_STATE_D0);
                        break;
                case PCI_PMCSR_STATE_D3:
                        /*
@@ -497,7 +502,9 @@
                         */
                        printf(": unable to wake up from power state D3, "
                               "reboot required.\n");
-                       pci_conf_write(pc, pa->pa_tag, pmreg + 4, 0);
+                       pci_conf_write(pc, pa->pa_tag, pmreg + 4,
+                           (reg & ~PCI_PMCSR_STATE_MASK) |
+                           PCI_PMCSR_STATE_D0);
                        return;
                }
        }
@@ -780,6 +787,7 @@
 
        case TULIP_CHIP_MX98713A:
        case TULIP_CHIP_MX98715A:
+       case TULIP_CHIP_MX98715AEC_X:
        case TULIP_CHIP_MX98725:
                /*
                 * The MX98713A has an MII as well as an internal Nway block,



Home | Main Index | Thread Index | Old Index