Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Identify correctly ITE Super I/O chipsets by chec...



details:   https://anonhg.NetBSD.org/src/rev/9308990b0ee3
branches:  trunk
changeset: 580544:9308990b0ee3
user:      xtraeme <xtraeme%NetBSD.org@localhost>
date:      Fri Apr 29 02:02:52 2005 +0000

description:
Identify correctly ITE Super I/O chipsets by checking the core ID
register (only available in the model 8712F), if that fails we check
the vendor ID register as before.

diffstat:

 sys/dev/ic/nslm7x.c    |  27 ++++++++++++++++++---------
 sys/dev/ic/nslm7xvar.h |  10 ++++++----
 2 files changed, 24 insertions(+), 13 deletions(-)

diffs (87 lines):

diff -r fedaaf0a8792 -r 9308990b0ee3 sys/dev/ic/nslm7x.c
--- a/sys/dev/ic/nslm7x.c       Thu Apr 28 20:27:30 2005 +0000
+++ b/sys/dev/ic/nslm7x.c       Fri Apr 29 02:02:52 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nslm7x.c,v 1.21 2005/02/27 00:27:02 perry Exp $ */
+/*     $NetBSD: nslm7x.c,v 1.22 2005/04/29 02:02:52 xtraeme Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.21 2005/02/27 00:27:02 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nslm7x.c,v 1.22 2005/04/29 02:02:52 xtraeme Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -427,7 +427,8 @@
 itec_match(sc)
        struct lm_softc *sc;
 {
-       int vendor;
+       int vendor, coreid;
+
        /* do the same thing as in  lm_probe() */
        if ((*sc->lm_readreg)(sc, ITEC_RES48) != ITEC_RES48_DEFAULT)
                return 0;
@@ -435,13 +436,21 @@
        if ((*sc->lm_readreg)(sc, ITEC_RES52) != ITEC_RES52_DEFAULT)
                return 0;
 
-       vendor=(*sc->lm_readreg)(sc, ITEC_VENDID);
+       /* We check for the core ID register (0x5B), which is available
+        * only in the 8712F, if that fails, we check the vendor ID
+        * register, available on 8705F and 8712F */
+
+       coreid = (*sc->lm_readreg)(sc, ITEC_COREID);
 
-       if (vendor == ITEC_VENDID_ITE)
-               printf(": iTE IT8705f\n");
-       else
-               printf(": unknown IT8705f compatible, vendorid 0x%02x\n",
-                   vendor);
+       if (coreid == ITEC_COREID_ITE)
+               printf(": ITE8712F\n");
+       else {
+               vendor = (*sc->lm_readreg)(sc, ITEC_VENDID);
+               if (vendor == ITEC_VENDID_ITE)
+                       printf(": ITE8705F\n");
+               else
+                       printf(": unknown ITE87%02x compatible\n", vendor);
+       }
 
        /*
         * XXX this is a litle bit lame...
diff -r fedaaf0a8792 -r 9308990b0ee3 sys/dev/ic/nslm7xvar.h
--- a/sys/dev/ic/nslm7xvar.h    Thu Apr 28 20:27:30 2005 +0000
+++ b/sys/dev/ic/nslm7xvar.h    Fri Apr 29 02:02:52 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nslm7xvar.h,v 1.14 2005/02/27 00:27:02 perry Exp $ */
+/*     $NetBSD: nslm7xvar.h,v 1.15 2005/04/29 02:02:52 xtraeme Exp $ */
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -138,16 +138,18 @@
 #define ITEC_TEMP3     0x31    /* TMPIN1 temperature */
 #define ITEC_RES48     0x48    /* reserved, used for probing the chip */
 #define ITEC_RES52     0x52    /* reserved, used for probing the chip */
-#define ITEC_VENDID    0x58    /* vendor ID register */
+#define        ITEC_VENDID     0x58    /* vendor ID register */
+#define ITEC_COREID    0x5b    /* core ID register, only 8712F */
 
 /*
  * misc values
  */
-#define ITEC_VENDID_ITE        0x90    /* iTE vendor ID */
+#define ITEC_VENDID_ITE                0x90    /* iTE vendor ID */
+#define ITEC_COREID_ITE                0x12    /* iTE core ID */
 #define ITEC_RES48_DEFAULT     0x2d
 #define ITEC_RES52_DEFAULT     0x7f
 #define ITEC_NUM_SENSORS       15
-#define ITEC_VREF      4096            /* VREF in mV */
+#define ITEC_VREF              4096    /* VREF in mV */
 
 
 struct lm_softc {



Home | Main Index | Thread Index | Old Index