Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/amiga/dev adapt to the new world of wdc register ma...



details:   https://anonhg.NetBSD.org/src/rev/4742f3c39290
branches:  trunk
changeset: 556117:4742f3c39290
user:      is <is%NetBSD.org@localhost>
date:      Sun Dec 07 20:05:03 2003 +0000

description:
adapt to the new world of wdc register mappings

diffstat:

 sys/arch/amiga/dev/wdc_amiga.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (51 lines):

diff -r 2e3882ddec1f -r 4742f3c39290 sys/arch/amiga/dev/wdc_amiga.c
--- a/sys/arch/amiga/dev/wdc_amiga.c    Sun Dec 07 20:03:47 2003 +0000
+++ b/sys/arch/amiga/dev/wdc_amiga.c    Sun Dec 07 20:05:03 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdc_amiga.c,v 1.13 2003/10/08 11:04:32 bouyer Exp $ */
+/*     $NetBSD: wdc_amiga.c,v 1.14 2003/12/07 20:05:03 is Exp $ */
 
 /*-
  * Copyright (c) 2000, 2003 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.13 2003/10/08 11:04:32 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_amiga.c,v 1.14 2003/12/07 20:05:03 is Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -89,6 +89,7 @@
 wdc_amiga_attach(struct device *parent, struct device *self, void *aux)
 {
        struct wdc_amiga_softc *sc = (void *)self;
+       int i;
 
        printf("\n");
 
@@ -108,12 +109,23 @@
        sc->wdc_channel.ctl_iot = &sc->ctl_iot;
 
        if (bus_space_map(sc->wdc_channel.cmd_iot, 0, 0x40, 0,
-                         &sc->wdc_channel.cmd_ioh)) {
+                         &sc->wdc_channel.cmd_baseioh)) {
                printf("%s: couldn't map registers\n",
                    sc->sc_wdcdev.sc_dev.dv_xname);
                return;
        }
 
+       for (i = 0; i < WDC_PIOC_REG_NPORTS; i++) {
+               if (bus_space_subregion(ch.cmd_iot, ch.cmd_baseioh, i,
+                       i == 0 ? 4 : 1, &ch.cmd_iohs[i]) != 0) {
+                       bus_space_unmap(ch.cmd_iot, ch.cmd_baseioh,
+                           WDC_PIOC_REG_NPORTS);
+                       printf("%s: couldn't map registers\n",
+                           sc->sc_wdcdev.sc_dev.dv_xname);
+                       return;
+               }
+       }
+
        if (sc->sc_a1200)
                sc->wdc_channel.ctl_ioh = sc->ctl_iot.base;
        else if (bus_space_subregion(sc->wdc_channel.cmd_iot,



Home | Main Index | Thread Index | Old Index