brintos

brintos / linux-shallow public Read only

0
0
Text · 72.2 KiB · 7e12c31 Raw
4282 lines · plain
1/*2 * Aic79xx register and scratch ram definitions.3 *4 * Copyright (c) 1994-2001, 2004 Justin T. Gibbs.5 * Copyright (c) 2000-2002 Adaptec Inc.6 * All rights reserved.7 *8 * Redistribution and use in source and binary forms, with or without9 * modification, are permitted provided that the following conditions10 * are met:11 * 1. Redistributions of source code must retain the above copyright12 *    notice, this list of conditions, and the following disclaimer,13 *    without modification.14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer15 *    substantially similar to the "NO WARRANTY" disclaimer below16 *    ("Disclaimer") and any redistribution must be conditioned upon17 *    including a substantially similar Disclaimer requirement for further18 *    binary redistribution.19 * 3. Neither the names of the above-listed copyright holders nor the names20 *    of any contributors may be used to endorse or promote products derived21 *    from this software without specific prior written permission.22 *23 * Alternatively, this software may be distributed under the terms of the24 * GNU General Public License ("GPL") version 2 as published by the Free25 * Software Foundation.26 *27 * NO WARRANTY28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT32 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE38 * POSSIBILITY OF SUCH DAMAGES.39 *40 * $FreeBSD$41 */42VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $"43 44/*45 * This file is processed by the aic7xxx_asm utility for use in assembling46 * firmware for the aic79xx family of SCSI host adapters as well as to generate47 * a C header file for use in the kernel portion of the Aic79xx driver.48 */49 50/* Register window Modes */51#define M_DFF0		052#define M_DFF1		153#define M_CCHAN		254#define M_SCSI		355#define M_CFG		456#define M_DST_SHIFT	457 58#define MK_MODE(src, dst) ((src) | ((dst) << M_DST_SHIFT))59#define SET_MODE(src, dst)						\60	SET_SRC_MODE	src;						\61	SET_DST_MODE	dst;						\62	if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {			\63		mvi	MK_MODE(src, dst) call set_mode_work_around;	\64	} else {							\65		mvi	MODE_PTR, MK_MODE(src, dst);			\66	}67 68#define RESTORE_MODE(mode)						\69	if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) {			\70		mov	mode call set_mode_work_around;			\71	} else {							\72		mov	MODE_PTR, mode;					\73	}74 75#define SET_SEQINTCODE(code)						\76	if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) {			\77		mvi	code call set_seqint_work_around;		\78	} else {							\79		mvi	SEQINTCODE, code;				\80	}81 82/*83 * Registers marked "dont_generate_debug_code" are not (yet) referenced84 * from the driver code, and this keyword inhibit generation85 * of debug code for them.86 *87 * REG_PRETTY_PRINT config will complain if dont_generate_debug_code88 * is added to the register which is referenced in the driver.89 * Unreferenced register with no dont_generate_debug_code will result90 * in dead code. No warning is issued.91 */92 93/*94 * Mode Pointer95 * Controls which of the 5, 512byte, address spaces should be used96 * as the source and destination of any register accesses in our97 * register window.98 */99register MODE_PTR {100	address			0x000101	access_mode	RW102	field	DST_MODE	0x70103	field	SRC_MODE	0x07104	mode_pointer105	dont_generate_debug_code106}107 108const SRC_MODE_SHIFT	0109const DST_MODE_SHIFT	4110 111/*112 * Host Interrupt Status113 */114register INTSTAT {115	address			0x001116	access_mode	RW117	field	HWERRINT	0x80118	field	BRKADRINT	0x40119	field	SWTMINT		0x20120	field	PCIINT		0x10121	field	SCSIINT		0x08122	field	SEQINT		0x04123	field	CMDCMPLT	0x02124	field	SPLTINT		0x01125	mask	INT_PEND 0xFF126}127 128/*129 * Sequencer Interrupt Code130 */131register SEQINTCODE {132	address			0x002133	access_mode	RW134	field {135		NO_SEQINT,			/* No seqint pending. */136		BAD_PHASE,			/* unknown scsi bus phase */137		SEND_REJECT,			/* sending a message reject */138		PROTO_VIOLATION, 		/* Protocol Violation */139		NO_MATCH,			/* no cmd match for reconnect */140		IGN_WIDE_RES,			/* Complex IGN Wide Res Msg */141		PDATA_REINIT,			/*142						 * Returned to data phase143						 * that requires data144						 * transfer pointers to be145						 * recalculated from the146						 * transfer residual.147						 */148		HOST_MSG_LOOP,			/*149						 * The bus is ready for the150						 * host to perform another151						 * message transaction.  This152						 * mechanism is used for things153						 * like sync/wide negotiation154						 * that require a kernel based155						 * message state engine.156						 */157		BAD_STATUS,			/* Bad status from target */158		DATA_OVERRUN,			/*159						 * Target attempted to write160						 * beyond the bounds of its161						 * command.162						 */163		MKMSG_FAILED,			/*164						 * Target completed command165						 * without honoring our ATN166						 * request to issue a message. 167						 */168		MISSED_BUSFREE,			/*169						 * The sequencer never saw170						 * the bus go free after171						 * either a command complete172						 * or disconnect message.173						 */174		DUMP_CARD_STATE,175		ILLEGAL_PHASE,176		INVALID_SEQINT,177		CFG4ISTAT_INTR,178		STATUS_OVERRUN,179		CFG4OVERRUN,180		ENTERING_NONPACK,181		TASKMGMT_FUNC_COMPLETE,		/*182						 * Task management function183						 * request completed with184						 * an expected busfree.185						 */186		TASKMGMT_CMD_CMPLT_OKAY,	/*187						 * A command with a non-zero188						 * task management function189						 * has completed via the normal190						 * command completion method191						 * for commands with a zero192						 * task management function.193						 * This happens when an attempt194						 * to abort a command loses195						 * the race for the command to196						 * complete normally.197						 */198		TRACEPOINT0,199		TRACEPOINT1,200		TRACEPOINT2,201		TRACEPOINT3,202		SAW_HWERR,203		BAD_SCB_STATUS204	}205	dont_generate_debug_code206}207 208/*209 * Clear Host Interrupt210 */211register CLRINT {212	address			0x003213	access_mode	WO214	count		19215	field	CLRHWERRINT	0x80 /* Rev B or greater */216	field	CLRBRKADRINT	0x40217	field	CLRSWTMINT	0x20218	field	CLRPCIINT	0x10219	field	CLRSCSIINT	0x08220	field	CLRSEQINT	0x04221	field	CLRCMDINT	0x02222	field	CLRSPLTINT	0x01223	dont_generate_debug_code224}225 226/*227 * Error Register228 */229register ERROR {230	address			0x004231	access_mode	RO232	field	CIOPARERR	0x80233	field	CIOACCESFAIL	0x40 /* Rev B or greater */234	field	MPARERR		0x20235	field	DPARERR		0x10236	field	SQPARERR	0x08237	field	ILLOPCODE	0x04238	field	DSCTMOUT	0x02239	dont_generate_debug_code240}241 242/*243 * Clear Error244 */245register CLRERR {246	address			0x004247	access_mode 	WO248	field	CLRCIOPARERR	0x80249	field	CLRCIOACCESFAIL	0x40 /* Rev B or greater */250	field	CLRMPARERR	0x20251	field	CLRDPARERR	0x10252	field	CLRSQPARERR	0x08253	field	CLRILLOPCODE	0x04254	field	CLRDSCTMOUT	0x02255}256 257/*258 * Host Control Register259 * Overall host control of the device.260 */261register HCNTRL {262	address			0x005263	access_mode	RW264	count		12265	field	SEQ_RESET	0x80 /* Rev B or greater */266	field	POWRDN		0x40267	field	SWINT		0x10268	field	SWTIMER_START_B	0x08 /* Rev B or greater */269	field	PAUSE		0x04270	field	INTEN		0x02271	field	CHIPRST		0x01272	field	CHIPRSTACK	0x01273	dont_generate_debug_code274}275 276/*277 * Host New SCB Queue Offset278 */279register HNSCB_QOFF {280	address			0x006281	access_mode	RW282	size		2283	count		2284	dont_generate_debug_code285}286 287/*288 * Host Empty SCB Queue Offset289 */290register HESCB_QOFF {291	address			0x008292	access_mode	RW293	count		2294	dont_generate_debug_code295}296 297/*298 * Host Mailbox299 */300register HS_MAILBOX {301	address			0x00B302	access_mode	RW303	mask	HOST_TQINPOS	0x80	/* Boundary at either 0 or 128 */304	mask	ENINT_COALESCE	0x40	/* Perform interrupt coalescing */305}306 307/*308 * Sequencer Interrupt Status309 */310register SEQINTSTAT {311	address			0x00C312	count		1313	access_mode	RO314	field	SEQ_SWTMRTO	0x10315	field	SEQ_SEQINT	0x08316	field	SEQ_SCSIINT	0x04317	field	SEQ_PCIINT	0x02318	field	SEQ_SPLTINT	0x01319}320 321/*322 * Clear SEQ Interrupt323 */324register CLRSEQINTSTAT {325	address			0x00C326	access_mode	WO327	field	CLRSEQ_SWTMRTO	0x10328	field	CLRSEQ_SEQINT	0x08329	field	CLRSEQ_SCSIINT	0x04330	field	CLRSEQ_PCIINT	0x02331	field	CLRSEQ_SPLTINT	0x01332	dont_generate_debug_code333}334 335/*336 * Software Timer337 */338register SWTIMER {339	address			0x00E340	access_mode	RW341	size		2342	dont_generate_debug_code343}344 345/*346 * SEQ New SCB Queue Offset347 */348register SNSCB_QOFF {349	address			0x010350	access_mode	RW351	size		2352	modes		M_CCHAN353	dont_generate_debug_code354}355 356/*357 * SEQ Empty SCB Queue Offset358 */359register SESCB_QOFF {360	address			0x012361	count		2362	access_mode	RW363	modes		M_CCHAN364	dont_generate_debug_code365}366 367/*368 * SEQ Done SCB Queue Offset369 */370register SDSCB_QOFF {371	address			0x014372	access_mode	RW373	modes		M_CCHAN374	size		2375	dont_generate_debug_code376}377 378/*379 * Queue Offset Control & Status380 */381register QOFF_CTLSTA {382	address			0x016383	access_mode	RW384	modes		M_CCHAN385	field	EMPTY_SCB_AVAIL	0x80386	field	NEW_SCB_AVAIL	0x40387	field	SDSCB_ROLLOVR	0x20388	field	HS_MAILBOX_ACT	0x10389	field	SCB_QSIZE	0x0F {390		SCB_QSIZE_4,391		SCB_QSIZE_8,392		SCB_QSIZE_16,393		SCB_QSIZE_32,394		SCB_QSIZE_64,395		SCB_QSIZE_128,396		SCB_QSIZE_256,397		SCB_QSIZE_512,398		SCB_QSIZE_1024,399		SCB_QSIZE_2048,400		SCB_QSIZE_4096,401		SCB_QSIZE_8192,402		SCB_QSIZE_16384403	}404	dont_generate_debug_code405}406 407/*408 * Interrupt Control409 */410register INTCTL {411	address			0x018412	access_mode	RW413	field	SWTMINTMASK	0x80414	field	SWTMINTEN	0x40415	field	SWTIMER_START	0x20416	field	AUTOCLRCMDINT	0x10417	field	PCIINTEN	0x08418	field	SCSIINTEN	0x04419	field	SEQINTEN	0x02420	field	SPLTINTEN	0x01421}422 423/*424 * Data FIFO Control425 */426register DFCNTRL {427	address			0x019428	access_mode	RW429	modes		M_DFF0, M_DFF1430	count		11431	field	PRELOADEN	0x80432	field	SCSIENWRDIS	0x40	/* Rev B only. */433	field	SCSIEN		0x20434	field	SCSIENACK	0x20435	field	HDMAEN		0x08436	field	HDMAENACK	0x08437	field	DIRECTION	0x04438	field	DIRECTIONACK	0x04439	field	FIFOFLUSH	0x02440	field	FIFOFLUSHACK	0x02441	field	DIRECTIONEN	0x01442}443 444/*445 * Device Space Command 0446 */447register DSCOMMAND0 {448	address			0x019449	count		1450	access_mode	RW451	modes		M_CFG452	field	CACHETHEN	0x80	/* Cache Threshold enable */453	field	DPARCKEN	0x40	/* Data Parity Check Enable */454	field	MPARCKEN	0x20	/* Memory Parity Check Enable */455	field	EXTREQLCK	0x10	/* External Request Lock */456	field	DISABLE_TWATE	0x02	/* Rev B or greater */457	field	CIOPARCKEN	0x01	/* Internal bus parity error enable */458	dont_generate_debug_code459}460 461/*462 * Data FIFO Status463 */464register DFSTATUS {465	address			0x01A466	access_mode	RO467	modes		M_DFF0, M_DFF1468	field	PRELOAD_AVAIL		0x80469	field	PKT_PRELOAD_AVAIL	0x40470	field	MREQPEND		0x10471	field	HDONE			0x08472	field	DFTHRESH		0x04473	field	FIFOFULL		0x02474	field	FIFOEMP			0x01475}476 477/*478 * S/G Cache Pointer479 */480register SG_CACHE_PRE {481	address			0x01B482	access_mode	WO483	modes		M_DFF0, M_DFF1484	field	SG_ADDR_MASK	0xf8485	field	ODD_SEG		0x04486	field	LAST_SEG	0x02487	dont_generate_debug_code488}489 490register SG_CACHE_SHADOW {491	address			0x01B492	access_mode	RO493	modes		M_DFF0, M_DFF1494	field	SG_ADDR_MASK	0xf8495	field	ODD_SEG		0x04496	field	LAST_SEG	0x02497	field	LAST_SEG_DONE	0x01498}499 500/*501 * Arbiter Control502 */503register ARBCTL {504	address			0x01B505	access_mode	RW506	modes		M_CFG507	field	RESET_HARB	0x80508	field	RETRY_SWEN	0x08509	field	USE_TIME	0x07510}511 512/*513 * Data Channel Host Address514 */515register HADDR {516	address			0x070517	access_mode	RW518	size		8519	modes		M_DFF0, M_DFF1520	dont_generate_debug_code521}522 523/*524 * Host Overlay DMA Address525 */526register HODMAADR {527	address			0x070528	access_mode	RW529	size		8530	modes		M_SCSI531}532 533/*534 * PCI PLL Delay.535 */536register PLLDELAY {537	address			0x070538	access_mode	RW539	size		1540	modes		M_CFG541	field	SPLIT_DROP_REQ	0x80542}543 544/*545 * Data Channel Host Count546 */547register HCNT {548	address			0x078549	access_mode	RW550	size		3551	modes		M_DFF0, M_DFF1552	dont_generate_debug_code553}554 555/*556 * Host Overlay DMA Count557 */558register HODMACNT {559	address			0x078560	access_mode	RW561	size		2562	modes		M_SCSI563}564 565/*566 * Host Overlay DMA Enable567 */568register HODMAEN {569	address			0x07A570	access_mode	RW571	modes		M_SCSI572}573 574/*575 * Scatter/Gather Host Address576 */577register SGHADDR {578	address			0x07C579	access_mode	RW580	size		8581	modes		M_DFF0, M_DFF1582	dont_generate_debug_code583}584 585/*586 * SCB Host Address587 */588register SCBHADDR {589	address			0x07C590	access_mode	RW591	size		8592	modes		M_CCHAN593	dont_generate_debug_code594}595 596/*597 * Scatter/Gather Host Count598 */599register SGHCNT {600	address			0x084601	access_mode	RW602	modes		M_DFF0, M_DFF1603	dont_generate_debug_code604}605 606/*607 * SCB Host Count608 */609register SCBHCNT {610	address			0x084611	access_mode	RW612	modes		M_CCHAN613	dont_generate_debug_code614}615 616/*617 * Data FIFO Threshold618 */619register DFF_THRSH {620	address			0x088621	access_mode	RW622	modes		M_CFG623	count		1624	field	WR_DFTHRSH	0x70 {625		WR_DFTHRSH_MIN,626		WR_DFTHRSH_25,627		WR_DFTHRSH_50,628		WR_DFTHRSH_63,629		WR_DFTHRSH_75,630		WR_DFTHRSH_85,631		WR_DFTHRSH_90,632		WR_DFTHRSH_MAX633	}634	field	RD_DFTHRSH	0x07 {635		RD_DFTHRSH_MIN,636		RD_DFTHRSH_25,637		RD_DFTHRSH_50,638		RD_DFTHRSH_63,639		RD_DFTHRSH_75,640		RD_DFTHRSH_85,641		RD_DFTHRSH_90,642		RD_DFTHRSH_MAX643	}644	dont_generate_debug_code645}646 647/*648 * ROM Address649 */650register ROMADDR {651	address			0x08A652	access_mode	RW653	size		3654}655 656/*657 * ROM Control658 */659register ROMCNTRL {660	address			0x08D661	access_mode	RW662	field	ROMOP		0xE0663	field	ROMSPD		0x18664	field	REPEAT		0x02665	field	RDY		0x01666}667 668/*669 * ROM Data670 */671register ROMDATA {672	address			0x08E673	access_mode	RW674}675 676/*677 * Data Channel Receive Message 0678 */679register DCHRXMSG0 {680	address			0x090681	access_mode	RO682	modes		M_DFF0, M_DFF1683	field		CDNUM	0xF8684	field		CFNUM	0x07685}686 687/*688 * CMC Receive Message 0689 */690register CMCRXMSG0 {691	address			0x090692	access_mode	RO693	modes		M_CCHAN694	field		CDNUM	0xF8695	field		CFNUM	0x07696}697 698/*699 * Overlay Receive Message 0700 */701register OVLYRXMSG0 {702	address			0x090703	access_mode	RO704	modes		M_SCSI705	field		CDNUM	0xF8706	field		CFNUM	0x07707}708 709/*710 * Relaxed Order Enable711 */712register ROENABLE {713	address			0x090714	access_mode	RW715	modes		M_CFG716	field	MSIROEN		0x20717	field	OVLYROEN	0x10718	field	CMCROEN		0x08719	field	SGROEN		0x04720	field	DCH1ROEN	0x02721	field	DCH0ROEN	0x01722}723 724/*725 * Data Channel Receive Message 1726 */727register DCHRXMSG1 {728	address			0x091729	access_mode	RO730	modes		M_DFF0, M_DFF1731	field	CBNUM		0xFF732}733 734/*735 * CMC Receive Message 1736 */737register CMCRXMSG1 {738	address			0x091739	access_mode	RO740	modes		M_CCHAN741	field	CBNUM		0xFF742}743 744/*745 * Overlay Receive Message 1746 */747register OVLYRXMSG1 {748	address			0x091749	access_mode	RO750	modes		M_SCSI751	field	CBNUM		0xFF752}753 754/*755 * No Snoop Enable756 */757register NSENABLE {758	address			0x091759	access_mode	RW760	modes		M_CFG761	field	MSINSEN		0x20762	field	OVLYNSEN	0x10763	field	CMCNSEN		0x08764	field	SGNSEN		0x04765	field	DCH1NSEN	0x02766	field	DCH0NSEN	0x01767}768 769/*770 * Data Channel Receive Message 2771 */772register DCHRXMSG2 {773	address			0x092774	access_mode	RO775	modes		M_DFF0, M_DFF1776	field	MINDEX		0xFF777}778 779/*780 * CMC Receive Message 2781 */782register CMCRXMSG2 {783	address			0x092784	access_mode	RO785	modes		M_CCHAN786	field	MINDEX		0xFF787}788 789/*790 * Overlay Receive Message 2791 */792register OVLYRXMSG2 {793	address			0x092794	access_mode	RO795	modes		M_SCSI796	field	MINDEX		0xFF797}798 799/*800 * Outstanding Split Transactions801 */802register OST {803	address			0x092804	access_mode	RW805	modes		M_CFG806}807 808/*809 * Data Channel Receive Message 3810 */811register DCHRXMSG3 {812	address			0x093813	access_mode	RO814	modes		M_DFF0, M_DFF1815	field	MCLASS		0x0F816}817 818/*819 * CMC Receive Message 3820 */821register CMCRXMSG3 {822	address			0x093823	access_mode	RO824	modes		M_CCHAN825	field	MCLASS		0x0F826}827 828/*829 * Overlay Receive Message 3830 */831register OVLYRXMSG3 {832	address			0x093833	access_mode	RO834	modes		M_SCSI835	field	MCLASS		0x0F836}837 838/*839 * PCI-X Control840 */841register PCIXCTL {842	address			0x093843	access_mode	RW844	modes		M_CFG845	count		1846	field	SERRPULSE	0x80847	field	UNEXPSCIEN	0x20848	field	SPLTSMADIS	0x10849	field	SPLTSTADIS	0x08850	field	SRSPDPEEN	0x04851	field	TSCSERREN	0x02852	field	CMPABCDIS	0x01853	dont_generate_debug_code854}855 856/*857 * CMC Sequencer Byte Count858 */859register CMCSEQBCNT {860	address			0x094861	access_mode	RO862	modes		M_CCHAN863}864 865/*866 * Overlay Sequencer Byte Count867 */868register OVLYSEQBCNT {869	address			0x094870	access_mode	RO871	modes		M_SCSI872}873 874/*875 * Data Channel Sequencer Byte Count876 */877register DCHSEQBCNT {878	address			0x094879	access_mode	RO880	size		2881	modes		M_DFF0, M_DFF1882}883 884/*885 * Data Channel Split Status 0886 */887register DCHSPLTSTAT0 {888	address			0x096889	access_mode	RW890	modes		M_DFF0, M_DFF1891	count		2892	field	STAETERM	0x80893	field	SCBCERR		0x40894	field	SCADERR		0x20895	field	SCDATBUCKET	0x10896	field	CNTNOTCMPLT	0x08897	field	RXOVRUN		0x04898	field	RXSCEMSG	0x02899	field	RXSPLTRSP	0x01900	dont_generate_debug_code901}902 903/*904 * CMC Split Status 0905 */906register CMCSPLTSTAT0 {907	address			0x096908	access_mode	RW909	modes		M_CCHAN910	field	STAETERM	0x80911	field	SCBCERR		0x40912	field	SCADERR		0x20913	field	SCDATBUCKET	0x10914	field	CNTNOTCMPLT	0x08915	field	RXOVRUN		0x04916	field	RXSCEMSG	0x02917	field	RXSPLTRSP	0x01918}919 920/*921 * Overlay Split Status 0922 */923register OVLYSPLTSTAT0 {924	address			0x096925	access_mode	RW926	modes		M_SCSI927	field	STAETERM	0x80928	field	SCBCERR		0x40929	field	SCADERR		0x20930	field	SCDATBUCKET	0x10931	field	CNTNOTCMPLT	0x08932	field	RXOVRUN		0x04933	field	RXSCEMSG	0x02934	field	RXSPLTRSP	0x01935}936 937/*938 * Data Channel Split Status 1939 */940register DCHSPLTSTAT1 {941	address			0x097942	access_mode	RW943	modes		M_DFF0, M_DFF1944	count		2945	field	RXDATABUCKET	0x01946	dont_generate_debug_code947}948 949/*950 * CMC Split Status 1951 */952register CMCSPLTSTAT1 {953	address			0x097954	access_mode	RW955	modes		M_CCHAN956	field	RXDATABUCKET	0x01957}958 959/*960 * Overlay Split Status 1961 */962register OVLYSPLTSTAT1 {963	address			0x097964	access_mode	RW965	modes		M_SCSI966	field	RXDATABUCKET	0x01967}968 969/*970 * S/G Receive Message 0971 */972register SGRXMSG0 {973	address			0x098974	access_mode	RO975	modes		M_DFF0, M_DFF1976	field		CDNUM	0xF8977	field		CFNUM	0x07978}979 980/*981 * S/G Receive Message 1982 */983register SGRXMSG1 {984	address			0x099985	access_mode	RO986	modes		M_DFF0, M_DFF1987	field	CBNUM		0xFF988}989 990/*991 * S/G Receive Message 2992 */993register SGRXMSG2 {994	address			0x09A995	access_mode	RO996	modes		M_DFF0, M_DFF1997	field	MINDEX		0xFF998}999 1000/*1001 * S/G Receive Message 31002 */1003register SGRXMSG3 {1004	address			0x09B1005	access_mode	RO1006	modes		M_DFF0, M_DFF11007	field	MCLASS		0x0F1008}1009 1010/*1011 * Slave Split Out Address 01012 */1013register SLVSPLTOUTADR0 {1014	address			0x0981015	access_mode	RO1016	modes		M_SCSI1017	field	LOWER_ADDR	0x7F1018}1019 1020/*1021 * Slave Split Out Address 11022 */1023register SLVSPLTOUTADR1 {1024	address			0x0991025	access_mode	RO1026	modes		M_SCSI1027	field	REQ_DNUM	0xF81028	field	REQ_FNUM	0x071029}1030 1031/*1032 * Slave Split Out Address 21033 */1034register SLVSPLTOUTADR2 {1035	address			0x09A1036	access_mode	RO1037	modes		M_SCSI1038	field	REQ_BNUM	0xFF1039}1040 1041/*1042 * Slave Split Out Address 31043 */1044register SLVSPLTOUTADR3 {1045	address			0x09B1046	access_mode	RO1047	modes		M_SCSI1048	field	RLXORD		0201049	field	TAG_NUM		0x1F1050}1051 1052/*1053 * SG Sequencer Byte Count1054 */1055register SGSEQBCNT {1056	address			0x09C1057	access_mode	RO1058	modes		M_DFF0, M_DFF11059}1060 1061/*1062 * Slave Split Out Attribute 01063 */1064register SLVSPLTOUTATTR0 {1065	address			0x09C1066	access_mode	RO1067	modes		M_SCSI1068	field	LOWER_BCNT	0xFF1069}1070 1071/*1072 * Slave Split Out Attribute 11073 */1074register SLVSPLTOUTATTR1 {1075	address			0x09D1076	access_mode	RO1077	modes		M_SCSI1078	field	CMPLT_DNUM	0xF81079	field	CMPLT_FNUM	0x071080}1081 1082/*1083 * Slave Split Out Attribute 21084 */1085register SLVSPLTOUTATTR2 {1086	address			0x09E1087	access_mode	RO1088	size		21089	modes		M_SCSI1090	field	CMPLT_BNUM	0xFF1091}1092/*1093 * S/G Split Status 01094 */1095register SGSPLTSTAT0 {1096	address			0x09E1097	access_mode	RW1098	modes		M_DFF0, M_DFF11099	count		21100	field	STAETERM	0x801101	field	SCBCERR		0x401102	field	SCADERR		0x201103	field	SCDATBUCKET	0x101104	field	CNTNOTCMPLT	0x081105	field	RXOVRUN		0x041106	field	RXSCEMSG	0x021107	field	RXSPLTRSP	0x011108	dont_generate_debug_code1109}1110 1111/*1112 * S/G Split Status 11113 */1114register SGSPLTSTAT1 {1115	address			0x09F1116	access_mode	RW1117	modes		M_DFF0, M_DFF11118	count		21119	field	RXDATABUCKET	0x011120	dont_generate_debug_code1121}1122 1123/*1124 * Special Function1125 */1126register SFUNCT {1127	address			0x09f1128	access_mode	RW1129	modes		M_CFG1130	field	TEST_GROUP	0xF01131	field	TEST_NUM	0x0F1132	dont_generate_debug_code1133}1134 1135/*1136 * Data FIFO 0 PCI Status 1137 */1138register DF0PCISTAT {1139	address			0x0A01140	access_mode	RW1141	modes		M_CFG1142	count		11143	field	DPE		0x801144	field	SSE		0x401145	field	RMA		0x201146	field	RTA		0x101147	field	SCAAPERR	0x081148	field	RDPERR		0x041149	field	TWATERR		0x021150	field	DPR		0x011151	dont_generate_debug_code1152}1153 1154/*1155 * Data FIFO 1 PCI Status 1156 */1157register DF1PCISTAT {1158	address			0x0A11159	access_mode	RW1160	modes		M_CFG1161	field	DPE		0x801162	field	SSE		0x401163	field	RMA		0x201164	field	RTA		0x101165	field	SCAAPERR	0x081166	field	RDPERR		0x041167	field	TWATERR		0x021168	field	DPR		0x011169}1170 1171/*1172 * S/G PCI Status 1173 */1174register SGPCISTAT {1175	address			0x0A21176	access_mode	RW1177	modes		M_CFG1178	field	DPE		0x801179	field	SSE		0x401180	field	RMA		0x201181	field	RTA		0x101182	field	SCAAPERR	0x081183	field	RDPERR		0x041184	field	DPR		0x011185}1186 1187/*1188 * CMC PCI Status 1189 */1190register CMCPCISTAT {1191	address			0x0A31192	access_mode	RW1193	modes		M_CFG1194	field	DPE		0x801195	field	SSE		0x401196	field	RMA		0x201197	field	RTA		0x101198	field	SCAAPERR	0x081199	field	RDPERR		0x041200	field	TWATERR		0x021201	field	DPR		0x011202}1203 1204/*1205 * Overlay PCI Status 1206 */1207register OVLYPCISTAT {1208	address			0x0A41209	access_mode	RW1210	modes		M_CFG1211	field	DPE		0x801212	field	SSE		0x401213	field	RMA		0x201214	field	RTA		0x101215	field	SCAAPERR	0x081216	field	RDPERR		0x041217	field	DPR		0x011218}1219 1220/*1221 * PCI Status for MSI Master DMA Transfer1222 */1223register MSIPCISTAT {1224	address			0x0A61225	access_mode	RW1226	modes		M_CFG1227	field	SSE		0x401228	field	RMA		0x201229	field	RTA		0x101230	field	CLRPENDMSI	0x081231	field	TWATERR		0x021232	field	DPR		0x011233}1234 1235/*1236 * PCI Status for Target1237 */1238register TARGPCISTAT {1239	address			0x0A71240	access_mode	RW1241	modes		M_CFG1242	count		51243	field	DPE		0x801244	field	SSE		0x401245	field	STA		0x081246	field	TWATERR		0x021247	dont_generate_debug_code1248}1249 1250/*1251 * LQ Packet In1252 * The last LQ Packet received1253 */1254register LQIN {1255	address			0x0201256	access_mode	RW1257	size		201258	count		21259	modes		M_DFF0, M_DFF1, M_SCSI1260	dont_generate_debug_code1261}1262 1263/*1264 * SCB Type Pointer1265 * SCB offset for Target Mode SCB type information1266 */1267register TYPEPTR {1268	address			0x0201269	access_mode	RW1270	modes		M_CFG1271}1272 1273/*1274 * Queue Tag Pointer1275 * SCB offset to the Two Byte tag identifier used for target mode.1276 */1277register TAGPTR {1278	address			0x0211279	access_mode	RW1280	modes		M_CFG1281}1282 1283/*1284 * Logical Unit Number Pointer1285 * SCB offset to the LSB (little endian) of the lun field.1286 */1287register LUNPTR {1288	address			0x0221289	access_mode	RW1290	modes		M_CFG1291	count		21292	dont_generate_debug_code1293}1294 1295/*1296 * Data Length Pointer1297 * SCB offset for the 4 byte data length field in target mode.1298 */1299register DATALENPTR {1300	address			0x0231301	access_mode	RW1302	modes		M_CFG1303}1304 1305/*1306 * Status Length Pointer1307 * SCB offset to the two byte status field in target SCBs.1308 */1309register STATLENPTR {1310	address			0x0241311	access_mode	RW1312	modes		M_CFG1313}1314 1315/*1316 * Command Length Pointer1317 * Scb offset for the CDB length field in initiator SCBs.1318 */1319register CMDLENPTR {1320	address			0x0251321	access_mode	RW1322	modes		M_CFG1323	count		11324	dont_generate_debug_code1325}1326 1327/*1328 * Task Attribute Pointer1329 * Scb offset for the byte field specifying the attribute byte1330 * to be used in command packets.1331 */ 1332register ATTRPTR {1333	address			0x0261334	access_mode	RW1335	modes		M_CFG1336	count		11337	dont_generate_debug_code1338}1339 1340/*1341 * Task Management Flags Pointer1342 * Scb offset for the byte field specifying the attribute flags1343 * byte to be used in command packets.1344 */ 1345register FLAGPTR {1346	address			0x0271347	access_mode	RW1348	modes		M_CFG1349	count		11350	dont_generate_debug_code1351}1352 1353/*1354 * Command Pointer1355 * Scb offset for the first byte in the CDB for initiator SCBs.1356 */1357register CMDPTR {1358	address			0x0281359	access_mode	RW1360	modes		M_CFG1361	count		11362	dont_generate_debug_code1363}1364 1365/*1366 * Queue Next Pointer1367 * Scb offset for the 2 byte "next scb link".1368 */1369register QNEXTPTR {1370	address			0x0291371	access_mode	RW1372	modes		M_CFG1373	count		11374	dont_generate_debug_code1375}1376 1377/*1378 * SCSI ID Pointer1379 * Scb offset to the value to place in the SCSIID register1380 * during target mode connections.1381 */1382register IDPTR {1383	address			0x02A1384	access_mode	RW1385	modes		M_CFG1386}1387 1388/*1389 * Command Aborted Byte Pointer1390 * Offset to the SCB flags field that includes the1391 * "SCB aborted" status bit.1392 */1393register ABRTBYTEPTR {1394	address			0x02B1395	access_mode	RW1396	modes		M_CFG1397	count		11398	dont_generate_debug_code1399}1400 1401/*1402 * Command Aborted Bit Pointer1403 * Bit offset in the SCB flags field for "SCB aborted" status.1404 */1405register ABRTBITPTR {1406	address			0x02C1407	access_mode	RW1408	modes		M_CFG1409	count		11410	dont_generate_debug_code1411}1412 1413/*1414 * Rev B or greater.1415 */1416register MAXCMDBYTES {1417	address			0x02D1418	access_mode	RW1419	modes		M_CFG1420}1421 1422/*1423 * Rev B or greater.1424 */1425register MAXCMD2RCV {1426	address			0x02E1427	access_mode	RW1428	modes		M_CFG1429}1430 1431/*1432 * Rev B or greater.1433 */1434register SHORTTHRESH {1435	address			0x02F1436	access_mode	RW1437	modes		M_CFG1438}1439 1440/*1441 * Logical Unit Number Length1442 * The length, in bytes, of the SCB lun field.1443 */1444register LUNLEN {1445	address			0x0301446	access_mode	RW1447	modes		M_CFG1448	count		21449	mask		ILUNLEN	0x0F1450	mask		TLUNLEN	0xF01451	dont_generate_debug_code1452}1453const LUNLEN_SINGLE_LEVEL_LUN 0xF1454 1455/*1456 * CDB Limit1457 * The size, in bytes, of the embedded CDB field in initator SCBs.1458 */1459register CDBLIMIT {1460	address			0x0311461	access_mode	RW1462	modes		M_CFG1463	count		11464	dont_generate_debug_code1465}1466 1467/*1468 * Maximum Commands1469 * The maximum number of commands to issue during a1470 * single packetized connection.1471 */1472register MAXCMD {1473	address			0x0321474	access_mode	RW1475	modes		M_CFG1476	count		91477	dont_generate_debug_code1478}1479 1480/*1481 * Maximum Command Counter1482 * The number of commands already sent during this connection1483 */1484register MAXCMDCNT {1485	address			0x0331486	access_mode	RW1487	modes		M_CFG1488	dont_generate_debug_code1489}1490 1491/*1492 * LQ Packet Reserved Bytes1493 * The bytes to be sent in the currently reserved fileds1494 * of all LQ packets.1495 */1496register LQRSVD01 {1497	address			0x0341498	access_mode	RW1499	modes		M_SCSI1500}1501register LQRSVD16 {1502	address			0x0351503	access_mode	RW1504	modes		M_SCSI1505}1506register LQRSVD17 {1507	address			0x0361508	access_mode	RW1509	modes		M_SCSI1510}1511 1512/*1513 * Command Reserved 01514 * The byte to be sent for the reserved byte 0 of1515 * outgoing command packets.1516 */1517register CMDRSVD0 {1518	address			0x0371519	access_mode	RW1520	modes		M_CFG1521}1522 1523/*1524 * LQ Manager Control 01525 */1526register LQCTL0 {1527	address			0x0381528	access_mode	RW1529	modes		M_CFG1530	field	LQITARGCLT	0xC01531	field	LQIINITGCLT	0x301532	field	LQ0TARGCLT	0x0C1533	field	LQ0INITGCLT	0x031534}1535 1536/*1537 * LQ Manager Control 11538 */1539register LQCTL1 {1540	address			0x0381541	access_mode	RW1542	modes		M_DFF0, M_DFF1, M_SCSI1543	count		21544	field	PCI2PCI		0x041545	field	SINGLECMD	0x021546	field	ABORTPENDING	0x011547	dont_generate_debug_code1548}1549 1550/*1551 * LQ Manager Control 21552 */1553register LQCTL2 {1554	address			0x0391555	access_mode	RW1556	modes		M_DFF0, M_DFF1, M_SCSI1557	count		51558	field	LQIRETRY	0x801559	field	LQICONTINUE	0x401560	field	LQITOIDLE	0x201561	field	LQIPAUSE	0x101562	field	LQORETRY	0x081563	field	LQOCONTINUE	0x041564	field	LQOTOIDLE	0x021565	field	LQOPAUSE	0x011566	dont_generate_debug_code1567}1568 1569/*1570 * SCSI RAM BIST01571 */1572register SCSBIST0 {1573	address			0x0391574	access_mode	RW1575	modes		M_CFG1576	field	GSBISTERR	0x401577	field	GSBISTDONE	0x201578	field	GSBISTRUN	0x101579	field	OSBISTERR	0x041580	field	OSBISTDONE	0x021581	field	OSBISTRUN	0x011582}1583 1584/*1585 * SCSI Sequence Control01586 */1587register SCSISEQ0 {1588	address			0x03A1589	access_mode	RW1590	modes		M_DFF0, M_DFF1, M_SCSI1591	field	TEMODEO		0x801592	field	ENSELO		0x401593	field	ENARBO		0x201594	field	FORCEBUSFREE	0x101595	field	SCSIRSTO	0x011596}1597 1598/*1599 * SCSI RAM BIST 11600 */1601register SCSBIST1 {1602	address			0x03A1603	access_mode	RW1604	modes		M_CFG1605	field	NTBISTERR	0x041606	field	NTBISTDONE	0x021607	field	NTBISTRUN	0x011608}1609 1610/*1611 * SCSI Sequence Control 11612 */1613register SCSISEQ1 {1614	address			0x03B1615	access_mode	RW1616	modes		M_DFF0, M_DFF1, M_SCSI1617	count		81618	field	MANUALCTL	0x401619	field	ENSELI		0x201620	field	ENRSELI		0x101621	field	MANUALP		0x0C1622	field	ENAUTOATNP	0x021623	field	ALTSTIM		0x011624}1625 1626/*1627 * SCSI Transfer Control 01628 */1629register SXFRCTL0 {1630	address			0x03C1631	access_mode	RW1632	modes		M_SCSI1633	field	DFON		0x801634	field	DFPEXP		0x401635	field	BIOSCANCELEN	0x101636	field	SPIOEN		0x081637	dont_generate_debug_code1638}1639 1640/*1641 * SCSI Transfer Control 11642 */1643register SXFRCTL1 {1644	address			0x03D1645	access_mode	RW1646	modes		M_SCSI1647	field	BITBUCKET	0x801648	field	ENSACHK		0x401649	field	ENSPCHK		0x201650	field	STIMESEL	0x181651	field	ENSTIMER	0x041652	field	ACTNEGEN	0x021653	field	STPWEN		0x011654	dont_generate_debug_code1655}1656 1657/*1658 * SCSI Transfer Control 21659 */1660register SXFRCTL2 {1661	address			0x03E1662	access_mode	RW1663	modes		M_SCSI1664	field	AUTORSTDIS	0x101665	field	CMDDMAEN	0x081666	field	ASU		0x071667}1668 1669/*1670 * SCSI Bus Initiator IDs1671 * Bitmask of observed initiators on the bus.1672 */1673register BUSINITID {1674	address			0x03C1675	access_mode	RW1676	modes		M_CFG1677	size		21678}1679 1680/*1681 * Data Length Counters1682 * Packet byte counter.1683 */1684register DLCOUNT {1685	address			0x03C1686	access_mode	RW1687	modes		M_DFF0, M_DFF11688	size		31689}1690 1691/*1692 * Data FIFO Status1693 */1694register DFFSTAT {1695	address			0x03F1696	access_mode	RW1697	modes		M_SCSI1698	field	FIFO1FREE	0x201699	field	FIFO0FREE	0x101700	/*1701	 * On the B, this enum only works1702	 * in the read direction.  For writes,1703	 * you must use the B version of the1704	 * CURRFIFO_0 definition which is defined1705	 * as a constant outside of this register1706	 * definition to avoid confusing the1707	 * register pretty printing code.1708	 */1709	enum	CURRFIFO	0x03 {1710		CURRFIFO_0,1711		CURRFIFO_1,1712		CURRFIFO_NONE	0x31713	}1714}1715 1716const B_CURRFIFO_0 0x21717 1718/*1719 * SCSI Bus Target IDs1720 * Bitmask of observed targets on the bus.1721 */1722register BUSTARGID {1723	address			0x03E1724	access_mode	RW1725	modes		M_CFG1726	size		21727}1728 1729/*1730 * SCSI Control Signal Out1731 */1732register SCSISIGO {1733	address			0x0401734	access_mode	RW1735	modes		M_DFF0, M_DFF1, M_SCSI1736	field	CDO		0x801737	field	IOO		0x401738	field	MSGO		0x201739	field	ATNO		0x101740	field	SELO		0x081741	field	BSYO		0x041742	field	REQO		0x021743	field	ACKO		0x011744/*1745 * Possible phases to write into SCSISIG01746 */1747	enum	PHASE_MASK  CDO|IOO|MSGO {1748		P_DATAOUT	0x0,1749		P_DATAIN	IOO,1750		P_DATAOUT_DT	P_DATAOUT|MSGO,1751		P_DATAIN_DT	P_DATAIN|MSGO,1752		P_COMMAND	CDO,1753		P_MESGOUT	CDO|MSGO,1754		P_STATUS	CDO|IOO,1755		P_MESGIN	CDO|IOO|MSGO1756	}1757	dont_generate_debug_code1758}1759 1760/*1761 * SCSI Control Signal In1762 */1763register SCSISIGI {1764	address			0x0411765	access_mode	RO1766	modes		M_DFF0, M_DFF1, M_SCSI1767	field	CDI		0x801768	field	IOI		0x401769	field	MSGI		0x201770	field	ATNI		0x101771	field	SELI		0x081772	field	BSYI		0x041773	field	REQI		0x021774	field	ACKI		0x011775/*1776 * Possible phases in SCSISIGI1777 */1778	enum	PHASE_MASK  CDO|IOO|MSGO {1779		P_DATAOUT	0x0,1780		P_DATAIN	IOO,1781		P_DATAOUT_DT	P_DATAOUT|MSGO,1782		P_DATAIN_DT	P_DATAIN|MSGO,1783		P_COMMAND	CDO,1784		P_MESGOUT	CDO|MSGO,1785		P_STATUS	CDO|IOO,1786		P_MESGIN	CDO|IOO|MSGO1787	}1788}1789 1790/*1791 * Multiple Target IDs1792 * Bitmask of ids to respond as a target.1793 */1794register MULTARGID {1795	address			0x0401796	access_mode	RW1797	modes		M_CFG1798	size		21799	count		21800	dont_generate_debug_code1801}1802 1803/*1804 * SCSI Phase1805 */1806register SCSIPHASE {1807	address			0x0421808	access_mode	RO1809	modes		M_DFF0, M_DFF1, M_SCSI1810	field	STATUS_PHASE	0x201811	field	COMMAND_PHASE	0x101812	field	MSG_IN_PHASE	0x081813	field	MSG_OUT_PHASE	0x041814	field	DATA_PHASE_MASK	0x03 {1815		DATA_OUT_PHASE	0x01,1816		DATA_IN_PHASE	0x021817	}1818}1819 1820/*1821 * SCSI Data 0 Image1822 */1823register SCSIDAT0_IMG {1824	address			0x0431825	access_mode	RW1826	modes		M_DFF0, M_DFF1, M_SCSI1827}1828 1829/*1830 * SCSI Latched Data1831 */1832register SCSIDAT {1833	address			0x0441834	access_mode	RW1835	modes		M_DFF0, M_DFF1, M_SCSI1836	size		21837	dont_generate_debug_code1838}1839 1840/*1841 * SCSI Data Bus1842 */1843register SCSIBUS {1844	address			0x0461845	access_mode	RW1846	modes		M_DFF0, M_DFF1, M_SCSI1847	size		21848}1849 1850/*1851 * Target ID In1852 */1853register TARGIDIN {1854	address			0x0481855	access_mode	RO1856	modes		M_DFF0, M_DFF1, M_SCSI1857	count		21858	field	CLKOUT		0x801859	field	TARGID		0x0F1860	dont_generate_debug_code1861}1862 1863/*1864 * Selection/Reselection ID1865 * Upper four bits are the device id.  The ONEBIT is set when the re/selecting1866 * device did not set its own ID.1867 */1868register SELID {1869	address			0x0491870	access_mode	RW1871	modes		M_DFF0, M_DFF1, M_SCSI1872	field	SELID_MASK	0xf01873	field	ONEBIT		0x081874}1875 1876/*1877 * SCSI Block Control1878 * Controls Bus type and channel selection.  SELWIDE allows for the1879 * coexistence of 8bit and 16bit devices on a wide bus.1880 */1881register SBLKCTL {1882	address			0x04A1883	access_mode	RW1884	modes		M_DFF0, M_DFF1, M_SCSI1885	field	DIAGLEDEN	0x801886	field	DIAGLEDON	0x401887	field	ENAB40		0x08	/* LVD transceiver active */1888	field	ENAB20		0x04	/* SE/HVD transceiver active */1889	field	SELWIDE		0x021890	dont_generate_debug_code1891}1892 1893/*1894 * Option Mode1895 */1896register OPTIONMODE {1897	address			0x04A1898	access_mode	RW1899	modes		M_CFG1900	count		41901	field	BIOSCANCTL		0x801902	field	AUTOACKEN		0x401903	field	BIASCANCTL		0x201904	field	BUSFREEREV		0x101905	field	ENDGFORMCHK		0x041906	field	AUTO_MSGOUT_DE		0x021907	mask	OPTIONMODE_DEFAULTS	AUTO_MSGOUT_DE1908	dont_generate_debug_code1909}1910 1911/*1912 * SCSI Status 01913 */1914register SSTAT0	{1915	address			0x04B1916	access_mode	RO1917	modes		M_DFF0, M_DFF1, M_SCSI1918	field	TARGET		0x80	/* Board acting as target */1919	field	SELDO		0x40	/* Selection Done */1920	field	SELDI		0x20	/* Board has been selected */1921	field	SELINGO		0x10	/* Selection In Progress */1922	field	IOERR		0x08	/* LVD Tranceiver mode changed */1923	field	OVERRUN		0x04	/* SCSI Offset overrun detected */1924	field	SPIORDY		0x02	/* SCSI PIO Ready */1925	field	ARBDO		0x01	/* Arbitration Done Out */1926}1927 1928/*1929 * Clear SCSI Interrupt 01930 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.1931 */1932register CLRSINT0 {1933	address			0x04B1934	access_mode	WO1935	modes		M_DFF0, M_DFF1, M_SCSI1936	field	CLRSELDO	0x401937	field	CLRSELDI	0x201938	field	CLRSELINGO	0x101939	field	CLRIOERR	0x081940	field	CLROVERRUN	0x041941	field	CLRSPIORDY	0x021942	field	CLRARBDO	0x011943	dont_generate_debug_code1944}1945 1946/*1947 * SCSI Interrupt Mode 01948 * Setting any bit will enable the corresponding function1949 * in SIMODE0 to interrupt via the IRQ pin.1950 */1951register SIMODE0 {1952	address			0x04B1953	access_mode	RW1954	modes		M_CFG1955	count		81956	field	ENSELDO		0x401957	field	ENSELDI		0x201958	field	ENSELINGO	0x101959	field	ENIOERR		0x081960	field	ENOVERRUN	0x041961	field	ENSPIORDY	0x021962	field	ENARBDO		0x011963}1964 1965/*1966 * SCSI Status 11967 */1968register SSTAT1 {1969	address			0x04C1970	access_mode	RO1971	modes		M_DFF0, M_DFF1, M_SCSI1972	field	SELTO		0x801973	field	ATNTARG 	0x401974	field	SCSIRSTI	0x201975	field	PHASEMIS	0x101976	field	BUSFREE		0x081977	field	SCSIPERR	0x041978	field	STRB2FAST	0x021979	field	REQINIT		0x011980}1981 1982/*1983 * Clear SCSI Interrupt 11984 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.1985 */1986register CLRSINT1 {1987	address			0x04C1988	access_mode	WO1989	modes		M_DFF0, M_DFF1, M_SCSI1990	field	CLRSELTIMEO	0x801991	field	CLRATNO		0x401992	field	CLRSCSIRSTI	0x201993	field	CLRBUSFREE	0x081994	field	CLRSCSIPERR	0x041995	field	CLRSTRB2FAST	0x021996	field	CLRREQINIT	0x011997	dont_generate_debug_code1998}1999 2000/*2001 * SCSI Status 22002 */2003register SSTAT2 {2004	address			0x04d2005	access_mode	RO2006	modes		M_DFF0, M_DFF1, M_SCSI2007	field	BUSFREETIME	0xc0 {2008		BUSFREE_LQO	0x40,2009		BUSFREE_DFF0	0x80,2010		BUSFREE_DFF1	0xC02011	}2012	field	NONPACKREQ	0x202013	field	EXP_ACTIVE	0x10	/* SCSI Expander Active */2014	field	BSYX		0x08	/* Busy Expander */2015	field	WIDE_RES	0x04	/* Modes 0 and 1 only */2016	field	SDONE		0x02	/* Modes 0 and 1 only */2017	field	DMADONE		0x01	/* Modes 0 and 1 only */2018}2019 2020/*2021 * Clear SCSI Interrupt 22022 */2023register CLRSINT2 {2024	address			0x04D2025	access_mode	WO2026	modes		M_DFF0, M_DFF1, M_SCSI2027	field	CLRNONPACKREQ	0x202028	field	CLRWIDE_RES	0x04	/* Modes 0 and 1 only */2029	field	CLRSDONE	0x02	/* Modes 0 and 1 only */2030	field	CLRDMADONE	0x01	/* Modes 0 and 1 only */2031	dont_generate_debug_code2032}2033 2034/*2035 * SCSI Interrupt Mode 22036 */2037register SIMODE2 {2038	address			0x04D2039	access_mode	RW2040	modes		M_CFG2041	field	ENWIDE_RES	0x042042	field	ENSDONE		0x022043	field	ENDMADONE	0x012044}2045 2046/*2047 * Physical Error Diagnosis2048 */2049register PERRDIAG {2050	address			0x04E2051	access_mode	RO2052	modes		M_DFF0, M_DFF1, M_SCSI2053	count		32054	field	HIZERO		0x802055	field	HIPERR		0x402056	field	PREVPHASE	0x202057	field	PARITYERR	0x102058	field	AIPERR		0x082059	field	CRCERR		0x042060	field	DGFORMERR	0x022061	field	DTERR		0x012062}2063 2064/*2065 * LQI Manager Current State2066 */2067register LQISTATE {2068	address			0x04E2069	access_mode	RO2070	modes		M_CFG2071	count		62072	dont_generate_debug_code2073}2074 2075/*2076 * SCSI Offset Count2077 */2078register SOFFCNT {2079	address			0x04F2080	access_mode	RO2081	modes		M_DFF0, M_DFF1, M_SCSI2082	count		12083}2084 2085/*2086 * LQO Manager Current State2087 */2088register LQOSTATE {2089	address			0x04F2090	access_mode	RO2091	modes		M_CFG2092	count		22093	dont_generate_debug_code2094}2095 2096/*2097 * LQI Manager Status2098 */2099register LQISTAT0 {2100	address			0x0502101	access_mode	RO2102	modes		M_DFF0, M_DFF1, M_SCSI2103	count		22104	field	LQIATNQAS	0x202105	field	LQICRCT1	0x102106	field	LQICRCT2	0x082107	field	LQIBADLQT	0x042108	field	LQIATNLQ	0x022109	field	LQIATNCMD	0x012110}2111 2112/*2113 * Clear LQI Interrupts 02114 */2115register CLRLQIINT0 {2116	address			0x0502117	access_mode	WO2118	modes		M_DFF0, M_DFF1, M_SCSI2119	count		12120	field	CLRLQIATNQAS	0x202121	field	CLRLQICRCT1	0x102122	field	CLRLQICRCT2	0x082123	field	CLRLQIBADLQT	0x042124	field	CLRLQIATNLQ	0x022125	field	CLRLQIATNCMD	0x012126	dont_generate_debug_code2127}2128 2129/*2130 * LQI Manager Interrupt Mode 02131 */2132register LQIMODE0 {2133	address			0x0502134	access_mode	RW2135	modes		M_CFG2136	count		32137	field	ENLQIATNQASK	0x202138	field	ENLQICRCT1	0x102139	field	ENLQICRCT2	0x082140	field	ENLQIBADLQT	0x042141	field	ENLQIATNLQ	0x022142	field	ENLQIATNCMD	0x012143	dont_generate_debug_code2144}2145 2146/*2147 * LQI Manager Status 12148 */2149register LQISTAT1 {2150	address			0x0512151	access_mode	RO2152	modes		M_DFF0, M_DFF1, M_SCSI2153	count		32154	field	LQIPHASE_LQ	0x802155	field	LQIPHASE_NLQ	0x402156	field	LQIABORT	0x202157	field	LQICRCI_LQ	0x102158	field	LQICRCI_NLQ	0x082159	field	LQIBADLQI	0x042160	field	LQIOVERI_LQ	0x022161	field	LQIOVERI_NLQ	0x012162}2163 2164/*2165 * Clear LQI Manager Interrupts12166 */2167register CLRLQIINT1 {2168	address			0x0512169	access_mode	WO2170	modes		M_DFF0, M_DFF1, M_SCSI2171	count		42172	field	CLRLQIPHASE_LQ	0x802173	field	CLRLQIPHASE_NLQ	0x402174	field	CLRLIQABORT	0x202175	field	CLRLQICRCI_LQ	0x102176	field	CLRLQICRCI_NLQ	0x082177	field	CLRLQIBADLQI	0x042178	field	CLRLQIOVERI_LQ	0x022179	field	CLRLQIOVERI_NLQ	0x012180	dont_generate_debug_code2181}2182 2183/*2184 * LQI Manager Interrupt Mode 12185 */2186register LQIMODE1 {2187	address			0x0512188	access_mode	RW2189	modes		M_CFG2190	count		42191	field	ENLQIPHASE_LQ	0x80	/* LQIPHASE1 */2192	field	ENLQIPHASE_NLQ	0x40	/* LQIPHASE2 */2193	field	ENLIQABORT	0x202194	field	ENLQICRCI_LQ	0x10	/* LQICRCI1 */2195	field	ENLQICRCI_NLQ	0x08	/* LQICRCI2 */2196	field	ENLQIBADLQI	0x042197	field	ENLQIOVERI_LQ	0x02	/* LQIOVERI1 */2198	field	ENLQIOVERI_NLQ	0x01	/* LQIOVERI2 */2199	dont_generate_debug_code2200}2201 2202/*2203 * LQI Manager Status 22204 */2205register LQISTAT2 {2206	address			0x0522207	access_mode	RO2208	modes		M_DFF0, M_DFF1, M_SCSI2209	field	PACKETIZED	0x802210	field	LQIPHASE_OUTPKT	0x402211	field	LQIWORKONLQ	0x202212	field	LQIWAITFIFO	0x102213	field	LQISTOPPKT	0x082214	field	LQISTOPLQ	0x042215	field	LQISTOPCMD	0x022216	field	LQIGSAVAIL	0x012217}2218 2219/*2220 * SCSI Status 32221 */2222register SSTAT3 {2223	address			0x0532224	access_mode	RO2225	modes		M_DFF0, M_DFF1, M_SCSI2226	count		32227	field	NTRAMPERR	0x022228	field	OSRAMPERR	0x012229}2230 2231/*2232 * Clear SCSI Status 32233 */2234register CLRSINT3 {2235	address			0x0532236	access_mode	WO2237	modes		M_DFF0, M_DFF1, M_SCSI2238	count		32239	field	CLRNTRAMPERR	0x022240	field	CLROSRAMPERR	0x012241	dont_generate_debug_code2242}2243 2244/*2245 * SCSI Interrupt Mode 32246 */2247register SIMODE3 {2248	address			0x0532249	access_mode	RW2250	modes		M_CFG2251	count		42252	field	ENNTRAMPERR	0x022253	field	ENOSRAMPERR	0x012254	dont_generate_debug_code2255}2256 2257/*2258 * LQO Manager Status 02259 */2260register LQOSTAT0 {2261	address			0x0542262	access_mode	RO2263	modes		M_DFF0, M_DFF1, M_SCSI2264	count		22265	field	LQOTARGSCBPERR	0x102266	field	LQOSTOPT2	0x082267	field	LQOATNLQ	0x042268	field	LQOATNPKT	0x022269	field	LQOTCRC		0x012270}2271 2272/*2273 * Clear LQO Manager interrupt 02274 */2275register CLRLQOINT0 {2276	address			0x0542277	access_mode	WO2278	modes		M_DFF0, M_DFF1, M_SCSI2279	count		32280	field	CLRLQOTARGSCBPERR	0x102281	field	CLRLQOSTOPT2		0x082282	field	CLRLQOATNLQ		0x042283	field	CLRLQOATNPKT		0x022284	field	CLRLQOTCRC		0x012285	dont_generate_debug_code2286}2287 2288/*2289 * LQO Manager Interrupt Mode 02290 */2291register LQOMODE0 {2292	address			0x0542293	access_mode	RW2294	modes		M_CFG2295	count		42296	field	ENLQOTARGSCBPERR	0x102297	field	ENLQOSTOPT2		0x082298	field	ENLQOATNLQ		0x042299	field	ENLQOATNPKT		0x022300	field	ENLQOTCRC		0x012301	dont_generate_debug_code2302}2303 2304/*2305 * LQO Manager Status 12306 */2307register LQOSTAT1 {2308	address			0x0552309	access_mode	RO2310	modes		M_DFF0, M_DFF1, M_SCSI2311	field	LQOINITSCBPERR	0x102312	field	LQOSTOPI2	0x082313	field	LQOBADQAS	0x042314	field	LQOBUSFREE	0x022315	field	LQOPHACHGINPKT	0x012316}2317 2318/*2319 * Clear LOQ Interrupt 12320 */2321register CLRLQOINT1 {2322	address			0x0552323	access_mode	WO2324	modes		M_DFF0, M_DFF1, M_SCSI2325	count		72326	field	CLRLQOINITSCBPERR	0x102327	field	CLRLQOSTOPI2		0x082328	field	CLRLQOBADQAS		0x042329	field	CLRLQOBUSFREE		0x022330	field	CLRLQOPHACHGINPKT	0x012331	dont_generate_debug_code2332}2333 2334/*2335 * LQO Manager Interrupt Mode 12336 */2337register LQOMODE1 {2338	address			0x0552339	access_mode	RW2340	modes		M_CFG2341	count		42342	field	ENLQOINITSCBPERR	0x102343	field	ENLQOSTOPI2		0x082344	field	ENLQOBADQAS		0x042345	field	ENLQOBUSFREE		0x022346	field	ENLQOPHACHGINPKT	0x012347	dont_generate_debug_code2348}2349 2350/*2351 * LQO Manager Status 22352 */2353register LQOSTAT2 {2354	address			0x0562355	access_mode	RO2356	modes		M_DFF0, M_DFF1, M_SCSI2357	field	LQOPKT		0xE02358	field	LQOWAITFIFO	0x102359	field	LQOPHACHGOUTPKT	0x02	/* outside of packet boundaries. */2360	field	LQOSTOP0	0x01	/* Stopped after sending all packets */2361}2362 2363/*2364 * Output Synchronizer Space Count2365 */2366register OS_SPACE_CNT {2367	address			0x0562368	access_mode	RO2369	modes		M_CFG2370	count		22371	dont_generate_debug_code2372}2373 2374/*2375 * SCSI Interrupt Mode 12376 * Setting any bit will enable the corresponding function2377 * in SIMODE1 to interrupt via the IRQ pin.2378 */2379register SIMODE1 {2380	address			0x0572381	access_mode	RW2382	modes		M_DFF0, M_DFF1, M_SCSI2383	field	ENSELTIMO	0x802384	field	ENATNTARG	0x402385	field	ENSCSIRST	0x202386	field	ENPHASEMIS	0x102387	field	ENBUSFREE	0x082388	field	ENSCSIPERR	0x042389	field	ENSTRB2FAST	0x022390	field	ENREQINIT	0x012391}2392 2393/*2394 * Good Status FIFO2395 */2396register GSFIFO {2397	address			0x0582398	access_mode	RO2399	size		22400	modes		M_DFF0, M_DFF1, M_SCSI2401	dont_generate_debug_code2402}2403 2404/*2405 * Data FIFO SCSI Transfer Control2406 */2407register DFFSXFRCTL {2408	address			0x05A2409	access_mode	RW2410	modes		M_DFF0, M_DFF12411	field	DFFBITBUCKET	0x082412	field	CLRSHCNT	0x042413	field	CLRCHN		0x022414	field	RSTCHN		0x012415}2416 2417/*2418 * Next SCSI Control Block2419 */2420register NEXTSCB {2421	address			0x05A2422	access_mode	RW2423	size		22424	modes		M_SCSI2425	dont_generate_debug_code2426}2427 2428/*2429 * LQO SCSI Control2430 * (Rev B only.)2431 */2432register LQOSCSCTL {2433	address			0x05A2434	access_mode	RW2435	size		12436	modes		M_CFG2437	count		12438	field		LQOH2A_VERSION	0x802439	field		LQOBUSETDLY	0x402440	field		LQONOHOLDLACK	0x022441	field		LQONOCHKOVER	0x012442	dont_generate_debug_code2443}2444 2445/*2446 * SEQ Interrupts2447 */2448register SEQINTSRC {2449	address			0x05B2450	access_mode	RO2451	modes		M_DFF0, M_DFF12452	field	CTXTDONE	0x402453	field	SAVEPTRS	0x202454	field	CFG4DATA	0x102455	field	CFG4ISTAT	0x082456	field	CFG4TSTAT	0x042457	field	CFG4ICMD	0x022458	field	CFG4TCMD	0x012459}2460 2461/*2462 * Clear Arp Interrupts2463 */2464register CLRSEQINTSRC {2465	address			0x05B2466	access_mode	WO2467	modes		M_DFF0, M_DFF12468	field	CLRCTXTDONE	0x402469	field	CLRSAVEPTRS	0x202470	field	CLRCFG4DATA	0x102471	field	CLRCFG4ISTAT	0x082472	field	CLRCFG4TSTAT	0x042473	field	CLRCFG4ICMD	0x022474	field	CLRCFG4TCMD	0x012475	dont_generate_debug_code2476}2477 2478/*2479 * SEQ Interrupt Enabled (Shared)2480 */2481register SEQIMODE {2482	address			0x05C2483	access_mode	RW2484	modes		M_DFF0, M_DFF12485	field	ENCTXTDONE	0x402486	field	ENSAVEPTRS	0x202487	field	ENCFG4DATA	0x102488	field	ENCFG4ISTAT	0x082489	field	ENCFG4TSTAT	0x042490	field	ENCFG4ICMD	0x022491	field	ENCFG4TCMD	0x012492}2493 2494/*2495 * Current SCSI Control Block2496 */2497register CURRSCB {2498	address			0x05C2499	access_mode	RW2500	size		22501	modes		M_SCSI2502	dont_generate_debug_code2503}2504 2505/*2506 * Data FIFO Status2507 */2508register MDFFSTAT {2509	address			0x05D2510	access_mode	RO2511	modes		M_DFF0, M_DFF12512	field	SHCNTNEGATIVE	0x40 /* Rev B or higher */2513	field	SHCNTMINUS1	0x20 /* Rev B or higher */2514	field	LASTSDONE	0x102515	field	SHVALID		0x082516	field	DLZERO		0x04 /* FIFO data ends on packet boundary. */2517	field	DATAINFIFO	0x022518	field	FIFOFREE	0x012519}2520 2521/*2522 * CRC Control2523 */2524register CRCCONTROL {2525	address			0x05d2526	access_mode	RW2527	modes		M_CFG2528	field	CRCVALCHKEN		0x402529}2530 2531/*2532 * SCSI Test Control2533 */2534register SCSITEST {2535	address			0x05E2536	access_mode	RW2537	modes		M_CFG2538	field	CNTRTEST	0x082539	field	SEL_TXPLL_DEBUG	0x042540}2541 2542/*2543 * Data FIFO Queue Tag2544 */2545register DFFTAG {2546	address			0x05E2547	access_mode	RW2548	size		22549	modes		M_DFF0, M_DFF12550}2551 2552/*2553 * Last SCSI Control Block2554 */2555register LASTSCB {2556	address			0x05E2557	access_mode	RW2558	size		22559	modes		M_SCSI2560	dont_generate_debug_code2561}2562 2563/*2564 * SCSI I/O Cell Power-down Control2565 */2566register IOPDNCTL {2567	address			0x05F2568	access_mode	RW2569	modes		M_CFG2570	field	DISABLE_OE	0x802571	field	PDN_IDIST	0x042572	field	PDN_DIFFSENSE	0x012573}2574 2575/*2576 * Shadow Host Address.2577 */2578register SHADDR {2579	address			0x0602580	access_mode	RO2581	size		82582	modes		M_DFF0, M_DFF12583	dont_generate_debug_code2584}2585 2586/*2587 * Data Group CRC Interval.2588 */2589register DGRPCRCI {2590	address			0x0602591	access_mode	RW2592	size		22593	modes		M_CFG2594}2595 2596/*2597 * Data Transfer Negotiation Address2598 */2599register NEGOADDR {2600	address			0x0602601	access_mode	RW2602	modes		M_SCSI2603	dont_generate_debug_code2604}2605 2606/*2607 * Data Transfer Negotiation Data - Period Byte2608 */2609register NEGPERIOD {2610	address			0x0612611	access_mode	RW2612	modes		M_SCSI2613	count		12614	dont_generate_debug_code2615}2616 2617/*2618 * Packetized CRC Interval2619 */2620register PACKCRCI {2621	address			0x0622622	access_mode	RW2623	size		22624	modes		M_CFG2625}2626 2627/*2628 * Data Transfer Negotiation Data - Offset Byte2629 */2630register NEGOFFSET {2631	address			0x0622632	access_mode	RW2633	modes		M_SCSI2634	count		12635	dont_generate_debug_code2636}2637 2638/*2639 * Data Transfer Negotiation Data - PPR Options2640 */2641register NEGPPROPTS {2642	address			0x0632643	access_mode	RW2644	modes		M_SCSI2645	count		12646	field	PPROPT_PACE	0x082647	field	PPROPT_QAS	0x042648	field	PPROPT_DT	0x022649	field	PPROPT_IUT	0x012650	dont_generate_debug_code2651}2652 2653/*2654 * Data Transfer Negotiation Data -  Connection Options2655 */2656register NEGCONOPTS {2657	address			0x0642658	access_mode	RW2659	modes		M_SCSI2660	field	ENSNAPSHOT	0x402661	field	RTI_WRTDIS	0x202662	field	RTI_OVRDTRN	0x102663	field	ENSLOWCRC	0x082664	field	ENAUTOATNI	0x042665	field	ENAUTOATNO	0x022666	field	WIDEXFER	0x012667	dont_generate_debug_code2668}2669 2670/*2671 * Negotiation Table Annex Column Index.2672 */2673register ANNEXCOL {2674	address			0x0652675	access_mode	RW2676	modes		M_SCSI2677	count		72678	dont_generate_debug_code2679}2680 2681/*2682 * SCSI Check2683 * (Rev. B only)2684 */2685register SCSCHKN {2686	address			0x0662687	access_mode	RW2688	modes		M_CFG2689	count		12690	field	BIDICHKDIS	0x802691	field	STSELSKIDDIS	0x402692	field	CURRFIFODEF	0x202693	field	WIDERESEN	0x102694	field	SDONEMSKDIS	0x082695	field	DFFACTCLR	0x042696	field	SHVALIDSTDIS	0x022697	field	LSTSGCLRDIS	0x012698	dont_generate_debug_code2699}2700 2701const AHD_ANNEXCOL_PER_DEV0	42702const AHD_NUM_PER_DEV_ANNEXCOLS	42703const AHD_ANNEXCOL_PRECOMP_SLEW	42704const	AHD_PRECOMP_MASK	0x072705const	AHD_PRECOMP_SHIFT	02706const	AHD_PRECOMP_CUTBACK_17	0x042707const	AHD_PRECOMP_CUTBACK_29	0x062708const	AHD_PRECOMP_CUTBACK_37	0x072709const	AHD_SLEWRATE_MASK	0x782710const	AHD_SLEWRATE_SHIFT	32711/*2712 * Rev A has only a single bit (high bit of field) of slew adjustment.2713 * Rev B has 4 bits.  The current default happens to be the same for both.2714 */2715const	AHD_SLEWRATE_DEF_REVA	0x082716const	AHD_SLEWRATE_DEF_REVB	0x082717 2718/* Rev A does not have any amplitude setting. */2719const AHD_ANNEXCOL_AMPLITUDE	62720const	AHD_AMPLITUDE_MASK	0x72721const	AHD_AMPLITUDE_SHIFT	02722const	AHD_AMPLITUDE_DEF	0x72723 2724/*2725 * Negotiation Table Annex Data Port.2726 */2727register ANNEXDAT {2728	address			0x0662729	access_mode	RW2730	modes		M_SCSI2731	count		32732	dont_generate_debug_code2733}2734 2735/*2736 * Initiator's Own Id.2737 * The SCSI ID to use for Selection Out and seen during a reselection..2738 */2739register IOWNID {2740	address			0x0672741	access_mode	RW2742	modes		M_SCSI2743	dont_generate_debug_code2744}2745 2746/*2747 * 960MHz Phase-Locked Loop Control 02748 */2749register PLL960CTL0 {2750	address			0x0682751	access_mode	RW2752	modes		M_CFG2753	field	PLL_VCOSEL	0x802754	field	PLL_PWDN	0x402755	field	PLL_NS		0x302756	field	PLL_ENLUD	0x082757	field	PLL_ENLPF	0x042758	field	PLL_DLPF	0x022759	field	PLL_ENFBM	0x012760}2761 2762/*2763 * Target Own Id2764 */2765register TOWNID {2766	address			0x0692767	access_mode	RW2768	modes		M_SCSI2769	count		22770	dont_generate_debug_code2771}2772 2773/*2774 * 960MHz Phase-Locked Loop Control 12775 */2776register PLL960CTL1 {2777	address			0x0692778	access_mode	RW2779	modes		M_CFG2780	field	PLL_CNTEN	0x802781	field	PLL_CNTCLR	0x402782	field	PLL_RST		0x012783}2784 2785/*2786 * Expander Signature2787 */2788register XSIG {2789	address			0x06A2790	access_mode	RW2791	modes		M_SCSI2792}2793 2794/*2795 * Shadow Byte Count2796 */2797register SHCNT {2798	address			0x0682799	access_mode	RW2800	size		32801	modes		M_DFF0, M_DFF12802	dont_generate_debug_code2803}2804 2805/*2806 * Selection Out ID2807 */2808register SELOID {2809	address			0x06B2810	access_mode	RW2811	modes		M_SCSI2812}2813 2814/*2815 * 960-MHz Phase-Locked Loop Test Count2816 */2817register PLL960CNT0 {2818	address			0x06A2819	access_mode	RO2820	size		22821	modes		M_CFG2822}2823 2824/*2825 * 400-MHz Phase-Locked Loop Control 02826 */2827register PLL400CTL0 {2828	address			0x06C2829	access_mode	RW2830	modes		M_CFG2831	field	PLL_VCOSEL	0x802832	field	PLL_PWDN	0x402833	field	PLL_NS		0x302834	field	PLL_ENLUD	0x082835	field	PLL_ENLPF	0x042836	field	PLL_DLPF	0x022837	field	PLL_ENFBM	0x012838}2839 2840/*2841 * Arbitration Fairness2842 */2843register FAIRNESS {2844	address			0x06C2845	access_mode	RW2846	size		22847	modes		M_SCSI2848}2849 2850/*2851 * 400-MHz Phase-Locked Loop Control 12852 */2853register PLL400CTL1 {2854	address			0x06D2855	access_mode	RW2856	modes		M_CFG2857	field	PLL_CNTEN	0x802858	field	PLL_CNTCLR	0x402859	field	PLL_RST		0x012860}2861 2862/*2863 * Arbitration Unfairness2864 */2865register UNFAIRNESS {2866	address			0x06E2867	access_mode	RW2868	size		22869	modes		M_SCSI2870}2871 2872/*2873 * 400-MHz Phase-Locked Loop Test Count2874 */2875register PLL400CNT0 {2876	address			0x06E2877	access_mode	RO2878	size		22879	modes		M_CFG2880}2881 2882/*2883 * SCB Page Pointer2884 */2885register SCBPTR {2886	address			0x0A82887	access_mode	RW2888	size		22889	modes		M_DFF0, M_DFF1, M_CCHAN, M_SCSI2890	dont_generate_debug_code2891}2892 2893/*2894 * CMC SCB Array Count2895 * Number of bytes to transfer between CMC SCB memory and SCBRAM.2896 * Transfers must be 8byte aligned and sized.2897 */2898register CCSCBACNT {2899	address			0x0AB2900	access_mode	RW2901	modes		M_CCHAN2902}2903 2904/*2905 * SCB Autopointer2906 * SCB-Next Address Snooping logic.  When an SCB is transferred to2907 * the card, the next SCB address to be used by the CMC array can2908 * be autoloaded from that transfer.2909 */2910register SCBAUTOPTR {2911	address			0x0AB2912	access_mode	RW2913	modes		M_CFG2914	count		12915	field	AUSCBPTR_EN	0x802916	field	SCBPTR_ADDR	0x382917	field	SCBPTR_OFF	0x072918	dont_generate_debug_code2919}2920 2921/*2922 * CMC SG Ram Address Pointer2923 */2924register CCSGADDR {2925	address			0x0AC2926	access_mode	RW2927	modes		M_DFF0, M_DFF12928	dont_generate_debug_code2929}2930 2931/*2932 * CMC SCB RAM Address Pointer2933 */2934register CCSCBADDR {2935	address			0x0AC2936	access_mode	RW2937	modes		M_CCHAN2938	dont_generate_debug_code2939}2940 2941/*2942 * CMC SCB Ram Back-up Address Pointer2943 * Indicates the true stop location of transfers halted prior2944 * to SCBHCNT going to 0.2945 */2946register CCSCBADR_BK {2947	address			0x0AC2948	access_mode	RO2949	modes		M_CFG2950}2951 2952/*2953 * CMC SG Control2954 */2955register CCSGCTL {2956	address			0x0AD2957	access_mode	RW2958	modes		M_DFF0, M_DFF12959	field	CCSGDONE	0x802960	field	SG_CACHE_AVAIL	0x102961	field	CCSGENACK	0x082962	mask	CCSGEN		0x0C2963	field	SG_FETCH_REQ	0x022964	field	CCSGRESET	0x012965}2966 2967/*2968 * CMD SCB Control2969 */2970register CCSCBCTL {2971	address			0x0AD2972	access_mode	RW2973	modes		M_CCHAN2974	field	CCSCBDONE	0x802975	field	ARRDONE		0x402976	field	CCARREN		0x102977	field	CCSCBEN		0x082978	field	CCSCBDIR	0x042979	field	CCSCBRESET	0x012980}2981 2982/*2983 * CMC Ram BIST2984 */2985register CMC_RAMBIST {2986	address			0x0AD2987	access_mode	RW2988	modes		M_CFG2989	field	SG_ELEMENT_SIZE		0x802990	field	SCBRAMBIST_FAIL		0x402991	field	SG_BIST_FAIL		0x202992	field	SG_BIST_EN		0x102993	field	CMC_BUFFER_BIST_FAIL	0x022994	field	CMC_BUFFER_BIST_EN	0x012995}2996 2997/*2998 * CMC SG RAM Data Port2999 */3000register CCSGRAM {3001	address			0x0B03002	access_mode	RW3003	modes		M_DFF0, M_DFF13004	dont_generate_debug_code3005}3006 3007/*3008 * CMC SCB RAM Data Port3009 */3010register CCSCBRAM {3011	address			0x0B03012	access_mode	RW3013	modes		M_CCHAN3014	dont_generate_debug_code3015}3016 3017/*3018 * Flex DMA Address.3019 */3020register FLEXADR {3021	address			0x0B03022	access_mode	RW3023	size		33024	modes		M_SCSI3025}3026 3027/*3028 * Flex DMA Byte Count3029 */3030register FLEXCNT {3031	address			0x0B33032	access_mode	RW3033	size		23034	modes		M_SCSI3035}3036 3037/*3038 * Flex DMA Status3039 */3040register FLEXDMASTAT {3041	address			0x0B53042	access_mode	RW3043	modes		M_SCSI3044	field	FLEXDMAERR	0x023045	field	FLEXDMADONE	0x013046}3047 3048/*3049 * Flex DMA Data Port3050 */3051register FLEXDATA {3052	address			0x0B63053	access_mode	RW3054	modes		M_SCSI3055}3056 3057/*3058 * Board Data3059 */3060register BRDDAT {3061	address			0x0B83062	access_mode	RW3063	modes		M_SCSI3064	count		23065	dont_generate_debug_code3066}3067 3068/*3069 * Board Control3070 */3071register BRDCTL {3072	address			0x0B93073	access_mode	RW3074	modes		M_SCSI3075	count		73076	field	FLXARBACK	0x803077	field	FLXARBREQ	0x403078	field	BRDADDR		0x383079	field	BRDEN		0x043080	field	BRDRW		0x023081	field	BRDSTB		0x013082	dont_generate_debug_code3083}3084 3085/*3086 * Serial EEPROM Address3087 */3088register SEEADR {3089	address			0x0BA3090	access_mode	RW3091	modes		M_SCSI3092	count		43093	dont_generate_debug_code3094}3095 3096/*3097 * Serial EEPROM Data3098 */3099register SEEDAT {3100	address			0x0BC3101	access_mode	RW3102	size		23103	modes		M_SCSI3104	count		43105	dont_generate_debug_code3106}3107 3108/*3109 * Serial EEPROM Status3110 */3111register SEESTAT {3112	address			0x0BE3113	access_mode	RO3114	modes		M_SCSI3115	count		13116	field	INIT_DONE	0x803117	field	SEEOPCODE	0x703118	field	LDALTID_L	0x083119	field	SEEARBACK	0x043120	field	SEEBUSY		0x023121	field	SEESTART	0x013122	dont_generate_debug_code3123}3124 3125/*3126 * Serial EEPROM Control3127 */3128register SEECTL {3129	address			0x0BE3130	access_mode	RW3131	modes		M_SCSI3132	count		43133	field	SEEOPCODE	0x70 {3134		SEEOP_ERASE	0x70,3135		SEEOP_READ	0x60,3136		SEEOP_WRITE	0x50,3137	/*3138	 * The following four commands use special3139	 * addresses for differentiation.3140	 */3141		SEEOP_ERAL	0x403142	}3143	mask	SEEOP_EWEN	0x403144	mask	SEEOP_WALL	0x403145	mask	SEEOP_EWDS	0x403146	field	SEERST		0x023147	field	SEESTART	0x013148	dont_generate_debug_code3149}3150 3151const SEEOP_ERAL_ADDR	0x803152const SEEOP_EWEN_ADDR	0xC03153const SEEOP_WRAL_ADDR	0x403154const SEEOP_EWDS_ADDR	0x003155 3156/*3157 * SCB Counter3158 */3159register SCBCNT {3160	address			0x0BF3161	access_mode	RW3162	modes		M_SCSI3163	dont_generate_debug_code3164}3165 3166/*3167 * Data FIFO Write Address3168 * Pointer to the next QWD location to be written to the data FIFO.3169 */3170register DFWADDR {3171	address			0x0C03172	access_mode	RW3173	size		23174	modes		M_DFF0, M_DFF13175	dont_generate_debug_code3176}3177 3178/*3179 * DSP Filter Control3180 */3181register DSPFLTRCTL {3182	address			0x0C03183	access_mode	RW3184	modes		M_CFG3185	field	FLTRDISABLE	0x203186	field	EDGESENSE	0x103187	field	DSPFCNTSEL	0x0F3188}3189 3190/*3191 * DSP Data Channel Control3192 */3193register DSPDATACTL {3194	address			0x0C13195	access_mode	RW3196	modes		M_CFG3197	count		33198	field	BYPASSENAB	0x803199	field	DESQDIS		0x103200	field	RCVROFFSTDIS	0x043201	field	XMITOFFSTDIS	0x023202	dont_generate_debug_code3203}3204 3205/*3206 * Data FIFO Read Address3207 * Pointer to the next QWD location to be read from the data FIFO.3208 */3209register DFRADDR {3210	address			0x0C23211	access_mode	RW3212	size		23213	modes		M_DFF0, M_DFF13214}3215 3216/*3217 * DSP REQ Control3218 */3219register DSPREQCTL {3220	address			0x0C23221	access_mode	RW3222	modes		M_CFG3223	field	MANREQCTL	0xC03224	field	MANREQDLY	0x3F3225}3226 3227/*3228 * DSP ACK Control3229 */3230register DSPACKCTL {3231	address			0x0C33232	access_mode	RW3233	modes		M_CFG3234	field	MANACKCTL	0xC03235	field	MANACKDLY	0x3F3236}3237 3238/*3239 * Data FIFO Data3240 * Read/Write byte port into the data FIFO.  The read and write3241 * FIFO pointers increment with each read and write respectively3242 * to this port.3243 */3244register DFDAT {3245	address			0x0C43246	access_mode	RW3247	modes		M_DFF0, M_DFF13248	dont_generate_debug_code3249}3250 3251/*3252 * DSP Channel Select3253 */3254register DSPSELECT {3255	address			0x0C43256	access_mode	RW3257	modes		M_CFG3258	count		13259	field	AUTOINCEN	0x803260	field	DSPSEL		0x1F3261	dont_generate_debug_code3262}3263 3264const NUMDSPS 0x143265 3266/*3267 * Write Bias Control3268 */3269register WRTBIASCTL {3270	address			0x0C53271	access_mode	WO3272	modes		M_CFG3273	count		33274	field	AUTOXBCDIS	0x803275	field	XMITMANVAL	0x3F3276	dont_generate_debug_code3277}3278 3279/*3280 * Currently the WRTBIASCTL is the same as the default.3281 */3282const WRTBIASCTL_HP_DEFAULT 0x03283 3284/*3285 * Receiver Bias Control3286 */3287register RCVRBIOSCTL {3288	address			0x0C63289	access_mode	WO3290	modes		M_CFG3291	field	AUTORBCDIS	0x803292	field	RCVRMANVAL	0x3F3293}3294 3295/*3296 * Write Bias Calculator3297 */3298register WRTBIASCALC {3299	address			0x0C73300	access_mode	RO3301	modes		M_CFG3302}3303 3304/*3305 * Data FIFO Pointers3306 * Contains the byte offset from DFWADDR and DWRADDR to the current3307 * FIFO write/read locations.3308 */3309register DFPTRS {3310	address			0x0C83311	access_mode	RW3312	modes		M_DFF0, M_DFF13313}3314 3315/*3316 * Receiver Bias Calculator3317 */3318register RCVRBIASCALC {3319	address			0x0C83320	access_mode	RO3321	modes		M_CFG3322}3323 3324/*3325 * Data FIFO Backup Read Pointer3326 * Contains the data FIFO address to be restored if the last3327 * data accessed from the data FIFO was not transferred successfully.3328 */3329register DFBKPTR {3330	address			0x0C93331	access_mode	RW3332	size		23333	modes		M_DFF0, M_DFF13334}3335 3336/*3337 * Skew Calculator3338 */3339register SKEWCALC {3340	address			0x0C93341	access_mode	RO3342	modes		M_CFG3343}3344 3345/*3346 * Data FIFO Debug Control3347 */3348register DFDBCTL {3349	address				0x0CB3350	access_mode	RW3351	modes		M_DFF0, M_DFF13352	field	DFF_CIO_WR_RDY		0x203353	field	DFF_CIO_RD_RDY		0x103354	field	DFF_DIR_ERR		0x083355	field	DFF_RAMBIST_FAIL	0x043356	field	DFF_RAMBIST_DONE	0x023357	field	DFF_RAMBIST_EN		0x013358}3359 3360/*3361 * Data FIFO Space Count3362 * Number of FIFO locations that are free.3363 */3364register DFSCNT {3365	address			0x0CC3366	access_mode	RO3367	size		23368	modes		M_DFF0, M_DFF13369}3370 3371/*3372 * Data FIFO Byte Count3373 * Number of filled FIFO locations.3374 */3375register DFBCNT {3376	address			0x0CE3377	access_mode	RO3378	size		23379	modes		M_DFF0, M_DFF13380}3381 3382/*3383 * Sequencer Program Overlay Address.3384 * Low address must be written prior to high address.3385 */3386register OVLYADDR {3387	address			0x0D43388	modes		M_SCSI3389	size		23390	access_mode	RW3391}3392 3393/*3394 * Sequencer Control 03395 * Error detection mode, speed configuration,3396 * single step, breakpoints and program load.3397 */3398register SEQCTL0 {3399	address			0x0D63400	access_mode	RW3401	count		113402	field	PERRORDIS	0x803403	field	PAUSEDIS	0x403404	field	FAILDIS		0x203405	field	FASTMODE	0x103406	field	BRKADRINTEN	0x083407	field	STEP		0x043408	field	SEQRESET	0x023409	field	LOADRAM		0x013410}3411 3412/*3413 * Sequencer Control 13414 * Instruction RAM Diagnostics3415 */3416register SEQCTL1 {3417	address			0x0D73418	access_mode RW3419	field	OVRLAY_DATA_CHK	0x083420	field	RAMBIST_DONE	0x043421	field	RAMBIST_FAIL	0x023422	field	RAMBIST_EN	0x013423}3424 3425/*3426 * Sequencer Flags3427 * Zero and Carry state of the ALU.3428 */3429register FLAGS {3430	address			0x0D83431	access_mode 	RO3432	count		233433	field	ZERO		0x023434	field	CARRY		0x013435	dont_generate_debug_code3436}3437 3438/*3439 * Sequencer Interrupt Control3440 */ 3441register SEQINTCTL {3442	address			0x0D93443	access_mode RW3444	field	INTVEC1DSL	0x803445	field	INT1_CONTEXT	0x203446	field	SCS_SEQ_INT1M1	0x103447	field	SCS_SEQ_INT1M0	0x083448	field	INTMASK2	0x043449	field	INTMASK1	0x023450	field	IRET		0x013451}3452 3453/*3454 * Sequencer RAM Data Port3455 * Single byte window into the Sequencer Instruction Ram area starting3456 * at the address specified by OVLYADDR.  To write a full instruction word,3457 * simply write four bytes in succession.  OVLYADDR will increment after the3458 * most significant instrution byte (the byte with the parity bit) is written.3459 */3460register SEQRAM {3461	address			0x0DA3462	access_mode 	RW3463	count		23464	dont_generate_debug_code3465}3466 3467/*3468 * Sequencer Program Counter3469 * Low byte must be written prior to high byte.3470 */3471register PRGMCNT {3472	address			0x0DE3473	access_mode	RW3474	size		23475	count		53476	dont_generate_debug_code3477}3478 3479/*3480 * Accumulator3481 */3482register ACCUM {3483	address			0x0E03484	access_mode 	RW3485	accumulator3486	dont_generate_debug_code3487}3488 3489/*3490 * Source Index Register3491 * Incrementing index for reads of SINDIR and the destination (low byte only)3492 * for any immediate operands passed in jmp, jc, jnc, call instructions.3493 * Example:3494 *		mvi	0xFF	call some_routine;3495 *3496 *  Will set SINDEX[0] to 0xFF and call the routine "some_routine.3497 */3498register SINDEX	{3499	address			0x0E23500	access_mode	RW3501	size		23502	sindex3503	dont_generate_debug_code3504}3505 3506/*3507 * Destination Index Register3508 * Incrementing index for writes to DINDIR.  Can be used as a scratch register.3509 */3510register DINDEX {3511	address			0x0E43512	access_mode	RW3513	size		23514	dont_generate_debug_code3515}3516 3517/*3518 * Break Address3519 * Sequencer instruction breakpoint address address.3520 */3521register BRKADDR0 {3522	address			0x0E63523	access_mode	RW3524}3525 3526register BRKADDR1 {3527	address			0x0E63528	access_mode	RW3529	field	BRKDIS		0x80	/* Disable Breakpoint */3530}3531 3532/*3533 * All Ones3534 * All reads to this register return the value 0xFF.3535 */3536register ALLONES {3537	address			0x0E83538	access_mode RO3539	allones3540	dont_generate_debug_code3541}3542 3543/*3544 * All Zeros3545 * All reads to this register return the value 0.3546 */3547register ALLZEROS {3548	address			0x0EA3549	access_mode RO3550	allzeros3551	dont_generate_debug_code3552}3553 3554/*3555 * No Destination3556 * Writes to this register have no effect.3557 */3558register NONE {3559	address			0x0EA3560	access_mode WO3561	none3562	dont_generate_debug_code3563}3564 3565/*3566 * Source Index Indirect3567 * Reading this register is equivalent to reading (register_base + SINDEX) and3568 * incrementing SINDEX by 1.3569 */3570register SINDIR	{3571	address			0x0EC3572	access_mode RO3573	dont_generate_debug_code3574}3575 3576/*3577 * Destination Index Indirect3578 * Writing this register is equivalent to writing to (register_base + DINDEX)3579 * and incrementing DINDEX by 1.3580 */3581register DINDIR	 {3582	address			0x0ED3583	access_mode WO3584	dont_generate_debug_code3585}3586 3587/*3588 * Function One3589 * 2's complement to bit value conversion.  Write the 2's complement value3590 * (0-7 only) to the top nibble and retrieve the bit indexed by that value3591 * on the next read of this register. 3592 * Example:3593 *	Write	0x603594 *	Read	0x403595 */3596register FUNCTION1 {3597	address			0x0F03598	access_mode RW3599}3600 3601/*3602 * Stack3603 * Window into the stack.  Each stack location is 10 bits wide reported3604 * low byte followed by high byte.  There are 8 stack locations.3605 */3606register STACK {3607	address			0x0F23608	access_mode RW3609	dont_generate_debug_code3610}3611 3612/*3613 * Interrupt Vector 1 Address3614 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.3615 */3616register INTVEC1_ADDR {3617	address			0x0F43618	access_mode	RW3619	size		23620	modes		M_CFG3621	count		13622	dont_generate_debug_code3623}3624 3625/*3626 * Current Address3627 * Address of the SEQRAM instruction currently executing instruction.3628 */3629register CURADDR {3630	address			0x0F43631	access_mode	RW3632	size		23633	modes		M_SCSI3634	count		23635	dont_generate_debug_code3636}3637 3638/*3639 * Interrupt Vector 2 Address3640 * Interrupt branch address for HST_SEQ_INT2 interrupts.3641 */3642register INTVEC2_ADDR {3643	address			0x0F63644	access_mode	RW3645	size		23646	modes		M_CFG3647	count		13648	dont_generate_debug_code3649}3650 3651/*3652 * Last Address3653 * Address of the SEQRAM instruction executed prior to the current instruction.3654 */3655register LASTADDR {3656	address			0x0F63657	access_mode	RW3658	size		23659	modes		M_SCSI3660}3661 3662register AHD_PCI_CONFIG_BASE {3663	address			0x1003664	access_mode	RW3665	size		2563666	modes		M_CFG3667}3668 3669/* ---------------------- Scratch RAM Offsets ------------------------- */3670scratch_ram {3671	/* Mode Specific */3672	address			0x0A03673	size	83674	modes	0, 1, 2, 33675	REG0 {3676		size		23677		dont_generate_debug_code3678	}3679	REG1 {3680		size		23681	}3682	REG_ISR {3683		size		23684		dont_generate_debug_code3685	}3686	SG_STATE {3687		size		13688		field	SEGS_AVAIL	0x013689		field	LOADING_NEEDED	0x023690		field	FETCH_INPROG	0x043691	}3692	/*3693	 * Track whether the transfer byte count for3694	 * the current data phase is odd.3695	 */3696	DATA_COUNT_ODD {3697		size		13698	}3699}3700 3701scratch_ram {3702	/* Mode Specific */3703	address			0x0F83704	size	83705	modes	0, 1, 2, 33706	LONGJMP_ADDR {3707		size		23708		dont_generate_debug_code3709	}3710	ACCUM_SAVE {3711		size		13712		dont_generate_debug_code3713	}3714}3715 3716 3717scratch_ram {3718	address			0x1003719	size	1283720	modes	0, 1, 2, 33721	/*3722	 * Per "other-id" execution queues.  We use an array of3723	 * tail pointers into lists of SCBs sorted by "other-id".3724	 * The execution head pointer threads the head SCBs for3725	 * each list.3726	 */3727	WAITING_SCB_TAILS {3728		size		323729		dont_generate_debug_code3730	}3731	WAITING_TID_HEAD {3732		size		23733		dont_generate_debug_code3734	}3735	WAITING_TID_TAIL {3736		size		23737		dont_generate_debug_code3738	}3739	/*3740	 * SCBID of the next SCB in the new SCB queue.3741	 */3742	NEXT_QUEUED_SCB_ADDR {3743		size		43744		dont_generate_debug_code3745	}3746	/*3747	 * head of list of SCBs that have3748	 * completed but have not been3749	 * put into the qoutfifo.3750	 */3751	COMPLETE_SCB_HEAD {3752		size		23753		dont_generate_debug_code3754	}3755	/*3756	 * The list of completed SCBs in3757	 * the active DMA.3758	 */3759	COMPLETE_SCB_DMAINPROG_HEAD {3760		size		23761		dont_generate_debug_code3762	}3763	/*3764	 * head of list of SCBs that have3765	 * completed but need to be uploaded3766	 * to the host prior to being completed.3767	 */3768	COMPLETE_DMA_SCB_HEAD {3769		size		23770		dont_generate_debug_code3771	}3772	/*3773	 * tail of list of SCBs that have3774	 * completed but need to be uploaded3775	 * to the host prior to being completed.3776	 */3777	COMPLETE_DMA_SCB_TAIL {3778		size		23779		dont_generate_debug_code3780	}3781	/*3782	 * head of list of SCBs that have3783	 * been uploaded to the host, but cannot3784	 * be completed until the QFREEZE is in3785	 * full effect (i.e. no selections pending).3786	 */3787	COMPLETE_ON_QFREEZE_HEAD {3788		size		23789		dont_generate_debug_code3790	}3791	/*3792	 * Counting semaphore to prevent new select-outs3793	 * The queue is frozen so long as the sequencer3794	 * and kernel freeze counts differ.3795	 */3796	QFREEZE_COUNT {3797		size		23798	}3799	KERNEL_QFREEZE_COUNT {3800		size		23801	}3802	/*3803	 * Mode to restore on legacy idle loop exit.3804	 */3805	SAVED_MODE {3806		size		13807	}3808	/*3809	 * Single byte buffer used to designate the type or message3810	 * to send to a target.3811	 */3812	MSG_OUT {3813		size		13814		dont_generate_debug_code3815	}3816	/* Parameters for DMA Logic */3817	DMAPARAMS {3818		size		13819		count		83820		field	PRELOADEN	0x803821		field	WIDEODD		0x403822		field	SCSIEN		0x203823		field	SDMAEN		0x103824		field	SDMAENACK	0x103825		field	HDMAEN		0x083826		field	HDMAENACK	0x083827		field	DIRECTION	0x04	/* Set indicates PCI->SCSI */3828		field	FIFOFLUSH	0x023829		field	FIFORESET	0x013830		dont_generate_debug_code3831	}3832	SEQ_FLAGS {3833		size		13834		field	NOT_IDENTIFIED		0x803835		field	NO_CDB_SENT		0x403836		field	TARGET_CMD_IS_TAGGED	0x403837		field	DPHASE			0x203838		/* Target flags */3839		field	TARG_CMD_PENDING	0x103840		field	CMDPHASE_PENDING	0x083841		field	DPHASE_PENDING		0x043842		field	SPHASE_PENDING		0x023843		field	NO_DISCONNECT		0x013844	}3845	/*3846	 * Temporary storage for the3847	 * target/channel/lun of a3848	 * reconnecting target3849	 */3850	SAVED_SCSIID {3851		size		13852		dont_generate_debug_code3853	}3854	SAVED_LUN {3855		size		13856		dont_generate_debug_code3857	}3858	/*3859	 * The last bus phase as seen by the sequencer. 3860	 */3861	LASTPHASE {3862		size		13863		field	CDI		0x803864		field	IOI		0x403865		field	MSGI		0x203866		field	P_BUSFREE	0x013867		enum	PHASE_MASK  CDO|IOO|MSGO {3868			P_DATAOUT	0x0,3869			P_DATAIN	IOO,3870			P_DATAOUT_DT	P_DATAOUT|MSGO,3871			P_DATAIN_DT	P_DATAIN|MSGO,3872			P_COMMAND	CDO,3873			P_MESGOUT	CDO|MSGO,3874			P_STATUS	CDO|IOO,3875			P_MESGIN	CDO|IOO|MSGO3876		}3877	}3878	/*3879	 * Value to "or" into the SCBPTR[1] value to3880	 * indicate that an entry in the QINFIFO is valid.3881	 */3882	QOUTFIFO_ENTRY_VALID_TAG {3883		size		13884		dont_generate_debug_code3885	}3886	/*3887	 * Kernel and sequencer offsets into the queue of3888	 * incoming target mode command descriptors.  The3889	 * queue is full when the KERNEL_TQINPOS == TQINPOS.3890	 */3891	KERNEL_TQINPOS {3892		size		13893		count		13894		dont_generate_debug_code3895	}3896	TQINPOS {3897		size		13898		count		83899		dont_generate_debug_code3900	}3901	/*3902	 * Base address of our shared data with the kernel driver in host3903	 * memory.  This includes the qoutfifo and target mode3904	 * incoming command queue.3905	 */3906	SHARED_DATA_ADDR {3907		size		43908		dont_generate_debug_code3909	}3910	/*3911	 * Pointer to location in host memory for next3912	 * position in the qoutfifo.3913	 */3914	QOUTFIFO_NEXT_ADDR {3915		size		43916		dont_generate_debug_code3917	}3918	ARG_1 {3919		size		13920		mask	SEND_MSG		0x803921		mask	SEND_SENSE		0x403922		mask	SEND_REJ		0x203923		mask	MSGOUT_PHASEMIS		0x103924		mask	EXIT_MSG_LOOP		0x083925		mask	CONT_MSG_LOOP_WRITE	0x043926		mask	CONT_MSG_LOOP_READ	0x033927		mask	CONT_MSG_LOOP_TARG	0x023928		alias	RETURN_13929		dont_generate_debug_code3930	}3931	ARG_2 {3932		size		13933		count		13934		alias	RETURN_23935		dont_generate_debug_code3936	}3937 3938	/*3939	 * Snapshot of MSG_OUT taken after each message is sent.3940	 */3941	LAST_MSG {3942		size		13943		dont_generate_debug_code3944	}3945 3946	/*3947	 * Sequences the kernel driver has okayed for us.  This allows3948	 * the driver to do things like prevent initiator or target3949	 * operations.3950	 */3951	SCSISEQ_TEMPLATE {3952		size		13953		count		73954		field	MANUALCTL	0x403955		field	ENSELI		0x203956		field	ENRSELI		0x103957		field	MANUALP		0x0C3958		field	ENAUTOATNP	0x023959		field	ALTSTIM		0x013960		dont_generate_debug_code3961	}3962 3963	/*3964	 * The initiator specified tag for this target mode transaction.3965	 */3966	INITIATOR_TAG {3967		size		13968		count		13969		dont_generate_debug_code3970	}3971 3972	SEQ_FLAGS2 {3973		size		13974		field	PENDING_MK_MESSAGE	0x013975		field	TARGET_MSG_PENDING	0x023976		field	SELECTOUT_QFROZEN	0x043977	}3978 3979	ALLOCFIFO_SCBPTR {3980		size		23981		dont_generate_debug_code3982	}3983 3984	/*3985	 * The maximum amount of time to wait, when interrupt coalescing3986	 * is enabled, before issuing a CMDCMPLT interrupt for a completed3987	 * command.3988	 */3989	INT_COALESCING_TIMER {3990		size		23991		dont_generate_debug_code3992	}3993 3994	/*3995	 * The maximum number of commands to coalesce into a single interrupt.3996	 * Actually the 2's complement of that value to simplify sequencer3997	 * code.3998	 */3999	INT_COALESCING_MAXCMDS {4000		size		14001		dont_generate_debug_code4002	}4003 4004	/*4005	 * The minimum number of commands still outstanding required4006	 * to continue coalescing (2's complement of value).4007	 */4008	INT_COALESCING_MINCMDS {4009		size		14010		dont_generate_debug_code4011	}4012 4013	/*4014	 * Number of commands "in-flight".4015	 */4016	CMDS_PENDING {4017		size		24018		dont_generate_debug_code4019	}4020 4021	/*4022	 * The count of commands that have been coalesced.4023	 */4024	INT_COALESCING_CMDCOUNT {4025		size		14026		dont_generate_debug_code4027	}4028 4029	/*4030	 * Since the HS_MAIBOX is self clearing, copy its contents to4031	 * this position in scratch ram every time it changes.4032	 */4033	LOCAL_HS_MAILBOX {4034		size		14035		dont_generate_debug_code4036	}4037	/*4038	 * Target-mode CDB type to CDB length table used4039	 * in non-packetized operation.4040	 */4041	CMDSIZE_TABLE {4042		size		84043		count		84044		dont_generate_debug_code4045	}4046	/*4047	 * When an SCB with the MK_MESSAGE flag is4048	 * queued to the controller, it cannot enter4049	 * the waiting for selection list until the4050	 * selections for any previously queued4051	 * commands to that target complete.  During4052	 * the wait, the MK_MESSAGE SCB is queued4053	 * here.4054	 */4055	MK_MESSAGE_SCB {4056		size		24057	}4058	/*4059	 * Saved SCSIID of MK_MESSAGE_SCB to avoid4060	 * an extra SCBPTR operation when deciding4061	 * if the MK_MESSAGE_SCB can be run.4062	 */4063	MK_MESSAGE_SCSIID {4064		size		14065	}4066}4067 4068/************************* Hardware SCB Definition ****************************/4069scb {4070	address			0x1804071	size		644072	modes		0, 1, 2, 34073	SCB_RESIDUAL_DATACNT {4074		size	44075		alias	SCB_CDB_STORE4076		alias	SCB_HOST_CDB_PTR4077		dont_generate_debug_code4078	}4079	SCB_RESIDUAL_SGPTR {4080		size	44081		field	SG_ADDR_MASK		0xf8	/* In the last byte */4082		field	SG_OVERRUN_RESID	0x02	/* In the first byte */4083		field	SG_LIST_NULL		0x01	/* In the first byte */4084		dont_generate_debug_code4085	}4086	SCB_SCSI_STATUS {4087		size	14088		alias	SCB_HOST_CDB_LEN4089		dont_generate_debug_code4090	}4091	SCB_TARGET_PHASES {4092		size	14093		dont_generate_debug_code4094	}4095	SCB_TARGET_DATA_DIR {4096		size	14097		dont_generate_debug_code4098	}4099	SCB_TARGET_ITAG {4100		size	14101		dont_generate_debug_code4102	}4103	SCB_SENSE_BUSADDR {4104		/*4105		 * Only valid if CDB length is less than 13 bytes or4106		 * we are using a CDB pointer.  Otherwise contains4107		 * the last 4 bytes of embedded cdb information.4108		 */4109		size	44110		alias	SCB_NEXT_COMPLETE4111		dont_generate_debug_code4112	}4113	SCB_TAG {4114		alias	SCB_FIFO_USE_COUNT4115		size	24116		dont_generate_debug_code4117	}4118	SCB_CONTROL {4119		size	14120		field	TARGET_SCB	0x804121		field	DISCENB		0x404122		field	TAG_ENB		0x204123		field	MK_MESSAGE	0x104124		field	STATUS_RCVD	0x084125		field	DISCONNECTED	0x044126		field	SCB_TAG_TYPE	0x034127	}4128	SCB_SCSIID {4129		size	14130		field	TID	0xF04131		field	OID	0x0F4132	}4133	SCB_LUN {4134		size	14135		field	LID	0xff4136		dont_generate_debug_code4137	}4138	SCB_TASK_ATTRIBUTE {4139		size	14140		/*4141		 * Overloaded field for non-packetized 4142		 * ignore wide residue message handling.4143		 */4144		field	SCB_XFERLEN_ODD	0x014145		dont_generate_debug_code4146	}4147	SCB_CDB_LEN {4148		size	14149		field	SCB_CDB_LEN_PTR	0x80	/* CDB in host memory */4150		dont_generate_debug_code4151	}4152	SCB_TASK_MANAGEMENT {4153		size	14154		dont_generate_debug_code4155	}4156	SCB_DATAPTR {4157		size	84158		dont_generate_debug_code4159	}4160	SCB_DATACNT {4161		/*4162		 * The last byte is really the high address bits for4163		 * the data address.4164		 */4165		size	44166		field	SG_LAST_SEG		0x80	/* In the fourth byte */4167		field	SG_HIGH_ADDR_BITS	0x7F	/* In the fourth byte */4168		dont_generate_debug_code4169	}4170	SCB_SGPTR {4171		size	44172		field	SG_STATUS_VALID	0x04	/* In the first byte */4173		field	SG_FULL_RESID	0x02	/* In the first byte */4174		field	SG_LIST_NULL	0x01	/* In the first byte */4175		dont_generate_debug_code4176	}4177	SCB_BUSADDR {4178		size	44179		dont_generate_debug_code4180	}4181	SCB_NEXT {4182		alias	SCB_NEXT_SCB_BUSADDR4183		size	24184		dont_generate_debug_code4185	}4186	SCB_NEXT2 {4187		size	24188		dont_generate_debug_code4189	}4190	SCB_SPARE {4191		size	84192		alias	SCB_PKT_LUN4193	}4194	SCB_DISCONNECTED_LISTS {4195		size	84196		dont_generate_debug_code4197	}4198}4199 4200/*********************************** Constants ********************************/4201const MK_MESSAGE_BIT_OFFSET	44202const TID_SHIFT		44203const TARGET_CMD_CMPLT	0xfe4204const INVALID_ADDR	0x804205#define SCB_LIST_NULL	0xff4206#define QOUTFIFO_ENTRY_VALID_TOGGLE	0x804207 4208const CCSGADDR_MAX	0x804209const CCSCBADDR_MAX	0x804210const CCSGRAM_MAXSEGS	164211 4212/* Selection Timeout Timer Constants */4213const STIMESEL_SHIFT	34214const STIMESEL_MIN	0x184215const STIMESEL_BUG_ADJ	0x84216 4217/* WDTR Message values */4218const BUS_8_BIT			0x004219const BUS_16_BIT		0x014220const BUS_32_BIT		0x024221 4222/* Offset maximums */4223const MAX_OFFSET		0xfe4224const MAX_OFFSET_PACED		0xfe4225const MAX_OFFSET_PACED_BUG	0x7f4226/*4227 * Some 160 devices incorrectly accept 0xfe as a4228 * sync offset, but will overrun this value.  Limit4229 * to 0x7f for speed lower than U320 which will4230 * avoid the persistent sync offset overruns.4231 */4232const MAX_OFFSET_NON_PACED	0x7f4233const HOST_MSG			0xff4234 4235/*4236 * The size of our sense buffers.4237 * Sense buffer mapping can be handled in either of two ways.4238 * The first is to allocate a dmamap for each transaction.4239 * Depending on the architecture, dmamaps can be costly. The4240 * alternative is to statically map the buffers in much the same4241 * way we handle our scatter gather lists.  The driver implements4242 * the later.4243 */4244const AHD_SENSE_BUFSIZE		2564245 4246/* Target mode command processing constants */4247const CMD_GROUP_CODE_SHIFT	0x054248 4249const STATUS_BUSY		0x084250const STATUS_QUEUE_FULL		0x284251const STATUS_PKT_SENSE		0xFF4252const TARGET_DATA_IN		14253 4254const SCB_TRANSFER_SIZE_FULL_LUN	564255const SCB_TRANSFER_SIZE_1BYTE_LUN	484256/* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */4257const PKT_OVERRUN_BUFSIZE	5124258 4259/*4260 * Timer parameters.4261 */4262const AHD_TIMER_US_PER_TICK	254263const AHD_TIMER_MAX_TICKS	0xFFFF4264const AHD_TIMER_MAX_US		(AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)4265 4266/*4267 * Downloaded (kernel inserted) constants4268 */4269const SG_PREFETCH_CNT download4270const SG_PREFETCH_CNT_LIMIT download4271const SG_PREFETCH_ALIGN_MASK download4272const SG_PREFETCH_ADDR_MASK download4273const SG_SIZEOF download4274const PKT_OVERRUN_BUFOFFSET download4275const SCB_TRANSFER_SIZE	download4276const CACHELINE_MASK download4277 4278/*4279 * BIOS SCB offsets4280 */4281const NVRAM_SCB_OFFSET	0x2C4282