Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/next68k Comprehensive patches from Christian Limpach:



details:   https://anonhg.NetBSD.org/src/rev/b0d583fad52f
branches:  trunk
changeset: 536193:b0d583fad52f
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Sep 11 01:46:29 2002 +0000

description:
Comprehensive patches from Christian Limpach:
* Fix problems with the DMA and SCSI drivers.
* Make turbo machines sort of work.
Additional fixes from me:
* Determine if we're a turbo at boot time, by looking at the ROM machine type.
* Set the display size correctly (1120 pixels wide, but padded to 1152 only on
  non-turbo machines).
Caveats:
* SCSI doesn't work on the turbo (or at least it blows chunks with no devices
  attached).
* Media selection doesn't work on the turbo (the BMAP stuff doesn't exist on
  turbo machines).
* The boot block is prone to timing out.

diffstat:

 sys/arch/next68k/conf/GENERIC             |     6 +-
 sys/arch/next68k/conf/SLAB                |     4 +-
 sys/arch/next68k/conf/files.next68k       |    19 +-
 sys/arch/next68k/dev/bmapreg.h            |     8 +-
 sys/arch/next68k/dev/bus_dma.c            |   722 ------------
 sys/arch/next68k/dev/enreg.h              |     3 +-
 sys/arch/next68k/dev/esp.c                |   596 +++++----
 sys/arch/next68k/dev/espvar.h             |     4 +-
 sys/arch/next68k/dev/if_xe.c              |   788 ++++++++++++-
 sys/arch/next68k/dev/if_xereg.h           |    35 +
 sys/arch/next68k/dev/if_xevar.h           |    25 +-
 sys/arch/next68k/dev/intio.c              |    34 +-
 sys/arch/next68k/dev/intiovar.h           |    11 +-
 sys/arch/next68k/dev/mb8795.c             |   688 ++---------
 sys/arch/next68k/dev/mb8795reg.h          |   145 +-
 sys/arch/next68k/dev/mb8795var.h          |    82 +-
 sys/arch/next68k/dev/nextcons.c           |     6 +-
 sys/arch/next68k/dev/nextdisplay.c        |    13 +-
 sys/arch/next68k/dev/nextdma.c            |  1651 +++++++++++++++-------------
 sys/arch/next68k/dev/nextdmareg.h         |     3 +-
 sys/arch/next68k/dev/nextdmavar.h         |    71 +-
 sys/arch/next68k/dev/nextkbd.c            |    57 +-
 sys/arch/next68k/dev/nextkbdvar.h         |     5 +-
 sys/arch/next68k/dev/zs.c                 |    13 +-
 sys/arch/next68k/include/autoconf.h       |     8 +-
 sys/arch/next68k/include/bus.h            |     4 +-
 sys/arch/next68k/include/bus_dma.h        |   259 +----
 sys/arch/next68k/include/bus_space.h      |    11 +-
 sys/arch/next68k/include/cpu.h            |    36 +-
 sys/arch/next68k/include/intr.h           |    19 +-
 sys/arch/next68k/include/pmap.h           |    20 +-
 sys/arch/next68k/next68k/autoconf.c       |   102 +-
 sys/arch/next68k/next68k/clock.c          |    29 +-
 sys/arch/next68k/next68k/isr.c            |   172 ++-
 sys/arch/next68k/next68k/isr.h            |    19 +-
 sys/arch/next68k/next68k/locore.s         |    31 +-
 sys/arch/next68k/next68k/machdep.c        |    11 +-
 sys/arch/next68k/next68k/mainbus.c        |   116 ++
 sys/arch/next68k/next68k/nextrom.c        |   125 +-
 sys/arch/next68k/next68k/nextrom.h        |     4 +-
 sys/arch/next68k/next68k/pmap.c           |  1619 +++++++++++++---------------
 sys/arch/next68k/next68k/pmap_bootstrap.c |    24 +-
 sys/arch/next68k/next68k/rtc.c            |     4 +-
 sys/arch/next68k/next68k/trap.c           |    17 +-
 sys/arch/next68k/next68k/vectors.s        |    10 +-
 sys/arch/next68k/stand/boot/Makefile      |    14 +-
 sys/arch/next68k/stand/boot/boot.c        |    11 +-
 sys/arch/next68k/stand/boot/dmareg.h      |     3 +-
 sys/arch/next68k/stand/boot/en.c          |   116 +-
 sys/arch/next68k/stand/boot/enreg.h       |     6 +-
 50 files changed, 3775 insertions(+), 4004 deletions(-)

diffs (truncated from 11318 to 300 lines):

diff -r 354de3337ab0 -r b0d583fad52f sys/arch/next68k/conf/GENERIC
--- a/sys/arch/next68k/conf/GENERIC     Tue Sep 10 22:44:28 2002 +0000
+++ b/sys/arch/next68k/conf/GENERIC     Wed Sep 11 01:46:29 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.60 2002/07/11 18:07:22 mycroft Exp $
+# $NetBSD: GENERIC,v 1.61 2002/09/11 01:46:29 mycroft Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options        INCLUDE_CONFIG_FILE     # embed config file in kernel binary
 
