📄 aic7xxx.reg
字号:
/* * Aic7xxx register and scratch ram definitions. * * Copyright (c) 1994-2001 Justin T. Gibbs. * Copyright (c) 2000-2001 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$ */VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#40 $"/* * This file is processed by the aic7xxx_asm utility for use in assembling * firmware for the aic7xxx family of SCSI host adapters as well as to generate * a C header file for use in the kernel portion of the Aic7xxx driver. * * All page numbers refer to the Adaptec AIC-7770 Data Book available from * Adaptec's Technical Documents Department 1-800-934-2766 *//* * SCSI Sequence Control (p. 3-11). * Each bit, when set starts a specific SCSI sequence on the bus */register SCSISEQ { address 0x000 access_mode RW field TEMODE 0x80 field ENSELO 0x40 field ENSELI 0x20 field ENRSELI 0x10 field ENAUTOATNO 0x08 field ENAUTOATNI 0x04 field ENAUTOATNP 0x02 field SCSIRSTO 0x01}/* * SCSI Transfer Control 0 Register (pp. 3-13). * Controls the SCSI module data path. */register SXFRCTL0 { address 0x001 access_mode RW field DFON 0x80 field DFPEXP 0x40 field FAST20 0x20 field CLRSTCNT 0x10 field SPIOEN 0x08 field SCAMEN 0x04 field CLRCHN 0x02}/* * SCSI Transfer Control 1 Register (pp. 3-14,15). * Controls the SCSI module data path. */register SXFRCTL1 { address 0x002 access_mode RW field BITBUCKET 0x80 field SWRAPEN 0x40 field ENSPCHK 0x20 mask STIMESEL 0x18 field ENSTIMER 0x04 field ACTNEGEN 0x02 field STPWEN 0x01 /* Powered Termination */}/* * SCSI Control Signal Read Register (p. 3-15). * Reads the actual state of the SCSI bus pins */register SCSISIGI { address 0x003 access_mode RO field CDI 0x80 field IOI 0x40 field MSGI 0x20 field ATNI 0x10 field SELI 0x08 field BSYI 0x04 field REQI 0x02 field ACKI 0x01/* * Possible phases in SCSISIGI */ mask PHASE_MASK CDI|IOI|MSGI mask P_DATAOUT 0x00 mask P_DATAIN IOI mask P_DATAOUT_DT P_DATAOUT|MSGI mask P_DATAIN_DT P_DATAIN|MSGI mask P_COMMAND CDI mask P_MESGOUT CDI|MSGI mask P_STATUS CDI|IOI mask P_MESGIN CDI|IOI|MSGI}/* * SCSI Control Signal Write Register (p. 3-16). * Writing to this register modifies the control signals on the bus. Only * those signals that are allowed in the current mode (Initiator/Target) are * asserted. */register SCSISIGO { address 0x003 access_mode WO field CDO 0x80 field IOO 0x40 field MSGO 0x20 field ATNO 0x10 field SELO 0x08 field BSYO 0x04 field REQO 0x02 field ACKO 0x01/* * Possible phases to write into SCSISIG0 */ mask PHASE_MASK CDI|IOI|MSGI mask P_DATAOUT 0x00 mask P_DATAIN IOI mask P_COMMAND CDI mask P_MESGOUT CDI|MSGI mask P_STATUS CDI|IOI mask P_MESGIN CDI|IOI|MSGI}/* * SCSI Rate Control (p. 3-17). * Contents of this register determine the Synchronous SCSI data transfer * rate and the maximum synchronous Req/Ack offset. An offset of 0 in the * SOFS (3:0) bits disables synchronous data transfers. Any offset value * greater than 0 enables synchronous transfers. */register SCSIRATE { address 0x004 access_mode RW field WIDEXFER 0x80 /* Wide transfer control */ field ENABLE_CRC 0x40 /* CRC for D-Phases */ field SINGLE_EDGE 0x10 /* Disable DT Transfers */ mask SXFR 0x70 /* Sync transfer rate */ mask SXFR_ULTRA2 0x0f /* Sync transfer rate */ mask SOFS 0x0f /* Sync offset */}/* * SCSI ID (p. 3-18). * Contains the ID of the board and the current target on the * selected channel. */register SCSIID { address 0x005 access_mode RW mask TID 0xf0 /* Target ID mask */ mask TWIN_TID 0x70 field TWIN_CHNLB 0x80 mask OID 0x0f /* Our ID mask */ /* * SCSI Maximum Offset (p. 4-61 aic7890/91 Data Book) * The aic7890/91 allow an offset of up to 127 transfers in both wide * and narrow mode. */ alias SCSIOFFSET mask SOFS_ULTRA2 0x7f /* Sync offset U2 chips */}/* * SCSI Latched Data (p. 3-19). * Read/Write latches used to transfer data on the SCSI bus during * Automatic or Manual PIO mode. SCSIDATH can be used for the * upper byte of a 16bit wide asynchronouse data phase transfer. */register SCSIDATL { address 0x006 access_mode RW}register SCSIDATH { address 0x007 access_mode RW}/* * SCSI Transfer Count (pp. 3-19,20) * These registers count down the number of bytes transferred * across the SCSI bus. The counter is decremented only once * the data has been safely transferred. SDONE in SSTAT0 is * set when STCNT goes to 0 */ register STCNT { address 0x008 size 3 access_mode RW}/* ALT_MODE registers (Ultra2 and Ultra160 chips) */register SXFRCTL2 { address 0x013 access_mode RW field AUTORSTDIS 0x10 field CMDDMAEN 0x08 mask ASYNC_SETUP 0x07}/* ALT_MODE register on Ultra160 chips */register OPTIONMODE { address 0x008 access_mode RW field AUTORATEEN 0x80 field AUTOACKEN 0x40 field ATNMGMNTEN 0x20 field BUSFREEREV 0x10 field EXPPHASEDIS 0x08 field SCSIDATL_IMGEN 0x04 field AUTO_MSGOUT_DE 0x02 field DIS_MSGIN_DUALEDGE 0x01 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE|DIS_MSGIN_DUALEDGE}/* ALT_MODE register on Ultra160 chips */register TARGCRCCNT { address 0x00a size 2 access_mode RW}/* * Clear SCSI Interrupt 0 (p. 3-20) * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0. */register CLRSINT0 { address 0x00b access_mode WO field CLRSELDO 0x40 field CLRSELDI 0x20 field CLRSELINGO 0x10 field CLRSWRAP 0x08 field CLRIOERR 0x08 /* Ultra2 Only */ field CLRSPIORDY 0x02}/* * SCSI Status 0 (p. 3-21) * Contains one set of SCSI Interrupt codes * These are most likely of interest to the sequencer */register SSTAT0 { address 0x00b access_mode RO field TARGET 0x80 /* Board acting as target */ field SELDO 0x40 /* Selection Done */ field SELDI 0x20 /* Board has been selected */ field SELINGO 0x10 /* Selection In Progress */ field SWRAP 0x08 /* 24bit counter wrap */ field IOERR 0x08 /* LVD Tranceiver mode changed */ field SDONE 0x04 /* STCNT = 0x000000 */ field SPIORDY 0x02 /* SCSI PIO Ready */ field DMADONE 0x01 /* DMA transfer completed */}/* * Clear SCSI Interrupt 1 (p. 3-23) * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1. */register CLRSINT1 { address 0x00c access_mode WO field CLRSELTIMEO 0x80 field CLRATNO 0x40 field CLRSCSIRSTI 0x20 field CLRBUSFREE 0x08 field CLRSCSIPERR 0x04 field CLRPHASECHG 0x02 field CLRREQINIT 0x01}/* * SCSI Status 1 (p. 3-24) */register SSTAT1 { address 0x00c access_mode RO field SELTO 0x80 field ATNTARG 0x40 field SCSIRSTI 0x20 field PHASEMIS 0x10 field BUSFREE 0x08 field SCSIPERR 0x04 field PHASECHG 0x02 field REQINIT 0x01}/* * SCSI Status 2 (pp. 3-25,26) */register SSTAT2 { address 0x00d access_mode RO field OVERRUN 0x80 field SHVALID 0x40 /* Shaddow Layer non-zero */ field EXP_ACTIVE 0x10 /* SCSI Expander Active */ field CRCVALERR 0x08 /* CRC doesn't match (U3 only) */ field CRCENDERR 0x04 /* No terminal CRC packet (U3 only) */ field CRCREQERR 0x02 /* Illegal CRC packet req (U3 only) */ field DUAL_EDGE_ERR 0x01 /* Incorrect data phase (U3 only) */ mask SFCNT 0x1f}/* * SCSI Status 3 (p. 3-26) */register SSTAT3 { address 0x00e access_mode RO mask SCSICNT 0xf0 mask OFFCNT 0x0f mask U2OFFCNT 0x7f}/* * SCSI ID for the aic7890/91 chips */register SCSIID_ULTRA2 { address 0x00f access_mode RW mask TID 0xf0 /* Target ID mask */ mask OID 0x0f /* Our ID mask */}/* * SCSI Interrupt Mode 1 (p. 3-28) * Setting any bit will enable the corresponding function * in SIMODE0 to interrupt via the IRQ pin. */register SIMODE0 { address 0x010 access_mode RW field ENSELDO 0x40 field ENSELDI 0x20 field ENSELINGO 0x10 field ENSWRAP 0x08 field ENIOERR 0x08 /* LVD Tranceiver mode changes */ field ENSDONE 0x04 field ENSPIORDY 0x02 field ENDMADONE 0x01}/* * SCSI Interrupt Mode 1 (pp. 3-28,29) * Setting any bit will enable the corresponding function * in SIMODE1 to interrupt via the IRQ pin. */register SIMODE1 { address 0x011 access_mode RW field ENSELTIMO 0x80 field ENATNTARG 0x40 field ENSCSIRST 0x20 field ENPHASEMIS 0x10 field ENBUSFREE 0x08 field ENSCSIPERR 0x04 field ENPHASECHG 0x02 field ENREQINIT 0x01}/* * SCSI Data Bus (High) (p. 3-29) * This register reads data on the SCSI Data bus directly. */register SCSIBUSL { address 0x012 access_mode RW}register SCSIBUSH { address 0x013 access_mode RW}/* * SCSI/Host Address (p. 3-30) * These registers hold the host address for the byte about to be * transferred on the SCSI bus. They are counted up in the same * manner as STCNT is counted down. SHADDR should always be used * to determine the address of the last byte transferred since HADDR * can be skewed by write ahead. */register SHADDR { address 0x014 size 4 access_mode RO}/* * Selection Timeout Timer (p. 3-30) */register SELTIMER { address 0x018 access_mode RW field STAGE6 0x20 field STAGE5 0x10 field STAGE4 0x08 field STAGE3 0x04 field STAGE2 0x02 field STAGE1 0x01 alias TARGIDIN}/* * Selection/Reselection ID (p. 3-31) * Upper four bits are the device id. The ONEBIT is set when the re/selecting * device did not set its own ID. */register SELID { address 0x019 access_mode RW mask SELID_MASK 0xf0 field ONEBIT 0x08}register SCAMCTL { address 0x01a access_mode RW field ENSCAMSELO 0x80 field CLRSCAMSELID 0x40 field ALTSTIM 0x20 field DFLTTID 0x10 mask SCAMLVL 0x03}/* * Target Mode Selecting in ID bitmask (aic7890/91/96/97) */register TARGID { address 0x01b size 2 access_mode RW}/* * Serial Port I/O Cabability register (p. 4-95 aic7860 Data Book) * Indicates if external logic has been attached to the chip to * perform the tasks of accessing a serial eeprom, testing termination * strength, and performing cable detection. On the aic7860, most of * these features are handled on chip, but on the aic7855 an attached * aic3800 does the grunt work. */register SPIOCAP { address 0x01b access_mode RW field SOFT1 0x80 field SOFT0 0x40 field SOFTCMDEN 0x20 field EXT_BRDCTL 0x10 /* External Board control */ field SEEPROM 0x08 /* External serial eeprom logic */ field EEPROM 0x04 /* Writable external BIOS ROM */ field ROM 0x02 /* Logic for accessing external ROM */ field SSPIOCPS 0x01 /* Termination and cable detection */}register BRDCTL { address 0x01d field BRDDAT7 0x80 field BRDDAT6 0x40 field BRDDAT5 0x20 field BRDSTB 0x10 field BRDCS 0x08 field BRDRW 0x04 field BRDCTL1 0x02 field BRDCTL0 0x01 /* 7890 Definitions */ field BRDDAT4 0x10 field BRDDAT3 0x08 field BRDDAT2 0x04 field BRDRW_ULTRA2 0x02 field BRDSTB_ULTRA2 0x01}/* * Serial EEPROM Control (p. 4-92 in 7870 Databook) * Controls the reading and writing of an external serial 1-bit * EEPROM Device. In order to access the serial EEPROM, you must * first set the SEEMS bit that generates a request to the memory * port for access to the serial EEPROM device. When the memory * port is not busy servicing another request, it reconfigures * to allow access to the serial EEPROM. When this happens, SEERDY * gets set high to verify that the memory port access has been * granted. * * After successful arbitration for the memory port, the SEECS bit of * the SEECTL register is connected to the chip select. The SEECK, * SEEDO, and SEEDI are connected to the clock, data out, and data in * lines respectively. The SEERDY bit of SEECTL is useful in that it * gives us an 800 nsec timer. After a write to the SEECTL register, * the SEERDY goes high 800 nsec later. The one exception to this is * when we first request access to the memory port. The SEERDY goes * high to signify that access has been granted and, for this case, has * no implied timing. * * See 93cx6.c for detailed information on the protocol necessary to
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -