Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Fix register offset problem. This should make EISA b...



details:   https://anonhg.NetBSD.org/src/rev/4edd16faaa7a
branches:  trunk
changeset: 480705:4edd16faaa7a
user:      ad <ad%NetBSD.org@localhost>
date:      Tue Jan 18 16:50:38 2000 +0000

description:
Fix register offset problem. This should make EISA boards work correctly,
and is also needed for the ISA frontend (some time this week).

diffstat:

 sys/dev/ic/dptreg.h   |  21 ++++++++++-----------
 sys/dev/pci/dpt_pci.c |  13 ++++++++++---
 2 files changed, 20 insertions(+), 14 deletions(-)

diffs (95 lines):

diff -r 9f552573c33e -r 4edd16faaa7a sys/dev/ic/dptreg.h
--- a/sys/dev/ic/dptreg.h       Tue Jan 18 16:12:25 2000 +0000
+++ b/sys/dev/ic/dptreg.h       Tue Jan 18 16:50:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dptreg.h,v 1.5 1999/11/29 15:04:23 ad Exp $    */
+/*     $NetBSD: dptreg.h,v 1.6 2000/01/18 16:50:38 ad Exp $    */
 
 /*
  * Copyright (c) 1999 Andy Doran <ad%NetBSD.org@localhost>
@@ -63,16 +63,15 @@
 /*
  * HBA registers
  */
-#define HA_BASE                        0x10
-#define HA_DATA                        (HA_BASE + 0)
-#define HA_ERROR               (HA_BASE + 1)
-#define HA_DMA_BASE            (HA_BASE + 2)
-#define HA_ICMD_CODE2          (HA_BASE + 4)
-#define HA_ICMD_CODE1          (HA_BASE + 5)
-#define HA_ICMD                        (HA_BASE + 6)
+#define HA_DATA                        0
+#define HA_ERROR               1
+#define HA_DMA_BASE            2
+#define HA_ICMD_CODE2          4
+#define HA_ICMD_CODE1          5
+#define HA_ICMD                        6
 
 /* EATA commands. There are many more that we don't define or use. */
-#define HA_COMMAND             (HA_BASE + 7)
+#define HA_COMMAND             7
 #define   CP_PIO_GETCFG                0xf0    /* Read configuration data, PIO */
 #define   CP_PIO_CMD           0xf2    /* Execute command, PIO */
 #define   CP_DMA_GETCFG                0xfd    /* Read configuration data, DMA */
@@ -93,7 +92,7 @@
 #define     CPI_RESET_MSKD_BUS 0x09    /* Reset masked bus */
 #define     CPI_POWEROFF_WARN  0x0a    /* Power about to fail */
 
-#define HA_STATUS              (HA_BASE + 7)
+#define HA_STATUS              7
 #define   HA_ST_ERROR          0x01
 #define   HA_ST_MORE           0x02
 #define   HA_ST_CORRECTD       0x04
@@ -104,7 +103,7 @@
 #define   HA_ST_BUSY           0x80
 #define   HA_ST_DATA_RDY       (HA_ST_SEEK_COMPLETE|HA_ST_READY|HA_ST_DRQ)
 
-#define HA_AUX_STATUS          (HA_BASE + 8)
+#define HA_AUX_STATUS          8
 #define   HA_AUX_BUSY          0x01
 #define   HA_AUX_INTR          0x02
 
diff -r 9f552573c33e -r 4edd16faaa7a sys/dev/pci/dpt_pci.c
--- a/sys/dev/pci/dpt_pci.c     Tue Jan 18 16:12:25 2000 +0000
+++ b/sys/dev/pci/dpt_pci.c     Tue Jan 18 16:50:38 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dpt_pci.c,v 1.3 2000/01/05 16:28:39 ad Exp $   */
+/*     $NetBSD: dpt_pci.c,v 1.4 2000/01/18 16:50:39 ad Exp $   */
 
 /*
  * Copyright (c) 1999 Andy Doran <ad%NetBSD.org@localhost>
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dpt_pci.c,v 1.3 2000/01/05 16:28:39 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dpt_pci.c,v 1.4 2000/01/18 16:50:39 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -89,6 +89,7 @@
        struct dpt_softc *sc;
        pci_chipset_tag_t pc;
        pci_intr_handle_t ih;
+       bus_space_handle_t ioh;
        const char *intrstr;
        pcireg_t csr;
 
@@ -98,10 +99,16 @@
        printf(": ");
 
        if (pci_mapreg_map(pa, PCI_CBIO, PCI_MAPREG_TYPE_IO, 0, &sc->sc_iot, 
-           &sc->sc_ioh, NULL, NULL)) {
+           &ioh, NULL, NULL)) {
                printf("can't map i/o space\n");
                return;
        }
+       
+       /* Need to map in by 16 registers */
+       if (bus_space_subregion(sc->sc_iot, ioh, 16, 16, &sc->sc_ioh)) {
+               printf("can't map i/o subregion\n");
+               return;
+       }
 
        sc->sc_dmat = pa->pa_dmat;
 



Home | Main Index | Thread Index | Old Index