Source-Changes-HG archive

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

[src/trunk]: src/sys Repopulate TCDS dual channel SCSI adapter to MI dev/tc, ...



details:   https://anonhg.NetBSD.org/src/rev/d50e92f569ba
branches:  trunk
changeset: 494221:d50e92f569ba
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Tue Jul 04 02:22:08 2000 +0000

description:
Repopulate TCDS dual channel SCSI adapter to MI dev/tc, squashing
internals for better layering between TCDS DMA ASIC and ASC SCSI
controller.

diffstat:

 sys/arch/alpha/alpha/dec_3000_300.c |    6 +-
 sys/arch/alpha/alpha/dec_3000_500.c |    6 +-
 sys/arch/alpha/conf/files.alpha     |    7 +-
 sys/arch/alpha/tc/asc.c             |  340 --------------------
 sys/arch/alpha/tc/ascvar.h          |   47 --
 sys/arch/alpha/tc/tcds.c            |  609 ------------------------------------
 sys/arch/alpha/tc/tcds_dma.c        |  359 ---------------------
 sys/arch/alpha/tc/tcdsreg.h         |  217 ------------
 sys/arch/alpha/tc/tcdsvar.h         |  113 ------
 sys/dev/tc/asc_tcds.c               |  534 +++++++++++++++++++++++++++++++
 sys/dev/tc/tcds.c                   |  597 +++++++++++++++++++++++++++++++++++
 sys/dev/tc/tcdsreg.h                |  217 ++++++++++++
 sys/dev/tc/tcdsvar.h                |   85 +++++
 13 files changed, 1442 insertions(+), 1695 deletions(-)

diffs (truncated from 3237 to 300 lines):

