summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ncr53c8xx.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
committer <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
commit19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch)
tree40b1cb534496a7f1ca0f5c314a523c69f1fee464 /drivers/scsi/ncr53c8xx.h
parent7206675c40394c78a90e74812bbdbf8cf3cca1be (diff)
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'drivers/scsi/ncr53c8xx.h')
-rw-r--r--drivers/scsi/ncr53c8xx.h223
1 files changed, 178 insertions, 45 deletions
diff --git a/drivers/scsi/ncr53c8xx.h b/drivers/scsi/ncr53c8xx.h
index bad845ed0..3c0c7fb03 100644
--- a/drivers/scsi/ncr53c8xx.h
+++ b/drivers/scsi/ncr53c8xx.h
@@ -45,10 +45,10 @@
/*
** Name and revision of the driver
*/
-#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - revision 1.14c"
+#define SCSI_NCR_DRIVER_NAME "ncr53c8xx - revision 1.18f"
/*
-** If SCSI_NCR_SPECIAL_FEATURES is defined,
+** If SCSI_NCR_SETUP_SPECIAL_FEATURES is defined,
** the driver enables or not the following features according to chip id
** revision id:
** DMODE 0xce
@@ -63,6 +63,9 @@
** 0x01 set write and invalidate
** CTEST4 0x80
** 0x80 burst disabled
+** CTEST5 0x24 (825a and 875 only)
+** 0x04 burst 128
+** 0x80 large dma fifo
**
** If SCSI_NCR_TRUST_BIOS_SETTING is defined, the driver will use the
** initial value of corresponding bit fields, assuming they have been
@@ -71,14 +74,6 @@
** the driver will not be able to guess it.
*/
-#if 0
-#define SCSI_NCR_TRUST_BIOS_SETTING
-#endif
-
-#if 0
-#define SCSI_NCR_SPECIAL_FEATURES
-#endif
-
/*********** LINUX SPECIFIC SECTION ******************/
/*
@@ -144,10 +139,23 @@
# define SCSI_NCR_SHARE_IRQ
#endif
-/*
-** Avoid to change these constants, unless you know what you are doing.
+/* ---------------------------------------------------------------------
+** Take into account kernel configured parameters.
+** Most of these options can be overridden at startup by a command line.
+** ---------------------------------------------------------------------
*/
+/*
+ * For Ultra2 SCSI support option, use special features and allow 40Mhz
+ * synchronous data transfers.
+ */
+#define SCSI_NCR_SETUP_SPECIAL_FEATURES (1)
+#define SCSI_NCR_SETUP_ULTRA_SCSI (2)
+#define SCSI_NCR_MAX_SYNC (40)
+
+/*
+ * Allow tags from 2 to 12, default 4
+ */
#ifdef CONFIG_SCSI_NCR53C8XX_MAX_TAGS
#if CONFIG_SCSI_NCR53C8XX_MAX_TAGS < 2
#define SCSI_NCR_MAX_TAGS (2)
@@ -160,66 +168,121 @@
#define SCSI_NCR_MAX_TAGS (4)
#endif
-#define SCSI_NCR_ALWAYS_SIMPLE_TAG
-
-#ifdef CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE
-#define SCSI_NCR_DEFAULT_TAGS SCSI_NCR_MAX_TAGS
+/*
+ * Allow tagged command queuing support if configured with default number
+ * of tags set to max (see above).
+ */
+#ifdef CONFIG_SCSI_NCR53C8XX_TAGGED_QUEUE
+#define SCSI_NCR_SETUP_DEFAULT_TAGS SCSI_NCR_MAX_TAGS
#else
-#define SCSI_NCR_DEFAULT_TAGS (0)
+#define SCSI_NCR_SETUP_DEFAULT_TAGS (0)
#endif
-#ifdef CONFIG_SCSI_NCR53C8XX_IOMAPPED
+/*
+ * Use normal IO if configured. Forced for alpha.
+ */
+#if defined(CONFIG_SCSI_NCR53C8XX_IOMAPPED) || defined(__alpha__)
#define SCSI_NCR_IOMAPPED
#endif
-#ifdef CONFIG_SCSI_NCR53C8XX_SYNC
-#if CONFIG_SCSI_NCR53C8XX_SYNC == 0
-#define SCSI_NCR_DEFAULT_SYNC (0)
-#elif CONFIG_SCSI_NCR53C8XX_SYNC < 5
-#define SCSI_NCR_DEFAULT_SYNC (5000)
-#elif CONFIG_SCSI_NCR53C8XX_SYNC > 10
-#define SCSI_NCR_DEFAULT_SYNC (10000)
-#else
-#define SCSI_NCR_DEFAULT_SYNC (CONFIG_SCSI_NCR53C8XX_SYNC * 1000)
+/*
+ * Sync transfer frequency at startup.
+ * Allow from 5Mhz to 40Mhz default 10 Mhz.
+ */
+#ifndef CONFIG_SCSI_NCR53C8XX_SYNC
+#define CONFIG_SCSI_NCR53C8XX_SYNC (5)
+#elif CONFIG_SCSI_NCR53C8XX_SYNC > SCSI_NCR_MAX_SYNC
+#define SCSI_NCR_SETUP_DEFAULT_SYNC SCSI_NCR_MAX_SYNC
#endif
+
+#if CONFIG_SCSI_NCR53C8XX_SYNC == 0
+#define SCSI_NCR_SETUP_DEFAULT_SYNC (255)
+#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 5
+#define SCSI_NCR_SETUP_DEFAULT_SYNC (50)
+#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 20
+#define SCSI_NCR_SETUP_DEFAULT_SYNC (250/(CONFIG_SCSI_NCR53C8XX_SYNC))
+#elif CONFIG_SCSI_NCR53C8XX_SYNC <= 33
+#define SCSI_NCR_SETUP_DEFAULT_SYNC (11)
#else
-#define SCSI_NCR_DEFAULT_SYNC (10000)
+#define SCSI_NCR_SETUP_DEFAULT_SYNC (10)
#endif
+/*
+ * Default sync to 0 will force asynchronous at startup
+ */
#ifdef CONFIG_SCSI_FORCE_ASYNCHRONOUS
-#undef SCSI_NCR_DEFAULT_SYNC
-#define SCSI_NCR_DEFAULT_SYNC (0)
+#undef SCSI_NCR_SETUP_DEFAULT_SYNC
+#define SCSI_NCR_SETUP_DEFAULT_SYNC (255)
#endif
+/*
+ * Disallow disconnections at boot-up
+ */
#ifdef CONFIG_SCSI_NCR53C8XX_NO_DISCONNECT
-#define SCSI_NCR_NO_DISCONNECT
+#define SCSI_NCR_SETUP_DISCONNECTION (0)
+#else
+#define SCSI_NCR_SETUP_DISCONNECTION (1)
#endif
+/*
+ * Force synchronous negotiation for all targets
+ */
#ifdef CONFIG_SCSI_NCR53C8XX_FORCE_SYNC_NEGO
-#define SCSI_NCR_FORCE_SYNC_NEGO
+#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (1)
+#else
+#define SCSI_NCR_SETUP_FORCE_SYNC_NEGO (0)
#endif
+/*
+ * Disable master parity checking (flawed hardwares need that)
+ */
#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_MPARITY_CHECK
-#define SCSI_NCR_DISABLE_MPARITY_CHECK
+#define SCSI_NCR_SETUP_MASTER_PARITY (0)
+#else
+#define SCSI_NCR_SETUP_MASTER_PARITY (1)
#endif
+/*
+ * Disable scsi parity checking (flawed devices may need that)
+ */
#ifdef CONFIG_SCSI_NCR53C8XX_DISABLE_PARITY_CHECK
-#define SCSI_NCR_DISABLE_PARITY_CHECK
+#define SCSI_NCR_SETUP_SCSI_PARITY (0)
+#else
+#define SCSI_NCR_SETUP_SCSI_PARITY (1)
#endif
-#if 0
-#define SCSI_NCR_SEGMENT_SIZE (512)
+/*
+ * Vendor specific stuff
+ */
+#ifdef CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT
+#define SCSI_NCR_SETUP_LED_PIN (1)
+#define SCSI_NCR_SETUP_DIFF_SUPPORT (3)
+#else
+#define SCSI_NCR_SETUP_LED_PIN (0)
+#define SCSI_NCR_SETUP_DIFF_SUPPORT (0)
#endif
-#define SCSI_NCR_MAX_SCATTER (128)
+/*
+ * Settle time after reset at boot-up
+ */
+#define SCSI_NCR_SETUP_SETTLE_TIME (2)
+
+/*
+** Other parameters not configurable with "make config"
+** Avoid to change these constants, unless you know what you are doing.
+*/
+
+#define SCSI_NCR_ALWAYS_SIMPLE_TAG
+#define SCSI_NCR_MAX_SCATTER (127)
#define SCSI_NCR_MAX_TARGET (16)
#define SCSI_NCR_MAX_HOST (2)
-#define SCSI_NCR_SETTLE_TIME (2)
#define SCSI_NCR_TIMEOUT_ALERT (3*HZ)
#define SCSI_NCR_CAN_QUEUE (7*SCSI_NCR_MAX_TAGS)
#define SCSI_NCR_CMD_PER_LUN (SCSI_NCR_MAX_TAGS)
-#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER-1)
+#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER)
+
+#define SCSI_NCR_TIMER_INTERVAL ((HZ+5-1)/5)
#if 1 /* defined CONFIG_SCSI_MULTI_LUN */
#define SCSI_NCR_MAX_LUN (8)
@@ -227,7 +290,56 @@
#define SCSI_NCR_MAX_LUN (1)
#endif
-#define SCSI_NCR_TIMER_INTERVAL ((HZ+5-1)/5)
+/*
+** Initial setup.
+** Can be overriden at startup by a command line.
+*/
+#define SCSI_NCR_DRIVER_SETUP \
+{ \
+ SCSI_NCR_SETUP_MASTER_PARITY, \
+ SCSI_NCR_SETUP_SCSI_PARITY, \
+ SCSI_NCR_SETUP_DISCONNECTION, \
+ SCSI_NCR_SETUP_SPECIAL_FEATURES, \
+ SCSI_NCR_SETUP_ULTRA_SCSI, \
+ SCSI_NCR_SETUP_FORCE_SYNC_NEGO, \
+ 0, \
+ 1, \
+ SCSI_NCR_SETUP_DEFAULT_TAGS, \
+ SCSI_NCR_SETUP_DEFAULT_SYNC, \
+ 0x00, \
+ 7, \
+ SCSI_NCR_SETUP_LED_PIN, \
+ 1, \
+ SCSI_NCR_SETUP_SETTLE_TIME, \
+ SCSI_NCR_SETUP_DIFF_SUPPORT, \
+ 0 \
+}
+
+/*
+** Boot fail safe setup.
+** Override initial setup from boot command line:
+** ncr53c8xx=safe:y
+*/
+#define SCSI_NCR_DRIVER_SAFE_SETUP \
+{ \
+ 0, \
+ 1, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ 0, \
+ 2, \
+ 0, \
+ 255, \
+ 0x00, \
+ 255, \
+ 0, \
+ 0, \
+ 10, \
+ 1, \
+ 1 \
+}
/*
** Define Scsi_Host_Template parameters
@@ -442,6 +554,7 @@ struct ncr_reg {
/*03*/ u_char nc_scntl3; /* cnf system clock dependent */
#define EWS 0x08 /* cmd: enable wide scsi [W]*/
+ #define ULTRA 0x80 /* cmd: ULTRA enable */
/*04*/ u_char nc_scid; /* cnf host adapter scsi address */
#define RRE 0x40 /* r/w:e enable response to resel. */
@@ -520,13 +633,20 @@ struct ncr_reg {
#define CSIGP 0x40
/*1b*/ u_char nc_ctest3;
- #define CLF 0x04 /* clear scsi fifo */
+ #define FLF 0x08 /* cmd: flush dma fifo */
+ #define CLF 0x04 /* cmd: clear dma fifo */
+ #define FM 0x02 /* mod: fetch pin mode */
+ #define WRIE 0x01 /* mod: write and invalidate enable */
/*1c*/ u_int32 nc_temp; /* ### Temporary stack */
/*20*/ u_char nc_dfifo;
/*21*/ u_char nc_ctest4;
+ #define BDIS 0x80 /* mod: burst disable */
+ #define MPEE 0x08 /* mod: master parity error enable */
+
/*22*/ u_char nc_ctest5;
+ #define DFS 0x20 /* mod: dma fifo size */
/*23*/ u_char nc_ctest6;
/*24*/ u_int32 nc_dbc; /* ### Byte count and command */
@@ -536,13 +656,25 @@ struct ncr_reg {
/*34*/ u_int32 nc_scratcha; /* ??? Temporary register a */
/*38*/ u_char nc_dmode;
+ #define BL_2 0x80 /* mod: burst length shift value +2 */
+ #define BL_1 0x40 /* mod: burst length shift value +1 */
+ #define ERL 0x08 /* mod: enable read line */
+ #define ERMP 0x04 /* mod: enable read multiple */
+ #define BOF 0x02 /* mod: burst op code fetch */
+
/*39*/ u_char nc_dien;
/*3a*/ u_char nc_dwt;
/*3b*/ u_char nc_dcntl; /* --> Script execution control */
- #define SSM 0x10 /* mod: single step mode */
- #define STD 0x04 /* cmd: start dma mode */
- #define NOCOM 0x01 /* cmd: protect sfbr while reselect */
+
+ #define CLSE 0x80 /* mod: cache line size enable */
+ #define PFF 0x40 /* cmd: pre-fetch flush */
+ #define PFEN 0x20 /* mod: pre-fetch enable */
+ #define SSM 0x10 /* mod: single step mode */
+ #define IRQM 0x08 /* mod: irq mode (1 = totem pole !) */
+ #define STD 0x04 /* cmd: start dma mode */
+ #define IRQD 0x02 /* mod: irq disable */
+ #define NOCOM 0x01 /* cmd: protect sfbr while reselect */
/*3c*/ u_int32 nc_adder;
@@ -584,7 +716,8 @@ struct ncr_reg {
#define CSF 0x02 /* c: clear scsi fifo */
/*50*/ u_short nc_sidl; /* Lowlevel: latched from scsi data */
-/*52*/ u_short nc_52_;
+/*52*/ u_char nc_stest4;
+/*53*/ u_char nc_53_;
/*54*/ u_short nc_sodl; /* Lowlevel: data out to scsi data */
/*56*/ u_short nc_56_;
/*58*/ u_short nc_sbdl; /* Lowlevel: data from scsi data */