Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64/dev move the sbus IOMMU work around into th...



details:   https://anonhg.NetBSD.org/src/rev/4a4ddcf843c9
branches:  trunk
changeset: 510084:4a4ddcf843c9
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri May 18 21:35:23 2001 +0000

description:
move the sbus IOMMU work around into the sbus code, so that the psycho
doesn't have to lose a page.

diffstat:

 sys/arch/sparc64/dev/iommu.c |   8 ++------
 sys/arch/sparc64/dev/sbus.c  |  16 +++++++++++++++-
 2 files changed, 17 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 695b76548be3 -r 4a4ddcf843c9 sys/arch/sparc64/dev/iommu.c
--- a/sys/arch/sparc64/dev/iommu.c      Fri May 18 21:11:43 2001 +0000
+++ b/sys/arch/sparc64/dev/iommu.c      Fri May 18 21:35:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iommu.c,v 1.33 2001/04/24 04:31:12 thorpej Exp $       */
+/*     $NetBSD: iommu.c,v 1.34 2001/05/18 21:35:23 mrg Exp $   */
 
 /*
  * Copyright (c) 1999, 2000 Matthew R. Green
@@ -173,14 +173,10 @@
         * address depends on the size of the map.  The map size is 1024 * 2 ^
         * is->is_tsbsize entries, where each entry is 8 bytes.  The start of
         * the map can be calculated by (0xffffe000 << (8 + is->is_tsbsize)).
-        *
-        * Note: the stupid IOMMU ignores the high bits of an address, so a
-        * NULL DMA pointer will be translated by the first page of the IOTSB.
-        * To trap bugs we'll skip the first entry in the IOTSB.
         */
        is->is_cr = (tsbsize << 16) | IOMMUCR_EN;
        is->is_tsbsize = tsbsize;
-       is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize) + NBPG;
+       is->is_dvmabase = IOTSB_VSTART(is->is_tsbsize);
 
        /*
         * Allocate memory for I/O pagetables.  They need to be physically
diff -r 695b76548be3 -r 4a4ddcf843c9 sys/arch/sparc64/dev/sbus.c
--- a/sys/arch/sparc64/dev/sbus.c       Fri May 18 21:11:43 2001 +0000
+++ b/sys/arch/sparc64/dev/sbus.c       Fri May 18 21:35:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbus.c,v 1.41 2001/03/16 10:47:25 hubertf Exp $ */
+/*     $NetBSD: sbus.c,v 1.42 2001/05/18 21:35:23 mrg Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -341,6 +341,20 @@
        *(ih->ih_map) |= INTMAP_V;
        
        /*
+        * Note: the stupid SBUS IOMMU ignores the high bits of an address, so a
+        * NULL DMA pointer will be translated by the first page of the IOTSB.
+        * To avoid bugs we'll alloc and ignore the first entry in the IOTSB.
+        */
+       {
+               u_long dummy;
+
+               if (extent_alloc_subregion(sc->sc_is.is_dvmamap,
+                   sc->sc_is.is_dvmabase, sc->sc_is.is_dvmabase + NBPG, NBPG,
+                   NBPG, 0, EX_NOWAIT|EX_BOUNDZERO, (u_long *)&dummy) != 0)
+                       panic("sbus iommu: can't toss first dvma page");
+       }
+
+       /*
         * Loop through ROM children, fixing any relative addresses
         * and then configuring each device.
         * `specials' is an array of device names that are treated



Home | Main Index | Thread Index | Old Index