-#ident                 "GENERIC-$Revision: 1.60 $"
+#ident                 "GENERIC-$Revision: 1.61 $"
 
 # Needs to be set per system.  i.e change these as you see fit
 maxusers       16
@@ -171,6 +171,8 @@
 wskbd*         at nextkbd? console ?
 
 # INTIO
+nextdma*       at intio? ipl 6
+
 zsc0   at intio? ipl 5
 #zsc1  at intio? ipl 5
 
diff -r 354de3337ab0 -r b0d583fad52f sys/arch/next68k/conf/SLAB
--- a/sys/arch/next68k/conf/SLAB        Tue Sep 10 22:44:28 2002 +0000
+++ b/sys/arch/next68k/conf/SLAB        Wed Sep 11 01:46:29 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: SLAB,v 1.15 2002/07/11 18:07:22 mycroft Exp $
+# $NetBSD: SLAB,v 1.16 2002/09/11 01:46:29 mycroft Exp $
 #
 # deberg's development machine
 #
@@ -150,6 +150,8 @@
 wskbd*         at nextkbd? console ?
 
 # INTIO
+nextdma*       at intio? ipl 6
+
 zsc0   at intio? ipl 5
 #zsc1  at intio? ipl 5
 
diff -r 354de3337ab0 -r b0d583fad52f sys/arch/next68k/conf/files.next68k
--- a/sys/arch/next68k/conf/files.next68k       Tue Sep 10 22:44:28 2002 +0000
+++ b/sys/arch/next68k/conf/files.next68k       Wed Sep 11 01:46:29 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.next68k,v 1.26 2002/09/06 13:18:43 gehenna Exp $
+# $NetBSD: files.next68k,v 1.27 2002/09/11 01:46:29 mycroft Exp $
 
 # next68k-specific configuration info
 
@@ -49,14 +49,19 @@
 file   arch/next68k/next68k/sys_machdep.c
 file   arch/next68k/next68k/isr.c
 file   arch/next68k/next68k/autoconf.c
+file   arch/next68k/next68k/mainbus.c
 file   arch/next68k/next68k/nextrom.c
 file   arch/next68k/next68k/rtc.c
 file   arch/next68k/next68k/disksubr.c
 file   arch/next68k/next68k/kgdb_machdep.c     kgdb
 
 #file  arch/next68k/dev/dbj_debug.c
-file   arch/next68k/dev/bus_dma.c
-file   arch/next68k/dev/nextdma.c
+file   arch/m68k/m68k/bus_dma.c
+
+define nextdma
+device nextdma
+attach nextdma at intio
+file   arch/next68k/dev/nextdma.c      nextdma
 
 file   dev/cons.c
 file   dev/cninit.c
@@ -68,9 +73,9 @@
 include "dev/wscons/files.wscons"
 
 device xe: arp, ether, ifnet
-attach xe at intio
-file   arch/next68k/dev/mb8795.c
-file   arch/next68k/dev/if_xe.c
+attach xe at intio: nextdma
+file   arch/next68k/dev/mb8795.c       xe
+file   arch/next68k/dev/if_xe.c        xe needs-flag
 
 device nextdisplay: wsemuldisplaydev, wsrasteremulops
 attach nextdisplay at mainbus
@@ -82,7 +87,7 @@
 file   arch/next68k/dev/wskbdmap_next.c        nextkbd
 file   arch/next68k/dev/nextcons.c             nextkbd
 
-attach esp at intio
+attach esp at intio: nextdma
 file   arch/next68k/dev/esp.c          esp needs-flag
 
 # Memory disk for boot tape
diff -r 354de3337ab0 -r b0d583fad52f sys/arch/next68k/dev/bmapreg.h
--- a/sys/arch/next68k/dev/bmapreg.h    Tue Sep 10 22:44:28 2002 +0000
+++ b/sys/arch/next68k/dev/bmapreg.h    Wed Sep 11 01:46:29 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bmapreg.h,v 1.1 2002/07/11 16:03:09 christos Exp $     */
+/*     $NetBSD: bmapreg.h,v 1.2 2002/09/11 01:46:30 mycroft Exp $      */
 
 /* 
  * Copyright (c) 2002 Christian Limpach
@@ -35,8 +35,14 @@
 #define BMAP_DDIR_UTPENABLE_MASK 0x80|0x10
 
 #define BMAP_DATA (13 * 4)
+/* observed values:
+ * utp: 0xb0 0xd0 0xf0
+ * bnc: 0x60
+ */
 #define BMAP_DATA_UTPCARRIER_MASK 0x20
+#define BMAP_DATA_UTPENABLED_MASK 0x10
 #define BMAP_DATA_UTPENABLE 0x80|0x10
+#define BMAP_DATA_BNCENABLE 0x00
 
 /* Size of register area to be mapped */
 #define BMAP_SIZE 14 * 4
