Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sgimips/hpc * Add a callback to the front-end for t...



details:   https://anonhg.NetBSD.org/src/rev/98c876dd54ca
branches:  trunk
changeset: 517725:98c876dd54ca
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Nov 18 05:14:38 2001 +0000

description:
* Add a callback to the front-end for the 33c93 driver to reset
  the controller/SCSI bus.
* Implement controller/SCSI bus reset on SGI HPC3 SCSI using the
  "channel reset" bit in the SCSI DMA channel control register.

diffstat:

 sys/arch/sgimips/hpc/hpcdma.c  |  14 +++++++++++++-
 sys/arch/sgimips/hpc/hpcdma.h  |   3 ++-
 sys/arch/sgimips/hpc/sbic.c    |   5 ++++-
 sys/arch/sgimips/hpc/sbicvar.h |   3 ++-
 sys/arch/sgimips/hpc/wdsc.c    |  17 ++++++++++++++++-
 5 files changed, 37 insertions(+), 5 deletions(-)

diffs (126 lines):

diff -r c19bd6183562 -r 98c876dd54ca sys/arch/sgimips/hpc/hpcdma.c
--- a/sys/arch/sgimips/hpc/hpcdma.c     Sun Nov 18 04:27:49 2001 +0000
+++ b/sys/arch/sgimips/hpc/hpcdma.c     Sun Nov 18 05:14:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpcdma.c,v 1.1 2001/08/19 03:16:21 wdk Exp $   */
+/*     $NetBSD: hpcdma.c,v 1.2 2001/11/18 05:14:38 thorpej Exp $       */
 
 /*
  * Copyright (c) 2001 Wayne Knowles
@@ -159,6 +159,18 @@
 }
 
 void
+hpcdma_reset(sc)
+       struct hpc_dma_softc *sc;
+{
+
+       bus_space_write_4(sc->sc_bst, sc->sc_bsh, HPC_SCSI0_CTL,
+           HPC_DMACTL_RESET);
+       delay(100);
+       bus_space_write_4(sc->sc_bst, sc->sc_bsh, HPC_SCSI0_CTL, 0);
+       delay(1000);
+}
+
+void
 hpcdma_flush(sc)
        struct hpc_dma_softc *sc;
 {
diff -r c19bd6183562 -r 98c876dd54ca sys/arch/sgimips/hpc/hpcdma.h
--- a/sys/arch/sgimips/hpc/hpcdma.h     Sun Nov 18 04:27:49 2001 +0000
+++ b/sys/arch/sgimips/hpc/hpcdma.h     Sun Nov 18 05:14:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpcdma.h,v 1.2 2001/11/10 07:32:42 wdk Exp $   */
+/*     $NetBSD: hpcdma.h,v 1.3 2001/11/18 05:14:38 thorpej Exp $       */
 
 /*
  * Copyright (c) 2001 Wayne Knowles
@@ -62,6 +62,7 @@
 void hpcdma_init(struct hpc_attach_args *, struct hpc_dma_softc *, int);
 void hpcdma_sglist_create(struct hpc_dma_softc *, bus_dmamap_t);
 void hpcdma_cntl(struct hpc_dma_softc *, u_int32_t);
+void hpcdma_reset(struct hpc_dma_softc *);
 void hpcdma_flush(struct hpc_dma_softc *);
 
 #endif /* _SGIMIPS_HPC_DMA_H */
diff -r c19bd6183562 -r 98c876dd54ca sys/arch/sgimips/hpc/sbic.c
--- a/sys/arch/sgimips/hpc/sbic.c       Sun Nov 18 04:27:49 2001 +0000
+++ b/sys/arch/sgimips/hpc/sbic.c       Sun Nov 18 05:14:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbic.c,v 1.3 2001/11/10 22:54:54 wdk Exp $     */
+/*     $NetBSD: sbic.c,v 1.4 2001/11/18 05:14:38 thorpej Exp $ */
 
 /*
  * Changes Copyright (c) 2001 Wayne Knowles
@@ -259,6 +259,9 @@
 
        s = splbio();
 
+       if (dev->sc_reset != NULL)
+               (*dev->sc_reset)(dev);
+
        my_id = dev->sc_channel.chan_id & SBIC_ID_MASK;
        if (dev->sc_clkfreq < 110)
                my_id |= SBIC_ID_FS_8_10;
diff -r c19bd6183562 -r 98c876dd54ca sys/arch/sgimips/hpc/sbicvar.h
--- a/sys/arch/sgimips/hpc/sbicvar.h    Sun Nov 18 04:27:49 2001 +0000
+++ b/sys/arch/sgimips/hpc/sbicvar.h    Sun Nov 18 05:14:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sbicvar.h,v 1.2 2001/11/10 07:32:43 wdk Exp $  */
+/*     $NetBSD: sbicvar.h,v 1.3 2001/11/18 05:14:39 thorpej Exp $      */
 
 /*
  * Copyright (c) 1990 The Regents of the University of California.
@@ -180,6 +180,7 @@
                                            size_t *,int,size_t *));
        int  (*sc_dmago) __P((struct sbic_softc *));
        void (*sc_dmastop) __P((struct sbic_softc *));
+       void (*sc_reset) __P((struct sbic_softc *));
 };
 
 /* values for sc_flags */
diff -r c19bd6183562 -r 98c876dd54ca sys/arch/sgimips/hpc/wdsc.c
--- a/sys/arch/sgimips/hpc/wdsc.c       Sun Nov 18 04:27:49 2001 +0000
+++ b/sys/arch/sgimips/hpc/wdsc.c       Sun Nov 18 05:14:38 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wdsc.c,v 1.2 2001/11/10 07:32:43 wdk Exp $     */
+/*     $NetBSD: wdsc.c,v 1.3 2001/11/18 05:14:39 thorpej Exp $ */
 
 /*
  * Copyright (c) 2001 Wayne Knowles
@@ -90,6 +90,7 @@
                                int, size_t *));
 int     wdsc_dmago      __P((struct sbic_softc *));
 void    wdsc_dmastop    __P((struct sbic_softc *));
+void   wdsc_reset      __P((struct sbic_softc *));
 int     wdsc_dmaintr    __P((void *));
 int     wdsc_scsiintr   __P((void *));
 
@@ -149,6 +150,7 @@
        sc->sc_dmasetup = wdsc_dmasetup;
        sc->sc_dmago    = wdsc_dmago;
        sc->sc_dmastop  = wdsc_dmastop;
+       sc->sc_reset    = wdsc_reset;
 
        sc->sc_adapter.adapt_request = sbic_scsi_request;
        sc->sc_adapter.adapt_minphys = minphys;
@@ -268,6 +270,19 @@
 }
 
 /*
+ * Reset the controller.
+ */
+void
+wdsc_reset(dev)
+       struct sbic_softc *dev;
+{
+       struct wdsc_softc *wsc = (void *)dev;
+       struct hpc_dma_softc *dsc = &wsc->sc_hpcdma;
+
+       hpcdma_reset(dsc);
+}
+
+/*
  * WD33c93 SCSI controller interrupt
  */
 int



Home | Main Index | Thread Index | Old Index