/*
* Copyright (c) 1994 Peter Galbavy. 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.
* 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 Peter Galbavy.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
*/
/*
* Register addresses, relative to some base address
*/
#define NCR_TCL 0x00 /* RW - Transfer Count Low */
#define NCR_TCM 0x01 /* RW - Transfer Count Mid */
#define NCR_TCH 0x0e /* RW - Transfer Count High */
/* NOT on 53C90 */
#define NCR_SELID 0x04 /* WO - Select/Reselect Bus ID */
#define NCR_BUSID_HME 0x10 /* XXX HME reselect ID */
#define NCR_BUSID_HME32 0x40 /* XXX HME to select more than 16 */
/* Config #3 only on 53C9X */
#define NCR_CFG3 0x0c /* RW - Configuration #3 */
#define NCRCFG3_RSVD 0xe0 /* reserved */
#define NCRCFG3_IDM 0x10 /* ID Message Res Check */
#define NCRCFG3_QTE 0x08 /* Queue Tag Enable */
#define NCRCFG3_CDB 0x04 /* CDB 10-bytes OK */
#define NCRCFG3_FSCSI 0x02 /* Fast SCSI */
#define NCRCFG3_FCLK 0x01 /* Fast Clock (>25MHz) */
/*
* For some unknown reason, the ESP406/FAS408 looks like every
* other ncr53c9x, except for configuration #3 register. At any
* rate, if you're dealing with these chips, you need to use these
* defines instead.
*/
/* Config #3 different on ESP406/FAS408 */
#define NCR_ESPCFG3 0x0c /* RW - Configuration #3 */
#define NCRESPCFG3_IDM 0x80 /* ID Message Res Check */
#define NCRESPCFG3_QTE 0x40 /* Queue Tag Enable */
#define NCRESPCFG3_CDB 0x20 /* CDB 10-bytes OK */
#define NCRESPCFG3_FSCSI 0x10 /* Fast SCSI */
#define NCRESPCFG3_SRESB 0x08 /* Save Residual Byte */
#define NCRESPCFG3_FCLK 0x04 /* Fast Clock (>25MHz) */
#define NCRESPCFG3_ADMA 0x02 /* Alternate DMA Mode */
#define NCRESPCFG3_T8M 0x01 /* Threshold 8 Mode */
/* Config #3 also different on NCR53CF9x/FAS216 */
#define NCR_F9XCFG3 0x0c /* RW - Configuration #3 */
#define NCRF9XCFG3_IDM 0x80 /* ID Message Res Check */
#define NCRF9XCFG3_QTE 0x40 /* Queue Tag Enable */
#define NCRF9XCFG3_CDB 0x20 /* CDB 10-bytes OK */
#define NCRF9XCFG3_FSCSI 0x10 /* Fast SCSI */
#define NCRF9XCFG3_FCLK 0x08 /* Fast Clock (>25MHz) */
#define NCRF9XCFG3_SRESB 0x04 /* Save Residual Byte */
#define NCRF9XCFG3_ADMA 0x02 /* Alternate DMA Mode */
#define NCRF9XCFG3_T8M 0x01 /* Threshold 8 Mode */
/* Config #3 on FAS366 */
#define NCRFASCFG3_OBAUTO 0x80 /* auto push odd-byte to DMA */
#define NCRFASCFG3_EWIDE 0x40 /* Enable Wide-SCSI */
#define NCRFASCFG3_IDBIT3 0x20 /* Bit 3 of HME SCSI-ID */
#define NCRFASCFG3_IDRESCHK 0x10 /* ID message checking */
#define NCRFASCFG3_QUENB 0x08 /* 3-byte msg support */
#define NCRFASCFG3_CDB10 0x04 /* group 2 scsi-2 support */
#define NCRFASCFG3_FASTSCSI 0x02 /* 10 MB/S fast scsi mode */
#define NCRFASCFG3_FASTCLK 0x01 /* fast clock mode */
/* Config #4 only on ESP406/FAS408 */
#define NCR_CFG4 0x0d /* RW - Configuration #4 */
#define NCRCFG4_CRS1 0x80 /* Select register set #1 */
#define NCRCFG4_RSVD 0x7b /* reserved */
#define NCRCFG4_ACTNEG 0x04 /* Active negation */
/*
The following registers are only on the ESP406/FAS408. The
documentation refers to them as "Control Register Set #1".
These are the registers that are visible when bit 7 of
register 0x0d is set. This bit is common to both register sets.
*/