Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/microcode/aic7xxx Newer aic sequencer assembler. Fro...



details:   https://anonhg.NetBSD.org/src/rev/e610f9927a0a
branches:  trunk
changeset: 546032:e610f9927a0a
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Sat Apr 19 19:26:10 2003 +0000

description:
Newer aic sequencer assembler. From FreeBSD, written by Justin Gibbs.
Ported to NetBSD by Pascal Renauld at Network Storage Solutions, Inc.
Some Makefile changes by me.

The 79xx code isn't yet used, driver for that to follow shortly.

diffstat:

 sys/dev/microcode/aic7xxx/Makefile            |    39 +
 sys/dev/microcode/aic7xxx/Makefile.sequencer  |    24 -
 sys/dev/microcode/aic7xxx/aic79xx.reg         |  3951 +++++++++++++++++++++++++
 sys/dev/microcode/aic7xxx/aic79xx.seq         |  1987 ++++++++++++
 sys/dev/microcode/aic7xxx/aic7xxx.reg         |   938 +++--
 sys/dev/microcode/aic7xxx/aic7xxx.seq         |  2291 ++++++++-----
 sys/dev/microcode/aic7xxx/aicasm.c            |   275 +-
 sys/dev/microcode/aic7xxx/aicasm.h            |    64 +-
 sys/dev/microcode/aic7xxx/aicasm_gram.y       |   896 ++++-
 sys/dev/microcode/aic7xxx/aicasm_insformat.h  |   131 +
 sys/dev/microcode/aic7xxx/aicasm_macro_gram.y |   164 +
 sys/dev/microcode/aic7xxx/aicasm_macro_scan.l |   155 +
 sys/dev/microcode/aic7xxx/aicasm_scan.l       |   407 ++-
 sys/dev/microcode/aic7xxx/aicasm_symbol.c     |   571 ++-
 sys/dev/microcode/aic7xxx/aicasm_symbol.h     |   126 +-
 sys/dev/microcode/aic7xxx/sequencer.h         |   125 -
 16 files changed, 10138 insertions(+), 2006 deletions(-)

diffs (truncated from 14624 to 300 lines):