diff -r 354de3337ab0 -r b0d583fad52f sys/arch/next68k/dev/bus_dma.c
--- a/sys/arch/next68k/dev/bus_dma.c    Tue Sep 10 22:44:28 2002 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,722 +0,0 @@
-/* $NetBSD: bus_dma.c,v 1.26 2002/06/02 14:44:41 drochner Exp $ */
-
-/*
- * This file was taken from from alpha/common/bus_dma.c
- * should probably be re-synced when needed.
- * Darrin B. Jewell <dbj%netbsd.org@localhost> Sat Jul 31 06:11:33 UTC 1999
- * original cvs id: NetBSD: bus_dma.c,v 1.31 1999/07/08 18:05:23 thorpej Exp 
- */
-
-/*-
- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
- * NASA Ames Research Center.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the NetBSD
- *     Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.26 2002/06/02 14:44:41 drochner Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/proc.h>
-#include <sys/mbuf.h>
-
-#include <uvm/uvm_extern.h>
-
-#include <machine/cpu.h>
-
-#define _NEXT68K_BUS_DMA_PRIVATE
-#include <machine/bus.h>
-#include <m68k/cacheops.h>
-
-int    _bus_dmamap_load_buffer_direct_common __P((bus_dma_tag_t,
-           bus_dmamap_t, void *, bus_size_t, struct proc *, int,
-           paddr_t *, int *, int));
-
-/*
- * Common function for DMA map creation.  May be called by bus-specific
- * DMA map creation functions.
- */
-int
-_bus_dmamap_create(t, size, nsegments, maxsegsz, boundary, flags, dmamp)
-       bus_dma_tag_t t;
-       bus_size_t size;
-       int nsegments;
-       bus_size_t maxsegsz;
-       bus_size_t boundary;
-       int flags;
-       bus_dmamap_t *dmamp;
-{
-       struct next68k_bus_dmamap *map;
-       void *mapstore;
-       size_t mapsize;
-
-       /*
-        * Allcoate and initialize the DMA map.  The end of the map
-        * is a variable-sized array of segments, so we allocate enough
-        * room for them in one shot.
-        *
-        * Note we don't preserve the WAITOK or NOWAIT flags.  Preservation
-        * of ALLOCNOW notifes others that we've reserved these resources,
-        * and they are not to be freed.
-        *
-        * The bus_dmamap_t includes one bus_dma_segment_t, hence
-        * the (nsegments - 1).
-        */
-       mapsize = sizeof(struct next68k_bus_dmamap) +
-           (sizeof(bus_dma_segment_t) * (nsegments - 1));
-       if ((mapstore = malloc(mapsize, M_DMAMAP,
-           (flags & BUS_DMA_NOWAIT) ? M_NOWAIT : M_WAITOK)) == NULL)
-               return (ENOMEM);
-
-       bzero(mapstore, mapsize);
-       map = (struct next68k_bus_dmamap *)mapstore;
-       map->_dm_size = size;
-       map->_dm_segcnt = nsegments;
-       map->_dm_maxsegsz = maxsegsz;
-       if (t->_boundary != 0 && t->_boundary < boundary)
-               map->_dm_boundary = t->_boundary;
-       else
-               map->_dm_boundary = boundary;
-       map->_dm_flags = flags & ~(BUS_DMA_WAITOK|BUS_DMA_NOWAIT);
-       map->dm_mapsize = 0;            /* no valid mappings */
-       map->dm_nsegs = 0;
-
-       *dmamp = map;
-       return (0);
-}
-
-/*
- * Common function for DMA map destruction.  May be called by bus-specific
- * DMA map destruction functions.
- */
-void
-_bus_dmamap_destroy(t, map)
-       bus_dma_tag_t t;
-       bus_dmamap_t map;
-{
-
-       free(map, M_DMAMAP);
-}
-
-/*
- * Utility function to load a linear buffer.  lastaddrp holds state
- * between invocations (for multiple-buffer loads).  segp contains
- * the starting segment on entrance, and the ending segment on exit.
- * first indicates if this is the first invocation of this function.
- */
-int
-_bus_dmamap_load_buffer_direct_common(t, map, buf, buflen, p, flags,
-    lastaddrp, segp, first)
-       bus_dma_tag_t t;
-       bus_dmamap_t map;
-       void *buf;
-       bus_size_t buflen;
-       struct proc *p;
-       int flags;
-       paddr_t *lastaddrp;
-       int *segp;
-       int first;
-{
-       bus_size_t sgsize;
-       bus_addr_t curaddr, lastaddr, baddr, bmask;
-       vaddr_t vaddr = (vaddr_t)buf;
-       int seg;
-       boolean_t rv;
-
-       lastaddr = *lastaddrp;
-       bmask = ~(map->_dm_boundary - 1);
-
-       for (seg = *segp; buflen > 0 ; ) {
-               /*
-                * Get the physical address for this segment.
-                */
-               if (p != NULL)
-                       rv = pmap_extract(p->p_vmspace->vm_map.pmap,
-                           vaddr, &curaddr);
-               else
-                       rv = pmap_extract(pmap_kernel(), vaddr, &curaddr);
-               KASSERT(rv);



Home | Main Index | Thread Index | Old Index