diff options
-rw-r--r-- | sys/arch/mvme88k/dev/siopreg.h | 336 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/ssh.c (renamed from sys/arch/mvme88k/dev/siop.c) | 892 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/ssh_script.out (renamed from sys/arch/mvme88k/dev/siop_script.out) | 0 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/ssh_script.ss (renamed from sys/arch/mvme88k/dev/siop_script.ss) | 2 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sshdma.c (renamed from sys/arch/mvme88k/dev/siopdma.c) | 72 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sshreg.h | 336 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/sshvar.h (renamed from sys/arch/mvme88k/dev/siopvar.h) | 46 | ||||
-rw-r--r-- | sys/arch/mvme88k/dev/vsvar.h | 6 |
8 files changed, 845 insertions, 845 deletions
diff --git a/sys/arch/mvme88k/dev/siopreg.h b/sys/arch/mvme88k/dev/siopreg.h deleted file mode 100644 index d4345934bb5..00000000000 --- a/sys/arch/mvme88k/dev/siopreg.h +++ /dev/null @@ -1,336 +0,0 @@ -/* $OpenBSD: siopreg.h,v 1.2 1998/12/15 05:52:31 smurph Exp $ */ - -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Van Jacobson of Lawrence Berkeley Laboratory. - * - * 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 University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)siopreg.h 7.3 (Berkeley) 2/5/91 - */ - -/* - * NCR 53C710 SCSI interface hardware description. - * - * From the Mach scsi driver for the 53C700 - */ - -typedef struct { -/*00*/ volatile unsigned char siop_sien; /* rw: SCSI Interrupt Enable */ -/*01*/ volatile unsigned char siop_sdid; /* rw: SCSI Destination ID */ -/*02*/ volatile unsigned char siop_scntl1; /* rw: SCSI control reg 1 */ -/*03*/ volatile unsigned char siop_scntl0; /* rw: SCSI control reg 0 */ -/*04*/ volatile unsigned char siop_socl; /* rw: SCSI Output Control Latch */ -/*05*/ volatile unsigned char siop_sodl; /* rw: SCSI Output Data Latch */ -/*06*/ volatile unsigned char siop_sxfer; /* rw: SCSI Transfer reg */ -/*07*/ volatile unsigned char siop_scid; /* rw: SCSI Chip ID reg */ -/*08*/ volatile unsigned char siop_sbcl; /* ro: SCSI Bus Control Lines */ -/*09*/ volatile unsigned char siop_sbdl; /* ro: SCSI Bus Data Lines */ -/*0a*/ volatile unsigned char siop_sidl; /* ro: SCSI Input Data Latch */ -/*0b*/ volatile unsigned char siop_sfbr; /* ro: SCSI First Byte Received */ -/*0c*/ volatile unsigned char siop_sstat2; /* ro: SCSI status reg 2 */ -/*0d*/ volatile unsigned char siop_sstat1; /* ro: SCSI status reg 1 */ -/*0e*/ volatile unsigned char siop_sstat0; /* ro: SCSI status reg 0 */ -/*0f*/ volatile unsigned char siop_dstat; /* ro: DMA status */ -/*10*/ volatile unsigned long siop_dsa; /* rw: Data Structure Address */ -/*14*/ volatile unsigned char siop_ctest3; /* ro: Chip test register 3 */ -/*15*/ volatile unsigned char siop_ctest2; /* ro: Chip test register 2 */ -/*16*/ volatile unsigned char siop_ctest1; /* ro: Chip test register 1 */ -/*17*/ volatile unsigned char siop_ctest0; /* ro: Chip test register 0 */ -/*18*/ volatile unsigned char siop_ctest7; /* rw: Chip test register 7 */ -/*19*/ volatile unsigned char siop_ctest6; /* rw: Chip test register 6 */ -/*1a*/ volatile unsigned char siop_ctest5; /* rw: Chip test register 5 */ -/*1b*/ volatile unsigned char siop_ctest4; /* rw: Chip test register 4 */ -/*1c*/ volatile unsigned long siop_temp; /* rw: Temporary Stack reg */ -/*20*/ volatile unsigned char siop_lcrc; /* rw: LCRC value */ -/*21*/ volatile unsigned char siop_ctest8; /* rw: Chip test register 8 */ -/*22*/ volatile unsigned char siop_istat; /* rw: Interrupt Status reg */ -/*23*/ volatile unsigned char siop_dfifo; /* rw: DMA FIFO */ -/*24*/ volatile unsigned char siop_dcmd; /* rw: DMA Command Register */ -/*25*/ volatile unsigned char siop_dbc2; /* rw: DMA Byte Counter reg */ -/*26*/ volatile unsigned char siop_dbc1; -/*27*/ volatile unsigned char siop_dbc0; -/*28*/ volatile unsigned long siop_dnad; /* rw: DMA Next Address */ -/*2c*/ volatile unsigned long siop_dsp; /* rw: DMA SCRIPTS Pointer reg */ -/*30*/ volatile unsigned long siop_dsps; /* rw: DMA SCRIPTS Pointer Save reg */ -/*34*/ volatile unsigned long siop_scratch; /* rw: Scratch Register */ -/*38*/ volatile unsigned char siop_dcntl; /* rw: DMA Control reg */ -/*39*/ volatile unsigned char siop_dwt; /* rw: DMA Watchdog Timer */ -/*3a*/ volatile unsigned char siop_dien; /* rw: DMA Interrupt Enable */ -/*3b*/ volatile unsigned char siop_dmode; /* rw: DMA Mode reg */ -/*3c*/ volatile unsigned long siop_adder; - -} siop_regmap_t; -typedef volatile siop_regmap_t *siop_regmap_p; - -/* - * Register defines - */ - -/* Scsi control register 0 (scntl0) */ - -#define SIOP_SCNTL0_ARB 0xc0 /* Arbitration mode */ -# define SIOP_ARB_SIMPLE 0x00 -# define SIOP_ARB_FULL 0xc0 -#define SIOP_SCNTL0_START 0x20 /* Start Sequence */ -#define SIOP_SCNTL0_WATN 0x10 /* (Select) With ATN */ -#define SIOP_SCNTL0_EPC 0x08 /* Enable Parity Checking */ -#define SIOP_SCNTL0_EPG 0x04 /* Enable Parity Generation */ -#define SIOP_SCNTL0_AAP 0x02 /* Assert ATN on Parity Error */ -#define SIOP_SCNTL0_TRG 0x01 /* Target Mode */ - -/* Scsi control register 1 (scntl1) */ - -#define SIOP_SCNTL1_EXC 0x80 /* Extra Clock Cycle of data setup */ -#define SIOP_SCNTL1_ADB 0x40 /* Assert Data Bus */ -#define SIOP_SCNTL1_ESR 0x20 /* Enable Selection/Reselection */ -#define SIOP_SCNTL1_CON 0x10 /* Connected */ -#define SIOP_SCNTL1_RST 0x08 /* Assert RST */ -#define SIOP_SCNTL1_AESP 0x04 /* Assert even SCSI parity */ -#define SIOP_SCNTL1_RES0 0x02 /* Reserved */ -#define SIOP_SCNTL1_RES1 0x01 /* Reserved */ - -/* Scsi interrupt enable register (sien) */ - -#define SIOP_SIEN_M_A 0x80 /* Phase Mismatch or ATN active */ -#define SIOP_SIEN_FCMP 0x40 /* Function Complete */ -#define SIOP_SIEN_STO 0x20 /* (Re)Selection timeout */ -#define SIOP_SIEN_SEL 0x10 /* (Re)Selected */ -#define SIOP_SIEN_SGE 0x08 /* SCSI Gross Error */ -#define SIOP_SIEN_UDC 0x04 /* Unexpected Disconnect */ -#define SIOP_SIEN_RST 0x02 /* RST asserted */ -#define SIOP_SIEN_PAR 0x01 /* Parity Error */ - -/* Scsi chip ID (scid) */ - -#define SIOP_SCID_VALUE(i) (1<<i) - -/* Scsi transfer register (sxfer) */ - -#define SIOP_SXFER_DHP 0x80 /* Disable Halt on Parity error/ ATN asserted */ -#define SIOP_SXFER_TP 0x70 /* Synch Transfer Period */ - /* see specs for formulas: - Period = TCP * (4 + XFERP ) - TCP = 1 + CLK + 1..2; - */ -#define SIOP_SXFER_MO 0x0f /* Synch Max Offset */ -# define SIOP_MAX_OFFSET 8 - -/* Scsi output data latch register (sodl) */ - -/* Scsi output control latch register (socl) */ - -#define SIOP_REQ 0x80 /* SCSI signal <x> asserted */ -#define SIOP_ACK 0x40 -#define SIOP_BSY 0x20 -#define SIOP_SEL 0x10 -#define SIOP_ATN 0x08 -#define SIOP_MSG 0x04 -#define SIOP_CD 0x02 -#define SIOP_IO 0x01 - -#define SIOP_PHASE(socl) SCSI_PHASE(socl) - -/* Scsi first byte received register (sfbr) */ - -/* Scsi input data latch register (sidl) */ - -/* Scsi bus data lines register (sbdl) */ - -/* Scsi bus control lines register (sbcl). Same as socl */ - -/* DMA status register (dstat) */ - -#define SIOP_DSTAT_DFE 0x80 /* DMA FIFO empty */ -#define SIOP_DSTAT_RES 0x40 -#define SIOP_DSTAT_BF 0x20 /* Bus fault */ -#define SIOP_DSTAT_ABRT 0x10 /* Aborted */ -#define SIOP_DSTAT_SSI 0x08 /* SCRIPT Single Step */ -#define SIOP_DSTAT_SIR 0x04 /* SCRIPT Interrupt Instruction */ -#define SIOP_DSTAT_WTD 0x02 /* Watchdog Timeout Detected */ -#define SIOP_DSTAT_IID 0x01 /* Invalid Instruction Detected */ - -/* Scsi status register 0 (sstat0) */ - -#define SIOP_SSTAT0_M_A 0x80 /* Phase Mismatch or ATN active */ -#define SIOP_SSTAT0_FCMP 0x40 /* Function Complete */ -#define SIOP_SSTAT0_STO 0x20 /* (Re)Selection timeout */ -#define SIOP_SSTAT0_SEL 0x10 /* (Re)Selected */ -#define SIOP_SSTAT0_SGE 0x08 /* SCSI Gross Error */ -#define SIOP_SSTAT0_UDC 0x04 /* Unexpected Disconnect */ -#define SIOP_SSTAT0_RST 0x02 /* RST asserted */ -#define SIOP_SSTAT0_PAR 0x01 /* Parity Error */ - -/* Scsi status register 1 (sstat1) */ - -#define SIOP_SSTAT1_ILF 0x80 /* Input latch (sidl) full */ -#define SIOP_SSTAT1_ORF 0x40 /* output reg (sodr) full */ -#define SIOP_SSTAT1_OLF 0x20 /* output latch (sodl) full */ -#define SIOP_SSTAT1_AIP 0x10 /* Arbitration in progress */ -#define SIOP_SSTAT1_LOA 0x08 /* Lost arbitration */ -#define SIOP_SSTAT1_WOA 0x04 /* Won arbitration */ -#define SIOP_SSTAT1_RST 0x02 /* SCSI RST current value */ -#define SIOP_SSTAT1_SDP 0x01 /* SCSI SDP current value */ - -/* Scsi status register 2 (sstat2) */ - -#define SIOP_SSTAT2_FF 0xf0 /* SCSI FIFO flags (bytecount) */ -# define SIOP_SCSI_FIFO_DEEP 8 -#define SIOP_SSTAT2_SDP 0x08 /* Latched (on REQ) SCSI SDP */ -#define SIOP_SSTAT2_MSG 0x04 /* Latched SCSI phase */ -#define SIOP_SSTAT2_CD 0x02 -#define SIOP_SSTAT2_IO 0x01 - -/* Chip test register 0 (ctest0) */ - -#define SIOP_CTEST0_RES0 0x80 -#define SIOP_CTEST0_BTD 0x40 /* Byte-to-byte Timer Disable */ -#define SIOP_CTEST0_GRP 0x20 /* Generate Receive Parity for Passthrough */ -#define SIOP_CTEST0_EAN 0x10 /* Enable Active Negation */ -#define SIOP_CTEST0_HSC 0x08 /* Halt SCSI clock */ -#define SIOP_CTEST0_ERF 0x04 /* Extend REQ/ACK Filtering */ -#define SIOP_CTEST0_RES1 0x02 -#define SIOP_CTEST0_DDIR 0x01 /* Xfer direction (1-> from SCSI bus) */ - -/* Chip test register 1 (ctest1) */ - -#define SIOP_CTEST1_FMT 0xf0 /* Byte empty in DMA FIFO bottom (high->byte3) */ -#define SIOP_CTEST1_FFL 0x0f /* Byte full in DMA FIFO top, same */ - -/* Chip test register 2 (ctest2) */ - -#define SIOP_CTEST2_RES 0x80 -#define SIOP_CTEST2_SIGP 0x40 /* Signal process */ -#define SIOP_CTEST2_SOFF 0x20 /* Synch Offset compare (1-> zero Init, max Tgt */ -#define SIOP_CTEST2_SFP 0x10 /* SCSI FIFO Parity */ -#define SIOP_CTEST2_DFP 0x08 /* DMA FIFO Parity */ -#define SIOP_CTEST2_TEOP 0x04 /* True EOP (a-la 5380) */ -#define SIOP_CTEST2_DREQ 0x02 /* DREQ status */ -#define SIOP_CTEST2_DACK 0x01 /* DACK status */ - -/* Chip test register 3 (ctest3) read-only, top of SCSI FIFO */ - -/* Chip test register 4 (ctest4) */ - -#define SIOP_CTEST4_MUX 0x80 /* Host bus multiplex mode */ -#define SIOP_CTEST4_ZMOD 0x40 /* High-impedance outputs */ -#define SIOP_CTEST4_SZM 0x20 /* ditto, SCSI "outputs" */ -#define SIOP_CTEST4_SLBE 0x10 /* SCSI loobpack enable */ -#define SIOP_CTEST4_SFWR 0x08 /* SCSI FIFO write enable (from sodl) */ -#define SIOP_CTEST4_FBL 0x07 /* DMA FIFO Byte Lane select (from ctest6) - 4->0, .. 7->3 */ - -/* Chip test register 5 (ctest5) */ - -#define SIOP_CTEST5_ADCK 0x80 /* Clock Address Incrementor */ -#define SIOP_CTEST5_BBCK 0x40 /* Clock Byte counter */ -#define SIOP_CTEST5_ROFF 0x20 /* Reset SCSI offset */ -#define SIOP_CTEST5_MASR 0x10 /* Master set/reset pulses (of bits 3-0) */ -#define SIOP_CTEST5_DDIR 0x08 /* (re)set internal DMA direction */ -#define SIOP_CTEST5_EOP 0x04 /* (re)set internal EOP */ -#define SIOP_CTEST5_DREQ 0x02 /* (re)set internal REQ */ -#define SIOP_CTEST5_DACK 0x01 /* (re)set internal ACK */ - -/* Chip test register 6 (ctest6) DMA FIFO access */ - -/* Chip test register 7 (ctest7) */ - -#define SIOP_CTEST7_CDIS 0x80 /* Cache burst disable */ -#define SIOP_CTEST7_SC1 0x40 /* Snoop control 1 */ -#define SIOP_CTEST7_SC0 0x20 /* Snoop contorl 0 */ -#define SIOP_CTEST7_INHIBIT (0 << 5) -#define SIOP_CTEST7_SNOOP (1 << 5) -#define SIOP_CTEST7_INVAL (2 << 5) -#define SIOP_CTEST7_RESV (3 << 5) -#define SIOP_CTEST7_STD 0x10 /* Selection timeout disable */ -#define SIOP_CTEST7_DFP 0x08 /* DMA FIFO parity bit */ -#define SIOP_CTEST7_EVP 0x04 /* Even parity (to host bus) */ -#define SIOP_CTEST7_TT1 0x02 /* Transfer type bit */ -#define SIOP_CTEST7_DIFF 0x01 /* Differential mode */ - -/* DMA FIFO register (dfifo) */ - -#define SIOP_DFIFO_RES 0x80 -#define SIOP_DFIFO_BO 0x7f /* FIFO byte offset counter */ - -/* Interrupt status register (istat) */ - -#define SIOP_ISTAT_ABRT 0x80 /* Abort operation */ -#define SIOP_ISTAT_RST 0x40 /* Software reset */ -#define SIOP_ISTAT_SIGP 0x20 /* Signal process */ -#define SIOP_ISTAT_RES 0x10 -#define SIOP_ISTAT_CON 0x08 /* Connected */ -#define SIOP_ISTAT_RES1 0x04 -#define SIOP_ISTAT_SIP 0x02 /* SCSI Interrupt pending */ -#define SIOP_ISTAT_DIP 0x01 /* DMA Interrupt pending */ - -/* Chip test register 8 (ctest8) - -#define SIOP_CTEST8_V 0xf0 /* Chip revision level */ -#define SIOP_CTEST8_FLF 0x08 /* Flush DMA FIFO */ -#define SIOP_CTEST8_CLF 0x04 /* Clear DMA and SCSI FIFOs */ -#define SIOP_CTEST8_FM 0x02 /* Fetch pin mode */ -#define SIOP_CTEST8_SM 0x01 /* Snoop pins mode */ - -/* DMA Mode register (dmode) */ - -#define SIOP_DMODE_BL_MASK 0xc0 /* 0->1 1->2 2->4 3->8 */ -#define SIOP_DMODE_FC 0x30 /* Function code */ -#define SIOP_DMODE_PD 0x08 /* Program/data */ -#define SIOP_DMODE_FAM 0x04 /* Fixed address mode */ -#define SIOP_DMODE_U0 0x02 /* User programmable transfer type */ -#define SIOP_DMODE_MAN 0x01 /* Manual start mode */ - -/* DMA interrupt enable register (dien) */ - -#define SIOP_DIEN_RES 0xc0 -#define SIOP_DIEN_BF 0x20 /* On Bus Fault */ -#define SIOP_DIEN_ABRT 0x10 /* On Abort */ -#define SIOP_DIEN_SSI 0x08 /* On SCRIPTS sstep */ -#define SIOP_DIEN_SIR 0x04 /* On SCRIPTS intr instruction */ -#define SIOP_DIEN_WTD 0x02 /* On watchdog timeout */ -#define SIOP_DIEN_IID 0x01 /* On illegal instruction detected */ - -/* DMA control register (dcntl) */ - -#define SIOP_DCNTL_CF_MASK 0xc0 /* Clock frequency dividers: - 0 --> 37.51..50.00 Mhz, div=2 - 1 --> 25.01..37.50 Mhz, div=1.5 - 2 --> 16.67..25.00 Mhz, div=1 - 3 --> 50.01..66.67 Mhz, div=3 - */ -#define SIOP_DCNTL_EA 0x20 /* Enable ack */ -#define SIOP_DCNTL_SSM 0x10 /* Single step mode */ -#define SIOP_DCNTL_LLM 0x08 /* Enable SCSI Low-level mode */ -#define SIOP_DCNTL_STD 0x04 /* Start DMA operation */ -#define SIOP_DCNTL_FA 0x02 /* Fast arbitration */ -#define SIOP_DCNTL_COM 0x01 /* 53C700 compatibility */ diff --git a/sys/arch/mvme88k/dev/siop.c b/sys/arch/mvme88k/dev/ssh.c index 7b3c06174c1..f029e67f2a2 100644 --- a/sys/arch/mvme88k/dev/siop.c +++ b/sys/arch/mvme88k/dev/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.5 2001/02/01 03:38:15 smurph Exp $ */ +/* $OpenBSD: ssh.c,v 1.1 2001/03/07 01:57:56 miod Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -36,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)siop.c 7.5 (Berkeley) 5/4/91 + * @(#)ssh.c 7.5 (Berkeley) 5/4/91 */ /* @@ -54,11 +54,11 @@ #include <scsi/scsiconf.h> #include <machine/autoconf.h> #if defined(MVME187) -#include <mvme88k/dev/siopreg.h> -#include <mvme88k/dev/siopvar.h> +#include <mvme88k/dev/sshreg.h> +#include <mvme88k/dev/sshvar.h> #else -#include <mvme68k/dev/siopreg.h> -#include <mvme68k/dev/siopvar.h> +#include <mvme68k/dev/sshreg.h> +#include <mvme68k/dev/sshvar.h> #endif /* MVME187 */ #if defined(MVME187) @@ -76,42 +76,42 @@ extern u_int kvtop(); #define SCSI_DATA_WAIT 500000 /* wait per data in/out step */ #define SCSI_INIT_WAIT 500000 /* wait per step (both) during init */ -void siop_select __P((struct siop_softc *)); -void siopabort __P((struct siop_softc *, siop_regmap_p, char *)); -void sioperror __P((struct siop_softc *, siop_regmap_p, u_char)); -void siopstart __P((struct siop_softc *)); -int siop_checkintr __P((struct siop_softc *, u_char, u_char, u_char, int *)); -void siopreset __P((struct siop_softc *)); -void siopsetdelay __P((int)); -void siop_scsidone __P((struct siop_acb *, int)); -void siop_sched __P((struct siop_softc *)); -int siop_poll __P((struct siop_softc *, struct siop_acb *)); -int siopintr __P((struct siop_softc *)); -void scsi_period_to_siop __P((struct siop_softc *, int)); -void siop_start __P((struct siop_softc *, int, int, u_char *, int, u_char *, int)); -void siop_dump_acb __P((struct siop_acb *)); +void ssh_select __P((struct ssh_softc *)); +void sshabort __P((struct ssh_softc *, ssh_regmap_p, char *)); +void ssherror __P((struct ssh_softc *, ssh_regmap_p, u_char)); +void sshstart __P((struct ssh_softc *)); +int ssh_checkintr __P((struct ssh_softc *, u_char, u_char, u_char, int *)); +void sshreset __P((struct ssh_softc *)); +void sshsetdelay __P((int)); +void ssh_scsidone __P((struct ssh_acb *, int)); +void ssh_sched __P((struct ssh_softc *)); +int ssh_poll __P((struct ssh_softc *, struct ssh_acb *)); +int sshintr __P((struct ssh_softc *)); +void scsi_period_to_ssh __P((struct ssh_softc *, int)); +void ssh_start __P((struct ssh_softc *, int, int, u_char *, int, u_char *, int)); +void ssh_dump_acb __P((struct ssh_acb *)); /* 53C710 script */ const #if defined(MVME187) -#include <mvme88k/dev/siop_script.out> +#include <mvme88k/dev/ssh_script.out> #else -#include <mvme68k/dev/siop_script.out> +#include <mvme68k/dev/ssh_script.out> #endif /* MVME187 */ u_long scsi_nosync = 0; int shift_nosync; /* default to not inhibit sync negotiation on any drive */ -u_char siop_inhibit_sync[8] = { 0, 0, 0, 0, 0, 0, 0 }; /* initialize, so patchable */ -u_char siop_allow_disc[8] = {3, 3, 3, 3, 3, 3, 3, 3}; -int siop_no_dma = 0; +u_char ssh_inhibit_sync[8] = { 0, 0, 0, 0, 0, 0, 0 }; /* initialize, so patchable */ +u_char ssh_allow_disc[8] = {3, 3, 3, 3, 3, 3, 3, 3}; +int ssh_no_dma = 0; -int siop_reset_delay = 250; /* delay after reset, in milleseconds */ +int ssh_reset_delay = 250; /* delay after reset, in milleseconds */ -int siop_cmd_wait = SCSI_CMD_WAIT; -int siop_data_wait = SCSI_DATA_WAIT; -int siop_init_wait = SCSI_INIT_WAIT; +int ssh_cmd_wait = SCSI_CMD_WAIT; +int ssh_data_wait = SCSI_DATA_WAIT; +int ssh_init_wait = SCSI_INIT_WAIT; extern struct pmap kernel_pmap_store; #define pmap_kernel() (&kernel_pmap_store) @@ -122,7 +122,7 @@ extern struct pmap kernel_pmap_store; */ static struct { unsigned char p; /* period from sync request message */ - unsigned char r; /* siop_period << 4 | sbcl */ + unsigned char r; /* ssh_period << 4 | sbcl */ } sync_tab[] = { { 60/4, 0<<4 | 1}, { 76/4, 1<<4 | 1}, @@ -155,33 +155,33 @@ static struct { /* * 0x01 - full debug * 0x02 - DMA chaining - * 0x04 - siopintr + * 0x04 - sshintr * 0x08 - phase mismatch * 0x10 - <not used> * 0x20 - panic on unhandled exceptions * 0x100 - disconnect/reselect */ -int siop_debug = 0; -int siopsync_debug = 0; -int siopdma_hits = 0; -int siopdma_misses = 0; -int siopchain_ints = 0; -int siopstarts = 0; -int siopints = 0; -int siopphmm = 0; -#define SIOP_TRACE_SIZE 128 -#define SIOP_TRACE(a,b,c,d) \ - siop_trbuf[siop_trix] = (a); \ - siop_trbuf[siop_trix+1] = (b); \ - siop_trbuf[siop_trix+2] = (c); \ - siop_trbuf[siop_trix+3] = (d); \ - siop_trix = (siop_trix + 4) & (SIOP_TRACE_SIZE - 1); -u_char siop_trbuf[SIOP_TRACE_SIZE]; -int siop_trix; -void siop_dump __P((struct siop_softc *)); -void siop_dump_trace __P((void)); +int ssh_debug = 0; +int sshsync_debug = 0; +int sshdma_hits = 0; +int sshdma_misses = 0; +int sshchain_ints = 0; +int sshstarts = 0; +int sshints = 0; +int sshphmm = 0; +#define SSH_TRACE_SIZE 128 +#define SSH_TRACE(a,b,c,d) \ + ssh_trbuf[ssh_trix] = (a); \ + ssh_trbuf[ssh_trix+1] = (b); \ + ssh_trbuf[ssh_trix+2] = (c); \ + ssh_trbuf[ssh_trix+3] = (d); \ + ssh_trix = (ssh_trix + 4) & (SSH_TRACE_SIZE - 1); +u_char ssh_trbuf[SSH_TRACE_SIZE]; +int ssh_trix; +void ssh_dump __P((struct ssh_softc *)); +void ssh_dump_trace __P((void)); #else -#define SIOP_TRACE(a,b,c,d) +#define SSH_TRACE(a,b,c,d) #endif int kludge_city = 1; @@ -200,10 +200,10 @@ wdummy(void) } /* - * default minphys routine for siop based controllers + * default minphys routine for ssh based controllers */ void -siop_minphys(bp) +ssh_minphys(bp) struct buf *bp; { @@ -214,15 +214,15 @@ siop_minphys(bp) } /* - * used by specific siop controller + * used by specific ssh controller * */ int -siop_scsicmd(xs) +ssh_scsicmd(xs) struct scsi_xfer *xs; { - struct siop_acb *acb; - struct siop_softc *sc; + struct ssh_acb *acb; + struct ssh_softc *sc; struct scsi_link *slp; int flags, s, i; @@ -233,12 +233,12 @@ siop_scsicmd(xs) /* XXXX ?? */ if (flags & SCSI_DATA_UIO) - panic("siop: scsi data uio requested"); + panic("ssh: scsi data uio requested"); /* XXXX ?? */ if (sc->sc_nexus && flags & SCSI_POLL) -/* panic("siop_scsicmd: busy");*/ - printf("siop_scsicmd: busy\n"); +/* panic("ssh_scsicmd: busy");*/ + printf("ssh_scsicmd: busy\n"); s = splbio(); acb = sc->free_list.tqh_first; @@ -264,7 +264,7 @@ siop_scsicmd(xs) * Since the 187 doesn't support cache snooping, we have * to flush the cache for a write and flush with inval for * a read, prior to starting the IO. - * We should move this siop_sched() XXX + * We should move this ssh_sched() XXX */ if (xs->flags & SCSI_DATA_IN) { /* read */ dma_cachectl((vm_offset_t)xs->data, xs->datalen, @@ -278,21 +278,21 @@ siop_scsicmd(xs) TAILQ_INSERT_TAIL(&sc->ready_list, acb, chain); if (sc->sc_nexus == NULL) - siop_sched(sc); + ssh_sched(sc); splx(s); - if (flags & SCSI_POLL || siop_no_dma) - return(siop_poll(sc, acb)); + if (flags & SCSI_POLL || ssh_no_dma) + return(ssh_poll(sc, acb)); return(SUCCESSFULLY_QUEUED); } int -siop_poll(sc, acb) - struct siop_softc *sc; - struct siop_acb *acb; +ssh_poll(sc, acb) + struct ssh_softc *sc; + struct ssh_acb *acb; { - siop_regmap_p rp = sc->sc_siopp; + ssh_regmap_p rp = sc->sc_sshp; struct scsi_xfer *xs = acb->xs; int i; int status; @@ -305,44 +305,44 @@ siop_poll(sc, acb) s = splbio(); to = xs->timeout / 1000; if (sc->nexus_list.tqh_first) - printf("%s: siop_poll called with disconnected device\n", + printf("%s: ssh_poll called with disconnected device\n", sc->sc_dev.dv_xname); for (;;) { /* use cmd_wait values? */ i = 50000; spl0(); - while (((istat = rp->siop_istat) & - (SIOP_ISTAT_SIP | SIOP_ISTAT_DIP)) == 0) { + while (((istat = rp->ssh_istat) & + (SSH_ISTAT_SIP | SSH_ISTAT_DIP)) == 0) { if (--i <= 0) { #ifdef DEBUG printf ("waiting: tgt %d cmd %02x sbcl %02x dsp %x (+%x) dcmd %x ds %x timeout %d\n", xs->sc_link->target, acb->cmd.opcode, - rp->siop_sbcl, rp->siop_dsp, - rp->siop_dsp - sc->sc_scriptspa, - *((long *)&rp->siop_dcmd), &acb->ds, acb->xs->timeout); + rp->ssh_sbcl, rp->ssh_dsp, + rp->ssh_dsp - sc->sc_scriptspa, + *((long *)&rp->ssh_dcmd), &acb->ds, acb->xs->timeout); #endif i = 50000; --to; if (to <= 0) { - siopreset(sc); + sshreset(sc); return(COMPLETE); } } delay(10); } - sstat0 = rp->siop_sstat0; + sstat0 = rp->ssh_sstat0; delay(10); - dstat = rp->siop_dstat; - if (siop_checkintr(sc, istat, dstat, sstat0, &status)) { + dstat = rp->ssh_dstat; + if (ssh_checkintr(sc, istat, dstat, sstat0, &status)) { if (acb != sc->sc_nexus) - printf("%s: siop_poll disconnected device completed\n", + printf("%s: ssh_poll disconnected device completed\n", sc->sc_dev.dv_xname); - else if ((sc->sc_flags & SIOP_INTDEFER) == 0) { - sc->sc_flags &= ~SIOP_INTSOFF; - rp->siop_sien = sc->sc_sien; - rp->siop_dien = sc->sc_dien; + else if ((sc->sc_flags & SSH_INTDEFER) == 0) { + sc->sc_flags &= ~SSH_INTSOFF; + rp->ssh_sien = sc->sc_sien; + rp->ssh_dien = sc->sc_dien; } - siop_scsidone(sc->sc_nexus, status); + ssh_scsidone(sc->sc_nexus, status); } if (xs->flags & ITSDONE) break; @@ -355,16 +355,16 @@ siop_poll(sc, acb) * start next command that's ready */ void -siop_sched(sc) - struct siop_softc *sc; +ssh_sched(sc) + struct ssh_softc *sc; { struct scsi_link *slp; - struct siop_acb *acb; + struct ssh_acb *acb; int stat, i; #ifdef DEBUG if (sc->sc_nexus) { - printf("%s: siop_sched- nexus %x/%d ready %x/%d\n", + printf("%s: ssh_sched- nexus %x/%d ready %x/%d\n", sc->sc_dev.dv_xname, sc->sc_nexus, sc->sc_nexus->xs->sc_link->target, sc->ready_list.tqh_first, @@ -376,7 +376,7 @@ siop_sched(sc) slp = acb->xs->sc_link; i = slp->target; if(!(sc->sc_tinfo[i].lubusy & (1 << slp->lun))) { - struct siop_tinfo *ti = &sc->sc_tinfo[i]; + struct ssh_tinfo *ti = &sc->sc_tinfo[i]; TAILQ_REMOVE(&sc->ready_list, acb, chain); sc->sc_nexus = acb; @@ -389,35 +389,35 @@ siop_sched(sc) if (acb == NULL) { #ifdef DEBUGXXX - printf("%s: siop_sched didn't find ready command\n", + printf("%s: ssh_sched didn't find ready command\n", sc->sc_dev.dv_xname); #endif return; } if (acb->xs->flags & SCSI_RESET) - siopreset(sc); + sshreset(sc); #if 0 acb->cmd.bytes[0] |= slp->lun << 5; /* XXXX */ #endif ++sc->sc_active; - siop_select(sc); + ssh_select(sc); } void -siop_scsidone(acb, stat) - struct siop_acb *acb; +ssh_scsidone(acb, stat) + struct ssh_acb *acb; int stat; { struct scsi_xfer *xs = acb->xs; struct scsi_link *slp = xs->sc_link; - struct siop_softc *sc = slp->adapter_softc; + struct ssh_softc *sc = slp->adapter_softc; int s, dosched = 0; if (acb == NULL || (xs = acb->xs) == NULL) { #ifdef DIAGNOSTIC - printf("siop_scsidone: NULL acb or scsi_xfer\n"); + printf("ssh_scsidone: NULL acb or scsi_xfer\n"); #if defined(DEBUG) && defined(DDB) Debugger(); #endif @@ -449,9 +449,9 @@ siop_scsidone(acb, stat) sc->sc_tinfo[slp->target].senses++; if (sc->sc_nexus == acb) { sc->sc_nexus = NULL; - siop_sched(sc); + ssh_sched(sc); } - SIOP_TRACE('d','s',0,0) + SSH_TRACE('d','s',0,0) return; } } @@ -480,12 +480,12 @@ siop_scsidone(acb, stat) if (sc->ready_list.tqh_first) dosched = 1; /* start next command */ --sc->sc_active; - SIOP_TRACE('d','a',stat,0) + SSH_TRACE('d','a',stat,0) } else if (sc->ready_list.tqh_last == &acb->chain.tqe_next) { TAILQ_REMOVE(&sc->ready_list, acb, chain); - SIOP_TRACE('d','r',stat,0) + SSH_TRACE('d','r',stat,0) } else { - register struct siop_acb *acb2; + register struct ssh_acb *acb2; for (acb2 = sc->nexus_list.tqh_first; acb2; acb2 = acb2->chain.tqe_next) if (acb2 == acb) { @@ -507,7 +507,7 @@ siop_scsidone(acb, stat) /* Debugger(); */ #endif } - SIOP_TRACE('d','n',stat,0); + SSH_TRACE('d','n',stat,0); } /* Put it on the free list. */ acb->flags = ACB_FREE; @@ -518,20 +518,20 @@ siop_scsidone(acb, stat) scsi_done(xs); if (dosched && sc->sc_nexus == NULL) - siop_sched(sc); + ssh_sched(sc); } void -siopabort(sc, rp, where) - register struct siop_softc *sc; - siop_regmap_p rp; +sshabort(sc, rp, where) + register struct ssh_softc *sc; + ssh_regmap_p rp; char *where; { int i; printf ("%s: abort %s: dstat %02x, sstat0 %02x sbcl %02x\n", sc->sc_dev.dv_xname, - where, rp->siop_dstat, rp->siop_sstat0, rp->siop_sbcl); + where, rp->ssh_dstat, rp->ssh_sstat0, rp->ssh_sbcl); if (sc->sc_active > 0) { #ifdef TODO @@ -565,7 +565,7 @@ siopabort(sc, rp, where) for (i = 0; i < 2; ++i) { if (sc->sc_iob[i].sc_xs && &sc->sc_iob[i] != sc->sc_cur) { - printf ("siopabort: cleanup!\n"); + printf ("sshabort: cleanup!\n"); sc->sc_iob[i].sc_xs = NULL; } } @@ -575,8 +575,8 @@ siopabort(sc, rp, where) } void -siopinitialize(sc) - struct siop_softc *sc; +sshinitialize(sc) + struct ssh_softc *sc; { /* * Need to check that scripts is on a long word boundary @@ -589,10 +589,10 @@ siopinitialize(sc) * malloc sc_acb to ensure that DS is on a long word boundary. */ - MALLOC(sc->sc_acb, struct siop_acb *, - sizeof(struct siop_acb) * SIOP_NACB, M_DEVBUF, M_NOWAIT); + MALLOC(sc->sc_acb, struct ssh_acb *, + sizeof(struct ssh_acb) * SSH_NACB, M_DEVBUF, M_NOWAIT); if (sc->sc_acb == NULL) - panic("siopinitialize: ACB malloc failed!"); + panic("sshinitialize: ACB malloc failed!"); sc->sc_tcp[1] = 1000 / sc->sc_clock_freq; sc->sc_tcp[2] = 1500 / sc->sc_clock_freq; @@ -611,22 +611,22 @@ siopinitialize(sc) sc->sc_tcp[0] = 3000 / sc->sc_clock_freq; #endif - siopreset (sc); + sshreset (sc); } void -siopreset(sc) - struct siop_softc *sc; +sshreset(sc) + struct ssh_softc *sc; { - siop_regmap_p rp; + ssh_regmap_p rp; u_int i, s; u_char dummy; - struct siop_acb *acb; + struct ssh_acb *acb; - rp = sc->sc_siopp; + rp = sc->sc_sshp; - if (sc->sc_flags & SIOP_ALIVE) - siopabort(sc, rp, "reset"); + if (sc->sc_flags & SSH_ALIVE) + sshabort(sc, rp, "reset"); s = splbio(); @@ -634,55 +634,55 @@ siopreset(sc) * Reset the chip * XXX - is this really needed? */ - rp->siop_istat |= SIOP_ISTAT_ABRT; /* abort current script */ - rp->siop_istat |= SIOP_ISTAT_RST; /* reset chip */ - rp->siop_istat &= ~SIOP_ISTAT_RST; + rp->ssh_istat |= SSH_ISTAT_ABRT; /* abort current script */ + rp->ssh_istat |= SSH_ISTAT_RST; /* reset chip */ + rp->ssh_istat &= ~SSH_ISTAT_RST; /* * Reset SCSI bus (do we really want this?) */ - rp->siop_sien = 0; - rp->siop_scntl1 |= SIOP_SCNTL1_RST; + rp->ssh_sien = 0; + rp->ssh_scntl1 |= SSH_SCNTL1_RST; delay(25); - rp->siop_scntl1 &= ~SIOP_SCNTL1_RST; + rp->ssh_scntl1 &= ~SSH_SCNTL1_RST; /* * Set up various chip parameters */ - rp->siop_scntl0 = SIOP_ARB_FULL | SIOP_SCNTL0_EPC | SIOP_SCNTL0_EPG; - rp->siop_scntl1 = SIOP_SCNTL1_ESR; - rp->siop_dcntl = sc->sc_dcntl; - rp->siop_dmode = 0x80; /* burst length = 4 */ - rp->siop_sien = 0x00; /* don't enable interrupts yet */ - rp->siop_dien = 0x00; /* don't enable interrupts yet */ - rp->siop_scid = 1 << sc->sc_link.adapter_target; - rp->siop_dwt = 0x00; - rp->siop_ctest0 |= SIOP_CTEST0_BTD | SIOP_CTEST0_EAN; - rp->siop_ctest7 = sc->sc_ctest7; + rp->ssh_scntl0 = SSH_ARB_FULL | SSH_SCNTL0_EPC | SSH_SCNTL0_EPG; + rp->ssh_scntl1 = SSH_SCNTL1_ESR; + rp->ssh_dcntl = sc->sc_dcntl; + rp->ssh_dmode = 0x80; /* burst length = 4 */ + rp->ssh_sien = 0x00; /* don't enable interrupts yet */ + rp->ssh_dien = 0x00; /* don't enable interrupts yet */ + rp->ssh_scid = 1 << sc->sc_link.adapter_target; + rp->ssh_dwt = 0x00; + rp->ssh_ctest0 |= SSH_CTEST0_BTD | SSH_CTEST0_EAN; + rp->ssh_ctest7 = sc->sc_ctest7; /* will need to re-negotiate sync xfers */ bzero(&sc->sc_sync, sizeof (sc->sc_sync)); - i = rp->siop_istat; - if (i & SIOP_ISTAT_SIP) - dummy = rp->siop_sstat0; + i = rp->ssh_istat; + if (i & SSH_ISTAT_SIP) + dummy = rp->ssh_sstat0; delay(1); - if (i & SIOP_ISTAT_DIP) - dummy = rp->siop_dstat; + if (i & SSH_ISTAT_DIP) + dummy = rp->ssh_dstat; splx (s); - delay (siop_reset_delay * 1000); - printf(": version %d target %d\n", rp->siop_ctest8 >> 4, + delay (ssh_reset_delay * 1000); + printf(": version %d target %d\n", rp->ssh_ctest8 >> 4, sc->sc_link.adapter_target); - if ((sc->sc_flags & SIOP_ALIVE) == 0) { + if ((sc->sc_flags & SSH_ALIVE) == 0) { TAILQ_INIT(&sc->ready_list); TAILQ_INIT(&sc->nexus_list); TAILQ_INIT(&sc->free_list); sc->sc_nexus = NULL; acb = sc->sc_acb; - bzero(acb, sizeof(struct siop_acb) * SIOP_NACB); - for (i = 0; i < SIOP_NACB; i++) { + bzero(acb, sizeof(struct ssh_acb) * SSH_NACB); + for (i = 0; i < SSH_NACB; i++) { pmap_cache_ctrl(pmap_kernel(), M88K_TRUNC_PAGE((vm_offset_t)acb), @@ -696,24 +696,24 @@ siopreset(sc) } else { if (sc->sc_nexus != NULL) { sc->sc_nexus->xs->error = XS_DRIVER_STUFFUP; - siop_scsidone(sc->sc_nexus, sc->sc_nexus->stat[0]); + ssh_scsidone(sc->sc_nexus, sc->sc_nexus->stat[0]); } while (acb = sc->nexus_list.tqh_first) { acb->xs->error = XS_DRIVER_STUFFUP; - siop_scsidone(acb, acb->stat[0]); + ssh_scsidone(acb, acb->stat[0]); } } - sc->sc_flags |= SIOP_ALIVE; - sc->sc_flags &= ~(SIOP_INTDEFER|SIOP_INTSOFF); + sc->sc_flags |= SSH_ALIVE; + sc->sc_flags &= ~(SSH_INTDEFER|SSH_INTSOFF); /* enable SCSI and DMA interrupts */ /* XXX turn on SEL interrupt? nivas */ - sc->sc_sien = SIOP_SIEN_M_A | SIOP_SIEN_STO | /*SIOP_SIEN_SEL |*/ SIOP_SIEN_SGE | - SIOP_SIEN_UDC | SIOP_SIEN_RST | SIOP_SIEN_PAR; - sc->sc_dien = SIOP_DIEN_BF | SIOP_DIEN_ABRT | SIOP_DIEN_SIR | - /*SIOP_DIEN_WTD |*/ SIOP_DIEN_IID; - rp->siop_sien = sc->sc_sien; - rp->siop_dien = sc->sc_dien; + sc->sc_sien = SSH_SIEN_M_A | SSH_SIEN_STO | /*SSH_SIEN_SEL |*/ SSH_SIEN_SGE | + SSH_SIEN_UDC | SSH_SIEN_RST | SSH_SIEN_PAR; + sc->sc_dien = SSH_DIEN_BF | SSH_DIEN_ABRT | SSH_DIEN_SIR | + /*SSH_DIEN_WTD |*/ SSH_DIEN_IID; + rp->ssh_sien = sc->sc_sien; + rp->ssh_dien = sc->sc_dien; } /* @@ -721,8 +721,8 @@ siopreset(sc) */ void -siop_start (sc, target, lun, cbuf, clen, buf, len) - struct siop_softc *sc; +ssh_start (sc, target, lun, cbuf, clen, buf, len) + struct ssh_softc *sc; int target; int lun; u_char *cbuf; @@ -730,28 +730,28 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) u_char *buf; int len; { - siop_regmap_p rp = sc->sc_siopp; + ssh_regmap_p rp = sc->sc_sshp; int i; int nchain; int count, tcount; char *addr, *dmaend; - struct siop_acb *acb = sc->sc_nexus; + struct ssh_acb *acb = sc->sc_nexus; #ifdef DEBUG - if (siop_debug & 0x100 && rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy: rp %x script %x dsa %x active %d\n", + if (ssh_debug & 0x100 && rp->ssh_sbcl & SSH_BSY) { + printf ("ACK! ssh was busy: rp %x script %x dsa %x active %d\n", rp, &scripts, &acb->ds, sc->sc_active); printf ("istat %02x sfbr %02x lcrc %02x sien %02x dien %02x\n", - rp->siop_istat, rp->siop_sfbr, rp->siop_lcrc, - rp->siop_sien, rp->siop_dien); + rp->ssh_istat, rp->ssh_sfbr, rp->ssh_lcrc, + rp->ssh_sien, rp->ssh_dien); #ifdef DDB /*Debugger();*/ #endif } #endif acb->msgout[0] = MSG_IDENTIFY | lun; - if (siop_allow_disc[target] & 2 || - (siop_allow_disc[target] && len == 0)) + if (ssh_allow_disc[target] & 2 || + (ssh_allow_disc[target] && len == 0)) acb->msgout[0] = MSG_IDENTIFY_DR | lun; acb->status = 0; acb->stat[0] = -1; @@ -775,12 +775,12 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) bzero(&acb->ds.chain, sizeof (acb->ds.chain)); if (sc->sc_sync[target].state == SYNC_START) { - if (siop_inhibit_sync[target]) { + if (ssh_inhibit_sync[target]) { sc->sc_sync[target].state = SYNC_DONE; sc->sc_sync[target].sbcl = 0; sc->sc_sync[target].sxfer = 0; #ifdef DEBUG - if (siopsync_debug) + if (sshsync_debug) printf ("Forcing target %d asynchronous\n", target); #endif } @@ -794,11 +794,11 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) #else acb->msgout[4] = sc->sc_minsync; #endif - acb->msgout[5] = SIOP_MAX_OFFSET; + acb->msgout[5] = SSH_MAX_OFFSET; acb->ds.idlen = 6; sc->sc_sync[target].state = SYNC_SENT; #ifdef DEBUG - if (siopsync_debug) + if (sshsync_debug) printf ("Sending sync request to target %d\n", target); #endif } @@ -826,7 +826,7 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) acb->ds.chain[nchain].datalen = 0; acb->ds.chain[--nchain].datalen += tcount; #ifdef DEBUG - ++siopdma_hits; + ++sshdma_hits; #endif } else { @@ -835,13 +835,13 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) acb->ds.chain[nchain].datalen = tcount; #ifdef DEBUG if (nchain) /* Don't count miss on first one */ - ++siopdma_misses; + ++sshdma_misses; #endif } ++nchain; } #ifdef DEBUG - if (nchain != 1 && len != 0 && siop_debug & 3) { + if (nchain != 1 && len != 0 && ssh_debug & 3) { printf ("DMA chaining set: %d\n", nchain); for (i = 0; i < nchain; ++i) { printf (" [%d] %8x %4x\n", i, acb->ds.chain[i].databuf, @@ -852,7 +852,7 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) #if CACHECTL /* push data cache for all data the 53c710 needs to access */ - dma_cachectl(sc, sizeof (struct siop_softc), DMA_CACHE_SYNC); + dma_cachectl(sc, sizeof (struct ssh_softc), DMA_CACHE_SYNC); dma_cachectl(acb, sizeof (*acb), DMA_CACHE_SYNC); #endif dma_cachectl((vm_offset_t)cbuf, clen, DMA_CACHE_SYNC); @@ -875,8 +875,8 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) #endif #ifdef DEBUG - if (siop_debug & 0x100 && rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy at start: rp %x script %x dsa %x active %d\n", + if (ssh_debug & 0x100 && rp->ssh_sbcl & SSH_BSY) { + printf ("ACK! ssh was busy at start: rp %x script %x dsa %x active %d\n", rp, &scripts, &acb->ds, sc->sc_active); #ifdef DDB /*Debugger();*/ @@ -884,81 +884,81 @@ siop_start (sc, target, lun, cbuf, clen, buf, len) } #endif if (sc->nexus_list.tqh_first == NULL) { - if (rp->siop_istat & SIOP_ISTAT_CON) - printf("%s: siop_select while connected?\n", + if (rp->ssh_istat & SSH_ISTAT_CON) + printf("%s: ssh_select while connected?\n", sc->sc_dev.dv_xname); - rp->siop_temp = 0; - rp->siop_sbcl = sc->sc_sync[target].sbcl; - rp->siop_dsa = kvtop(&acb->ds); - rp->siop_dsp = sc->sc_scriptspa; - SIOP_TRACE('s',1,0,0) + rp->ssh_temp = 0; + rp->ssh_sbcl = sc->sc_sync[target].sbcl; + rp->ssh_dsa = kvtop(&acb->ds); + rp->ssh_dsp = sc->sc_scriptspa; + SSH_TRACE('s',1,0,0) } else { /* - * SIOP is waiting for a reselect. If it is not + * SSH is waiting for a reselect. If it is not * yet connected to the BUS, signal to change state. * Else, leave it alone - later on, the reselect interrupt * will take care of this request. */ - if ((rp->siop_istat & SIOP_ISTAT_CON) == 0) { - rp->siop_istat = SIOP_ISTAT_SIGP; - SIOP_TRACE('s',2,0,0); + if ((rp->ssh_istat & SSH_ISTAT_CON) == 0) { + rp->ssh_istat = SSH_ISTAT_SIGP; + SSH_TRACE('s',2,0,0); } else { - SIOP_TRACE('s',3,rp->siop_istat,0); + SSH_TRACE('s',3,rp->ssh_istat,0); } } #ifdef DEBUG - ++siopstarts; + ++sshstarts; #endif } /* - * Process a DMA or SCSI interrupt from the 53C710 SIOP + * Process a DMA or SCSI interrupt from the 53C710 SSH */ int -siop_checkintr(sc, istat, dstat, sstat0, status) - struct siop_softc *sc; +ssh_checkintr(sc, istat, dstat, sstat0, status) + struct ssh_softc *sc; u_char istat; u_char dstat; u_char sstat0; int *status; { - siop_regmap_p rp = sc->sc_siopp; - struct siop_acb *acb = sc->sc_nexus; + ssh_regmap_p rp = sc->sc_sshp; + struct ssh_acb *acb = sc->sc_nexus; int target = 0; int dfifo, dbc, sstat1; int dummy; - dfifo = rp->siop_dfifo; - dbc = rp->siop_dbc0; - sstat1 = rp->siop_sstat1; + dfifo = rp->ssh_dfifo; + dbc = rp->ssh_dbc0; + sstat1 = rp->ssh_sstat1; /* * Flush DMA and SCSI FIFOs. */ - rp->siop_ctest8 |= SIOP_CTEST8_CLF; - while ((rp->siop_ctest1 & SIOP_CTEST1_FMT) != SIOP_CTEST1_FMT){ + rp->ssh_ctest8 |= SSH_CTEST8_CLF; + while ((rp->ssh_ctest1 & SSH_CTEST1_FMT) != SSH_CTEST1_FMT){ wdummy(); } ; - rp->siop_ctest8 &= ~SIOP_CTEST8_CLF; + rp->ssh_ctest8 &= ~SSH_CTEST8_CLF; #ifdef DEBUG - ++siopints; + ++sshints; #if 0 - if (siop_debug & 0x100) { + if (ssh_debug & 0x100) { DCIAS(&acb->stat[0]); /* XXX */ - printf ("siopchkintr: istat %x dstat %x sstat0 %x dsps %x sbcl %x sts %x msg %x\n", - istat, dstat, sstat0, rp->siop_dsps, rp->siop_sbcl, acb->stat[0], acb->msg[0]); + printf ("sshchkintr: istat %x dstat %x sstat0 %x dsps %x sbcl %x sts %x msg %x\n", + istat, dstat, sstat0, rp->ssh_dsps, rp->ssh_sbcl, acb->stat[0], acb->msg[0]); printf ("sync msg in: %02x %02x %02x %02x %02x %02x\n", acb->msg[0], acb->msg[1], acb->msg[2], acb->msg[3], acb->msg[4], acb->msg[5]); } #endif - if (rp->siop_dsp && (rp->siop_dsp < sc->sc_scriptspa || - rp->siop_dsp >= sc->sc_scriptspa + sizeof(scripts))) { + if (rp->ssh_dsp && (rp->ssh_dsp < sc->sc_scriptspa || + rp->ssh_dsp >= sc->sc_scriptspa + sizeof(scripts))) { printf ("%s: dsp not within script dsp %x scripts %x:%x", - sc->sc_dev.dv_xname, rp->siop_dsp, sc->sc_scriptspa, + sc->sc_dev.dv_xname, rp->ssh_dsp, sc->sc_scriptspa, sc->sc_scriptspa + sizeof(scripts)); printf(" istat %x dstat %x sstat0 %x\n", istat, dstat, sstat0); @@ -967,14 +967,14 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif } #endif - SIOP_TRACE('i',dstat,istat,(istat&SIOP_ISTAT_DIP)?rp->siop_dsps&0xff:sstat0); - if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff00) { + SSH_TRACE('i',dstat,istat,(istat&SSH_ISTAT_DIP)?rp->ssh_dsps&0xff:sstat0); + if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff00) { /* Normal completion status, or check condition */ #ifdef DEBUG - if (rp->siop_dsa != kvtop(&acb->ds)) { - printf ("siop: invalid dsa: %x %x\n", rp->siop_dsa, + if (rp->ssh_dsa != kvtop(&acb->ds)) { + printf ("ssh: invalid dsa: %x %x\n", rp->ssh_dsa, kvtop(&acb->ds)); - panic("*** siop DSA invalid ***"); + panic("*** ssh DSA invalid ***"); } #endif if (acb == NULL) { @@ -986,7 +986,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) target = acb->xs->sc_link->target; if (sc->sc_sync[target].state == SYNC_SENT) { #ifdef DEBUG - if (siopsync_debug) + if (sshsync_debug) printf ("sync msg in: %02x %02x %02x %02x %02x %02x\n", acb->msg[0], acb->msg[1], acb->msg[2], acb->msg[3], acb->msg[4], acb->msg[5]); @@ -1028,7 +1028,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) printf ("%s: target %d now synchronous, period=%dns, offset=%d\n", sc->sc_dev.dv_xname, target, acb->msg[4] * 4, acb->msg[5]); - scsi_period_to_siop (sc, target); + scsi_period_to_ssh (sc, target); } } #if CACHECTL @@ -1037,8 +1037,8 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif *status = acb->stat[0]; #ifdef DEBUG - if (rp->siop_sbcl & SIOP_BSY) { - /*printf ("ACK! siop was busy at end: rp %x script %x dsa %x\n", + if (rp->ssh_sbcl & SSH_BSY) { + /*printf ("ACK! ssh was busy at end: rp %x script %x dsa %x\n", rp, &scripts, &acb->ds);*/ #ifdef DDB /*Debugger();*/ @@ -1049,12 +1049,12 @@ siop_checkintr(sc, istat, dstat, sstat0, status) sc->sc_dev.dv_xname, acb->msg[0]); #endif if (sc->nexus_list.tqh_first) - rp->siop_dcntl |= SIOP_DCNTL_STD; + rp->ssh_dcntl |= SSH_DCNTL_STD; return 1; } - if (sstat0 & SIOP_SSTAT0_M_A) { /* Phase mismatch */ + if (sstat0 & SSH_SSTAT0_M_A) { /* Phase mismatch */ #ifdef DEBUG - ++siopphmm; + ++sshphmm; if (acb == NULL) printf("%s: Phase mismatch with no active command?\n", sc->sc_dev.dv_xname); @@ -1062,19 +1062,19 @@ siop_checkintr(sc, istat, dstat, sstat0, status) if (acb->iob_len) { int adjust; adjust = ((dfifo - (dbc & 0x7f)) & 0x7f); - if (sstat1 & SIOP_SSTAT1_ORF) + if (sstat1 & SSH_SSTAT1_ORF) ++adjust; - if (sstat1 & SIOP_SSTAT1_OLF) + if (sstat1 & SSH_SSTAT1_OLF) ++adjust; - acb->iob_curlen = *((long *)&rp->siop_dcmd) & 0xffffff; + acb->iob_curlen = *((long *)&rp->ssh_dcmd) & 0xffffff; acb->iob_curlen += adjust; - acb->iob_curbuf = *((long *)&rp->siop_dnad) - adjust; + acb->iob_curbuf = *((long *)&rp->ssh_dnad) - adjust; #ifdef DEBUG - if (siop_debug & 0x100) { + if (ssh_debug & 0x100) { int i; printf ("Phase mismatch: curbuf %x curlen %x dfifo %x dbc %x sstat1 %x adjust %x sbcl %x starts %d acb %x\n", acb->iob_curbuf, acb->iob_curlen, dfifo, - dbc, sstat1, adjust, rp->siop_sbcl, siopstarts, acb); + dbc, sstat1, adjust, rp->ssh_sbcl, sshstarts, acb); if (acb->ds.chain[1].datalen) { for (i = 0; acb->ds.chain[i].datalen; ++i) printf("chain[%d] addr %x len %x\n", @@ -1089,54 +1089,54 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif } #ifdef DEBUG - SIOP_TRACE('m',rp->siop_sbcl,(rp->siop_dsp>>8),rp->siop_dsp); - if (siop_debug & 9) + SSH_TRACE('m',rp->ssh_sbcl,(rp->ssh_dsp>>8),rp->ssh_dsp); + if (ssh_debug & 9) printf ("Phase mismatch: %x dsp +%x dcmd %x\n", - rp->siop_sbcl, - rp->siop_dsp - sc->sc_scriptspa, - *((long *)&rp->siop_dcmd)); + rp->ssh_sbcl, + rp->ssh_dsp - sc->sc_scriptspa, + *((long *)&rp->ssh_dcmd)); #endif - if ((rp->siop_sbcl & SIOP_REQ) == 0) { + if ((rp->ssh_sbcl & SSH_REQ) == 0) { printf ("Phase mismatch: REQ not asserted! %02x dsp %x\n", - rp->siop_sbcl, rp->siop_dsp); + rp->ssh_sbcl, rp->ssh_dsp); #ifdef DEBUG Debugger(); #endif } - switch (rp->siop_sbcl & 7) { + switch (rp->ssh_sbcl & 7) { case 0: /* data out */ case 1: /* data in */ case 2: /* status */ case 3: /* command */ case 6: /* message in */ case 7: /* message out */ - rp->siop_dsp = sc->sc_scriptspa + Ent_switch; + rp->ssh_dsp = sc->sc_scriptspa + Ent_switch; break; default: goto bad_phase; } return 0; } - if (sstat0 & SIOP_SSTAT0_STO) { /* Select timed out */ + if (sstat0 & SSH_SSTAT0_STO) { /* Select timed out */ #ifdef DEBUG if (acb == NULL) printf("%s: Select timeout with no active command?\n", sc->sc_dev.dv_xname); - if (rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy at timeout: rp %x script %x dsa %x\n", + if (rp->ssh_sbcl & SSH_BSY) { + printf ("ACK! ssh was busy at timeout: rp %x script %x dsa %x\n", rp, &scripts, &acb->ds); printf(" sbcl %x sdid %x istat %x dstat %x sstat0 %x\n", - rp->siop_sbcl, rp->siop_sdid, istat, dstat, sstat0); - if (!(rp->siop_sbcl & SIOP_BSY)) { + rp->ssh_sbcl, rp->ssh_sdid, istat, dstat, sstat0); + if (!(rp->ssh_sbcl & SSH_BSY)) { printf ("Yikes, it's not busy now!\n"); #if 0 *status = -1; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return 1; #endif } -/* rp->siop_dcntl |= SIOP_DCNTL_STD;*/ +/* rp->ssh_dcntl |= SSH_DCNTL_STD;*/ return (0); #ifdef DDB Debugger(); @@ -1146,14 +1146,14 @@ siop_checkintr(sc, istat, dstat, sstat0, status) *status = -1; acb->xs->error = XS_SELTIMEOUT; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return 1; } if (acb) target = acb->xs->sc_link->target; else target = 7; - if (sstat0 & SIOP_SSTAT0_UDC) { + if (sstat0 & SSH_SSTAT0_UDC) { #ifdef DEBUG if (acb == NULL) printf("%s: Unexpected disconnect with no active command?\n", @@ -1162,22 +1162,22 @@ siop_checkintr(sc, istat, dstat, sstat0, status) sc->sc_dev.dv_xname, target); #endif #if 0 - siopabort (sc, rp, "siopchkintr"); + sshabort (sc, rp, "sshchkintr"); #endif *status = STS_BUSY; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return 1; } - if (dstat & SIOP_DSTAT_SIR && (rp->siop_dsps == 0xff01 || - rp->siop_dsps == 0xff02)) { + if (dstat & SSH_DSTAT_SIR && (rp->ssh_dsps == 0xff01 || + rp->ssh_dsps == 0xff02)) { #ifdef DEBUG - if (siop_debug & 0x100) + if (ssh_debug & 0x100) printf ("%s: ID %02x disconnected TEMP %x (+%x) curbuf %x curlen %x buf %x len %x dfifo %x dbc %x sstat1 %x starts %d acb %x\n", - sc->sc_dev.dv_xname, 1 << target, rp->siop_temp, - rp->siop_temp ? rp->siop_temp - sc->sc_scriptspa : 0, + sc->sc_dev.dv_xname, 1 << target, rp->ssh_temp, + rp->ssh_temp ? rp->ssh_temp - sc->sc_scriptspa : 0, acb->iob_curbuf, acb->iob_curlen, - acb->ds.chain[0].databuf, acb->ds.chain[0].datalen, dfifo, dbc, sstat1, siopstarts, acb); + acb->ds.chain[0].databuf, acb->ds.chain[0].datalen, dfifo, dbc, sstat1, sshstarts, acb); #endif if (acb == NULL) { printf("%s: Disconnect with no active command?\n", @@ -1192,8 +1192,8 @@ siop_checkintr(sc, istat, dstat, sstat0, status) * occurs on a DMA block boundary, we have to figure out * which DMA block it was. */ - if (acb->iob_len && rp->siop_temp) { - int n = rp->siop_temp - sc->sc_scriptspa; + if (acb->iob_len && rp->ssh_temp) { + int n = rp->ssh_temp - sc->sc_scriptspa; if (acb->iob_curlen && acb->iob_curlen != acb->ds.chain[0].datalen) printf("%s: iob_curbuf/len already set? n %x iob %x/%x chain[0] %x/%x\n", @@ -1210,7 +1210,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) acb->iob_curlen = acb->ds.chain[n].datalen; } #ifdef DEBUG - if (siop_debug & 0x100) { + if (ssh_debug & 0x100) { printf("%s: TEMP offset %d", sc->sc_dev.dv_xname, n); printf(" curbuf %x curlen %x\n", acb->iob_curbuf, acb->iob_curlen); @@ -1228,10 +1228,10 @@ siop_checkintr(sc, istat, dstat, sstat0, status) int i, j; #ifdef DEBUG - if (siop_debug & 0x100) + if (ssh_debug & 0x100) printf ("%s: adjusting DMA chain\n", sc->sc_dev.dv_xname); - if (rp->siop_dsps == 0xff02) + if (rp->ssh_dsps == 0xff02) printf ("%s: ID %02x disconnected without Save Data Pointers\n", sc->sc_dev.dv_xname, 1 << target); #endif @@ -1246,7 +1246,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) if (i >= DMAMAXIO || acb->ds.chain[i].datalen == 0) printf("couldn't find saved data pointer\n"); #ifdef DEBUG - if (siop_debug & 0x100) + if (ssh_debug & 0x100) printf(" chain[0]: %x/%x -> %x/%x\n", acb->ds.chain[0].databuf, acb->ds.chain[0].datalen, @@ -1257,7 +1257,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) acb->ds.chain[0].datalen = acb->iob_curlen; for (j = 1, ++i; i < DMAMAXIO && acb->ds.chain[i].datalen; ++i, ++j) { #ifdef DEBUG - if (siop_debug & 0x100) + if (ssh_debug & 0x100) printf(" chain[%d]: %x/%x -> %x/%x\n", j, acb->ds.chain[j].databuf, acb->ds.chain[j].datalen, @@ -1280,30 +1280,30 @@ siop_checkintr(sc, istat, dstat, sstat0, status) * clear nexus * try to start another command for another target/lun */ - acb->status = sc->sc_flags & SIOP_INTSOFF; + acb->status = sc->sc_flags & SSH_INTSOFF; TAILQ_INSERT_HEAD(&sc->nexus_list, acb, chain); sc->sc_nexus = NULL; /* no current device */ /* start script to wait for reselect */ if (sc->sc_nexus == NULL) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; /* XXXX start another command ? */ if (sc->ready_list.tqh_first) - siop_sched(sc); + ssh_sched(sc); return (0); } - if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff03) { - int reselid = rp->siop_scratch & 0x7f; - int reselun = rp->siop_sfbr & 0x07; + if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff03) { + int reselid = rp->ssh_scratch & 0x7f; + int reselun = rp->ssh_sfbr & 0x07; - sc->sc_sstat1 = rp->siop_sbcl; /* XXXX save current SBCL */ + sc->sc_sstat1 = rp->ssh_sbcl; /* XXXX save current SBCL */ #ifdef DEBUG - if (siop_debug & 0x100) + if (ssh_debug & 0x100) printf ("%s: target ID %02x reselected dsps %x\n", sc->sc_dev.dv_xname, reselid, - rp->siop_dsps); - if ((rp->siop_sfbr & 0x80) == 0) + rp->ssh_dsps); + if ((rp->ssh_sfbr & 0x80) == 0) printf("%s: Reselect message in was not identify: %x\n", - sc->sc_dev.dv_xname, rp->siop_sfbr); + sc->sc_dev.dv_xname, rp->ssh_sfbr); #endif /* * If we were trying to start a command when the reselect @@ -1312,7 +1312,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) */ if (sc->sc_nexus) { #ifdef DEBUG - if (siop_debug & 0x100) + if (ssh_debug & 0x100) printf ("%s: reselect ID %02x w/active\n", sc->sc_dev.dv_xname, reselid); #endif @@ -1337,9 +1337,9 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #if CACHECTL dma_cachectl(&acb->stat[0], sizeof(acb->stat[0])); #endif - rp->siop_dsa = kvtop(&acb->ds); - rp->siop_sxfer = sc->sc_sync[acb->xs->sc_link->target].sxfer; - rp->siop_sbcl = sc->sc_sync[acb->xs->sc_link->target].sbcl; + rp->ssh_dsa = kvtop(&acb->ds); + rp->ssh_sxfer = sc->sc_sync[acb->xs->sc_link->target].sxfer; + rp->ssh_sbcl = sc->sc_sync[acb->xs->sc_link->target].sbcl; break; } if (acb == NULL) { @@ -1351,43 +1351,43 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #if CACHECTL dma_cachectl (acb, sizeof(*acb)); #endif - rp->siop_temp = 0; - rp->siop_dcntl |= SIOP_DCNTL_STD; + rp->ssh_temp = 0; + rp->ssh_dcntl |= SSH_DCNTL_STD; return (0); } - if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff04) { - u_short ctest2 = rp->siop_ctest2; + if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff04) { + u_short ctest2 = rp->ssh_ctest2; /* reselect was interrupted (by Sig_P or select) */ #ifdef DEBUG - if (siop_debug & 0x100 || - (ctest2 & SIOP_CTEST2_SIGP) == 0) + if (ssh_debug & 0x100 || + (ctest2 & SSH_CTEST2_SIGP) == 0) printf ("%s: reselect interrupted (Sig_P?) scntl1 %x ctest2 %x sfbr %x istat %x/%x\n", - sc->sc_dev.dv_xname, rp->siop_scntl1, - ctest2, rp->siop_sfbr, istat, rp->siop_istat); + sc->sc_dev.dv_xname, rp->ssh_scntl1, + ctest2, rp->ssh_sfbr, istat, rp->ssh_istat); #endif /* XXX assumes it was not select */ if (sc->sc_nexus == NULL) { printf("%s: reselect interrupted, sc_nexus == NULL\n", sc->sc_dev.dv_xname); #if 0 - siop_dump(sc); + ssh_dump(sc); #ifdef DDB Debugger(); #endif #endif - rp->siop_dcntl |= SIOP_DCNTL_STD; + rp->ssh_dcntl |= SSH_DCNTL_STD; return(0); } target = sc->sc_nexus->xs->sc_link->target; - rp->siop_temp = 0; - rp->siop_dsa = kvtop(&sc->sc_nexus->ds); - rp->siop_sxfer = sc->sc_sync[target].sxfer; - rp->siop_sbcl = sc->sc_sync[target].sbcl; - rp->siop_dsp = sc->sc_scriptspa; + rp->ssh_temp = 0; + rp->ssh_dsa = kvtop(&sc->sc_nexus->ds); + rp->ssh_sxfer = sc->sc_sync[target].sxfer; + rp->ssh_sbcl = sc->sc_sync[target].sbcl; + rp->ssh_dsp = sc->sc_scriptspa; return (0); } - if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff06) { + if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff06) { if (acb == NULL) printf("%s: Bad message-in with no active command?\n", sc->sc_dev.dv_xname); @@ -1397,60 +1397,60 @@ siop_checkintr(sc, istat, dstat, sstat0, status) dma_cachectl (&acb->msg[1],1); #endif printf ("%s: Unrecognized message in data sfbr %x msg %x sbcl %x\n", - sc->sc_dev.dv_xname, rp->siop_sfbr, acb->msg[1], rp->siop_sbcl); + sc->sc_dev.dv_xname, rp->ssh_sfbr, acb->msg[1], rp->ssh_sbcl); /* what should be done here? */ /*DCIAS(kvtop(&acb->msg[1]));*/ - rp->siop_dsp = sc->sc_scriptspa + Ent_switch; + rp->ssh_dsp = sc->sc_scriptspa + Ent_switch; return (0); } - if (dstat & SIOP_DSTAT_SIR && rp->siop_dsps == 0xff0a) { + if (dstat & SSH_DSTAT_SIR && rp->ssh_dsps == 0xff0a) { /* Status phase wasn't followed by message in phase? */ printf ("%s: Status phase not followed by message in phase? sbcl %x sbdl %x\n", - sc->sc_dev.dv_xname, rp->siop_sbcl, rp->siop_sbdl); - if (rp->siop_sbcl == 0xa7) { + sc->sc_dev.dv_xname, rp->ssh_sbcl, rp->ssh_sbdl); + if (rp->ssh_sbcl == 0xa7) { /* It is now, just continue the script? */ - rp->siop_dcntl |= SIOP_DCNTL_STD; + rp->ssh_dcntl |= SSH_DCNTL_STD; return (0); } - siopreset (sc); + sshreset (sc); *status = -1; - return 0; /* siopreset has cleaned up */ + return 0; /* sshreset has cleaned up */ } - if (sstat0 & SIOP_SSTAT0_M_A) { /* Phase mismatch */ + if (sstat0 & SSH_SSTAT0_M_A) { /* Phase mismatch */ #ifdef DEBUG printf("%s: Phase mismatch - expecting %x got %x\n", - sc->sc_dev.dv_xname, rp->siop_dcmd & 0x07, - rp->siop_sstat2 & 0x07); - ++siopphmm; + sc->sc_dev.dv_xname, rp->ssh_dcmd & 0x07, + rp->ssh_sstat2 & 0x07); + ++sshphmm; #endif if (acb == NULL) { printf("%s: Phase mismatch with no active command- expecting %x got %x\n", sc->sc_dev.dv_xname, - *((long *)&rp->siop_dcmd) & 0x07000000, - rp->siop_sstat2 & 0x07); + *((long *)&rp->ssh_dcmd) & 0x07000000, + rp->ssh_sstat2 & 0x07); goto bad_phase; } if (acb->iob_len) { int adjust; adjust = ((dfifo - (dbc & 0x7f)) & 0x7f); - if (sstat1 & SIOP_SSTAT1_ORF) + if (sstat1 & SSH_SSTAT1_ORF) ++adjust; - if (sstat1 & SIOP_SSTAT1_OLF) + if (sstat1 & SSH_SSTAT1_OLF) ++adjust; - /* XXX what's with this siop_dcmd here? nivas */ - acb->iob_curlen = *((long *)&rp->siop_dcmd) & 0xffffff; + /* XXX what's with this ssh_dcmd here? nivas */ + acb->iob_curlen = *((long *)&rp->ssh_dcmd) & 0xffffff; acb->iob_curlen += adjust; - acb->iob_curbuf = *((long *)&rp->siop_dnad) - adjust; + acb->iob_curbuf = *((long *)&rp->ssh_dnad) - adjust; #ifdef DEBUG - if (siop_debug & 0x100) { + if (ssh_debug & 0x100) { int i; printf ("Phase mismatch: curbuf %lx curlen %lx dfifo %x dbc %x sstat1 %x adjust %x sbcl %x starts %d acb %p\n", acb->iob_curbuf, acb->iob_curlen, dfifo, - dbc, sstat1, adjust, rp->siop_sbcl, siopstarts, acb); + dbc, sstat1, adjust, rp->ssh_sbcl, sshstarts, acb); if (acb->ds.chain[1].datalen) { for (i = 0; acb->ds.chain[i].datalen; ++i) printf("chain[%d] addr %p len %lx\n", @@ -1464,32 +1464,32 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif } #ifdef DEBUG - SIOP_TRACE('m',rp->siop_sbcl,(rp->siop_dsp>>8),rp->siop_dsp); - if (siop_debug & 9) + SSH_TRACE('m',rp->ssh_sbcl,(rp->ssh_dsp>>8),rp->ssh_dsp); + if (ssh_debug & 9) printf ("Phase mismatch: %x dsp +%lx dcmd %lx\n", - rp->siop_sbcl, - rp->siop_dsp - sc->sc_scriptspa, - *((long *)&rp->siop_dcmd)); + rp->ssh_sbcl, + rp->ssh_dsp - sc->sc_scriptspa, + *((long *)&rp->ssh_dcmd)); #endif - if ((rp->siop_sbcl & SIOP_REQ) == 0) { + if ((rp->ssh_sbcl & SSH_REQ) == 0) { printf ("Phase mismatch: REQ not asserted! %02x dsp %lx\n", - rp->siop_sbcl, rp->siop_dsp); + rp->ssh_sbcl, rp->ssh_dsp); #if defined(DEBUG) && defined(DDB) Debugger(); #endif goto bad_phase; } #if XXX - switch (rp->siop_sbcl & 7) + switch (rp->ssh_sbcl & 7) #endif - switch (rp->siop_sstat2 & 7) { + switch (rp->ssh_sstat2 & 7) { case 0: /* data out */ case 1: /* data in */ case 2: /* command */ case 3: /* status */ case 6: /* message out */ case 7: /* message in */ - rp->siop_dsp = sc->sc_scriptspa + Ent_switch; + rp->ssh_dsp = sc->sc_scriptspa + Ent_switch; break; default: goto bad_phase; @@ -1497,7 +1497,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) return 0; } - if (sstat0 & SIOP_SSTAT0_STO) { /* SCSI bus time out */ + if (sstat0 & SSH_SSTAT0_STO) { /* SCSI bus time out */ if (acb == NULL) { printf("%s: SCSI bus timeout with no active command?\n", @@ -1506,36 +1506,36 @@ siop_checkintr(sc, istat, dstat, sstat0, status) } printf ("STO: scripts %x dsp %x dcmd %x dsps %x\n", sc->sc_scriptspa, - rp->siop_dsp, *((long *)&rp->siop_dcmd), rp->siop_dsps); + rp->ssh_dsp, *((long *)&rp->ssh_dcmd), rp->ssh_dsps); - if ((istat & SIOP_ISTAT_CON) == 0) { - printf("selection of %x timeout\n", rp->siop_sdid); - } else if ((rp->siop_ctest0 & SIOP_CTEST0_BTD) == 0) { + if ((istat & SSH_ISTAT_CON) == 0) { + printf("selection of %x timeout\n", rp->ssh_sdid); + } else if ((rp->ssh_ctest0 & SSH_CTEST0_BTD) == 0) { printf("No SCSI activity for 250ms(ctest0 %x %x dsps %x)\n", - rp->siop_ctest0, - rp->siop_ctest0, - rp->siop_dsps); + rp->ssh_ctest0, + rp->ssh_ctest0, + rp->ssh_dsps); } else { printf("Waited > 250ms for disconnect\n"); } #ifdef DEBUG printf ("scripts %x dsp %x dcmd %x\n", sc->sc_scriptspa, - rp->siop_dsp, *((long *)&rp->siop_dcmd)); + rp->ssh_dsp, *((long *)&rp->ssh_dcmd)); printf("msg %x status %x\n", acb->msg[0], acb->stat[0]); - if (rp->siop_sbcl & SIOP_BSY) { - printf ("ACK! siop was busy at timeout: rp %p script %p dsa %p\n", + if (rp->ssh_sbcl & SSH_BSY) { + printf ("ACK! ssh was busy at timeout: rp %p script %p dsa %p\n", rp, &scripts, &acb->ds); printf(" sbcl %x sdid %x istat %x dstat %x sstat0 %x\n", - rp->siop_sbcl, rp->siop_sdid, istat, dstat, sstat0); - if (!(rp->siop_sbcl & SIOP_BSY)) { + rp->ssh_sbcl, rp->ssh_sdid, istat, dstat, sstat0); + if (!(rp->ssh_sbcl & SSH_BSY)) { printf ("Yikes, it's not busy now!\n"); #if 0 *status = -1; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return 1; #endif } @@ -1548,10 +1548,10 @@ siop_checkintr(sc, istat, dstat, sstat0, status) */ if (kludge_city) { - dummy = rp->siop_dsp; - rp->siop_dsp = dummy; + dummy = rp->ssh_dsp; + rp->ssh_dsp = dummy; } else { - rp->siop_dcntl |= SIOP_DCNTL_STD; + rp->ssh_dcntl |= SSH_DCNTL_STD; } return (0); #ifdef DDB @@ -1559,16 +1559,16 @@ siop_checkintr(sc, istat, dstat, sstat0, status) #endif } #endif - if (rp->siop_sbcl & SIOP_BSY) { - if (!(rp->siop_sbcl & SIOP_BSY)) { + if (rp->ssh_sbcl & SSH_BSY) { + if (!(rp->ssh_sbcl & SSH_BSY)) { printf ("Yikes, it's not busy now!\n"); *status = -1; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return 1; } - rp->siop_dcntl |= SIOP_DCNTL_STD; + rp->ssh_dcntl |= SSH_DCNTL_STD; return 0; } @@ -1577,7 +1577,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) if (acb) acb->xs->error = XS_SELTIMEOUT; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return 1; } @@ -1586,7 +1586,7 @@ siop_checkintr(sc, istat, dstat, sstat0, status) else target = 7; - if (sstat0 & SIOP_SSTAT0_UDC) { + if (sstat0 & SSH_SSTAT0_UDC) { #ifdef DEBUG if (acb == NULL) printf("%s: Unexpected disconnect with no active command?\n", @@ -1595,40 +1595,40 @@ siop_checkintr(sc, istat, dstat, sstat0, status) sc->sc_dev.dv_xname, target); #endif #if 0 - siopabort (sc, rp, "siopchkintr"); + sshabort (sc, rp, "sshchkintr"); #endif *status = STS_BUSY; if (sc->nexus_list.tqh_first) - rp->siop_dsp = sc->sc_scriptspa + Ent_wait_reselect; + rp->ssh_dsp = sc->sc_scriptspa + Ent_wait_reselect; return (acb != NULL); } - if (sstat0 == 0 && dstat & SIOP_DSTAT_SIR) { + if (sstat0 == 0 && dstat & SSH_DSTAT_SIR) { #if CACHECTL /*cmmu_inval_cache(kvtop(&acb->stat[0]), 1); */ /*cmmu_inval_cache(kvtop(&acb->msg[0]), 1); */ dma_cachectl (&acb->stat[0], 1); dma_cachectl (&acb->msg[0], 1); #endif - printf ("SIOP interrupt: %lx sts %x msg %x %x sbcl %x\n", - rp->siop_dsps, acb->stat[0], acb->msg[0], acb->msg[1], - rp->siop_sbcl); - siopreset (sc); + printf ("SSH interrupt: %lx sts %x msg %x %x sbcl %x\n", + rp->ssh_dsps, acb->stat[0], acb->msg[0], acb->msg[1], + rp->ssh_sbcl); + sshreset (sc); *status = -1; - return 0; /* siopreset has cleaned up */ + return 0; /* sshreset has cleaned up */ } - if (sstat0 & SIOP_SSTAT0_SGE) - printf ("SIOP: SCSI Gross Error\n"); - if (sstat0 & SIOP_SSTAT0_PAR) - printf ("SIOP: Parity Error\n"); - - if (dstat & SIOP_DSTAT_IID) { - printf ("SIOP: Illegal instruction detected (dsp %x dcmd %x dsps %x)\n", - rp->siop_dsp, *((long *)&rp->siop_dcmd), - rp->siop_dsps); - - if (*((long *)&rp->siop_dcmd) & 0xf8000000 == 0x48000000) { /* wait disconnect */ - printf("SIOP was executing wait disconnect\n"); + if (sstat0 & SSH_SSTAT0_SGE) + printf ("SSH: SCSI Gross Error\n"); + if (sstat0 & SSH_SSTAT0_PAR) + printf ("SSH: Parity Error\n"); + + if (dstat & SSH_DSTAT_IID) { + printf ("SSH: Illegal instruction detected (dsp %x dcmd %x dsps %x)\n", + rp->ssh_dsp, *((long *)&rp->ssh_dcmd), + rp->ssh_dsps); + + if (*((long *)&rp->ssh_dcmd) & 0xf8000000 == 0x48000000) { /* wait disconnect */ + printf("SSH was executing wait disconnect\n"); } } @@ -1640,65 +1640,65 @@ bad_phase: * then panics. * XXXX need to clean this up to print out the info, reset, and continue */ - printf ("siopchkintr: target %x ds %x\n", target, &acb->ds); + printf ("sshchkintr: target %x ds %x\n", target, &acb->ds); printf ("scripts %x ds %x rp %x dsp %x dcmd %x\n", sc->sc_scriptspa, - kvtop(&acb->ds), kvtop(rp), rp->siop_dsp, - *((long *)&rp->siop_dcmd)); - printf ("siopchkintr: istat %x dstat %x sstat0 %x dsps %x " + kvtop(&acb->ds), kvtop(rp), rp->ssh_dsp, + *((long *)&rp->ssh_dcmd)); + printf ("sshchkintr: istat %x dstat %x sstat0 %x dsps %x " "dsa %x sbcl %x sts %x msg %x %x sfbr %x\n", - istat, dstat, sstat0, rp->siop_dsps, rp->siop_dsa, - rp->siop_sbcl, acb->stat[0], acb->msg[0], acb->msg[1], - rp->siop_sfbr); + istat, dstat, sstat0, rp->ssh_dsps, rp->ssh_dsa, + rp->ssh_sbcl, acb->stat[0], acb->msg[0], acb->msg[1], + rp->ssh_sfbr); #ifdef DEBUG - if (siop_debug & 0x20) - panic("siopchkintr: **** temp ****"); + if (ssh_debug & 0x20) + panic("sshchkintr: **** temp ****"); #ifdef DDB /* Debugger(); */ #endif #endif #endif /* XXX */ - siopreset (sc); /* hard reset */ + sshreset (sc); /* hard reset */ *status = -1; - return 0; /* siopreset cleaned up */ + return 0; /* sshreset cleaned up */ } void -siop_select(sc) - struct siop_softc *sc; +ssh_select(sc) + struct ssh_softc *sc; { - siop_regmap_p rp; - struct siop_acb *acb = sc->sc_nexus; + ssh_regmap_p rp; + struct ssh_acb *acb = sc->sc_nexus; #ifdef DEBUG - if (siop_debug & 1) + if (ssh_debug & 1) printf ("%s: select ", sc->sc_dev.dv_xname); #endif - rp = sc->sc_siopp; - if (acb->xs->flags & SCSI_POLL || siop_no_dma) { - sc->sc_flags |= SIOP_INTSOFF; - sc->sc_flags &= ~SIOP_INTDEFER; - if ((rp->siop_istat & 0x08) == 0) { - rp->siop_sien = 0; - rp->siop_dien = 0; + rp = sc->sc_sshp; + if (acb->xs->flags & SCSI_POLL || ssh_no_dma) { + sc->sc_flags |= SSH_INTSOFF; + sc->sc_flags &= ~SSH_INTDEFER; + if ((rp->ssh_istat & 0x08) == 0) { + rp->ssh_sien = 0; + rp->ssh_dien = 0; } #if 0 - } else if ((sc->sc_flags & SIOP_INTDEFER) == 0) { - sc->sc_flags &= ~SIOP_INTSOFF; - if ((rp->siop_istat & 0x08) == 0) { - rp->siop_sien = sc->sc_sien; - rp->siop_dien = sc->sc_dien; + } else if ((sc->sc_flags & SSH_INTDEFER) == 0) { + sc->sc_flags &= ~SSH_INTSOFF; + if ((rp->ssh_istat & 0x08) == 0) { + rp->ssh_sien = sc->sc_sien; + rp->ssh_dien = sc->sc_dien; } #endif } #ifdef DEBUG - if (siop_debug & 1) - printf ("siop_select: target %x cmd %02x ds %x\n", + if (ssh_debug & 1) + printf ("ssh_select: target %x cmd %02x ds %x\n", acb->xs->sc_link->target, acb->cmd.opcode, &sc->sc_nexus->ds); #endif - siop_start(sc, acb->xs->sc_link->target, acb->xs->sc_link->lun, + ssh_start(sc, acb->xs->sc_link->target, acb->xs->sc_link->lun, (u_char *)&acb->cmd, acb->clen, acb->daddr, acb->dleft); return; @@ -1709,27 +1709,27 @@ siop_select(sc) */ int -siopintr (sc) - register struct siop_softc *sc; +sshintr (sc) + register struct ssh_softc *sc; { - siop_regmap_p rp; + ssh_regmap_p rp; register u_char istat, dstat, sstat0; int status; int s = splbio(); istat = sc->sc_istat; - if ((istat & (SIOP_ISTAT_SIP | SIOP_ISTAT_DIP)) == 0) { + if ((istat & (SSH_ISTAT_SIP | SSH_ISTAT_DIP)) == 0) { /* is this possible? we won't come here if there is not int!!! XXX */ splx(s); return; } /* Got a valid interrupt on this device */ - rp = sc->sc_siopp; + rp = sc->sc_sshp; dstat = sc->sc_dstat; sstat0 = sc->sc_sstat0; - if (dstat & SIOP_DSTAT_SIR) - sc->sc_intcode = rp->siop_dsps; /* XXX use sc_intcode instead of dsps */ + if (dstat & SSH_DSTAT_SIR) + sc->sc_intcode = rp->ssh_dsps; /* XXX use sc_intcode instead of dsps */ /* Clear the copies in sc */ sc->sc_istat = 0; @@ -1737,7 +1737,7 @@ siopintr (sc) sc->sc_sstat0 = 0; #ifdef DEBUG - if (siop_debug & 1) + if (ssh_debug & 1) printf ("%s: intr istat %x dstat %x sstat0 %x\n", sc->sc_dev.dv_xname, istat, dstat, sstat0); if (!sc->sc_active) { @@ -1747,7 +1747,7 @@ siopintr (sc) #endif #ifdef DEBUG - if (siop_debug & 5) { + if (ssh_debug & 5) { #if CACHECTL /*cmmu_inval_cache(kvtop(&sc->sc_nexus->stat[0]), sizeof(sc->sc_nexus->stat[0])); */ @@ -1756,32 +1756,32 @@ siopintr (sc) #endif printf ("%s: intr istat %x dstat %x sstat0 %x dsps %x sbcl %x sts %x msg %x\n", sc->sc_dev.dv_xname, istat, dstat, sstat0, - rp->siop_dsps, rp->siop_sbcl, + rp->ssh_dsps, rp->ssh_sbcl, sc->sc_nexus->stat[0], sc->sc_nexus->msg[0]); } #endif - if (sc->sc_flags & SIOP_INTDEFER) { - sc->sc_flags &= ~(SIOP_INTDEFER | SIOP_INTSOFF); - rp->siop_sien = sc->sc_sien; - rp->siop_dien = sc->sc_dien; + if (sc->sc_flags & SSH_INTDEFER) { + sc->sc_flags &= ~(SSH_INTDEFER | SSH_INTSOFF); + rp->ssh_sien = sc->sc_sien; + rp->ssh_dien = sc->sc_dien; } - if (siop_checkintr (sc, istat, dstat, sstat0, &status)) { + if (ssh_checkintr (sc, istat, dstat, sstat0, &status)) { #if 1 if (status == 0xff) - printf ("siopintr: status == 0xff\n"); + printf ("sshintr: status == 0xff\n"); #endif - if ((sc->sc_flags & (SIOP_INTSOFF | SIOP_INTDEFER)) != SIOP_INTSOFF) { + if ((sc->sc_flags & (SSH_INTSOFF | SSH_INTDEFER)) != SSH_INTSOFF) { #if 0 - if (rp->siop_sbcl & SIOP_BSY) { + if (rp->ssh_sbcl & SSH_BSY) { printf ("%s: SCSI bus busy at completion", sc->sc_dev.dv_xname); printf(" targ %d sbcl %02x sfbr %x lcrc %02x dsp +%x\n", sc->sc_nexus->xs->sc_link->target, - rp->siop_sbcl, rp->siop_sfbr, rp->siop_lcrc, - rp->siop_dsp - sc->sc_scriptspa); + rp->ssh_sbcl, rp->ssh_sfbr, rp->ssh_lcrc, + rp->ssh_dsp - sc->sc_scriptspa); } #endif - siop_scsidone(sc->sc_nexus, sc->sc_nexus->stat[0]); + ssh_scsidone(sc->sc_nexus, sc->sc_nexus->stat[0]); } } splx(s); @@ -1793,8 +1793,8 @@ siopintr (sc) * XXX fix this - nivas */ void -scsi_period_to_siop (sc, target) - struct siop_softc *sc; +scsi_period_to_ssh (sc, target) + struct ssh_softc *sc; int target; { int period, offset, sxfer, sbcl = 0; @@ -1806,7 +1806,7 @@ scsi_period_to_siop (sc, target) offset = sc->sc_nexus->msg[5]; #ifdef DEBUG_SYNC sxfer = 0; - if (offset <= SIOP_MAX_OFFSET) + if (offset <= SSH_MAX_OFFSET) sxfer = offset; for (i = 0; i < sizeof (sync_tab) / 2; ++i) { if (period <= sync_tab[i].p) { @@ -1815,7 +1815,7 @@ scsi_period_to_siop (sc, target) break; } } - printf ("siop sync old: siop_sxfr %02x, siop_sbcl %02x\n", sxfer, sbcl); + printf ("ssh sync old: ssh_sxfr %02x, ssh_sbcl %02x\n", sxfer, sbcl); #endif for (sbcl = 1; sbcl < 4; ++sbcl) { sxfer = (period * 4 - 1) / sc->sc_tcp[sbcl] - 3; @@ -1823,17 +1823,17 @@ scsi_period_to_siop (sc, target) break; } if (sbcl > 3) { - printf("siop_sync: unable to compute sync params for period %dns\n", + printf("ssh_sync: unable to compute sync params for period %dns\n", period * 4); /* * XXX need to pick a value we can do and renegotiate */ sxfer = sbcl = 0; } else { - sxfer = (sxfer << 4) | ((offset <= SIOP_MAX_OFFSET) ? - offset : SIOP_MAX_OFFSET); + sxfer = (sxfer << 4) | ((offset <= SSH_MAX_OFFSET) ? + offset : SSH_MAX_OFFSET); #ifdef DEBUG_SYNC - printf("siop sync: params for period %dns: sxfer %x sbcl %x", + printf("ssh sync: params for period %dns: sxfer %x sbcl %x", period * 4, sxfer, sbcl); printf(" actual period %dns\n", sc->sc_tcp[sbcl] * ((sxfer >> 4) + 4)); @@ -1842,31 +1842,31 @@ scsi_period_to_siop (sc, target) sc->sc_sync[target].sxfer = sxfer; sc->sc_sync[target].sbcl = sbcl; #ifdef DEBUG_SYNC - printf ("siop sync: siop_sxfr %02x, siop_sbcl %02x\n", sxfer, sbcl); + printf ("ssh sync: ssh_sxfr %02x, ssh_sbcl %02x\n", sxfer, sbcl); #endif } #ifdef DEBUG -#if SIOP_TRACE_SIZE +#if SSH_TRACE_SIZE void -siop_dump_trace() +ssh_dump_trace() { int i; - printf("siop trace: next index %d\n", siop_trix); - i = siop_trix; + printf("ssh trace: next index %d\n", ssh_trix); + i = ssh_trix; do { - printf("%3d: '%c' %02x %02x %02x\n", i, siop_trbuf[i], - siop_trbuf[i + 1], siop_trbuf[i + 2], siop_trbuf[i + 3]); - i = (i + 4) & (SIOP_TRACE_SIZE - 1); - } while (i != siop_trix); + printf("%3d: '%c' %02x %02x %02x\n", i, ssh_trbuf[i], + ssh_trbuf[i + 1], ssh_trbuf[i + 2], ssh_trbuf[i + 3]); + i = (i + 4) & (SSH_TRACE_SIZE - 1); + } while (i != ssh_trix); } #endif void -siop_dump_acb(acb) - struct siop_acb *acb; +ssh_dump_acb(acb) + struct ssh_acb *acb; { u_char *b = (u_char *) &acb->cmd; int i; @@ -1888,44 +1888,44 @@ siop_dump_acb(acb) } void -siop_dump(sc) - struct siop_softc *sc; +ssh_dump(sc) + struct ssh_softc *sc; { - struct siop_acb *acb; - siop_regmap_p rp = sc->sc_siopp; + struct ssh_acb *acb; + ssh_regmap_p rp = sc->sc_sshp; int s; int i; s = splbio(); -#if SIOP_TRACE_SIZE - siop_dump_trace(); +#if SSH_TRACE_SIZE + ssh_dump_trace(); #endif printf("%s@%p regs %p istat %x\n", - sc->sc_dev.dv_xname, sc, rp, rp->siop_istat); + sc->sc_dev.dv_xname, sc, rp, rp->ssh_istat); if (acb = sc->free_list.tqh_first) { printf("Free list:\n"); while (acb) { - siop_dump_acb(acb); + ssh_dump_acb(acb); acb = acb->chain.tqe_next; } } if (acb = sc->ready_list.tqh_first) { printf("Ready list:\n"); while (acb) { - siop_dump_acb(acb); + ssh_dump_acb(acb); acb = acb->chain.tqe_next; } } if (acb = sc->nexus_list.tqh_first) { printf("Nexus list:\n"); while (acb) { - siop_dump_acb(acb); + ssh_dump_acb(acb); acb = acb->chain.tqe_next; } } if (sc->sc_nexus) { printf("Nexus:\n"); - siop_dump_acb(sc->sc_nexus); + ssh_dump_acb(sc->sc_nexus); } for (i = 0; i < 8; ++i) { if (sc->sc_tinfo[i].cmds > 2) { diff --git a/sys/arch/mvme88k/dev/siop_script.out b/sys/arch/mvme88k/dev/ssh_script.out index c6a91178fc8..c6a91178fc8 100644 --- a/sys/arch/mvme88k/dev/siop_script.out +++ b/sys/arch/mvme88k/dev/ssh_script.out diff --git a/sys/arch/mvme88k/dev/siop_script.ss b/sys/arch/mvme88k/dev/ssh_script.ss index c107e71469b..c11fd3991f4 100644 --- a/sys/arch/mvme88k/dev/siop_script.ss +++ b/sys/arch/mvme88k/dev/ssh_script.ss @@ -1,4 +1,4 @@ -; $OpenBSD: siop_script.ss,v 1.2 1998/12/15 05:52:31 smurph Exp $ +; $OpenBSD: ssh_script.ss,v 1.1 2001/03/07 01:57:56 miod Exp $ ; ; Copyright (c) 1995 Michael L. Hitch diff --git a/sys/arch/mvme88k/dev/siopdma.c b/sys/arch/mvme88k/dev/sshdma.c index 698793e0af8..14b892a5fa4 100644 --- a/sys/arch/mvme88k/dev/siopdma.c +++ b/sys/arch/mvme88k/dev/sshdma.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siopdma.c,v 1.3 2001/01/13 05:18:58 smurph Exp $ */ +/* $OpenBSD: sshdma.c,v 1.1 2001/03/07 01:57:56 miod Exp $ */ /* * Copyright (c) 1996 Nivas Madhur @@ -50,11 +50,11 @@ #endif /* MVME187 */ #if defined(MVME187) -#include <mvme88k/dev/siopreg.h> -#include <mvme88k/dev/siopvar.h> +#include <mvme88k/dev/sshreg.h> +#include <mvme88k/dev/sshvar.h> #else -#include <mvme68k/dev/siopreg.h> -#include <mvme68k/dev/siopvar.h> +#include <mvme68k/dev/sshreg.h> +#include <mvme68k/dev/sshvar.h> #endif /* defined(MVME187) */ #if !defined(MVME187) @@ -84,12 +84,12 @@ int afscmatch __P((struct device *, void *, void *)); void afscattach __P((struct device *, struct device *, void *)); int afscprint __P((void *auxp, char *)); -int siopintr __P((struct siop_softc *)); -int afsc_dmaintr __P((struct siop_softc *)); +int sshintr __P((struct ssh_softc *)); +int afsc_dmaintr __P((struct ssh_softc *)); struct scsi_adapter afsc_scsiswitch = { - siop_scsicmd, - siop_minphys, + ssh_scsicmd, + ssh_minphys, 0, /* no lun support */ 0, /* no lun support */ }; @@ -101,12 +101,12 @@ struct scsi_device afsc_scsidev = { NULL, /* Use default done routine */ }; -struct cfattach siop_ca = { - sizeof(struct siop_softc), afscmatch, afscattach, +struct cfattach ssh_ca = { + sizeof(struct ssh_softc), afscmatch, afscattach, }; -struct cfdriver siop_cd = { - NULL, "siop", DV_DULL, 0 +struct cfdriver ssh_cd = { + NULL, "ssh", DV_DULL, 0 }; int @@ -119,7 +119,7 @@ afscmatch(pdp, vcf, args) int ret; if ((ret = badvaddr(IIOV(ca->ca_vaddr), 4)) <=0){ - printf("==> siop: failed address check returning %ld.\n", ret); + printf("==> ssh: failed address check returning %ld.\n", ret); return(0); } @@ -131,17 +131,17 @@ afscattach(parent, self, auxp) struct device *parent, *self; void *auxp; { - struct siop_softc *sc = (struct siop_softc *)self; + struct ssh_softc *sc = (struct ssh_softc *)self; struct confargs *ca = auxp; - siop_regmap_p rp; + ssh_regmap_p rp; int tmp; extern int cpuspeed; - sc->sc_siopp = rp = ca->ca_vaddr; + sc->sc_sshp = rp = ca->ca_vaddr; /* - * siop uses sc_clock_freq to define the dcntl & ctest7 reg values - * (was 0x0221, but i added SIOP_CTEST7_SC0 for snooping control) + * ssh uses sc_clock_freq to define the dcntl & ctest7 reg values + * (was 0x0221, but i added SSH_CTEST7_SC0 for snooping control) * XXX does the clock frequency change for the 33MHz processors? */ sc->sc_clock_freq = cpuspeed * 2; @@ -150,7 +150,7 @@ afscattach(parent, self, auxp) if (cputyp == CPU_177) sc->sc_clock_freq = cpuspeed; #endif - sc->sc_dcntl = SIOP_DCNTL_EA; + sc->sc_dcntl = SSH_DCNTL_EA; /*X*/ if (sc->sc_clock_freq <= 25) /*X*/ sc->sc_dcntl |= (2 << 6); /*X*/ else if (sc->sc_clock_freq <= 37) @@ -160,15 +160,15 @@ afscattach(parent, self, auxp) /*X*/ else /*X*/ sc->sc_dcntl |= (3 << 6); - sc->sc_ctest0 = SIOP_CTEST0_BTD | SIOP_CTEST0_EAN; + sc->sc_ctest0 = SSH_CTEST0_BTD | SSH_CTEST0_EAN; #ifdef MVME187 /* * MVME187 doesn't implement snooping... */ - sc->sc_ctest7 = SIOP_CTEST7_TT1; + sc->sc_ctest7 = SSH_CTEST7_TT1; #else - sc->sc_ctest7 = SIOP_CTEST7_SNOOP | SIOP_CTEST7_TT1 | SIOP_CTEST7_STD; + sc->sc_ctest7 = SSH_CTEST7_SNOOP | SSH_CTEST7_TT1 | SSH_CTEST7_STD; #endif /* MVME187 */ sc->sc_link.adapter_softc = sc; @@ -181,7 +181,7 @@ afscattach(parent, self, auxp) sc->sc_ih.ih_arg = sc; sc->sc_ih.ih_ipl = ca->ca_ipl; - siopinitialize(sc); + sshinitialize(sc); switch (ca->ca_bustype) { #if NMC > 0 @@ -248,16 +248,16 @@ afscprint(auxp, pnp) int afsc_dmaintr(sc) - struct siop_softc *sc; + struct ssh_softc *sc; { - siop_regmap_p rp; + ssh_regmap_p rp; u_char istat; - rp = sc->sc_siopp; - istat = rp->siop_istat; - if ((istat & (SIOP_ISTAT_SIP | SIOP_ISTAT_DIP)) == 0) + rp = sc->sc_sshp; + istat = rp->ssh_istat; + if ((istat & (SSH_ISTAT_SIP | SSH_ISTAT_DIP)) == 0) return (0); - if ((rp->siop_sien | rp->siop_dien) == 0) + if ((rp->ssh_sien | rp->ssh_dien) == 0) return (0); /* no interrupts enabled */ /* @@ -270,14 +270,14 @@ afsc_dmaintr(sc) * (may need to deal with stacked interrupts?) */ sc->sc_istat = istat; - if (istat & SIOP_ISTAT_SIP) { - sc->sc_sstat0 = rp->siop_sstat0; + if (istat & SSH_ISTAT_SIP) { + sc->sc_sstat0 = rp->ssh_sstat0; } - if (istat & SIOP_ISTAT_DIP) { + if (istat & SSH_ISTAT_DIP) { delay(3); - sc->sc_dstat = rp->siop_dstat; + sc->sc_dstat = rp->ssh_dstat; } - siopintr(sc); + sshintr(sc); sc->sc_intrcnt.ev_count++; return (1); } @@ -290,6 +290,6 @@ afsc_dump() for (i = 0; i < afsccd.cd_ndevs; ++i) if (afsccd.cd_devs[i]) - siop_dump(afsccd.cd_devs[i]); + ssh_dump(afsccd.cd_devs[i]); } #endif diff --git a/sys/arch/mvme88k/dev/sshreg.h b/sys/arch/mvme88k/dev/sshreg.h new file mode 100644 index 00000000000..41a3407a1b2 --- /dev/null +++ b/sys/arch/mvme88k/dev/sshreg.h @@ -0,0 +1,336 @@ +/* $OpenBSD: sshreg.h,v 1.1 2001/03/07 01:57:56 miod Exp $ */ + +/* + * Copyright (c) 1990 The Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Van Jacobson of Lawrence Berkeley Laboratory. + * + * 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 University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. + * + * @(#)sshreg.h 7.3 (Berkeley) 2/5/91 + */ + +/* + * NCR 53C710 SCSI interface hardware description. + * + * From the Mach scsi driver for the 53C700 + */ + +typedef struct { +/*00*/ volatile unsigned char ssh_sien; /* rw: SCSI Interrupt Enable */ +/*01*/ volatile unsigned char ssh_sdid; /* rw: SCSI Destination ID */ +/*02*/ volatile unsigned char ssh_scntl1; /* rw: SCSI control reg 1 */ +/*03*/ volatile unsigned char ssh_scntl0; /* rw: SCSI control reg 0 */ +/*04*/ volatile unsigned char ssh_socl; /* rw: SCSI Output Control Latch */ +/*05*/ volatile unsigned char ssh_sodl; /* rw: SCSI Output Data Latch */ +/*06*/ volatile unsigned char ssh_sxfer; /* rw: SCSI Transfer reg */ +/*07*/ volatile unsigned char ssh_scid; /* rw: SCSI Chip ID reg */ +/*08*/ volatile unsigned char ssh_sbcl; /* ro: SCSI Bus Control Lines */ +/*09*/ volatile unsigned char ssh_sbdl; /* ro: SCSI Bus Data Lines */ +/*0a*/ volatile unsigned char ssh_sidl; /* ro: SCSI Input Data Latch */ +/*0b*/ volatile unsigned char ssh_sfbr; /* ro: SCSI First Byte Received */ +/*0c*/ volatile unsigned char ssh_sstat2; /* ro: SCSI status reg 2 */ +/*0d*/ volatile unsigned char ssh_sstat1; /* ro: SCSI status reg 1 */ +/*0e*/ volatile unsigned char ssh_sstat0; /* ro: SCSI status reg 0 */ +/*0f*/ volatile unsigned char ssh_dstat; /* ro: DMA status */ +/*10*/ volatile unsigned long ssh_dsa; /* rw: Data Structure Address */ +/*14*/ volatile unsigned char ssh_ctest3; /* ro: Chip test register 3 */ +/*15*/ volatile unsigned char ssh_ctest2; /* ro: Chip test register 2 */ +/*16*/ volatile unsigned char ssh_ctest1; /* ro: Chip test register 1 */ +/*17*/ volatile unsigned char ssh_ctest0; /* ro: Chip test register 0 */ +/*18*/ volatile unsigned char ssh_ctest7; /* rw: Chip test register 7 */ +/*19*/ volatile unsigned char ssh_ctest6; /* rw: Chip test register 6 */ +/*1a*/ volatile unsigned char ssh_ctest5; /* rw: Chip test register 5 */ +/*1b*/ volatile unsigned char ssh_ctest4; /* rw: Chip test register 4 */ +/*1c*/ volatile unsigned long ssh_temp; /* rw: Temporary Stack reg */ +/*20*/ volatile unsigned char ssh_lcrc; /* rw: LCRC value */ +/*21*/ volatile unsigned char ssh_ctest8; /* rw: Chip test register 8 */ +/*22*/ volatile unsigned char ssh_istat; /* rw: Interrupt Status reg */ +/*23*/ volatile unsigned char ssh_dfifo; /* rw: DMA FIFO */ +/*24*/ volatile unsigned char ssh_dcmd; /* rw: DMA Command Register */ +/*25*/ volatile unsigned char ssh_dbc2; /* rw: DMA Byte Counter reg */ +/*26*/ volatile unsigned char ssh_dbc1; +/*27*/ volatile unsigned char ssh_dbc0; +/*28*/ volatile unsigned long ssh_dnad; /* rw: DMA Next Address */ +/*2c*/ volatile unsigned long ssh_dsp; /* rw: DMA SCRIPTS Pointer reg */ +/*30*/ volatile unsigned long ssh_dsps; /* rw: DMA SCRIPTS Pointer Save reg */ +/*34*/ volatile unsigned long ssh_scratch; /* rw: Scratch Register */ +/*38*/ volatile unsigned char ssh_dcntl; /* rw: DMA Control reg */ +/*39*/ volatile unsigned char ssh_dwt; /* rw: DMA Watchdog Timer */ +/*3a*/ volatile unsigned char ssh_dien; /* rw: DMA Interrupt Enable */ +/*3b*/ volatile unsigned char ssh_dmode; /* rw: DMA Mode reg */ +/*3c*/ volatile unsigned long ssh_adder; + +} ssh_regmap_t; +typedef volatile ssh_regmap_t *ssh_regmap_p; + +/* + * Register defines + */ + +/* Scsi control register 0 (scntl0) */ + +#define SSH_SCNTL0_ARB 0xc0 /* Arbitration mode */ +# define SSH_ARB_SIMPLE 0x00 +# define SSH_ARB_FULL 0xc0 +#define SSH_SCNTL0_START 0x20 /* Start Sequence */ +#define SSH_SCNTL0_WATN 0x10 /* (Select) With ATN */ +#define SSH_SCNTL0_EPC 0x08 /* Enable Parity Checking */ +#define SSH_SCNTL0_EPG 0x04 /* Enable Parity Generation */ +#define SSH_SCNTL0_AAP 0x02 /* Assert ATN on Parity Error */ +#define SSH_SCNTL0_TRG 0x01 /* Target Mode */ + +/* Scsi control register 1 (scntl1) */ + +#define SSH_SCNTL1_EXC 0x80 /* Extra Clock Cycle of data setup */ +#define SSH_SCNTL1_ADB 0x40 /* Assert Data Bus */ +#define SSH_SCNTL1_ESR 0x20 /* Enable Selection/Reselection */ +#define SSH_SCNTL1_CON 0x10 /* Connected */ +#define SSH_SCNTL1_RST 0x08 /* Assert RST */ +#define SSH_SCNTL1_AESP 0x04 /* Assert even SCSI parity */ +#define SSH_SCNTL1_RES0 0x02 /* Reserved */ +#define SSH_SCNTL1_RES1 0x01 /* Reserved */ + +/* Scsi interrupt enable register (sien) */ + +#define SSH_SIEN_M_A 0x80 /* Phase Mismatch or ATN active */ +#define SSH_SIEN_FCMP 0x40 /* Function Complete */ +#define SSH_SIEN_STO 0x20 /* (Re)Selection timeout */ +#define SSH_SIEN_SEL 0x10 /* (Re)Selected */ +#define SSH_SIEN_SGE 0x08 /* SCSI Gross Error */ +#define SSH_SIEN_UDC 0x04 /* Unexpected Disconnect */ +#define SSH_SIEN_RST 0x02 /* RST asserted */ +#define SSH_SIEN_PAR 0x01 /* Parity Error */ + +/* Scsi chip ID (scid) */ + +#define SSH_SCID_VALUE(i) (1<<i) + +/* Scsi transfer register (sxfer) */ + +#define SSH_SXFER_DHP 0x80 /* Disable Halt on Parity error/ ATN asserted */ +#define SSH_SXFER_TP 0x70 /* Synch Transfer Period */ + /* see specs for formulas: + Period = TCP * (4 + XFERP ) + TCP = 1 + CLK + 1..2; + */ +#define SSH_SXFER_MO 0x0f /* Synch Max Offset */ +# define SSH_MAX_OFFSET 8 + +/* Scsi output data latch register (sodl) */ + +/* Scsi output control latch register (socl) */ + +#define SSH_REQ 0x80 /* SCSI signal <x> asserted */ +#define SSH_ACK 0x40 +#define SSH_BSY 0x20 +#define SSH_SEL 0x10 +#define SSH_ATN 0x08 +#define SSH_MSG 0x04 +#define SSH_CD 0x02 +#define SSH_IO 0x01 + +#define SSH_PHASE(socl) SCSI_PHASE(socl) + +/* Scsi first byte received register (sfbr) */ + +/* Scsi input data latch register (sidl) */ + +/* Scsi bus data lines register (sbdl) */ + +/* Scsi bus control lines register (sbcl). Same as socl */ + +/* DMA status register (dstat) */ + +#define SSH_DSTAT_DFE 0x80 /* DMA FIFO empty */ +#define SSH_DSTAT_RES 0x40 +#define SSH_DSTAT_BF 0x20 /* Bus fault */ +#define SSH_DSTAT_ABRT 0x10 /* Aborted */ +#define SSH_DSTAT_SSI 0x08 /* SCRIPT Single Step */ +#define SSH_DSTAT_SIR 0x04 /* SCRIPT Interrupt Instruction */ +#define SSH_DSTAT_WTD 0x02 /* Watchdog Timeout Detected */ +#define SSH_DSTAT_IID 0x01 /* Invalid Instruction Detected */ + +/* Scsi status register 0 (sstat0) */ + +#define SSH_SSTAT0_M_A 0x80 /* Phase Mismatch or ATN active */ +#define SSH_SSTAT0_FCMP 0x40 /* Function Complete */ +#define SSH_SSTAT0_STO 0x20 /* (Re)Selection timeout */ +#define SSH_SSTAT0_SEL 0x10 /* (Re)Selected */ +#define SSH_SSTAT0_SGE 0x08 /* SCSI Gross Error */ +#define SSH_SSTAT0_UDC 0x04 /* Unexpected Disconnect */ +#define SSH_SSTAT0_RST 0x02 /* RST asserted */ +#define SSH_SSTAT0_PAR 0x01 /* Parity Error */ + +/* Scsi status register 1 (sstat1) */ + +#define SSH_SSTAT1_ILF 0x80 /* Input latch (sidl) full */ +#define SSH_SSTAT1_ORF 0x40 /* output reg (sodr) full */ +#define SSH_SSTAT1_OLF 0x20 /* output latch (sodl) full */ +#define SSH_SSTAT1_AIP 0x10 /* Arbitration in progress */ +#define SSH_SSTAT1_LOA 0x08 /* Lost arbitration */ +#define SSH_SSTAT1_WOA 0x04 /* Won arbitration */ +#define SSH_SSTAT1_RST 0x02 /* SCSI RST current value */ +#define SSH_SSTAT1_SDP 0x01 /* SCSI SDP current value */ + +/* Scsi status register 2 (sstat2) */ + +#define SSH_SSTAT2_FF 0xf0 /* SCSI FIFO flags (bytecount) */ +# define SSH_SCSI_FIFO_DEEP 8 +#define SSH_SSTAT2_SDP 0x08 /* Latched (on REQ) SCSI SDP */ +#define SSH_SSTAT2_MSG 0x04 /* Latched SCSI phase */ +#define SSH_SSTAT2_CD 0x02 +#define SSH_SSTAT2_IO 0x01 + +/* Chip test register 0 (ctest0) */ + +#define SSH_CTEST0_RES0 0x80 +#define SSH_CTEST0_BTD 0x40 /* Byte-to-byte Timer Disable */ +#define SSH_CTEST0_GRP 0x20 /* Generate Receive Parity for Passthrough */ +#define SSH_CTEST0_EAN 0x10 /* Enable Active Negation */ +#define SSH_CTEST0_HSC 0x08 /* Halt SCSI clock */ +#define SSH_CTEST0_ERF 0x04 /* Extend REQ/ACK Filtering */ +#define SSH_CTEST0_RES1 0x02 +#define SSH_CTEST0_DDIR 0x01 /* Xfer direction (1-> from SCSI bus) */ + +/* Chip test register 1 (ctest1) */ + +#define SSH_CTEST1_FMT 0xf0 /* Byte empty in DMA FIFO bottom (high->byte3) */ +#define SSH_CTEST1_FFL 0x0f /* Byte full in DMA FIFO top, same */ + +/* Chip test register 2 (ctest2) */ + +#define SSH_CTEST2_RES 0x80 +#define SSH_CTEST2_SIGP 0x40 /* Signal process */ +#define SSH_CTEST2_SOFF 0x20 /* Synch Offset compare (1-> zero Init, max Tgt */ +#define SSH_CTEST2_SFP 0x10 /* SCSI FIFO Parity */ +#define SSH_CTEST2_DFP 0x08 /* DMA FIFO Parity */ +#define SSH_CTEST2_TEOP 0x04 /* True EOP (a-la 5380) */ +#define SSH_CTEST2_DREQ 0x02 /* DREQ status */ +#define SSH_CTEST2_DACK 0x01 /* DACK status */ + +/* Chip test register 3 (ctest3) read-only, top of SCSI FIFO */ + +/* Chip test register 4 (ctest4) */ + +#define SSH_CTEST4_MUX 0x80 /* Host bus multiplex mode */ +#define SSH_CTEST4_ZMOD 0x40 /* High-impedance outputs */ +#define SSH_CTEST4_SZM 0x20 /* ditto, SCSI "outputs" */ +#define SSH_CTEST4_SLBE 0x10 /* SCSI loobpack enable */ +#define SSH_CTEST4_SFWR 0x08 /* SCSI FIFO write enable (from sodl) */ +#define SSH_CTEST4_FBL 0x07 /* DMA FIFO Byte Lane select (from ctest6) + 4->0, .. 7->3 */ + +/* Chip test register 5 (ctest5) */ + +#define SSH_CTEST5_ADCK 0x80 /* Clock Address Incrementor */ +#define SSH_CTEST5_BBCK 0x40 /* Clock Byte counter */ +#define SSH_CTEST5_ROFF 0x20 /* Reset SCSI offset */ +#define SSH_CTEST5_MASR 0x10 /* Master set/reset pulses (of bits 3-0) */ +#define SSH_CTEST5_DDIR 0x08 /* (re)set internal DMA direction */ +#define SSH_CTEST5_EOP 0x04 /* (re)set internal EOP */ +#define SSH_CTEST5_DREQ 0x02 /* (re)set internal REQ */ +#define SSH_CTEST5_DACK 0x01 /* (re)set internal ACK */ + +/* Chip test register 6 (ctest6) DMA FIFO access */ + +/* Chip test register 7 (ctest7) */ + +#define SSH_CTEST7_CDIS 0x80 /* Cache burst disable */ +#define SSH_CTEST7_SC1 0x40 /* Snoop control 1 */ +#define SSH_CTEST7_SC0 0x20 /* Snoop contorl 0 */ +#define SSH_CTEST7_INHIBIT (0 << 5) +#define SSH_CTEST7_SNOOP (1 << 5) +#define SSH_CTEST7_INVAL (2 << 5) +#define SSH_CTEST7_RESV (3 << 5) +#define SSH_CTEST7_STD 0x10 /* Selection timeout disable */ +#define SSH_CTEST7_DFP 0x08 /* DMA FIFO parity bit */ +#define SSH_CTEST7_EVP 0x04 /* Even parity (to host bus) */ +#define SSH_CTEST7_TT1 0x02 /* Transfer type bit */ +#define SSH_CTEST7_DIFF 0x01 /* Differential mode */ + +/* DMA FIFO register (dfifo) */ + +#define SSH_DFIFO_RES 0x80 +#define SSH_DFIFO_BO 0x7f /* FIFO byte offset counter */ + +/* Interrupt status register (istat) */ + +#define SSH_ISTAT_ABRT 0x80 /* Abort operation */ +#define SSH_ISTAT_RST 0x40 /* Software reset */ +#define SSH_ISTAT_SIGP 0x20 /* Signal process */ +#define SSH_ISTAT_RES 0x10 +#define SSH_ISTAT_CON 0x08 /* Connected */ +#define SSH_ISTAT_RES1 0x04 +#define SSH_ISTAT_SIP 0x02 /* SCSI Interrupt pending */ +#define SSH_ISTAT_DIP 0x01 /* DMA Interrupt pending */ + +/* Chip test register 8 (ctest8) + +#define SSH_CTEST8_V 0xf0 /* Chip revision level */ +#define SSH_CTEST8_FLF 0x08 /* Flush DMA FIFO */ +#define SSH_CTEST8_CLF 0x04 /* Clear DMA and SCSI FIFOs */ +#define SSH_CTEST8_FM 0x02 /* Fetch pin mode */ +#define SSH_CTEST8_SM 0x01 /* Snoop pins mode */ + +/* DMA Mode register (dmode) */ + +#define SSH_DMODE_BL_MASK 0xc0 /* 0->1 1->2 2->4 3->8 */ +#define SSH_DMODE_FC 0x30 /* Function code */ +#define SSH_DMODE_PD 0x08 /* Program/data */ +#define SSH_DMODE_FAM 0x04 /* Fixed address mode */ +#define SSH_DMODE_U0 0x02 /* User programmable transfer type */ +#define SSH_DMODE_MAN 0x01 /* Manual start mode */ + +/* DMA interrupt enable register (dien) */ + +#define SSH_DIEN_RES 0xc0 +#define SSH_DIEN_BF 0x20 /* On Bus Fault */ +#define SSH_DIEN_ABRT 0x10 /* On Abort */ +#define SSH_DIEN_SSI 0x08 /* On SCRIPTS sstep */ +#define SSH_DIEN_SIR 0x04 /* On SCRIPTS intr instruction */ +#define SSH_DIEN_WTD 0x02 /* On watchdog timeout */ +#define SSH_DIEN_IID 0x01 /* On illegal instruction detected */ + +/* DMA control register (dcntl) */ + +#define SSH_DCNTL_CF_MASK 0xc0 /* Clock frequency dividers: + 0 --> 37.51..50.00 Mhz, div=2 + 1 --> 25.01..37.50 Mhz, div=1.5 + 2 --> 16.67..25.00 Mhz, div=1 + 3 --> 50.01..66.67 Mhz, div=3 + */ +#define SSH_DCNTL_EA 0x20 /* Enable ack */ +#define SSH_DCNTL_SSM 0x10 /* Single step mode */ +#define SSH_DCNTL_LLM 0x08 /* Enable SCSI Low-level mode */ +#define SSH_DCNTL_STD 0x04 /* Start DMA operation */ +#define SSH_DCNTL_FA 0x02 /* Fast arbitration */ +#define SSH_DCNTL_COM 0x01 /* 53C700 compatibility */ diff --git a/sys/arch/mvme88k/dev/siopvar.h b/sys/arch/mvme88k/dev/sshvar.h index 0e61b358401..f5067562611 100644 --- a/sys/arch/mvme88k/dev/siopvar.h +++ b/sys/arch/mvme88k/dev/sshvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: siopvar.h,v 1.2 1998/12/15 05:52:31 smurph Exp $ */ +/* $OpenBSD: sshvar.h,v 1.1 2001/03/07 01:57:56 miod Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -36,10 +36,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)siopvar.h 7.1 (Berkeley) 5/8/90 + * @(#)sshvar.h 7.1 (Berkeley) 5/8/90 */ -#ifndef _SIOPVAR_H_ -#define _SIOPVAR_H_ +#ifndef _SSHVAR_H_ +#define _SSHVAR_H_ /* * The largest single request will be MAXPHYS bytes which will require @@ -52,7 +52,7 @@ /* * Data Structure for SCRIPTS program */ -struct siop_ds { +struct ssh_ds { /*00*/ long scsi_addr; /* SCSI ID & sync */ /*04*/ long idlen; /* Identify message */ /*08*/ char *idbuf; @@ -82,8 +82,8 @@ struct siop_ds { * We'll generally update: xs->{flags,resid,error,sense,status} and * occasionally xs->retries. */ -struct siop_acb { -/*00*/ TAILQ_ENTRY(siop_acb) chain; +struct ssh_acb { +/*00*/ TAILQ_ENTRY(ssh_acb) chain; /*08*/ struct scsi_xfer *xs; /* SCSI xfer ctrl block from above */ /*0c*/ int flags; /* Status */ #define ACB_FREE 0x00 @@ -91,7 +91,7 @@ struct siop_acb { #define ACB_DONE 0x04 #define ACB_CHKSENSE 0x08 /*10*/ struct scsi_generic cmd; /* SCSI command block */ -/*1c*/ struct siop_ds ds; +/*1c*/ struct ssh_ds ds; /*a0*/ void *iob_buf; /*a4*/ u_long iob_curbuf; /*a8*/ u_long iob_len, iob_curlen; @@ -110,7 +110,7 @@ struct siop_acb { * probably have been a "per target+lunit" structure, but we'll leave it at * this for now. Is there a way to reliably hook it up to sc->fordriver?? */ -struct siop_tinfo { +struct ssh_tinfo { int cmds; /* #commands processed */ int dconns; /* #disconnects */ int touts; /* #timeouts */ @@ -122,7 +122,7 @@ struct siop_tinfo { u_char offset; /* Offset suggestion */ } tinfo_t; -struct siop_softc { +struct ssh_softc { struct device sc_dev; struct intrhand sc_ih; struct evcnt sc_intrcnt; @@ -134,18 +134,18 @@ struct siop_softc { u_long sc_intcode; struct scsi_link sc_link; /* proto for sub devices */ u_long sc_scriptspa; /* physical address of scripts */ - siop_regmap_p sc_siopp; /* the SIOP */ + ssh_regmap_p sc_sshp; /* the SSH */ u_long sc_active; /* number of active I/O's */ /* Lists of command blocks */ - TAILQ_HEAD(acb_list, siop_acb) free_list, + TAILQ_HEAD(acb_list, ssh_acb) free_list, ready_list, nexus_list; - struct siop_acb *sc_nexus; /* current command */ -#define SIOP_NACB 8 - struct siop_acb *sc_acb; /* the real command blocks */ - struct siop_tinfo sc_tinfo[8]; + struct ssh_acb *sc_nexus; /* current command */ +#define SSH_NACB 8 + struct ssh_acb *sc_acb; /* the real command blocks */ + struct ssh_tinfo sc_tinfo[8]; u_short sc_clock_freq; u_char sc_dcntl; @@ -165,10 +165,10 @@ struct siop_softc { }; /* sc_flags */ -#define SIOP_INTSOFF 0x80 /* Interrupts turned off */ -#define SIOP_INTDEFER 0x40 /* Level 6 interrupt has been deferred */ -#define SIOP_ALIVE 0x01 /* controller initialized */ -#define SIOP_SELECTED 0x04 /* bus is in selected state. Needed for +#define SSH_INTSOFF 0x80 /* Interrupts turned off */ +#define SSH_INTDEFER 0x40 /* Level 6 interrupt has been deferred */ +#define SSH_ALIVE 0x01 /* controller initialized */ +#define SSH_SELECTED 0x04 /* bus is in selected state. Needed for correct abort procedure. */ /* sync states */ @@ -198,7 +198,7 @@ struct siop_softc { #define STS_INTERMED 0x10 /* Intermediate status sent */ #define STS_EXT 0x80 /* Extended status valid */ -void siop_minphys __P((struct buf *bp)); -int siop_scsicmd __P((struct scsi_xfer *)); +void ssh_minphys __P((struct buf *bp)); +int ssh_scsicmd __P((struct scsi_xfer *)); -#endif /* _SIOPVAR_H */ +#endif /* _SSHVAR_H */ diff --git a/sys/arch/mvme88k/dev/vsvar.h b/sys/arch/mvme88k/dev/vsvar.h index 56440eb28c3..367719b7295 100644 --- a/sys/arch/mvme88k/dev/vsvar.h +++ b/sys/arch/mvme88k/dev/vsvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vsvar.h,v 1.2 2001/02/01 03:38:16 smurph Exp $ */ +/* $OpenBSD: vsvar.h,v 1.3 2001/03/07 01:57:56 miod Exp $ */ /* * Copyright (c) 1999 Steve Murphree, Jr. * Copyright (c) 1990 The Regents of the University of California. @@ -124,8 +124,8 @@ struct vs_softc { u_long sc_chnl; /* channel 0 or 1 for dual bus cards */ u_long sc_qhp; /* Command queue head pointer */ struct vsreg *sc_vsreg; -#define SIOP_NACB 8 - struct vs_tinfo sc_tinfo[8]; +#define SSH_NACB 8 + struct vs_tinfo sc_tinfo[SSH_NACB]; u_char sc_flags; u_char sc_sien; u_char sc_dien; |