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/vme Pullup rev. 1.28.



details:   https://anonhg.NetBSD.org/src/rev/f94b8ebc9705
branches:  netbsd-1-5
changeset: 488662:f94b8ebc9705
user:      pk <pk%NetBSD.org@localhost>
date:      Sat Jul 22 21:03:56 2000 +0000

description:
Pullup rev. 1.28.

Use vme_dmamap_create().
Also, this device lives in VME_D16 data space.

diffstat:

 sys/dev/vme/xy.c |  54 +++++++++++++++++++++++++++++++++---------------------
 1 files changed, 33 insertions(+), 21 deletions(-)

diffs (134 lines):

diff -r 43d60a48f5f9 -r f94b8ebc9705 sys/dev/vme/xy.c
--- a/sys/dev/vme/xy.c  Sat Jul 22 21:03:22 2000 +0000
+++ b/sys/dev/vme/xy.c  Sat Jul 22 21:03:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xy.c,v 1.25 2000/06/05 15:58:43 chs Exp $      */
+/*     $NetBSD: xy.c,v 1.25.2.1 2000/07/22 21:03:56 pk Exp $   */
 
 /*
  *
@@ -83,6 +83,7 @@
 #include <dev/sun/disklabel.h>
 #endif
 
+#include <dev/vme/vmereg.h>
 #include <dev/vme/vmevar.h>
 
 #include <dev/vme/xyreg.h>
@@ -373,12 +374,12 @@
        vme_am_t                mod;
        int error;
 
-       mod = 0x2d; /* VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA */
-       if (vme_space_alloc(va->va_vct, va->r[0].offset, sizeof(struct xyc),
-                           mod))
+       mod = VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA;
+       if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xyc), mod))
                return (0);
+
        error = vme_probe(ct, va->r[0].offset, sizeof(struct xyc),
-                         mod, VME_D32, xyc_probe, 0);
+                         mod, VME_D16, xyc_probe, 0);
        vme_space_free(va->va_vct, va->r[0].offset, sizeof(struct xyc), mod);
 
        return (error == 0);
@@ -393,13 +394,13 @@
        void   *aux;
 
 {
+       struct xyc_softc        *xyc = (void *) self;
        struct vme_attach_args  *va = aux;
        vme_chipset_tag_t       ct = va->va_vct;
        bus_space_tag_t         bt;
        bus_space_handle_t      bh;
        vme_intr_handle_t       ih;
        vme_am_t                mod;
-       struct xyc_softc        *xyc = (void *) self;
        struct xyc_attach_args  xa;
        int                     lcv, res, error;
        bus_dma_segment_t       seg;
@@ -409,13 +410,13 @@
        /* get addressing and intr level stuff from autoconfig and load it
         * into our xyc_softc. */
 
-       mod = 0x2d; /* VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA */
+       mod = VME_AM_A16 | VME_AM_MBO | VME_AM_SUPER | VME_AM_DATA;
 
-       if (vme_space_alloc(va->va_vct, va->r[0].offset, sizeof(struct xyc),
-                           mod))
+       if (vme_space_alloc(ct, va->r[0].offset, sizeof(struct xyc), mod))
                panic("xyc: vme alloc");
+
        if (vme_space_map(ct, va->r[0].offset, sizeof(struct xyc),
-                         mod, VME_D32, 0, &bt, &bh, &resc) != 0)
+                         mod, VME_D16, 0, &bt, &bh, &resc) != 0)
                panic("xyc: vme_map");
 
        xyc->xyc = (struct xyc *) bh; /* XXX */
@@ -433,28 +434,36 @@
         */
 
        /* Get DMA handle for misc. transfers */
-       if ((error = bus_dmamap_create(
-                               xyc->dmatag,
-                               MAXPHYS,
+       if ((error = vme_dmamap_create(
+                               ct,             /* VME chip tag */
+                               MAXPHYS,        /* size */
+                               VME_AM_A24,     /* address modifier */
+                               VME_D16,        /* data size */
+                               0,              /* swap */
                                1,              /* nsegments */
-                               MAXPHYS,
+                               MAXPHYS,        /* maxsegsz */
                                0,              /* boundary */
                                BUS_DMA_NOWAIT,
-                               &xyc->auxmap)) != 0) {
+                               &xyc->reqs[lcv].dmamap)) != 0) {
+
                printf("%s: DMA buffer map create error %d\n",
                        xyc->sc_dev.dv_xname, error);
                return;
        }
 
        /* Get DMA handle for mapping iorq descriptors */
-       if ((error = bus_dmamap_create(
-                               xyc->dmatag,
+       if ((error = vme_dmamap_create(
+                               ct,             /* VME chip tag */
                                XYC_MAXIOPB * sizeof(struct xy_iopb),
+                               VME_AM_A24,     /* address modifier */
+                               VME_D16,        /* data size */
+                               0,              /* swap */
                                1,              /* nsegments */
                                XYC_MAXIOPB * sizeof(struct xy_iopb),
                                64*1024,        /* boundary */
                                BUS_DMA_NOWAIT,
                                &xyc->iopmap)) != 0) {
+
                printf("%s: DMA buffer map create error %d\n",
                        xyc->sc_dev.dv_xname, error);
                return;
@@ -494,15 +503,18 @@
                xyc->iopbase[lcv].relo = 1;     /* always the same */
                xyc->iopbase[lcv].thro = XY_THRO;/* always the same */
 
-               error = bus_dmamap_create(
-                               xyc->dmatag,
+               if ((error = vme_dmamap_create(
+                               ct,             /* VME chip tag */
                                MAXPHYS,        /* size */
+                               VME_AM_A24,     /* address modifier */
+                               VME_D16,        /* data size */
+                               0,              /* swap */
                                1,              /* nsegments */
                                MAXPHYS,        /* maxsegsz */
                                0,              /* boundary */
                                BUS_DMA_NOWAIT,
-                               &xyc->reqs[lcv].dmamap);
-               if (error) {
+                               &xyc->reqs[lcv].dmamap)) != 0) {
+
                        printf("%s: DMA buffer map create error %d\n",
                                xyc->sc_dev.dv_xname, error);
                        return;



Home | Main Index | Thread Index | Old Index