diff -r 232e2e103be2 -r d50e92f569ba sys/arch/alpha/alpha/dec_3000_300.c
--- a/sys/arch/alpha/alpha/dec_3000_300.c       Tue Jul 04 02:10:37 2000 +0000
+++ b/sys/arch/alpha/alpha/dec_3000_300.c       Tue Jul 04 02:22:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3000_300.c,v 1.30 2000/05/22 20:13:32 thorpej Exp $ */
+/* $NetBSD: dec_3000_300.c,v 1.31 2000/07/04 02:22:08 nisimura Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -33,7 +33,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.30 2000/05/22 20:13:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3000_300.c,v 1.31 2000/07/04 02:22:08 nisimura Exp $");
 
 #include "opt_new_scc_driver.h"
 
@@ -47,7 +47,7 @@
 #include <machine/conf.h>
 
 #include <dev/tc/tcvar.h>
-#include <alpha/tc/tcdsvar.h>
+#include <dev/tc/tcdsvar.h>
 #include <alpha/tc/tc_3000_300.h>
 #ifndef NEW_SCC_DRIVER
 #include <alpha/tc/sccvar.h>
diff -r 232e2e103be2 -r d50e92f569ba sys/arch/alpha/alpha/dec_3000_500.c
--- a/sys/arch/alpha/alpha/dec_3000_500.c       Tue Jul 04 02:10:37 2000 +0000
+++ b/sys/arch/alpha/alpha/dec_3000_500.c       Tue Jul 04 02:22:08 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_3000_500.c,v 1.29 2000/05/22 20:13:32 thorpej Exp $ */
+/* $NetBSD: dec_3000_500.c,v 1.30 2000/07/04 02:22:09 nisimura Exp $ */
 
 /*
  * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
@@ -32,7 +32,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.29 2000/05/22 20:13:32 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_3000_500.c,v 1.30 2000/07/04 02:22:09 nisimura Exp $");
 
 #include "opt_new_scc_driver.h"
 
@@ -47,7 +47,7 @@
 #include <machine/conf.h>
 
 #include <dev/tc/tcvar.h>
-#include <alpha/tc/tcdsvar.h>
+#include <dev/tc/tcdsvar.h>
 #include <alpha/tc/tc_3000_500.h>
 #ifndef NEW_SCC_DRIVER
 #include <alpha/tc/sccvar.h>
diff -r 232e2e103be2 -r d50e92f569ba sys/arch/alpha/conf/files.alpha
--- a/sys/arch/alpha/conf/files.alpha   Tue Jul 04 02:10:37 2000 +0000
+++ b/sys/arch/alpha/conf/files.alpha   Tue Jul 04 02:22:08 2000 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.alpha,v 1.119 2000/06/25 17:21:57 thorpej Exp $
+# $NetBSD: files.alpha,v 1.120 2000/07/04 02:22:10 nisimura Exp $
 #
 # alpha-specific configuration info
 
@@ -193,13 +193,12 @@
 # the TCDS ASIC
 device tcds { chip = -1 }
 attach tcds at tc
-file   arch/alpha/tc/tcds.c            tcds
+file   dev/tc/tcds.c                   tcds
 
 # 53C[F]90 SCSI
 device asc: scsi, ncr53c9x
 attach asc at tcds with asc_tcds
-file   arch/alpha/tc/asc.c             asc
-file   arch/alpha/tc/tcds_dma.c        asc
+file   dev/tc/asc_tcds.c               asc_tcds
 
 # TC and baseboard ioasic Lance ethernet are in files.tc
 
diff -r 232e2e103be2 -r d50e92f569ba sys/arch/alpha/tc/asc.c
--- a/sys/arch/alpha/tc/asc.c   Tue Jul 04 02:10:37 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,340 +0,0 @@
-/* $NetBSD: asc.c,v 1.17 2000/06/05 07:59:50 nisimura Exp $ */
-
-/*-
- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles M. Hannum; Jason R. Thorpe of the Numerical Aerospace
- * Simulation Facility, NASA Ames Research Center;  Paul Kranenburg.
- *
- * 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.
- */
-
-/*
- * Copyright (c) 1994 Peter Galbavy
- * All rights reserved.
- *
- * 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 Peter Galbavy
- * 4. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
- */
-
-/*
- * Based on aic6360 by Jarle Greipsland
- *
- * Acknowledgements: Many of the algorithms used in this driver are
- * inspired by the work of Julian Elischer (julian%tfs.com@localhost) and
- * Charles Hannum (mycroft%duality.gnu.ai.mit.edu@localhost).  Thanks a million!
- */
-
-#include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-
-__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.17 2000/06/05 07:59:50 nisimura Exp $");
-
-#include <sys/types.h>
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/errno.h>
-#include <sys/ioctl.h>
-#include <sys/device.h>
-#include <sys/buf.h>
-#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/queue.h>
-
-#include <dev/scsipi/scsi_all.h>
-#include <dev/scsipi/scsipi_all.h>
-#include <dev/scsipi/scsiconf.h>
-#include <dev/scsipi/scsi_message.h>
-
-#include <machine/bus.h>
-#include <machine/cpu.h>
-
-#include <dev/ic/ncr53c9xreg.h>
-#include <dev/ic/ncr53c9xvar.h>
-
-#include <dev/tc/tcvar.h>
-#include <alpha/tc/tcdsvar.h>
-#include <alpha/tc/ascvar.h>
-
-int    asc_tcds_match  __P((struct device *, struct cfdata *, void *));
-void   asc_tcds_attach __P((struct device *, struct device *, void *));
-
-/* Linkup to the rest of the kernel */
-struct cfattach asc_tcds_ca = {
-       sizeof(struct asc_tcds_softc), asc_tcds_match, asc_tcds_attach
-};
-
-/*
- * Functions and the switch for the MI code.
- */
-u_char asc_tcds_read_reg __P((struct ncr53c9x_softc *, int));
-void   asc_tcds_write_reg __P((struct ncr53c9x_softc *, int, u_char));
-int    asc_tcds_dma_isintr __P((struct ncr53c9x_softc *));
-void   asc_tcds_dma_reset __P((struct ncr53c9x_softc *));
-int    asc_tcds_dma_intr __P((struct ncr53c9x_softc *));
-int    asc_tcds_dma_setup __P((struct ncr53c9x_softc *, caddr_t *,
-           size_t *, int, size_t *));
-void   asc_tcds_dma_go __P((struct ncr53c9x_softc *));
-void   asc_tcds_dma_stop __P((struct ncr53c9x_softc *));
-int    asc_tcds_dma_isactive __P((struct ncr53c9x_softc *));
-void   asc_tcds_clear_latched_intr __P((struct ncr53c9x_softc *));
-
-struct ncr53c9x_glue asc_tcds_glue = {
-       asc_tcds_read_reg,
-       asc_tcds_write_reg,
-       asc_tcds_dma_isintr,
-       asc_tcds_dma_reset,
-       asc_tcds_dma_intr,
-       asc_tcds_dma_setup,
-       asc_tcds_dma_go,
-       asc_tcds_dma_stop,
-       asc_tcds_dma_isactive,
-       asc_tcds_clear_latched_intr,
-};
-
-int
-asc_tcds_match(parent, cf, aux)
-       struct device *parent;
-       struct cfdata *cf;
-       void *aux;
-{
-
-       /* We always exist. */
-       return (1);
-}
-
-/*
- * Attach this instance, and then all the sub-devices
- */
-void
-asc_tcds_attach(parent, self, aux)
-       struct device *parent, *self;
-       void *aux;
-{
-       struct tcdsdev_attach_args *tcdsdev = aux;
-       struct asc_tcds_softc *asc = (void *)self;
-       struct ncr53c9x_softc *sc = &asc->sc_ncr53c9x;
-
-       /*
-        * Set up glue for MI code early; we use some of it here.
-        */
-       sc->sc_glue = &asc_tcds_glue;
-
-       asc->sc_bst = tcdsdev->tcdsda_bst;
-       asc->sc_bsh = tcdsdev->tcdsda_bsh;
-       asc->sc_dma = tcdsdev->tcdsda_sc;
-
-       sc->sc_id = tcdsdev->tcdsda_id;
-       sc->sc_freq = tcdsdev->tcdsda_freq;
-
-       /* gimme Mhz */
-       sc->sc_freq /= 1000000;
-
-       asc->sc_dma->sc_asc = asc;                      /* XXX */
-
-       tcds_intr_establish(parent, tcdsdev->tcdsda_chip, ncr53c9x_intr, sc);
-
-       /*
-        * XXX More of this should be in ncr53c9x_attach(), but
-        * XXX should we really poke around the chip that much in
-        * XXX the MI code?  Think about this more...
-        */
-
-       /*
-        * Set up static configuration info.
-        */
-       sc->sc_cfg1 = sc->sc_id | NCRCFG1_PARENB;
-       sc->sc_cfg2 = NCRCFG2_SCSI2;
-       sc->sc_cfg3 = NCRCFG3_CDB;
-       if (sc->sc_freq > 25)
-               sc->sc_cfg3 |= NCRF9XCFG3_FCLK;
-       sc->sc_rev = tcdsdev->tcdsda_variant;
-       if (tcdsdev->tcdsda_fast) {
-               sc->sc_features |= NCR_F_FASTSCSI;
-               sc->sc_cfg3_fscsi = NCRF9XCFG3_FSCSI;
-       }
-
-       /*
-        * XXX minsync and maxxfer _should_ be set up in MI code,
-        * XXX but it appears to have some dependency on what sort
-        * XXX of DMA we're hooked up to, etc.
-        */
-
-       /*
-        * This is the value used to start sync negotiations
-        * Note that the NCR register "SYNCTP" is programmed
-        * in "clocks per byte", and has a minimum value of 4.



Home | Main Index | Thread Index | Old Index