Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/obio Fix PR 11000: The esp driver needs two ...



details:   https://anonhg.NetBSD.org/src/rev/21b00d67ecce
branches:  trunk
changeset: 500037:21b00d67ecce
user:      scottr <scottr%NetBSD.org@localhost>
date:      Mon Dec 04 06:23:36 2000 +0000

description:
Fix PR 11000: The esp driver needs two longwords in DAFB register space to
implement pseudo-DMA transfers with the SCSI controller.  This caused our
match to fail when we couldn't map the entire DAFB register/control space
for our own use.  Instead, we map only (about) what we will need in two
separate regions.

As a consequence we no longer do Turbo SCSI configuration here; indeed, it
may have caused us trouble later on if we actually changed the values
stored in those registers in the esp driver.

diffstat:

 sys/arch/mac68k/obio/grf_obio.c |  32 +++++++++++++++++++-------------
 1 files changed, 19 insertions(+), 13 deletions(-)

diffs (71 lines):

diff -r a92a624007fc -r 21b00d67ecce sys/arch/mac68k/obio/grf_obio.c
--- a/sys/arch/mac68k/obio/grf_obio.c   Mon Dec 04 03:38:56 2000 +0000
+++ b/sys/arch/mac68k/obio/grf_obio.c   Mon Dec 04 06:23:36 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: grf_obio.c,v 1.45 2000/07/30 21:40:49 briggs Exp $     */
+/*     $NetBSD: grf_obio.c,v 1.46 2000/12/04 06:23:36 scottr Exp $     */
 
 /*
  * Copyright (C) 1998 Scott Reynolds
@@ -142,27 +142,33 @@
                 */
                base = DAFB_CONTROL_BASE;
 
-               if (bus_space_map(oa->oa_tag, base, 0x1000, 0, &bsh))
+               if (bus_space_map(oa->oa_tag, base, 0x20, 0, &bsh))
                        return 0;
 
                if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0x1c, 4) == 0) {
-                       bus_space_unmap(oa->oa_tag, bsh, 0x1000);
+                       bus_space_unmap(oa->oa_tag, bsh, 0x20);
                        return 0;
                }
 
-               /* Set "Turbo SCSI" configuration to default */
-               bus_space_write_4(oa->oa_tag, bsh, 0x24, 0x1d1); /* ch0 */
-               bus_space_write_4(oa->oa_tag, bsh, 0x28, 0x1d1); /* ch1 */
+               bus_space_unmap(oa->oa_tag, bsh, 0x20);
+
+               if (bus_space_map(oa->oa_tag, base + 0x100, 0x20, 0, &bsh))
+                       return 0;
+
+               if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0x04, 4) == 0) {
+                       bus_space_unmap(oa->oa_tag, bsh, 0x20);
+                       return 0;
+               }
 
                /* Disable interrupts */
-               bus_space_write_4(oa->oa_tag, bsh, 0x104, 0);
+               bus_space_write_4(oa->oa_tag, bsh, 0x04, 0);
 
                /* Clear any interrupts */
-               bus_space_write_4(oa->oa_tag, bsh, 0x10C, 0);
-               bus_space_write_4(oa->oa_tag, bsh, 0x110, 0);
-               bus_space_write_4(oa->oa_tag, bsh, 0x114, 0);
+               bus_space_write_4(oa->oa_tag, bsh, 0x0C, 0);
+               bus_space_write_4(oa->oa_tag, bsh, 0x10, 0);
+               bus_space_write_4(oa->oa_tag, bsh, 0x14, 0);
 
-               bus_space_unmap(oa->oa_tag, bsh, 0x1000);
+               bus_space_unmap(oa->oa_tag, bsh, 0x20);
                break;
        case MACH_CLASSAV:
                base = CIVIC_CONTROL_BASE;
@@ -229,7 +235,7 @@
        case MACH_CLASSQ:
                base = DAFB_CONTROL_BASE;
                sc->sc_tag = oa->oa_tag;
-               if (bus_space_map(sc->sc_tag, base, 0x1000, 0, &sc->sc_regh)) {
+               if (bus_space_map(sc->sc_tag, base, 0x20, 0, &sc->sc_regh)) {
                        printf(": failed to map DAFB register space\n");
                        return;
                }
@@ -265,7 +271,7 @@
                    sc->sc_basepa + sc->sc_fbofs,
                    (bus_space_read_4(sc->sc_tag, sc->sc_regh, 0x1c) & 0x7));
 
-               bus_space_unmap(sc->sc_tag, sc->sc_regh, 0x1000);
+               bus_space_unmap(sc->sc_tag, sc->sc_regh, 0x20);
                break;
        case MACH_CLASSAV:
                sc->sc_basepa = CIVIC_BASE;



Home | Main Index | Thread Index | Old Index