📄 am53c974.h
字号:
/* AM53/79C974 (PCscsi) driver release 0.5 * * The architecture and much of the code of this device * driver was originally developed by Drew Eckhardt for * the NCR5380. The following copyrights apply: * For the architecture and all parts similar to the NCR5380: * Copyright 1993, Drew Eckhardt * Visionary Computing * (Unix and Linux consulting and custom programming) * drew@colorado.edu * +1 (303) 666-5836 * * The AM53C974_nobios_detect code was originally developed by * Robin Cutshaw (robin@xfree86.org) and is used here in a * modified form. * * For the other parts: * Copyright 1994, D. Frieauff * EMail: fri@rsx42sun0.dofn.de * Phone: x49-7545-8-2256 , x49-7541-42305 *//* * $Log: AM53C974.h,v $ * Revision 1.1 1999/04/26 05:53:51 tb * 1998-11-30 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> * * Clean up linux emulation code to make it architecture-independent * as much as possible. * * * linux: Renamed from linuxdev. * * Makefile.in (objfiles): Add linux.o instead of linuxdev.o. * (MAKE): New variable. Used for the linux.o target. * * configure.in: Add AC_CHECK_TOOL(MAKE, make). * * i386/i386/spl.h: Include <i386/ipl.h>, for compatibility with * OSF Mach 3.0. Suggested by Elgin Lee <ehl@funghi.com>. * * linux/src: Renamed from linux/linux. * * linux/dev: Renamed from linux/mach. * * linux/Drivers.in (AC_INIT): Use dev/include/linux/autoconf.h, * instead of mach/include/linux/autoconf.h. * * Makefile.in (all): Target ../linux.o instead of ../linuxdev.o. * * linux/dev/drivers/block/genhd.c: Include <machine/spl.h> instead * of <i386/ipl.h>. * * linux/dev/drivers/net/auto_irq.c: Remove unneeded header files, * <i386/ipl.h> and <i386/pic.h>. * * linux/dev/init/main.c: Many i386-dependent codes moved to ... * * linux/dev/arch/i386/irq.c: ... here. * * linux/dev/arch/i386/setup.c: New file. * * linux/dev/arch/i386/linux_emul.h: Likewise. * * linux/dev/arch/i386/glue/timer.c: Merged into sched.c. * * linux/dev/arch/i386/glue/sched.c: Include <machine/spl.h> instead * of <i386/ipl.h>, and moved to ... * * linux/dev/kernel/sched.c: ... here. * * linux/dev/arch/i386/glue/block.c: Include <machine/spl.h> and * <linux_emul.h>, instead of i386-dependent header files, and * moved to ... * * linux/dev/glue/blocl.c: ... here. * * linux/dev/arch/i386/glue/net.c: Include <machine/spl.h> and * <linux_emul.h>, instead of i386-dependent header files, and * moved to ... * * linux/dev/glue/net.c: ... here. * * linux/dev/arch/i386/glue/misc.c: Remove `x86' and moved to ... * * linux/dev/glue/misc.c: ... here. * * linux/dev/arch/i386/glue/kmem.c: Moved to ... * * linux/dev/glue/kmem.c: ... here. * */#ifndef AM53C974_H#define AM53C974_H#include <scsi/scsicam.h>/**************************************************************************************** Default setting of the controller's SCSI id. Edit and uncomment this only if your ** BIOS does not correctly initialize the controller's SCSI id. ** If you don't get a warning during boot, it is correctly initialized. *****************************************************************************************//* #define AM53C974_SCSI_ID 7 *//**************************************************************************************** Default settings for sync. negotiation enable, transfer rate and sync. offset. ** These settings can be replaced by LILO overrides (append) with the following syntax: ** AM53C974=host-scsi-id, target-scsi-id, max-rate, max-offset ** Sync. negotiation is disabled by default and will be enabled for those targets which ** are specified in the LILO override *****************************************************************************************/#define DEFAULT_SYNC_NEGOTIATION_ENABLED 0 /* 0 or 1 */#define DEFAULT_RATE 5 /* MHz, min: 3; max: 10 */#define DEFAULT_SYNC_OFFSET 0 /* bytes, min: 0; max: 15; use 0 for async. mode *//* --------------------- don't edit below here --------------------- */#define AM53C974_DRIVER_REVISION_MAJOR 0#define AM53C974_DRIVER_REVISION_MINOR 5#define SEPARATOR_LINE \"--------------------------------------------------------------------------\n"/* debug control *//* #define AM53C974_DEBUG *//* #define AM53C974_DEBUG_MSG *//* #define AM53C974_DEBUG_KEYWAIT *//* #define AM53C974_DEBUG_INIT *//* #define AM53C974_DEBUG_QUEUE *//* #define AM53C974_DEBUG_INFO *//* #define AM53C974_DEBUG_LINKED *//* #define VERBOSE_AM53C974_DEBUG *//* #define AM53C974_DEBUG_INTR *//* #define AM53C974_DEB_RESEL */#define AM53C974_DEBUG_ABORT/* #define AM53C974_OPTION_DEBUG_PROBE_ONLY *//* special options/constants */#define DEF_CLK 40 /* chip clock freq. in MHz */#define MIN_PERIOD 4 /* for negotiation: min. number of clocks per cycle */#define MAX_PERIOD 13 /* for negotiation: max. number of clocks per cycle */#define MAX_OFFSET 15 /* for negotiation: max. offset (0=async) */#define DEF_SCSI_TIMEOUT 245 /* STIMREG value, 40 Mhz */#define DEF_STP 8 /* STPREG value assuming 5.0 MB/sec, FASTCLK, FASTSCSI */#define DEF_SOF_RAD 0 /* REQ/ACK deassertion delay */#define DEF_SOF_RAA 0 /* REQ/ACK assertion delay */#define DEF_ETM 0 /* CNTLREG1, ext. timing mode */#define DEF_PERE 1 /* CNTLREG1, parity error reporting */#define DEF_CLKF 0 /* CLKFREG, 0=40 Mhz */#define DEF_ENF 1 /* CNTLREG2, enable features */#define DEF_ADIDCHK 0 /* CNTLREG3, additional ID check */#define DEF_FASTSCSI 1 /* CNTLREG3, fast SCSI */#define DEF_FASTCLK 1 /* CNTLREG3, fast clocking, 5 MB/sec at 40MHz chip clk */#define DEF_GLITCH 1 /* CNTLREG4, glitch eater, 0=12ns, 1=35ns, 2=25ns, 3=off */#define DEF_PWD 0 /* CNTLREG4, reduced power feature */#define DEF_RAE 0 /* CNTLREG4, RAE active negation on REQ, ACK only */#define DEF_RADE 1 /* 1CNTLREG4, active negation on REQ, ACK and data *//*** PCI block ***//* standard registers are defined in <linux/pci.h> */#ifndef PCI_VENDOR_ID_AMD#define PCI_VENDOR_ID_AMD 0x1022#define PCI_DEVICE_ID_AMD_SCSI 0x2020#endif#define PCI_BASE_MASK 0xFFFFFFE0#define PCI_COMMAND_PERREN 0x40#define PCI_SCRATCH_REG_0 0x40 /* 16 bits */#define PCI_SCRATCH_REG_1 0x42 /* 16 bits */#define PCI_SCRATCH_REG_2 0x44 /* 16 bits */#define PCI_SCRATCH_REG_3 0x46 /* 16 bits */#define PCI_SCRATCH_REG_4 0x48 /* 16 bits */#define PCI_SCRATCH_REG_5 0x4A /* 16 bits */#define PCI_SCRATCH_REG_6 0x4C /* 16 bits */#define PCI_SCRATCH_REG_7 0x4E /* 16 bits *//*** SCSI block ***/#define CTCLREG 0x00 /* r current transf. count, low byte */#define CTCMREG 0x04 /* r current transf. count, middle byte */#define CTCHREG 0x38 /* r current transf. count, high byte */#define STCLREG 0x00 /* w start transf. count, low byte */#define STCMREG 0x04 /* w start transf. count, middle byte */#define STCHREG 0x38 /* w start transf. count, high byte */#define FFREG 0x08 /* rw SCSI FIFO reg. */#define STIMREG 0x14 /* w SCSI timeout reg. */#define SDIDREG 0x10 /* w SCSI destination ID reg. */#define SDIREG_MASK 0x07 /* mask */#define STPREG 0x18 /* w synchronous transf. period reg. */#define STPREG_STP 0x1F /* synchr. transfer period */#define CLKFREG 0x24 /* w clock factor reg. */#define CLKFREG_MASK 0x07 /* mask */#define CMDREG 0x0C /* rw SCSI command reg. */#define CMDREG_DMA 0x80 /* set DMA mode (set together with opcodes below) */#define CMDREG_IT 0x10 /* information transfer */#define CMDREG_ICCS 0x11 /* initiator command complete steps */#define CMDREG_MA 0x12 /* message accepted */#define CMDREG_TPB 0x98 /* transfer pad bytes, DMA mode only */#define CMDREG_SATN 0x1A /* set ATN */#define CMDREG_RATN 0x1B /* reset ATN */#define CMDREG_SOAS 0x41 /* select without ATN steps */#define CMDREG_SAS 0x42 /* select with ATN steps (1 msg byte) */#define CMDREG_SASS 0x43 /* select with ATN and stop steps */#define CMDREG_ESR 0x44 /* enable selection/reselection */#define CMDREG_DSR 0x45 /* disable selection/reselection */#define CMDREG_SA3S 0x46 /* select with ATN 3 steps (3 msg bytes) */#define CMDREG_NOP 0x00 /* no operation */#define CMDREG_CFIFO 0x01 /* clear FIFO */#define CMDREG_RDEV 0x02 /* reset device */#define CMDREG_RBUS 0x03 /* reset SCSI bus */#define STATREG 0x10 /* r SCSI status reg. */#define STATREG_INT 0x80 /* SCSI interrupt condition detected */#define STATREG_IOE 0x40 /* SCSI illegal operation error detected */#define STATREG_PE 0x20 /* SCSI parity error detected */#define STATREG_CTZ 0x10 /* CTC reg decremented to zero */#define STATREG_MSG 0x04 /* SCSI MSG phase (latched?) */#define STATREG_CD 0x02 /* SCSI C/D phase (latched?) */#define STATREG_IO 0x01 /* SCSI I/O phase (latched?) */#define STATREG_PHASE 0x07 /* SCSI phase mask */#define INSTREG 0x14 /* r interrupt status reg. */#define INSTREG_SRST 0x80 /* SCSI reset detected */#define INSTREG_ICMD 0x40 /* SCSI invalid command detected */#define INSTREG_DIS 0x20 /* target disconnected or sel/resel timeout*/#define INSTREG_SR 0x10 /* device on bus has service request */#define INSTREG_SO 0x08 /* successful operation */#define INSTREG_RESEL 0x04 /* device reselected as initiator */#define ISREG 0x18 /* r internal state reg. */#define ISREG_SOF 0x08 /* synchronous offset flag (act. low) */#define ISREG_IS 0x07 /* status of intermediate op. */#define ISREG_OK_NO_STOP 0x04 /* selection successful */#define ISREG_OK_STOP 0x01 /* selection successful */#define CFIREG 0x1C /* r current FIFO/internal state reg. */#define CFIREG_IS 0xE0 /* status of intermediate op. */#define CFIREG_CF 0x1F /* number of bytes in SCSI FIFO */#define SOFREG 0x1C /* w synchr. offset reg. */#define SOFREG_RAD 0xC0 /* REQ/ACK deassertion delay (sync.) */#define SOFREG_RAA 0x30 /* REQ/ACK assertion delay (sync.) */#define SOFREG_SO 0x0F /* synch. offset (sync.) */#define CNTLREG1 0x20 /* rw control register one */#define CNTLREG1_ETM 0x80 /* set extended timing mode */#define CNTLREG1_DISR 0x40 /* disable interrupt on SCSI reset */#define CNTLREG1_PERE 0x10 /* enable parity error reporting */#define CNTLREG1_SID 0x07 /* host adapter SCSI ID */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -