Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/podulebus Update for new wdc.c with indirect registe...



details:   https://anonhg.NetBSD.org/src/rev/f9c59fe296c2
branches:  trunk
changeset: 555818:f9c59fe296c2
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Sat Nov 29 20:30:27 2003 +0000

description:
Update for new wdc.c with indirect register mapping.

diffstat:

 sys/dev/podulebus/dtide.c |  29 +++++++++++++++++------------
 sys/dev/podulebus/hcide.c |  29 +++++++++++++++++------------
 2 files changed, 34 insertions(+), 24 deletions(-)

diffs (136 lines):

diff -r ca7b821dbd26 -r f9c59fe296c2 sys/dev/podulebus/dtide.c
--- a/sys/dev/podulebus/dtide.c Sat Nov 29 19:33:34 2003 +0000
+++ b/sys/dev/podulebus/dtide.c Sat Nov 29 20:30:27 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dtide.c,v 1.11 2003/10/08 10:58:13 bouyer Exp $ */
+/* $NetBSD: dtide.c,v 1.12 2003/11/29 20:30:27 bjh21 Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 Ben Harris
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dtide.c,v 1.11 2003/10/08 10:58:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dtide.c,v 1.12 2003/11/29 20:30:27 bjh21 Exp $");
 
 #include <sys/param.h>
 
@@ -45,6 +45,7 @@
 #include <dev/podulebus/podules.h>
 #include <dev/podulebus/dtidereg.h>
 
+#include <dev/ic/wdcreg.h>
 #include <dev/ata/atavar.h>
 #include <dev/ic/wdcvar.h>
 
@@ -79,7 +80,8 @@
 {
        struct podulebus_attach_args *pa = aux;
        struct dtide_softc *sc = (void *)self;
-       int i;
+       struct channel_softc *ch;
+       int i, j;
        bus_space_tag_t bst;
 
        sc->sc_wdc.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_NOIRQ;
@@ -94,19 +96,22 @@
        podulebus_shift_tag(pa->pa_fast_t, DTIDE_REGSHIFT, &bst);
        printf("\n");
        for (i = 0; i < DTIDE_NCHANNELS; i++) {
-               sc->sc_chp[i] = &sc->sc_chan[i];
-               sc->sc_chan[i].channel = i;
-               sc->sc_chan[i].wdc = &sc->sc_wdc;
-               sc->sc_chan[i].cmd_iot = bst;
-               sc->sc_chan[i].ctl_iot = bst;
-               sc->sc_chan[i].ch_queue = &sc->sc_chq[i];
+               ch = sc->sc_chp[i] = &sc->sc_chan[i];
+               ch->channel = i;
+               ch->wdc = &sc->sc_wdc;
+               ch->cmd_iot = bst;
+               ch->ctl_iot = bst;
+               ch->ch_queue = &sc->sc_chq[i];
                bus_space_map(pa->pa_fast_t,
                    pa->pa_fast_base + dtide_cmdoffsets[i], 0, 8,
-                   &sc->sc_chan[i].cmd_ioh);
+                   &ch->cmd_baseioh);
+               for (j = 0; j < WDC_NREG; j++)
+                       bus_space_subregion(ch->cmd_iot, ch->cmd_baseioh,
+                           j, j == 0 ? 4 : 1, &ch->cmd_iohs[j]);
                bus_space_map(pa->pa_fast_t,
                    pa->pa_fast_base + dtide_ctloffsets[i], 0, 8,
-                   &sc->sc_chan[i].ctl_ioh);
-               wdcattach(&sc->sc_chan[i]);
+                   &ch->ctl_ioh);
+               wdcattach(ch);
        }
 
 }
diff -r ca7b821dbd26 -r f9c59fe296c2 sys/dev/podulebus/hcide.c
--- a/sys/dev/podulebus/hcide.c Sat Nov 29 19:33:34 2003 +0000
+++ b/sys/dev/podulebus/hcide.c Sat Nov 29 20:30:27 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hcide.c,v 1.8 2003/10/08 10:58:13 bouyer Exp $ */
+/*     $NetBSD: hcide.c,v 1.9 2003/11/29 20:30:27 bjh21 Exp $  */
 
 /*-
  * Copyright (c) 2000, 2001 Ben Harris
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hcide.c,v 1.8 2003/10/08 10:58:13 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hcide.c,v 1.9 2003/11/29 20:30:27 bjh21 Exp $");
 
 #include <sys/param.h>
 
@@ -45,6 +45,7 @@
 #include <dev/podulebus/hcidereg.h>
 
 #include <dev/ata/atavar.h>
+#include <dev/ic/wdcreg.h>
 #include <dev/ic/wdcvar.h>
 
 struct hcide_softc {
@@ -79,7 +80,8 @@
 {
        struct hcide_softc *sc = (void *)self;
        struct podulebus_attach_args *pa = aux;
-       int i;
+       struct channel_softc *ch;
+       int i, j;
 
        sc->sc_wdc.cap = WDC_CAPABILITY_DATA16 | WDC_CAPABILITY_NOIRQ;
        sc->sc_wdc.PIO_cap = 0; /* XXX correct? */
@@ -89,19 +91,22 @@
        sc->sc_wdc.channels = sc->sc_chp;
        printf("\n");
        for (i = 0; i < HCIDE_NCHANNELS; i++) {
-               sc->sc_chp[i] = &sc->sc_chan[i];
-               sc->sc_chan[i].channel = i;
-               sc->sc_chan[i].wdc = &sc->sc_wdc;
-               sc->sc_chan[i].cmd_iot = pa->pa_mod_t;
-               sc->sc_chan[i].ctl_iot = pa->pa_mod_t;
-               sc->sc_chan[i].ch_queue = &sc->sc_chq[i];
+               ch = sc->sc_chp[i] = &sc->sc_chan[i];
+               ch->channel = i;
+               ch->wdc = &sc->sc_wdc;
+               ch->cmd_iot = pa->pa_mod_t;
+               ch->ctl_iot = pa->pa_mod_t;
+               ch->ch_queue = &sc->sc_chq[i];
                bus_space_map(pa->pa_fast_t,
                    pa->pa_fast_base + hcide_cmdoffsets[i], 0, 8,
-                   &sc->sc_chan[i].cmd_ioh);
+                   &ch->cmd_baseioh);
+               for (j = 0; j < WDC_NREG; j++)
+                       bus_space_subregion(ch->cmd_iot, ch->cmd_baseioh,
+                           j, j == 0 ? 4 : 1, &ch->cmd_iohs[j]);
                bus_space_map(pa->pa_fast_t,
                    pa->pa_fast_base + hcide_ctloffsets[i], 0, 8,
-                   &sc->sc_chan[i].ctl_ioh);
-               wdcattach(&sc->sc_chan[i]);
+                   &ch->ctl_ioh);
+               wdcattach(ch);
        }
 
 }



Home | Main Index | Thread Index | Old Index