diff -r 5b17e9e89676 -r e610f9927a0a sys/dev/microcode/aic7xxx/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/microcode/aic7xxx/Makefile        Sat Apr 19 19:26:10 2003 +0000
@@ -0,0 +1,39 @@
+#      $NetBSD: Makefile,v 1.7 2003/04/19 19:26:10 fvdl Exp $
+
+7XXX_SEQ=      aic7xxx.seq
+7XXX_SEQHDR=   aic7xxx_seq.h
+7XXX_REGHDR=   aic7xxx_reg.h
+
+79XX_SEQ=      aic79xx.seq
+79XX_SEQHDR=   aic79xx_seq.h
+79XX_REGHDR=   aic79xx_reg.h
+
+AICASMINCS=-I/usr/include -I${.CURDIR}/../../.. -I.
+
+PROG=  aicasm
+
+SRCS=  aicasm.c aicasm_symbol.c aicasm_scan.l aicasm_macro_scan.l \
+       aicasm_gram.y aicasm_macro_gram.y
+
+YHEADER=1
+
+DPADD+= ${LIBL} ${LIBY}
+LDADD+= -ll -ly
+
+NOSHARE=# defined
+
+.include <bsd.prog.mk>
+
+#
+# XXXfvdl must come after the .include. Yes, it's ugly.
+#
+LFLAGS+= ${.TARGET:M*macro*:S/$(.TARGET)/-Pmm/}
+YFLAGS+= ${.TARGET:M*macro*:S/$(.TARGET)/-p mm/}
+
+regen: 7xxx_headers 79xx_headers
+
+7xxx_headers: ${PROG} ${7XXX_SEQ}
+       ./${PROG} ${AICASMINCS} -o ${7XXX_SEQHDR} -r ${7XXX_REGHDR} ${7XXX_SEQ}
+
+79xx_headers: ${PROG} ${79XX_SEQ}
+       ./${PROG} ${AICASMINCS} -o ${79XX_SEQHDR} -r ${79XX_REGHDR} ${79XX_SEQ}
diff -r 5b17e9e89676 -r e610f9927a0a sys/dev/microcode/aic7xxx/Makefile.sequencer
--- a/sys/dev/microcode/aic7xxx/Makefile.sequencer      Sat Apr 19 19:21:35 2003 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#      $NetBSD: Makefile.sequencer,v 1.3 2001/12/12 01:50:04 tv Exp $
-
-SEQHEADER=aic7xxx_seq.h
-REGHEADER=aic7xxx_reg.h
-
-AICASMINCS=-I/usr/include -I../../..
-
-PROG=  aicasm
-
-SRCS=  aicasm.c aicasm_symbol.c aicasm_scan.l aicasm_gram.y
-
-YHEADER=1
-
-DPADD+= ${LIBL}
-LDADD+= -ll
-
-NOSHARE=# defined
-
-.include <bsd.prog.mk>
-
-regen: headers
-
-headers: ${PROG} aic7xxx.seq
-       ./${PROG} ${AICASMINCS} -o ${SEQHEADER} -r ${REGHEADER} aic7xxx.seq
diff -r 5b17e9e89676 -r e610f9927a0a sys/dev/microcode/aic7xxx/aic79xx.reg
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/microcode/aic7xxx/aic79xx.reg     Sat Apr 19 19:26:10 2003 +0000
@@ -0,0 +1,3951 @@
+/*
+ * Aic79xx register and scratch ram definitions.
+ *
+ * Copyright (c) 1994-2001 Justin T. Gibbs.
+ * Copyright (c) 2000-2002 Adaptec Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions, and the following disclaimer,
+ *    without modification.
+ * 2. Redistributions in binary form must reproduce at minimum a disclaimer
+ *    substantially similar to the "NO WARRANTY" disclaimer below
+ *    ("Disclaimer") and any redistribution must be conditioned upon
+ *    including a substantially similar Disclaimer requirement for further
+ *    binary redistribution.
+ * 3. Neither the names of the above-listed copyright holders nor the names
+ *    of any contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * Alternatively, this software may be distributed under the terms of the
+ * GNU General Public License ("GPL") version 2 as published by the Free
+ * Software Foundation.
+ *
+ * NO WARRANTY
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES.
+ *
+ * $FreeBSD: /repoman/r/ncvs/src/sys/dev/aic7xxx/aic79xx.reg,v 1.9 2003/02/27 23:23:16 gibbs Exp $
+ */
+VERSION = "$NetBSD: aic79xx.reg,v 1.1 2003/04/19 19:26:10 fvdl Exp $"
+
+/*
+ * This file is processed by the aic7xxx_asm utility for use in assembling
+ * firmware for the aic79xx family of SCSI host adapters as well as to generate
+ * a C header file for use in the kernel portion of the Aic79xx driver.
+ */
+
+/* Register window Modes */
+#define M_DFF0         0
+#define M_DFF1         1
+#define M_CCHAN                2
+#define M_SCSI         3
+#define M_CFG          4
+#define M_DST_SHIFT    4
+
+#define MK_MODE(src, dst) ((src) | ((dst) << M_DST_SHIFT))
+#define SET_MODE(src, dst)                                             \
+       SET_SRC_MODE    src;                                            \
+       SET_DST_MODE    dst;                                            \
+       if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {                      \
+               mvi     MK_MODE(src, dst) call set_mode_work_around;    \
+       } else {                                                        \
+               mvi     MODE_PTR, MK_MODE(src, dst);                    \
+       }
+
+#define TOGGLE_DFF_MODE                                                        \
+       if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {                      \
+               call    toggle_dff_mode_work_around;                    \
+       } else {                                                        \
+               xor     MODE_PTR, MK_MODE(M_DFF1, M_DFF1);              \
+       }
+       
+#define RESTORE_MODE(mode)                                             \
+       if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {                      \
+               mov     mode call set_mode_work_around;                 \
+       } else {                                                        \
+               mov     MODE_PTR, mode;                                 \
+       }
+
+#define SET_SEQINTCODE(code)                                           \
+       if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {                  \
+               mvi     code call set_seqint_work_around;               \
+       } else {                                                        \
+               mvi     SEQINTCODE, code;                               \
+       }
+
+/*
+ * Mode Pointer
+ * Controls which of the 5, 512byte, address spaces should be used
+ * as the source and destination of any register accesses in our
+ * register window.
+ */
+register MODE_PTR {
+       address                 0x000
+       access_mode     RW
+       field   DST_MODE        0x70
+       field   SRC_MODE        0x07
+       mode_pointer
+}
+
+const SRC_MODE_SHIFT   0
+const DST_MODE_SHIFT   4
+
+/*
+ * Host Interrupt Status
+ */
+register INTSTAT {
+       address                 0x001
+       access_mode     RW
+       field   HWERRINT        0x80
+       field   BRKADRINT       0x40
+       field   SWTMINT         0x20
+       field   PCIINT          0x10
+       field   SCSIINT         0x08
+       field   SEQINT          0x04
+       field   CMDCMPLT        0x02
+       field   SPLTINT         0x01
+       mask    INT_PEND 0xFF
+}
+
+/*
+ * Sequencer Interrupt Code
+ */
+register SEQINTCODE {
+       address                 0x002
+       access_mode     RW
+       field {
+               NO_SEQINT,                      /* No seqint pending. */
+               BAD_PHASE,                      /* unknown scsi bus phase */
+               SEND_REJECT,                    /* sending a message reject */
+               PROTO_VIOLATION,                /* Protocol Violation */
+               NO_MATCH,                       /* no cmd match for reconnect */
+               IGN_WIDE_RES,                   /* Complex IGN Wide Res Msg */
+               PDATA_REINIT,                   /*
+                                                * Returned to data phase
+                                                * that requires data
+                                                * transfer pointers to be
+                                                * recalculated from the
+                                                * transfer residual.
+                                                */
+               HOST_MSG_LOOP,                  /*
+                                                * The bus is ready for the
+                                                * host to perform another
+                                                * message transaction.  This
+                                                * mechanism is used for things
+                                                * like sync/wide negotiation
+                                                * that require a kernel based
+                                                * message state engine.
+                                                */
+               BAD_STATUS,                     /* Bad status from target */
+               DATA_OVERRUN,                   /*
+                                                * Target attempted to write
+                                                * beyond the bounds of its
+                                                * command.
+                                                */
+               MKMSG_FAILED,                   /*
+                                                * Target completed command
+                                                * without honoring our ATN
+                                                * request to issue a message. 
+                                                */
+               MISSED_BUSFREE,                 /*
+                                                * The sequencer never saw
+                                                * the bus go free after
+                                                * either a command complete
+                                                * or disconnect message.
+                                                */
+               DUMP_CARD_STATE,
+               ILLEGAL_PHASE,
+               INVALID_SEQINT,
+               CFG4ISTAT_INTR,
+               STATUS_OVERRUN,
+               CFG4OVERRUN,
+               ENTERING_NONPACK,
+               TASKMGMT_FUNC_COMPLETE,         /*
+                                                * Task management function
+                                                * request completed with
+                                                * an expected busfree.
+                                                */
+               TASKMGMT_CMD_CMPLT_OKAY,        /*
+                                                * A command with a non-zero
+                                                * task management function
+                                                * has completed via the normal
+                                                * command completion method
+                                                * for commands with a zero
+                                                * task management function.
+                                                * This happens when an attempt
+                                                * to abort a command loses
+                                                * the race for the command to
+                                                * complete normally.
+                                                */
+               TRACEPOINT0,
+               TRACEPOINT1,
+               TRACEPOINT2,
+               TRACEPOINT3,
+               SAW_HWERR
+       }
+}
+
+/*
+ * Clear Host Interrupt
+ */
+register CLRINT {
+       address                 0x003
+       access_mode     WO
+       field   CLRHWERRINT     0x80 /* Rev B or greater */
+       field   CLRBRKADRINT    0x40
+       field   CLRSWTMINT      0x20
+       field   CLRPCIINT       0x10
+       field   CLRSCSIINT      0x08
+       field   CLRSEQINT       0x04
+       field   CLRCMDINT       0x02
+       field   CLRSPLTINT      0x01
+}
+
+/*
+ * Error Register
+ */
+register ERROR {
+       address                 0x004
+       access_mode     RO
+       field   CIOPARERR       0x80
+       field   CIOACCESFAIL    0x40 /* Rev B or greater */
+       field   MPARERR         0x20



Home | Main Index | Thread Index | Old Index