1144411Sscottl/*
2247443Sdelphij********************************************************************************
3247443Sdelphij**        OS    : FreeBSD
4144411Sscottl**   FILE NAME  : arcmsr.h
5210358Sdelphij**        BY    : Erich Chen, Ching Huang
6144411Sscottl**   Description: SCSI RAID Device Driver for
7247443Sdelphij**                ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x)
8247443Sdelphij**                SATA/SAS RAID HOST Adapter
9247443Sdelphij********************************************************************************
10247443Sdelphij********************************************************************************
11247443Sdelphij** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved.
12165155Sscottl**
13144411Sscottl** Redistribution and use in source and binary forms,with or without
14144411Sscottl** modification,are permitted provided that the following conditions
15144411Sscottl** are met:
16144411Sscottl** 1. Redistributions of source code must retain the above copyright
17144411Sscottl**    notice,this list of conditions and the following disclaimer.
18144411Sscottl** 2. Redistributions in binary form must reproduce the above copyright
19144411Sscottl**    notice,this list of conditions and the following disclaimer in the
20144411Sscottl**    documentation and/or other materials provided with the distribution.
21144411Sscottl** 3. The name of the author may not be used to endorse or promote products
22144411Sscottl**    derived from this software without specific prior written permission.
23144411Sscottl**
24144411Sscottl** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
25144411Sscottl** IMPLIED WARRANTIES,INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES
26144411Sscottl** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27144411Sscottl** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,INDIRECT,
28144411Sscottl** INCIDENTAL,SPECIAL,EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT
29144411Sscottl** NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30144411Sscottl** DATA,OR PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY
31144411Sscottl** THEORY OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY,OR TORT
32144411Sscottl**(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF
33144411Sscottl** THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34144411Sscottl**************************************************************************
35165155Sscottl* $FreeBSD: stable/11/sys/dev/arcmsr/arcmsr.h 367508 2020-11-09 01:39:55Z delphij $
36144411Sscottl*/
37259565Sdelphij#define ARCMSR_SCSI_INITIATOR_ID	255
38259565Sdelphij#define ARCMSR_DEV_SECTOR_SIZE		512
39259565Sdelphij#define ARCMSR_MAX_XFER_SECTORS		4096
40259565Sdelphij#define ARCMSR_MAX_TARGETID		17	/*16 max target id + 1*/
41259565Sdelphij#define ARCMSR_MAX_TARGETLUN		8	/*8*/
42259565Sdelphij#define ARCMSR_MAX_CHIPTYPE_NUM		4
43259565Sdelphij#define ARCMSR_MAX_OUTSTANDING_CMD	256
44259565Sdelphij#define ARCMSR_MAX_START_JOB		256
45259565Sdelphij#define ARCMSR_MAX_CMD_PERLUN		ARCMSR_MAX_OUTSTANDING_CMD
46259565Sdelphij#define ARCMSR_MAX_FREESRB_NUM		384
47259565Sdelphij#define ARCMSR_MAX_QBUFFER		4096	/* ioctl QBUFFER */
48259565Sdelphij#define ARCMSR_MAX_SG_ENTRIES		38	/* max 38*/
49259565Sdelphij#define ARCMSR_MAX_ADAPTER		4
50259565Sdelphij#define ARCMSR_RELEASE_SIMQ_LEVEL	230
51259565Sdelphij#define ARCMSR_MAX_HBB_POSTQUEUE	264	/* (ARCMSR_MAX_OUTSTANDING_CMD+8) */
52259565Sdelphij#define ARCMSR_MAX_HBD_POSTQUEUE	256
53259565Sdelphij#define	ARCMSR_TIMEOUT_DELAY		60	/* in sec */
54321064Sdelphij#define	ARCMSR_NUM_MSIX_VECTORS		4
55144411Sscottl/*
56144411Sscottl*********************************************************************
57144411Sscottl*/
58144411Sscottl#ifndef TRUE
59174451Sscottl	#define TRUE  1
60144411Sscottl#endif
61144411Sscottl#ifndef FALSE
62174451Sscottl	#define FALSE 0
63144411Sscottl#endif
64165155Sscottl#ifndef INTR_ENTROPY
65174451Sscottl	# define INTR_ENTROPY 0
66165155Sscottl#endif
67165155Sscottl
68165155Sscottl#ifndef offsetof
69165155Sscottl	#define offsetof(type, member)  ((size_t)(&((type *)0)->member))
70165155Sscottl#endif
71244406Sdelphij
72367508Sdelphij#define ARCMSR_LOCK_INIT(l, s)		mtx_init(l, s, NULL, MTX_DEF)
73367508Sdelphij#define ARCMSR_LOCK_DESTROY(l)		mtx_destroy(l)
74367508Sdelphij#define ARCMSR_LOCK_ACQUIRE(l)		mtx_lock(l)
75367508Sdelphij#define ARCMSR_LOCK_RELEASE(l)		mtx_unlock(l)
76367508Sdelphij#define ARCMSR_LOCK_TRY(l)		mtx_trylock(l)
77367508Sdelphij#define arcmsr_htole32(x)		htole32(x)
78367508Sdelphijtypedef struct mtx			arcmsr_lock_t;
79244406Sdelphij
80144411Sscottl/*
81144411Sscottl**********************************************************************************
82144411Sscottl**
83144411Sscottl**********************************************************************************
84144411Sscottl*/
85259565Sdelphij#define PCI_VENDOR_ID_ARECA		0x17D3 /* Vendor ID	*/
86215234Sdelphij#define PCI_DEVICE_ID_ARECA_1110        0x1110 /* Device ID	*/
87215234Sdelphij#define PCI_DEVICE_ID_ARECA_1120        0x1120 /* Device ID	*/
88215234Sdelphij#define PCI_DEVICE_ID_ARECA_1130        0x1130 /* Device ID	*/
89215234Sdelphij#define PCI_DEVICE_ID_ARECA_1160        0x1160 /* Device ID	*/
90215234Sdelphij#define PCI_DEVICE_ID_ARECA_1170        0x1170 /* Device ID	*/
91215234Sdelphij#define PCI_DEVICE_ID_ARECA_1200        0x1200 /* Device ID	*/
92215234Sdelphij#define PCI_DEVICE_ID_ARECA_1201        0x1201 /* Device ID	*/
93291641Sdelphij#define PCI_DEVICE_ID_ARECA_1203        0x1203 /* Device ID	*/
94215234Sdelphij#define PCI_DEVICE_ID_ARECA_1210        0x1210 /* Device ID	*/
95210358Sdelphij#define PCI_DEVICE_ID_ARECA_1212        0x1212 /* Device ID	*/
96244406Sdelphij#define PCI_DEVICE_ID_ARECA_1214        0x1214 /* Device ID	*/
97215234Sdelphij#define PCI_DEVICE_ID_ARECA_1220        0x1220 /* Device ID	*/
98210358Sdelphij#define PCI_DEVICE_ID_ARECA_1222        0x1222 /* Device ID	*/
99215234Sdelphij#define PCI_DEVICE_ID_ARECA_1230        0x1230 /* Device ID	*/
100215234Sdelphij#define PCI_DEVICE_ID_ARECA_1231        0x1231 /* Device ID	*/
101215234Sdelphij#define PCI_DEVICE_ID_ARECA_1260        0x1260 /* Device ID	*/
102215234Sdelphij#define PCI_DEVICE_ID_ARECA_1261        0x1261 /* Device ID	*/
103215234Sdelphij#define PCI_DEVICE_ID_ARECA_1270        0x1270 /* Device ID	*/
104215234Sdelphij#define PCI_DEVICE_ID_ARECA_1280        0x1280 /* Device ID	*/
105215234Sdelphij#define PCI_DEVICE_ID_ARECA_1380        0x1380 /* Device ID	*/
106215234Sdelphij#define PCI_DEVICE_ID_ARECA_1381        0x1381 /* Device ID	*/
107215234Sdelphij#define PCI_DEVICE_ID_ARECA_1680        0x1680 /* Device ID	*/
108215234Sdelphij#define PCI_DEVICE_ID_ARECA_1681        0x1681 /* Device ID	*/
109210358Sdelphij#define PCI_DEVICE_ID_ARECA_1880        0x1880 /* Device ID	*/
110321064Sdelphij#define PCI_DEVICE_ID_ARECA_1884        0x1884 /* Device ID	*/
111144411Sscottl
112240079Sdelphij#define ARECA_SUB_DEV_ID_1880	0x1880 /* Subsystem Device ID	*/
113240079Sdelphij#define ARECA_SUB_DEV_ID_1882	0x1882 /* Subsystem Device ID	*/
114259564Sdelphij#define ARECA_SUB_DEV_ID_1883	0x1883 /* Subsystem Device ID	*/
115321064Sdelphij#define ARECA_SUB_DEV_ID_1884	0x1884 /* Subsystem Device ID	*/
116240079Sdelphij#define ARECA_SUB_DEV_ID_1212	0x1212 /* Subsystem Device ID	*/
117240079Sdelphij#define ARECA_SUB_DEV_ID_1213	0x1213 /* Subsystem Device ID	*/
118326087Sdelphij#define ARECA_SUB_DEV_ID_1216	0x1216 /* Subsystem Device ID	*/
119240079Sdelphij#define ARECA_SUB_DEV_ID_1222	0x1222 /* Subsystem Device ID	*/
120240079Sdelphij#define ARECA_SUB_DEV_ID_1223	0x1223 /* Subsystem Device ID	*/
121326087Sdelphij#define ARECA_SUB_DEV_ID_1226	0x1226 /* Subsystem Device ID	*/
122240079Sdelphij
123215234Sdelphij#define PCIDevVenIDARC1110              0x111017D3 /* Vendor Device ID	*/
124215234Sdelphij#define PCIDevVenIDARC1120              0x112017D3 /* Vendor Device ID	*/
125215234Sdelphij#define PCIDevVenIDARC1130              0x113017D3 /* Vendor Device ID	*/
126215234Sdelphij#define PCIDevVenIDARC1160              0x116017D3 /* Vendor Device ID	*/
127215234Sdelphij#define PCIDevVenIDARC1170              0x117017D3 /* Vendor Device ID	*/
128215234Sdelphij#define PCIDevVenIDARC1200              0x120017D3 /* Vendor Device ID	*/
129215234Sdelphij#define PCIDevVenIDARC1201              0x120117D3 /* Vendor Device ID	*/
130291641Sdelphij#define PCIDevVenIDARC1203              0x120317D3 /* Vendor Device ID	*/
131215234Sdelphij#define PCIDevVenIDARC1210              0x121017D3 /* Vendor Device ID	*/
132210358Sdelphij#define PCIDevVenIDARC1212              0x121217D3 /* Vendor Device ID	*/
133259565Sdelphij#define PCIDevVenIDARC1213              0x121317D3 /* Vendor Device ID	*/
134259565Sdelphij#define PCIDevVenIDARC1214              0x121417D3 /* Vendor Device ID	*/
135215234Sdelphij#define PCIDevVenIDARC1220              0x122017D3 /* Vendor Device ID	*/
136210358Sdelphij#define PCIDevVenIDARC1222              0x122217D3 /* Vendor Device ID	*/
137259565Sdelphij#define PCIDevVenIDARC1223              0x122317D3 /* Vendor Device ID	*/
138215234Sdelphij#define PCIDevVenIDARC1230              0x123017D3 /* Vendor Device ID	*/
139215234Sdelphij#define PCIDevVenIDARC1231              0x123117D3 /* Vendor Device ID	*/
140215234Sdelphij#define PCIDevVenIDARC1260              0x126017D3 /* Vendor Device ID	*/
141215234Sdelphij#define PCIDevVenIDARC1261              0x126117D3 /* Vendor Device ID	*/
142215234Sdelphij#define PCIDevVenIDARC1270              0x127017D3 /* Vendor Device ID	*/
143215234Sdelphij#define PCIDevVenIDARC1280              0x128017D3 /* Vendor Device ID	*/
144215234Sdelphij#define PCIDevVenIDARC1380              0x138017D3 /* Vendor Device ID	*/
145215234Sdelphij#define PCIDevVenIDARC1381              0x138117D3 /* Vendor Device ID	*/
146215234Sdelphij#define PCIDevVenIDARC1680              0x168017D3 /* Vendor Device ID	*/
147215234Sdelphij#define PCIDevVenIDARC1681              0x168117D3 /* Vendor Device ID	*/
148210358Sdelphij#define PCIDevVenIDARC1880              0x188017D3 /* Vendor Device ID	*/
149259565Sdelphij#define PCIDevVenIDARC1882              0x188217D3 /* Vendor Device ID	*/
150321064Sdelphij#define PCIDevVenIDARC1884              0x188417D3 /* Vendor Device ID	*/
151367508Sdelphij#define PCIDevVenIDARC1886_             0x188917D3 /* Vendor Device ID	*/
152367508Sdelphij#define PCIDevVenIDARC1886              0x188A17D3 /* Vendor Device ID	*/
153144411Sscottl
154165155Sscottl#ifndef PCIR_BARS
155165155Sscottl	#define PCIR_BARS	0x10
156165155Sscottl	#define	PCIR_BAR(x)	(PCIR_BARS + (x) * 4)
157165155Sscottl#endif
158165155Sscottl
159215234Sdelphij#define PCI_BASE_ADDR0                  0x10
160215234Sdelphij#define PCI_BASE_ADDR1                  0x14
161215234Sdelphij#define PCI_BASE_ADDR2                  0x18
162215234Sdelphij#define PCI_BASE_ADDR3                  0x1C
163215234Sdelphij#define PCI_BASE_ADDR4                  0x20
164215234Sdelphij#define PCI_BASE_ADDR5                  0x24
165144411Sscottl/*
166144411Sscottl**********************************************************************************
167144411Sscottl**
168144411Sscottl**********************************************************************************
169144411Sscottl*/
170215234Sdelphij#define ARCMSR_SCSICMD_IOCTL            0x77
171215234Sdelphij#define ARCMSR_CDEVSW_IOCTL             0x88
172215234Sdelphij#define ARCMSR_MESSAGE_FAIL             0x0001
173215234Sdelphij#define	ARCMSR_MESSAGE_SUCCESS          0x0000
174144411Sscottl/*
175144411Sscottl**********************************************************************************
176144411Sscottl**
177144411Sscottl**********************************************************************************
178144411Sscottl*/
179259565Sdelphij#define arcmsr_ccbsrb_ptr	spriv_ptr0
180259565Sdelphij#define arcmsr_ccbacb_ptr	spriv_ptr1
181259565Sdelphij#define dma_addr_hi32(addr)	(u_int32_t) ((addr>>16)>>16)
182259565Sdelphij#define dma_addr_lo32(addr)	(u_int32_t) (addr & 0xffffffff)
183259565Sdelphij#define get_min(x,y)		((x) < (y) ? (x) : (y))
184259565Sdelphij#define get_max(x,y)		((x) < (y) ? (y) : (x))
185144411Sscottl/*
186244406Sdelphij**************************************************************************
187244406Sdelphij**************************************************************************
188244406Sdelphij*/
189259565Sdelphij#define CHIP_REG_READ32(s, b, r)	bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r))
190244406Sdelphij#define CHIP_REG_WRITE32(s, b, r, d)	bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d)
191291641Sdelphij#define READ_CHIP_REG32(b, r)		bus_space_read_4(acb->btag[b], acb->bhandle[b], r)
192291641Sdelphij#define WRITE_CHIP_REG32(b, r, d)	bus_space_write_4(acb->btag[b], acb->bhandle[b], r, d)
193244406Sdelphij/*
194165155Sscottl**********************************************************************************
195244406Sdelphij**    IOCTL CONTROL Mail Box
196165155Sscottl**********************************************************************************
197144411Sscottl*/
198210358Sdelphijstruct CMD_MESSAGE {
199210358Sdelphij      u_int32_t HeaderLength;
200210358Sdelphij      u_int8_t Signature[8];
201210358Sdelphij      u_int32_t Timeout;
202210358Sdelphij      u_int32_t ControlCode;
203210358Sdelphij      u_int32_t ReturnCode;
204210358Sdelphij      u_int32_t Length;
205210358Sdelphij};
206210358Sdelphij
207210358Sdelphijstruct CMD_MESSAGE_FIELD {
208210358Sdelphij    struct CMD_MESSAGE cmdmessage; /* ioctl header */
209210358Sdelphij    u_int8_t           messagedatabuffer[1032]; /* areca gui program does not accept more than 1031 byte */
210210358Sdelphij};
211210358Sdelphij
212210358Sdelphij/************************************************************************/
213210358Sdelphij/************************************************************************/
214210358Sdelphij
215259565Sdelphij#define ARCMSR_IOP_ERROR_ILLEGALPCI		0x0001
216259565Sdelphij#define ARCMSR_IOP_ERROR_VENDORID		0x0002
217259565Sdelphij#define ARCMSR_IOP_ERROR_DEVICEID		0x0002
218259565Sdelphij#define ARCMSR_IOP_ERROR_ILLEGALCDB		0x0003
219259565Sdelphij#define ARCMSR_IOP_ERROR_UNKNOW_CDBERR		0x0004
220259565Sdelphij#define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE	0x0005
221259565Sdelphij#define ARCMSR_SYS_ERROR_MEMORY_CROSS4G		0x0006
222259565Sdelphij#define ARCMSR_SYS_ERROR_MEMORY_LACK		0x0007
223259565Sdelphij#define ARCMSR_SYS_ERROR_MEMORY_RANGE		0x0008
224259565Sdelphij#define ARCMSR_SYS_ERROR_DEVICE_BASE		0x0009
225259565Sdelphij#define ARCMSR_SYS_ERROR_PORT_VALIDATE		0x000A
226210358Sdelphij
227144411Sscottl/*DeviceType*/
228144411Sscottl#define ARECA_SATA_RAID                      	0x90000000
229210358Sdelphij
230144411Sscottl/*FunctionCode*/
231144411Sscottl#define FUNCTION_READ_RQBUFFER               	0x0801
232144411Sscottl#define FUNCTION_WRITE_WQBUFFER              	0x0802
233144411Sscottl#define FUNCTION_CLEAR_RQBUFFER              	0x0803
234144411Sscottl#define FUNCTION_CLEAR_WQBUFFER              	0x0804
235144411Sscottl#define FUNCTION_CLEAR_ALLQBUFFER            	0x0805
236165155Sscottl#define FUNCTION_REQUEST_RETURNCODE_3F         	0x0806
237144411Sscottl#define FUNCTION_SAY_HELLO                   	0x0807
238165155Sscottl#define FUNCTION_SAY_GOODBYE                    0x0808
239165155Sscottl#define FUNCTION_FLUSH_ADAPTER_CACHE           	0x0809
240165155Sscottl/*
241165155Sscottl************************************************************************
242244406Sdelphij**      IOCTL CONTROL CODE
243165155Sscottl************************************************************************
244165155Sscottl*/
245144411Sscottl/* ARECA IO CONTROL CODE*/
246165155Sscottl#define ARCMSR_MESSAGE_READ_RQBUFFER           	_IOWR('F', FUNCTION_READ_RQBUFFER, struct CMD_MESSAGE_FIELD)
247165155Sscottl#define ARCMSR_MESSAGE_WRITE_WQBUFFER          	_IOWR('F', FUNCTION_WRITE_WQBUFFER, struct CMD_MESSAGE_FIELD)
248165155Sscottl#define ARCMSR_MESSAGE_CLEAR_RQBUFFER          	_IOWR('F', FUNCTION_CLEAR_RQBUFFER, struct CMD_MESSAGE_FIELD)
249165155Sscottl#define ARCMSR_MESSAGE_CLEAR_WQBUFFER          	_IOWR('F', FUNCTION_CLEAR_WQBUFFER, struct CMD_MESSAGE_FIELD)
250165155Sscottl#define ARCMSR_MESSAGE_CLEAR_ALLQBUFFER        	_IOWR('F', FUNCTION_CLEAR_ALLQBUFFER, struct CMD_MESSAGE_FIELD)
251165155Sscottl#define ARCMSR_MESSAGE_REQUEST_RETURNCODE_3F   	_IOWR('F', FUNCTION_REQUEST_RETURNCODE_3F, struct CMD_MESSAGE_FIELD)
252165155Sscottl#define ARCMSR_MESSAGE_SAY_HELLO               	_IOWR('F', FUNCTION_SAY_HELLO, struct CMD_MESSAGE_FIELD)
253165155Sscottl#define ARCMSR_MESSAGE_SAY_GOODBYE              _IOWR('F', FUNCTION_SAY_GOODBYE, struct CMD_MESSAGE_FIELD)
254165155Sscottl#define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE      _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD)
255210358Sdelphij
256144411Sscottl/* ARECA IOCTL ReturnCode */
257259565Sdelphij#define ARCMSR_MESSAGE_RETURNCODE_OK		0x00000001
258259565Sdelphij#define ARCMSR_MESSAGE_RETURNCODE_ERROR		0x00000006
259259565Sdelphij#define ARCMSR_MESSAGE_RETURNCODE_3F		0x0000003F
260259565Sdelphij#define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON	0x00000088
261144411Sscottl/*
262174451Sscottl************************************************************************
263244406Sdelphij**                SPEC. for Areca HBA adapter
264244406Sdelphij************************************************************************
265244406Sdelphij*/
266244406Sdelphij/* signature of set and get firmware config */
267259565Sdelphij#define ARCMSR_SIGNATURE_GET_CONFIG		0x87974060
268259565Sdelphij#define ARCMSR_SIGNATURE_SET_CONFIG		0x87974063
269244406Sdelphij/* message code of inbound message register */
270259565Sdelphij#define ARCMSR_INBOUND_MESG0_NOP		0x00000000
271259565Sdelphij#define ARCMSR_INBOUND_MESG0_GET_CONFIG		0x00000001
272259565Sdelphij#define ARCMSR_INBOUND_MESG0_SET_CONFIG		0x00000002
273259565Sdelphij#define ARCMSR_INBOUND_MESG0_ABORT_CMD		0x00000003
274259565Sdelphij#define ARCMSR_INBOUND_MESG0_STOP_BGRB		0x00000004
275259565Sdelphij#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE	0x00000005
276259565Sdelphij#define ARCMSR_INBOUND_MESG0_START_BGRB		0x00000006
277259565Sdelphij#define ARCMSR_INBOUND_MESG0_CHK331PENDING	0x00000007
278259565Sdelphij#define ARCMSR_INBOUND_MESG0_SYNC_TIMER		0x00000008
279244406Sdelphij/* doorbell interrupt generator */
280259565Sdelphij#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK	0x00000001
281259565Sdelphij#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK	0x00000002
282259565Sdelphij#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK	0x00000001
283259565Sdelphij#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK	0x00000002
284244406Sdelphij/* srb areca cdb flag */
285259565Sdelphij#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE		0x80000000
286259565Sdelphij#define ARCMSR_SRBPOST_FLAG_IAM_BIOS		0x40000000
287259565Sdelphij#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS		0x40000000
288259565Sdelphij#define ARCMSR_SRBREPLY_FLAG_ERROR		0x10000000
289259565Sdelphij#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0        0x10000000
290259565Sdelphij#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1	0x00000001
291244406Sdelphij/* outbound firmware ok */
292259565Sdelphij#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK	0x80000000
293244406Sdelphij
294259565Sdelphij#define ARCMSR_ARC1680_BUS_RESET		0x00000003
295244406Sdelphij/*
296244406Sdelphij************************************************************************
297174451Sscottl**                SPEC. for Areca HBB adapter
298174451Sscottl************************************************************************
299174451Sscottl*/
300174451Sscottl/* ARECA HBB COMMAND for its FIRMWARE */
301174451Sscottl#define ARCMSR_DRV2IOP_DOORBELL                 0x00020400    /* window of "instruction flags" from driver to iop */
302174451Sscottl#define ARCMSR_DRV2IOP_DOORBELL_MASK            0x00020404
303174451Sscottl#define ARCMSR_IOP2DRV_DOORBELL                 0x00020408    /* window of "instruction flags" from iop to driver */
304174451Sscottl#define ARCMSR_IOP2DRV_DOORBELL_MASK            0x0002040C
305210358Sdelphij
306291641Sdelphij#define ARCMSR_IOP2DRV_DOORBELL_1203            0x00021870    /* window of "instruction flags" from iop to driver */
307291641Sdelphij#define ARCMSR_IOP2DRV_DOORBELL_MASK_1203       0x00021874
308291641Sdelphij#define ARCMSR_DRV2IOP_DOORBELL_1203            0x00021878    /* window of "instruction flags" from driver to iop */
309291641Sdelphij#define ARCMSR_DRV2IOP_DOORBELL_MASK_1203       0x0002187C
310291641Sdelphij
311174451Sscottl/* ARECA FLAG LANGUAGE */
312174451Sscottl#define ARCMSR_IOP2DRV_DATA_WRITE_OK            0x00000001        /* ioctl transfer */
313174451Sscottl#define ARCMSR_IOP2DRV_DATA_READ_OK             0x00000002        /* ioctl transfer */
314174451Sscottl#define ARCMSR_IOP2DRV_CDB_DONE                 0x00000004
315174451Sscottl#define ARCMSR_IOP2DRV_MESSAGE_CMD_DONE         0x00000008
316174451Sscottl
317259565Sdelphij#define ARCMSR_DOORBELL_HANDLE_INT		0x0000000F
318174451Sscottl#define ARCMSR_DOORBELL_INT_CLEAR_PATTERN       0xFF00FFF0
319174451Sscottl#define ARCMSR_MESSAGE_INT_CLEAR_PATTERN        0xFF00FFF7
320174451Sscottl
321259565Sdelphij#define ARCMSR_MESSAGE_GET_CONFIG		0x00010008	/* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */
322259565Sdelphij#define ARCMSR_MESSAGE_SET_CONFIG		0x00020008	/* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */
323259565Sdelphij#define ARCMSR_MESSAGE_ABORT_CMD		0x00030008	/* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */
324259565Sdelphij#define ARCMSR_MESSAGE_STOP_BGRB		0x00040008	/* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */
325174451Sscottl#define ARCMSR_MESSAGE_FLUSH_CACHE              0x00050008	/* (ARCMSR_INBOUND_MESG0_FLUSH_CACHE<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */
326259565Sdelphij#define ARCMSR_MESSAGE_START_BGRB		0x00060008	/* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */
327259565Sdelphij#define ARCMSR_MESSAGE_START_DRIVER_MODE	0x000E0008
328259565Sdelphij#define ARCMSR_MESSAGE_SET_POST_WINDOW		0x000F0008
329259565Sdelphij#define ARCMSR_MESSAGE_ACTIVE_EOI_MODE		0x00100008
330259565Sdelphij#define ARCMSR_MESSAGE_FIRMWARE_OK		0x80000000	/* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */
331174451Sscottl
332174451Sscottl#define ARCMSR_DRV2IOP_DATA_WRITE_OK            0x00000001	/* ioctl transfer */
333174451Sscottl#define ARCMSR_DRV2IOP_DATA_READ_OK             0x00000002	/* ioctl transfer */
334174451Sscottl#define ARCMSR_DRV2IOP_CDB_POSTED               0x00000004
335174451Sscottl#define ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED       0x00000008
336174451Sscottl#define ARCMSR_DRV2IOP_END_OF_INTERRUPT         0x00000010  /*  */
337174451Sscottl
338174451Sscottl/* data tunnel buffer between user space program and its firmware */
339259565Sdelphij#define ARCMSR_MSGCODE_RWBUFFER			0x0000fa00    /* iop msgcode_rwbuffer for message command */
340259565Sdelphij#define ARCMSR_IOCTL_WBUFFER			0x0000fe00    /* user space data to iop 128bytes */
341259565Sdelphij#define ARCMSR_IOCTL_RBUFFER			0x0000ff00    /* iop data to user space 128bytes */
342259565Sdelphij#define ARCMSR_HBB_BASE0_OFFSET			0x00000010
343259565Sdelphij#define ARCMSR_HBB_BASE1_OFFSET			0x00000018
344259565Sdelphij#define ARCMSR_HBB_BASE0_LEN			0x00021000
345259565Sdelphij#define ARCMSR_HBB_BASE1_LEN			0x00010000
346174451Sscottl/*
347210358Sdelphij************************************************************************
348210358Sdelphij**                SPEC. for Areca HBC adapter
349210358Sdelphij************************************************************************
350210358Sdelphij*/
351210358Sdelphij#define ARCMSR_HBC_ISR_THROTTLING_LEVEL                 12
352210358Sdelphij#define ARCMSR_HBC_ISR_MAX_DONE_QUEUE                   20
353210358Sdelphij/* Host Interrupt Mask */
354210358Sdelphij#define ARCMSR_HBCMU_UTILITY_A_ISR_MASK                 0x00000001 /* When clear, the Utility_A interrupt routes to the host.*/
355210358Sdelphij#define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK         0x00000004 /* When clear, the General Outbound Doorbell interrupt routes to the host.*/
356210358Sdelphij#define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK        0x00000008 /* When clear, the Outbound Post List FIFO Not Empty interrupt routes to the host.*/
357210358Sdelphij#define ARCMSR_HBCMU_ALL_INTMASKENABLE                  0x0000000D /* disable all ISR */
358210358Sdelphij/* Host Interrupt Status */
359210358Sdelphij#define ARCMSR_HBCMU_UTILITY_A_ISR                      0x00000001
360210358Sdelphij        /*
361210358Sdelphij        ** Set when the Utility_A Interrupt bit is set in the Outbound Doorbell Register.
362210358Sdelphij        ** It clears by writing a 1 to the Utility_A bit in the Outbound Doorbell Clear Register or through automatic clearing (if enabled).
363210358Sdelphij        */
364210358Sdelphij#define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR              0x00000004
365210358Sdelphij        /*
366210358Sdelphij        ** Set if Outbound Doorbell register bits 30:1 have a non-zero
367210358Sdelphij        ** value. This bit clears only when Outbound Doorbell bits
368210358Sdelphij        ** 30:1 are ALL clear. Only a write to the Outbound Doorbell
369210358Sdelphij        ** Clear register clears bits in the Outbound Doorbell register.
370210358Sdelphij        */
371210358Sdelphij#define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR             0x00000008
372210358Sdelphij        /*
373210358Sdelphij        ** Set whenever the Outbound Post List Producer/Consumer
374210358Sdelphij        ** Register (FIFO) is not empty. It clears when the Outbound
375210358Sdelphij        ** Post List FIFO is empty.
376210358Sdelphij        */
377210358Sdelphij#define ARCMSR_HBCMU_SAS_ALL_INT                        0x00000010
378210358Sdelphij        /*
379210358Sdelphij        ** This bit indicates a SAS interrupt from a source external to
380210358Sdelphij        ** the PCIe core. This bit is not maskable.
381210358Sdelphij        */
382210358Sdelphij/* DoorBell*/
383210358Sdelphij#define ARCMSR_HBCMU_DRV2IOP_DATA_WRITE_OK                      0x00000002/**/
384210358Sdelphij#define ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK                       0x00000004/**/
385210358Sdelphij#define ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE                   0x00000008/*inbound message 0 ready*/
386210358Sdelphij#define ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING               0x00000010/*more than 12 request completed in a time*/
387210358Sdelphij#define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK                      0x00000002/**/
388210358Sdelphij#define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_DOORBELL_CLEAR          0x00000002/*outbound DATA WRITE isr door bell clear*/
389210358Sdelphij#define ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK                       0x00000004/**/
390210358Sdelphij#define ARCMSR_HBCMU_IOP2DRV_DATA_READ_DOORBELL_CLEAR           0x00000004/*outbound DATA READ isr door bell clear*/
391210358Sdelphij#define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE                   0x00000008/*outbound message 0 ready*/
392210358Sdelphij#define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR    0x00000008/*outbound message cmd isr door bell clear*/
393259565Sdelphij#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK		        0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/
394244406Sdelphij#define ARCMSR_HBCMU_RESET_ADAPTER				0x00000024
395259565Sdelphij#define ARCMSR_HBCMU_DiagWrite_ENABLE				0x00000080
396210358Sdelphij
397210358Sdelphij/*
398244406Sdelphij************************************************************************
399244406Sdelphij**                SPEC. for Areca HBD adapter
400244406Sdelphij************************************************************************
401244406Sdelphij*/
402259565Sdelphij#define ARCMSR_HBDMU_CHIP_ID				0x00004
403244406Sdelphij#define ARCMSR_HBDMU_CPU_MEMORY_CONFIGURATION		0x00008
404259565Sdelphij#define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK		0x00034
405259565Sdelphij#define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS		0x00200
406244406Sdelphij#define ARCMSR_HBDMU_PCIE_F0_INTERRUPT_ENABLE		0x0020C
407259565Sdelphij#define ARCMSR_HBDMU_INBOUND_MESSAGE0			0x00400
408259565Sdelphij#define ARCMSR_HBDMU_INBOUND_MESSAGE1			0x00404
409259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_MESSAGE0			0x00420
410259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_MESSAGE1			0x00424
411259565Sdelphij#define ARCMSR_HBDMU_INBOUND_DOORBELL			0x00460
412259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_DOORBELL			0x00480
413244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_ENABLE		0x00484
414259565Sdelphij#define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW		0x01000
415259565Sdelphij#define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH		0x01004
416244406Sdelphij#define ARCMSR_HBDMU_INBOUND_LIST_WRITE_POINTER		0x01018
417259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW		0x01060
418244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_HIGH		0x01064
419244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_LIST_COPY_POINTER		0x0106C
420244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_LIST_READ_POINTER		0x01070
421244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_CAUSE		0x01088
422244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_ENABLE		0x0108C
423244406Sdelphij
424259565Sdelphij#define ARCMSR_HBDMU_MESSAGE_WBUFFER			0x02000
425259565Sdelphij#define ARCMSR_HBDMU_MESSAGE_RBUFFER			0x02100
426259565Sdelphij#define ARCMSR_HBDMU_MESSAGE_RWBUFFER			0x02200
427244406Sdelphij
428259565Sdelphij#define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL		16
429259565Sdelphij#define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE			20
430244406Sdelphij
431244406Sdelphij/* Host Interrupt Mask */
432259565Sdelphij#define ARCMSR_HBDMU_ALL_INT_ENABLE			0x00001010	/* enable all ISR */
433259565Sdelphij#define ARCMSR_HBDMU_ALL_INT_DISABLE			0x00000000	/* disable all ISR */
434244406Sdelphij
435244406Sdelphij/* Host Interrupt Status */
436259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_INT			0x00001010
437259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT		0x00001000
438259565Sdelphij#define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT		0x00000010
439244406Sdelphij
440244406Sdelphij/* DoorBell*/
441259565Sdelphij#define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY		0x00000001
442259565Sdelphij#define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ		0x00000002
443244406Sdelphij
444259565Sdelphij#define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK		0x00000001
445259565Sdelphij#define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK		0x00000002
446244406Sdelphij
447244406Sdelphij/*outbound message 0 ready*/
448244406Sdelphij#define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE		0x02000000
449244406Sdelphij
450259565Sdelphij#define ARCMSR_HBDMU_F0_DOORBELL_CAUSE			0x02000003
451244406Sdelphij
452244406Sdelphij/*outbound message cmd isr door bell clear*/
453244406Sdelphij#define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE_CLEAR	0x02000000
454244406Sdelphij
455244406Sdelphij/*outbound list */
456244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT		0x00000001
457244406Sdelphij#define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT_CLEAR	0x00000001
458244406Sdelphij
459244406Sdelphij/*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/
460259565Sdelphij#define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK		0x80000000
461367508Sdelphij/*
462321064Sdelphij*******************************************************************************
463321064Sdelphij**                SPEC. for Areca HBE adapter
464321064Sdelphij*******************************************************************************
465321064Sdelphij*/
466321064Sdelphij#define ARCMSR_SIGNATURE_1884				0x188417D3
467321064Sdelphij#define ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR		0x00000001
468321064Sdelphij#define ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR		0x00000008
469321064Sdelphij#define ARCMSR_HBEMU_ALL_INTMASKENABLE			0x00000009 /* disable all ISR */
470321064Sdelphij
471321064Sdelphij#define ARCMSR_HBEMU_DRV2IOP_DATA_WRITE_OK		0x00000002
472321064Sdelphij#define ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK		0x00000004
473321064Sdelphij#define ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE		0x00000008 /* inbound message 0 ready */
474321064Sdelphij#define ARCMSR_HBEMU_IOP2DRV_DATA_WRITE_OK		0x00000002
475321064Sdelphij#define ARCMSR_HBEMU_IOP2DRV_DATA_READ_OK		0x00000004
476321064Sdelphij#define ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE		0x00000008 /* outbound message 0 ready */
477321064Sdelphij#define ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK		0x80000000 /* ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK */
478321064Sdelphij/* ARC-1884 doorbell sync */
479321064Sdelphij#define ARCMSR_HBEMU_DOORBELL_SYNC			0x100
480321064Sdelphij#define ARCMSR_ARC188X_RESET_ADAPTER			0x00000004
481244406Sdelphij/*
482367508Sdelphij*******************************************************************************
483367508Sdelphij**                SPEC. for Areca HBF adapter
484367508Sdelphij*******************************************************************************
485367508Sdelphij*/
486367508Sdelphij#define ARCMSR_SIGNATURE_1886				0x188617D3
487367508Sdelphij// Doorbell and interrupt definition are same as Type E adapter
488367508Sdelphij/* ARC-1886 doorbell sync */
489367508Sdelphij#define ARCMSR_HBFMU_DOORBELL_SYNC			0x100
490367508Sdelphij//set host rw buffer physical address at inbound message 0, 1 (low,high)
491367508Sdelphij#define ARCMSR_HBFMU_DOORBELL_SYNC1			0x300
492367508Sdelphij#define ARCMSR_HBFMU_MESSAGE_FIRMWARE_OK		0x80000000
493367508Sdelphij#define ARCMSR_HBFMU_MESSAGE_NO_VOLUME_CHANGE		0x20000000
494367508Sdelphij
495367508Sdelphij/*
496244406Sdelphij*********************************************************************
497367508Sdelphij**     Messaging Unit (MU) of Type A processor
498244406Sdelphij*********************************************************************
499244406Sdelphij*/
500244406Sdelphijstruct HBA_MessageUnit
501244406Sdelphij{
502259565Sdelphij	u_int32_t	resrved0[4];		/*0000 000F*/
503259565Sdelphij	u_int32_t	inbound_msgaddr0;	/*0010 0013*/
504259565Sdelphij	u_int32_t	inbound_msgaddr1;	/*0014 0017*/
505259565Sdelphij	u_int32_t	outbound_msgaddr0;	/*0018 001B*/
506259565Sdelphij	u_int32_t	outbound_msgaddr1;	/*001C 001F*/
507259565Sdelphij	u_int32_t	inbound_doorbell;	/*0020 0023*/
508259565Sdelphij	u_int32_t	inbound_intstatus;	/*0024 0027*/
509259565Sdelphij	u_int32_t	inbound_intmask;	/*0028 002B*/
510259565Sdelphij	u_int32_t	outbound_doorbell;	/*002C 002F*/
511259565Sdelphij	u_int32_t	outbound_intstatus;	/*0030 0033*/
512259565Sdelphij	u_int32_t	outbound_intmask;	/*0034 0037*/
513259565Sdelphij	u_int32_t	reserved1[2];		/*0038 003F*/
514259565Sdelphij	u_int32_t	inbound_queueport;	/*0040 0043*/
515259565Sdelphij	u_int32_t	outbound_queueport;	/*0044 0047*/
516259565Sdelphij	u_int32_t	reserved2[2];		/*0048 004F*/
517259565Sdelphij	u_int32_t	reserved3[492];		/*0050 07FF ......local_buffer 492*/
518259565Sdelphij	u_int32_t	reserved4[128];		/*0800 09FF                    128*/
519259565Sdelphij	u_int32_t	msgcode_rwbuffer[256];	/*0a00 0DFF                    256*/
520259565Sdelphij	u_int32_t	message_wbuffer[32];	/*0E00 0E7F                     32*/
521259565Sdelphij	u_int32_t	reserved5[32];		/*0E80 0EFF                     32*/
522259565Sdelphij	u_int32_t	message_rbuffer[32];	/*0F00 0F7F                     32*/
523259565Sdelphij	u_int32_t	reserved6[32];		/*0F80 0FFF                     32*/
524244406Sdelphij};
525244406Sdelphij/*
526244406Sdelphij*********************************************************************
527244406Sdelphij**
528244406Sdelphij*********************************************************************
529244406Sdelphij*/
530291641Sdelphijstruct HBB_DOORBELL_1203
531291641Sdelphij{
532291641Sdelphij	u_int8_t	doorbell_reserved[ARCMSR_IOP2DRV_DOORBELL_1203]; /*reserved */
533291641Sdelphij	u_int32_t	iop2drv_doorbell;          /*offset 0x00021870:00,01,02,03: window of "instruction flags" from iop to driver */
534291641Sdelphij	u_int32_t	iop2drv_doorbell_mask;     /*                  04,05,06,07: doorbell mask */
535291641Sdelphij	u_int32_t	drv2iop_doorbell;          /*                  08,09,10,11: window of "instruction flags" from driver to iop */
536291641Sdelphij	u_int32_t	drv2iop_doorbell_mask;     /*                  12,13,14,15: doorbell mask */
537291641Sdelphij};
538244406Sdelphijstruct HBB_DOORBELL
539244406Sdelphij{
540259565Sdelphij	u_int8_t	doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */
541259565Sdelphij	u_int32_t	drv2iop_doorbell;          /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */
542259565Sdelphij	u_int32_t	drv2iop_doorbell_mask;     /*                  04,05,06,07: doorbell mask */
543259565Sdelphij	u_int32_t	iop2drv_doorbell;          /*                  08,09,10,11: window of "instruction flags" from iop to driver */
544259565Sdelphij	u_int32_t	iop2drv_doorbell_mask;     /*                  12,13,14,15: doorbell mask */
545244406Sdelphij};
546244406Sdelphij/*
547244406Sdelphij*********************************************************************
548244406Sdelphij**
549244406Sdelphij*********************************************************************
550244406Sdelphij*/
551244406Sdelphijstruct HBB_RWBUFFER
552244406Sdelphij{
553259565Sdelphij	u_int8_t	message_reserved0[ARCMSR_MSGCODE_RWBUFFER];   /*reserved */
554259565Sdelphij	u_int32_t	msgcode_rwbuffer[256];      /*offset 0x0000fa00:   0,   1,   2,   3,...,1023: message code read write 1024bytes */
555259565Sdelphij	u_int32_t	message_wbuffer[32];        /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */
556259565Sdelphij	u_int32_t	message_reserved1[32];      /*                  1152,1153,1154,1155,...,1279: message reserved*/
557259565Sdelphij	u_int32_t	message_rbuffer[32];        /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */
558244406Sdelphij};
559244406Sdelphij/*
560244406Sdelphij*********************************************************************
561367508Sdelphij**      Messaging Unit (MU) of Type B processor(MARVEL)
562244406Sdelphij*********************************************************************
563244406Sdelphij*/
564244406Sdelphijstruct HBB_MessageUnit
565244406Sdelphij{
566259565Sdelphij	u_int32_t		post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];       /* post queue buffer for iop */
567259565Sdelphij	u_int32_t		done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE];       /* done queue buffer for iop */
568259565Sdelphij	int32_t			postq_index;                                  /* post queue index */
569259565Sdelphij	int32_t			doneq_index;								   /* done queue index */
570244406Sdelphij	struct HBB_DOORBELL    *hbb_doorbell;
571244406Sdelphij	struct HBB_RWBUFFER    *hbb_rwbuffer;
572291641Sdelphij	bus_size_t		drv2iop_doorbell;          /* window of "instruction flags" from driver to iop */
573291641Sdelphij	bus_size_t		drv2iop_doorbell_mask;     /* doorbell mask */
574291641Sdelphij	bus_size_t		iop2drv_doorbell;          /* window of "instruction flags" from iop to driver */
575291641Sdelphij	bus_size_t		iop2drv_doorbell_mask;     /* doorbell mask */
576244406Sdelphij};
577244406Sdelphij
578244406Sdelphij/*
579244406Sdelphij*********************************************************************
580367508Sdelphij**      Messaging Unit (MU) of Type C processor(LSI)
581244406Sdelphij*********************************************************************
582244406Sdelphij*/
583244406Sdelphijstruct HBC_MessageUnit {
584244406Sdelphij	u_int32_t	message_unit_status;                        /*0000 0003*/
585244406Sdelphij	u_int32_t	slave_error_attribute;	                    /*0004 0007*/
586244406Sdelphij	u_int32_t	slave_error_address;	                    /*0008 000B*/
587259565Sdelphij	u_int32_t	posted_outbound_doorbell;	            /*000C 000F*/
588244406Sdelphij	u_int32_t	master_error_attribute;	                    /*0010 0013*/
589259565Sdelphij	u_int32_t	master_error_address_low;	            /*0014 0017*/
590259565Sdelphij	u_int32_t	master_error_address_high;	            /*0018 001B*/
591244406Sdelphij	u_int32_t	hcb_size;                                   /*001C 001F size of the PCIe window used for HCB_Mode accesses*/
592259565Sdelphij	u_int32_t	inbound_doorbell;	                    /*0020 0023*/
593259565Sdelphij	u_int32_t	diagnostic_rw_data;	                    /*0024 0027*/
594259565Sdelphij	u_int32_t	diagnostic_rw_address_low;	            /*0028 002B*/
595259565Sdelphij	u_int32_t	diagnostic_rw_address_high;	            /*002C 002F*/
596259565Sdelphij	u_int32_t	host_int_status;	                    /*0030 0033 host interrupt status*/
597259565Sdelphij	u_int32_t	host_int_mask;     	                    /*0034 0037 host interrupt mask*/
598259565Sdelphij	u_int32_t	dcr_data;	                            /*0038 003B*/
599259565Sdelphij	u_int32_t	dcr_address;                                /*003C 003F*/
600259565Sdelphij	u_int32_t	inbound_queueport;                          /*0040 0043 port32 host inbound queue port*/
601259565Sdelphij	u_int32_t	outbound_queueport;                         /*0044 0047 port32 host outbound queue port*/
602259565Sdelphij	u_int32_t	hcb_pci_address_low;                        /*0048 004B*/
603259565Sdelphij	u_int32_t	hcb_pci_address_high;                       /*004C 004F*/
604259565Sdelphij	u_int32_t	iop_int_status;                             /*0050 0053*/
605259565Sdelphij	u_int32_t	iop_int_mask;                               /*0054 0057*/
606259565Sdelphij	u_int32_t	iop_inbound_queue_port;                     /*0058 005B*/
607259565Sdelphij	u_int32_t	iop_outbound_queue_port;                    /*005C 005F*/
608259565Sdelphij	u_int32_t	inbound_free_list_index;                    /*0060 0063 inbound free list producer consumer index*/
609259565Sdelphij	u_int32_t	inbound_post_list_index;                    /*0064 0067 inbound post list producer consumer index*/
610259565Sdelphij	u_int32_t	outbound_free_list_index;                   /*0068 006B outbound free list producer consumer index*/
611259565Sdelphij	u_int32_t	outbound_post_list_index;                   /*006C 006F outbound post list producer consumer index*/
612259565Sdelphij	u_int32_t	inbound_doorbell_clear;                     /*0070 0073*/
613259565Sdelphij	u_int32_t	i2o_message_unit_control;                   /*0074 0077*/
614259565Sdelphij	u_int32_t	last_used_message_source_address_low;       /*0078 007B*/
615259565Sdelphij	u_int32_t	last_used_message_source_address_high;	    /*007C 007F*/
616259565Sdelphij	u_int32_t	pull_mode_data_byte_count[4];               /*0080 008F pull mode data byte count0..count7*/
617259565Sdelphij	u_int32_t	message_dest_address_index;                 /*0090 0093*/
618259565Sdelphij	u_int32_t	done_queue_not_empty_int_counter_timer;     /*0094 0097*/
619259565Sdelphij	u_int32_t	utility_A_int_counter_timer;                /*0098 009B*/
620259565Sdelphij	u_int32_t	outbound_doorbell;                          /*009C 009F*/
621259565Sdelphij	u_int32_t	outbound_doorbell_clear;                    /*00A0 00A3*/
622259565Sdelphij	u_int32_t	message_source_address_index;               /*00A4 00A7 message accelerator source address consumer producer index*/
623259565Sdelphij	u_int32_t	message_done_queue_index;                   /*00A8 00AB message accelerator completion queue consumer producer index*/
624259565Sdelphij	u_int32_t	reserved0;                                  /*00AC 00AF*/
625259565Sdelphij	u_int32_t	inbound_msgaddr0;                           /*00B0 00B3 scratchpad0*/
626259565Sdelphij	u_int32_t	inbound_msgaddr1;                           /*00B4 00B7 scratchpad1*/
627259565Sdelphij	u_int32_t	outbound_msgaddr0;                          /*00B8 00BB scratchpad2*/
628259565Sdelphij	u_int32_t	outbound_msgaddr1;                          /*00BC 00BF scratchpad3*/
629259565Sdelphij	u_int32_t	inbound_queueport_low;                      /*00C0 00C3 port64 host inbound queue port low*/
630259565Sdelphij	u_int32_t	inbound_queueport_high;                     /*00C4 00C7 port64 host inbound queue port high*/
631259565Sdelphij	u_int32_t	outbound_queueport_low;                     /*00C8 00CB port64 host outbound queue port low*/
632259565Sdelphij	u_int32_t	outbound_queueport_high;                    /*00CC 00CF port64 host outbound queue port high*/
633259565Sdelphij	u_int32_t	iop_inbound_queue_port_low;                 /*00D0 00D3*/
634259565Sdelphij	u_int32_t	iop_inbound_queue_port_high;                /*00D4 00D7*/
635259565Sdelphij	u_int32_t	iop_outbound_queue_port_low;                /*00D8 00DB*/
636259565Sdelphij	u_int32_t	iop_outbound_queue_port_high;               /*00DC 00DF*/
637259565Sdelphij	u_int32_t	message_dest_queue_port_low;                /*00E0 00E3 message accelerator destination queue port low*/
638259565Sdelphij	u_int32_t	message_dest_queue_port_high;               /*00E4 00E7 message accelerator destination queue port high*/
639259565Sdelphij	u_int32_t	last_used_message_dest_address_low;         /*00E8 00EB last used message accelerator destination address low*/
640259565Sdelphij	u_int32_t	last_used_message_dest_address_high;        /*00EC 00EF last used message accelerator destination address high*/
641259565Sdelphij	u_int32_t	message_done_queue_base_address_low;        /*00F0 00F3 message accelerator completion queue base address low*/
642259565Sdelphij	u_int32_t	message_done_queue_base_address_high;       /*00F4 00F7 message accelerator completion queue base address high*/
643259565Sdelphij	u_int32_t	host_diagnostic;                            /*00F8 00FB*/
644259565Sdelphij	u_int32_t	write_sequence;                             /*00FC 00FF*/
645259565Sdelphij	u_int32_t	reserved1[34];                              /*0100 0187*/
646259565Sdelphij	u_int32_t	reserved2[1950];                            /*0188 1FFF*/
647259565Sdelphij	u_int32_t	message_wbuffer[32];                        /*2000 207F*/
648259565Sdelphij	u_int32_t	reserved3[32];                              /*2080 20FF*/
649259565Sdelphij	u_int32_t	message_rbuffer[32];                        /*2100 217F*/
650259565Sdelphij	u_int32_t	reserved4[32];                              /*2180 21FF*/
651259565Sdelphij	u_int32_t	msgcode_rwbuffer[256];                      /*2200 23FF*/
652244406Sdelphij};
653244406Sdelphij/*
654244406Sdelphij*********************************************************************
655367508Sdelphij**      Messaging Unit (MU) of Type D processor
656244406Sdelphij*********************************************************************
657244406Sdelphij*/
658244406Sdelphijstruct InBound_SRB {
659244406Sdelphij	uint32_t addressLow; //pointer to SRB block
660244406Sdelphij	uint32_t addressHigh;
661244406Sdelphij	uint32_t length; // in DWORDs
662244406Sdelphij	uint32_t reserved0;
663244406Sdelphij};
664244406Sdelphij
665244406Sdelphijstruct OutBound_SRB {
666244406Sdelphij	uint32_t addressLow; //pointer to SRB block
667244406Sdelphij	uint32_t addressHigh;
668244406Sdelphij};
669244406Sdelphij
670244406Sdelphijstruct HBD_MessageUnit {
671244406Sdelphij	uint32_t reserved0;
672244406Sdelphij	uint32_t chip_id;			//0x0004
673259565Sdelphij	uint32_t cpu_mem_config;		//0x0008
674259565Sdelphij	uint32_t reserved1[10];			//0x000C
675244406Sdelphij	uint32_t i2o_host_interrupt_mask;	//0x0034
676259565Sdelphij	uint32_t reserved2[114];		//0x0038
677259565Sdelphij	uint32_t host_int_status;		//0x0200
678259565Sdelphij	uint32_t host_int_enable;		//0x0204
679259565Sdelphij	uint32_t reserved3[1];			//0x0208
680259565Sdelphij	uint32_t pcief0_int_enable;		//0x020C
681259565Sdelphij	uint32_t reserved4[124];		//0x0210
682259565Sdelphij	uint32_t inbound_msgaddr0;		//0x0400
683259565Sdelphij	uint32_t inbound_msgaddr1;		//0x0404
684259565Sdelphij	uint32_t reserved5[6];			//0x0408
685259565Sdelphij	uint32_t outbound_msgaddr0;		//0x0420
686259565Sdelphij	uint32_t outbound_msgaddr1;		//0x0424
687259565Sdelphij	uint32_t reserved6[14];			//0x0428
688259565Sdelphij	uint32_t inbound_doorbell;		//0x0460
689259565Sdelphij	uint32_t reserved7[7];			//0x0464
690259565Sdelphij	uint32_t outbound_doorbell;		//0x0480
691244406Sdelphij	uint32_t outbound_doorbell_enable;	//0x0484
692244406Sdelphij	uint32_t reserved8[734];		//0x0488
693259565Sdelphij	uint32_t inboundlist_base_low;		//0x1000
694259565Sdelphij	uint32_t inboundlist_base_high;		//0x1004
695259565Sdelphij	uint32_t reserved9[4];			//0x1008
696244406Sdelphij	uint32_t inboundlist_write_pointer;	//0x1018
697244406Sdelphij	uint32_t inboundlist_read_pointer;	//0x101C
698244406Sdelphij	uint32_t reserved10[16];		//0x1020
699259565Sdelphij	uint32_t outboundlist_base_low;		//0x1060
700244406Sdelphij	uint32_t outboundlist_base_high;	//0x1064
701259565Sdelphij	uint32_t reserved11;			//0x1068
702244406Sdelphij	uint32_t outboundlist_copy_pointer;	//0x106C
703244406Sdelphij	uint32_t outboundlist_read_pointer;	//0x1070 0x1072
704259565Sdelphij	uint32_t reserved12[5];			//0x1074
705244406Sdelphij	uint32_t outboundlist_interrupt_cause;	//0x1088
706244406Sdelphij	uint32_t outboundlist_interrupt_enable;	//0x108C
707244406Sdelphij	uint32_t reserved13[988];		//0x1090
708259565Sdelphij	uint32_t message_wbuffer[32];		//0x2000
709244406Sdelphij	uint32_t reserved14[32];		//0x2080
710259565Sdelphij	uint32_t message_rbuffer[32];		//0x2100
711244406Sdelphij	uint32_t reserved15[32];		//0x2180
712259565Sdelphij	uint32_t msgcode_rwbuffer[256];		//0x2200
713244406Sdelphij};
714244406Sdelphij
715244406Sdelphijstruct HBD_MessageUnit0 {
716244406Sdelphij 	struct InBound_SRB post_qbuffer[ARCMSR_MAX_HBD_POSTQUEUE];
717244406Sdelphij   	struct OutBound_SRB done_qbuffer[ARCMSR_MAX_HBD_POSTQUEUE+1];
718244406Sdelphij	uint16_t postq_index;
719244406Sdelphij	uint16_t doneq_index;
720244406Sdelphij	struct HBD_MessageUnit	*phbdmu;
721244406Sdelphij};
722321064Sdelphij/*
723321064Sdelphij*********************************************************************
724367508Sdelphij**      Messaging Unit (MU) of Type E processor(LSI)
725321064Sdelphij*********************************************************************
726321064Sdelphij*/
727321064Sdelphijstruct HBE_MessageUnit {
728321064Sdelphij	u_int32_t	iobound_doorbell;                           /*0000 0003*/
729321064Sdelphij	u_int32_t	write_sequence_3xxx;	                    /*0004 0007*/
730321064Sdelphij	u_int32_t	host_diagnostic_3xxx;	                    /*0008 000B*/
731321064Sdelphij	u_int32_t	posted_outbound_doorbell;	            /*000C 000F*/
732321064Sdelphij	u_int32_t	master_error_attribute;	                    /*0010 0013*/
733321064Sdelphij	u_int32_t	master_error_address_low;	            /*0014 0017*/
734321064Sdelphij	u_int32_t	master_error_address_high;	            /*0018 001B*/
735321064Sdelphij	u_int32_t	hcb_size;                                   /*001C 001F*/
736321064Sdelphij	u_int32_t	inbound_doorbell;	                    /*0020 0023*/
737321064Sdelphij	u_int32_t	diagnostic_rw_data;	                    /*0024 0027*/
738321064Sdelphij	u_int32_t	diagnostic_rw_address_low;	            /*0028 002B*/
739321064Sdelphij	u_int32_t	diagnostic_rw_address_high;	            /*002C 002F*/
740321064Sdelphij	u_int32_t	host_int_status;	                    /*0030 0033 host interrupt status*/
741321064Sdelphij	u_int32_t	host_int_mask;     	                    /*0034 0037 host interrupt mask*/
742321064Sdelphij	u_int32_t	dcr_data;	                            /*0038 003B*/
743321064Sdelphij	u_int32_t	dcr_address;                                /*003C 003F*/
744321064Sdelphij	u_int32_t	inbound_queueport;                          /*0040 0043 port32 host inbound queue port*/
745321064Sdelphij	u_int32_t	outbound_queueport;                         /*0044 0047 port32 host outbound queue port*/
746321064Sdelphij	u_int32_t	hcb_pci_address_low;                        /*0048 004B*/
747321064Sdelphij	u_int32_t	hcb_pci_address_high;                       /*004C 004F*/
748321064Sdelphij	u_int32_t	iop_int_status;                             /*0050 0053*/
749321064Sdelphij	u_int32_t	iop_int_mask;                               /*0054 0057*/
750321064Sdelphij	u_int32_t	iop_inbound_queue_port;                     /*0058 005B*/
751321064Sdelphij	u_int32_t	iop_outbound_queue_port;                    /*005C 005F*/
752321064Sdelphij	u_int32_t	inbound_free_list_index;                    /*0060 0063*/
753321064Sdelphij	u_int32_t	inbound_post_list_index;                    /*0064 0067*/
754321064Sdelphij	u_int32_t	outbound_free_list_index;                   /*0068 006B*/
755321064Sdelphij	u_int32_t	outbound_post_list_index;                   /*006C 006F*/
756321064Sdelphij	u_int32_t	inbound_doorbell_clear;                     /*0070 0073*/
757321064Sdelphij	u_int32_t	i2o_message_unit_control;                   /*0074 0077*/
758321064Sdelphij	u_int32_t	last_used_message_source_address_low;       /*0078 007B*/
759321064Sdelphij	u_int32_t	last_used_message_source_address_high;	    /*007C 007F*/
760321064Sdelphij	u_int32_t	pull_mode_data_byte_count[4];               /*0080 008F*/
761321064Sdelphij	u_int32_t	message_dest_address_index;                 /*0090 0093*/
762321064Sdelphij	u_int32_t	done_queue_not_empty_int_counter_timer;     /*0094 0097*/
763321064Sdelphij	u_int32_t	utility_A_int_counter_timer;                /*0098 009B*/
764321064Sdelphij	u_int32_t	outbound_doorbell;                          /*009C 009F*/
765321064Sdelphij	u_int32_t	outbound_doorbell_clear;                    /*00A0 00A3*/
766321064Sdelphij	u_int32_t	message_source_address_index;               /*00A4 00A7*/
767321064Sdelphij	u_int32_t	message_done_queue_index;                   /*00A8 00AB*/
768321064Sdelphij	u_int32_t	reserved0;                                  /*00AC 00AF*/
769321064Sdelphij	u_int32_t	inbound_msgaddr0;                           /*00B0 00B3 scratchpad0*/
770321064Sdelphij	u_int32_t	inbound_msgaddr1;                           /*00B4 00B7 scratchpad1*/
771321064Sdelphij	u_int32_t	outbound_msgaddr0;                          /*00B8 00BB scratchpad2*/
772321064Sdelphij	u_int32_t	outbound_msgaddr1;                          /*00BC 00BF scratchpad3*/
773321064Sdelphij	u_int32_t	inbound_queueport_low;                      /*00C0 00C3 port64 host inbound queue port low*/
774321064Sdelphij	u_int32_t	inbound_queueport_high;                     /*00C4 00C7 port64 host inbound queue port high*/
775321064Sdelphij	u_int32_t	outbound_queueport_low;                     /*00C8 00CB port64 host outbound queue port low*/
776321064Sdelphij	u_int32_t	outbound_queueport_high;                    /*00CC 00CF port64 host outbound queue port high*/
777321064Sdelphij	u_int32_t	iop_inbound_queue_port_low;                 /*00D0 00D3*/
778321064Sdelphij	u_int32_t	iop_inbound_queue_port_high;                /*00D4 00D7*/
779321064Sdelphij	u_int32_t	iop_outbound_queue_port_low;                /*00D8 00DB*/
780321064Sdelphij	u_int32_t	iop_outbound_queue_port_high;               /*00DC 00DF*/
781321064Sdelphij	u_int32_t	message_dest_queue_port_low;                /*00E0 00E3*/
782321064Sdelphij	u_int32_t	message_dest_queue_port_high;               /*00E4 00E7*/
783321064Sdelphij	u_int32_t	last_used_message_dest_address_low;         /*00E8 00EB*/
784321064Sdelphij	u_int32_t	last_used_message_dest_address_high;        /*00EC 00EF*/
785321064Sdelphij	u_int32_t	message_done_queue_base_address_low;        /*00F0 00F3*/
786321064Sdelphij	u_int32_t	message_done_queue_base_address_high;       /*00F4 00F7*/
787321064Sdelphij	u_int32_t	host_diagnostic;                            /*00F8 00FB*/
788321064Sdelphij	u_int32_t	write_sequence;                             /*00FC 00FF*/
789321064Sdelphij	u_int32_t	reserved1[46];                              /*0100 01B7*/
790321064Sdelphij	u_int32_t	reply_post_producer_index;                  /*01B8 01BB*/
791321064Sdelphij	u_int32_t	reply_post_consumer_index;                  /*01BC 01BF*/
792321064Sdelphij	u_int32_t	reserved2[1936];                            /*01C0 1FFF*/
793321064Sdelphij	u_int32_t	message_wbuffer[32];                        /*2000 207F*/
794321064Sdelphij	u_int32_t	reserved3[32];                              /*2080 20FF*/
795321064Sdelphij	u_int32_t	message_rbuffer[32];                        /*2100 217F*/
796321064Sdelphij	u_int32_t	reserved4[32];                              /*2180 21FF*/
797321064Sdelphij	u_int32_t	msgcode_rwbuffer[256];                      /*2200 23FF*/
798321064Sdelphij};
799244406Sdelphij
800367508Sdelphij/*
801367508Sdelphij*********************************************************************
802367508Sdelphij**      Messaging Unit (MU) of Type F processor(LSI)
803367508Sdelphij*********************************************************************
804367508Sdelphij*/
805367508Sdelphijstruct HBF_MessageUnit {
806367508Sdelphij	u_int32_t	iobound_doorbell;                           /*0000 0003*/
807367508Sdelphij	u_int32_t	write_sequence_3xxx;	                    /*0004 0007*/
808367508Sdelphij	u_int32_t	host_diagnostic_3xxx;	                    /*0008 000B*/
809367508Sdelphij	u_int32_t	posted_outbound_doorbell;	            /*000C 000F*/
810367508Sdelphij	u_int32_t	master_error_attribute;	                    /*0010 0013*/
811367508Sdelphij	u_int32_t	master_error_address_low;	            /*0014 0017*/
812367508Sdelphij	u_int32_t	master_error_address_high;	            /*0018 001B*/
813367508Sdelphij	u_int32_t	hcb_size;                                   /*001C 001F*/
814367508Sdelphij	u_int32_t	inbound_doorbell;	                    /*0020 0023*/
815367508Sdelphij	u_int32_t	diagnostic_rw_data;	                    /*0024 0027*/
816367508Sdelphij	u_int32_t	diagnostic_rw_address_low;	            /*0028 002B*/
817367508Sdelphij	u_int32_t	diagnostic_rw_address_high;	            /*002C 002F*/
818367508Sdelphij	u_int32_t	host_int_status;	                    /*0030 0033 host interrupt status*/
819367508Sdelphij	u_int32_t	host_int_mask;     	                    /*0034 0037 host interrupt mask*/
820367508Sdelphij	u_int32_t	dcr_data;	                            /*0038 003B*/
821367508Sdelphij	u_int32_t	dcr_address;                                /*003C 003F*/
822367508Sdelphij	u_int32_t	inbound_queueport;                          /*0040 0043 port32 host inbound queue port*/
823367508Sdelphij	u_int32_t	outbound_queueport;                         /*0044 0047 port32 host outbound queue port*/
824367508Sdelphij	u_int32_t	hcb_pci_address_low;                        /*0048 004B*/
825367508Sdelphij	u_int32_t	hcb_pci_address_high;                       /*004C 004F*/
826367508Sdelphij	u_int32_t	iop_int_status;                             /*0050 0053*/
827367508Sdelphij	u_int32_t	iop_int_mask;                               /*0054 0057*/
828367508Sdelphij	u_int32_t	iop_inbound_queue_port;                     /*0058 005B*/
829367508Sdelphij	u_int32_t	iop_outbound_queue_port;                    /*005C 005F*/
830367508Sdelphij	u_int32_t	inbound_free_list_index;                    /*0060 0063*/
831367508Sdelphij	u_int32_t	inbound_post_list_index;                    /*0064 0067*/
832367508Sdelphij	u_int32_t	reply_post_producer_index;                  /*0068 006B*/
833367508Sdelphij	u_int32_t	reply_post_consumer_index;                  /*006C 006F*/
834367508Sdelphij	u_int32_t	inbound_doorbell_clear;                     /*0070 0073*/
835367508Sdelphij	u_int32_t	i2o_message_unit_control;                   /*0074 0077*/
836367508Sdelphij	u_int32_t	last_used_message_source_address_low;       /*0078 007B*/
837367508Sdelphij	u_int32_t	last_used_message_source_address_high;	    /*007C 007F*/
838367508Sdelphij	u_int32_t	pull_mode_data_byte_count[4];               /*0080 008F*/
839367508Sdelphij	u_int32_t	message_dest_address_index;                 /*0090 0093*/
840367508Sdelphij	u_int32_t	done_queue_not_empty_int_counter_timer;     /*0094 0097*/
841367508Sdelphij	u_int32_t	utility_A_int_counter_timer;                /*0098 009B*/
842367508Sdelphij	u_int32_t	outbound_doorbell;                          /*009C 009F*/
843367508Sdelphij	u_int32_t	outbound_doorbell_clear;                    /*00A0 00A3*/
844367508Sdelphij	u_int32_t	message_source_address_index;               /*00A4 00A7*/
845367508Sdelphij	u_int32_t	message_done_queue_index;                   /*00A8 00AB*/
846367508Sdelphij	u_int32_t	reserved0;                                  /*00AC 00AF*/
847367508Sdelphij	u_int32_t	inbound_msgaddr0;                           /*00B0 00B3 scratchpad0*/
848367508Sdelphij	u_int32_t	inbound_msgaddr1;                           /*00B4 00B7 scratchpad1*/
849367508Sdelphij	u_int32_t	outbound_msgaddr0;                          /*00B8 00BB scratchpad2*/
850367508Sdelphij	u_int32_t	outbound_msgaddr1;                          /*00BC 00BF scratchpad3*/
851367508Sdelphij	u_int32_t	inbound_queueport_low;                      /*00C0 00C3 port64 host inbound queue port low*/
852367508Sdelphij	u_int32_t	inbound_queueport_high;                     /*00C4 00C7 port64 host inbound queue port high*/
853367508Sdelphij	u_int32_t	outbound_queueport_low;                     /*00C8 00CB port64 host outbound queue port low*/
854367508Sdelphij	u_int32_t	outbound_queueport_high;                    /*00CC 00CF port64 host outbound queue port high*/
855367508Sdelphij	u_int32_t	iop_inbound_queue_port_low;                 /*00D0 00D3*/
856367508Sdelphij	u_int32_t	iop_inbound_queue_port_high;                /*00D4 00D7*/
857367508Sdelphij	u_int32_t	iop_outbound_queue_port_low;                /*00D8 00DB*/
858367508Sdelphij	u_int32_t	iop_outbound_queue_port_high;               /*00DC 00DF*/
859367508Sdelphij	u_int32_t	message_dest_queue_port_low;                /*00E0 00E3*/
860367508Sdelphij	u_int32_t	message_dest_queue_port_high;               /*00E4 00E7*/
861367508Sdelphij	u_int32_t	last_used_message_dest_address_low;         /*00E8 00EB*/
862367508Sdelphij	u_int32_t	last_used_message_dest_address_high;        /*00EC 00EF*/
863367508Sdelphij	u_int32_t	message_done_queue_base_address_low;        /*00F0 00F3*/
864367508Sdelphij	u_int32_t	message_done_queue_base_address_high;       /*00F4 00F7*/
865367508Sdelphij	u_int32_t	host_diagnostic;                            /*00F8 00FB*/
866367508Sdelphij	u_int32_t	write_sequence;                             /*00FC 00FF*/
867367508Sdelphij	u_int32_t	reserved1[46];                              /*0100 01B7*/
868367508Sdelphij	u_int32_t	reply_post_producer_index1;                  /*01B8 01BB*/
869367508Sdelphij	u_int32_t	reply_post_consumer_index1;                  /*01BC 01BF*/
870367508Sdelphij};
871367508Sdelphij
872367508Sdelphij#define	MESG_RW_BUFFER_SIZE	(256 * 3)
873367508Sdelphij
874321064Sdelphijtypedef struct deliver_completeQ {
875321064Sdelphij	u_int16_t	cmdFlag;
876321064Sdelphij	u_int16_t	cmdSMID;
877321064Sdelphij	u_int16_t	cmdLMID;        // reserved (0)
878321064Sdelphij	u_int16_t	cmdFlag2;       // reserved (0)
879321064Sdelphij} DeliverQ, CompletionQ, *pDeliver_Q, *pCompletion_Q;
880321064Sdelphij
881321064Sdelphij#define	COMPLETION_Q_POOL_SIZE	(sizeof(struct deliver_completeQ) * 512 + 128)
882321064Sdelphij
883244406Sdelphij/*
884244406Sdelphij*********************************************************************
885244406Sdelphij**
886244406Sdelphij*********************************************************************
887244406Sdelphij*/
888244406Sdelphijstruct MessageUnit_UNION
889244406Sdelphij{
890244406Sdelphij	union	{
891259565Sdelphij		struct HBA_MessageUnit		hbamu;
892259565Sdelphij		struct HBB_MessageUnit		hbbmu;
893259565Sdelphij        	struct HBC_MessageUnit		hbcmu;
894259565Sdelphij        	struct HBD_MessageUnit0		hbdmu;
895321064Sdelphij        	struct HBE_MessageUnit		hbemu;
896367508Sdelphij        	struct HBF_MessageUnit		hbfmu;
897244406Sdelphij	} muu;
898244406Sdelphij};
899244406Sdelphij/*
900144411Sscottl*************************************************************
901144411Sscottl**   structure for holding DMA address data
902144411Sscottl*************************************************************
903144411Sscottl*/
904259565Sdelphij#define IS_SG64_ADDR	0x01000000 /* bit24 */
905144411Sscottl/*
906144411Sscottl************************************************************************************************
907144411Sscottl**                            ARECA FIRMWARE SPEC
908144411Sscottl************************************************************************************************
909144411Sscottl**		Usage of IOP331 adapter
910144411Sscottl**		(All In/Out is in IOP331's view)
911144411Sscottl**		1. Message 0 --> InitThread message and retrun code
912144411Sscottl**		2. Doorbell is used for RS-232 emulation
913259565Sdelphij**			inDoorBell :    bit0 -- data in ready            (DRIVER DATA WRITE OK)
914259565Sdelphij**					bit1 -- data out has been read   (DRIVER DATA READ OK)
915259565Sdelphij**			outDooeBell:    bit0 -- data out ready           (IOP331 DATA WRITE OK)
916259565Sdelphij**					bit1 -- data in has been read    (IOP331 DATA READ OK)
917144411Sscottl**		3. Index Memory Usage
918144411Sscottl**			offset 0xf00 : for RS232 out (request buffer)
919144411Sscottl**			offset 0xe00 : for RS232 in  (scratch buffer)
920174451Sscottl**			offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331)
921174451Sscottl**			offset 0xa00 : for outbound message code msgcode_rwbuffer (IOP331 send to driver)
922144411Sscottl**		4. RS-232 emulation
923144411Sscottl**			Currently 128 byte buffer is used
924165155Sscottl**			          1st u_int32_t : Data length (1--124)
925144411Sscottl**			        Byte 4--127 : Max 124 bytes of data
926144411Sscottl**		5. PostQ
927144411Sscottl**		All SCSI Command must be sent through postQ:
928144411Sscottl**		(inbound queue port)	Request frame must be 32 bytes aligned
929259565Sdelphij**              	#   bit27--bit31 => flag for post ccb
930259565Sdelphij**			#   bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb
931259565Sdelphij**					bit31 : 0 : 256 bytes frame
932259565Sdelphij**						1 : 512 bytes frame
933259565Sdelphij**					bit30 : 0 : normal request
934259565Sdelphij**						1 : BIOS request
935259565Sdelphij**                                      bit29 : reserved
936259565Sdelphij**                                      bit28 : reserved
937259565Sdelphij**                                      bit27 : reserved
938144411Sscottl**  -------------------------------------------------------------------------------
939144411Sscottl**		(outbount queue port)	Request reply
940259565Sdelphij**              	#   bit27--bit31 => flag for reply
941259565Sdelphij**			#   bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb
942259565Sdelphij**			bit31 : must be 0 (for this type of reply)
943259565Sdelphij**			bit30 : reserved for BIOS handshake
944259565Sdelphij**			bit29 : reserved
945259565Sdelphij**			bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData
946259565Sdelphij**				1 : Error, error code in AdapStatus/DevStatus/SenseData
947259565Sdelphij**			bit27 : reserved
948144411Sscottl**		6. BIOS request
949144411Sscottl**			All BIOS request is the same with request from PostQ
950144411Sscottl**			Except :
951144411Sscottl**				Request frame is sent from configuration space
952259565Sdelphij**					offset: 0x78 : Request Frame (bit30 == 1)
953259565Sdelphij**					offset: 0x18 : writeonly to generate IRQ to IOP331
954144411Sscottl**				Completion of request:
955259565Sdelphij**				        (bit30 == 0, bit28==err flag)
956144411Sscottl**		7. Definition of SGL entry (structure)
957144411Sscottl**		8. Message1 Out - Diag Status Code (????)
958144411Sscottl**		9. Message0 message code :
959144411Sscottl**			0x00 : NOP
960174451Sscottl**			0x01 : Get Config ->offset 0xa00 :for outbound message code msgcode_rwbuffer (IOP331 send to driver)
961259565Sdelphij**					Signature             0x87974060(4)
962259565Sdelphij**					Request len           0x00000200(4)
963259565Sdelphij**					numbers of queue      0x00000100(4)
964259565Sdelphij**					SDRAM Size            0x00000100(4)-->256 MB
965259565Sdelphij**					IDE Channels          0x00000008(4)
966259565Sdelphij**					vendor                40 bytes char
967259565Sdelphij**					model                  8 bytes char
968259565Sdelphij**					FirmVer               16 bytes char
969259565Sdelphij**					Device Map            16 bytes char
970174451Sscottl**
971174451Sscottl**					FirmwareVersion DWORD <== Added for checking of new firmware capability
972174451Sscottl**			0x02 : Set Config ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331)
973259565Sdelphij**					Signature             0x87974063(4)
974259565Sdelphij**					UPPER32 of Request Frame  (4)-->Driver Only
975144411Sscottl**			0x03 : Reset (Abort all queued Command)
976144411Sscottl**			0x04 : Stop Background Activity
977144411Sscottl**			0x05 : Flush Cache
978144411Sscottl**			0x06 : Start Background Activity (re-start if background is halted)
979144411Sscottl**			0x07 : Check If Host Command Pending (Novell May Need This Function)
980174451Sscottl**			0x08 : Set controller time ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver to IOP331)
981259565Sdelphij**					byte 0 : 0xaa <-- signature
982259565Sdelphij**					byte 1 : 0x55 <-- signature
983259565Sdelphij**					byte 2 : year (04)
984259565Sdelphij**					byte 3 : month (1..12)
985259565Sdelphij**					byte 4 : date (1..31)
986259565Sdelphij**					byte 5 : hour (0..23)
987259565Sdelphij**					byte 6 : minute (0..59)
988259565Sdelphij**					byte 7 : second (0..59)
989210358Sdelphij**      *********************************************************************************
990210358Sdelphij**      Porting Of LSI2108/2116 Based PCIE SAS/6G host raid adapter
991210358Sdelphij**      ==> Difference from IOP348
992210358Sdelphij**      <1> Message Register 0,1 (the same usage) Init Thread message and retrun code
993210358Sdelphij**           Inbound Message 0  (inbound_msgaddr0) : at offset 0xB0 (Scratchpad0) for inbound message code msgcode_rwbuffer (driver send to IOP)
994210358Sdelphij**           Inbound Message 1  (inbound_msgaddr1) : at offset 0xB4 (Scratchpad1) Out.... Diag Status Code
995210358Sdelphij**           Outbound Message 0 (outbound_msgaddr0): at offset 0xB8 (Scratchpad3) Out.... Diag Status Code
996210358Sdelphij**           Outbound Message 1 (outbound_msgaddr1): at offset 0xBC (Scratchpad2) for outbound message code msgcode_rwbuffer (IOP send to driver)
997210358Sdelphij**           <A> use doorbell to generate interrupt
998210358Sdelphij**
999210358Sdelphij**               inbound doorbell: bit3 --  inbound message 0 ready (driver to iop)
1000210358Sdelphij**              outbound doorbell: bit3 -- outbound message 0 ready (iop to driver)
1001210358Sdelphij**
1002210358Sdelphij**		        a. Message1: Out - Diag Status Code (????)
1003210358Sdelphij**
1004210358Sdelphij**		        b. Message0: message code
1005210358Sdelphij**		        	    0x00 : NOP
1006210358Sdelphij**		        	    0x01 : Get Config ->offset 0xB8 :for outbound message code msgcode_rwbuffer (IOP send to driver)
1007259565Sdelphij**		        	    			Signature             0x87974060(4)
1008259565Sdelphij**		        	    			Request len           0x00000200(4)
1009259565Sdelphij**		        	    			numbers of queue      0x00000100(4)
1010259565Sdelphij**		        	    			SDRAM Size            0x00000100(4)-->256 MB
1011259565Sdelphij**		        	    			IDE Channels          0x00000008(4)
1012259565Sdelphij**		        	    			vendor                40 bytes char
1013259565Sdelphij**		        	    			model                  8 bytes char
1014259565Sdelphij**		        	    			FirmVer               16 bytes char
1015259565Sdelphij**                                         Device Map            16 bytes char
1016259565Sdelphij**                                         cfgVersion    ULONG <== Added for checking of new firmware capability
1017210358Sdelphij**		        	    0x02 : Set Config ->offset 0xB0 :for inbound message code msgcode_rwbuffer (driver send to IOP)
1018259565Sdelphij**		        	    			Signature             0x87974063(4)
1019259565Sdelphij**		        	    			UPPER32 of Request Frame  (4)-->Driver Only
1020210358Sdelphij**		        	    0x03 : Reset (Abort all queued Command)
1021210358Sdelphij**		        	    0x04 : Stop Background Activity
1022210358Sdelphij**		        	    0x05 : Flush Cache
1023210358Sdelphij**		        	    0x06 : Start Background Activity (re-start if background is halted)
1024210358Sdelphij**		        	    0x07 : Check If Host Command Pending (Novell May Need This Function)
1025210358Sdelphij**		        	    0x08 : Set controller time ->offset 0xB0 : for inbound message code msgcode_rwbuffer (driver to IOP)
1026259565Sdelphij**		        	            		byte 0 : 0xaa <-- signature
1027259565Sdelphij**                                      		byte 1 : 0x55 <-- signature
1028259565Sdelphij**		        	            		byte 2 : year (04)
1029259565Sdelphij**		        	            		byte 3 : month (1..12)
1030259565Sdelphij**		        	            		byte 4 : date (1..31)
1031259565Sdelphij**		        	            		byte 5 : hour (0..23)
1032259565Sdelphij**		        	            		byte 6 : minute (0..59)
1033259565Sdelphij**		        	            		byte 7 : second (0..59)
1034210358Sdelphij**
1035210358Sdelphij**      <2> Doorbell Register is used for RS-232 emulation
1036210358Sdelphij**           <A> different clear register
1037210358Sdelphij**           <B> different bit0 definition (bit0 is reserved)
1038210358Sdelphij**
1039210358Sdelphij**           inbound doorbell        : at offset 0x20
1040210358Sdelphij**           inbound doorbell clear  : at offset 0x70
1041210358Sdelphij**
1042210358Sdelphij**           inbound doorbell        : bit0 -- reserved
1043210358Sdelphij**                                     bit1 -- data in ready             (DRIVER DATA WRITE OK)
1044210358Sdelphij**                                     bit2 -- data out has been read    (DRIVER DATA READ OK)
1045210358Sdelphij**                                     bit3 -- inbound message 0 ready
1046210358Sdelphij**                                     bit4 -- more than 12 request completed in a time
1047210358Sdelphij**
1048210358Sdelphij**           outbound doorbell       : at offset 0x9C
1049210358Sdelphij**           outbound doorbell clear : at offset 0xA0
1050210358Sdelphij**
1051210358Sdelphij**           outbound doorbell       : bit0 -- reserved
1052210358Sdelphij**                                     bit1 -- data out ready            (IOP DATA WRITE OK)
1053210358Sdelphij**                                     bit2 -- data in has been read     (IOP DATA READ OK)
1054210358Sdelphij**                                     bit3 -- outbound message 0 ready
1055210358Sdelphij**
1056210358Sdelphij**      <3> Index Memory Usage (Buffer Area)
1057210358Sdelphij**           COMPORT_IN     at  0x2000: message_wbuffer  --  128 bytes (to be sent to ROC) : for RS232 in  (scratch buffer)
1058210358Sdelphij**           COMPORT_OUT    at  0x2100: message_rbuffer  --  128 bytes (to be sent to host): for RS232 out (request buffer)
1059210358Sdelphij**           BIOS_CFG_AREA  at  0x2200: msgcode_rwbuffer -- 1024 bytes for outbound message code msgcode_rwbuffer (IOP send to driver)
1060210358Sdelphij**           BIOS_CFG_AREA  at  0x2200: msgcode_rwbuffer -- 1024 bytes for  inbound message code msgcode_rwbuffer (driver send to IOP)
1061210358Sdelphij**
1062210358Sdelphij**      <4> PostQ (Command Post Address)
1063210358Sdelphij**          All SCSI Command must be sent through postQ:
1064210358Sdelphij**              inbound  queue port32 at offset 0x40 , 0x41, 0x42, 0x43
1065210358Sdelphij**              inbound  queue port64 at offset 0xC0 (lower)/0xC4 (upper)
1066210358Sdelphij**              outbound queue port32 at offset 0x44
1067210358Sdelphij**              outbound queue port64 at offset 0xC8 (lower)/0xCC (upper)
1068210358Sdelphij**              <A> For 32bit queue, access low part is enough to send/receive request
1069210358Sdelphij**                  i.e. write 0x40/0xC0, ROC will get the request with high part == 0, the
1070210358Sdelphij**                  same for outbound queue port
1071210358Sdelphij**              <B> For 64bit queue, if 64bit instruction is supported, use 64bit instruction
1072210358Sdelphij**                  to post inbound request in a single instruction, and use 64bit instruction
1073210358Sdelphij**                  to retrieve outbound request in a single instruction.
1074210358Sdelphij**                  If in 32bit environment, when sending inbound queue, write high part first
1075210358Sdelphij**                  then write low part. For receiving outbound request, read high part first
1076210358Sdelphij**                  then low part, to check queue empty, ONLY check high part to be 0xFFFFFFFF.
1077210358Sdelphij**                  If high part is 0xFFFFFFFF, DO NOT read low part, this may corrupt the
1078210358Sdelphij**                  consistency of the FIFO. Another way to check empty is to check status flag
1079210358Sdelphij**                  at 0x30 bit3.
1080210358Sdelphij**              <C> Post Address IS NOT shifted (must be 16 bytes aligned)
1081210358Sdelphij**                  For   BIOS, 16bytes aligned   is OK
1082210358Sdelphij**                  For Driver, 32bytes alignment is recommended.
1083210358Sdelphij**                  POST Command bit0 to bit3 is defined differently
1084210358Sdelphij**                  ----------------------------
1085210358Sdelphij**                  bit0:1 for PULL mode (must be 1)
1086210358Sdelphij**                  ----------------------------
1087210358Sdelphij**                  bit3/2/1: for arcmsr cdb size (arccdbsize)
1088210358Sdelphij**                      000: <= 0x0080 (128)
1089210358Sdelphij**                      001: <= 0x0100 (256)
1090210358Sdelphij**                      010: <= 0x0180 (384)
1091210358Sdelphij**                      011: <= 0x0200 (512)
1092210358Sdelphij**                      100: <= 0x0280 (640)
1093210358Sdelphij**                      101: <= 0x0300 (768)
1094210358Sdelphij**                      110: <= 0x0300 (reserved)
1095210358Sdelphij**                      111: <= 0x0300 (reserved)
1096210358Sdelphij**                  -----------------------------
1097210358Sdelphij**                  if len > 0x300 the len always set as 0x300
1098210358Sdelphij**                  -----------------------------
1099210358Sdelphij**                  post addr = addr | ((len-1) >> 6) | 1
1100210358Sdelphij**                  -----------------------------
1101210358Sdelphij**                  page length in command buffer still required,
1102210358Sdelphij**
1103210358Sdelphij**                  if page length > 3,
1104210358Sdelphij**                     firmware will assume more request data need to be retrieved
1105210358Sdelphij**
1106210358Sdelphij**              <D> Outbound Posting
1107210358Sdelphij**                  bit0:0 , no error, 1 with error, refer to status buffer
1108210358Sdelphij**                  bit1:0 , reserved (will be 0)
1109210358Sdelphij**                  bit2:0 , reserved (will be 0)
1110210358Sdelphij**                  bit3:0 , reserved (will be 0)
1111210358Sdelphij**                  bit63-4: Completed command address
1112210358Sdelphij**
1113210358Sdelphij**              <E> BIOS support, no special support is required.
1114210358Sdelphij**                  LSI2108 support I/O register
1115210358Sdelphij**                  All driver functionality is supported through I/O address
1116210358Sdelphij**
1117144411Sscottl************************************************************************************************
1118144411Sscottl*/
1119144411Sscottl/*
1120165155Sscottl**********************************
1121165155Sscottl**
1122165155Sscottl**********************************
1123165155Sscottl*/
1124165155Sscottl/* size 8 bytes */
1125210358Sdelphij/* 32bit Scatter-Gather list */
1126259565Sdelphijstruct SG32ENTRY {                 /* length bit 24 == 0 */
1127259565Sdelphij	u_int32_t	length;    /* high 8 bit == flag,low 24 bit == length */
1128259565Sdelphij	u_int32_t	address;
1129165155Sscottl};
1130165155Sscottl/* size 12 bytes */
1131210358Sdelphij/* 64bit Scatter-Gather list */
1132259565Sdelphijstruct SG64ENTRY {                 /* length bit 24 == 1 */
1133259565Sdelphij  	u_int32_t       length;    /* high 8 bit == flag,low 24 bit == length */
1134259565Sdelphij   	u_int32_t       address;
1135259565Sdelphij   	u_int32_t       addresshigh;
1136165155Sscottl};
1137165155Sscottlstruct SGENTRY_UNION {
1138165155Sscottl	union {
1139259565Sdelphij  		struct SG32ENTRY	sg32entry;   /* 30h   Scatter gather address  */
1140259565Sdelphij  		struct SG64ENTRY	sg64entry;   /* 30h */
1141165155Sscottl	}u;
1142165155Sscottl};
1143165155Sscottl/*
1144165155Sscottl**********************************
1145165155Sscottl**
1146165155Sscottl**********************************
1147165155Sscottl*/
1148165155Sscottlstruct QBUFFER {
1149165155Sscottl	u_int32_t     data_len;
1150259565Sdelphij	u_int8_t      data[124];
1151165155Sscottl};
1152165155Sscottl/*
1153244406Sdelphij**********************************
1154244406Sdelphij*/
1155244406Sdelphijtypedef struct PHYS_ADDR64 {
1156259565Sdelphij	u_int32_t	phyadd_low;
1157259565Sdelphij	u_int32_t	phyadd_high;
1158244406Sdelphij}PHYSADDR64;
1159244406Sdelphij/*
1160144411Sscottl************************************************************************************************
1161165155Sscottl**      FIRMWARE INFO
1162165155Sscottl************************************************************************************************
1163165155Sscottl*/
1164210358Sdelphij#define	ARCMSR_FW_MODEL_OFFSET		15
1165210358Sdelphij#define	ARCMSR_FW_VERS_OFFSET		17
1166210358Sdelphij#define	ARCMSR_FW_DEVMAP_OFFSET		21
1167210358Sdelphij#define	ARCMSR_FW_CFGVER_OFFSET		25
1168210358Sdelphij
1169165155Sscottlstruct FIRMWARE_INFO {
1170215234Sdelphij	u_int32_t      signature;           /*0,00-03*/
1171215234Sdelphij	u_int32_t      request_len;         /*1,04-07*/
1172215234Sdelphij	u_int32_t      numbers_queue;       /*2,08-11*/
1173215234Sdelphij	u_int32_t      sdram_size;          /*3,12-15*/
1174215234Sdelphij	u_int32_t      ide_channels;        /*4,16-19*/
1175215234Sdelphij	char           vendor[40];          /*5,20-59*/
1176215234Sdelphij	char           model[8];            /*15,60-67*/
1177259565Sdelphij	char           firmware_ver[16];    /*17,68-83*/
1178215234Sdelphij	char           device_map[16];      /*21,84-99*/
1179259565Sdelphij	u_int32_t      cfgVersion;          /*25,100-103 Added for checking of new firmware capability*/
1180259565Sdelphij	char           cfgSerial[16];       /*26,104-119*/
1181259565Sdelphij	u_int32_t      cfgPicStatus;        /*30,120-123*/
1182165155Sscottl};
1183210358Sdelphij/*   (A) For cfgVersion in FIRMWARE_INFO
1184210358Sdelphij**        if low BYTE (byte#0) >= 3 (version 3)
1185210358Sdelphij**        then byte#1 report the capability of the firmware can xfer in a single request
1186210358Sdelphij**
1187210358Sdelphij**        byte#1
1188210358Sdelphij**        0         256K
1189210358Sdelphij**        1         512K
1190210358Sdelphij**        2         1M
1191210358Sdelphij**        3         2M
1192210358Sdelphij**        4         4M
1193210358Sdelphij**        5         8M
1194210358Sdelphij**        6         16M
1195210358Sdelphij**    (B) Byte offset 7 (Reserved1) of CDB is changed to msgPages
1196210358Sdelphij**        Driver support new xfer method need to set this field to indicate
1197210358Sdelphij**        large CDB block in 0x100 unit (we use 0x100 byte as one page)
1198210358Sdelphij**        e.g. If the length of CDB including MSG header and SGL is 0x1508
1199210358Sdelphij**        driver need to set the msgPages to 0x16
1200210358Sdelphij**    (C) REQ_LEN_512BYTE must be used also to indicate SRB length
1201210358Sdelphij**        e.g. CDB len      msgPages    REQ_LEN_512BYTE flag
1202210358Sdelphij**             <= 0x100     1               0
1203210358Sdelphij**             <= 0x200     2               1
1204210358Sdelphij**             <= 0x300     3               1
1205210358Sdelphij**             <= 0x400     4               1
1206210358Sdelphij**             .
1207210358Sdelphij**             .
1208210358Sdelphij*/
1209210358Sdelphij
1210165155Sscottl/*
1211165155Sscottl************************************************************************************************
1212144411Sscottl**    size 0x1F8 (504)
1213144411Sscottl************************************************************************************************
1214144411Sscottl*/
1215165155Sscottlstruct ARCMSR_CDB {
1216215234Sdelphij	u_int8_t     	Bus;              /* 00h   should be 0            */
1217215234Sdelphij	u_int8_t     	TargetID;         /* 01h   should be 0--15        */
1218215234Sdelphij	u_int8_t     	LUN;              /* 02h   should be 0--7         */
1219215234Sdelphij	u_int8_t     	Function;         /* 03h   should be 1            */
1220367508Sdelphij
1221215234Sdelphij	u_int8_t     	CdbLength;        /* 04h   not used now           */
1222215234Sdelphij	u_int8_t     	sgcount;          /* 05h                          */
1223215234Sdelphij	u_int8_t     	Flags;            /* 06h                          */
1224210358Sdelphij	u_int8_t     	msgPages;         /* 07h                          */
1225367508Sdelphij
1226215234Sdelphij	u_int32_t    	Context;          /* 08h   Address of this request */
1227215234Sdelphij	u_int32_t    	DataLength;       /* 0ch   not used now           */
1228367508Sdelphij
1229215234Sdelphij	u_int8_t     	Cdb[16];          /* 10h   SCSI CDB               */
1230144411Sscottl	/*
1231144411Sscottl	********************************************************
1232244406Sdelphij	** Device Status : the same from SCSI bus if error occur
1233144411Sscottl	** SCSI bus status codes.
1234144411Sscottl	********************************************************
1235144411Sscottl	*/
1236215234Sdelphij	u_int8_t     	DeviceStatus;     /* 20h   if error                */
1237367508Sdelphij
1238244406Sdelphij	u_int8_t     	SenseData[15];    /* 21h   output                  */
1239367508Sdelphij
1240244406Sdelphij	union {
1241259565Sdelphij		struct SG32ENTRY	sg32entry[ARCMSR_MAX_SG_ENTRIES];        /* 30h   Scatter gather address  */
1242259565Sdelphij		struct SG64ENTRY	sg64entry[ARCMSR_MAX_SG_ENTRIES];        /* 30h                           */
1243244406Sdelphij	} u;
1244244406Sdelphij};
1245244406Sdelphij/* CDB flag */
1246244406Sdelphij#define ARCMSR_CDB_FLAG_SGL_BSIZE		0x01	/* bit 0: 0(256) / 1(512) bytes         */
1247244406Sdelphij#define ARCMSR_CDB_FLAG_BIOS			0x02	/* bit 1: 0(from driver) / 1(from BIOS) */
1248244406Sdelphij#define ARCMSR_CDB_FLAG_WRITE			0x04	/* bit 2: 0(Data in) / 1(Data out)      */
1249244406Sdelphij#define ARCMSR_CDB_FLAG_SIMPLEQ			0x00	/* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */
1250244406Sdelphij#define ARCMSR_CDB_FLAG_HEADQ			0x08
1251244406Sdelphij#define ARCMSR_CDB_FLAG_ORDEREDQ		0x10
1252244406Sdelphij/* scsi status */
1253144411Sscottl#define SCSISTAT_GOOD                  		0x00
1254144411Sscottl#define SCSISTAT_CHECK_CONDITION       		0x02
1255144411Sscottl#define SCSISTAT_CONDITION_MET         		0x04
1256144411Sscottl#define SCSISTAT_BUSY                  		0x08
1257144411Sscottl#define SCSISTAT_INTERMEDIATE          		0x10
1258144411Sscottl#define SCSISTAT_INTERMEDIATE_COND_MET 		0x14
1259144411Sscottl#define SCSISTAT_RESERVATION_CONFLICT  		0x18
1260144411Sscottl#define SCSISTAT_COMMAND_TERMINATED    		0x22
1261144411Sscottl#define SCSISTAT_QUEUE_FULL            		0x28
1262244406Sdelphij/* DeviceStatus */
1263259565Sdelphij#define ARCMSR_DEV_SELECT_TIMEOUT		0xF0
1264259565Sdelphij#define ARCMSR_DEV_ABORTED			0xF1
1265259565Sdelphij#define ARCMSR_DEV_INIT_FAIL			0xF2
1266144411Sscottl/*
1267144411Sscottl*********************************************************************
1268144411Sscottl**                   Command Control Block (SrbExtension)
1269144411Sscottl** SRB must be not cross page boundary,and the order from offset 0
1270144411Sscottl**         structure describing an ATA disk request
1271144411Sscottl**             this SRB length must be 32 bytes boundary
1272144411Sscottl*********************************************************************
1273144411Sscottl*/
1274165155Sscottlstruct CommandControlBlock {
1275259565Sdelphij	struct ARCMSR_CDB	arcmsr_cdb;		/* 0  -503 (size of CDB=504): arcmsr messenger scsi command descriptor size 504 bytes */
1276259565Sdelphij	u_int32_t		cdb_phyaddr_low;	/* 504-507 */
1277259565Sdelphij	u_int32_t		arc_cdb_size;		/* 508-511 */
1278165155Sscottl	/*  ======================512+32 bytes============================  */
1279259565Sdelphij	union ccb		*pccb;			/* 512-515 516-519 pointer of freebsd scsi command */
1280259565Sdelphij	struct AdapterControlBlock	*acb;		/* 520-523 524-527 */
1281259565Sdelphij	bus_dmamap_t		dm_segs_dmamap;		/* 528-531 532-535 */
1282259565Sdelphij	u_int16_t   		srb_flags;		/* 536-537 */
1283259565Sdelphij	u_int16_t		srb_state;              /* 538-539 */
1284259565Sdelphij	u_int32_t		cdb_phyaddr_high;	/* 540-543 */
1285259565Sdelphij	struct	callout		ccb_callout;
1286321064Sdelphij	u_int32_t		smid;
1287144411Sscottl    /*  ==========================================================  */
1288144411Sscottl};
1289210358Sdelphij/*	srb_flags */
1290259565Sdelphij#define		SRB_FLAG_READ			0x0000
1291259565Sdelphij#define		SRB_FLAG_WRITE			0x0001
1292259565Sdelphij#define		SRB_FLAG_ERROR			0x0002
1293259565Sdelphij#define		SRB_FLAG_FLUSHCACHE		0x0004
1294210358Sdelphij#define		SRB_FLAG_MASTER_ABORTED 	0x0008
1295259565Sdelphij#define		SRB_FLAG_DMAVALID		0x0010
1296210358Sdelphij#define		SRB_FLAG_DMACONSISTENT  	0x0020
1297259565Sdelphij#define		SRB_FLAG_DMAWRITE		0x0040
1298259565Sdelphij#define		SRB_FLAG_PKTBIND		0x0080
1299220403Sdelphij#define		SRB_FLAG_TIMER_START		0x0080
1300220403Sdelphij/*	srb_state */
1301259565Sdelphij#define		ARCMSR_SRB_DONE   		0x0000
1302259565Sdelphij#define		ARCMSR_SRB_UNBUILD 		0x0000
1303259565Sdelphij#define		ARCMSR_SRB_TIMEOUT 		0x1111
1304259565Sdelphij#define		ARCMSR_SRB_RETRY 		0x2222
1305259565Sdelphij#define		ARCMSR_SRB_START   		0x55AA
1306259565Sdelphij#define		ARCMSR_SRB_PENDING		0xAA55
1307259565Sdelphij#define		ARCMSR_SRB_RESET		0xA5A5
1308259565Sdelphij#define		ARCMSR_SRB_ABORTED		0x5A5A
1309259565Sdelphij#define		ARCMSR_SRB_ILLEGAL		0xFFFF
1310244406Sdelphij
1311244406Sdelphij#define		SRB_SIZE	((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0)
1312244406Sdelphij#define 	ARCMSR_SRBS_POOL_SIZE   (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM)
1313244406Sdelphij
1314144411Sscottl/*
1315144411Sscottl*********************************************************************
1316144411Sscottl**                 Adapter Control Block
1317144411Sscottl*********************************************************************
1318144411Sscottl*/
1319321064Sdelphij#define ACB_ADAPTER_TYPE_A	0x00000000	/* hba I IOP */
1320321064Sdelphij#define ACB_ADAPTER_TYPE_B	0x00000001	/* hbb M IOP */
1321321064Sdelphij#define ACB_ADAPTER_TYPE_C	0x00000002	/* hbc L IOP */
1322321064Sdelphij#define ACB_ADAPTER_TYPE_D	0x00000003	/* hbd M IOP */
1323321064Sdelphij#define ACB_ADAPTER_TYPE_E	0x00000004	/* hbd L IOP */
1324367508Sdelphij#define ACB_ADAPTER_TYPE_F	0x00000005	/* hbd L IOP */
1325215234Sdelphij
1326210358Sdelphijstruct AdapterControlBlock {
1327259565Sdelphij	u_int32_t		adapter_type;		/* adapter A,B..... */
1328367508Sdelphij
1329259565Sdelphij	bus_space_tag_t		btag[2];
1330259565Sdelphij	bus_space_handle_t	bhandle[2];
1331259565Sdelphij	bus_dma_tag_t		parent_dmat;
1332259565Sdelphij	bus_dma_tag_t		dm_segs_dmat;		/* dmat for buffer I/O */
1333259565Sdelphij	bus_dma_tag_t		srb_dmat;		/* dmat for freesrb */
1334259565Sdelphij	bus_dmamap_t		srb_dmamap;
1335259565Sdelphij	device_t		pci_dev;
1336259565Sdelphij	struct cdev		*ioctl_dev;
1337259565Sdelphij	int			pci_unit;
1338367508Sdelphij
1339259565Sdelphij	struct resource		*sys_res_arcmsr[2];
1340321064Sdelphij	struct resource		*irqres[ARCMSR_NUM_MSIX_VECTORS];
1341321064Sdelphij	void			*ih[ARCMSR_NUM_MSIX_VECTORS]; /* interrupt handle */
1342321064Sdelphij	int			irq_id[ARCMSR_NUM_MSIX_VECTORS];
1343367508Sdelphij
1344144411Sscottl	/* Hooks into the CAM XPT */
1345259565Sdelphij	struct			cam_sim *psim;
1346259565Sdelphij	struct			cam_path *ppath;
1347259565Sdelphij	u_int8_t		*uncacheptr;
1348259565Sdelphij	unsigned long		vir2phy_offset;
1349210358Sdelphij	union	{
1350259565Sdelphij		unsigned long	phyaddr;
1351210358Sdelphij		struct {
1352259565Sdelphij			u_int32_t	phyadd_low;
1353259565Sdelphij			u_int32_t	phyadd_high;
1354210358Sdelphij		}B;
1355259564Sdelphij	}srb_phyaddr;
1356210358Sdelphij//	unsigned long				srb_phyaddr;
1357165155Sscottl	/* Offset is used in making arc cdb physical to virtual calculations */
1358259565Sdelphij	u_int32_t		outbound_int_enable;
1359367508Sdelphij
1360259565Sdelphij	struct MessageUnit_UNION	*pmu;		/* message unit ATU inbound base address0 */
1361367508Sdelphij	uint32_t		*message_wbuffer;	//0x000 - COMPORT_IN  (to be sent to ROC)
1362367508Sdelphij	uint32_t		*message_rbuffer;	//0x100 - COMPORT_OUT (to be sent to Host)
1363367508Sdelphij	uint32_t		*msgcode_rwbuffer;	//0x200 - BIOS_AREA
1364367508Sdelphij
1365259564Sdelphij	u_int8_t		adapter_index;
1366259565Sdelphij	u_int8_t		irq;
1367259564Sdelphij	u_int16_t		acb_flags;
1368367508Sdelphij
1369220403Sdelphij	struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM];     /* serial srb pointer array */
1370220403Sdelphij	struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM];   /* working srb pointer array */
1371259565Sdelphij	int32_t			workingsrb_doneindex;		/* done srb array index */
1372259565Sdelphij	int32_t			workingsrb_startindex;		/* start srb array index  */
1373259565Sdelphij	int32_t			srboutstandingcount;
1374367508Sdelphij
1375259565Sdelphij	u_int8_t		rqbuffer[ARCMSR_MAX_QBUFFER];	/* data collection buffer for read from 80331 */
1376259565Sdelphij	u_int32_t		rqbuf_firstindex;		/* first of read buffer  */
1377259565Sdelphij	u_int32_t		rqbuf_lastindex;		/* last of read buffer   */
1378367508Sdelphij
1379259565Sdelphij	u_int8_t		wqbuffer[ARCMSR_MAX_QBUFFER];	/* data collection buffer for write to 80331  */
1380259565Sdelphij	u_int32_t		wqbuf_firstindex;		/* first of write buffer */
1381259565Sdelphij	u_int32_t		wqbuf_lastindex;		/* last of write buffer  */
1382367508Sdelphij
1383259565Sdelphij	arcmsr_lock_t		isr_lock;
1384259565Sdelphij	arcmsr_lock_t		srb_lock;
1385259565Sdelphij	arcmsr_lock_t		postDone_lock;
1386259565Sdelphij	arcmsr_lock_t		qbuffer_lock;
1387367508Sdelphij
1388259565Sdelphij	u_int8_t		devstate[ARCMSR_MAX_TARGETID][ARCMSR_MAX_TARGETLUN]; /* id0 ..... id15,lun0...lun7 */
1389259565Sdelphij	u_int32_t		num_resets;
1390259565Sdelphij	u_int32_t		num_aborts;
1391259565Sdelphij	u_int32_t		firm_request_len;	/*1,04-07*/
1392259565Sdelphij	u_int32_t		firm_numbers_queue;	/*2,08-11*/
1393259565Sdelphij	u_int32_t		firm_sdram_size;	/*3,12-15*/
1394259565Sdelphij	u_int32_t		firm_ide_channels;	/*4,16-19*/
1395259565Sdelphij	u_int32_t		firm_cfg_version;
1396259565Sdelphij	char			firm_model[12];		/*15,60-67*/
1397259565Sdelphij	char			firm_version[20];	/*17,68-83*/
1398259565Sdelphij	char			device_map[20];		/*21,84-99 */
1399259565Sdelphij	struct	callout		devmap_callout;
1400259565Sdelphij	u_int32_t		pktRequestCount;
1401259565Sdelphij	u_int32_t		pktReturnCount;
1402259565Sdelphij	u_int32_t		vendor_device_id;
1403259565Sdelphij	u_int32_t		adapter_bus_speed;
1404259565Sdelphij	u_int32_t		maxOutstanding;
1405259564Sdelphij	u_int16_t		sub_device_id;
1406321064Sdelphij	u_int32_t		doneq_index;
1407321064Sdelphij	u_int32_t		in_doorbell;
1408321064Sdelphij	u_int32_t		out_doorbell;
1409321064Sdelphij	u_int32_t		completionQ_entry;
1410321064Sdelphij	pCompletion_Q		pCompletionQ;
1411321064Sdelphij	int			msix_vectors;
1412326087Sdelphij	int			rid[2];
1413367508Sdelphij	unsigned long		completeQ_phys;
1414144411Sscottl};/* HW_DEVICE_EXTENSION */
1415210358Sdelphij/* acb_flags */
1416210358Sdelphij#define ACB_F_SCSISTOPADAPTER           0x0001
1417259565Sdelphij#define ACB_F_MSG_STOP_BGRB             0x0002		/* stop RAID background rebuild */
1418259565Sdelphij#define ACB_F_MSG_START_BGRB            0x0004		/* stop RAID background rebuild */
1419259565Sdelphij#define ACB_F_IOPDATA_OVERFLOW          0x0008		/* iop ioctl data rqbuffer overflow */
1420259565Sdelphij#define ACB_F_MESSAGE_WQBUFFER_CLEARED  0x0010		/* ioctl clear wqbuffer */
1421259565Sdelphij#define ACB_F_MESSAGE_RQBUFFER_CLEARED  0x0020		/* ioctl clear rqbuffer */
1422210358Sdelphij#define ACB_F_MESSAGE_WQBUFFER_READ     0x0040
1423210358Sdelphij#define ACB_F_BUS_RESET                 0x0080
1424259565Sdelphij#define ACB_F_IOP_INITED                0x0100		/* iop init */
1425259565Sdelphij#define ACB_F_MAPFREESRB_FAILD		0x0200		/* arcmsr_map_freesrb faild */
1426210358Sdelphij#define ACB_F_CAM_DEV_QFRZN             0x0400
1427259565Sdelphij#define ACB_F_BUS_HANG_ON               0x0800		/* need hardware reset bus */
1428210358Sdelphij#define ACB_F_SRB_FUNCTION_POWER        0x1000
1429321064Sdelphij#define	ACB_F_MSIX_ENABLED		0x2000
1430210358Sdelphij/* devstate */
1431259565Sdelphij#define ARECA_RAID_GONE         	0x55
1432259565Sdelphij#define ARECA_RAID_GOOD         	0xaa
1433240079Sdelphij/* adapter_bus_speed */
1434240079Sdelphij#define	ACB_BUS_SPEED_3G	0
1435240079Sdelphij#define	ACB_BUS_SPEED_6G	1
1436240079Sdelphij#define	ACB_BUS_SPEED_12G	2
1437144411Sscottl/*
1438144411Sscottl*************************************************************
1439144411Sscottl*************************************************************
1440144411Sscottl*/
1441165155Sscottlstruct SENSE_DATA {
1442215234Sdelphij    u_int8_t 	ErrorCode:7;
1443215234Sdelphij    u_int8_t 	Valid:1;
1444215234Sdelphij    u_int8_t 	SegmentNumber;
1445215234Sdelphij    u_int8_t 	SenseKey:4;
1446215234Sdelphij    u_int8_t 	Reserved:1;
1447215234Sdelphij    u_int8_t 	IncorrectLength:1;
1448215234Sdelphij    u_int8_t 	EndOfMedia:1;
1449215234Sdelphij    u_int8_t 	FileMark:1;
1450215234Sdelphij    u_int8_t 	Information[4];
1451215234Sdelphij    u_int8_t 	AdditionalSenseLength;
1452215234Sdelphij    u_int8_t 	CommandSpecificInformation[4];
1453215234Sdelphij    u_int8_t 	AdditionalSenseCode;
1454215234Sdelphij    u_int8_t 	AdditionalSenseCodeQualifier;
1455215234Sdelphij    u_int8_t 	FieldReplaceableUnitCode;
1456215234Sdelphij    u_int8_t 	SenseKeySpecific[3];
1457144411Sscottl};
1458144411Sscottl/*
1459144411Sscottl**********************************
1460144411Sscottl**  Peripheral Device Type definitions
1461144411Sscottl**********************************
1462144411Sscottl*/
1463259565Sdelphij#define SCSI_DASD		0x00	   /* Direct-access Device	   */
1464215234Sdelphij#define SCSI_SEQACESS		0x01	   /* Sequential-access device     */
1465215234Sdelphij#define SCSI_PRINTER		0x02	   /* Printer device		   */
1466215234Sdelphij#define SCSI_PROCESSOR		0x03	   /* Processor device		   */
1467215234Sdelphij#define SCSI_WRITEONCE		0x04	   /* Write-once device 	   */
1468259565Sdelphij#define SCSI_CDROM		0x05	   /* CD-ROM device		   */
1469215234Sdelphij#define SCSI_SCANNER		0x06	   /* Scanner device		   */
1470215234Sdelphij#define SCSI_OPTICAL		0x07	   /* Optical memory device	   */
1471215234Sdelphij#define SCSI_MEDCHGR		0x08	   /* Medium changer device	   */
1472259565Sdelphij#define SCSI_COMM		0x09	   /* Communications device	   */
1473259565Sdelphij#define SCSI_NODEV		0x1F	   /* Unknown or no device type    */
1474144411Sscottl/*
1475144411Sscottl************************************************************************************************************
1476144411Sscottl**				         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1477144411Sscottl**				                          80331 PCI-to-PCI Bridge
1478144411Sscottl**				                          PCI Configuration Space
1479144411Sscottl**
1480144411Sscottl**				         @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
1481144411Sscottl**				                            Programming Interface
1482144411Sscottl**				                          ========================
1483144411Sscottl**				            Configuration Register Address Space Groupings and Ranges
1484144411Sscottl**				         =============================================================
1485144411Sscottl**				                 Register Group                      Configuration  Offset
1486144411Sscottl**				         -------------------------------------------------------------
1487144411Sscottl**				            Standard PCI Configuration                      00-3Fh
1488144411Sscottl**				         -------------------------------------------------------------
1489144411Sscottl**				             Device Specific Registers                      40-A7h
1490144411Sscottl**				         -------------------------------------------------------------
1491144411Sscottl**				                   Reserved                                 A8-CBh
1492144411Sscottl**				         -------------------------------------------------------------
1493144411Sscottl**				              Enhanced Capability List                      CC-FFh
1494144411Sscottl** ==========================================================================================================
1495144411Sscottl**                         Standard PCI [Type 1] Configuration Space Address Map
1496144411Sscottl** **********************************************************************************************************
1497144411Sscottl** |    Byte 3              |         Byte 2         |        Byte 1          |       Byte 0              |   Configu-ration Byte Offset
1498144411Sscottl** ----------------------------------------------------------------------------------------------------------
1499144411Sscottl** |                    Device ID                    |                     Vendor ID                      | 00h
1500144411Sscottl** ----------------------------------------------------------------------------------------------------------
1501144411Sscottl** |                 Primary Status                  |                  Primary Command                   | 04h
1502144411Sscottl** ----------------------------------------------------------------------------------------------------------
1503144411Sscottl** |                   Class Code                                             |        RevID              | 08h
1504144411Sscottl** ----------------------------------------------------------------------------------------------------------
1505144411Sscottl** |        reserved        |      Header Type       |      Primary MLT       |      Primary CLS          | 0Ch
1506144411Sscottl** ----------------------------------------------------------------------------------------------------------
1507144411Sscottl** |                                             Reserved                                                 | 10h
1508144411Sscottl** ----------------------------------------------------------------------------------------------------------
1509144411Sscottl** |                                             Reserved                                                 | 14h
1510144411Sscottl** ----------------------------------------------------------------------------------------------------------
1511144411Sscottl** |     Secondary MLT      | Subordinate Bus Number |  Secondary Bus Number  |     Primary Bus Number    | 18h
1512144411Sscottl** ----------------------------------------------------------------------------------------------------------
1513144411Sscottl** |                 Secondary Status                |       I/O Limit        |        I/O Base           | 1Ch
1514144411Sscottl** ----------------------------------------------------------------------------------------------------------
1515144411Sscottl** |      Non-prefetchable Memory Limit Address      |       Non-prefetchable Memory Base Address         | 20h
1516144411Sscottl** ----------------------------------------------------------------------------------------------------------
1517144411Sscottl** |        Prefetchable Memory Limit Address        |           Prefetchable Memory Base Address         | 24h
1518144411Sscottl** ----------------------------------------------------------------------------------------------------------
1519144411Sscottl** |                          Prefetchable Memory Base Address Upper 32 Bits                              | 28h
1520144411Sscottl** ----------------------------------------------------------------------------------------------------------
1521144411Sscottl** |                          Prefetchable Memory Limit Address Upper 32 Bits                             | 2Ch
1522144411Sscottl** ----------------------------------------------------------------------------------------------------------
1523144411Sscottl** |             I/O Limit Upper 16 Bits             |                 I/O Base Upper 16                  | 30h
1524144411Sscottl** ----------------------------------------------------------------------------------------------------------
1525144411Sscottl** |                                Reserved                                  |   Capabilities Pointer    | 34h
1526144411Sscottl** ----------------------------------------------------------------------------------------------------------
1527144411Sscottl** |                                             Reserved                                                 | 38h
1528144411Sscottl** ----------------------------------------------------------------------------------------------------------
1529144411Sscottl** |                   Bridge Control                |  Primary Interrupt Pin | Primary Interrupt Line    | 3Ch
1530144411Sscottl**=============================================================================================================
1531144411Sscottl*/
1532144411Sscottl/*
1533144411Sscottl**=============================================================================================================
1534144411Sscottl**  0x03-0x00 :
1535144411Sscottl** Bit       Default             Description
1536144411Sscottl**31:16       0335h            Device ID (DID): Indicates the unique device ID that is assigned to bridge by the PCI SIG.
1537144411Sscottl**                             ID is unique per product speed as indicated.
1538144411Sscottl**15:00       8086h            Vendor ID (VID): 16-bit field which indicates that Intel is the vendor.
1539144411Sscottl**=============================================================================================================
1540144411Sscottl*/
1541144411Sscottl#define     ARCMSR_PCI2PCI_VENDORID_REG		         0x00    /*word*/
1542144411Sscottl#define     ARCMSR_PCI2PCI_DEVICEID_REG		         0x02    /*word*/
1543144411Sscottl/*
1544144411Sscottl**==============================================================================
1545144411Sscottl**  0x05-0x04 : command register
1546144411Sscottl** Bit       Default 		               Description
1547144411Sscottl**15:11        00h		   		             Reserved
1548144411Sscottl** 10          0		   		           Interrupt Disable: Disables/Enables the generation of Interrupts on the primary bus.
1549144411Sscottl**                		   		                              The bridge does not support interrupts.
1550165155Sscottl** 09          0		   		                 FB2B Enable: Enables/Disables the generation of fast back to back
1551165155Sscottl**										transactions on the primary bus.
1552165155Sscottl**                		   		                              The bridge does not generate fast back to back
1553165155Sscottl**										transactions on the primary bus.
1554144411Sscottl** 08          0		   		          SERR# Enable (SEE): Enables primary bus SERR# assertions.
1555144411Sscottl**                		   		                              0=The bridge does not assert P_SERR#.
1556144411Sscottl**                		   		                              1=The bridge may assert P_SERR#, subject to other programmable criteria.
1557165155Sscottl** 07          0		   		    Wait Cycle Control (WCC): Always returns 0bzero indicating
1558165155Sscottl**										that bridge does not perform address or data stepping,
1559144411Sscottl** 06          0		   		 Parity Error Response (PER): Controls bridge response to a detected primary bus parity error.
1560144411Sscottl**                		   		                              0=When a data parity error is detected bridge does not assert S_PERR#.
1561165155Sscottl**                		   		                                  Also bridge does not assert P_SERR# in response to
1562165155Sscottl**											a detected address or attribute parity error.
1563144411Sscottl**                		   		                              1=When a data parity error is detected bridge asserts S_PERR#.
1564165155Sscottl**                		   		                                  The bridge also asserts P_SERR#
1565165155Sscottl**											(when enabled globally via bit(8) of this register)
1566165155Sscottl**											in response to a detected address or attribute parity error.
1567144411Sscottl** 05          0		  VGA Palette Snoop Enable (VGA_PSE): Controls bridge response to VGA-compatible palette write transactions.
1568165155Sscottl**                		                                      VGA palette write transactions are I/O transactions
1569165155Sscottl**										 whose address bits are: P_AD[9:0] equal to 3C6h, 3C8h or 3C9h
1570165155Sscottl**                		                                      P_AD[15:10] are not decoded (i.e. aliases are claimed),
1571165155Sscottl**										or are fully decoding
1572165155Sscottl**										(i.e., must be all 0's depending upon the VGA
1573165155Sscottl**										aliasing bit in the Bridge Control Register, offset 3Eh.
1574144411Sscottl**                		                                      P_AD[31:16] equal to 0000h
1575165155Sscottl**                		                                      0=The bridge ignores VGA palette write transactions,
1576165155Sscottl**										unless decoded by the standard I/O address range window.
1577165155Sscottl**                		                                      1=The bridge responds to VGA palette write transactions
1578165155Sscottl**										with medium DEVSEL# timing and forwards them to the secondary bus.
1579144411Sscottl** 04          0   Memory Write and Invalidate Enable (MWIE): The bridge does not promote MW transactions to MWI transactions.
1580165155Sscottl**                                                            MWI transactions targeting resources on the opposite side of the bridge,
1581165155Sscottl**										however, are forwarded as MWI transactions.
1582144411Sscottl** 03          0                  Special Cycle Enable (SCE): The bridge ignores special cycle transactions.
1583144411Sscottl**                                                            This bit is read only and always returns 0 when read
1584144411Sscottl** 02          0                     Bus Master Enable (BME): Enables bridge to initiate memory and I/O transactions on the primary interface.
1585144411Sscottl**                                                            Initiation of configuration transactions is not affected by the state of this bit.
1586144411Sscottl**                                                            0=The bridge does not initiate memory or I/O transactions on the primary interface.
1587144411Sscottl**                                                            1=The bridge is enabled to function as an initiator on the primary interface.
1588144411Sscottl** 01          0                   Memory Space Enable (MSE): Controls target response to memory transactions on the primary interface.
1589144411Sscottl**                                                            0=The bridge target response to memory transactions on the primary interface is disabled.
1590144411Sscottl**                                                            1=The bridge target response to memory transactions on the primary interface is enabled.
1591144411Sscottl** 00          0                     I/O Space Enable (IOSE): Controls target response to I/O transactions on the primary interface.
1592144411Sscottl**                                                            0=The bridge target response to I/O transactions on the primary interface is disabled.
1593144411Sscottl**                                                            1=The bridge target response to I/O transactions on the primary interface is enabled.
1594144411Sscottl**==============================================================================
1595144411Sscottl*/
1596215234Sdelphij#define     ARCMSR_PCI2PCI_PRIMARY_COMMAND_REG		0x04    /*word*/
1597215234Sdelphij#define     PCI_DISABLE_INTERRUPT					0x0400
1598144411Sscottl/*
1599144411Sscottl**==============================================================================
1600144411Sscottl**  0x07-0x06 : status register
1601144411Sscottl** Bit       Default                       Description
1602165155Sscottl** 15          0                       Detected Parity Error: The bridge sets this bit to a 1b whenever it detects an address,
1603165155Sscottl**									attribute or data parity error.
1604144411Sscottl**                                                            This bit is set regardless of the state of the PER bit in the command register.
1605144411Sscottl** 14          0                       Signaled System Error: The bridge sets this bit to a 1b whenever it asserts SERR# on the primary bus.
1606165155Sscottl** 13          0                       Received Master Abort: The bridge sets this bit to a 1b when,
1607165155Sscottl**									acting as the initiator on the primary bus,
1608165155Sscottl**									its transaction (with the exception of special cycles)
1609165155Sscottl**									has been terminated with a Master Abort.
1610165155Sscottl** 12          0                       Received Target Abort: The bridge sets this bit to a 1b when,
1611165155Sscottl**									acting as the initiator on the primary bus,
1612165155Sscottl**									its transaction has been terminated with a Target Abort.
1613165155Sscottl** 11          0                       Signaled Target Abort: The bridge sets this bit to a 1b when it,
1614165155Sscottl**									as the target of a transaction, terminates it with a Target Abort.
1615144411Sscottl**                                                            In PCI-X mode this bit is also set when it forwards a SCM with a target abort error code.
1616144411Sscottl** 10:09       01                             DEVSEL# Timing: Indicates slowest response to a non-configuration command on the primary interface.
1617144411Sscottl**                                                            Returns ��01b�� when read, indicating that bridge responds no slower than with medium timing.
1618165155Sscottl** 08          0                    Master Data Parity Error: The bridge sets this bit to a 1b when all of the following conditions are true:
1619165155Sscottl**									The bridge is the current master on the primary bus
1620144411Sscottl**                                                            S_PERR# is detected asserted or is asserted by bridge
1621144411Sscottl**                                                            The Parity Error Response bit is set in the Command register
1622165155Sscottl** 07          1                   Fast Back to Back Capable: Returns a 1b when read indicating that bridge
1623165155Sscottl**									is able to respond to fast back to back transactions on its primary interface.
1624144411Sscottl** 06          0                             Reserved
1625144411Sscottl** 05          1                   66 MHz Capable Indication: Returns a 1b when read indicating that bridge primary interface is 66 MHz capable.
1626144411Sscottl**                                                            1 =
1627144411Sscottl** 04          1                    Capabilities List Enable: Returns 1b when read indicating that bridge supports PCI standard enhanced capabilities.
1628165155Sscottl**                                                            Offset 34h (Capability Pointer register)
1629165155Sscottl**										provides the offset for the first entry
1630165155Sscottl**										in the linked list of enhanced capabilities.
1631144411Sscottl** 03          0                            Interrupt Status: Reflects the state of the interrupt in the device/function.
1632144411Sscottl**                                                            The bridge does not support interrupts.
1633144411Sscottl** 02:00       000                           Reserved
1634144411Sscottl**==============================================================================
1635144411Sscottl*/
1636144411Sscottl#define     ARCMSR_PCI2PCI_PRIMARY_STATUS_REG	     0x06    /*word: 06,07 */
1637165155Sscottl#define          ARCMSR_ADAP_66MHZ                   0x20
1638144411Sscottl/*
1639144411Sscottl**==============================================================================
1640144411Sscottl**  0x08 : revision ID
1641144411Sscottl** Bit       Default                       Description
1642144411Sscottl** 07:00       00000000                  Revision ID (RID): '00h' indicating bridge A-0 stepping.
1643144411Sscottl**==============================================================================
1644144411Sscottl*/
1645144411Sscottl#define     ARCMSR_PCI2PCI_REVISIONID_REG		     0x08    /*byte*/
1646144411Sscottl/*
1647144411Sscottl**==============================================================================
1648144411Sscottl**  0x0b-0x09 : 0180_00 (class code 1,native pci mode )
1649144411Sscottl** Bit       Default                       Description
1650144411Sscottl** 23:16       06h                     Base Class Code (BCC): Indicates that this is a bridge device.
1651144411Sscottl** 15:08       04h                      Sub Class Code (SCC): Indicates this is of type PCI-to-PCI bridge.
1652144411Sscottl** 07:00       00h               Programming Interface (PIF): Indicates that this is standard (non-subtractive) PCI-PCI bridge.
1653144411Sscottl**==============================================================================
1654144411Sscottl*/
1655144411Sscottl#define     ARCMSR_PCI2PCI_CLASSCODE_REG	         0x09    /*3bytes*/
1656144411Sscottl/*
1657144411Sscottl**==============================================================================
1658144411Sscottl**  0x0c : cache line size
1659144411Sscottl** Bit       Default                       Description
1660144411Sscottl** 07:00       00h                     Cache Line Size (CLS): Designates the cache line size in 32-bit dword units.
1661165155Sscottl**                                                            The contents of this register are factored into
1662165155Sscottl**									internal policy decisions associated with memory read prefetching,
1663165155Sscottl**									and the promotion of Memory Write transactions to MWI transactions.
1664144411Sscottl**                                                            Valid cache line sizes are 8 and 16 dwords.
1665165155Sscottl**                                                            When the cache line size is set to an invalid value,
1666165155Sscottl**									bridge behaves as though the cache line size was set to 00h.
1667144411Sscottl**==============================================================================
1668144411Sscottl*/
1669144411Sscottl#define     ARCMSR_PCI2PCI_PRIMARY_CACHELINESIZE_REG 0x0C    /*byte*/
1670144411Sscottl/*
1671144411Sscottl**==============================================================================
1672144411Sscottl**  0x0d : latency timer (number of pci clock 00-ff )
1673144411Sscottl** Bit       Default                       Description
1674144411Sscottl**                                   Primary Latency Timer (PTV):
1675144411Sscottl** 07:00      00h (Conventional PCI)   Conventional PCI Mode: Primary bus Master latency timer. Indicates the number of PCI clock cycles,
1676144411Sscottl**                                                            referenced from the assertion of FRAME# to the expiration of the timer,
1677144411Sscottl**                                                            when bridge may continue as master of the current transaction. All bits are writable,
1678144411Sscottl**                                                            resulting in a granularity of 1 PCI clock cycle.
1679165155Sscottl**                                                            When the timer expires (i.e., equals 00h)
1680165155Sscottl**									bridge relinquishes the bus after the first data transfer
1681165155Sscottl**									when its PCI bus grant has been deasserted.
1682144411Sscottl**         or 40h (PCI-X)                         PCI-X Mode: Primary bus Master latency timer.
1683144411Sscottl**                                                            Indicates the number of PCI clock cycles,
1684144411Sscottl**                                                            referenced from the assertion of FRAME# to the expiration of the timer,
1685144411Sscottl**                                                            when bridge may continue as master of the current transaction.
1686144411Sscottl**                                                            All bits are writable, resulting in a granularity of 1 PCI clock cycle.
1687144411Sscottl**                                                            When the timer expires (i.e., equals 00h) bridge relinquishes the bus at the next ADB.
1688165155Sscottl**                                                            (Except in the case where MLT expires within 3 data phases
1689165155Sscottl**								of an ADB.In this case bridge continues on
1690165155Sscottl**								until it reaches the next ADB before relinquishing the bus.)
1691144411Sscottl**==============================================================================
1692144411Sscottl*/
1693144411Sscottl#define     ARCMSR_PCI2PCI_PRIMARY_LATENCYTIMER_REG	 0x0D    /*byte*/
1694144411Sscottl/*
1695144411Sscottl**==============================================================================
1696144411Sscottl**  0x0e : (header type,single function )
1697144411Sscottl** Bit       Default                       Description
1698144411Sscottl** 07           0                Multi-function device (MVD): 80331 is a single-function device.
1699144411Sscottl** 06:00       01h                       Header Type (HTYPE): Defines the layout of addresses 10h through 3Fh in configuration space.
1700165155Sscottl**                                                            Returns ��01h�� when read indicating
1701165155Sscottl**								that the register layout conforms to the standard PCI-to-PCI bridge layout.
1702144411Sscottl**==============================================================================
1703144411Sscottl*/
1704144411Sscottl#define     ARCMSR_PCI2PCI_HEADERTYPE_REG	         0x0E    /*byte*/
1705144411Sscottl/*
1706144411Sscottl**==============================================================================
1707144411Sscottl**     0x0f   :
1708144411Sscottl**==============================================================================
1709144411Sscottl*/
1710144411Sscottl/*
1711144411Sscottl**==============================================================================
1712144411Sscottl**  0x13-0x10 :
1713144411Sscottl**  PCI CFG Base Address #0 (0x10)
1714144411Sscottl**==============================================================================
1715144411Sscottl*/
1716144411Sscottl/*
1717144411Sscottl**==============================================================================
1718144411Sscottl**  0x17-0x14 :
1719144411Sscottl**  PCI CFG Base Address #1 (0x14)
1720144411Sscottl**==============================================================================
1721144411Sscottl*/
1722144411Sscottl/*
1723144411Sscottl**==============================================================================
1724144411Sscottl**  0x1b-0x18 :
1725144411Sscottl**  PCI CFG Base Address #2 (0x18)
1726144411Sscottl**-----------------0x1A,0x19,0x18--Bus Number Register - BNR
1727144411Sscottl** Bit       Default                       Description
1728144411Sscottl** 23:16       00h             Subordinate Bus Number (SBBN): Indicates the highest PCI bus number below this bridge.
1729165155Sscottl**                                                            Any Type 1 configuration cycle
1730165155Sscottl**									on the primary bus whose bus number is greater than the secondary bus number,
1731165155Sscottl**                                                            and less than or equal to the subordinate bus number
1732165155Sscottl**									is forwarded unaltered as a Type 1 configuration cycle on the secondary PCI bus.
1733144411Sscottl** 15:08       00h               Secondary Bus Number (SCBN): Indicates the bus number of PCI to which the secondary interface is connected.
1734165155Sscottl**                                                            Any Type 1 configuration cycle matching this bus number
1735165155Sscottl**									is translated to a Type 0 configuration cycle (or a Special Cycle)
1736165155Sscottl**									before being executed on bridge's secondary PCI bus.
1737144411Sscottl** 07:00       00h                  Primary Bus Number (PBN): Indicates bridge primary bus number.
1738165155Sscottl**                                                            Any Type 1 configuration cycle on the primary interface
1739165155Sscottl**									with a bus number that is less than the contents
1740165155Sscottl**									of this register field does not be claimed by bridge.
1741144411Sscottl**-----------------0x1B--Secondary Latency Timer Register - SLTR
1742144411Sscottl** Bit       Default                       Description
1743144411Sscottl**                             Secondary Latency Timer (STV):
1744144411Sscottl** 07:00       00h (Conventional PCI)  Conventional PCI Mode: Secondary bus Master latency timer.
1745165155Sscottl**                                                            Indicates the number of PCI clock cycles,
1746165155Sscottl**									referenced from the assertion of FRAME# to the expiration of the timer,
1747144411Sscottl**                                                            when bridge may continue as master of the current transaction. All bits are writable,
1748144411Sscottl**                                                            resulting in a granularity of 1 PCI clock cycle.
1749165155Sscottl**                                                            When the timer expires (i.e., equals 00h)
1750165155Sscottl**								bridge relinquishes the bus after the first data transfer
1751165155Sscottl**								when its PCI bus grant has been deasserted.
1752144411Sscottl**          or 40h (PCI-X)                        PCI-X Mode: Secondary bus Master latency timer.
1753165155Sscottl**                                                            Indicates the number of PCI clock cycles,referenced from the assertion of FRAME#
1754165155Sscottl**								to the expiration of the timer,
1755144411Sscottl**                                                            when bridge may continue as master of the current transaction. All bits are writable,
1756144411Sscottl**                                                            resulting in a granularity of 1 PCI clock cycle.
1757144411Sscottl**                                                            When the timer expires (i.e., equals 00h) bridge relinquishes the bus at the next ADB.
1758165155Sscottl**                                                            (Except in the case where MLT expires within 3 data phases of an ADB.
1759165155Sscottl**								In this case bridge continues on until it reaches the next ADB
1760165155Sscottl**								before relinquishing the bus)
1761144411Sscottl**==============================================================================
1762144411Sscottl*/
1763144411Sscottl#define     ARCMSR_PCI2PCI_PRIMARY_BUSNUMBER_REG	         0x18    /*3byte 0x1A,0x19,0x18*/
1764144411Sscottl#define     ARCMSR_PCI2PCI_SECONDARY_BUSNUMBER_REG	         0x19    /*byte*/
1765165155Sscottl#define     ARCMSR_PCI2PCI_SUBORDINATE_BUSNUMBER_REG             0x1A    /*byte*/
1766165155Sscottl#define     ARCMSR_PCI2PCI_SECONDARY_LATENCYTIMER_REG	         0x1B    /*byte*/
1767144411Sscottl/*
1768144411Sscottl**==============================================================================
1769144411Sscottl**  0x1f-0x1c :
1770144411Sscottl**  PCI CFG Base Address #3 (0x1C)
1771144411Sscottl**-----------------0x1D,0x1C--I/O Base and Limit Register - IOBL
1772144411Sscottl** Bit       Default                       Description
1773165155Sscottl** 15:12        0h            I/O Limit Address Bits [15:12]: Defines the top address of an address range to
1774165155Sscottl**								determine when to forward I/O transactions from one interface to the other.
1775144411Sscottl**                                                            These bits correspond to address lines 15:12 for 4KB alignment.
1776144411Sscottl**                                                            Bits 11:0 are assumed to be FFFh.
1777144411Sscottl** 11:08        1h           I/O Limit Addressing Capability: This field is hard-wired to 1h, indicating support 32-bit I/O addressing.
1778165155Sscottl** 07:04        0h             I/O Base Address Bits [15:12]: Defines the bottom address of
1779165155Sscottl**								an address range to determine when to forward I/O transactions
1780165155Sscottl**								from one interface to the other.
1781165155Sscottl**                                                            These bits correspond to address lines 15:12 for 4KB alignment.
1782165155Sscottl**								Bits 11:0 are assumed to be 000h.
1783144411Sscottl** 03:00        1h            I/O Base Addressing Capability: This is hard-wired to 1h, indicating support for 32-bit I/O addressing.
1784144411Sscottl**-----------------0x1F,0x1E--Secondary Status Register - SSR
1785144411Sscottl** Bit       Default                       Description
1786165155Sscottl** 15           0b                     Detected Parity Error: The bridge sets this bit to a 1b whenever it detects an address,
1787165155Sscottl**								attribute or data parity error on its secondary interface.
1788144411Sscottl** 14           0b                     Received System Error: The bridge sets this bit when it samples SERR# asserted on its secondary bus interface.
1789165155Sscottl** 13           0b                     Received Master Abort: The bridge sets this bit to a 1b when,
1790165155Sscottl**								acting as the initiator on the secondary bus,
1791165155Sscottl**								it's transaction (with the exception of special cycles)
1792165155Sscottl**								has been terminated with a Master Abort.
1793165155Sscottl** 12           0b                     Received Target Abort: The bridge sets this bit to a 1b when,
1794165155Sscottl**								acting as the initiator on the secondary bus,
1795165155Sscottl**								it's transaction has been terminated with a Target Abort.
1796165155Sscottl** 11           0b                     Signaled Target Abort: The bridge sets this bit to a 1b when it,
1797165155Sscottl**								as the target of a transaction, terminates it with a Target Abort.
1798144411Sscottl**                                                            In PCI-X mode this bit is also set when it forwards a SCM with a target abort error code.
1799144411Sscottl** 10:09       01b                            DEVSEL# Timing: Indicates slowest response to a non-configuration command on the secondary interface.
1800144411Sscottl**                                                            Returns ��01b�� when read, indicating that bridge responds no slower than with medium timing.
1801144411Sscottl** 08           0b                  Master Data Parity Error: The bridge sets this bit to a 1b when all of the following conditions are true:
1802144411Sscottl**                                                            The bridge is the current master on the secondary bus
1803144411Sscottl**                                                            S_PERR# is detected asserted or is asserted by bridge
1804144411Sscottl**                                                            The Parity Error Response bit is set in the Command register
1805144411Sscottl** 07           1b           Fast Back-to-Back Capable (FBC): Indicates that the secondary interface of bridge can receive fast back-to-back cycles.
1806144411Sscottl** 06           0b                           Reserved
1807144411Sscottl** 05           1b                      66 MHz Capable (C66): Indicates the secondary interface of the bridge is 66 MHz capable.
1808144411Sscottl**                                                            1 =
1809144411Sscottl** 04:00       00h                           Reserved
1810144411Sscottl**==============================================================================
1811144411Sscottl*/
1812144411Sscottl#define     ARCMSR_PCI2PCI_IO_BASE_REG	                     0x1C    /*byte*/
1813144411Sscottl#define     ARCMSR_PCI2PCI_IO_LIMIT_REG	                     0x1D    /*byte*/
1814144411Sscottl#define     ARCMSR_PCI2PCI_SECONDARY_STATUS_REG	             0x1E    /*word: 0x1F,0x1E */
1815144411Sscottl/*
1816144411Sscottl**==============================================================================
1817144411Sscottl**  0x23-0x20 :
1818144411Sscottl**  PCI CFG Base Address #4 (0x20)
1819144411Sscottl**-----------------0x23,0x22,0x21,0x20--Memory Base and Limit Register - MBL
1820144411Sscottl** Bit       Default                       Description
1821144411Sscottl** 31:20      000h                              Memory Limit: These 12 bits are compared with P_AD[31:20] of the incoming address to determine
1822144411Sscottl**                                                            the upper 1MB aligned value (exclusive) of the range.
1823144411Sscottl**                                                            The incoming address must be less than or equal to this value.
1824165155Sscottl**                                                            For the purposes of address decoding the lower 20 address bits (P_AD[19:0]
1825165155Sscottl**									are assumed to be F FFFFh.
1826144411Sscottl** 19:16        0h                            Reserved.
1827165155Sscottl** 15:04      000h                               Memory Base: These 12 bits are compared with bits P_AD[31:20]
1828165155Sscottl**								of the incoming address to determine the lower 1MB
1829165155Sscottl**								aligned value (inclusive) of the range.
1830144411Sscottl**                                                            The incoming address must be greater than or equal to this value.
1831165155Sscottl**                                                            For the purposes of address decoding the lower 20 address bits (P_AD[19:0])
1832165155Sscottl**								are assumed to be 0 0000h.
1833144411Sscottl** 03:00        0h                            Reserved.
1834144411Sscottl**==============================================================================
1835144411Sscottl*/
1836144411Sscottl#define     ARCMSR_PCI2PCI_NONPREFETCHABLE_MEMORY_BASE_REG   0x20    /*word: 0x21,0x20 */
1837144411Sscottl#define     ARCMSR_PCI2PCI_NONPREFETCHABLE_MEMORY_LIMIT_REG  0x22    /*word: 0x23,0x22 */
1838144411Sscottl/*
1839144411Sscottl**==============================================================================
1840144411Sscottl**  0x27-0x24 :
1841144411Sscottl**  PCI CFG Base Address #5 (0x24)
1842144411Sscottl**-----------------0x27,0x26,0x25,0x24--Prefetchable Memory Base and Limit Register - PMBL
1843144411Sscottl** Bit       Default                       Description
1844144411Sscottl** 31:20      000h                 Prefetchable Memory Limit: These 12 bits are compared with P_AD[31:20] of the incoming address to determine
1845144411Sscottl**                                                            the upper 1MB aligned value (exclusive) of the range.
1846144411Sscottl**                                                            The incoming address must be less than or equal to this value.
1847165155Sscottl**                                                            For the purposes of address decoding the lower 20 address bits (P_AD[19:0]
1848165155Sscottl**									are assumed to be F FFFFh.
1849144411Sscottl** 19:16        1h                          64-bit Indicator: Indicates that 64-bit addressing is supported.
1850165155Sscottl** 15:04      000h                  Prefetchable Memory Base: These 12 bits are compared with bits P_AD[31:20]
1851165155Sscottl**								of the incoming address to determine the lower 1MB aligned value (inclusive)
1852165155Sscottl**								of the range.
1853144411Sscottl**                                                            The incoming address must be greater than or equal to this value.
1854165155Sscottl**                                                            For the purposes of address decoding the lower 20 address bits (P_AD[19:0])
1855165155Sscottl**								 are assumed to be 0 0000h.
1856144411Sscottl** 03:00        1h                          64-bit Indicator: Indicates that 64-bit addressing is supported.
1857144411Sscottl**==============================================================================
1858144411Sscottl*/
1859144411Sscottl#define     ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_BASE_REG      0x24    /*word: 0x25,0x24 */
1860144411Sscottl#define     ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_LIMIT_REG     0x26    /*word: 0x27,0x26 */
1861144411Sscottl/*
1862144411Sscottl**==============================================================================
1863144411Sscottl**  0x2b-0x28 :
1864144411Sscottl** Bit       Default                       Description
1865144411Sscottl** 31:00    00000000h Prefetchable Memory Base Upper Portion: All bits are read/writable
1866144411Sscottl**                                                            bridge supports full 64-bit addressing.
1867144411Sscottl**==============================================================================
1868144411Sscottl*/
1869144411Sscottl#define     ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_BASE_UPPER32_REG     0x28    /*dword: 0x2b,0x2a,0x29,0x28 */
1870144411Sscottl/*
1871144411Sscottl**==============================================================================
1872144411Sscottl**  0x2f-0x2c :
1873144411Sscottl** Bit       Default                       Description
1874144411Sscottl** 31:00    00000000h Prefetchable Memory Limit Upper Portion: All bits are read/writable
1875144411Sscottl**                                                             bridge supports full 64-bit addressing.
1876144411Sscottl**==============================================================================
1877144411Sscottl*/
1878144411Sscottl#define     ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_LIMIT_UPPER32_REG    0x2C    /*dword: 0x2f,0x2e,0x2d,0x2c */
1879144411Sscottl/*
1880144411Sscottl**==============================================================================
1881144411Sscottl**  0x33-0x30 :
1882144411Sscottl** Bit       Default                       Description
1883144411Sscottl** 07:00       DCh                      Capabilities Pointer: Pointer to the first CAP ID entry in the capabilities list is at DCh in PCI configuration
1884144411Sscottl**                                                            space. (Power Management Capability Registers)
1885144411Sscottl**==============================================================================
1886144411Sscottl*/
1887144411Sscottl#define     ARCMSR_PCI2PCI_CAPABILITIES_POINTER_REG	                 0x34    /*byte*/
1888144411Sscottl/*
1889144411Sscottl**==============================================================================
1890144411Sscottl**  0x3b-0x35 : reserved
1891144411Sscottl**==============================================================================
1892144411Sscottl*/
1893165155Sscottl/*
1894144411Sscottl**==============================================================================
1895144411Sscottl**  0x3d-0x3c :
1896144411Sscottl**
1897144411Sscottl** Bit       Default                       Description
1898144411Sscottl** 15:08       00h                       Interrupt Pin (PIN): Bridges do not support the generation of interrupts.
1899144411Sscottl** 07:00       00h                     Interrupt Line (LINE): The bridge does not generate interrupts, so this is reserved as '00h'.
1900144411Sscottl**==============================================================================
1901144411Sscottl*/
1902144411Sscottl#define     ARCMSR_PCI2PCI_PRIMARY_INTERRUPT_LINE_REG                0x3C    /*byte*/
1903144411Sscottl#define     ARCMSR_PCI2PCI_PRIMARY_INTERRUPT_PIN_REG                 0x3D    /*byte*/
1904144411Sscottl/*
1905144411Sscottl**==============================================================================
1906144411Sscottl**  0x3f-0x3e :
1907144411Sscottl** Bit       Default                       Description
1908144411Sscottl** 15:12        0h                          Reserved
1909144411Sscottl** 11           0b                Discard Timer SERR# Enable: Controls the generation of SERR# on the primary interface (P_SERR#) in response
1910144411Sscottl**                                                            to a timer discard on either the primary or secondary interface.
1911144411Sscottl**                                                            0b=SERR# is not asserted.
1912144411Sscottl**                                                            1b=SERR# is asserted.
1913144411Sscottl** 10           0b                Discard Timer Status (DTS): This bit is set to a '1b' when either the primary or secondary discard timer expires.
1914144411Sscottl**                                                            The delayed completion is then discarded.
1915165155Sscottl** 09           0b             Secondary Discard Timer (SDT): Sets the maximum number of PCI clock cycles
1916165155Sscottl**									that bridge waits for an initiator on the secondary bus
1917165155Sscottl**									to repeat a delayed transaction request.
1918165155Sscottl**                                                            The counter starts when the delayed transaction completion is ready
1919165155Sscottl**									to be returned to the initiator.
1920165155Sscottl**                                                            When the initiator has not repeated the transaction
1921165155Sscottl**									at least once before the counter expires,bridge
1922165155Sscottl**										discards the delayed transaction from its queues.
1923144411Sscottl**                                                            0b=The secondary master time-out counter is 2 15 PCI clock cycles.
1924144411Sscottl**                                                            1b=The secondary master time-out counter is 2 10 PCI clock cycles.
1925165155Sscottl** 08           0b               Primary Discard Timer (PDT): Sets the maximum number of PCI clock cycles
1926165155Sscottl**									that bridge waits for an initiator on the primary bus
1927165155Sscottl**									to repeat a delayed transaction request.
1928165155Sscottl**                                                            The counter starts when the delayed transaction completion
1929165155Sscottl**									is ready to be returned to the initiator.
1930165155Sscottl**                                                            When the initiator has not repeated the transaction
1931165155Sscottl**									at least once before the counter expires,
1932165155Sscottl**									bridge discards the delayed transaction from its queues.
1933144411Sscottl**                                                            0b=The primary master time-out counter is 2 15 PCI clock cycles.
1934144411Sscottl**                                                            1b=The primary master time-out counter is 2 10 PCI clock cycles.
1935144411Sscottl** 07           0b            Fast Back-to-Back Enable (FBE): The bridge does not initiate back to back transactions.
1936144411Sscottl** 06           0b                 Secondary Bus Reset (SBR):
1937165155Sscottl**                                                            When cleared to 0b: The bridge deasserts S_RST#,
1938165155Sscottl**									when it had been asserted by writing this bit to a 1b.
1939144411Sscottl**                                                                When set to 1b: The bridge asserts S_RST#.
1940165155Sscottl** 05           0b                   Master Abort Mode (MAM): Dictates bridge behavior on the initiator bus
1941165155Sscottl**									when a master abort termination occurs in response to
1942165155Sscottl**										a delayed transaction initiated by bridge on the target bus.
1943165155Sscottl**                                                            0b=The bridge asserts TRDY# in response to a non-locked delayed transaction,
1944165155Sscottl**										and returns FFFF FFFFh when a read.
1945165155Sscottl**                                                            1b=When the transaction had not yet been completed on the initiator bus
1946165155Sscottl**										(e.g.,delayed reads, or non-posted writes),
1947144411Sscottl**                                                                 then bridge returns a Target Abort in response to the original requester
1948144411Sscottl**                                                                 when it returns looking for its delayed completion on the initiator bus.
1949165155Sscottl**                                                                 When the transaction had completed on the initiator bus (e.g., a PMW),
1950165155Sscottl**										then bridge asserts P_SERR# (when enabled).
1951165155Sscottl**                                   For PCI-X transactions this bit is an enable for the assertion of P_SERR# due to a master abort
1952165155Sscottl**								while attempting to deliver a posted memory write on the destination bus.
1953165155Sscottl** 04           0b                   VGA Alias Filter Enable: This bit dictates bridge behavior in conjunction with the VGA enable bit
1954165155Sscottl**								(also of this register),
1955144411Sscottl**                                                            and the VGA Palette Snoop Enable bit (Command Register).
1956165155Sscottl**                                                            When the VGA enable, or VGA Palette Snoop enable bits are on (i.e., 1b)
1957165155Sscottl**									the VGA Aliasing bit for the corresponding enabled functionality,:
1958144411Sscottl**                                                            0b=Ignores address bits AD[15:10] when decoding VGA I/O addresses.
1959144411Sscottl**                                                            1b=Ensures that address bits AD[15:10] equal 000000b when decoding VGA I/O addresses.
1960165155Sscottl**                                   When all VGA cycle forwarding is disabled, (i.e., VGA Enable bit =0b and VGA Palette Snoop bit =0b),
1961165155Sscottl**									then this bit has no impact on bridge behavior.
1962165155Sscottl** 03           0b                                VGA Enable: Setting this bit enables address decoding
1963165155Sscottl**								 and transaction forwarding of the following VGA transactions from the primary bus
1964165155Sscottl**									to the secondary bus:
1965165155Sscottl**                                                            frame buffer memory addresses 000A0000h:000BFFFFh,
1966174451Sscottl**									VGA I/O addresses 3B0:3BBh and 3C0h:3DFh, where AD[31:16]=��0000h?**									?and AD[15:10] are either not decoded (i.e., don't cares),
1967165155Sscottl**										 or must be ��000000b��
1968144411Sscottl**                                                            depending upon the state of the VGA Alias Filter Enable bit. (bit(4) of this register)
1969165155Sscottl**                                                            I/O and Memory Enable bits must be set in the Command register
1970165155Sscottl**										to enable forwarding of VGA cycles.
1971165155Sscottl** 02           0b                                ISA Enable: Setting this bit enables special handling
1972165155Sscottl**								for the forwarding of ISA I/O transactions that fall within the address range
1973165155Sscottl**									specified by the I/O Base and Limit registers,
1974165155Sscottl**										and are within the lowest 64Kbyte of the I/O address map
1975165155Sscottl**											(i.e., 0000 0000h - 0000 FFFFh).
1976165155Sscottl**                                                            0b=All I/O transactions that fall within the I/O Base
1977165155Sscottl**										and Limit registers' specified range are forwarded
1978165155Sscottl**											from primary to secondary unfiltered.
1979165155Sscottl**                                                            1b=Blocks the forwarding from primary to secondary
1980165155Sscottl**											of the top 768 bytes of each 1Kbyte alias.
1981165155Sscottl**												On the secondary the top 768 bytes of each 1K alias
1982165155Sscottl**													are inversely decoded and forwarded
1983165155Sscottl**														from secondary to primary.
1984144411Sscottl** 01           0b                      SERR# Forward Enable: 0b=The bridge does not assert P_SERR# as a result of an S_SERR# assertion.
1985165155Sscottl**                                                            1b=The bridge asserts P_SERR# whenever S_SERR# is detected
1986165155Sscottl**									asserted provided the SERR# Enable bit is set (PCI Command Register bit(8)=1b).
1987165155Sscottl** 00           0b                     Parity Error Response: This bit controls bridge response to a parity error
1988165155Sscottl**										that is detected on its secondary interface.
1989144411Sscottl**                                                            0b=When a data parity error is detected bridge does not assert S_PERR#.
1990165155Sscottl**                                                            Also bridge does not assert P_SERR# in response to a detected address
1991165155Sscottl**										or attribute parity error.
1992165155Sscottl**                                                            1b=When a data parity error is detected bridge asserts S_PERR#.
1993165155Sscottl**										The bridge also asserts P_SERR# (when enabled globally via bit(8)
1994165155Sscottl**											of the Command register)
1995144411Sscottl**                                                            in response to a detected address or attribute parity error.
1996144411Sscottl**==============================================================================
1997144411Sscottl*/
1998144411Sscottl#define     ARCMSR_PCI2PCI_BRIDGE_CONTROL_REG	                     0x3E    /*word*/
1999144411Sscottl/*
2000144411Sscottl**************************************************************************
2001144411Sscottl**                  Device Specific Registers 40-A7h
2002144411Sscottl**************************************************************************
2003144411Sscottl** ----------------------------------------------------------------------------------------------------------
2004144411Sscottl** |    Byte 3              |         Byte 2         |        Byte 1          |       Byte 0              | Configu-ration Byte Offset
2005144411Sscottl** ----------------------------------------------------------------------------------------------------------
2006144411Sscottl** |    Bridge Control 0    |             Arbiter Control/Status              |      Reserved             | 40h
2007144411Sscottl** ----------------------------------------------------------------------------------------------------------
2008144411Sscottl** |                 Bridge Control 2                |                 Bridge Control 1                   | 44h
2009144411Sscottl** ----------------------------------------------------------------------------------------------------------
2010144411Sscottl** |                    Reserved                     |                 Bridge Status                      | 48h
2011144411Sscottl** ----------------------------------------------------------------------------------------------------------
2012144411Sscottl** |                                             Reserved                                                 | 4Ch
2013144411Sscottl** ----------------------------------------------------------------------------------------------------------
2014144411Sscottl** |                 Prefetch Policy                 |               Multi-Transaction Timer              | 50h
2015144411Sscottl** ----------------------------------------------------------------------------------------------------------
2016144411Sscottl** |       Reserved         |      Pre-boot Status   |             P_SERR# Assertion Control              | 54h
2017144411Sscottl** ----------------------------------------------------------------------------------------------------------
2018144411Sscottl** |       Reserved         |        Reserved        |             Secondary Decode Enable                | 58h
2019144411Sscottl** ----------------------------------------------------------------------------------------------------------
2020144411Sscottl** |                    Reserved                     |                 Secondary IDSEL                    | 5Ch
2021144411Sscottl** ----------------------------------------------------------------------------------------------------------
2022144411Sscottl** |                                              Reserved                                                | 5Ch
2023144411Sscottl** ----------------------------------------------------------------------------------------------------------
2024144411Sscottl** |                                              Reserved                                                | 68h:CBh
2025144411Sscottl** ----------------------------------------------------------------------------------------------------------
2026144411Sscottl**************************************************************************
2027144411Sscottl**==============================================================================
2028144411Sscottl**  0x42-0x41: Secondary Arbiter Control/Status Register - SACSR
2029144411Sscottl** Bit       Default                       Description
2030165155Sscottl** 15:12      1111b                  Grant Time-out Violator: This field indicates the agent that violated the Grant Time-out rule
2031165155Sscottl**							(PCI=16 clocks,PCI-X=6 clocks).
2032144411Sscottl**                                   Note that this field is only meaningful when:
2033165155Sscottl**                                                              # Bit[11] of this register is set to 1b,
2034165155Sscottl**									indicating that a Grant Time-out violation had occurred.
2035144411Sscottl**                                                              # bridge internal arbiter is enabled.
2036144411Sscottl**                                           Bits[15:12] Violating Agent (REQ#/GNT# pair number)
2037144411Sscottl**                                                 0000b REQ#/GNT#[0]
2038144411Sscottl**                                                 0001b REQ#/GNT#[1]
2039144411Sscottl**                                                 0010b REQ#/GNT#[2]
2040144411Sscottl**                                                 0011b REQ#/GNT#[3]
2041144411Sscottl**                                                 1111b Default Value (no violation detected)
2042144411Sscottl**                                   When bit[11] is cleared by software, this field reverts back to its default value.
2043144411Sscottl**                                   All other values are Reserved
2044144411Sscottl** 11            0b                  Grant Time-out Occurred: When set to 1b,
2045144411Sscottl**                                   this indicates that a Grant Time-out error had occurred involving one of the secondary bus agents.
2046144411Sscottl**                                   Software clears this bit by writing a 1b to it.
2047144411Sscottl** 10            0b                      Bus Parking Control: 0=During bus idle, bridge parks the bus on the last master to use the bus.
2048165155Sscottl**                                                            1=During bus idle, bridge parks the bus on itself.
2049165155Sscottl**									The bus grant is removed from the last master and internally asserted to bridge.
2050144411Sscottl** 09:08        00b                          Reserved
2051144411Sscottl** 07:00      0000 0000b  Secondary Bus Arbiter Priority Configuration: The bridge secondary arbiter provides two rings of arbitration priority.
2052165155Sscottl**                                                                      Each bit of this field assigns its corresponding secondary
2053165155Sscottl**										bus master to either the high priority arbiter ring (1b)
2054165155Sscottl**											or to the low priority arbiter ring (0b).
2055144411Sscottl**                                                                      Bits [3:0] correspond to request inputs S_REQ#[3:0], respectively.
2056165155Sscottl**                                                                      Bit [6] corresponds to the bridge internal secondary bus request
2057165155Sscottl**										while Bit [7] corresponds to the SATU secondary bus request.
2058144411Sscottl**                                                                      Bits [5:4] are unused.
2059144411Sscottl**                                                                      0b=Indicates that the master belongs to the low priority group.
2060144411Sscottl**                                                                      1b=Indicates that the master belongs to the high priority group
2061144411Sscottl**=================================================================================
2062144411Sscottl**  0x43: Bridge Control Register 0 - BCR0
2063144411Sscottl** Bit       Default                       Description
2064165155Sscottl** 07           0b                  Fully Dynamic Queue Mode: 0=The number of Posted write transactions is limited to eight
2065165155Sscottl**									and the Posted Write data is limited to 4KB.
2066165155Sscottl**                                                            1=Operation in fully dynamic queue mode. The bridge enqueues up to
2067165155Sscottl**									14 Posted Memory Write transactions and 8KB of posted write data.
2068144411Sscottl** 06:03        0H                          Reserved.
2069165155Sscottl** 02           0b                 Upstream Prefetch Disable: This bit disables bridge ability
2070165155Sscottl**									to perform upstream prefetch operations for Memory
2071165155Sscottl**										Read requests received on its secondary interface.
2072165155Sscottl**                                 This bit also controls the bridge's ability to generate advanced read commands
2073165155Sscottl**								when forwarding a Memory Read Block transaction request upstream from a PCI-X bus
2074165155Sscottl**										to a Conventional PCI bus.
2075165155Sscottl**                                 0b=bridge treats all upstream Memory Read requests as though they target prefetchable memory.
2076165155Sscottl**										The use of Memory Read Line and Memory Read
2077165155Sscottl**                                      Multiple is enabled when forwarding a PCI-X Memory Read Block request
2078165155Sscottl**										to an upstream bus operating in Conventional PCI mode.
2079165155Sscottl**                                 1b=bridge treats upstream PCI Memory Read requests as though
2080165155Sscottl**									they target non-prefetchable memory and forwards upstream PCI-X Memory
2081165155Sscottl**											Read Block commands as Memory Read
2082165155Sscottl**												when the primary bus is operating
2083165155Sscottl**													in Conventional PCI mode.
2084165155Sscottl**                                 NOTE: This bit does not affect bridge ability to perform read prefetching
2085165155Sscottl**									when the received command is Memory Read Line or Memory Read Multiple.
2086144411Sscottl**=================================================================================
2087144411Sscottl**  0x45-0x44: Bridge Control Register 1 - BCR1 (Sheet 2 of 2)
2088144411Sscottl** Bit       Default                       Description
2089144411Sscottl** 15:08    0000000b                         Reserved
2090165155Sscottl** 07:06         00b                   Alias Command Mapping: This two bit field determines how bridge handles PCI-X ��Alias�� commands,
2091165155Sscottl**								specifically the Alias to Memory Read Block and Alias to Memory Write Block commands.
2092165155Sscottl**                                                            The three options for handling these alias commands are to either pass it as is,
2093165155Sscottl**									re-map to the actual block memory read/write command encoding, or ignore
2094165155Sscottl**                                                            			the transaction forcing a Master Abort to occur on the Origination Bus.
2095144411Sscottl**                                                   Bit (7:6) Handling of command
2096144411Sscottl**                                                        0 0 Re-map to Memory Read/Write Block before forwarding
2097144411Sscottl**                                                        0 1 Enqueue and forward the alias command code unaltered
2098144411Sscottl**                                                        1 0 Ignore the transaction, forcing Master Abort
2099144411Sscottl**                                                        1 1 Reserved
2100144411Sscottl** 05            1b                  Watchdog Timers Disable: Disables or enables all 2 24 Watchdog Timers in both directions.
2101144411Sscottl**                                                            The watchdog timers are used to detect prohibitively long latencies in the system.
2102144411Sscottl**                                                            The watchdog timer expires when any Posted Memory Write (PMW), Delayed Request,
2103144411Sscottl**                                                            or Split Requests (PCI-X mode) is not completed within 2 24 events
2104165155Sscottl**                                                            (��events�� are defined as PCI Clocks when operating in PCI-X mode,
2105165155Sscottl**								and as the number of times being retried when operating in Conventional PCI mode)
2106144411Sscottl**                                                            0b=All 2 24 watchdog timers are enabled.
2107165155Sscottl**                                                            1b=All 2 24 watchdog timers are disabled and there is no limits to
2108165155Sscottl**									the number of attempts bridge makes when initiating a PMW,
2109165155Sscottl**                                                                 transacting a Delayed Transaction, or how long it waits for
2110165155Sscottl**									a split completion corresponding to one of its requests.
2111144411Sscottl** 04            0b                  GRANT# time-out disable: This bit enables/disables the GNT# time-out mechanism.
2112144411Sscottl**                                                            Grant time-out is 16 clocks for conventional PCI, and 6 clocks for PCI-X.
2113165155Sscottl**                                                            0b=The Secondary bus arbiter times out an agent
2114165155Sscottl**									that does not assert FRAME# within 16/6 clocks of receiving its grant,
2115165155Sscottl**										once the bus has gone idle.
2116144411Sscottl**                                                                 The time-out counter begins as soon as the bus goes idle with the new GNT# asserted.
2117165155Sscottl**                                                                 An infringing agent does not receive a subsequent GNT#
2118165155Sscottl**									until it de-asserts its REQ# for at least one clock cycle.
2119144411Sscottl**                                                            1b=GNT# time-out mechanism is disabled.
2120144411Sscottl** 03           00b                           Reserved.
2121144411Sscottl** 02            0b          Secondary Discard Timer Disable: This bit enables/disables bridge secondary delayed transaction discard mechanism.
2122165155Sscottl**                                                            The time out mechanism is used to ensure that initiators
2123165155Sscottl**									of delayed transactions return for their delayed completion data/status
2124165155Sscottl**										within a reasonable amount of time after it is available from bridge.
2125165155Sscottl**                                                            0b=The secondary master time-out counter is enabled
2126165155Sscottl**										and uses the value specified by the Secondary Discard Timer bit
2127165155Sscottl**											(see Bridge Control Register).
2128165155Sscottl**                                                            1b=The secondary master time-out counter is disabled.
2129165155Sscottl**											The bridge waits indefinitely for a secondary bus master
2130165155Sscottl**												to repeat a delayed transaction.
2131165155Sscottl** 01            0b            Primary Discard Timer Disable: This bit enables/disables bridge primary delayed transaction discard mechanism.
2132165155Sscottl**								The time out mechanism is used to ensure that initiators
2133165155Sscottl**									of delayed transactions return for their delayed completion data/status
2134165155Sscottl**										within a reasonable amount of time after it is available from bridge.
2135165155Sscottl**                                                            0b=The primary master time-out counter is enabled and uses the value specified
2136165155Sscottl**									by the Primary Discard Timer bit (see Bridge Control Register).
2137165155Sscottl**                                                            1b=The secondary master time-out counter is disabled.
2138165155Sscottl**									The bridge waits indefinitely for a secondary bus master
2139165155Sscottl**										to repeat a delayed transaction.
2140144411Sscottl** 00            0b                           Reserved
2141144411Sscottl**=================================================================================
2142144411Sscottl**  0x47-0x46: Bridge Control Register 2 - BCR2
2143144411Sscottl** Bit       Default                       Description
2144144411Sscottl** 15:07      0000b                          Reserved.
2145165155Sscottl** 06            0b Global Clock Out Disable (External Secondary Bus Clock Source Enable):
2146165155Sscottl**									This bit disables all of the secondary PCI clock outputs including
2147165155Sscottl**										the feedback clock S_CLKOUT.
2148144411Sscottl**                                                            This means that the user is required to provide an S_CLKIN input source.
2149144411Sscottl** 05:04        11 (66 MHz)                  Preserved.
2150144411Sscottl**              01 (100 MHz)
2151144411Sscottl**              00 (133 MHz)
2152144411Sscottl** 03:00        Fh (100 MHz & 66 MHz)
2153144411Sscottl**              7h (133 MHz)
2154144411Sscottl**                                        This 4 bit field provides individual enable/disable mask bits for each of bridge
2155144411Sscottl**                                        secondary PCI clock outputs. Some, or all secondary clock outputs (S_CLKO[3:0])
2156144411Sscottl**                                        default to being enabled following the rising edge of P_RST#, depending on the
2157144411Sscottl**                                        frequency of the secondary bus clock:
2158165155Sscottl**                                               �E Designs with 100 MHz (or lower) Secondary PCI clock power up with
2159165155Sscottl**								all four S_CLKOs enabled by default. (SCLKO[3:0])�P
2160165155Sscottl**                                               �E Designs with 133 MHz Secondary PCI clock power up
2161165155Sscottl**								with the lower order 3 S_CLKOs enabled by default.
2162165155Sscottl**								(S_CLKO[2:0]) Only those SCLKs that power up enabled by can be connected
2163165155Sscottl**								to downstream device clock inputs.
2164144411Sscottl**=================================================================================
2165144411Sscottl**  0x49-0x48: Bridge Status Register - BSR
2166144411Sscottl** Bit       Default                       Description
2167165155Sscottl** 15           0b  Upstream Delayed Transaction Discard Timer Expired: This bit is set to a 1b and P_SERR#
2168165155Sscottl**									is conditionally asserted when the secondary discard timer expires.
2169144411Sscottl** 14           0b  Upstream Delayed/Split Read Watchdog Timer Expired:
2170165155Sscottl**                                                     Conventional PCI Mode: This bit is set to a 1b and P_SERR#
2171165155Sscottl**									is conditionally asserted when bridge discards an upstream delayed read **	**									transaction request after 2 24 retries following the initial retry.
2172165155Sscottl**                                                                PCI-X Mode: This bit is set to a 1b and P_SERR# is conditionally asserted
2173165155Sscottl**									when bridge discards an upstream split read request
2174165155Sscottl**									after waiting in excess of 2 24 clocks for the corresponding
2175165155Sscottl**									Split Completion to arrive.
2176144411Sscottl** 13           0b Upstream Delayed/Split Write Watchdog Timer Expired:
2177165155Sscottl**                                                     Conventional PCI Mode: This bit is set to a 1b and P_SERR#
2178165155Sscottl**									is conditionally asserted when bridge discards an upstream delayed write **	**									transaction request after 2 24 retries following the initial retry.
2179165155Sscottl**                                                                PCI-X Mode: This bit is set to a 1b and P_SERR#
2180165155Sscottl**									is conditionally asserted when bridge discards an upstream split write request **									after waiting in excess of 2 24 clocks for the corresponding
2181165155Sscottl**									Split Completion to arrive.
2182165155Sscottl** 12           0b           Master Abort during Upstream Posted Write: This bit is set to a 1b and P_SERR#
2183165155Sscottl**									is conditionally asserted when a Master Abort occurs as a result of an attempt,
2184165155Sscottl**									by bridge, to retire a PMW upstream.
2185165155Sscottl** 11           0b           Target Abort during Upstream Posted Write: This bit is set to a 1b and P_SERR#
2186165155Sscottl**									is conditionally asserted when a Target Abort occurs as a result of an attempt,
2187165155Sscottl**									by bridge, to retire a PMW upstream.
2188165155Sscottl** 10           0b                Upstream Posted Write Data Discarded: This bit is set to a 1b and P_SERR#
2189165155Sscottl**									is conditionally asserted when bridge discards an upstream PMW transaction
2190165155Sscottl**									after receiving 2 24 target retries from the primary bus target
2191165155Sscottl** 09           0b             Upstream Posted Write Data Parity Error: This bit is set to a 1b and P_SERR#
2192165155Sscottl**									is conditionally asserted when a data parity error is detected by bridge
2193165155Sscottl**									while attempting to retire a PMW upstream
2194165155Sscottl** 08           0b                  Secondary Bus Address Parity Error: This bit is set to a 1b and P_SERR#
2195165155Sscottl**									is conditionally asserted when bridge detects an address parity error on
2196165155Sscottl**									the secondary bus.
2197165155Sscottl** 07           0b Downstream Delayed Transaction Discard Timer Expired: This bit is set to a 1b and P_SERR#
2198165155Sscottl**									is conditionally asserted when the primary bus discard timer expires.
2199144411Sscottl** 06           0b Downstream Delayed/Split Read Watchdog Timer Expired:
2200165155Sscottl**                                                     Conventional PCI Mode: This bit is set to a 1b and P_SERR#
2201165155Sscottl**									is conditionally asserted when bridge discards a downstream delayed read **	**										transaction request after receiving 2 24 target retries
2202165155Sscottl**											 from the secondary bus target.
2203165155Sscottl**                                                                PCI-X Mode: This bit is set to a 1b and P_SERR# is conditionally asserted
2204165155Sscottl**										when bridge discards a downstream split read request
2205165155Sscottl**											after waiting in excess of 2 24 clocks for the corresponding
2206165155Sscottl**												Split Completion to arrive.
2207144411Sscottl** 05           0b Downstream Delayed Write/Split Watchdog Timer Expired:
2208165155Sscottl**                                                     Conventional PCI Mode: This bit is set to a 1b and P_SERR# is conditionally asserted
2209165155Sscottl**									when bridge discards a downstream delayed write transaction request
2210165155Sscottl**										after receiving 2 24 target retries from the secondary bus target.
2211165155Sscottl**                                                                PCI-X Mode: This bit is set to a 1b and P_SERR#
2212165155Sscottl**									is conditionally asserted when bridge discards a downstream
2213165155Sscottl**										split write request after waiting in excess of 2 24 clocks
2214165155Sscottl**											for the corresponding Split Completion to arrive.
2215165155Sscottl** 04           0b          Master Abort during Downstream Posted Write: This bit is set to a 1b and P_SERR#
2216165155Sscottl**									is conditionally asserted when a Master Abort occurs as a result of an attempt,
2217165155Sscottl**										by bridge, to retire a PMW downstream.
2218165155Sscottl** 03           0b          Target Abort during Downstream Posted Write: This bit is set to a 1b and P_SERR# is conditionally asserted
2219165155Sscottl**										when a Target Abort occurs as a result of an attempt, by bridge,
2220165155Sscottl**											to retire a PMW downstream.
2221165155Sscottl** 02           0b               Downstream Posted Write Data Discarded: This bit is set to a 1b and P_SERR#
2222165155Sscottl**									is conditionally asserted when bridge discards a downstream PMW transaction
2223165155Sscottl**										after receiving 2 24 target retries from the secondary bus target
2224165155Sscottl** 01           0b            Downstream Posted Write Data Parity Error: This bit is set to a 1b and P_SERR#
2225165155Sscottl**									is conditionally asserted when a data parity error is detected by bridge
2226165155Sscottl**										while attempting to retire a PMW downstream.
2227165155Sscottl** 00           0b                     Primary Bus Address Parity Error: This bit is set to a 1b and P_SERR# is conditionally asserted
2228165155Sscottl**										when bridge detects an address parity error on the primary bus.
2229144411Sscottl**==================================================================================
2230144411Sscottl**  0x51-0x50: Bridge Multi-Transaction Timer Register - BMTTR
2231144411Sscottl** Bit       Default                       Description
2232144411Sscottl** 15:13       000b                          Reserved
2233165155Sscottl** 12:10       000b                          GRANT# Duration: This field specifies the count (PCI clocks)
2234165155Sscottl**							that a secondary bus master has its grant maintained in order to enable
2235165155Sscottl**								multiple transactions to execute within the same arbitration cycle.
2236144411Sscottl**                                                    Bit[02:00] GNT# Extended Duration
2237144411Sscottl**                                                               000 MTT Disabled (Default=no GNT# extension)
2238144411Sscottl**                                                               001 16 clocks
2239144411Sscottl**                                                               010 32 clocks
2240144411Sscottl**                                                               011 64 clocks
2241144411Sscottl**                                                               100 128 clocks
2242144411Sscottl**                                                               101 256 clocks
2243144411Sscottl**                                                               110 Invalid (treated as 000)
2244144411Sscottl**                                                               111 Invalid (treated as 000)
2245144411Sscottl** 09:08        00b                          Reserved
2246165155Sscottl** 07:00        FFh                                 MTT Mask: This field enables/disables MTT usage for each REQ#/GNT#
2247165155Sscottl**								pair supported by bridge secondary arbiter.
2248144411Sscottl**                                                            Bit(7) corresponds to SATU internal REQ#/GNT# pair,
2249144411Sscottl**                                                            bit(6) corresponds to bridge internal REQ#/GNT# pair,
2250144411Sscottl**                                                            bit(5) corresponds to REQ#/GNT#(5) pair, etc.
2251165155Sscottl**                                                  When a given bit is set to 1b, its corresponding REQ#/GNT#
2252165155Sscottl**								pair is enabled for MTT functionality as determined by bits(12:10) of this register.
2253144411Sscottl**                                                  When a given bit is cleared to 0b, its corresponding REQ#/GNT# pair is disabled from using the MTT.
2254144411Sscottl**==================================================================================
2255144411Sscottl**  0x53-0x52: Read Prefetch Policy Register - RPPR
2256144411Sscottl** Bit       Default                       Description
2257165155Sscottl** 15:13       000b                    ReRead_Primary Bus: 3-bit field indicating the multiplication factor
2258165155Sscottl**							to be used in calculating the number of bytes to prefetch from the secondary bus interface on **								subsequent PreFetch operations given that the read demands were not satisfied
2259165155Sscottl**									using the FirstRead parameter.
2260165155Sscottl**                                           The default value of 000b correlates to: Command Type Hardwired pre-fetch amount Memory Read 4 DWORDs
2261165155Sscottl**							Memory Read Line 1 cache lines Memory Read Multiple 2 cache lines
2262165155Sscottl** 12:10       000b                 FirstRead_Primary Bus: 3-bit field indicating the multiplication factor to be used in calculating
2263165155Sscottl**							the number of bytes to prefetch from the secondary bus interface
2264165155Sscottl**								on the initial PreFetch operation.
2265165155Sscottl**                                           The default value of 000b correlates to: Command Type Hardwired pre-fetch amount Memory Read 4 DWORDs
2266165155Sscottl**								Memory Read Line 1 cache line Memory Read Multiple 2 cache lines
2267165155Sscottl** 09:07       010b                  ReRead_Secondary Bus: 3-bit field indicating the multiplication factor to be used
2268165155Sscottl**								in calculating the number of bytes to prefetch from the primary
2269165155Sscottl**									bus interface on subsequent PreFetch operations given
2270165155Sscottl**										that the read demands were not satisfied using
2271165155Sscottl**											the FirstRead parameter.
2272165155Sscottl**                                           The default value of 010b correlates to: Command Type Hardwired pre-fetch a
2273165155Sscottl**							mount Memory Read 3 cache lines Memory Read Line 3 cache lines
2274165155Sscottl**								Memory Read Multiple 6 cache lines
2275165155Sscottl** 06:04       000b               FirstRead_Secondary Bus: 3-bit field indicating the multiplication factor to be used
2276165155Sscottl**							in calculating the number of bytes to prefetch from
2277165155Sscottl**								the primary bus interface on the initial PreFetch operation.
2278165155Sscottl**                                           The default value of 000b correlates to: Command Type Hardwired pre-fetch amount
2279165155Sscottl**							Memory Read 4 DWORDs Memory Read Line 1 cache line Memory Read Multiple 2 cache lines
2280165155Sscottl** 03:00      1111b                Staged Prefetch Enable: This field enables/disables the FirstRead/ReRead pre-fetch
2281165155Sscottl**							algorithm for the secondary and the primary bus interfaces.
2282144411Sscottl**                                                         Bit(3) is a ganged enable bit for REQ#/GNT#[7:3], and bits(2:0) provide individual
2283165155Sscottl**                                                                            enable bits for REQ#/GNT#[2:0].
2284165155Sscottl**							  (bit(2) is the enable bit for REQ#/GNT#[2], etc...)
2285144411Sscottl**                                                                            1b: enables the staged pre-fetch feature
2286144411Sscottl**                                                                            0b: disables staged pre-fetch,
2287144411Sscottl**                                                         and hardwires read pre-fetch policy to the following for
2288144411Sscottl**                                                         Memory Read,
2289144411Sscottl**                                                         Memory Read Line,
2290144411Sscottl**                                                     and Memory Read Multiple commands:
2291144411Sscottl**                                                     Command Type Hardwired Pre-Fetch Amount...
2292144411Sscottl**                                                                                      Memory Read 4 DWORDs
2293144411Sscottl**                                                                                      Memory Read Line 1 cache line
2294144411Sscottl**                                                                                      Memory Read Multiple 2 cache lines
2295165155Sscottl** NOTE: When the starting address is not cache line aligned, bridge pre-fetches Memory Read line commands
2296165155Sscottl** only to the next higher cache line boundary.For non-cache line aligned Memory Read
2297165155Sscottl** Multiple commands bridge pre-fetches only to the second cache line boundary encountered.
2298144411Sscottl**==================================================================================
2299144411Sscottl**  0x55-0x54: P_SERR# Assertion Control - SERR_CTL
2300144411Sscottl** Bit       Default                       Description
2301165155Sscottl**  15          0b   Upstream Delayed Transaction Discard Timer Expired: Dictates the bridge behavior
2302165155Sscottl** 						in response to its discarding of a delayed transaction that was initiated from the primary bus.
2303144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2304144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2305144411Sscottl**  14          0b   Upstream Delayed/Split Read Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.
2306144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2307144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2308144411Sscottl**  13          0b   Upstream Delayed/Split Write Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.
2309144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2310144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2311165155Sscottl**  12          0b             Master Abort during Upstream Posted Write: Dictates bridge behavior following
2312165155Sscottl**						its having detected a Master Abort while attempting to retire one of its PMWs upstream.
2313144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2314144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2315165155Sscottl**  11          0b             Target Abort during Upstream Posted Write: Dictates bridge behavior following
2316165155Sscottl**						its having been terminated with Target Abort while attempting to retire one of its PMWs upstream.
2317144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2318144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2319165155Sscottl**  10          0b                  Upstream Posted Write Data Discarded: Dictates bridge behavior in the event that
2320165155Sscottl**						it discards an upstream posted write transaction.
2321144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2322144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2323165155Sscottl**  09          0b               Upstream Posted Write Data Parity Error: Dictates bridge behavior
2324165155Sscottl**						when a data parity error is detected while attempting to retire on of its PMWs upstream.
2325144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2326144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2327165155Sscottl**  08          0b                    Secondary Bus Address Parity Error: This bit dictates bridge behavior
2328165155Sscottl**						when it detects an address parity error on the secondary bus.
2329144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2330144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2331165155Sscottl**  07          0b  Downstream Delayed Transaction Discard Timer Expired: Dictates bridge behavior in response to
2332165155Sscottl**						its discarding of a delayed transaction that was initiated on the secondary bus.
2333144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2334144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2335144411Sscottl**  06          0b  Downstream Delayed/Split Read Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.
2336144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2337144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2338144411Sscottl**  05          0b Downstream Delayed/Split Write Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.
2339144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2340144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2341165155Sscottl**  04          0b           Master Abort during Downstream Posted Write: Dictates bridge behavior following
2342165155Sscottl**						its having detected a Master Abort while attempting to retire one of its PMWs downstream.
2343144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2344144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2345165155Sscottl**  03          0b           Target Abort during Downstream Posted Write: Dictates bridge behavior following
2346165155Sscottl**						its having been terminated with Target Abort while attempting to retire one of its PMWs downstream.
2347144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2348144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2349165155Sscottl**  02          0b                Downstream Posted Write Data Discarded: Dictates bridge behavior in the event
2350165155Sscottl**						that it discards a downstream posted write transaction.
2351144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2352144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2353165155Sscottl**  01          0b             Downstream Posted Write Data Parity Error: Dictates bridge behavior
2354165155Sscottl**						when a data parity error is detected while attempting to retire on of its PMWs downstream.
2355144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2356144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2357165155Sscottl**  00          0b                      Primary Bus Address Parity Error: This bit dictates bridge behavior
2358165155Sscottl**						when it detects an address parity error on the primary bus.
2359144411Sscottl**                                                                       0b=bridge asserts P_SERR#.
2360144411Sscottl**                                                                       1b=bridge does not assert P_SERR#
2361144411Sscottl**===============================================================================
2362144411Sscottl**  0x56: Pre-Boot Status Register - PBSR
2363144411Sscottl** Bit       Default                       							Description
2364144411Sscottl** 07           1                          							 Reserved
2365144411Sscottl** 06           -                          							 Reserved - value indeterminate
2366144411Sscottl** 05:02        0                          							 Reserved
2367165155Sscottl** 01      Varies with External State of S_133EN at PCI Bus Reset    Secondary Bus Max Frequency Setting:
2368165155Sscottl**									 This bit reflect captured S_133EN strap,
2369165155Sscottl**										indicating the maximum secondary bus clock frequency when in PCI-X mode.
2370144411Sscottl**                                                                   Max Allowable Secondary Bus Frequency
2371165155Sscottl**																			**						S_133EN PCI-X Mode
2372165155Sscottl**																			**						0 100 MHz
2373165155Sscottl**																			**						1 133 MH
2374144411Sscottl** 00          0b                                                    Reserved
2375144411Sscottl**===============================================================================
2376144411Sscottl**  0x59-0x58: Secondary Decode Enable Register - SDER
2377144411Sscottl** Bit       Default                       							Description
2378144411Sscottl** 15:03      FFF1h                        							 Preserved.
2379165155Sscottl** 02     Varies with External State of PRIVMEM at PCI Bus Reset   Private Memory Space Enable - when set,
2380165155Sscottl**									bridge overrides its secondary inverse decode logic and not
2381144411Sscottl**                                                                 forward upstream any secondary bus initiated DAC Memory transactions with AD(63)=1b.
2382165155Sscottl**                                                                 This creates a private memory space on the Secondary PCI bus
2383165155Sscottl**									that allows peer-to-peer transactions.
2384144411Sscottl** 01:00      10 2                                                   Preserved.
2385144411Sscottl**===============================================================================
2386144411Sscottl**  0x5D-0x5C: Secondary IDSEL Select Register - SISR
2387144411Sscottl** Bit       Default                       							Description
2388144411Sscottl** 15:10     000000 2                      							 Reserved.
2389165155Sscottl** 09    Varies with External State of PRIVDEV at PCI Bus Reset     AD25- IDSEL Disable - When this bit is set,
2390165155Sscottl**							AD25 is deasserted for any possible Type 1 to Type 0 conversion.
2391165155Sscottl**                                                                                        When this bit is clear,
2392165155Sscottl**							AD25 is asserted when Primary addresses AD[15:11]=01001 2 during a Type 1 to Type 0 conversion.
2393165155Sscottl** 08    Varies with External State of PRIVDEV at PCI Bus Reset     AD24- IDSEL Disable - When this bit is set,
2394165155Sscottl**							AD24 is deasserted for any possible Type 1 to Type 0 conversion.
2395165155Sscottl**                                                                                        When this bit is clear,
2396165155Sscottl**							AD24 is asserted when Primary addresses AD[15:11]=01000 2 during a Type 1 to Type 0 conversion.
2397165155Sscottl** 07    Varies with External State of PRIVDEV at PCI Bus Reset     AD23- IDSEL Disable - When this bit is set,
2398165155Sscottl**							AD23 is deasserted for any possible Type 1 to Type 0 conversion.
2399165155Sscottl**                                                                                        When this bit is clear,
2400165155Sscottl**							AD23 is asserted when Primary addresses AD[15:11]=00111 2 during a Type 1 to Type 0 conversion.
2401165155Sscottl** 06    Varies with External State of PRIVDEV at PCI Bus Reset     AD22- IDSEL Disable - When this bit is set,
2402165155Sscottl**							AD22 is deasserted for any possible Type 1 to Type 0 conversion.
2403165155Sscottl**                                                                                        When this bit is clear,
2404165155Sscottl**							AD22 is asserted when Primary addresses AD[15:11]=00110 2 during a Type 1 to Type 0 conversion.
2405165155Sscottl** 05    Varies with External State of PRIVDEV at PCI Bus Reset     AD21- IDSEL Disable - When this bit is set,
2406165155Sscottl**							AD21 is deasserted for any possible Type 1 to Type 0 conversion.
2407165155Sscottl**                                                                                        When this bit is clear,
2408165155Sscottl**							AD21 is asserted when Primary addresses AD[15:11]=00101 2 during a Type 1 to Type 0 conversion.
2409165155Sscottl** 04    Varies with External State of PRIVDEV at PCI Bus Reset     AD20- IDSEL Disable - When this bit is set,
2410165155Sscottl**							AD20 is deasserted for any possible Type 1 to Type 0 conversion.
2411165155Sscottl**                                                                                        When this bit is clear,
2412165155Sscottl**							AD20 is asserted when Primary addresses AD[15:11]=00100 2 during a Type 1 to Type 0 conversion.
2413165155Sscottl** 03    Varies with External State of PRIVDEV at PCI Bus Reset     AD19- IDSEL Disable - When this bit is set,
2414165155Sscottl**							AD19 is deasserted for any possible Type 1 to Type 0 conversion.
2415165155Sscottl**                                                                                        When this bit is clear,
2416165155Sscottl**							AD19 is asserted when Primary addresses AD[15:11]=00011 2 during a Type 1 to Type 0 conversion.
2417165155Sscottl** 02    Varies with External State of PRIVDEV at PCI Bus Reset     AD18- IDSEL Disable - When this bit is set,
2418165155Sscottl**							AD18 is deasserted for any possible Type 1 to Type 0 conversion.
2419165155Sscottl**                                                                                        When this bit is clear,
2420165155Sscottl**							AD18 is asserted when Primary addresses AD[15:11]=00010 2 during a Type 1 to Type 0 conversion.
2421165155Sscottl** 01    Varies with External State of PRIVDEV at PCI Bus Reset     AD17- IDSEL Disable - When this bit is set,
2422165155Sscottl**							AD17 is deasserted for any possible Type 1 to Type 0 conversion.
2423165155Sscottl**                                                                                        When this bit is clear,
2424165155Sscottl**							AD17 is asserted when Primary addresses AD[15:11]=00001 2 during a Type 1 to Type 0 conversion.
2425165155Sscottl** 00    Varies with External State of PRIVDEV at PCI Bus Reset     AD16- IDSEL Disable - When this bit is set,
2426165155Sscottl**							AD16 is deasserted for any possible Type 1 to Type 0 conversion.
2427165155Sscottl**                                                                                        When this bit is clear,
2428165155Sscottl**							AD16 is asserted when Primary addresses AD[15:11]=00000 2 during a Type 1 to Type 0 conversion.
2429144411Sscottl**************************************************************************
2430144411Sscottl*/
2431144411Sscottl/*
2432144411Sscottl**************************************************************************
2433144411Sscottl**                 Reserved      A8-CBh
2434144411Sscottl**************************************************************************
2435144411Sscottl*/
2436144411Sscottl/*
2437144411Sscottl**************************************************************************
2438144411Sscottl**                  PCI Extended Enhanced Capabilities List CC-FFh
2439144411Sscottl**************************************************************************
2440144411Sscottl** ----------------------------------------------------------------------------------------------------------
2441144411Sscottl** |    Byte 3              |         Byte 2         |        Byte 1          |       Byte 0              | Configu-ration Byte Offset
2442144411Sscottl** ----------------------------------------------------------------------------------------------------------
2443144411Sscottl** |           Power Management Capabilities         |        Next Item Ptr   |     Capability ID         | DCh
2444144411Sscottl** ----------------------------------------------------------------------------------------------------------
2445144411Sscottl** |        PM Data         |       PPB Support      |            Extensions Power Management CSR         | E0h
2446144411Sscottl** ----------------------------------------------------------------------------------------------------------
2447144411Sscottl** |                    Reserved                     |        Reserved        |        Reserved           | E4h
2448144411Sscottl** ----------------------------------------------------------------------------------------------------------
2449144411Sscottl** |                                              Reserved                                                | E8h
2450144411Sscottl** ----------------------------------------------------------------------------------------------------------
2451144411Sscottl** |       Reserved         |        Reserved        |        Reserved        |         Reserved          | ECh
2452144411Sscottl** ----------------------------------------------------------------------------------------------------------
2453144411Sscottl** |              PCI-X Secondary Status             |       Next Item Ptr    |       Capability ID       | F0h
2454144411Sscottl** ----------------------------------------------------------------------------------------------------------
2455144411Sscottl** |                                         PCI-X Bridge Status                                          | F4h
2456144411Sscottl** ----------------------------------------------------------------------------------------------------------
2457144411Sscottl** |                                PCI-X Upstream Split Transaction Control                              | F8h
2458144411Sscottl** ----------------------------------------------------------------------------------------------------------
2459144411Sscottl** |                               PCI-X Downstream Split Transaction Control                             | FCh
2460144411Sscottl** ----------------------------------------------------------------------------------------------------------
2461144411Sscottl**===============================================================================
2462144411Sscottl**  0xDC: Power Management Capabilities Identifier - PM_CAPID
2463144411Sscottl** Bit       Default                       Description
2464144411Sscottl** 07:00       01h                        Identifier (ID): PCI SIG assigned ID for PCI-PM register block
2465144411Sscottl**===============================================================================
2466144411Sscottl**  0xDD: Next Item Pointer - PM_NXTP
2467144411Sscottl** Bit       Default                       Description
2468144411Sscottl** 07:00       F0H                Next Capabilities Pointer (PTR): The register defaults to F0H pointing to the PCI-X Extended Capability Header.
2469144411Sscottl**===============================================================================
2470144411Sscottl**  0xDF-0xDE: Power Management Capabilities Register - PMCR
2471144411Sscottl** Bit       Default                       Description
2472144411Sscottl** 15:11       00h                     PME Supported (PME): PME# cannot be asserted by bridge.
2473144411Sscottl** 10           0h                 State D2 Supported (D2): Indicates no support for state D2. No power management action in this state.
2474144411Sscottl** 09           1h                 State D1 Supported (D1): Indicates support for state D1. No power management action in this state.
2475144411Sscottl** 08:06        0h                Auxiliary Current (AUXC): This 3 bit field reports the 3.3Vaux auxiliary current requirements for the PCI function.
2476144411Sscottl**                                                          This returns 000b as PME# wake-up for bridge is not implemented.
2477144411Sscottl** 05           0   Special Initialization Required (SINT): Special initialization is not required for bridge.
2478144411Sscottl** 04:03       00                            Reserved
2479144411Sscottl** 02:00       010                            Version (VS): Indicates that this supports PCI Bus Power Management Interface Specification, Revision 1.1.
2480144411Sscottl**===============================================================================
2481144411Sscottl**  0xE1-0xE0: Power Management Control / Status - Register - PMCSR
2482144411Sscottl** Bit       Default                       Description
2483144411Sscottl** 15:09       00h                          Reserved
2484165155Sscottl** 08          0b                          PME_Enable: This bit, when set to 1b enables bridge to assert PME#.
2485165155Sscottl**	Note that bridge never has occasion to assert PME# and implements this dummy R/W bit only for the purpose of working around an OS PCI-PM bug.
2486144411Sscottl** 07:02       00h                          Reserved
2487165155Sscottl** 01:00       00                Power State (PSTATE): This 2-bit field is used both to determine the current power state of
2488165155Sscottl**									a function and to set the Function into a new power state.
2489144411Sscottl**  													00 - D0 state
2490144411Sscottl**  													01 - D1 state
2491144411Sscottl**  													10 - D2 state
2492144411Sscottl**  													11 - D3 hot state
2493144411Sscottl**===============================================================================
2494144411Sscottl**  0xE2: Power Management Control / Status PCI to PCI Bridge Support - PMCSR_BSE
2495144411Sscottl** Bit       Default                       Description
2496144411Sscottl** 07          0         Bus Power/Clock Control Enable (BPCC_En): Indicates that the bus power/clock control policies have been disabled.
2497165155Sscottl** 06          0                B2/B3 support for D3 Hot (B2_B3#): The state of this bit determines the action that
2498165155Sscottl**									is to occur as a direct result of programming the function to D3 hot.
2499144411Sscottl**                                                                 This bit is only meaningful when bit 7 (BPCC_En) is a ��1��.
2500144411Sscottl** 05:00     00h                            Reserved
2501144411Sscottl**===============================================================================
2502144411Sscottl**  0xE3: Power Management Data Register - PMDR
2503144411Sscottl** Bit       Default                       Description
2504144411Sscottl** 07:00       00h                          Reserved
2505144411Sscottl**===============================================================================
2506144411Sscottl**  0xF0: PCI-X Capabilities Identifier - PX_CAPID
2507144411Sscottl** Bit       Default                       Description
2508144411Sscottl** 07:00       07h                       Identifier (ID): Indicates this is a PCI-X capabilities list.
2509144411Sscottl**===============================================================================
2510144411Sscottl**  0xF1: Next Item Pointer - PX_NXTP
2511144411Sscottl** Bit       Default                       Description
2512144411Sscottl** 07:00       00h                     Next Item Pointer: Points to the next capability in the linked list The power on default value of this
2513144411Sscottl**                                                        register is 00h indicating that this is the last entry in the linked list of capabilities.
2514144411Sscottl**===============================================================================
2515144411Sscottl**  0xF3-0xF2: PCI-X Secondary Status - PX_SSTS
2516144411Sscottl** Bit       Default                       Description
2517144411Sscottl** 15:09       00h                          Reserved
2518144411Sscottl** 08:06       Xxx                Secondary Clock Frequency (SCF): This field is set with the frequency of the secondary bus.
2519144411Sscottl**                                                                 The values are:
2520165155Sscottl** 																			**		BitsMax FrequencyClock Period
2521165155Sscottl** 																			**		000PCI ModeN/A
2522165155Sscottl** 																			**		00166 15
2523165155Sscottl** 																			**		01010010
2524165155Sscottl** 																			**		0111337.5
2525165155Sscottl** 																			**		1xxreservedreserved
2526165155Sscottl** 																			**		The default value for this register is the operating frequency of the secondary bus
2527144411Sscottl** 05           0b                   Split Request Delayed. (SRD):  This bit is supposed to be set by a bridge when it cannot forward a transaction on the
2528165155Sscottl** 						secondary bus to the primary bus because there is not enough room within the limit
2529165155Sscottl** 						specified in the Split Transaction Commitment Limit field in the Downstream Split
2530165155Sscottl** 						Transaction Control register. The bridge does not set this bit.
2531165155Sscottl** 04           0b                 Split Completion Overrun (SCO): This bit is supposed to be set when a bridge terminates a Split Completion on the **	**						secondary bus with retry or Disconnect at next ADB because its buffers are full.
2532165155Sscottl**						The bridge does not set this bit.
2533165155Sscottl** 03           0b              Unexpected Split Completion (USC): This bit is set when an unexpected split completion with a requester ID
2534165155Sscottl**						equal to bridge secondary bus number, device number 00h,
2535165155Sscottl**						and function number 0 is received on the secondary interface.
2536165155Sscottl**						This bit is cleared by software writing a '1'.
2537165155Sscottl** 02           0b               Split Completion Discarded (SCD): This bit is set
2538165155Sscottl**						when bridge discards a split completion moving toward the secondary bus
2539165155Sscottl**						because the requester would not accept it. This bit cleared by software writing a '1'.
2540144411Sscottl** 01           1b                                133 MHz Capable: Indicates that bridge is capable of running its secondary bus at 133 MHz
2541144411Sscottl** 00           1b                            64-bit Device (D64): Indicates the width of the secondary bus as 64-bits.
2542144411Sscottl**===============================================================================
2543144411Sscottl**  0xF7-0xF6-0xf5-0xF4: PCI-X Bridge Status - PX_BSTS
2544144411Sscottl** Bit       Default      								                 Description
2545144411Sscottl** 31:22        0         								                  Reserved
2546165155Sscottl** 21           0         							Split Request Delayed (SRD): This bit does not be set by bridge.
2547165155Sscottl** 20           0         							Split Completion Overrun (SCO): This bit does not be set by bridge
2548165155Sscottl**										because bridge throttles traffic on the completion side.
2549165155Sscottl** 19           0         							Unexpected Split Completion (USC): The bridge sets this bit to 1b
2550165155Sscottl**										when it encounters a corrupted Split Completion, possibly with an **	**										inconsistent remaining byte count.Software clears
2551165155Sscottl**										this bit by writing a 1b to it.
2552165155Sscottl** 18           0         							Split Completion Discarded (SCD): The bridge sets this bit to 1b
2553165155Sscottl**										when it has discarded a Split Completion.Software clears this bit by **	**										writing a 1b to it.
2554165155Sscottl** 17           1         							133 MHz Capable: This bit indicates that the bridge primary interface is **										capable of 133 MHz operation in PCI-X mode.
2555165155Sscottl**										0=The maximum operating frequency is 66 MHz.
2556165155Sscottl**										1=The maximum operating frequency is 133 MHz.
2557144411Sscottl** 16 Varies with the external state of P_32BITPCI# at PCI Bus Reset    64-bit Device (D64): Indicates bus width of the Primary PCI bus interface.
2558165155Sscottl**										 0=Primary Interface is connected as a 32-bit PCI bus.
2559165155Sscottl**										 1=Primary Interface is connected as a 64-bit PCI bus.
2560165155Sscottl** 15:08       00h 								Bus Number (BNUM): This field is simply an alias to the PBN field
2561165155Sscottl**											of the BNUM register at offset 18h.
2562165155Sscottl**								Apparently it was deemed necessary reflect it here for diagnostic purposes.
2563165155Sscottl** 07:03       1fh						Device Number (DNUM): Indicates which IDSEL bridge consumes.
2564165155Sscottl**								May be updated whenever a PCI-X
2565165155Sscottl**								 configuration write cycle that targets bridge scores a hit.
2566144411Sscottl** 02:00        0h                                                   Function Number (FNUM): The bridge Function #
2567144411Sscottl**===============================================================================
2568144411Sscottl**  0xFB-0xFA-0xF9-0xF8: PCI-X Upstream Split Transaction Control - PX_USTC
2569144411Sscottl** Bit       Default                       Description
2570144411Sscottl** 31:16      003Eh                 Split Transaction Limit (STL): This register indicates the size of the commitment limit in units of ADQs.
2571144411Sscottl**                                                                 Software is permitted to program this register to any value greater than or equal to
2572144411Sscottl**                                                                 the contents of the Split Transaction Capacity register. A value less than the contents
2573144411Sscottl**                                                                 of the Split Transaction Capacity register causes unspecified results.
2574144411Sscottl**                                                                 A value of 003Eh or greater enables the bridge to forward all Split Requests of any
2575144411Sscottl**                                                                 size regardless of the amount of buffer space available.
2576144411Sscottl** 15:00      003Eh              Split Transaction Capacity (STC): This read-only field indicates the size of the buffer (number of ADQs) for storing
2577165155Sscottl** 				   split completions. This register controls behavior of the bridge buffers for forwarding
2578165155Sscottl** 				   Split Transactions from a primary bus requester to a secondary bus completer.
2579165155Sscottl** 				   The default value of 003Eh indicates there is available buffer space for 62 ADQs (7936 bytes).
2580144411Sscottl**===============================================================================
2581144411Sscottl**  0xFF-0xFE-0xFD-0xFC: PCI-X Downstream Split Transaction Control - PX_DSTC
2582144411Sscottl** Bit       Default                       Description
2583144411Sscottl** 31:16      003Eh                 Split Transaction Limit (STL):  This register indicates the size of the commitment limit in units of ADQs.
2584165155Sscottl**							Software is permitted to program this register to any value greater than or equal to
2585165155Sscottl**							the contents of the Split Transaction Capacity register. A value less than the contents
2586165155Sscottl**							of the Split Transaction Capacity register causes unspecified results.
2587165155Sscottl**							A value of 003Eh or greater enables the bridge to forward all Split Requests of any
2588165155Sscottl**							size regardless of the amount of buffer space available.
2589144411Sscottl** 15:00      003Eh              Split Transaction Capacity (STC): This read-only field indicates the size of the buffer (number of ADQs) for storing
2590144411Sscottl**                                                                 split completions. This register controls behavior of the bridge buffers for forwarding
2591144411Sscottl**                                                                 Split Transactions from a primary bus requester to a secondary bus completer.
2592165155Sscottl**                                                                 The default value of 003Eh indicates there is available buffer space for 62 ADQs
2593165155Sscottl**									(7936 bytes).
2594144411Sscottl**************************************************************************
2595144411Sscottl*/
2596144411Sscottl
2597144411Sscottl/*
2598144411Sscottl*************************************************************************************************************************************
2599144411Sscottl**                       80331 Address Translation Unit Register Definitions
2600144411Sscottl**                               ATU Interface Configuration Header Format
2601144411Sscottl**               The ATU is programmed via a [Type 0] configuration command on the PCI interface.
2602144411Sscottl*************************************************************************************************************************************
2603144411Sscottl** |    Byte 3              |         Byte 2         |        Byte 1          |       Byte 0              | Configuration Byte Offset
2604144411Sscottl**===================================================================================================================================
2605144411Sscottl** |                ATU Device ID                    |                     Vendor ID                      | 00h
2606144411Sscottl** ----------------------------------------------------------------------------------------------------------
2607144411Sscottl** |                     Status                      |                     Command                        | 04H
2608144411Sscottl** ----------------------------------------------------------------------------------------------------------
2609144411Sscottl** |                              ATU Class Code                              |       Revision ID         | 08H
2610144411Sscottl** ----------------------------------------------------------------------------------------------------------
2611144411Sscottl** |         ATUBISTR       |     Header Type        |      Latency Timer     |      Cacheline Size       | 0CH
2612144411Sscottl** ----------------------------------------------------------------------------------------------------------
2613144411Sscottl** |                                     Inbound ATU Base Address 0                                       | 10H
2614144411Sscottl** ----------------------------------------------------------------------------------------------------------
2615144411Sscottl** |                               Inbound ATU Upper Base Address 0                                       | 14H
2616144411Sscottl** ----------------------------------------------------------------------------------------------------------
2617144411Sscottl** |                                     Inbound ATU Base Address 1                                       | 18H
2618144411Sscottl** ----------------------------------------------------------------------------------------------------------
2619144411Sscottl** |                               Inbound ATU Upper Base Address 1                                       | 1CH
2620144411Sscottl** ----------------------------------------------------------------------------------------------------------
2621144411Sscottl** |                                     Inbound ATU Base Address 2                                       | 20H
2622144411Sscottl** ----------------------------------------------------------------------------------------------------------
2623144411Sscottl** |                               Inbound ATU Upper Base Address 2                                       | 24H
2624144411Sscottl** ----------------------------------------------------------------------------------------------------------
2625144411Sscottl** |                                             Reserved                                                 | 28H
2626144411Sscottl** ----------------------------------------------------------------------------------------------------------
2627144411Sscottl** |                ATU Subsystem ID                 |                ATU Subsystem Vendor ID             | 2CH
2628144411Sscottl** ----------------------------------------------------------------------------------------------------------
2629144411Sscottl** |                                       Expansion ROM Base Address                                     | 30H
2630144411Sscottl** ----------------------------------------------------------------------------------------------------------
2631144411Sscottl** |                                    Reserved Capabilities Pointer                                     | 34H
2632144411Sscottl** ----------------------------------------------------------------------------------------------------------
2633144411Sscottl** |                                             Reserved                                                 | 38H
2634144411Sscottl** ----------------------------------------------------------------------------------------------------------
2635144411Sscottl** |     Maximum Latency    |     Minimum Grant      |       Interrupt Pin    |      Interrupt Line       | 3CH
2636144411Sscottl** ----------------------------------------------------------------------------------------------------------
2637144411Sscottl*********************************************************************************************************************
2638144411Sscottl*/
2639144411Sscottl/*
2640144411Sscottl***********************************************************************************
2641144411Sscottl**  ATU Vendor ID Register - ATUVID
2642144411Sscottl**  -----------------------------------------------------------------
2643144411Sscottl**  Bit       Default                       Description
2644165155Sscottl**  15:00      8086H (0x17D3)               ATU Vendor ID - This is a 16-bit value assigned to Intel.
2645165155Sscottl**						This register, combined with the DID, uniquely identify the PCI device.
2646165155Sscottl**      Access type is Read/Write to allow the 80331 to configure the register as a different vendor ID
2647165155Sscottl**	to simulate the interface of a standard mechanism currently used by existing application software.
2648144411Sscottl***********************************************************************************
2649144411Sscottl*/
2650144411Sscottl#define     ARCMSR_ATU_VENDOR_ID_REG		         0x00    /*word*/
2651144411Sscottl/*
2652144411Sscottl***********************************************************************************
2653144411Sscottl**  ATU Device ID Register - ATUDID
2654144411Sscottl**  -----------------------------------------------------------------
2655144411Sscottl**  Bit       Default                       Description
2656165155Sscottl**  15:00      0336H (0x1110)               ATU Device ID - This is a 16-bit value assigned to the ATU.
2657165155Sscottl**	This ID, combined with the VID, uniquely identify any PCI device.
2658144411Sscottl***********************************************************************************
2659144411Sscottl*/
2660144411Sscottl#define     ARCMSR_ATU_DEVICE_ID_REG		         0x02    /*word*/
2661144411Sscottl/*
2662144411Sscottl***********************************************************************************
2663144411Sscottl**  ATU Command Register - ATUCMD
2664144411Sscottl**  -----------------------------------------------------------------
2665144411Sscottl**  Bit       Default                       Description
2666144411Sscottl**  15:11      000000 2                     Reserved
2667144411Sscottl**  10           0                          Interrupt Disable - This bit disables 80331 from asserting the ATU interrupt signal.
2668144411Sscottl**                                                              0=enables the assertion of interrupt signal.
2669144411Sscottl**                                                              1=disables the assertion of its interrupt signal.
2670165155Sscottl**  09          0 2                         Fast Back to Back Enable - When cleared,
2671165155Sscottl**						the ATU interface is not allowed to generate fast back-to-back cycles on its bus.
2672165155Sscottl**						Ignored when operating in the PCI-X mode.
2673144411Sscottl**  08          0 2                         SERR# Enable - When cleared, the ATU interface is not allowed to assert SERR# on the PCI interface.
2674144411Sscottl**  07          1 2                         Address/Data Stepping Control - Address stepping is implemented for configuration transactions. The
2675165155Sscottl**                                          ATU inserts 2 clock cycles of address stepping for Conventional Mode and 4 clock cycles
2676165155Sscottl**						of address stepping for PCI-X mode.
2677165155Sscottl**  06          0 2                         Parity Error Response - When set, the ATU takes normal action when a parity error
2678165155Sscottl**						is detected. When cleared, parity checking is disabled.
2679165155Sscottl**  05          0 2                         VGA Palette Snoop Enable - The ATU interface does not support I/O writes and therefore,
2680165155Sscottl**						does not perform VGA palette snooping.
2681165155Sscottl**  04          0 2                         Memory Write and Invalidate Enable - When set, ATU may generate MWI commands.
2682165155Sscottl**						When clear, ATU use Memory Write commands instead of MWI. Ignored when operating in the PCI-X mode.
2683165155Sscottl**  03          0 2                         Special Cycle Enable - The ATU interface does not respond to special cycle commands in any way.
2684165155Sscottl**						Not implemented and a reserved bit field.
2685165155Sscottl**  02          0 2                         Bus Master Enable - The ATU interface can act as a master on the PCI bus.
2686165155Sscottl**						When cleared, disables the device from generating PCI accesses.
2687165155Sscottl**						When set, allows the device to behave as a PCI bus master.
2688165155Sscottl**                                          When operating in the PCI-X mode, ATU initiates a split completion transaction regardless
2689165155Sscottl**						of the state of this bit.
2690165155Sscottl**  01          0 2                         Memory Enable - Controls the ATU interface��s response to PCI memory addresses.
2691165155Sscottl**						When cleared, the ATU interface does not respond to any memory access on the PCI bus.
2692165155Sscottl**  00          0 2                         I/O Space Enable - Controls the ATU interface response to I/O transactions.
2693165155Sscottl**						Not implemented and a reserved bit field.
2694144411Sscottl***********************************************************************************
2695144411Sscottl*/
2696144411Sscottl#define     ARCMSR_ATU_COMMAND_REG		         0x04    /*word*/
2697144411Sscottl/*
2698144411Sscottl***********************************************************************************
2699144411Sscottl**  ATU Status Register - ATUSR (Sheet 1 of 2)
2700144411Sscottl**  -----------------------------------------------------------------
2701144411Sscottl**  Bit       Default                       Description
2702144411Sscottl**  15          0 2                         Detected Parity Error - set when a parity error is detected in data received by the ATU on the PCI bus even
2703165155Sscottl**  					when the ATUCMD register��s Parity Error Response bit is cleared. Set under the following conditions:
2704144411Sscottl**  										�E Write Data Parity Error when the ATU is a target (inbound write).
2705144411Sscottl**  										�E Read Data Parity Error when the ATU is a requester (outbound read).
2706165155Sscottl**  										�E Any Address or Attribute (PCI-X Only) Parity Error on the Bus **	** **  								(including one generated by the ATU).
2707144411Sscottl**  14          0 2                         SERR# Asserted - set when SERR# is asserted on the PCI bus by the ATU.
2708144411Sscottl**  13          0 2                         Master Abort - set when a transaction initiated by the ATU PCI master interface, ends in a Master-Abort
2709144411Sscottl**                                          or when the ATU receives a Master Abort Split Completion Error Message in PCI-X mode.
2710144411Sscottl**  12          0 2                         Target Abort (master) - set when a transaction initiated by the ATU PCI master interface, ends in a target
2711144411Sscottl**                                          abort or when the ATU receives a Target Abort Split Completion Error Message in PCI-X mode.
2712165155Sscottl**  11          0 2                         Target Abort (target) - set when the ATU interface, acting as a target,
2713165155Sscottl**						terminates the transaction on the PCI bus with a target abort.
2714165155Sscottl**  10:09       01 2                        DEVSEL# Timing - These bits are read-only and define the slowest DEVSEL#
2715165155Sscottl**						timing for a target device in Conventional PCI Mode regardless of the operating mode
2716165155Sscottl**							(except configuration accesses).
2717144411Sscottl**  										00 2=Fast
2718144411Sscottl**  										01 2=Medium
2719144411Sscottl**  										10 2=Slow
2720144411Sscottl**  										11 2=Reserved
2721144411Sscottl**                                          The ATU interface uses Medium timing.
2722144411Sscottl**  08           0 2                        Master Parity Error - The ATU interface sets this bit under the following conditions:
2723144411Sscottl**  										�E The ATU asserted PERR# itself or the ATU observed PERR# asserted.
2724165155Sscottl**  										�E And the ATU acted as the requester
2725165155Sscottl**											for the operation in which the error occurred.
2726144411Sscottl**  										�E And the ATUCMD register��s Parity Error Response bit is set
2727144411Sscottl**  										�E Or (PCI-X Mode Only) the ATU received a Write Data Parity Error Message
2728144411Sscottl**  										�E And the ATUCMD register��s Parity Error Response bit is set
2729144411Sscottl**  07           1 2  (Conventional mode)
2730144411Sscottl**               0 2  (PCI-X mode)
2731165155Sscottl**  							Fast Back-to-Back - The ATU/Messaging Unit interface is capable of accepting fast back-to-back
2732165155Sscottl**  							transactions in Conventional PCI mode when the transactions are not to the same target. Since fast
2733165155Sscottl**  							back-to-back transactions do not exist in PCI-X mode, this bit is forced to 0 in the PCI-X mode.
2734144411Sscottl**  06           0 2                        UDF Supported - User Definable Features are not supported
2735144411Sscottl**  05           1 2                        66 MHz. Capable - 66 MHz operation is supported.
2736144411Sscottl**  04           1 2                        Capabilities - When set, this function implements extended capabilities.
2737165155Sscottl**  03             0                        Interrupt Status - reflects the state of the ATU interrupt
2738165155Sscottl**						when the Interrupt Disable bit in the command register is a 0.
2739144411Sscottl**  										0=ATU interrupt signal deasserted.
2740144411Sscottl**  										1=ATU interrupt signal asserted.
2741165155Sscottl**  		NOTE: Setting the Interrupt Disable bit to a 1 has no effect on the state of this bit. Refer to
2742165155Sscottl**  		Section 3.10.23, ��ATU Interrupt Pin Register - ATUIPR�� on page 236 for details on the ATU
2743144411Sscottl**  										interrupt signal.
2744144411Sscottl**  02:00      00000 2                      Reserved.
2745144411Sscottl***********************************************************************************
2746144411Sscottl*/
2747144411Sscottl#define     ARCMSR_ATU_STATUS_REG		         0x06    /*word*/
2748144411Sscottl/*
2749144411Sscottl***********************************************************************************
2750144411Sscottl**  ATU Revision ID Register - ATURID
2751144411Sscottl**  -----------------------------------------------------------------
2752144411Sscottl**  Bit       Default                       Description
2753144411Sscottl**  07:00        00H                        ATU Revision - identifies the 80331 revision number.
2754144411Sscottl***********************************************************************************
2755144411Sscottl*/
2756144411Sscottl#define     ARCMSR_ATU_REVISION_REG		         0x08    /*byte*/
2757144411Sscottl/*
2758144411Sscottl***********************************************************************************
2759144411Sscottl**  ATU Class Code Register - ATUCCR
2760144411Sscottl**  -----------------------------------------------------------------
2761144411Sscottl**  Bit       Default                       Description
2762144411Sscottl**  23:16        05H                        Base Class - Memory Controller
2763144411Sscottl**  15:08        80H                        Sub Class - Other Memory Controller
2764144411Sscottl**  07:00        00H                        Programming Interface - None defined
2765144411Sscottl***********************************************************************************
2766144411Sscottl*/
2767144411Sscottl#define     ARCMSR_ATU_CLASS_CODE_REG		         0x09    /*3bytes 0x0B,0x0A,0x09*/
2768144411Sscottl/*
2769144411Sscottl***********************************************************************************
2770144411Sscottl**  ATU Cacheline Size Register - ATUCLSR
2771144411Sscottl**  -----------------------------------------------------------------
2772144411Sscottl**  Bit       Default                       Description
2773144411Sscottl**  07:00        00H                        ATU Cacheline Size - specifies the system cacheline size in DWORDs. Cacheline size is restricted to either 0, 8 or 16 DWORDs.
2774144411Sscottl***********************************************************************************
2775144411Sscottl*/
2776144411Sscottl#define     ARCMSR_ATU_CACHELINE_SIZE_REG		         0x0C    /*byte*/
2777144411Sscottl/*
2778144411Sscottl***********************************************************************************
2779144411Sscottl**  ATU Latency Timer Register - ATULT
2780144411Sscottl**  -----------------------------------------------------------------
2781144411Sscottl**  Bit       Default                       Description
2782165155Sscottl**  07:03     00000 2   (for Conventional mode)
2783165155Sscottl**            01000 2   (for PCI-X mode)
2784165155Sscottl**  			Programmable Latency Timer - This field varies the latency timer for the interface from 0 to 248 clocks.
2785165155Sscottl**  			The default value is 0 clocks for Conventional PCI mode, and 64 clocks for PCI-X mode.
2786165155Sscottl**  02:00       000 2   Latency Timer Granularity - These Bits are read only giving a programmable granularity of 8 clocks for the latency timer.
2787144411Sscottl***********************************************************************************
2788144411Sscottl*/
2789144411Sscottl#define     ARCMSR_ATU_LATENCY_TIMER_REG		         0x0D    /*byte*/
2790144411Sscottl/*
2791144411Sscottl***********************************************************************************
2792144411Sscottl**  ATU Header Type Register - ATUHTR
2793144411Sscottl**  -----------------------------------------------------------------
2794144411Sscottl**  Bit       Default                       Description
2795144411Sscottl**  07           0 2                        Single Function/Multi-Function Device - Identifies the 80331 as a single-function PCI device.
2796144411Sscottl**  06:00   000000 2                        PCI Header Type - This bit field indicates the type of PCI header implemented. The ATU interface
2797144411Sscottl**                                          header conforms to PCI Local Bus Specification, Revision 2.3.
2798144411Sscottl***********************************************************************************
2799144411Sscottl*/
2800144411Sscottl#define     ARCMSR_ATU_HEADER_TYPE_REG		         0x0E    /*byte*/
2801144411Sscottl/*
2802144411Sscottl***********************************************************************************
2803144411Sscottl**  ATU BIST Register - ATUBISTR
2804144411Sscottl**
2805144411Sscottl**  The ATU BIST Register controls the functions the Intel XScale core performs when BIST is
2806144411Sscottl**  initiated. This register is the interface between the host processor requesting BIST functions and
2807144411Sscottl**  the 80331 replying with the results from the software implementation of the BIST functionality.
2808144411Sscottl**  -----------------------------------------------------------------
2809144411Sscottl**  Bit       Default                       Description
2810144411Sscottl**  07           0 2                        BIST Capable - This bit value is always equal to the ATUCR ATU BIST Interrupt Enable bit.
2811144411Sscottl**  06           0 2                        Start BIST - When the ATUCR BIST Interrupt Enable bit is set:
2812165155Sscottl**  				 Setting this bit generates an interrupt to the Intel XScale core to perform a software BIST function.
2813165155Sscottl**  				 The Intel XScale core clears this bit when the BIST software has completed with the BIST results
2814165155Sscottl**  				 found in ATUBISTR register bits [3:0].
2815165155Sscottl**  				 When the ATUCR BIST Interrupt Enable bit is clear:
2816165155Sscottl**  				 Setting this bit does not generate an interrupt to the Intel XScale core and no BIST functions is performed.
2817144411Sscottl**                                                       The Intel XScale core does not clear this bit.
2818165155Sscottl**  05:04       00 2             Reserved
2819165155Sscottl**  03:00     0000 2             BIST Completion Code - when the ATUCR BIST Interrupt Enable bit is set and the ATUBISTR Start BIST bit is set (bit 6):
2820165155Sscottl**                               The Intel XScale  core places the results of the software BIST in these bits.
2821165155Sscottl**				 A nonzero value indicates a device-specific error.
2822144411Sscottl***********************************************************************************
2823144411Sscottl*/
2824144411Sscottl#define     ARCMSR_ATU_BIST_REG		         0x0F    /*byte*/
2825144411Sscottl
2826144411Sscottl/*
2827144411Sscottl***************************************************************************************
2828144411Sscottl**            ATU Base Registers and Associated Limit Registers
2829144411Sscottl***************************************************************************************
2830144411Sscottl**           Base Address                         Register Limit                          Register Description
2831144411Sscottl**  Inbound ATU Base Address Register 0           Inbound ATU Limit Register 0            Defines the inbound translation window 0 from the PCI bus.
2832165155Sscottl**  Inbound ATU Upper Base Address Register 0     N/A                                     Together with ATU Base Address Register 0 defines the inbound **								translation window 0 from the PCI bus for DACs.
2833144411Sscottl**  Inbound ATU Base Address Register 1           Inbound ATU Limit Register 1            Defines inbound window 1 from the PCI bus.
2834165155Sscottl**  Inbound ATU Upper Base Address Register 1     N/A                                     Together with ATU Base Address Register 1 defines inbound window **  1 from the PCI bus for DACs.
2835144411Sscottl**  Inbound ATU Base Address Register 2           Inbound ATU Limit Register 2            Defines the inbound translation window 2 from the PCI bus.
2836165155Sscottl**  Inbound ATU Upper Base Address Register 2     N/A                                     Together with ATU Base Address Register 2 defines the inbound ** **  translation window 2 from the PCI bus for DACs.
2837144411Sscottl**  Inbound ATU Base Address Register 3           Inbound ATU Limit Register 3            Defines the inbound translation window 3 from the PCI bus.
2838165155Sscottl**  Inbound ATU Upper Base Address Register 3     N/A                                     Together with ATU Base Address Register 3 defines the inbound ** **  translation window 3 from the PCI bus for DACs.
2839165155Sscottl**     NOTE: This is a private BAR that resides outside of the standard PCI configuration header space (offsets 00H-3FH).
2840165155Sscottl**  Expansion ROM Base Address Register           Expansion ROM Limit Register            Defines the window of addresses used by a bus master for reading **  from an Expansion ROM.
2841144411Sscottl**--------------------------------------------------------------------------------------
2842144411Sscottl**  ATU Inbound Window 1 is not a translate window.
2843144411Sscottl**  The ATU does not claim any PCI accesses that fall within this range.
2844144411Sscottl**  This window is used to allocate host memory for use by Private Devices.
2845144411Sscottl**  When enabled, the ATU interrupts the Intel  XScale core when either the IABAR1 register or the IAUBAR1 register is written from the PCI bus.
2846144411Sscottl***********************************************************************************
2847144411Sscottl*/
2848144411Sscottl
2849144411Sscottl/*
2850144411Sscottl***********************************************************************************
2851144411Sscottl**  Inbound ATU Base Address Register 0 - IABAR0
2852144411Sscottl**
2853165155Sscottl**  . The Inbound ATU Base Address Register 0 (IABAR0) together with the Inbound ATU Upper Base Address Register 0 (IAUBAR0)
2854165155Sscottl**    defines the block of memory addresses where the inbound translation window 0 begins.
2855144411Sscottl**  . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory.
2856144411Sscottl**  . The IABAR0 and IAUBAR0 define the base address and describes the required memory block size.
2857144411Sscottl**  . Bits 31 through 12 of the IABAR0 is either read/write bits or read only with a value of 0
2858144411Sscottl**    depending on the value located within the IALR0.
2859144411Sscottl**    This configuration allows the IABAR0 to be programmed per PCI Local Bus Specification.
2860144411Sscottl**    The first 4 Kbytes of memory defined by the IABAR0, IAUBAR0 and the IALR0 is reserved for the Messaging Unit.
2861144411Sscottl**    The programmed value within the base address register must comply with the PCI programming requirements for address alignment.
2862144411Sscottl**  Warning:
2863144411Sscottl**    When IALR0 is cleared prior to host configuration:
2864144411Sscottl**                          the user should also clear the Prefetchable Indicator and the Type Indicator.
2865144411Sscottl**    Assuming IALR0 is not cleared:
2866144411Sscottl**                          a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary,
2867144411Sscottl**                             when the Prefetchable Indicator is cleared prior to host configuration,
2868144411Sscottl**                             the user should also set the Type Indicator for 32 bit addressability.
2869144411Sscottl**                          b. For compliance to the PCI-X Addendum to the PCI Local Bus Specification,
2870144411Sscottl**                             when the Prefetchable Indicator is set prior to host configuration, the user
2871144411Sscottl**                             should also set the Type Indicator for 64 bit addressability.
2872144411Sscottl**                             This is the default for IABAR0.
2873144411Sscottl**  -----------------------------------------------------------------
2874144411Sscottl**  Bit       Default                       Description
2875165155Sscottl**  31:12     00000H                        Translation Base Address 0 - These bits define the actual location
2876165155Sscottl**						the translation function is to respond to when addressed from the PCI bus.
2877144411Sscottl**  11:04        00H                        Reserved.
2878144411Sscottl**  03           1 2                        Prefetchable Indicator - When set, defines the memory space as prefetchable.
2879144411Sscottl**  02:01       10 2                        Type Indicator - Defines the width of the addressability for this memory window:
2880165155Sscottl**  						00 - Memory Window is locatable anywhere in 32 bit address space
2881165155Sscottl**  						10 - Memory Window is locatable anywhere in 64 bit address space
2882144411Sscottl**  00           0 2                        Memory Space Indicator - This bit field describes memory or I/O space base address.
2883144411Sscottl**                                                                   The ATU does not occupy I/O space,
2884144411Sscottl**                                                                   thus this bit must be zero.
2885144411Sscottl***********************************************************************************
2886144411Sscottl*/
2887144411Sscottl#define     ARCMSR_INBOUND_ATU_BASE_ADDRESS0_REG		         0x10    /*dword 0x13,0x12,0x11,0x10*/
2888144411Sscottl#define     ARCMSR_INBOUND_ATU_MEMORY_PREFETCHABLE	                 0x08
2889144411Sscottl#define     ARCMSR_INBOUND_ATU_MEMORY_WINDOW64		                 0x04
2890144411Sscottl/*
2891144411Sscottl***********************************************************************************
2892144411Sscottl**  Inbound ATU Upper Base Address Register 0 - IAUBAR0
2893144411Sscottl**
2894144411Sscottl**  This register contains the upper base address when decoding PCI addresses beyond 4 GBytes.
2895144411Sscottl**  Together with the Translation Base Address this register defines the actual location the translation
2896144411Sscottl**  function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs).
2897144411Sscottl**  The programmed value within the base address register must comply with the PCI programming requirements for address alignment.
2898144411Sscottl**  Note:
2899144411Sscottl**      When the Type indicator of IABAR0 is set to indicate 32 bit addressability,
2900144411Sscottl**      the IAUBAR0 register attributes are read-only.
2901144411Sscottl**  -----------------------------------------------------------------
2902144411Sscottl**  Bit       Default                       Description
2903144411Sscottl**  31:0      00000H                        Translation Upper Base Address 0 - Together with the Translation Base Address 0 these bits define the
2904165155Sscottl**                           actual location the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes.
2905144411Sscottl***********************************************************************************
2906144411Sscottl*/
2907144411Sscottl#define     ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS0_REG		     0x14    /*dword 0x17,0x16,0x15,0x14*/
2908144411Sscottl/*
2909144411Sscottl***********************************************************************************
2910144411Sscottl**  Inbound ATU Base Address Register 1 - IABAR1
2911144411Sscottl**
2912165155Sscottl**  . The Inbound ATU Base Address Register (IABAR1) together with the Inbound ATU Upper Base Address Register 1 (IAUBAR1)
2913165155Sscottl**    defines the block of memory addresses where the inbound translation window 1 begins.
2914144411Sscottl**  . This window is used merely to allocate memory on the PCI bus and, the ATU does not process any PCI bus transactions to this memory range.
2915144411Sscottl**  . The programmed value within the base address register must comply with the PCI programming requirements for address alignment.
2916144411Sscottl**  . When enabled, the ATU interrupts the Intel XScale core when the IABAR1 register is written from the PCI bus.
2917165155Sscottl**    Warning:
2918144411Sscottl**    When a non-zero value is not written to IALR1 prior to host configuration,
2919144411Sscottl**                          the user should not set either the Prefetchable Indicator or the Type Indicator for 64 bit addressability.
2920144411Sscottl**                          This is the default for IABAR1.
2921144411Sscottl**    Assuming a non-zero value is written to IALR1,
2922144411Sscottl**               			the user may set the Prefetchable Indicator
2923144411Sscottl**               			              or the Type         Indicator:
2924144411Sscottl**  						a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address
2925144411Sscottl**  						   boundary, when the Prefetchable Indicator is not set prior to host configuration,
2926144411Sscottl**                             the user should also leave the Type Indicator set for 32 bit addressability.
2927144411Sscottl**                             This is the default for IABAR1.
2928144411Sscottl**  						b. when the Prefetchable Indicator is set prior to host configuration,
2929144411Sscottl**                             the user should also set the Type Indicator for 64 bit addressability.
2930144411Sscottl**  -----------------------------------------------------------------
2931144411Sscottl**  Bit       Default                       Description
2932144411Sscottl**  31:12     00000H                        Translation Base Address 1 - These bits define the actual location of window 1 on the PCI bus.
2933144411Sscottl**  11:04        00H                        Reserved.
2934144411Sscottl**  03           0 2                        Prefetchable Indicator - When set, defines the memory space as prefetchable.
2935144411Sscottl**  02:01       00 2                        Type Indicator - Defines the width of the addressability for this memory window:
2936165155Sscottl**  			00 - Memory Window is locatable anywhere in 32 bit address space
2937165155Sscottl**  			10 - Memory Window is locatable anywhere in 64 bit address space
2938144411Sscottl**  00           0 2                        Memory Space Indicator - This bit field describes memory or I/O space base address.
2939144411Sscottl**                                                                   The ATU does not occupy I/O space,
2940144411Sscottl**                                                                   thus this bit must be zero.
2941144411Sscottl***********************************************************************************
2942144411Sscottl*/
2943144411Sscottl#define     ARCMSR_INBOUND_ATU_BASE_ADDRESS1_REG		         0x18    /*dword 0x1B,0x1A,0x19,0x18*/
2944144411Sscottl/*
2945144411Sscottl***********************************************************************************
2946144411Sscottl**  Inbound ATU Upper Base Address Register 1 - IAUBAR1
2947144411Sscottl**
2948144411Sscottl**  This register contains the upper base address when locating this window for PCI addresses beyond 4 GBytes.
2949144411Sscottl**  Together with the IABAR1 this register defines the actual location for this memory window for addresses > 4GBytes (for DACs).
2950144411Sscottl**  This window is used merely to allocate memory on the PCI bus and, the ATU does not process any PCI bus transactions to this memory range.
2951144411Sscottl**  The programmed value within the base address register must comply with the PCI programming
2952144411Sscottl**  requirements for address alignment.
2953144411Sscottl**  When enabled, the ATU interrupts the Intel XScale core when the IAUBAR1 register is written
2954144411Sscottl**  from the PCI bus.
2955144411Sscottl**  Note:
2956144411Sscottl**      When the Type indicator of IABAR1 is set to indicate 32 bit addressability,
2957144411Sscottl**      the IAUBAR1 register attributes are read-only.
2958144411Sscottl**      This is the default for IABAR1.
2959144411Sscottl**  -----------------------------------------------------------------
2960144411Sscottl**  Bit       Default                       Description
2961165155Sscottl**  31:0      00000H                        Translation Upper Base Address 1 - Together with the Translation Base Address 1
2962165155Sscottl**						these bits define the actual location for this memory window on the PCI bus for addresses > 4GBytes.
2963144411Sscottl***********************************************************************************
2964144411Sscottl*/
2965144411Sscottl#define     ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS1_REG		         0x1C    /*dword 0x1F,0x1E,0x1D,0x1C*/
2966144411Sscottl/*
2967144411Sscottl***********************************************************************************
2968144411Sscottl**  Inbound ATU Base Address Register 2 - IABAR2
2969144411Sscottl**
2970165155Sscottl**  . The Inbound ATU Base Address Register 2 (IABAR2) together with the Inbound ATU Upper Base Address Register 2 (IAUBAR2)
2971165155Sscottl**           defines the block of memory addresses where the inbound translation window 2 begins.
2972144411Sscottl**  . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory.
2973144411Sscottl**  . The IABAR2 and IAUBAR2 define the base address and describes the required memory block size
2974144411Sscottl**  . Bits 31 through 12 of the IABAR2 is either read/write bits or read only with a value of 0 depending on the value located within the IALR2.
2975144411Sscottl**    The programmed value within the base address register must comply with the PCI programming requirements for address alignment.
2976144411Sscottl**  Warning:
2977144411Sscottl**    When a non-zero value is not written to IALR2 prior to host configuration,
2978144411Sscottl**                          the user should not set either the Prefetchable Indicator
2979144411Sscottl**                                                      or the Type         Indicator for 64 bit addressability.
2980144411Sscottl**                          This is the default for IABAR2.
2981144411Sscottl**  Assuming a non-zero value is written to IALR2,
2982144411Sscottl**                          the user may set the Prefetchable Indicator
2983144411Sscottl**                                        or the Type         Indicator:
2984144411Sscottl**  						a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary,
2985144411Sscottl**                             when the Prefetchable Indicator is not set prior to host configuration,
2986144411Sscottl**                             the user should also leave the Type Indicator set for 32 bit addressability.
2987144411Sscottl**                             This is the default for IABAR2.
2988144411Sscottl**  						b. when the Prefetchable Indicator is set prior to host configuration,
2989144411Sscottl**                             the user should also set the Type Indicator for 64 bit addressability.
2990144411Sscottl**  -----------------------------------------------------------------
2991144411Sscottl**  Bit       Default                       Description
2992165155Sscottl**  31:12     00000H                        Translation Base Address 2 - These bits define the actual location
2993165155Sscottl**						the translation function is to respond to when addressed from the PCI bus.
2994144411Sscottl**  11:04        00H                        Reserved.
2995144411Sscottl**  03           0 2                        Prefetchable Indicator - When set, defines the memory space as prefetchable.
2996144411Sscottl**  02:01       00 2                        Type Indicator - Defines the width of the addressability for this memory window:
2997165155Sscottl**  			00 - Memory Window is locatable anywhere in 32 bit address space
2998165155Sscottl**  			10 - Memory Window is locatable anywhere in 64 bit address space
2999144411Sscottl**  00           0 2                        Memory Space Indicator - This bit field describes memory or I/O space base address.
3000144411Sscottl**                                                                   The ATU does not occupy I/O space,
3001144411Sscottl**                                                                   thus this bit must be zero.
3002144411Sscottl***********************************************************************************
3003144411Sscottl*/
3004144411Sscottl#define     ARCMSR_INBOUND_ATU_BASE_ADDRESS2_REG		         0x20    /*dword 0x23,0x22,0x21,0x20*/
3005144411Sscottl/*
3006144411Sscottl***********************************************************************************
3007144411Sscottl**  Inbound ATU Upper Base Address Register 2 - IAUBAR2
3008165155Sscottl**
3009144411Sscottl**  This register contains the upper base address when decoding PCI addresses beyond 4 GBytes.
3010165155Sscottl**  Together with the Translation Base Address this register defines the actual location
3011165155Sscottl**  the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs).
3012144411Sscottl**  The programmed value within the base address register must comply with the PCI programming
3013144411Sscottl**  requirements for address alignment.
3014144411Sscottl**  Note:
3015144411Sscottl**      When the Type indicator of IABAR2 is set to indicate 32 bit addressability,
3016144411Sscottl**      the IAUBAR2 register attributes are read-only.
3017144411Sscottl**      This is the default for IABAR2.
3018144411Sscottl**  -----------------------------------------------------------------
3019144411Sscottl**  Bit       Default                       Description
3020165155Sscottl**  31:0      00000H                        Translation Upper Base Address 2 - Together with the Translation Base Address 2
3021165155Sscottl**                                          these bits define the actual location the translation function is to respond to
3022165155Sscottl**                                          when addressed from the PCI bus for addresses > 4GBytes.
3023144411Sscottl***********************************************************************************
3024144411Sscottl*/
3025144411Sscottl#define     ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS2_REG		         0x24    /*dword 0x27,0x26,0x25,0x24*/
3026144411Sscottl/*
3027144411Sscottl***********************************************************************************
3028144411Sscottl**  ATU Subsystem Vendor ID Register - ASVIR
3029144411Sscottl**  -----------------------------------------------------------------
3030144411Sscottl**  Bit       Default                       Description
3031144411Sscottl**  15:0      0000H                         Subsystem Vendor ID - This register uniquely identifies the add-in board or subsystem vendor.
3032144411Sscottl***********************************************************************************
3033144411Sscottl*/
3034144411Sscottl#define     ARCMSR_ATU_SUBSYSTEM_VENDOR_ID_REG		         0x2C    /*word 0x2D,0x2C*/
3035144411Sscottl/*
3036144411Sscottl***********************************************************************************
3037144411Sscottl**  ATU Subsystem ID Register - ASIR
3038144411Sscottl**  -----------------------------------------------------------------
3039144411Sscottl**  Bit       Default                       Description
3040144411Sscottl**  15:0      0000H                         Subsystem ID - uniquely identifies the add-in board or subsystem.
3041144411Sscottl***********************************************************************************
3042144411Sscottl*/
3043144411Sscottl#define     ARCMSR_ATU_SUBSYSTEM_ID_REG		         0x2E    /*word 0x2F,0x2E*/
3044144411Sscottl/*
3045144411Sscottl***********************************************************************************
3046144411Sscottl**  Expansion ROM Base Address Register -ERBAR
3047144411Sscottl**  -----------------------------------------------------------------
3048144411Sscottl**  Bit       Default                       Description
3049165155Sscottl**  31:12     00000H                        Expansion ROM Base Address - These bits define the actual location
3050165155Sscottl**						where the Expansion ROM address window resides when addressed from the PCI bus on any 4 Kbyte boundary.
3051144411Sscottl**  11:01     000H                          Reserved
3052165155Sscottl**  00        0 2                           Address Decode Enable - This bit field shows the ROM address
3053165155Sscottl**						decoder is enabled or disabled. When cleared, indicates the address decoder is disabled.
3054144411Sscottl***********************************************************************************
3055144411Sscottl*/
3056144411Sscottl#define     ARCMSR_EXPANSION_ROM_BASE_ADDRESS_REG		         0x30    /*dword 0x33,0x32,0v31,0x30*/
3057144411Sscottl#define     ARCMSR_EXPANSION_ROM_ADDRESS_DECODE_ENABLE   		     0x01
3058144411Sscottl/*
3059144411Sscottl***********************************************************************************
3060144411Sscottl**  ATU Capabilities Pointer Register - ATU_CAP_PTR
3061144411Sscottl**  -----------------------------------------------------------------
3062144411Sscottl**  Bit Default Description
3063165155Sscottl**  07:00     C0H                           Capability List Pointer - This provides an offset in this function��s configuration space
3064165155Sscottl**						that points to the 80331 PCl Bus Power Management extended capability.
3065144411Sscottl***********************************************************************************
3066144411Sscottl*/
3067144411Sscottl#define     ARCMSR_ATU_CAPABILITY_PTR_REG		     0x34    /*byte*/
3068144411Sscottl/*
3069144411Sscottl***********************************************************************************
3070144411Sscottl**  Determining Block Sizes for Base Address Registers
3071144411Sscottl**  The required address size and type can be determined by writing ones to a base address register and
3072144411Sscottl**  reading from the registers. By scanning the returned value from the least-significant bit of the base
3073144411Sscottl**  address registers upwards, the programmer can determine the required address space size. The
3074144411Sscottl**  binary-weighted value of the first non-zero bit found indicates the required amount of space.
3075144411Sscottl**  Table 105 describes the relationship between the values read back and the byte sizes the base
3076144411Sscottl**  address register requires.
3077144411Sscottl**  As an example, assume that FFFF.FFFFH is written to the ATU Inbound Base Address Register 0
3078144411Sscottl**  (IABAR0) and the value read back is FFF0.0008H. Bit zero is a zero, so the device requires
3079144411Sscottl**  memory address space. Bit three is one, so the memory does supports prefetching. Scanning
3080144411Sscottl**  upwards starting at bit four, bit twenty is the first one bit found. The binary-weighted value of this
3081144411Sscottl**  bit is 1,048,576, indicated that the device requires 1 Mbyte of memory space.
3082144411Sscottl**  The ATU Base Address Registers and the Expansion ROM Base Address Register use their
3083144411Sscottl**  associated limit registers to enable which bits within the base address register are read/write and
3084144411Sscottl**  which bits are read only (0). This allows the programming of these registers in a manner similar to
3085144411Sscottl**  other PCI devices even though the limit is variable.
3086144411Sscottl**  Table 105. Memory Block Size Read Response
3087144411Sscottl**  Response After Writing all 1s
3088144411Sscottl**  to the Base Address Register
3089144411Sscottl**  Size
3090144411Sscottl**  (Bytes)
3091144411Sscottl**  Response After Writing all 1s
3092144411Sscottl**  to the Base Address Register
3093144411Sscottl**  Size
3094144411Sscottl**  (Bytes)
3095144411Sscottl**  FFFFFFF0H 16 FFF00000H 1 M
3096144411Sscottl**  FFFFFFE0H 32 FFE00000H 2 M
3097144411Sscottl**  FFFFFFC0H 64 FFC00000H 4 M
3098144411Sscottl**  FFFFFF80H 128 FF800000H 8 M
3099144411Sscottl**  FFFFFF00H 256 FF000000H 16 M
3100144411Sscottl**  FFFFFE00H 512 FE000000H 32 M
3101144411Sscottl**  FFFFFC00H 1K FC000000H 64 M
3102144411Sscottl**  FFFFF800H 2K F8000000H 128 M
3103144411Sscottl**  FFFFF000H 4K F0000000H 256 M
3104144411Sscottl**  FFFFE000H 8K E0000000H 512 M
3105144411Sscottl**  FFFFC000H 16K C0000000H 1 G
3106144411Sscottl**  FFFF8000H 32K 80000000H 2 G
3107144411Sscottl**  FFFF0000H 64K
3108144411Sscottl**  00000000H
3109144411Sscottl**  Register not
3110144411Sscottl**  imple-mented,
3111144411Sscottl**  no
3112144411Sscottl**  address
3113144411Sscottl**  space
3114144411Sscottl**  required.
3115144411Sscottl**  FFFE0000H 128K
3116144411Sscottl**  FFFC0000H 256K
3117144411Sscottl**  FFF80000H 512K
3118165155Sscottl**
3119144411Sscottl***************************************************************************************
3120144411Sscottl*/
3121144411Sscottl
3122144411Sscottl/*
3123144411Sscottl***********************************************************************************
3124144411Sscottl**  ATU Interrupt Line Register - ATUILR
3125144411Sscottl**  -----------------------------------------------------------------
3126144411Sscottl**  Bit       Default                       Description
3127144411Sscottl**  07:00       FFH                         Interrupt Assigned - system-assigned value identifies which system interrupt controller��s interrupt
3128165155Sscottl**                                                               request line connects to the device's PCI interrupt request lines
3129165155Sscottl**								(as specified in the interrupt pin register).
3130144411Sscottl**                                                               A value of FFH signifies ��no connection�� or ��unknown��.
3131144411Sscottl***********************************************************************************
3132144411Sscottl*/
3133144411Sscottl#define     ARCMSR_ATU_INTERRUPT_LINE_REG		     0x3C    /*byte*/
3134144411Sscottl/*
3135144411Sscottl***********************************************************************************
3136144411Sscottl**  ATU Interrupt Pin Register - ATUIPR
3137144411Sscottl**  -----------------------------------------------------------------
3138144411Sscottl**  Bit       Default                       Description
3139144411Sscottl**  07:00       01H                         Interrupt Used - A value of 01H signifies that the ATU interface unit uses INTA# as the interrupt pin.
3140144411Sscottl***********************************************************************************
3141144411Sscottl*/
3142144411Sscottl#define     ARCMSR_ATU_INTERRUPT_PIN_REG		     0x3D    /*byte*/
3143144411Sscottl/*
3144144411Sscottl***********************************************************************************
3145144411Sscottl**  ATU Minimum Grant Register - ATUMGNT
3146144411Sscottl**  -----------------------------------------------------------------
3147144411Sscottl**  Bit       Default                       Description
3148144411Sscottl**  07:00       80H                         This register specifies how long a burst period the device needs in increments of 8 PCI clocks.
3149144411Sscottl***********************************************************************************
3150144411Sscottl*/
3151144411Sscottl#define     ARCMSR_ATU_MINIMUM_GRANT_REG		     0x3E    /*byte*/
3152144411Sscottl/*
3153144411Sscottl***********************************************************************************
3154144411Sscottl**  ATU Maximum Latency Register - ATUMLAT
3155144411Sscottl**  -----------------------------------------------------------------
3156144411Sscottl**  Bit       Default                       Description
3157165155Sscottl**  07:00       00H                         Specifies frequency (how often) the device needs to access the PCI bus
3158165155Sscottl**						in increments of 8 PCI clocks. A zero value indicates the device has no stringent requirement.
3159144411Sscottl***********************************************************************************
3160144411Sscottl*/
3161144411Sscottl#define     ARCMSR_ATU_MAXIMUM_LATENCY_REG		     0x3F    /*byte*/
3162144411Sscottl/*
3163144411Sscottl***********************************************************************************
3164144411Sscottl**  Inbound Address Translation
3165144411Sscottl**
3166144411Sscottl**  The ATU allows external PCI bus initiators to directly access the internal bus.
3167144411Sscottl**  These PCI bus initiators can read or write 80331 memory-mapped registers or 80331 local memory space.
3168144411Sscottl**  The process of inbound address translation involves two steps:
3169144411Sscottl**  1. Address Detection.
3170144411Sscottl**             �E Determine when the 32-bit PCI address (64-bit PCI address during DACs) is
3171144411Sscottl**                within the address windows defined for the inbound ATU.
3172144411Sscottl**             �E Claim the PCI transaction with medium DEVSEL# timing in the conventional PCI
3173144411Sscottl**                mode and with Decode A DEVSEL# timing in the PCI-X mode.
3174144411Sscottl**  2. Address Translation.
3175144411Sscottl**             �E Translate the 32-bit PCI address (lower 32-bit PCI address during DACs) to a 32-bit 80331 internal bus address.
3176144411Sscottl**  				The ATU uses the following registers in inbound address window 0 translation:
3177144411Sscottl**  				�E Inbound ATU Base Address Register 0
3178144411Sscottl**  				�E Inbound ATU Limit Register 0
3179144411Sscottl**  				�E Inbound ATU Translate Value Register 0
3180144411Sscottl**  				The ATU uses the following registers in inbound address window 2 translation:
3181144411Sscottl**  				�E Inbound ATU Base Address Register 2
3182144411Sscottl**  				�E Inbound ATU Limit Register 2
3183144411Sscottl**  				�E Inbound ATU Translate Value Register 2
3184144411Sscottl**  				The ATU uses the following registers in inbound address window 3 translation:
3185144411Sscottl**  				�E Inbound ATU Base Address Register 3
3186144411Sscottl**  				�E Inbound ATU Limit Register 3
3187144411Sscottl**  				�E Inbound ATU Translate Value Register 3
3188144411Sscottl**    Note: Inbound Address window 1 is not a translate window.
3189144411Sscottl**          Instead, window 1 may be used to allocate host memory for Private Devices.
3190144411Sscottl**          Inbound Address window 3 does not reside in the standard section of the configuration header (offsets 00H - 3CH),
3191144411Sscottl**          thus the host BIOS does not configure window 3.
3192144411Sscottl**          Window 3 is intended to be used as a special window into local memory for private PCI
3193144411Sscottl**          agents controlled by the 80331 in conjunction with the Private Memory Space of the bridge.
3194144411Sscottl**          PCI-to-PCI Bridge in 80331 or
3195144411Sscottl**          Inbound address detection is determined from the 32-bit PCI address,
3196144411Sscottl**          (64-bit PCI address during DACs) the base address register and the limit register.
3197144411Sscottl**          In the case of DACs none of the upper 32-bits of the address is masked during address comparison.
3198144411Sscottl**
3199144411Sscottl**  The algorithm for detection is:
3200144411Sscottl**
3201144411Sscottl**  Equation 1. Inbound Address Detection
3202144411Sscottl**              When (PCI_Address [31:0] & Limit_Register[31:0]) == (Base_Register[31:0] & PCI_Address [63:32]) == Base_Register[63:32] (for DACs only)
3203144411Sscottl**              the PCI Address is claimed by the Inbound ATU.
3204144411Sscottl**
3205144411Sscottl**  			The incoming 32-bit PCI address (lower 32-bits of the address in case of DACs) is bitwise ANDed
3206144411Sscottl**  			with the associated inbound limit register.
3207144411Sscottl**              When the result matches the base register (and upper base address matches upper PCI address in case of DACs),
3208144411Sscottl**              the inbound PCI address is detected as being within the inbound translation window and is claimed by the ATU.
3209144411Sscottl**
3210144411Sscottl**  			Note:   The first 4 Kbytes of the ATU inbound address translation window 0 are reserved for the Messaging Unit.
3211144411Sscottl**  					Once the transaction is claimed, the address must be translated from a PCI address to a 32-bit
3212144411Sscottl**  					internal bus address. In case of DACs upper 32-bits of the address is simply discarded and only the
3213144411Sscottl**  					lower 32-bits are used during address translation.
3214144411Sscottl**              		The algorithm is:
3215144411Sscottl**
3216144411Sscottl**
3217144411Sscottl**  Equation 2. Inbound Translation
3218144411Sscottl**              Intel I/O processor Internal Bus Address=(PCI_Address[31:0] & ~Limit_Register[31:0]) | ATU_Translate_Value_Register[31:0].
3219144411Sscottl**
3220144411Sscottl**  			The incoming 32-bit PCI address (lower 32-bits in case of DACs) is first bitwise ANDed with the
3221144411Sscottl**  			bitwise inverse of the limit register. This result is bitwise ORed with the ATU Translate Value and
3222144411Sscottl**  			the result is the internal bus address. This translation mechanism is used for all inbound memory
3223144411Sscottl**  			read and write commands excluding inbound configuration read and writes.
3224144411Sscottl**  			In the PCI mode for inbound memory transactions, the only burst order supported is Linear
3225144411Sscottl**  			Incrementing. For any other burst order, the ATU signals a Disconnect after the first data phase.
3226144411Sscottl**  			The PCI-X supports linear incrementing only, and hence above situation is not encountered in the PCI-X mode.
3227144411Sscottl**  example:
3228144411Sscottl**  	    Register Values
3229144411Sscottl**  		         Base_Register=3A00 0000H
3230144411Sscottl**  		        Limit_Register=FF80 0000H (8 Mbyte limit value)
3231144411Sscottl**  		        Value_Register=B100 0000H
3232144411Sscottl**  		        Inbound Translation Window ranges from 3A00 0000H to 3A7F FFFFH (8 Mbytes)
3233144411Sscottl**
3234144411Sscottl**  		Address Detection (32-bit address)
3235144411Sscottl**
3236144411Sscottl**  						PCI_Address & Limit_Register == Base_Register
3237144411Sscottl**  						3A45 012CH  &   FF80 0000H   ==  3A00 0000H
3238144411Sscottl**
3239144411Sscottl**  					ANS: PCI_Address is in the Inbound Translation Window
3240144411Sscottl**  		Address Translation (to get internal bus address)
3241144411Sscottl**
3242144411Sscottl**  						IB_Address=(PCI_Address & ~Limit_Register) | Value_Reg
3243144411Sscottl**  						IB_Address=(3A45 012CH & 007F FFFFH) | B100 0000H
3244144411Sscottl**
3245144411Sscottl**  					ANS:IB_Address=B145 012CH
3246144411Sscottl***********************************************************************************
3247144411Sscottl*/
3248144411Sscottl
3249144411Sscottl/*
3250144411Sscottl***********************************************************************************
3251144411Sscottl**  Inbound ATU Limit Register 0 - IALR0
3252165155Sscottl**
3253144411Sscottl**  Inbound address translation for memory window 0 occurs for data transfers occurring from the PCI
3254144411Sscottl**  bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts
3255144411Sscottl**  PCI addresses to internal bus addresses.
3256144411Sscottl**  The 80331 translate value register��s programmed value must be naturally aligned with the base
3257144411Sscottl**  address register��s programmed value. The limit register is used as a mask; thus, the lower address
3258144411Sscottl**  bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus
3259144411Sscottl**  Specification, Revision 2.3 for additional information on programming base address registers.
3260144411Sscottl**  Bits 31 to 12 within the IALR0 have a direct effect on the IABAR0 register, bits 31 to 12, with a
3261144411Sscottl**  one to one correspondence. A value of 0 in a bit within the IALR0 makes the corresponding bit
3262144411Sscottl**  within the IABAR0 a read only bit which always returns 0. A value of 1 in a bit within the IALR0
3263144411Sscottl**  makes the corresponding bit within the IABAR0 read/write from PCI. Note that a consequence of
3264144411Sscottl**  this programming scheme is that unless a valid value exists within the IALR0, all writes to the
3265144411Sscottl**  IABAR0 has no effect since a value of all zeros within the IALR0 makes the IABAR0 a read only  register.
3266144411Sscottl**  -----------------------------------------------------------------
3267144411Sscottl**  Bit       Default                       Description
3268144411Sscottl**  31:12     FF000H                        Inbound Translation Limit 0 - This readback value determines the memory block size required for
3269165155Sscottl**                                          inbound memory window 0 of the address translation unit. This defaults to an inbound window of 16MB.
3270144411Sscottl**  11:00       000H                        Reserved
3271144411Sscottl***********************************************************************************
3272144411Sscottl*/
3273144411Sscottl#define     ARCMSR_INBOUND_ATU_LIMIT0_REG		     0x40    /*dword 0x43,0x42,0x41,0x40*/
3274144411Sscottl/*
3275144411Sscottl***********************************************************************************
3276144411Sscottl**  Inbound ATU Translate Value Register 0 - IATVR0
3277165155Sscottl**
3278144411Sscottl**  The Inbound ATU Translate Value Register 0 (IATVR0) contains the internal bus address used to
3279144411Sscottl**  convert PCI bus addresses. The converted address is driven on the internal bus as a result of the
3280144411Sscottl**  inbound ATU address translation.
3281144411Sscottl**  -----------------------------------------------------------------
3282144411Sscottl**  Bit       Default                       Description
3283144411Sscottl**  31:12     FF000H                        Inbound ATU Translation Value 0 - This value is used to convert the PCI address to internal bus addresses.
3284165155Sscottl**                                          This value must be 64-bit aligned on the internal bus.
3285165155Sscottl**						The default address allows the ATU to access the internal 80331 memory-mapped registers.
3286144411Sscottl**  11:00       000H                        Reserved
3287144411Sscottl***********************************************************************************
3288144411Sscottl*/
3289144411Sscottl#define     ARCMSR_INBOUND_ATU_TRANSLATE_VALUE0_REG		     0x44    /*dword 0x47,0x46,0x45,0x44*/
3290144411Sscottl/*
3291144411Sscottl***********************************************************************************
3292144411Sscottl**  Expansion ROM Limit Register - ERLR
3293165155Sscottl**
3294144411Sscottl**  The Expansion ROM Limit Register (ERLR) defines the block size of addresses the ATU defines
3295144411Sscottl**  as Expansion ROM address space. The block size is programmed by writing a value into the ERLR.
3296144411Sscottl**  Bits 31 to 12 within the ERLR have a direct effect on the ERBAR register, bits 31 to 12, with a one
3297144411Sscottl**  to one correspondence. A value of 0 in a bit within the ERLR makes the corresponding bit within
3298144411Sscottl**  the ERBAR a read only bit which always returns 0. A value of 1 in a bit within the ERLR makes
3299144411Sscottl**  the corresponding bit within the ERBAR read/write from PCI.
3300144411Sscottl**  -----------------------------------------------------------------
3301144411Sscottl**  Bit       Default                       Description
3302144411Sscottl**  31:12     000000H                       Expansion ROM Limit - Block size of memory required for the Expansion ROM translation unit. Default
3303165155Sscottl**                         value is 0, which indicates no Expansion ROM address space and all bits within the ERBAR are read only with a value of 0.
3304144411Sscottl**  11:00        000H                       Reserved.
3305144411Sscottl***********************************************************************************
3306144411Sscottl*/
3307144411Sscottl#define     ARCMSR_EXPANSION_ROM_LIMIT_REG		          0x48    /*dword 0x4B,0x4A,0x49,0x48*/
3308144411Sscottl/*
3309144411Sscottl***********************************************************************************
3310144411Sscottl**  Expansion ROM Translate Value Register - ERTVR
3311165155Sscottl**
3312144411Sscottl**  The Expansion ROM Translate Value Register contains the 80331 internal bus address which the
3313144411Sscottl**  ATU converts the PCI bus access. This address is driven on the internal bus as a result of the
3314144411Sscottl**  Expansion ROM address translation.
3315144411Sscottl**  -----------------------------------------------------------------
3316144411Sscottl**  Bit       Default                       Description
3317144411Sscottl**  31:12     00000H                        Expansion ROM Translation Value - Used to convert PCI addresses to 80331 internal bus addresses
3318165155Sscottl**                          for Expansion ROM accesses. The Expansion ROM address translation value must be word aligned on the internal bus.
3319144411Sscottl**  11:00       000H                        Reserved
3320144411Sscottl***********************************************************************************
3321144411Sscottl*/
3322144411Sscottl#define     ARCMSR_EXPANSION_ROM_TRANSLATE_VALUE_REG		          0x4C    /*dword 0x4F,0x4E,0x4D,0x4C*/
3323144411Sscottl/*
3324144411Sscottl***********************************************************************************
3325144411Sscottl**  Inbound ATU Limit Register 1 - IALR1
3326165155Sscottl**
3327144411Sscottl**  Bits 31 to 12 within the IALR1 have a direct effect on the IABAR1 register, bits 31 to 12, with a
3328144411Sscottl**  one to one correspondence. A value of 0 in a bit within the IALR1 makes the corresponding bit
3329144411Sscottl**  within the IABAR1 a read only bit which always returns 0. A value of 1 in a bit within the IALR1
3330144411Sscottl**  makes the corresponding bit within the IABAR1 read/write from PCI. Note that a consequence of
3331144411Sscottl**  this programming scheme is that unless a valid value exists within the IALR1, all writes to the
3332144411Sscottl**  IABAR1 has no effect since a value of all zeros within the IALR1 makes the IABAR1 a read only
3333144411Sscottl**  register.
3334144411Sscottl**  The inbound memory window 1 is used merely to allocate memory on the PCI bus. The ATU does
3335144411Sscottl**  not process any PCI bus transactions to this memory range.
3336144411Sscottl**  Warning: The ATU does not claim any PCI accesses that fall within the range defined by IABAR1,
3337144411Sscottl**  IAUBAR1, and IALR1.
3338144411Sscottl**  -----------------------------------------------------------------
3339144411Sscottl**  Bit       Default                       Description
3340165155Sscottl**  31:12     00000H                        Inbound Translation Limit 1 - This readback value determines the memory block size
3341165155Sscottl**						required for the ATUs memory window 1.
3342144411Sscottl**  11:00 000H Reserved
3343144411Sscottl***********************************************************************************
3344144411Sscottl*/
3345144411Sscottl#define     ARCMSR_INBOUND_ATU_LIMIT1_REG		          0x50    /*dword 0x53,0x52,0x51,0x50*/
3346144411Sscottl/*
3347144411Sscottl***********************************************************************************
3348144411Sscottl**  Inbound ATU Limit Register 2 - IALR2
3349144411Sscottl**
3350144411Sscottl**  Inbound address translation for memory window 2 occurs for data transfers occurring from the PCI
3351144411Sscottl**  bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts
3352144411Sscottl**  PCI addresses to internal bus addresses.
3353144411Sscottl**  The inbound translation base address for inbound window 2 is specified in Section 3.10.15. When
3354144411Sscottl**  determining block size requirements �X as described in Section 3.10.21 �X the translation limit
3355144411Sscottl**  register provides the block size requirements for the base address register. The remaining registers
3356144411Sscottl**  used for performing address translation are discussed in Section 3.2.1.1.
3357144411Sscottl**  The 80331 translate value register��s programmed value must be naturally aligned with the base
3358144411Sscottl**  address register��s programmed value. The limit register is used as a mask; thus, the lower address
3359144411Sscottl**  bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus
3360144411Sscottl**  Specification, Revision 2.3 for additional information on programming base address registers.
3361144411Sscottl**  Bits 31 to 12 within the IALR2 have a direct effect on the IABAR2 register, bits 31 to 12, with a
3362144411Sscottl**  one to one correspondence. A value of 0 in a bit within the IALR2 makes the corresponding bit
3363144411Sscottl**  within the IABAR2 a read only bit which always returns 0. A value of 1 in a bit within the IALR2
3364144411Sscottl**  makes the corresponding bit within the IABAR2 read/write from PCI. Note that a consequence of
3365144411Sscottl**  this programming scheme is that unless a valid value exists within the IALR2, all writes to the
3366144411Sscottl**  IABAR2 has no effect since a value of all zeros within the IALR2 makes the IABAR2 a read only
3367144411Sscottl**  register.
3368144411Sscottl**  -----------------------------------------------------------------
3369144411Sscottl**  Bit       Default                       Description
3370165155Sscottl**  31:12     00000H                        Inbound Translation Limit 2 - This readback value determines the memory block size
3371165155Sscottl**						required for the ATUs memory window 2.
3372144411Sscottl**  11:00       000H                        Reserved
3373144411Sscottl***********************************************************************************
3374144411Sscottl*/
3375144411Sscottl#define     ARCMSR_INBOUND_ATU_LIMIT2_REG		          0x54    /*dword 0x57,0x56,0x55,0x54*/
3376144411Sscottl/*
3377144411Sscottl***********************************************************************************
3378144411Sscottl**  Inbound ATU Translate Value Register 2 - IATVR2
3379165155Sscottl**
3380144411Sscottl**  The Inbound ATU Translate Value Register 2 (IATVR2) contains the internal bus address used to
3381144411Sscottl**  convert PCI bus addresses. The converted address is driven on the internal bus as a result of the
3382144411Sscottl**  inbound ATU address translation.
3383144411Sscottl**  -----------------------------------------------------------------
3384144411Sscottl**  Bit       Default                       Description
3385144411Sscottl**  31:12     00000H                        Inbound ATU Translation Value 2 - This value is used to convert the PCI address to internal bus addresses.
3386165155Sscottl**                                                                            This value must be 64-bit aligned on the internal bus.
3387165155Sscottl**										The default address allows the ATU to access the internal 80331 **	**										memory-mapped registers.
3388144411Sscottl**  11:00       000H                        Reserved
3389144411Sscottl***********************************************************************************
3390144411Sscottl*/
3391144411Sscottl#define     ARCMSR_INBOUND_ATU_TRANSLATE_VALUE2_REG		          0x58    /*dword 0x5B,0x5A,0x59,0x58*/
3392144411Sscottl/*
3393144411Sscottl***********************************************************************************
3394144411Sscottl**  Outbound I/O Window Translate Value Register - OIOWTVR
3395165155Sscottl**
3396144411Sscottl**  The Outbound I/O Window Translate Value Register (OIOWTVR) contains the PCI I/O address
3397144411Sscottl**  used to convert the internal bus access to a PCI address. This address is driven on the PCI bus as a
3398144411Sscottl**  result of the outbound ATU address translation.
3399144411Sscottl**  The I/O window is from 80331 internal bus address 9000 000H to 9000 FFFFH with the fixed
3400144411Sscottl**  length of 64 Kbytes.
3401144411Sscottl**  -----------------------------------------------------------------
3402144411Sscottl**  Bit       Default                       Description
3403144411Sscottl**  31:16     0000H                         Outbound I/O Window Translate Value - Used to convert internal bus addresses to PCI addresses.
3404144411Sscottl**  15:00     0000H                         Reserved
3405144411Sscottl***********************************************************************************
3406144411Sscottl*/
3407144411Sscottl#define     ARCMSR_OUTBOUND_IO_WINDOW_TRANSLATE_VALUE_REG		          0x5C    /*dword 0x5F,0x5E,0x5D,0x5C*/
3408144411Sscottl/*
3409144411Sscottl***********************************************************************************
3410144411Sscottl**  Outbound Memory Window Translate Value Register 0 -OMWTVR0
3411165155Sscottl**
3412144411Sscottl**  The Outbound Memory Window Translate Value Register 0 (OMWTVR0) contains the PCI
3413144411Sscottl**  address used to convert 80331 internal bus addresses for outbound transactions. This address is
3414144411Sscottl**  driven on the PCI bus as a result of the outbound ATU address translation.
3415144411Sscottl**  The memory window is from internal bus address 8000 000H to 83FF FFFFH with the fixed length
3416144411Sscottl**  of 64 Mbytes.
3417144411Sscottl**  -----------------------------------------------------------------
3418144411Sscottl**  Bit       Default                       Description
3419144411Sscottl**  31:26       00H                         Outbound MW Translate Value - Used to convert 80331 internal bus addresses to PCI addresses.
3420144411Sscottl**  25:02     00 0000H                      Reserved
3421165155Sscottl**  01:00      00 2                         Burst Order - This bit field shows the address sequence during a memory burst.
3422165155Sscottl**								Only linear incrementing mode is supported.
3423144411Sscottl***********************************************************************************
3424144411Sscottl*/
3425144411Sscottl#define     ARCMSR_OUTBOUND_MEMORY_WINDOW_TRANSLATE_VALUE0_REG		          0x60    /*dword 0x63,0x62,0x61,0x60*/
3426144411Sscottl/*
3427144411Sscottl***********************************************************************************
3428144411Sscottl**  Outbound Upper 32-bit Memory Window Translate Value Register 0 - OUMWTVR0
3429165155Sscottl**
3430144411Sscottl**  The Outbound Upper 32-bit Memory Window Translate Value Register 0 (OUMWTVR0) defines
3431144411Sscottl**  the upper 32-bits of address used during a dual address cycle. This enables the outbound ATU to
3432144411Sscottl**  directly address anywhere within the 64-bit host address space. When this register is all-zero, then
3433144411Sscottl**  a SAC is generated on the PCI bus.
3434144411Sscottl**  The memory window is from internal bus address 8000 000H to 83FF FFFFH with the fixed
3435144411Sscottl**  length of 64 Mbytes.
3436144411Sscottl**  -----------------------------------------------------------------
3437144411Sscottl**  Bit       Default                       Description
3438144411Sscottl**  31:00     0000 0000H                    These bits define the upper 32-bits of address driven during the dual address cycle (DAC).
3439144411Sscottl***********************************************************************************
3440144411Sscottl*/
3441144411Sscottl#define     ARCMSR_OUTBOUND_UPPER32_MEMORY_WINDOW_TRANSLATE_VALUE0_REG		          0x64    /*dword 0x67,0x66,0x65,0x64*/
3442144411Sscottl/*
3443144411Sscottl***********************************************************************************
3444144411Sscottl**  Outbound Memory Window Translate Value Register 1 -OMWTVR1
3445165155Sscottl**
3446144411Sscottl**  The Outbound Memory Window Translate Value Register 1 (OMWTVR1) contains the PCI
3447144411Sscottl**  address used to convert 80331 internal bus addresses for outbound transactions. This address is
3448144411Sscottl**  driven on the PCI bus as a result of the outbound ATU address translation.
3449144411Sscottl**  The memory window is from internal bus address 8400 000H to 87FF FFFFH with the fixed length
3450144411Sscottl**  of 64 Mbytes.
3451144411Sscottl**  -----------------------------------------------------------------
3452144411Sscottl**  Bit       Default                       Description
3453144411Sscottl**  31:26       00H                         Outbound MW Translate Value - Used to convert 80331 internal bus addresses to PCI addresses.
3454144411Sscottl**  25:02     00 0000H                      Reserved
3455165155Sscottl**  01:00       00 2                        Burst Order - This bit field shows the address sequence during a memory burst.
3456165155Sscottl**						Only linear incrementing mode is supported.
3457144411Sscottl***********************************************************************************
3458144411Sscottl*/
3459144411Sscottl#define     ARCMSR_OUTBOUND_MEMORY_WINDOW_TRANSLATE_VALUE1_REG		          0x68    /*dword 0x6B,0x6A,0x69,0x68*/
3460144411Sscottl/*
3461144411Sscottl***********************************************************************************
3462144411Sscottl**  Outbound Upper 32-bit Memory Window Translate Value Register 1 - OUMWTVR1
3463165155Sscottl**
3464144411Sscottl**  The Outbound Upper 32-bit Memory Window Translate Value Register 1 (OUMWTVR1) defines
3465144411Sscottl**  the upper 32-bits of address used during a dual address cycle. This enables the outbound ATU to
3466144411Sscottl**  directly address anywhere within the 64-bit host address space. When this register is all-zero, then
3467144411Sscottl**  a SAC is generated on the PCI bus.
3468144411Sscottl**  The memory window is from internal bus address 8400 000H to 87FF FFFFH with the fixed length
3469144411Sscottl**  of 64 Mbytes.
3470144411Sscottl**  -----------------------------------------------------------------
3471144411Sscottl**  Bit       Default                       Description
3472144411Sscottl**  31:00    0000 0000H                     These bits define the upper 32-bits of address driven during the dual address cycle (DAC).
3473144411Sscottl***********************************************************************************
3474144411Sscottl*/
3475144411Sscottl#define     ARCMSR_OUTBOUND_UPPER32_MEMORY_WINDOW_TRANSLATE_VALUE1_REG		          0x6C    /*dword 0x6F,0x6E,0x6D,0x6C*/
3476144411Sscottl/*
3477144411Sscottl***********************************************************************************
3478144411Sscottl**  Outbound Upper 32-bit Direct Window Translate Value Register - OUDWTVR
3479165155Sscottl**
3480144411Sscottl**  The Outbound Upper 32-bit Direct Window Translate Value Register (OUDWTVR) defines the
3481144411Sscottl**  upper 32-bits of address used during a dual address cycle for the transactions via Direct Addressing
3482144411Sscottl**  Window. This enables the outbound ATU to directly address anywhere within the 64-bit host
3483144411Sscottl**  address space. When this register is all-zero, then a SAC is generated on the PCI bus.
3484144411Sscottl**  -----------------------------------------------------------------
3485144411Sscottl**  Bit       Default                       Description
3486144411Sscottl**  31:00    0000 0000H                     These bits define the upper 32-bits of address driven during the dual address cycle (DAC).
3487144411Sscottl***********************************************************************************
3488144411Sscottl*/
3489144411Sscottl#define     ARCMSR_OUTBOUND_UPPER32_DIRECT_WINDOW_TRANSLATE_VALUE_REG		          0x78    /*dword 0x7B,0x7A,0x79,0x78*/
3490144411Sscottl/*
3491144411Sscottl***********************************************************************************
3492144411Sscottl**  ATU Configuration Register - ATUCR
3493165155Sscottl**
3494144411Sscottl**  The ATU Configuration Register controls the outbound address translation for address translation
3495144411Sscottl**  unit. It also contains bits for Conventional PCI Delayed Read Command (DRC) aliasing, discard
3496144411Sscottl**  timer status, SERR# manual assertion, SERR# detection interrupt masking, and ATU BIST
3497144411Sscottl**  interrupt enabling.
3498144411Sscottl**  -----------------------------------------------------------------
3499144411Sscottl**  Bit       Default                       Description
3500144411Sscottl**  31:20       00H                         Reserved
3501144411Sscottl**  19          0 2                         ATU DRC Alias - when set, the ATU does not distinguish read commands when attempting to match a
3502165155Sscottl**  			current PCI read transaction with read data enqueued within the DRC buffer. When clear, a current read
3503165155Sscottl**  			transaction must have the exact same read command as the DRR for the ATU to deliver DRC data. Not
3504165155Sscottl**  			applicable in the PCI-X mode.
3505165155Sscottl**  18          0 2                         Direct Addressing Upper 2Gbytes Translation Enable - When set,
3506165155Sscottl**						with Direct Addressing enabled (bit 7 of the ATUCR set),
3507165155Sscottl**							the ATU forwards internal bus cycles with an address between 0000.0040H and
3508165155Sscottl**								7FFF.FFFFH to the PCI bus with bit 31 of the address set (8000.0000H - FFFF.FFFFH).
3509165155Sscottl**									 When clear, no translation occurs.
3510144411Sscottl**  17          0 2                         Reserved
3511144411Sscottl**  16          0 2                         SERR# Manual Assertion - when set, the ATU asserts SERR# for one clock on the PCI interface. Until
3512165155Sscottl**						cleared, SERR# may not be manually asserted again. Once cleared, operation proceeds as specified.
3513144411Sscottl**  15          0 2                         ATU Discard Timer Status - when set, one of the 4 discard timers within the ATU has expired and
3514165155Sscottl** 						discarded the delayed completion transaction within the queue. When clear, no timer has expired.
3515144411Sscottl**  14:10    00000 2                        Reserved
3516144411Sscottl**  09          0 2                         SERR# Detected Interrupt Enable - When set, the Intel XScale core is signalled an HPI# interrupt
3517165155Sscottl**						when the ATU detects that SERR# was asserted. When clear,
3518165155Sscottl**							the Intel XScale core is not interrupted when SERR# is detected.
3519144411Sscottl**  08          0 2                         Direct Addressing Enable - Setting this bit enables direct outbound addressing through the ATU.
3520165155Sscottl**  						Internal bus cycles with an address between 0000.0040H and 7FFF.FFFFH automatically forwards to
3521165155Sscottl**  						the PCI bus with or without translation of address bit 31 based on the setting of bit 18 of
3522165155Sscottl**							the ATUCR.
3523144411Sscottl**  07:04    0000 2                         Reserved
3524144411Sscottl**  03          0 2                         ATU BIST Interrupt Enable - When set, enables an interrupt to the Intel XScale core when the start
3525165155Sscottl**						BIST bit is set in the ATUBISTR register. This bit is also reflected as the BIST Capable bit 7
3526165155Sscottl**							in the ATUBISTR register.
3527144411Sscottl**  02          0 2                         Reserved
3528165155Sscottl**  01          0 2                         Outbound ATU Enable - When set, enables the outbound address translation unit.
3529165155Sscottl**						When cleared, disables the outbound ATU.
3530144411Sscottl**  00          0 2                         Reserved
3531144411Sscottl***********************************************************************************
3532144411Sscottl*/
3533144411Sscottl#define     ARCMSR_ATU_CONFIGURATION_REG		          0x80    /*dword 0x83,0x82,0x81,0x80*/
3534144411Sscottl/*
3535144411Sscottl***********************************************************************************
3536144411Sscottl**  PCI Configuration and Status Register - PCSR
3537144411Sscottl**
3538144411Sscottl**  The PCI Configuration and Status Register has additional bits for controlling and monitoring
3539144411Sscottl**  various features of the PCI bus interface.
3540144411Sscottl**  -----------------------------------------------------------------
3541144411Sscottl**  Bit       Default                       Description
3542144411Sscottl**  31:19      0000H                        Reserved
3543144411Sscottl**  18          0 2                         Detected Address or Attribute Parity Error - set when a parity error is detected during either the address
3544165155Sscottl**  					or attribute phase of a transaction on the PCI bus even when the ATUCMD register Parity Error
3545165155Sscottl**  					Response bit is cleared. Set under the following conditions:
3546165155Sscottl**  					�E Any Address or Attribute (PCI-X Only) Parity Error on the Bus (including one generated by the ATU).
3547144411Sscottl**  17:16  Varies with
3548144411Sscottl**  										external state
3549144411Sscottl**  										of DEVSEL#,
3550144411Sscottl**  										STOP#, and
3551144411Sscottl**  										TRDY#,
3552144411Sscottl**  										during
3553144411Sscottl**  										P_RST#
3554165155Sscottl**  										PCI-X capability - These two bits define the mode of
3555165155Sscottl**  										the PCI bus (conventional or PCI-X) as well as the
3556144411Sscottl**  										operating frequency in the case of PCI-X mode.
3557144411Sscottl**  										00 - Conventional PCI mode
3558144411Sscottl**  										01 - PCI-X 66
3559144411Sscottl**  										10 - PCI-X 100
3560144411Sscottl**  										11 - PCI-X 133
3561165155Sscottl**  										As defined by the PCI-X Addendum to the PCI Local Bus Specification,
3562165155Sscottl**  										Revision 1.0a, the operating
3563165155Sscottl**  										mode is determined by an initialization pattern on the PCI bus during
3564165155Sscottl**  										P_RST# assertion:
3565144411Sscottl**  										DEVSEL# STOP# TRDY# Mode
3566144411Sscottl**  										Deasserted Deasserted Deasserted Conventional
3567144411Sscottl**  										Deasserted Deasserted Asserted PCI-X 66
3568144411Sscottl**  										Deasserted Asserted Deasserted PCI-X 100
3569144411Sscottl**  										Deasserted Asserted Asserted PCI-X 133
3570144411Sscottl**  										All other patterns are reserved.
3571144411Sscottl**  15          0 2
3572144411Sscottl**  										Outbound Transaction Queue Busy:
3573144411Sscottl**  										    0=Outbound Transaction Queue Empty
3574144411Sscottl**  										    1=Outbound Transaction Queue Busy
3575144411Sscottl**  14          0 2
3576144411Sscottl**  										Inbound Transaction Queue Busy:
3577144411Sscottl**  										    0=Inbound Transaction Queue Empty
3578144411Sscottl**  										    1=Inbound Transaction Queue Busy
3579144411Sscottl**  13          0 2                         Reserved.
3580165155Sscottl**  12          0 2								Discard Timer Value - This bit controls the time-out value
3581165155Sscottl**  										for the four discard timers attached to the queues holding read data.
3582144411Sscottl**                                                         A value of 0 indicates the time-out value is 2 15 clocks.
3583144411Sscottl**                                                         A value of 1 indicates the time-out value is 2 10 clocks.
3584144411Sscottl**  11          0 2                         Reserved.
3585144411Sscottl**  10      Varies with
3586144411Sscottl**  										external state
3587144411Sscottl**  										of M66EN
3588144411Sscottl**  										during
3589144411Sscottl**  										P_RST#
3590165155Sscottl**  							Bus Operating at 66 MHz - When set, the interface has been initialized to function at 66 MHz in
3591165155Sscottl**  										Conventional PCI mode by the assertion of M66EN during bus initialization.
3592165155Sscottl**  										When clear, the interface
3593144411Sscottl**  										has been initialized as a 33 MHz bus.
3594165155Sscottl**  		NOTE: When PCSR bits 17:16 are not equal to zero, then this bit is meaningless since the 80331 is operating in PCI-X mode.
3595144411Sscottl**  09          0 2                         Reserved
3596144411Sscottl**  08      Varies with
3597144411Sscottl**  										external state
3598144411Sscottl**  										of REQ64#
3599144411Sscottl**  										during
3600144411Sscottl**  										P_RST#
3601165155Sscottl**  										PCI Bus 64-Bit Capable - When clear, the PCI bus interface has been
3602165155Sscottl**  										configured as 64-bit capable by
3603165155Sscottl**  										the assertion of REQ64# on the rising edge of P_RST#. When set,
3604165155Sscottl**  										the PCI interface is configured as
3605144411Sscottl**  										32-bit only.
3606144411Sscottl**  07:06      00 2                         Reserved.
3607165155Sscottl**  05         0 2   						Reset Internal Bus - This bit controls the reset of the Intel XScale core
3608165155Sscottl**  								and all units on the internal
3609165155Sscottl**  								bus. In addition to the internal bus initialization,
3610165155Sscottl**  								this bit triggers the assertion of the M_RST# pin for
3611165155Sscottl**  								initialization of registered DIMMs. When set:
3612165155Sscottl**  								When operating in the conventional PCI mode:
3613165155Sscottl**  								�E All current PCI transactions being mastered by the ATU completes,
3614165155Sscottl**  								and the ATU master interfaces
3615165155Sscottl**  								proceeds to an idle state. No additional transactions is mastered by these units
3616165155Sscottl**  								until the internal bus reset is complete.
3617165155Sscottl**  								�E All current transactions being slaved by the ATU on either the PCI bus
3618165155Sscottl**  								or the internal bus
3619165155Sscottl**  								completes, and the ATU target interfaces proceeds to an idle state.
3620165155Sscottl**  								All future slave transactions master aborts,
3621165155Sscottl**  								with the exception of the completion cycle for the transaction that set the Reset
3622165155Sscottl**  								Internal Bus bit in the PCSR.
3623165155Sscottl**  								�E When the value of the Core Processor Reset bit in the PCSR (upon P_RST# assertion)
3624165155Sscottl**  								is set, the Intel XScale core is held in reset when the internal bus reset is complete.
3625165155Sscottl**  								�E The ATU ignores configuration cycles, and they appears as master aborts for: 32
3626165155Sscottl**  								Internal Bus clocks.
3627165155Sscottl**  								�E The 80331 hardware clears this bit after the reset operation completes.
3628165155Sscottl**  								When operating in the PCI-X mode:
3629165155Sscottl**  								The ATU hardware responds the same as in Conventional PCI-X mode.
3630165155Sscottl**  								However, this may create a problem in PCI-X mode for split requests in
3631165155Sscottl**  								that there may still be an outstanding split completion that the
3632165155Sscottl**  								ATU is either waiting to receive (Outbound Request) or initiate
3633165155Sscottl**  								(Inbound Read Request). For a cleaner
3634165155Sscottl**  								internal bus reset, host software can take the following steps prior
3635165155Sscottl**  								to asserting Reset Internal bus:
3636165155Sscottl**  					1. Clear the Bus Master (bit 2 of the ATUCMD) and the Memory Enable (bit 1 of the ATUCMD) bits in
3637165155Sscottl**  						the ATUCMD. This ensures that no new transactions, either outbound or inbound are enqueued.
3638165155Sscottl**  					2. Wait for both the Outbound (bit 15 of the PCSR) and Inbound Read (bit 14 of the PCSR) Transaction
3639165155Sscottl**  						queue busy bits to be clear.
3640165155Sscottl**  					3. Set the Reset Internal Bus bit
3641165155Sscottl**  	As a result, the ATU hardware resets the internal bus using the same logic as in conventional mode,
3642165155Sscottl**  	however the user is now assured that the ATU no longer has any pending inbound or outbound split
3643165155Sscottl**  	completion transactions.
3644165155Sscottl**  	NOTE: Since the Reset Internal Bus bit is set using an inbound configuration cycle, the user is
3645165155Sscottl**  	guaranteed that any prior configuration cycles have properly completed since there is only a one
3646165155Sscottl**  	deep transaction queue for configuration transaction requests. The ATU sends the appropriate
3647165155Sscottl**  	Split Write Completion Message to the Requester prior to the onset of Internal Bus Reset.
3648165155Sscottl**  04      0 2						        Bus Master Indicator Enable: Provides software control for the
3649165155Sscottl**  								Bus Master Indicator signal P_BMI used
3650165155Sscottl**  		for external RAIDIOS logic control of private devices. Only valid when operating with the bridge and
3651165155Sscottl**  		central resource/arbiter disabled (BRG_EN =low, ARB_EN=low).
3652165155Sscottl**  03		Varies with external state of PRIVDEV during
3653165155Sscottl**  							P_RST#
3654165155Sscottl**  			Private Device Enable - This bit indicates the state of the reset strap which enables the private device
3655165155Sscottl**  			control mechanism within the PCI-to-PCI Bridge SISR configuration register.
3656165155Sscottl**  			0=Private Device control Disabled - SISR register bits default to zero
3657165155Sscottl**  			1=Private Device control Enabled - SISR register bits default to one
3658165155Sscottl**  	02	Varies with external state of RETRY during P_RST#
3659165155Sscottl**  			Configuration Cycle Retry - When this bit is set, the PCI interface of the 80331 responds to all
3660165155Sscottl**  			configuration cycles with a Retry condition. When clear, the 80331 responds to the appropriate
3661165155Sscottl**  			configuration cycles.
3662165155Sscottl**  		The default condition for this bit is based on the external state of the RETRY pin at the rising edge of
3663165155Sscottl**  			P_RST#. When the external state of the pin is high, the bit is set. When the external state of the pin is
3664165155Sscottl**  			low, the bit is cleared.
3665165155Sscottl**  01		Varies with external state of CORE_RST# during P_RST#
3666165155Sscottl**  			Core Processor Reset - This bit is set to its default value by the hardware when either P_RST# is
3667165155Sscottl**  			asserted or the Reset Internal Bus bit in PCSR is set. When this bit is set, the Intel XScale core is
3668165155Sscottl**  			being held in reset. Software cannot set this bit. Software is required to clear this bit to deassert Intel
3669165155Sscottl**  			XScale  core reset.
3670165155Sscottl**  			The default condition for this bit is based on the external state of the CORE_RST# pin at the rising edge
3671165155Sscottl**  			of P_RST#. When the external state of the pin is low, the bit is set. When the external state of the pin is
3672165155Sscottl**  			high, the bit is clear.
3673165155Sscottl**  00		Varies with external state of PRIVMEM during P_RST#
3674165155Sscottl**  			Private Memory Enable - This bit indicates the state of the reset strap which enables the private device
3675165155Sscottl**  			control mechanism within the PCI-to-PCI Bridge SDER configuration register.
3676165155Sscottl**  			0=Private Memory control Disabled - SDER register bit 2 default to zero
3677165155Sscottl**  			1=Private Memory control Enabled - SDER register bits 2 default to one
3678144411Sscottl***********************************************************************************
3679144411Sscottl*/
3680144411Sscottl#define     ARCMSR_PCI_CONFIGURATION_STATUS_REG		          0x84    /*dword 0x87,0x86,0x85,0x84*/
3681144411Sscottl/*
3682144411Sscottl***********************************************************************************
3683144411Sscottl**  ATU Interrupt Status Register - ATUISR
3684144411Sscottl**
3685144411Sscottl**  The ATU Interrupt Status Register is used to notify the core processor of the source of an ATU
3686144411Sscottl**  interrupt. In addition, this register is written to clear the source of the interrupt to the interrupt unit
3687144411Sscottl**  of the 80331. All bits in this register are Read/Clear.
3688144411Sscottl**  Bits 4:0 are a direct reflection of bits 14:11 and bit 8 (respectively) of the ATU Status Register
3689144411Sscottl**  (these bits are set at the same time by hardware but need to be cleared independently). Bit 7 is set
3690144411Sscottl**  by an error associated with the internal bus of the 80331. Bit 8 is for software BIST. The
3691144411Sscottl**  conditions that result in an ATU interrupt are cleared by writing a 1 to the appropriate bits in this
3692144411Sscottl**  register.
3693144411Sscottl**  Note: Bits 4:0, and bits 15 and 13:7 can result in an interrupt being driven to the Intel XScale core.
3694144411Sscottl**  -----------------------------------------------------------------
3695144411Sscottl**  Bit       Default                       Description
3696144411Sscottl**  31:18      0000H                        Reserved
3697144411Sscottl**  17          0 2                         VPD Address Register Updated - This bit is set when a PCI bus configuration write occurs to the VPDAR
3698144411Sscottl**  														register. Configuration register writes to the VPDAR does NOT result in bit 15 also being set. When set,
3699144411Sscottl**  														this bit results in the assertion of the ATU Configure Register Write Interrupt.
3700144411Sscottl**  16          0 2                         Reserved
3701144411Sscottl**  15          0 2                         ATU Configuration Write - This bit is set when a PCI bus configuration write occurs to any ATU register.
3702144411Sscottl**                                                          When set, this bit results in the assertion of the ATU Configure Register Write Interrupt.
3703144411Sscottl**  14          0 2                         ATU Inbound Memory Window 1 Base Updated - This bit is set when a PCI bus configuration write
3704144411Sscottl**  														occurs to either the IABAR1 register or the IAUBAR1 register. Configuration register writes to these
3705144411Sscottl**  														registers deos NOT result in bit 15 also being set. When set, this bit results in the assertion of the ATU
3706144411Sscottl**  														Configure Register Write Interrupt.
3707144411Sscottl**  13          0 2                         Initiated Split Completion Error Message - This bit is set when the device initiates a Split Completion
3708144411Sscottl**                                                          Message on the PCI Bus with the Split Completion Error attribute bit set.
3709144411Sscottl**  12          0 2                         Received Split Completion Error Message - This bit is set when the device receives a Split Completion
3710144411Sscottl**                                                          Message from the PCI Bus with the Split Completion Error attribute bit set.
3711144411Sscottl**  11          0 2                         Power State Transition - When the Power State Field of the ATU Power Management Control/Status
3712144411Sscottl**  														Register is written to transition the ATU function Power State from D0 to D3, D0 to D1, or D3 to D0 and
3713144411Sscottl**  														the ATU Power State Transition Interrupt mask bit is cleared, this bit is set.
3714144411Sscottl**  10          0 2                         P_SERR# Asserted - set when P_SERR# is asserted on the PCI bus by the ATU.
3715144411Sscottl**  09          0 2                         Detected Parity Error - set when a parity error is detected on the PCI bus even when the ATUCMD
3716144411Sscottl**  														register��s Parity Error Response bit is cleared. Set under the following conditions:
3717144411Sscottl**  														�E Write Data Parity Error when the ATU is a target (inbound write).
3718144411Sscottl**  														�E Read Data Parity Error when the ATU is an initiator (outbound read).
3719144411Sscottl**  														�E Any Address or Attribute (PCI-X Only) Parity Error on the Bus.
3720144411Sscottl**  08          0 2                         ATU BIST Interrupt - When set, generates the ATU BIST Start Interrupt and indicates the host processor
3721144411Sscottl**  														has set the Start BIST bit (ATUBISTR register bit 6), when the ATU BIST interrupt is enabled (ATUCR
3722144411Sscottl**  														register bit 3). The Intel XScale core can initiate the software BIST and store the result in ATUBISTR
3723144411Sscottl**  														register bits 3:0.
3724144411Sscottl**  														Configuration register writes to the ATUBISTR does NOT result in bit 15 also being set or the assertion
3725144411Sscottl**  														of the ATU Configure Register Write Interrupt.
3726144411Sscottl**  07          0 2                         Internal Bus Master Abort - set when a transaction initiated by the ATU internal bus initiator interface ends in a Master-abort.
3727144411Sscottl**  06:05      00 2                         Reserved.
3728144411Sscottl**  04          0 2                         P_SERR# Detected - set when P_SERR# is detected on the PCI bus by the ATU.
3729144411Sscottl**  03          0 2                         PCI Master Abort - set when a transaction initiated by the ATU PCI initiator interface ends in a Master-abort.
3730144411Sscottl**  02          0 2                         PCI Target Abort (master) - set when a transaction initiated by the ATU PCI master interface ends in a Target-abort.
3731144411Sscottl**  01          0 2                         PCI Target Abort (target) - set when the ATU interface, acting as a target, terminates the transaction on the PCI bus with a target abort.
3732144411Sscottl**  00          0 2                         PCI Master Parity Error - Master Parity Error - The ATU interface sets this bit under the following
3733144411Sscottl**  														conditions:
3734144411Sscottl**  														�E The ATU asserted PERR# itself or the ATU observed PERR# asserted.
3735144411Sscottl**  														�E And the ATU acted as the requester for the operation in which the error occurred.
3736144411Sscottl**  														�E And the ATUCMD register��s Parity Error Response bit is set
3737144411Sscottl**  														�E Or (PCI-X Mode Only) the ATU received a Write Data Parity Error Message
3738144411Sscottl**  														�E And the ATUCMD register��s Parity Error Response bit is set
3739144411Sscottl***********************************************************************************
3740144411Sscottl*/
3741144411Sscottl#define     ARCMSR_ATU_INTERRUPT_STATUS_REG		          0x88    /*dword 0x8B,0x8A,0x89,0x88*/
3742144411Sscottl/*
3743144411Sscottl***********************************************************************************
3744144411Sscottl**  ATU Interrupt Mask Register - ATUIMR
3745165155Sscottl**
3746144411Sscottl**  The ATU Interrupt Mask Register contains the control bit to enable and disable interrupts
3747144411Sscottl**  generated by the ATU.
3748144411Sscottl**  -----------------------------------------------------------------
3749144411Sscottl**  Bit       Default                       Description
3750144411Sscottl**  31:15     0 0000H                       Reserved
3751144411Sscottl**  14        0 2                           VPD Address Register Updated Mask - Controls the setting of bit 17 of the ATUISR and generation of the
3752165155Sscottl**  					ATU Configuration Register Write interrupt when a PCI bus write occurs to the VPDAR register.
3753165155Sscottl**  					0=Not Masked
3754165155Sscottl**  					1=Masked
3755144411Sscottl**  13        0 2                           Reserved
3756144411Sscottl**  12        0 2                           Configuration Register Write Mask - Controls the setting of bit 15 of the ATUISR and generation of the
3757165155Sscottl**  					ATU Configuration Register Write interrupt when a PCI bus write occurs to any ATU configuration register
3758165155Sscottl**  					except those covered by mask bit 11 and bit 14 of this register, and ATU BIST enable bit 3 of the ATUCR.
3759144411Sscottl**  										0=Not Masked
3760144411Sscottl**  										1=Masked
3761144411Sscottl**  11        1 2                           ATU Inbound Memory Window 1 Base Updated Mask - Controls the setting of bit 14 of the ATUISR and
3762165155Sscottl**  					generation of the ATU Configuration Register Write interrupt when a PCI bus write occurs to either the
3763144411Sscottl**  														IABAR1 register or the IAUBAR1 register.
3764144411Sscottl**  														0=Not Masked
3765144411Sscottl**  														1=Masked
3766144411Sscottl**  10        0 2                           Initiated Split Completion Error Message Interrupt Mask - Controls the setting of bit 13 of the ATUISR and
3767165155Sscottl**  					generation of the ATU Error interrupt when the ATU initiates a Split Completion Error Message.
3768144411Sscottl**  														0=Not Masked
3769144411Sscottl**  														1=Masked
3770144411Sscottl**  09        0 2                           Received Split Completion Error Message Interrupt Mask- Controls the setting of bit 12 of the ATUISR
3771165155Sscottl**  					and generation of the ATU Error interrupt when a Split Completion Error Message results in bit 29 of the
3772165155Sscottl**  					PCIXSR being set.
3773165155Sscottl**  					0=Not Masked
3774165155Sscottl**  					1=Masked
3775144411Sscottl**  08        1 2                           Power State Transition Interrupt Mask - Controls the setting of bit 12 of the ATUISR and generation of the
3776165155Sscottl**  					ATU Error interrupt when ATU Power Management Control/Status Register is written to transition the
3777165155Sscottl**  					ATU Function Power State from D0 to D3, D0 to D1, D1 to D3 or D3 to D0.
3778144411Sscottl**  														0=Not Masked
3779144411Sscottl**  														1=Masked
3780144411Sscottl**  07        0 2                           ATU Detected Parity Error Interrupt Mask - Controls the setting of bit 9 of the ATUISR and generation of
3781165155Sscottl**  					the ATU Error interrupt when a parity error detected on the PCI bus that sets bit 15 of the ATUSR.
3782144411Sscottl**  														0=Not Masked
3783144411Sscottl**  														1=Masked
3784144411Sscottl**  06        0 2                           ATU SERR# Asserted Interrupt Mask - Controls the setting of bit 10 of the ATUISR and generation of the
3785165155Sscottl**  					ATU Error interrupt when SERR# is asserted on the PCI interface resulting in bit 14 of the ATUSR being set.
3786144411Sscottl**  														0=Not Masked
3787144411Sscottl**  														1=Masked
3788165155Sscottl**  		NOTE: This bit is specific to the ATU asserting SERR# and not detecting SERR# from another master.
3789144411Sscottl**  05        0 2                           ATU PCI Master Abort Interrupt Mask - Controls the setting of bit 3 of the ATUISR and generation of the
3790165155Sscottl**  					ATU Error interrupt when a master abort error resulting in bit 13 of the ATUSR being set.
3791144411Sscottl**  														0=Not Masked
3792144411Sscottl**  														1=Masked
3793144411Sscottl**  04        0 2                           ATU PCI Target Abort (Master) Interrupt Mask- Controls the setting of bit 12 of the ATUISR and ATU Error
3794165155Sscottl**  					generation of the interrupt when a target abort error resulting in bit 12 of the ATUSR being set
3795144411Sscottl**  														0=Not Masked
3796144411Sscottl**  														1=Masked
3797144411Sscottl**  03        0 2                           ATU PCI Target Abort (Target) Interrupt Mask- Controls the setting of bit 1 of the ATUISR and generation
3798165155Sscottl**  					of the ATU Error interrupt when a target abort error resulting in bit 11 of the ATUSR being set.
3799144411Sscottl**  														0=Not Masked
3800144411Sscottl**  														1=Masked
3801144411Sscottl**  02        0 2                           ATU PCI Master Parity Error Interrupt Mask - Controls the setting of bit 0 of the ATUISR and generation
3802165155Sscottl**  					of the ATU Error interrupt when a parity error resulting in bit 8 of the ATUSR being set.
3803144411Sscottl**  														0=Not Masked
3804144411Sscottl**  														1=Masked
3805144411Sscottl**  01        0 2                           ATU Inbound Error SERR# Enable - Controls when the ATU asserts (when enabled through the
3806165155Sscottl**  					ATUCMD) SERR# on the PCI interface in response to a master abort on the internal bus during an
3807144411Sscottl**  														inbound write transaction.
3808144411Sscottl**  														0=SERR# Not Asserted due to error
3809144411Sscottl**  														1=SERR# Asserted due to error
3810144411Sscottl**  00        0 2                           ATU ECC Target Abort Enable - Controls the ATU response on the PCI interface to a target abort (ECC
3811165155Sscottl**  					error) from the memory controller on the internal bus. In conventional mode, this action only occurs
3812165155Sscottl**  					during an inbound read transaction where the data phase that was target aborted on the internal bus is
3813165155Sscottl**  					actually requested from the inbound read queue.
3814165155Sscottl**  														0=Disconnect with data
3815165155Sscottl**  														(the data being up to 64 bits of 1��s)
3816144411Sscottl**  														1=Target Abort
3817165155Sscottl**  		NOTE: In PCI-X Mode, The ATU initiates a Split Completion Error Message (with message class=2h -
3818165155Sscottl**  			completer error and message index=81h - 80331 internal bus target abort) on the PCI bus,
3819165155Sscottl**  			independent of the setting of this bit.
3820144411Sscottl***********************************************************************************
3821144411Sscottl*/
3822144411Sscottl#define     ARCMSR_ATU_INTERRUPT_MASK_REG		          0x8C    /*dword 0x8F,0x8E,0x8D,0x8C*/
3823144411Sscottl/*
3824144411Sscottl***********************************************************************************
3825144411Sscottl**  Inbound ATU Base Address Register 3 - IABAR3
3826165155Sscottl**
3827165155Sscottl**  . The Inbound ATU Base Address Register 3 (IABAR3) together with the Inbound ATU Upper Base Address Register 3 (IAUBAR3) defines the block
3828165155Sscottl**    of memory addresses where the inbound translation window 3 begins.
3829144411Sscottl**  . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory.
3830144411Sscottl**  . The IABAR3 and IAUBAR3 define the base address and describes the required memory block size.
3831144411Sscottl**  . Bits 31 through 12 of the IABAR3 is either read/write bits or read only with a value of 0 depending on the value located within the IALR3.
3832144411Sscottl**    The programmed value within the base address register must comply with the PCI programming requirements for address alignment.
3833144411Sscottl**  Note:
3834144411Sscottl**      Since IABAR3 does not appear in the standard PCI configuration header space (offsets 00H - 3CH),
3835144411Sscottl**      IABAR3 is not configured by the host during normal system initialization.
3836144411Sscottl**  Warning:
3837144411Sscottl**    When a non-zero value is not written to IALR3,
3838144411Sscottl**                          the user should not set either the Prefetchable Indicator
3839144411Sscottl**                                                      or the Type         Indicator for 64 bit addressability.
3840144411Sscottl**                          This is the default for IABAR3.
3841144411Sscottl**  Assuming a non-zero value is written to IALR3,
3842144411Sscottl**                          the user may set the Prefetchable Indicator
3843144411Sscottl**                                        or the Type         Indicator:
3844144411Sscottl**  						a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary,
3845144411Sscottl**                             when the Prefetchable Indicator is not set,
3846144411Sscottl**                             the user should also leave the Type Indicator set for 32 bit addressability.
3847144411Sscottl**                             This is the default for IABAR3.
3848144411Sscottl**  						b. when the Prefetchable Indicator is set,
3849144411Sscottl**                             the user should also set the Type Indicator for 64 bit addressability.
3850144411Sscottl**  -----------------------------------------------------------------
3851144411Sscottl**  Bit       Default                       Description
3852165155Sscottl**  31:12     00000H                        Translation Base Address 3 - These bits define the actual location
3853165155Sscottl**                                          the translation function is to respond to when addressed from the PCI bus.
3854144411Sscottl**  11:04        00H                        Reserved.
3855144411Sscottl**  03           0 2                        Prefetchable Indicator - When set, defines the memory space as prefetchable.
3856144411Sscottl**  02:01       00 2                        Type Indicator - Defines the width of the addressability for this memory window:
3857165155Sscottl**  						00 - Memory Window is locatable anywhere in 32 bit address space
3858165155Sscottl**  						10 - Memory Window is locatable anywhere in 64 bit address space
3859144411Sscottl**  00           0 2                        Memory Space Indicator - This bit field describes memory or I/O space base address.
3860144411Sscottl**                                                                   The ATU does not occupy I/O space,
3861144411Sscottl**                                                                   thus this bit must be zero.
3862144411Sscottl***********************************************************************************
3863144411Sscottl*/
3864144411Sscottl#define     ARCMSR_INBOUND_ATU_BASE_ADDRESS3_REG		          0x90    /*dword 0x93,0x92,0x91,0x90*/
3865144411Sscottl/*
3866144411Sscottl***********************************************************************************
3867144411Sscottl**  Inbound ATU Upper Base Address Register 3 - IAUBAR3
3868165155Sscottl**
3869144411Sscottl**  This register contains the upper base address when decoding PCI addresses beyond 4 GBytes.
3870165155Sscottl**  Together with the Translation Base Address this register defines the actual location
3871165155Sscottl**  the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs).
3872144411Sscottl**  The programmed value within the base address register must comply with the PCI programming
3873144411Sscottl**  requirements for address alignment.
3874144411Sscottl**  Note:
3875144411Sscottl**      When the Type indicator of IABAR3 is set to indicate 32 bit addressability,
3876144411Sscottl**      the IAUBAR3 register attributes are read-only.
3877144411Sscottl**      This is the default for IABAR3.
3878144411Sscottl**  -----------------------------------------------------------------
3879144411Sscottl**  Bit       Default                       Description
3880165155Sscottl**  31:0      00000H                        Translation Upper Base Address 3 - Together with the Translation Base Address 3 these bits define
3881165155Sscottl**                        the actual location the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes.
3882144411Sscottl***********************************************************************************
3883144411Sscottl*/
3884144411Sscottl#define     ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS3_REG		          0x94    /*dword 0x97,0x96,0x95,0x94*/
3885144411Sscottl/*
3886144411Sscottl***********************************************************************************
3887144411Sscottl**  Inbound ATU Limit Register 3 - IALR3
3888165155Sscottl**
3889144411Sscottl**  Inbound address translation for memory window 3 occurs for data transfers occurring from the PCI
3890144411Sscottl**  bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts
3891144411Sscottl**  PCI addresses to internal bus addresses.
3892144411Sscottl**  The inbound translation base address for inbound window 3 is specified in Section 3.10.15. When
3893144411Sscottl**  determining block size requirements �X as described in Section 3.10.21 �X the translation limit
3894144411Sscottl**  register provides the block size requirements for the base address register. The remaining registers
3895144411Sscottl**  used for performing address translation are discussed in Section 3.2.1.1.
3896144411Sscottl**  The 80331 translate value register��s programmed value must be naturally aligned with the base
3897144411Sscottl**  address register��s programmed value. The limit register is used as a mask; thus, the lower address
3898144411Sscottl**  bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus
3899144411Sscottl**  Specification, Revision 2.3 for additional information on programming base address registers.
3900144411Sscottl**  Bits 31 to 12 within the IALR3 have a direct effect on the IABAR3 register, bits 31 to 12, with a
3901144411Sscottl**  one to one correspondence. A value of 0 in a bit within the IALR3 makes the corresponding bit
3902144411Sscottl**  within the IABAR3 a read only bit which always returns 0. A value of 1 in a bit within the IALR3
3903144411Sscottl**  makes the corresponding bit within the IABAR3 read/write from PCI. Note that a consequence of
3904144411Sscottl**  this programming scheme is that unless a valid value exists within the IALR3, all writes to the
3905144411Sscottl**  IABAR3 has no effect since a value of all zeros within the IALR3 makes the IABAR3 a read only
3906144411Sscottl**  register.
3907144411Sscottl**  -----------------------------------------------------------------
3908144411Sscottl**  Bit       Default                       Description
3909165155Sscottl**  31:12     00000H                        Inbound Translation Limit 3 - This readback value determines the memory block size required
3910165155Sscottl**                                          for the ATUs memory window 3.
3911144411Sscottl**  11:00       000H                        Reserved
3912144411Sscottl***********************************************************************************
3913144411Sscottl*/
3914144411Sscottl#define     ARCMSR_INBOUND_ATU_LIMIT3_REG		          0x98    /*dword 0x9B,0x9A,0x99,0x98*/
3915144411Sscottl/*
3916144411Sscottl***********************************************************************************
3917144411Sscottl**  Inbound ATU Translate Value Register 3 - IATVR3
3918165155Sscottl**
3919144411Sscottl**  The Inbound ATU Translate Value Register 3 (IATVR3) contains the internal bus address used to
3920144411Sscottl**  convert PCI bus addresses. The converted address is driven on the internal bus as a result of the
3921144411Sscottl**  inbound ATU address translation.
3922144411Sscottl**  -----------------------------------------------------------------
3923144411Sscottl**  Bit       Default                       Description
3924144411Sscottl**  31:12     00000H                        Inbound ATU Translation Value 3 - This value is used to convert the PCI address to internal bus addresses.
3925144411Sscottl**                                                          This value must be 64-bit aligned on the internal bus. The default address allows the ATU to
3926144411Sscottl**                                                          access the internal 80331 memory-mapped registers.
3927144411Sscottl**  11:00       000H                        Reserved
3928144411Sscottl***********************************************************************************
3929144411Sscottl*/
3930144411Sscottl#define     ARCMSR_INBOUND_ATU_TRANSLATE_VALUE3_REG		          0x9C    /*dword 0x9F,0x9E,0x9D,0x9C*/
3931144411Sscottl/*
3932144411Sscottl***********************************************************************************
3933144411Sscottl**  Outbound Configuration Cycle Address Register - OCCAR
3934144411Sscottl**
3935144411Sscottl**  The Outbound Configuration Cycle Address Register is used to hold the 32-bit PCI configuration
3936144411Sscottl**  cycle address. The Intel XScale core writes the PCI configuration cycles address which then
3937144411Sscottl**  enables the outbound configuration read or write. The Intel XScale core then performs a read or
3938144411Sscottl**  write to the Outbound Configuration Cycle Data Register to initiate the configuration cycle on the
3939144411Sscottl**  PCI bus.
3940144411Sscottl**  Note: Bits 15:11 of the configuration cycle address for Type 0 configuration cycles are defined differently
3941144411Sscottl**  for Conventional versus PCI-X modes. When 80331 software programs the OCCAR to initiate a
3942144411Sscottl**  Type 0 configuration cycle, the OCCAR should always be loaded based on the PCI-X definition for
3943144411Sscottl**  the Type 0 configuration cycle address. When operating in Conventional mode, the 80331 clears
3944144411Sscottl**  bits 15:11 of the OCCAR prior to initiating an outbound Type 0 configuration cycle. See the PCI-X
3945144411Sscottl**  Addendum to the PCI Local Bus Specification, Revision 1.0a for details on the two formats.
3946144411Sscottl**  -----------------------------------------------------------------
3947144411Sscottl**  Bit       Default                       Description
3948165155Sscottl**  31:00    0000 0000H                     Configuration Cycle Address - These bits define the 32-bit PCI address used during an outbound
3949165155Sscottl**                                          configuration read or write cycle.
3950144411Sscottl***********************************************************************************
3951144411Sscottl*/
3952144411Sscottl#define     ARCMSR_OUTBOUND_CONFIGURATION_CYCLE_ADDRESS_REG		          0xA4    /*dword 0xA7,0xA6,0xA5,0xA4*/
3953144411Sscottl/*
3954144411Sscottl***********************************************************************************
3955144411Sscottl**  Outbound Configuration Cycle Data Register - OCCDR
3956165155Sscottl**
3957144411Sscottl**  The Outbound Configuration Cycle Data Register is used to initiate a configuration read or write
3958144411Sscottl**  on the PCI bus. The register is logical rather than physical meaning that it is an address not a
3959144411Sscottl**  register. The Intel XScale core reads or writes the data registers memory-mapped address to
3960144411Sscottl**  initiate the configuration cycle on the PCI bus with the address found in the OCCAR. For a
3961144411Sscottl**  configuration write, the data is latched from the internal bus and forwarded directly to the OWQ.
3962144411Sscottl**  For a read, the data is returned directly from the ORQ to the Intel XScale core and is never
3963144411Sscottl**  actually entered into the data register (which does not physically exist).
3964144411Sscottl**  The OCCDR is only visible from 80331 internal bus address space and appears as a reserved value
3965144411Sscottl**  within the ATU configuration space.
3966144411Sscottl**  -----------------------------------------------------------------
3967144411Sscottl**  Bit       Default                       Description
3968165155Sscottl**  31:00    0000 0000H                     Configuration Cycle Data - These bits define the data used during an outbound configuration read
3969165155Sscottl**                                          or write cycle.
3970144411Sscottl***********************************************************************************
3971144411Sscottl*/
3972144411Sscottl#define     ARCMSR_OUTBOUND_CONFIGURATION_CYCLE_DATA_REG		          0xAC    /*dword 0xAF,0xAE,0xAD,0xAC*/
3973144411Sscottl/*
3974144411Sscottl***********************************************************************************
3975144411Sscottl**  VPD Capability Identifier Register - VPD_CAPID
3976144411Sscottl**
3977144411Sscottl**  The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification,
3978144411Sscottl**  Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended
3979144411Sscottl**  Capability contained in that header. In the case of the 80331, this is the VPD extended capability
3980144411Sscottl**  with an ID of 03H as defined by the PCI Local Bus Specification, Revision 2.3.
3981144411Sscottl**  -----------------------------------------------------------------
3982144411Sscottl**  Bit       Default                       Description
3983165155Sscottl**  07:00       03H               Cap_Id - This field with its�� 03H value identifies this item in the linked list of Extended Capability
3984165155Sscottl**                                Headers as being the VPD capability registers.
3985144411Sscottl***********************************************************************************
3986144411Sscottl*/
3987144411Sscottl#define     ARCMSR_VPD_CAPABILITY_IDENTIFIER_REG		      0xB8    /*byte*/
3988144411Sscottl/*
3989144411Sscottl***********************************************************************************
3990144411Sscottl**  VPD Next Item Pointer Register - VPD_NXTP
3991144411Sscottl**
3992144411Sscottl**  The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification,
3993144411Sscottl**  Revision 2.3. This register describes the location of the next item in the function��s capability list.
3994144411Sscottl**  For the 80331, this the final capability list, and hence, this register is set to 00H.
3995144411Sscottl**  -----------------------------------------------------------------
3996144411Sscottl**  Bit       Default                       Description
3997165155Sscottl**  07:00       00H               Next_ Item_ Pointer - This field provides an offset into the function��s configuration space pointing to the
3998165155Sscottl**                                next item in the function��s capability list. Since the VPD capabilities are the last in the linked list of
3999165155Sscottl**                                extended capabilities in the 80331, the register is set to 00H.
4000144411Sscottl***********************************************************************************
4001144411Sscottl*/
4002144411Sscottl#define     ARCMSR_VPD_NEXT_ITEM_PTR_REG		          0xB9    /*byte*/
4003144411Sscottl/*
4004144411Sscottl***********************************************************************************
4005144411Sscottl**  VPD Address Register - VPD_AR
4006165155Sscottl**
4007144411Sscottl**  The VPD Address register (VPDAR) contains the DWORD-aligned byte address of the VPD to be
4008144411Sscottl**  accessed. The register is read/write and the initial value at power-up is indeterminate.
4009144411Sscottl**  A PCI Configuration Write to the VPDAR interrupts the Intel XScale core. Software can use
4010144411Sscottl**  the Flag setting to determine whether the configuration write was intended to initiate a read or
4011144411Sscottl**  write of the VPD through the VPD Data Register.
4012144411Sscottl**  -----------------------------------------------------------------
4013144411Sscottl**  Bit       Default                       Description
4014165155Sscottl**  15          0 2          Flag - A flag is used to indicate when a transfer of data between the VPD Data Register and the storage
4015165155Sscottl**                           component has completed. Please see Section 3.9, ��Vital Product Data�� on page 201 for more details on
4016165155Sscottl**                           how the 80331 handles the data transfer.
4017165155Sscottl**  14:0       0000H         VPD Address - This register is written to set the DWORD-aligned byte address used to read or write
4018165155Sscottl**                           Vital Product Data from the VPD storage component.
4019144411Sscottl***********************************************************************************
4020144411Sscottl*/
4021144411Sscottl#define     ARCMSR_VPD_ADDRESS_REG		          0xBA    /*word 0xBB,0xBA*/
4022144411Sscottl/*
4023144411Sscottl***********************************************************************************
4024144411Sscottl**  VPD Data Register - VPD_DR
4025165155Sscottl**
4026144411Sscottl**  This register is used to transfer data between the 80331 and the VPD storage component.
4027144411Sscottl**  -----------------------------------------------------------------
4028144411Sscottl**  Bit       Default                       Description
4029144411Sscottl**  31:00      0000H                        VPD Data - Four bytes are always read or written through this register to/from the VPD storage component.
4030144411Sscottl***********************************************************************************
4031144411Sscottl*/
4032144411Sscottl#define     ARCMSR_VPD_DATA_REG		          0xBC    /*dword 0xBF,0xBE,0xBD,0xBC*/
4033144411Sscottl/*
4034144411Sscottl***********************************************************************************
4035144411Sscottl**  Power Management Capability Identifier Register -PM_CAPID
4036165155Sscottl**
4037144411Sscottl**  The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification,
4038144411Sscottl**  Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended
4039144411Sscottl**  Capability contained in that header. In the case of the 80331, this is the PCI Bus Power
4040144411Sscottl**  Management extended capability with an ID of 01H as defined by the PCI Bus Power Management
4041144411Sscottl**  Interface Specification, Revision 1.1.
4042144411Sscottl**  -----------------------------------------------------------------
4043144411Sscottl**  Bit       Default                       Description
4044165155Sscottl**  07:00       01H                         Cap_Id - This field with its�� 01H value identifies this item in the linked list of Extended Capability
4045165155Sscottl**                                          Headers as being the PCI Power Management Registers.
4046144411Sscottl***********************************************************************************
4047144411Sscottl*/
4048144411Sscottl#define     ARCMSR_POWER_MANAGEMENT_CAPABILITY_IDENTIFIER_REG		          0xC0    /*byte*/
4049144411Sscottl/*
4050144411Sscottl***********************************************************************************
4051144411Sscottl**  Power Management Next Item Pointer Register - PM_NXTP
4052165155Sscottl**
4053144411Sscottl**  The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification,
4054144411Sscottl**  Revision 2.3. This register describes the location of the next item in the function��s capability list.
4055144411Sscottl**  For the 80331, the next capability (MSI capability list) is located at off-set D0H.
4056144411Sscottl**  -----------------------------------------------------------------
4057144411Sscottl**  Bit       Default                       Description
4058144411Sscottl**  07:00       D0H                         Next_ Item_ Pointer - This field provides an offset into the function��s configuration space pointing to the
4059165155Sscottl**                          next item in the function��s capability list which in the 80331 is the MSI extended capabilities header.
4060144411Sscottl***********************************************************************************
4061144411Sscottl*/
4062144411Sscottl#define     ARCMSR_POWER_NEXT_ITEM_PTR_REG		          0xC1    /*byte*/
4063144411Sscottl/*
4064144411Sscottl***********************************************************************************
4065144411Sscottl**  Power Management Capabilities Register - PM_CAP
4066144411Sscottl**
4067144411Sscottl**  Power Management Capabilities bits adhere to the definitions in the PCI Bus Power Management
4068144411Sscottl**  Interface Specification, Revision 1.1. This register is a 16-bit read-only register which provides
4069144411Sscottl**  information on the capabilities of the ATU function related to power management.
4070144411Sscottl**  -----------------------------------------------------------------
4071144411Sscottl**  Bit       Default                       Description
4072165155Sscottl**  15:11   00000 2                         PME_Support - This function is not capable of asserting the PME# signal in any state, since PME#
4073165155Sscottl**                                          is not supported by the 80331.
4074144411Sscottl**  10          0 2                         D2_Support - This bit is set to 0 2 indicating that the 80331 does not support the D2 Power Management State
4075144411Sscottl**  9           1 2                         D1_Support - This bit is set to 1 2 indicating that the 80331 supports the D1 Power Management State
4076144411Sscottl**  8:6       000 2                         Aux_Current - This field is set to 000 2 indicating that the 80331 has no current requirements for the
4077144411Sscottl**                                                          3.3Vaux signal as defined in the PCI Bus Power Management Interface Specification, Revision 1.1
4078144411Sscottl**  5           0 2                         DSI - This field is set to 0 2 meaning that this function requires a device specific initialization sequence
4079144411Sscottl**                                                          following the transition to the D0 uninitialized state.
4080144411Sscottl**  4           0 2                         Reserved.
4081144411Sscottl**  3           0 2                         PME Clock - Since the 80331 does not support PME# signal generation this bit is cleared to 0 2 .
4082165155Sscottl**  2:0       010 2                         Version - Setting these bits to 010 2 means that this function complies with PCI Bus Power Management
4083165155Sscottl**                                          Interface Specification, Revision 1.1
4084144411Sscottl***********************************************************************************
4085144411Sscottl*/
4086144411Sscottl#define     ARCMSR_POWER_MANAGEMENT_CAPABILITY_REG		          0xC2    /*word 0xC3,0xC2*/
4087144411Sscottl/*
4088144411Sscottl***********************************************************************************
4089144411Sscottl**  Power Management Control/Status Register - PM_CSR
4090165155Sscottl**
4091144411Sscottl**  Power Management Control/Status bits adhere to the definitions in the PCI Bus Power
4092144411Sscottl**  Management Interface Specification, Revision 1.1. This 16-bit register is the control and status
4093144411Sscottl**  interface for the power management extended capability.
4094144411Sscottl**  -----------------------------------------------------------------
4095144411Sscottl**  Bit       Default                       Description
4096165155Sscottl**  15          0 2                         PME_Status - This function is not capable of asserting the PME# signal in any state, since PME## is not
4097165155Sscottl**                                          supported by the 80331.
4098144411Sscottl**  14:9        00H                         Reserved
4099165155Sscottl**  8           0 2                         PME_En - This bit is hardwired to read-only 0 2 since this function does not support PME#
4100165155Sscottl**                                          generation from any power state.
4101144411Sscottl**  7:2    000000 2                         Reserved
4102165155Sscottl**  1:0        00 2                         Power State - This 2-bit field is used both to determine the current power state
4103165155Sscottl**                                          of a function and to set the function into a new power state. The definition of the values is:
4104165155Sscottl**  							00 2 - D0
4105165155Sscottl**  							01 2 - D1
4106165155Sscottl**  							10 2 - D2 (Unsupported)
4107165155Sscottl**  							11 2 - D3 hot
4108165155Sscottl**  							The 80331 supports only the D0 and D3 hot states.
4109165155Sscottl**
4110144411Sscottl***********************************************************************************
4111144411Sscottl*/
4112144411Sscottl#define     ARCMSR_POWER_MANAGEMENT_CONTROL_STATUS_REG		          0xC4    /*word 0xC5,0xC4*/
4113144411Sscottl/*
4114144411Sscottl***********************************************************************************
4115144411Sscottl**  PCI-X Capability Identifier Register - PX_CAPID
4116144411Sscottl**
4117144411Sscottl**  The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification,
4118144411Sscottl**  Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended
4119144411Sscottl**  Capability contained in that header. In the case of the 80331, this is the PCI-X extended capability with
4120144411Sscottl**  an ID of 07H as defined by the PCI-X Addendum to the PCI Local Bus Specification, Revision 1.0a.
4121144411Sscottl**  -----------------------------------------------------------------
4122144411Sscottl**  Bit       Default                       Description
4123165155Sscottl**  07:00       07H                         Cap_Id - This field with its�� 07H value identifies this item in the linked list of Extended Capability
4124165155Sscottl**                                          Headers as being the PCI-X capability registers.
4125144411Sscottl***********************************************************************************
4126144411Sscottl*/
4127144411Sscottl#define     ARCMSR_PCIX_CAPABILITY_IDENTIFIER_REG		          0xE0    /*byte*/
4128144411Sscottl/*
4129144411Sscottl***********************************************************************************
4130144411Sscottl**  PCI-X Next Item Pointer Register - PX_NXTP
4131144411Sscottl**
4132144411Sscottl**  The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification,
4133144411Sscottl**  Revision 2.3. This register describes the location of the next item in the function��s capability list.
4134144411Sscottl**  By default, the PCI-X capability is the last capabilities list for the 80331, thus this register defaults
4135144411Sscottl**  to 00H.
4136144411Sscottl**  However, this register may be written to B8H prior to host configuration to include the VPD
4137144411Sscottl**  capability located at off-set B8H.
4138144411Sscottl**  Warning: Writing this register to any value other than 00H (default) or B8H is not supported and may
4139144411Sscottl**  produce unpredictable system behavior.
4140144411Sscottl**  In order to guarantee that this register is written prior to host configuration, the 80331 must be
4141144411Sscottl**  initialized at P_RST# assertion to Retry Type 0 configuration cycles (bit 2 of PCSR). Typically,
4142144411Sscottl**  the Intel XScale core would be enabled to boot immediately following P_RST# assertion in
4143144411Sscottl**  this case (bit 1 of PCSR), as well. Please see Table 125, ��PCI Configuration and Status Register -
4144144411Sscottl**  PCSR�� on page 253 for more details on the 80331 initialization modes.
4145144411Sscottl**  -----------------------------------------------------------------
4146144411Sscottl**  Bit       Default                       Description
4147144411Sscottl**  07:00       00H                         Next_ Item_ Pointer - This field provides an offset into the function��s configuration space pointing to the
4148165155Sscottl**  			next item in the function��s capability list. Since the PCI-X capabilities are the last in the linked list of
4149165155Sscottl**  			extended capabilities in the 80331, the register is set to 00H.
4150165155Sscottl**  			However, this field may be written prior to host configuration with B8H to extend the list to include the
4151165155Sscottl**  			VPD extended capabilities header.
4152144411Sscottl***********************************************************************************
4153144411Sscottl*/
4154144411Sscottl#define     ARCMSR_PCIX_NEXT_ITEM_PTR_REG		          0xE1    /*byte*/
4155144411Sscottl/*
4156144411Sscottl***********************************************************************************
4157144411Sscottl**  PCI-X Command Register - PX_CMD
4158144411Sscottl**
4159144411Sscottl**  This register controls various modes and features of ATU and Message Unit when operating in the
4160144411Sscottl**  PCI-X mode.
4161144411Sscottl**  -----------------------------------------------------------------
4162144411Sscottl**  Bit       Default                       Description
4163144411Sscottl**  15:7     000000000 2                    Reserved.
4164144411Sscottl**  6:4        011 2                        Maximum Outstanding Split Transactions - This register sets the maximum number of Split Transactions
4165165155Sscottl**  			the device is permitted to have outstanding at one time.
4166165155Sscottl**  			Register Maximum Outstanding
4167165155Sscottl**  					0 1
4168165155Sscottl**  					1 2
4169165155Sscottl**  					2 3
4170165155Sscottl**  					3 4
4171165155Sscottl**  					4 8
4172165155Sscottl**  					5 12
4173165155Sscottl**  					6 16
4174165155Sscottl**  					7 32
4175144411Sscottl**  3:2        00 2                         Maximum Memory Read Byte Count - This register sets the maximum byte count the device uses when
4176165155Sscottl**  			initiating a Sequence with one of the burst memory read commands.
4177165155Sscottl**  			Register Maximum Byte Count
4178165155Sscottl**  					0 512
4179165155Sscottl**  					1 1024
4180165155Sscottl**  					2 2048
4181165155Sscottl**  					3 4096
4182165155Sscottl**  					1 0 2
4183165155Sscottl**  			Enable Relaxed Ordering - The 80331 does not set the relaxed ordering bit in the Requester Attributes
4184165155Sscottl**  			of Transactions.
4185144411Sscottl**  0          0 2                          Data Parity Error Recovery Enable - The device driver sets this bit to enable the device to attempt to
4186165155Sscottl**  			recover from data parity errors. When this bit is 0 and the device is in PCI-X mode, the device asserts
4187165155Sscottl**  			SERR# (when enabled) whenever the Master Data Parity Error bit (Status register, bit 8) is set.
4188144411Sscottl***********************************************************************************
4189144411Sscottl*/
4190144411Sscottl#define     ARCMSR_PCIX_COMMAND_REG		          0xE2    /*word 0xE3,0xE2*/
4191144411Sscottl/*
4192144411Sscottl***********************************************************************************
4193144411Sscottl**  PCI-X Status Register - PX_SR
4194144411Sscottl**
4195144411Sscottl**  This register identifies the capabilities and current operating mode of ATU, DMAs and Message
4196144411Sscottl**  Unit when operating in the PCI-X mode.
4197144411Sscottl**  -----------------------------------------------------------------
4198144411Sscottl**  Bit       Default                       Description
4199144411Sscottl**  31:30       00 2                        Reserved
4200144411Sscottl**  29           0 2                        Received Split Completion Error Message - This bit is set when the device receives a Split Completion
4201165155Sscottl**  					Message with the Split Completion Error attribute bit set. Once set, this bit remains set until software
4202165155Sscottl**  					writes a 1 to this location.
4203165155Sscottl**  					0=no Split Completion error message received.
4204165155Sscottl**  					1=a Split Completion error message has been received.
4205144411Sscottl**  28:26      001 2                        Designed Maximum Cumulative Read Size (DMCRS) - The value of this register depends on the setting
4206165155Sscottl**  					of the Maximum Memory Read Byte Count field of the PCIXCMD register:
4207165155Sscottl**  					DMCRS Max ADQs Maximum Memory Read Byte Count Register Setting
4208165155Sscottl**  					1 16 512 (Default)
4209165155Sscottl**  					2 32 1024
4210165155Sscottl**  					2 32 2048
4211165155Sscottl**  					2 32 4096
4212144411Sscottl**  25:23      011 2                        Designed Maximum Outstanding Split Transactions - The 80331 can have up to four outstanding split transactions.
4213165155Sscottl**  22:21       01 2                        Designed Maximum Memory Read Byte Count - The 80331 can generate memory reads with byte counts up
4214165155Sscottl**                                          to 1024 bytes.
4215144411Sscottl**  20           1 2                        80331 is a complex device.
4216144411Sscottl**  19           0 2                        Unexpected Split Completion - This bit is set when an unexpected Split Completion with this device��s
4217165155Sscottl**  					Requester ID is received. Once set, this bit remains set until software writes a 1 to this location.
4218165155Sscottl**  					0=no unexpected Split Completion has been received.
4219165155Sscottl**  					1=an unexpected Split Completion has been received.
4220144411Sscottl**  18           0 2                        Split Completion Discarded - This bit is set when the device discards a Split Completion because the
4221165155Sscottl**  					requester would not accept it. See Section 5.4.4 of the PCI-X Addendum to the PCI Local Bus
4222165155Sscottl**  					Specification, Revision 1.0a for details. Once set, this bit remains set until software writes a 1 to this
4223165155Sscottl**  					location.
4224165155Sscottl**  					0=no Split Completion has been discarded.
4225165155Sscottl**  					1=a Split Completion has been discarded.
4226165155Sscottl**  		NOTE: The 80331 does not set this bit since there is no Inbound address responding to Inbound Read
4227165155Sscottl**  			Requests with Split Responses (Memory or Register) that has ��read side effects.��
4228144411Sscottl**  17           1 2                        80331 is a 133 MHz capable device.
4229165155Sscottl**  16           1 2 or P_32BITPCI#	80331 with bridge enabled (BRG_EN=1) implements the ATU with a 64-bit interface on the secondary PCI bus,
4230165155Sscottl**  					therefore this bit is always set.
4231165155Sscottl**  			80331 with no bridge and central resource disabled (BRG_EN=0, ARB_EN=0),
4232165155Sscottl**  			use this bit to identify the add-in card to the system as 64-bit or 32-bit wide via a user-configurable strap (P_32BITPCI#).
4233165155Sscottl**  			This strap, by default, identifies the add in card based on 80331 with bridge disabled
4234165155Sscottl**  			as 64-bit unless the user attaches the appropriate pull-down resistor to the strap.
4235165155Sscottl**  			0=The bus is 32 bits wide.
4236165155Sscottl**  			1=The bus is 64 bits wide.
4237144411Sscottl**  15:8         FFH                        Bus Number - This register is read for diagnostic purposes only. It indicates the number of the bus
4238165155Sscottl**  			segment for the device containing this function. The function uses this number as part of its Requester
4239165155Sscottl**  			ID and Completer ID. For all devices other than the source bridge, each time the function is addressed
4240165155Sscottl**  			by a Configuration Write transaction, the function must update this register with the contents of AD[7::0]
4241165155Sscottl**  			of the attribute phase of the Configuration Write, regardless of which register in the function is
4242165155Sscottl**  			addressed by the transaction. The function is addressed by a Configuration Write transaction when all of
4243165155Sscottl**  			the following are true:
4244165155Sscottl**  			1. The transaction uses a Configuration Write command.
4245165155Sscottl**  			2. IDSEL is asserted during the address phase.
4246165155Sscottl**  			3. AD[1::0] are 00b (Type 0 configuration transaction).
4247165155Sscottl**  			4. AD[10::08] of the configuration address contain the appropriate function number.
4248144411Sscottl**  7:3          1FH                        Device Number - This register is read for diagnostic purposes only. It indicates the number of the device
4249165155Sscottl**  			containing this function, i.e., the number in the Device Number field (AD[15::11]) of the address of a
4250165155Sscottl**  			Type 0 configuration transaction that is assigned to the device containing this function by the connection
4251165155Sscottl**  			of the system hardware. The system must assign a device number other than 00h (00h is reserved for
4252165155Sscottl**  			the source bridge). The function uses this number as part of its Requester ID and Completer ID. Each
4253165155Sscottl**  			time the function is addressed by a Configuration Write transaction, the device must update this register
4254165155Sscottl**  			with the contents of AD[15::11] of the address phase of the Configuration Write, regardless of which
4255165155Sscottl**  			register in the function is addressed by the transaction. The function is addressed by a Configuration
4256165155Sscottl**  			Write transaction when all of the following are true:
4257165155Sscottl**  			1. The transaction uses a Configuration Write command.
4258165155Sscottl**  			2. IDSEL is asserted during the address phase.
4259165155Sscottl**  			3. AD[1::0] are 00b (Type 0 configuration transaction).
4260165155Sscottl**  			4. AD[10::08] of the configuration address contain the appropriate function number.
4261144411Sscottl**  2:0        000 2                        Function Number - This register is read for diagnostic purposes only. It indicates the number of this
4262165155Sscottl**  			function; i.e., the number in the Function Number field (AD[10::08]) of the address of a Type 0
4263165155Sscottl**  			configuration transaction to which this function responds. The function uses this number as part of its
4264165155Sscottl**  			Requester ID and Completer ID.
4265165155Sscottl**
4266144411Sscottl**************************************************************************
4267144411Sscottl*/
4268144411Sscottl#define     ARCMSR_PCIX_STATUS_REG		          0xE4    /*dword 0xE7,0xE6,0xE5,0xE4*/
4269144411Sscottl
4270144411Sscottl/*
4271144411Sscottl**************************************************************************
4272144411Sscottl**                 Inbound Read Transaction
4273144411Sscottl**  ========================================================================
4274144411Sscottl**	An inbound read transaction is initiated by a PCI initiator and is targeted at either 80331 local
4275144411Sscottl**	memory or a 80331 memory-mapped register space. The read transaction is propagated through
4276144411Sscottl**	the inbound transaction queue (ITQ) and read data is returned through the inbound read queue
4277144411Sscottl**	(IRQ).
4278144411Sscottl**	When operating in the conventional PCI mode, all inbound read transactions are processed as
4279144411Sscottl**	delayed read transactions. When operating in the PCI-X mode, all inbound read transactions are
4280144411Sscottl**	processed as split transactions. The ATUs PCI interface claims the read transaction and forwards
4281144411Sscottl**	the read request through to the internal bus and returns the read data to the PCI bus. Data flow for
4282144411Sscottl**	an inbound read transaction on the PCI bus is summarized in the following statements:
4283144411Sscottl**	�E The ATU claims the PCI read transaction when the PCI address is within the inbound
4284144411Sscottl**	translation window defined by ATU Inbound Base Address Register (and Inbound Upper Base
4285144411Sscottl**	Address Register during DACs) and Inbound Limit Register.
4286144411Sscottl**	�E When operating in the conventional PCI mode, when the ITQ is currently holding transaction
4287144411Sscottl**	information from a previous delayed read, the current transaction information is compared to
4288144411Sscottl**	the previous transaction information (based on the setting of the DRC Alias bit in
4289144411Sscottl**	Section 3.10.39, ��ATU Configuration Register - ATUCR�� on page 252). When there is a
4290144411Sscottl**	match and the data is in the IRQ, return the data to the master on the PCI bus. When there is a
4291144411Sscottl**	match and the data is not available, a Retry is signaled with no other action taken. When there
4292144411Sscottl**	is not a match and when the ITQ has less than eight entries, capture the transaction
4293144411Sscottl**	information, signal a Retry and initiate a delayed transaction. When there is not a match and
4294144411Sscottl**	when the ITQ is full, then signal a Retry with no other action taken.
4295144411Sscottl**	�X When an address parity error is detected, the address parity response defined in
4296144411Sscottl**	Section 3.7 is used.
4297144411Sscottl**	�E When operating in the conventional PCI mode, once read data is driven onto the PCI bus from
4298144411Sscottl**	the IRQ, it continues until one of the following is true:
4299144411Sscottl**	�X The initiator completes the PCI transaction. When there is data left unread in the IRQ, the
4300144411Sscottl**	data is flushed.
4301144411Sscottl**	�X An internal bus Target Abort was detected. In this case, the QWORD associated with the
4302144411Sscottl**	Target Abort is never entered into the IRQ, and therefore is never returned.
4303144411Sscottl**	�X Target Abort or a Disconnect with Data is returned in response to the Internal Bus Error.
4304144411Sscottl**	�X The IRQ becomes empty. In this case, the PCI interface signals a Disconnect with data to
4305144411Sscottl**	the initiator on the last data word available.
4306144411Sscottl**	�E When operating in the PCI-X mode, when ITQ is not full, the PCI address, attribute and
4307144411Sscottl**	command are latched into the available ITQ and a Split Response Termination is signalled to
4308144411Sscottl**	the initiator.
4309144411Sscottl**	�E When operating in the PCI-X mode, when the transaction does not cross a 1024 byte aligned
4310144411Sscottl**	boundary, then the ATU waits until it receives the full byte count from the internal bus target
4311144411Sscottl**	before returning read data by generating the split completion transaction on the PCI-X bus.
4312144411Sscottl**	When the read requested crosses at least one 1024 byte boundary, then ATU completes the
4313144411Sscottl**	transfer by returning data in 1024 byte aligned chunks.
4314144411Sscottl**	�E When operating in the PCI-X mode, once a split completion transaction has started, it
4315144411Sscottl**	continues until one of the following is true:
4316144411Sscottl**	�X The requester (now the target) generates a Retry Termination, or a Disconnection at Next
4317144411Sscottl**	ADB (when the requester is a bridge)
4318144411Sscottl**	�X The byte count is satisfied.
4319144411Sscottl**	�X An internal bus Target Abort was detected. The ATU generates a Split Completion
4320144411Sscottl**	Message (message class=2h - completer error, and message index=81h - target abort) to
4321144411Sscottl**	inform the requester about the abnormal condition. The ITQ for this transaction is flushed.
4322144411Sscottl**	Refer to Section 3.7.1.
4323144411Sscottl**	�X An internal bus Master Abort was detected. The ATU generates a Split Completion
4324144411Sscottl**	Message (message class=2h - completer error, and message index=80h - Master abort) to
4325144411Sscottl**	inform the requester about the abnormal condition. The ITQ for this transaction is flushed.
4326144411Sscottl**	Refer to Section 3.7.1
4327144411Sscottl**	�E When operating in the conventional PCI mode, when the master inserts wait states on the PCI
4328144411Sscottl**	bus, the ATU PCI slave interface waits with no premature disconnects.
4329144411Sscottl**	�E When a data parity error occurs signified by PERR# asserted from the initiator, no action is
4330144411Sscottl**	taken by the target interface. Refer to Section 3.7.2.5.
4331144411Sscottl**	�E When operating in the conventional PCI mode, when the read on the internal bus is
4332144411Sscottl**	target-aborted, either a target-abort or a disconnect with data is signaled to the initiator. This is
4333144411Sscottl**	based on the ATU ECC Target Abort Enable bit (bit 0 of the ATUIMR for ATU). When set, a
4334144411Sscottl**	target abort is used, when clear, a disconnect is used.
4335144411Sscottl**	�E When operating in the PCI-X mode (with the exception of the MU queue ports at offsets 40h
4336144411Sscottl**	and 44h), when the transaction on the internal bus resulted in a target abort, the ATU generates
4337144411Sscottl**	a Split Completion Message (message class=2h - completer error, and message index=81h -
4338144411Sscottl**	internal bus target abort) to inform the requester about the abnormal condition. For the MU
4339144411Sscottl**	queue ports, the ATU returns either a target abort or a single data phase disconnect depending
4340144411Sscottl**	on the ATU ECC Target Abort Enable bit (bit 0 of the ATUIMR for ATU). The ITQ for this
4341144411Sscottl**	transaction is flushed. Refer to Section 3.7.1.
4342144411Sscottl**	�E When operating in the conventional PCI mode, when the transaction on the internal bus
4343144411Sscottl**	resulted in a master abort, the ATU returns a target abort to inform the requester about the
4344144411Sscottl**	abnormal condition. The ITQ for this transaction is flushed. Refer to Section 3.7.1
4345144411Sscottl**	�E When operating in the PCI-X mode, when the transaction on the internal bus resulted in a
4346144411Sscottl**	master abort, the ATU generates a Split Completion Message (message class=2h - completer
4347144411Sscottl**	error, and message index=80h - internal bus master abort) to inform the requester about the
4348144411Sscottl**	abnormal condition. The ITQ for this transaction is flushed. Refer to Section 3.7.1.
4349144411Sscottl**	�E When operating in the PCI-X mode, when the Split Completion transaction completes with
4350144411Sscottl**	either Master-Abort or Target-Abort, the requester is indicating a failure condition that
4351144411Sscottl**	prevents it from accepting the completion it requested. In this case, since the Split Request
4352144411Sscottl**	addresses a location that has no read side effects, the completer must discard the Split
4353144411Sscottl**	Completion and take no further action.
4354144411Sscottl**	The data flow for an inbound read transaction on the internal bus is summarized in the following
4355144411Sscottl**	statements:
4356144411Sscottl**	�E The ATU internal bus master interface requests the internal bus when a PCI address appears in
4357144411Sscottl**		an ITQ and transaction ordering has been satisfied. When operating in the PCI-X mode the
4358144411Sscottl**		ATU does not use the information provided by the Relax Ordering Attribute bit. That is, ATU
4359144411Sscottl**		always uses conventional PCI ordering rules.
4360144411Sscottl**	�E Once the internal bus is granted, the internal bus master interface drives the translated address
4361144411Sscottl**		onto the bus and wait for IB_DEVSEL#. When a Retry is signaled, the request is repeated.
4362144411Sscottl**		When a master abort occurs, the transaction is considered complete and a target abort is loaded
4363144411Sscottl**		into the associated IRQ for return to the PCI initiator (transaction is flushed once the PCI
4364144411Sscottl**		master has been delivered the target abort).
4365144411Sscottl**	�E Once the translated address is on the bus and the transaction has been accepted, the internal
4366144411Sscottl**		bus target starts returning data with the assertion of IB_TRDY#. Read data is continuously
4367144411Sscottl**		received by the IRQ until one of the following is true:
4368144411Sscottl**	�X The full byte count requested by the ATU read request is received. The ATU internal bus
4369144411Sscottl**	    initiator interface performs a initiator completion in this case.
4370144411Sscottl**	�X When operating in the conventional PCI mode, a Target Abort is received on the internal
4371144411Sscottl**		bus from the internal bus target. In this case, the transaction is aborted and the PCI side is
4372144411Sscottl**		informed.
4373144411Sscottl**	�X When operating in the PCI-X mode, a Target Abort is received on the internal bus from
4374144411Sscottl**		the internal bus target. In this case, the transaction is aborted. The ATU generates a Split
4375144411Sscottl**		Completion Message (message class=2h - completer error, and message index=81h -
4376144411Sscottl**		target abort) on the PCI bus to inform the requester about the abnormal condition. The
4377144411Sscottl**		ITQ for this transaction is flushed.
4378144411Sscottl**	�X When operating in the conventional PCI mode, a single data phase disconnection is
4379144411Sscottl**		received from the internal bus target. When the data has not been received up to the next
4380144411Sscottl**		QWORD boundary, the ATU internal bus master interface attempts to reacquire the bus.
4381144411Sscottl**		When not, the bus returns to idle.
4382144411Sscottl**	�X When operating in the PCI-X mode, a single data phase disconnection is received from
4383144411Sscottl**		the internal bus target. The ATU IB initiator interface attempts to reacquire the bus to
4384144411Sscottl**		obtain remaining data.
4385144411Sscottl**	�X When operating in the conventional PCI mode, a disconnection at Next ADB is received
4386144411Sscottl**	    from the internal bus target. The bus returns to idle.
4387144411Sscottl**	�X When operating in the PCI-X mode, a disconnection at Next ADB is received from the
4388144411Sscottl**		internal bus target. The ATU IB initiator interface attempts to reacquire the bus to obtain
4389144411Sscottl**		remaining data.
4390144411Sscottl**		To support PCI Local Bus Specification, Revision 2.0 devices, the ATU can be programmed to
4391144411Sscottl**		ignore the memory read command (Memory Read, Memory Read Line, and Memory Read
4392144411Sscottl**		Multiple) when trying to match the current inbound read transaction with data in a DRC queue
4393144411Sscottl**		which was read previously (DRC on target bus). When the Read Command Alias Bit in the
4394144411Sscottl**		ATUCR register is set, the ATU does not distinguish the read commands on transactions. For
4395144411Sscottl**		example, the ATU enqueues a DRR with a Memory Read Multiple command and performs the read
4396144411Sscottl**		on the internal bus. Some time later, a PCI master attempts a Memory Read with the same address
4397144411Sscottl**		as the previous Memory Read Multiple. When the Read Command Bit is set, the ATU would return
4398144411Sscottl**		the read data from the DRC queue and consider the Delayed Read transaction complete. When the
4399144411Sscottl**		Read Command bit in the ATUCR was clear, the ATU would not return data since the PCI read
4400144411Sscottl**		commands did not match, only the address.
4401144411Sscottl**************************************************************************
4402144411Sscottl*/
4403144411Sscottl/*
4404144411Sscottl**************************************************************************
4405144411Sscottl**                    Inbound Write Transaction
4406144411Sscottl**========================================================================
4407144411Sscottl**	  An inbound write transaction is initiated by a PCI master and is targeted at either 80331 local
4408144411Sscottl**	  memory or a 80331 memory-mapped register.
4409144411Sscottl**	Data flow for an inbound write transaction on the PCI bus is summarized as:
4410144411Sscottl**	�E The ATU claims the PCI write transaction when the PCI address is within the inbound
4411144411Sscottl**	  translation window defined by the ATU Inbound Base Address Register (and Inbound Upper
4412144411Sscottl**	  Base Address Register during DACs) and Inbound Limit Register.
4413144411Sscottl**	�E When the IWADQ has at least one address entry available and the IWQ has at least one buffer
4414144411Sscottl**	  available, the address is captured and the first data phase is accepted.
4415144411Sscottl**	�E The PCI interface continues to accept write data until one of the following is true:
4416144411Sscottl**	  �X The initiator performs a disconnect.
4417144411Sscottl**	  �X The transaction crosses a buffer boundary.
4418144411Sscottl**	�E When an address parity error is detected during the address phase of the transaction, the
4419144411Sscottl**	  address parity error mechanisms are used. Refer to Section 3.7.1 for details of the address
4420144411Sscottl**	  parity error response.
4421144411Sscottl**	�E When operating in the PCI-X mode when an attribute parity error is detected, the attribute
4422144411Sscottl**	  parity error mechanism described in Section 3.7.1 is used.
4423144411Sscottl**	�E When a data parity error is detected while accepting data, the slave interface sets the
4424144411Sscottl**	  appropriate bits based on PCI specifications. No other action is taken. Refer to Section 3.7.2.6
4425144411Sscottl**	  for details of the inbound write data parity error response.
4426144411Sscottl**	  Once the PCI interface places a PCI address in the IWADQ, when IWQ has received data sufficient
4427144411Sscottl**	  to cross a buffer boundary or the master disconnects on the PCI bus, the ATUs internal bus
4428144411Sscottl**	  interface becomes aware of the inbound write. When there are additional write transactions ahead
4429144411Sscottl**	  in the IWQ/IWADQ, the current transaction remains posted until ordering and priority have been
4430144411Sscottl**	  satisfied (Refer to Section 3.5.3) and the transaction is attempted on the internal bus by the ATU
4431144411Sscottl**	  internal master interface. The ATU does not insert target wait states nor do data merging on the PCI
4432144411Sscottl**	  interface, when operating in the PCI mode.
4433144411Sscottl**	  In the PCI-X mode memory writes are always executed as immediate transactions, while
4434144411Sscottl**	  configuration write transactions are processed as split transactions. The ATU generates a Split
4435144411Sscottl**	  Completion Message, (with Message class=0h - Write Completion Class and Message index =
4436144411Sscottl**	  00h - Write Completion Message) once a configuration write is successfully executed.
4437144411Sscottl**	  Also, when operating in the PCI-X mode a write sequence may contain multiple write transactions.
4438144411Sscottl**	  The ATU handles such transactions as independent transactions.
4439144411Sscottl**	  Data flow for the inbound write transaction on the internal bus is summarized as:
4440144411Sscottl**	�E The ATU internal bus master requests the internal bus when IWADQ has at least one entry
4441144411Sscottl**	  with associated data in the IWQ.
4442144411Sscottl**	�E When the internal bus is granted, the internal bus master interface initiates the write
4443144411Sscottl**	  transaction by driving the translated address onto the internal bus. For details on inbound
4444144411Sscottl**	  address translation.
4445144411Sscottl**	�E When IB_DEVSEL# is not returned, a master abort condition is signaled on the internal bus.
4446144411Sscottl**	  The current transaction is flushed from the queue and SERR# may be asserted on the PCI
4447144411Sscottl**	  interface.
4448144411Sscottl**	�E The ATU initiator interface asserts IB_REQ64# to attempt a 64-bit transfer. When
4449144411Sscottl**	  IB_ACK64# is not returned, a 32-bit transfer is used. Transfers of less than 64-bits use the
4450144411Sscottl**	  IB_C/BE[7:0]# to mask the bytes not written in the 64-bit data phase. Write data is transferred
4451144411Sscottl**	  from the IWQ to the internal bus when data is available and the internal bus interface retains
4452144411Sscottl**	  internal bus ownership.
4453144411Sscottl**	�E The internal bus interface stops transferring data from the current transaction to the internal
4454144411Sscottl**	  bus when one of the following conditions becomes true:
4455144411Sscottl**	�X The internal bus initiator interface loses bus ownership. The ATU internal initiator
4456144411Sscottl**	  terminates the transfer (initiator disconnection) at the next ADB (for the internal bus ADB
4457144411Sscottl**	  is defined as a naturally aligned 128-byte boundary) and attempt to reacquire the bus to
4458144411Sscottl**	  complete the delivery of remaining data using the same sequence ID but with the
4459144411Sscottl**	  modified starting address and byte count.
4460144411Sscottl**	�X A Disconnect at Next ADB is signaled on the internal bus from the internal target. When
4461144411Sscottl**	  the transaction in the IWQ completes at that ADB, the initiator returns to idle. When the
4462144411Sscottl**	  transaction in the IWQ is not complete, the initiator attempts to reacquire the bus to
4463144411Sscottl**	  complete the delivery of remaining data using the same sequence ID but with the
4464144411Sscottl**	  modified starting address and byte count.
4465144411Sscottl**	�X A Single Data Phase Disconnect is signaled on the internal bus from the internal target.
4466144411Sscottl**	  When the transaction in the IWQ needs only a single data phase, the master returns to idle.
4467144411Sscottl**	  When the transaction in the IWQ is not complete, the initiator attempts to reacquire the
4468144411Sscottl**	  bus to complete the delivery of remaining data using the same sequence ID but with the
4469144411Sscottl**	  modified starting address and byte count.
4470144411Sscottl**	�X The data from the current transaction has completed (satisfaction of byte count). An
4471144411Sscottl**	  initiator termination is performed and the bus returns to idle.
4472144411Sscottl**	�X A Master Abort is signaled on the internal bus. SERR# may be asserted on the PCI bus.
4473144411Sscottl**	  Data is flushed from the IWQ.
4474144411Sscottl*****************************************************************
4475144411Sscottl*/
4476144411Sscottl
4477144411Sscottl/*
4478144411Sscottl**************************************************************************
4479144411Sscottl**               Inbound Read Completions Data Parity Errors
4480144411Sscottl**========================================================================
4481144411Sscottl**	As an initiator, the ATU may encounter this error condition when operating in the PCI-X mode.
4482144411Sscottl**	When as the completer of a Split Read Request the ATU observes PERR# assertion during the split
4483144411Sscottl**	completion transaction, the ATU attempts to complete the transaction normally and no further
4484144411Sscottl**	action is taken.
4485144411Sscottl**************************************************************************
4486144411Sscottl*/
4487144411Sscottl
4488144411Sscottl/*
4489144411Sscottl**************************************************************************
4490144411Sscottl**               Inbound Configuration Write Completion Message Data Parity Errors
4491144411Sscottl**========================================================================
4492144411Sscottl**  As an initiator, the ATU may encounter this error condition when operating in the PCI-X mode.
4493144411Sscottl**  When as the completer of a Configuration (Split) Write Request the ATU observes PERR#
4494144411Sscottl**  assertion during the split completion transaction, the ATU attempts to complete the transaction
4495144411Sscottl**  normally and no further action is taken.
4496144411Sscottl**************************************************************************
4497144411Sscottl*/
4498144411Sscottl
4499144411Sscottl/*
4500144411Sscottl**************************************************************************
4501144411Sscottl**              Inbound Read Request Data Parity Errors
4502144411Sscottl**===================== Immediate Data Transfer ==========================
4503144411Sscottl**  As a target, the ATU may encounter this error when operating in the Conventional PCI or PCI-X modes.
4504144411Sscottl**  Inbound read data parity errors occur when read data delivered from the IRQ is detected as having
4505144411Sscottl**  bad parity by the initiator of the transaction who is receiving the data. The initiator may optionally
4506144411Sscottl**  report the error to the system by asserting PERR#. As a target device in this scenario, no action is
4507144411Sscottl**  required and no error bits are set.
4508144411Sscottl**=====================Split Response Termination=========================
4509144411Sscottl**  As a target, the ATU may encounter this error when operating in the PCI-X mode.
4510144411Sscottl**  Inbound read data parity errors occur during the Split Response Termination. The initiator may
4511144411Sscottl**  optionally report the error to the system by asserting PERR#. As a target device in this scenario, no
4512144411Sscottl**  action is required and no error bits are set.
4513144411Sscottl**************************************************************************
4514144411Sscottl*/
4515144411Sscottl
4516144411Sscottl/*
4517144411Sscottl**************************************************************************
4518144411Sscottl**              Inbound Write Request Data Parity Errors
4519144411Sscottl**========================================================================
4520144411Sscottl**	As a target, the ATU may encounter this error when operating in the Conventional or PCI-X modes.
4521144411Sscottl**	Data parity errors occurring during write operations received by the ATU may assert PERR# on
4522144411Sscottl**	the PCI Bus. When an error occurs, the ATU continues accepting data until the initiator of the write
4523144411Sscottl**	transaction completes or a queue fill condition is reached. Specifically, the following actions with
4524144411Sscottl**	the given constraints are taken by the ATU:
4525144411Sscottl**	�E PERR# is asserted two clocks cycles (three clock cycles when operating in the PCI-X mode)
4526144411Sscottl**	following the data phase in which the data parity error is detected on the bus. This is only
4527144411Sscottl**	done when the Parity Error Response bit in the ATUCMD is set.
4528144411Sscottl**	�E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional
4529144411Sscottl**	actions is taken:
4530144411Sscottl**	�X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the
4531144411Sscottl**	Detected Parity Error bit in the ATUISR. When set, no action.
4532144411Sscottl***************************************************************************
4533144411Sscottl*/
4534144411Sscottl
4535144411Sscottl/*
4536144411Sscottl***************************************************************************
4537144411Sscottl**                 Inbound Configuration Write Request
4538144411Sscottl**  =====================================================================
4539144411Sscottl**  As a target, the ATU may encounter this error when operating in the Conventional or PCI-X modes.
4540144411Sscottl**  ===============================================
4541144411Sscottl**              Conventional PCI Mode
4542144411Sscottl**  ===============================================
4543144411Sscottl**  To allow for correct data parity calculations for delayed write transactions, the ATU delays the
4544144411Sscottl**  assertion of STOP# (signalling a Retry) until PAR is driven by the master. A parity error during a
4545144411Sscottl**  delayed write transaction (inbound configuration write cycle) can occur in any of the following
4546144411Sscottl**  parts of the transactions:
4547144411Sscottl**  �E During the initial Delayed Write Request cycle on the PCI bus when the ATU latches the
4548144411Sscottl**  address/command and data for delayed delivery to the internal configuration register.
4549144411Sscottl**  �E During the Delayed Write Completion cycle on the PCI bus when the ATU delivers the status
4550144411Sscottl**  of the operation back to the original master.
4551144411Sscottl**  The 80331 ATU PCI interface has the following responses to a delayed write parity error for
4552144411Sscottl**  inbound transactions during Delayed Write Request cycles with the given constraints:
4553144411Sscottl**  �E When the Parity Error Response bit in the ATUCMD is set, the ATU asserts TRDY#
4554144411Sscottl**  (disconnects with data) and two clock cycles later asserts PERR# notifying the initiator of the
4555144411Sscottl**  parity error. The delayed write cycle is not enqueued and forwarded to the internal bus.
4556144411Sscottl**  When the Parity Error Response bit in the ATUCMD is cleared, the ATU retries the
4557144411Sscottl**  transaction by asserting STOP# and enqueues the Delayed Write Request cycle to be
4558144411Sscottl**  forwarded to the internal bus. PERR# is not asserted.
4559144411Sscottl**  �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional
4560144411Sscottl**  actions is taken:
4561144411Sscottl**  �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the
4562144411Sscottl**  Detected Parity Error bit in the ATUISR. When set, no action.
4563144411Sscottl**  For the original write transaction to be completed, the initiator retries the transaction on the PCI
4564144411Sscottl**  bus and the ATU returns the status from the internal bus, completing the transaction.
4565144411Sscottl**  For the Delayed Write Completion transaction on the PCI bus where a data parity error occurs and
4566144411Sscottl**  therefore does not agree with the status being returned from the internal bus (i.e. status being
4567144411Sscottl**  returned is normal completion) the ATU performs the following actions with the given constraints:
4568144411Sscottl**  �E When the Parity Error Response Bit is set in the ATUCMD, the ATU asserts TRDY#
4569144411Sscottl**  (disconnects with data) and two clocks later asserts PERR#. The Delayed Completion cycle in
4570144411Sscottl**  the IDWQ remains since the data of retried command did not match the data within the queue.
4571144411Sscottl**  �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional
4572144411Sscottl**  actions is taken:
4573144411Sscottl**  �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the
4574144411Sscottl**  Detected Parity Error bit in the ATUISR. When set, no action.
4575144411Sscottl**  ===================================================
4576144411Sscottl**                       PCI-X Mode
4577144411Sscottl**  ===================================================
4578144411Sscottl**  Data parity errors occurring during configuration write operations received by the ATU may cause
4579144411Sscottl**  PERR# assertion and delivery of a Split Completion Error Message on the PCI Bus. When an error
4580144411Sscottl**  occurs, the ATU accepts the write data and complete with a Split Response Termination.
4581144411Sscottl**  Specifically, the following actions with the given constraints are then taken by the ATU:
4582144411Sscottl**  �E When the Parity Error Response bit in the ATUCMD is set, PERR# is asserted three clocks
4583144411Sscottl**  cycles following the Split Response Termination in which the data parity error is detected on
4584144411Sscottl**  the bus. When the ATU asserts PERR#, additional actions is taken:
4585144411Sscottl**  �X A Split Write Data Parity Error message (with message class=2h - completer error and
4586144411Sscottl**  message index=01h - Split Write Data Parity Error) is initiated by the ATU on the PCI bus
4587144411Sscottl**  that addresses the requester of the configuration write.
4588144411Sscottl**  �X When the Initiated Split Completion Error Message Interrupt Mask in the ATUIMR is
4589144411Sscottl**  clear, set the Initiated Split Completion Error Message bit in the ATUISR. When set, no
4590144411Sscottl**  action.
4591144411Sscottl**  �X The Split Write Request is not enqueued and forwarded to the internal bus.
4592144411Sscottl**  �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional
4593144411Sscottl**  actions is taken:
4594144411Sscottl**  �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the
4595144411Sscottl**  Detected Parity Error bit in the ATUISR. When set, no action.
4596144411Sscottl**
4597144411Sscottl***************************************************************************
4598144411Sscottl*/
4599144411Sscottl
4600144411Sscottl/*
4601144411Sscottl***************************************************************************
4602144411Sscottl**                       Split Completion Messages
4603144411Sscottl**  =======================================================================
4604144411Sscottl**  As a target, the ATU may encounter this error when operating in the PCI-X mode.
4605144411Sscottl**  Data parity errors occurring during Split Completion Messages claimed by the ATU may assert
4606144411Sscottl**  PERR# (when enabled) or SERR# (when enabled) on the PCI Bus. When an error occurs, the
4607144411Sscottl**  ATU accepts the data and complete normally. Specifically, the following actions with the given
4608144411Sscottl**  constraints are taken by the ATU:
4609144411Sscottl**  �E PERR# is asserted three clocks cycles following the data phase in which the data parity error
4610144411Sscottl**  is detected on the bus. This is only done when the Parity Error Response bit in the ATUCMD
4611144411Sscottl**  is set. When the ATU asserts PERR#, additional actions is taken:
4612144411Sscottl**  �X The Master Parity Error bit in the ATUSR is set.
4613144411Sscottl**  �X When the ATU PCI Master Parity Error Interrupt Mask Bit in the ATUIMR is clear, set the
4614144411Sscottl**  PCI Master Parity Error bit in the ATUISR. When set, no action.
4615144411Sscottl**  �X When the SERR# Enable bit in the ATUCMD is set, and the Data Parity Error Recover
4616144411Sscottl**  Enable bit in the PCIXCMD register is clear, assert SERR#; otherwise no action is taken.
4617144411Sscottl**  When the ATU asserts SERR#, additional actions is taken:
4618144411Sscottl**  Set the SERR# Asserted bit in the ATUSR.
4619144411Sscottl**  When the ATU SERR# Asserted Interrupt Mask Bit in the ATUIMR is clear, set the
4620144411Sscottl**  SERR# Asserted bit in the ATUISR. When set, no action.
4621144411Sscottl**  When the ATU SERR# Detected Interrupt Enable Bit in the ATUCR is set, set the
4622144411Sscottl**  SERR# Detected bit in the ATUISR. When clear, no action.
4623144411Sscottl**  �E When the SCE bit (Split Completion Error -- bit 30 of the Completer Attributes) is set during
4624144411Sscottl**  the Attribute phase, the Received Split Completion Error Message bit in the PCIXSR is set.
4625144411Sscottl**  When the ATU sets this bit, additional actions is taken:
4626144411Sscottl**  �X When the ATU Received Split Completion Error Message Interrupt Mask bit in the
4627144411Sscottl**  ATUIMR is clear, set the Received Split Completion Error Message bit in the ATUISR.
4628144411Sscottl**  When set, no action.
4629144411Sscottl**  �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional
4630144411Sscottl**  actions is taken:
4631144411Sscottl**  �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the
4632144411Sscottl**  Detected Parity Error bit in the ATUISR. When set, no action.
4633144411Sscottl**  �E The transaction associated with the Split Completion Message is discarded.
4634144411Sscottl**  �E When the discarded transaction was a read, a completion error message (with message
4635144411Sscottl**  class=2h - completer error and message index=82h - PCI bus read parity error) is generated on
4636144411Sscottl**  the internal bus of the 80331.
4637144411Sscottl*****************************************************************************
4638144411Sscottl*/
4639144411Sscottl
4640144411Sscottl/*
4641144411Sscottl******************************************************************************************************
4642144411Sscottl**                 Messaging Unit (MU) of the Intel R 80331 I/O processor (80331)
4643144411Sscottl**  ==================================================================================================
4644144411Sscottl**	The Messaging Unit (MU) transfers data between the PCI system and the 80331
4645144411Sscottl**  notifies the respective system when new data arrives.
4646144411Sscottl**	The PCI window for messaging transactions is always the first 4 Kbytes of the inbound translation.
4647144411Sscottl**	window defined by:
4648144411Sscottl**                    1.Inbound ATU Base Address Register 0 (IABAR0)
4649144411Sscottl**                    2.Inbound ATU Limit Register 0 (IALR0)
4650144411Sscottl**	All of the Messaging Unit errors are reported in the same manner as ATU errors.
4651144411Sscottl**  Error conditions and status can be found in :
4652144411Sscottl**                                               1.ATUSR
4653144411Sscottl**                                               2.ATUISR
4654144411Sscottl**====================================================================================================
4655144411Sscottl**     Mechanism        Quantity               Assert PCI Interrupt Signals      Generate I/O Processor Interrupt
4656144411Sscottl**----------------------------------------------------------------------------------------------------
4657144411Sscottl**  Message Registers      2 Inbound                   Optional                              Optional
4658144411Sscottl**                         2 Outbound
4659144411Sscottl**----------------------------------------------------------------------------------------------------
4660144411Sscottl**  Doorbell Registers     1 Inbound                   Optional                              Optional
4661144411Sscottl**                         1 Outbound
4662144411Sscottl**----------------------------------------------------------------------------------------------------
4663144411Sscottl**  Circular Queues        4 Circular Queues           Under certain conditions              Under certain conditions
4664144411Sscottl**----------------------------------------------------------------------------------------------------
4665144411Sscottl**  Index Registers     1004 32-bit Memory Locations   No                                    Optional
4666144411Sscottl**====================================================================================================
4667144411Sscottl**     PCI Memory Map: First 4 Kbytes of the ATU Inbound PCI Address Space
4668144411Sscottl**====================================================================================================
4669144411Sscottl**  0000H           Reserved
4670144411Sscottl**  0004H           Reserved
4671144411Sscottl**  0008H           Reserved
4672144411Sscottl**  000CH           Reserved
4673144411Sscottl**------------------------------------------------------------------------
4674144411Sscottl**  0010H 			Inbound Message Register 0              ]
4675144411Sscottl**  0014H 			Inbound Message Register 1              ]
4676144411Sscottl**  0018H 			Outbound Message Register 0             ]
4677144411Sscottl**  001CH 			Outbound Message Register 1             ]   4 Message Registers
4678144411Sscottl**------------------------------------------------------------------------
4679144411Sscottl**  0020H 			Inbound Doorbell Register               ]
4680144411Sscottl**  0024H 			Inbound Interrupt Status Register       ]
4681144411Sscottl**  0028H 			Inbound Interrupt Mask Register         ]
4682144411Sscottl**  002CH 			Outbound Doorbell Register              ]
4683144411Sscottl**  0030H 			Outbound Interrupt Status Register      ]
4684144411Sscottl**  0034H 			Outbound Interrupt Mask Register        ]   2 Doorbell Registers and 4 Interrupt Registers
4685144411Sscottl**------------------------------------------------------------------------
4686144411Sscottl**  0038H 			Reserved
4687144411Sscottl**  003CH 			Reserved
4688144411Sscottl**------------------------------------------------------------------------
4689144411Sscottl**  0040H 			Inbound Queue Port                      ]
4690144411Sscottl**  0044H 			Outbound Queue Port                     ]   2 Queue Ports
4691144411Sscottl**------------------------------------------------------------------------
4692144411Sscottl**  0048H 			Reserved
4693144411Sscottl**  004CH 			Reserved
4694144411Sscottl**------------------------------------------------------------------------
4695144411Sscottl**  0050H                                                   ]
4696144411Sscottl**    :                                                     ]
4697144411Sscottl**    :      Intel Xscale Microarchitecture Local Memory    ]
4698144411Sscottl**    :                                                     ]
4699144411Sscottl**  0FFCH                                                   ]   1004 Index Registers
4700144411Sscottl*******************************************************************************
4701144411Sscottl*/
4702144411Sscottl/*
4703144411Sscottl*****************************************************************************
4704144411Sscottl**                      Theory of MU Operation
4705144411Sscottl*****************************************************************************
4706144411Sscottl**--------------------
4707144411Sscottl**   inbound_msgaddr0:
4708144411Sscottl**   inbound_msgaddr1:
4709144411Sscottl**  outbound_msgaddr0:
4710144411Sscottl**  outbound_msgaddr1:
4711144411Sscottl**  .  The MU has four independent messaging mechanisms.
4712144411Sscottl**     There are four Message Registers that are similar to a combination of mailbox and doorbell registers.
4713144411Sscottl**     Each holds a 32-bit value and generates an interrupt when written.
4714144411Sscottl**--------------------
4715144411Sscottl**   inbound_doorbell:
4716144411Sscottl**  outbound_doorbell:
4717144411Sscottl**  .  The two Doorbell Registers support software interrupts.
4718144411Sscottl**     When a bit is set in a Doorbell Register, an interrupt is generated.
4719144411Sscottl**--------------------
4720144411Sscottl**  inbound_queueport:
4721144411Sscottl** outbound_queueport:
4722144411Sscottl**
4723144411Sscottl**
4724144411Sscottl**  .  The Circular Queues support a message passing scheme that uses 4 circular queues.
4725144411Sscottl**     The 4 circular queues are implemented in 80331 local memory.
4726144411Sscottl**     Two queues are used for inbound messages and two are used for outbound messages.
4727144411Sscottl**     Interrupts may be generated when the queue is written.
4728144411Sscottl**--------------------
4729144411Sscottl** local_buffer 0x0050 ....0x0FFF
4730144411Sscottl**  .  The Index Registers use a portion of the 80331 local memory to implement a large set of message registers.
4731144411Sscottl**     When one of the Index Registers is written, an interrupt is generated and the address of the register written is captured.
4732144411Sscottl**     Interrupt status for all interrupts is recorded in the Inbound Interrupt Status Register and the Outbound Interrupt Status Register.
4733144411Sscottl**     Each interrupt generated by the Messaging Unit can be masked.
4734144411Sscottl**--------------------
4735144411Sscottl**  .  Multi-DWORD PCI burst accesses are not supported by the Messaging Unit,
4736144411Sscottl**     with the exception of Multi-DWORD reads to the index registers.
4737165155Sscottl**     In Conventional mode: the MU terminates   Multi-DWORD PCI transactions
4738165155Sscottl**     (other than index register reads) with a disconnect at the next Qword boundary, with the exception of queue ports.
4739165155Sscottl**     In PCI-X mode       : the MU terminates a Multi-DWORD PCI read transaction with a Split Response
4740165155Sscottl**     and the data is returned through split completion transaction(s).
4741165155Sscottl**     however, when the burst request crosses into or through the range of  offsets 40h to 4Ch
4742165155Sscottl**     (e.g., this includes the queue ports) the transaction is signaled target-abort immediately on the PCI bus.
4743165155Sscottl**     In PCI-X mode, Multi-DWORD PCI writes is signaled a Single-Data-Phase Disconnect
4744165155Sscottl**     which means that no data beyond the first Qword (Dword when the MU does not assert P_ACK64#) is written.
4745144411Sscottl**--------------------
4746144411Sscottl**  .  All registers needed to configure and control the Messaging Unit are memory-mapped registers.
4747144411Sscottl**     The MU uses the first 4 Kbytes of the inbound translation window in the Address Translation Unit (ATU).
4748144411Sscottl**     This PCI address window is used for PCI transactions that access the 80331 local memory.
4749144411Sscottl**     The  PCI address of the inbound translation window is contained in the Inbound ATU Base Address Register.
4750144411Sscottl**--------------------
4751144411Sscottl**  .  From the PCI perspective, the Messaging Unit is part of the Address Translation Unit.
4752144411Sscottl**     The Messaging Unit uses the PCI configuration registers of the ATU for control and status information.
4753144411Sscottl**     The Messaging Unit must observe all PCI control bits in the ATU Command Register and ATU Configuration Register.
4754144411Sscottl**     The Messaging Unit reports all PCI errors in the ATU Status Register.
4755144411Sscottl**--------------------
4756144411Sscottl**  .  Parts of the Messaging Unit can be accessed as a 64-bit PCI device.
4757165155Sscottl**     The register interface, message registers, doorbell registers,
4758165155Sscottl**     and index registers returns a P_ACK64# in response to a P_REQ64# on the PCI interface.
4759144411Sscottl**     Up to 1 Qword of data can be read or written per transaction (except Index Register reads).
4760144411Sscottl**     The Inbound and Outbound Queue Ports are always 32-bit addresses and the MU does not assert P_ACK64# to offsets 40H and 44H.
4761144411Sscottl**************************************************************************
4762144411Sscottl*/
4763144411Sscottl/*
4764144411Sscottl**************************************************************************
4765144411Sscottl**  Message Registers
4766144411Sscottl**  ==============================
4767144411Sscottl**  . Messages can be sent and received by the 80331 through the use of the Message Registers.
4768144411Sscottl**  . When written, the message registers may cause an interrupt to be generated to either the Intel XScale core or the host processor.
4769144411Sscottl**  . Inbound messages are sent by the host processor and received by the 80331.
4770144411Sscottl**    Outbound messages are sent by the 80331 and received by the host processor.
4771144411Sscottl**  . The interrupt status for outbound messages is recorded in the Outbound Interrupt Status Register.
4772144411Sscottl**    Interrupt status for inbound messages is recorded in the Inbound Interrupt Status Register.
4773165155Sscottl**
4774144411Sscottl**  Inbound Messages:
4775144411Sscottl**  -----------------
4776144411Sscottl**  . When an inbound message register is written by an external PCI agent, an interrupt may be generated to the Intel XScale core.
4777144411Sscottl**  . The interrupt may be masked by the mask bits in the Inbound Interrupt Mask Register.
4778144411Sscottl**  . The Intel XScale core interrupt is recorded in the Inbound Interrupt Status Register.
4779144411Sscottl**    The interrupt causes the Inbound Message Interrupt bit to be set in the Inbound Interrupt Status Register.
4780144411Sscottl**    This is a Read/Clear bit that is set by the MU hardware and cleared by software.
4781165155Sscottl**    The interrupt is cleared when the Intel XScale core writes a value of
4782165155Sscottl**    1 to the Inbound Message Interrupt bit in the Inbound Interrupt Status Register.
4783144411Sscottl**  ------------------------------------------------------------------------
4784144411Sscottl**  Inbound Message Register - IMRx
4785144411Sscottl**
4786144411Sscottl**  . There are two Inbound Message Registers: IMR0 and IMR1.
4787144411Sscottl**  . When the IMR register is written, an interrupt to the Intel XScale core may be generated.
4788165155Sscottl**    The interrupt is recorded in the Inbound Interrupt Status Register and may be masked
4789165155Sscottl**    by the Inbound Message Interrupt Mask bit in the Inbound Interrupt Mask Register.
4790144411Sscottl**  -----------------------------------------------------------------
4791144411Sscottl**  Bit       Default                       Description
4792144411Sscottl**  31:00    0000 0000H                     Inbound Message - This is a 32-bit message written by an external PCI agent.
4793144411Sscottl**                                                            When written, an interrupt to the Intel XScale core may be generated.
4794144411Sscottl**************************************************************************
4795144411Sscottl*/
4796144411Sscottl#define     ARCMSR_MU_INBOUND_MESSAGE_REG0		          0x10    /*dword 0x13,0x12,0x11,0x10*/
4797144411Sscottl#define     ARCMSR_MU_INBOUND_MESSAGE_REG1		          0x14    /*dword 0x17,0x16,0x15,0x14*/
4798144411Sscottl/*
4799144411Sscottl**************************************************************************
4800144411Sscottl**  Outbound Message Register - OMRx
4801144411Sscottl**  --------------------------------
4802144411Sscottl**  There are two Outbound Message Registers: OMR0 and OMR1. When the OMR register is
4803144411Sscottl**  written, a PCI interrupt may be generated. The interrupt is recorded in the Outbound Interrupt
4804144411Sscottl**  Status Register and may be masked by the Outbound Message Interrupt Mask bit in the Outbound
4805144411Sscottl**  Interrupt Mask Register.
4806165155Sscottl**
4807144411Sscottl**  Bit       Default                       Description
4808144411Sscottl**  31:00    00000000H                      Outbound Message - This is 32-bit message written by the Intel  XScale  core. When written, an
4809144411Sscottl**                                                             interrupt may be generated on the PCI Interrupt pin determined by the ATU Interrupt Pin Register.
4810144411Sscottl**************************************************************************
4811144411Sscottl*/
4812144411Sscottl#define     ARCMSR_MU_OUTBOUND_MESSAGE_REG0		          0x18    /*dword 0x1B,0x1A,0x19,0x18*/
4813144411Sscottl#define     ARCMSR_MU_OUTBOUND_MESSAGE_REG1		          0x1C    /*dword 0x1F,0x1E,0x1D,0x1C*/
4814144411Sscottl/*
4815144411Sscottl**************************************************************************
4816144411Sscottl**        Doorbell Registers
4817144411Sscottl**  ==============================
4818144411Sscottl**  There are two Doorbell Registers:
4819144411Sscottl**                                  Inbound Doorbell Register
4820144411Sscottl**                                  Outbound Doorbell Register
4821144411Sscottl**  The Inbound Doorbell Register allows external PCI agents to generate interrupts to the Intel R XScale core.
4822144411Sscottl**  The Outbound Doorbell Register allows the Intel R XScale core to generate a PCI interrupt.
4823144411Sscottl**  Both Doorbell Registers may generate interrupts whenever a bit in the register is set.
4824165155Sscottl**
4825144411Sscottl**  Inbound Doorbells:
4826144411Sscottl**  ------------------
4827144411Sscottl**  . When the Inbound Doorbell Register is written by an external PCI agent, an interrupt may be generated to the Intel R XScale  core.
4828144411Sscottl**    An interrupt is generated when any of the bits in the doorbell register is written to a value of 1.
4829144411Sscottl**    Writing a value of 0 to any bit does not change the value of that bit and does not cause an interrupt to be generated.
4830144411Sscottl**  . Once a bit is set in the Inbound Doorbell Register, it cannot be cleared by any external PCI agent.
4831144411Sscottl**    The interrupt is recorded in the Inbound Interrupt Status Register.
4832144411Sscottl**  . The interrupt may be masked by the Inbound Doorbell Interrupt mask bit in the Inbound Interrupt Mask Register.
4833144411Sscottl**    When the mask bit is set for a particular bit, no interrupt is generated for that bit.
4834165155Sscottl**    The Inbound Interrupt Mask Register affects only the generation of the normal messaging unit interrupt
4835165155Sscottl**    and not the values written to the Inbound Doorbell Register.
4836144411Sscottl**    One bit in the Inbound Doorbell Register is reserved for an Error Doorbell interrupt.
4837144411Sscottl**  . The interrupt is cleared when the Intel R XScale core writes a value of 1 to the bits in the Inbound Doorbell Register that are set.
4838144411Sscottl**    Writing a value of 0 to any bit does not change the value of that bit and does not clear the interrupt.
4839144411Sscottl**  ------------------------------------------------------------------------
4840144411Sscottl**  Inbound Doorbell Register - IDR
4841144411Sscottl**
4842144411Sscottl**  . The Inbound Doorbell Register (IDR) is used to generate interrupts to the Intel XScale core.
4843144411Sscottl**  . Bit 31 is reserved for generating an Error Doorbell interrupt.
4844144411Sscottl**    When bit 31 is set, an Error interrupt may be generated to the Intel XScale core.
4845144411Sscottl**    All other bits, when set, cause the Normal Messaging Unit interrupt line of the Intel XScale core to be asserted,
4846144411Sscottl**    when the interrupt is not masked by the Inbound Doorbell Interrupt Mask bit in the Inbound Interrupt Mask Register.
4847144411Sscottl**    The bits in the IDR register can only be set by an external PCI agent and can only be cleared by the Intel XScale  core.
4848144411Sscottl**  ------------------------------------------------------------------------
4849144411Sscottl**  Bit       Default                       Description
4850144411Sscottl**  31          0 2                         Error Interrupt - Generate an Error Interrupt to the Intel XScale core.
4851144411Sscottl**  30:00    00000000H                      Normal Interrupt - When any bit is set, generate a Normal interrupt to the Intel XScale core.
4852144411Sscottl**                                                             When all bits are clear, do not generate a Normal Interrupt.
4853144411Sscottl**************************************************************************
4854144411Sscottl*/
4855144411Sscottl#define     ARCMSR_MU_INBOUND_DOORBELL_REG		          0x20    /*dword 0x23,0x22,0x21,0x20*/
4856144411Sscottl/*
4857144411Sscottl**************************************************************************
4858144411Sscottl**  Inbound Interrupt Status Register - IISR
4859144411Sscottl**
4860144411Sscottl**  . The Inbound Interrupt Status Register (IISR) contains hardware interrupt status.
4861144411Sscottl**    It records the status of Intel XScale core interrupts generated by the Message Registers, Doorbell Registers, and the Circular Queues.
4862144411Sscottl**    All interrupts are routed to the Normal Messaging Unit interrupt input of the Intel XScale core,
4863144411Sscottl**    except for the Error Doorbell Interrupt and the Outbound Free Queue Full interrupt;
4864144411Sscottl**    these two are routed to the Messaging Unit Error interrupt input.
4865165155Sscottl**    The generation of interrupts recorded in the Inbound Interrupt Status Register
4866165155Sscottl**    may be masked by setting the corresponding bit in the Inbound Interrupt Mask Register.
4867144411Sscottl**    Some of the bits in this register are Read Only.
4868144411Sscottl**    For those bits, the interrupt must be cleared through another register.
4869144411Sscottl**
4870144411Sscottl**  Bit       Default                       Description
4871144411Sscottl**  31:07    0000000H 0 2                   Reserved
4872165155Sscottl**  06          0 2              Index Register Interrupt - This bit is set by the MU hardware
4873165155Sscottl**                               when an Index Register has been written after a PCI transaction.
4874165155Sscottl**  05          0 2              Outbound Free Queue Full Interrupt - This bit is set
4875165155Sscottl**                               when the Outbound Free Head Pointer becomes equal to the Tail Pointer and the queue is full.
4876165155Sscottl**                               An Error interrupt is generated for this condition.
4877165155Sscottl**  04          0 2              Inbound Post Queue Interrupt - This bit is set by the MU hardware when the Inbound Post Queue has been written.
4878165155Sscottl**                               Once cleared, an interrupt does NOT be generated
4879165155Sscottl**                               when the head and tail pointers remain unequal (i.e. queue status is Not Empty).
4880165155Sscottl**                               Therefore, when software leaves any unprocessed messages in the post queue when the interrupt is cleared,
4881165155Sscottl**                               software must retain the information that the Inbound Post queue status is not empty.
4882165155Sscottl**          NOTE: This interrupt is provided with dedicated support in the 80331 Interrupt Controller.
4883165155Sscottl**  03          0 2              Error Doorbell Interrupt - This bit is set when the Error Interrupt of the Inbound Doorbell Register is set.
4884165155Sscottl**                               To clear this bit (and the interrupt), the Error Interrupt bit of the Inbound Doorbell Register must be clear.
4885165155Sscottl**  02          0 2              Inbound Doorbell Interrupt - This bit is set when at least one
4886165155Sscottl**                               Normal Interrupt bit in the Inbound Doorbell Register is set.
4887165155Sscottl**                               To clear this bit (and the interrupt), the Normal Interrupt bits in the Inbound Doorbell Register must all be clear.
4888165155Sscottl**  01          0 2              Inbound Message 1 Interrupt - This bit is set by the MU hardware when the Inbound Message 1 Register has been written.
4889165155Sscottl**  00          0 2              Inbound Message 0 Interrupt - This bit is set by the MU hardware when the Inbound Message 0 Register has been written.
4890144411Sscottl**************************************************************************
4891144411Sscottl*/
4892144411Sscottl#define     ARCMSR_MU_INBOUND_INTERRUPT_STATUS_REG	      0x24    /*dword 0x27,0x26,0x25,0x24*/
4893144411Sscottl#define     ARCMSR_MU_INBOUND_INDEX_INT                      0x40
4894144411Sscottl#define     ARCMSR_MU_INBOUND_QUEUEFULL_INT                  0x20
4895144411Sscottl#define     ARCMSR_MU_INBOUND_POSTQUEUE_INT                  0x10
4896144411Sscottl#define     ARCMSR_MU_INBOUND_ERROR_DOORBELL_INT             0x08
4897144411Sscottl#define     ARCMSR_MU_INBOUND_DOORBELL_INT                   0x04
4898144411Sscottl#define     ARCMSR_MU_INBOUND_MESSAGE1_INT                   0x02
4899144411Sscottl#define     ARCMSR_MU_INBOUND_MESSAGE0_INT                   0x01
4900144411Sscottl/*
4901144411Sscottl**************************************************************************
4902144411Sscottl**  Inbound Interrupt Mask Register - IIMR
4903144411Sscottl**
4904144411Sscottl**  . The Inbound Interrupt Mask Register (IIMR) provides the ability to mask Intel XScale core interrupts generated by the Messaging Unit.
4905144411Sscottl**    Each bit in the Mask register corresponds to an interrupt bit in the Inbound Interrupt Status Register.
4906144411Sscottl**    Setting or clearing bits in this register does not affect the Inbound Interrupt Status Register.
4907144411Sscottl**    They only affect the generation of the Intel XScale core interrupt.
4908144411Sscottl**  ------------------------------------------------------------------------
4909144411Sscottl**  Bit       Default                       Description
4910144411Sscottl**  31:07     000000H 0 2                   Reserved
4911165155Sscottl**  06        0 2               Index Register Interrupt Mask - When set, this bit masks the interrupt generated by the MU hardware
4912165155Sscottl**				when an Index Register has been written after a PCI transaction.
4913165155Sscottl**  05        0 2               Outbound Free Queue Full Interrupt Mask - When set, this bit masks the Error interrupt generated
4914165155Sscottl**				when the Outbound Free Head Pointer becomes equal to the Tail Pointer and the queue is full.
4915165155Sscottl**  04        0 2               Inbound Post Queue Interrupt Mask - When set, this bit masks the interrupt generated
4916165155Sscottl**				by the MU hardware when the Inbound Post Queue has been written.
4917165155Sscottl**  03        0 2               Error Doorbell Interrupt Mask - When set, this bit masks the Error Interrupt
4918165155Sscottl**				when the Error Interrupt bit of the Inbound Doorbell Register is set.
4919165155Sscottl**  02        0 2               Inbound Doorbell Interrupt Mask - When set, this bit masks the interrupt generated
4920165155Sscottl**				when at least one Normal Interrupt bit in the Inbound Doorbell Register is set.
4921165155Sscottl**  01        0 2               Inbound Message 1 Interrupt Mask - When set, this bit masks the Inbound Message 1
4922165155Sscottl**				Interrupt generated by a write to the Inbound Message 1 Register.
4923165155Sscottl**  00        0 2               Inbound Message 0 Interrupt Mask - When set,
4924165155Sscottl**                              this bit masks the Inbound Message 0 Interrupt generated by a write to the Inbound Message 0 Register.
4925144411Sscottl**************************************************************************
4926144411Sscottl*/
4927144411Sscottl#define     ARCMSR_MU_INBOUND_INTERRUPT_MASK_REG	      0x28    /*dword 0x2B,0x2A,0x29,0x28*/
4928144411Sscottl#define     ARCMSR_MU_INBOUND_INDEX_INTMASKENABLE               0x40
4929144411Sscottl#define     ARCMSR_MU_INBOUND_QUEUEFULL_INTMASKENABLE           0x20
4930144411Sscottl#define     ARCMSR_MU_INBOUND_POSTQUEUE_INTMASKENABLE           0x10
4931144411Sscottl#define     ARCMSR_MU_INBOUND_DOORBELL_ERROR_INTMASKENABLE      0x08
4932144411Sscottl#define     ARCMSR_MU_INBOUND_DOORBELL_INTMASKENABLE            0x04
4933144411Sscottl#define     ARCMSR_MU_INBOUND_MESSAGE1_INTMASKENABLE            0x02
4934144411Sscottl#define     ARCMSR_MU_INBOUND_MESSAGE0_INTMASKENABLE            0x01
4935144411Sscottl/*
4936144411Sscottl**************************************************************************
4937144411Sscottl**  Outbound Doorbell Register - ODR
4938144411Sscottl**
4939144411Sscottl**  The Outbound Doorbell Register (ODR) allows software interrupt generation. It allows the Intel
4940144411Sscottl**  XScale  core to generate PCI interrupts to the host processor by writing to this register. The
4941144411Sscottl**  generation of PCI interrupts through the Outbound Doorbell Register may be masked by setting the
4942144411Sscottl**  Outbound Doorbell Interrupt Mask bit in the Outbound Interrupt Mask Register.
4943144411Sscottl**  The Software Interrupt bits in this register can only be set by the Intel  XScale  core and can only
4944144411Sscottl**  be cleared by an external PCI agent.
4945144411Sscottl**  ----------------------------------------------------------------------
4946144411Sscottl**  Bit       Default                       Description
4947144411Sscottl**  31          0 2                          Reserved
4948144411Sscottl**  30          0 2                          Reserved.
4949144411Sscottl**  29          0 2                          Reserved
4950165155Sscottl**  28       0000 0000H                      PCI Interrupt - When set, this bit causes the P_INTC# interrupt output
4951165155Sscottl**                                                           (P_INTA# with BRG_EN and ARB_EN straps low)
4952144411Sscottl**                                                           signal to be asserted or a Message-signaled Interrupt is generated (when enabled).
4953165155Sscottl**                                                           When this bit is cleared, the P_INTC# interrupt output
4954165155Sscottl**                                                           (P_INTA# with BRG_EN and ARB_EN straps low)
4955144411Sscottl**                                                           signal is deasserted.
4956165155Sscottl**  27:00     000 0000H                      Software Interrupts - When any bit is set the P_INTC# interrupt output
4957165155Sscottl**                                           (P_INTA# with BRG_EN and ARB_EN straps low)
4958165155Sscottl**                                           signal is asserted or a Message-signaled Interrupt is generated (when enabled).
4959165155Sscottl**                                           When all bits are cleared, the P_INTC# interrupt output (P_INTA# with BRG_EN and ARB_EN straps low)
4960165155Sscottl**                                           signal is deasserted.
4961144411Sscottl**************************************************************************
4962144411Sscottl*/
4963144411Sscottl#define     ARCMSR_MU_OUTBOUND_DOORBELL_REG		          0x2C    /*dword 0x2F,0x2E,0x2D,0x2C*/
4964144411Sscottl/*
4965144411Sscottl**************************************************************************
4966144411Sscottl**  Outbound Interrupt Status Register - OISR
4967144411Sscottl**
4968144411Sscottl**  The Outbound Interrupt Status Register (OISR) contains hardware interrupt status. It records the
4969144411Sscottl**  status of PCI interrupts generated by the Message Registers, Doorbell Registers, and the Circular
4970144411Sscottl**  Queues. The generation of PCI interrupts recorded in the Outbound Interrupt Status Register may
4971144411Sscottl**  be masked by setting the corresponding bit in the Outbound Interrupt Mask Register. Some of the
4972144411Sscottl**  bits in this register are Read Only. For those bits, the interrupt must be cleared through another
4973144411Sscottl**  register.
4974144411Sscottl**  ----------------------------------------------------------------------
4975144411Sscottl**  Bit       Default                       Description
4976144411Sscottl**  31:05     000000H 000 2                 Reserved
4977144411Sscottl**  04        0 2                           PCI Interrupt - This bit is set when the PCI Interrupt bit (bit 28) is set in the Outbound Doorbell Register.
4978144411Sscottl**                                                          To clear this bit (and the interrupt), the PCI Interrupt bit must be cleared.
4979144411Sscottl**  03        0 2                           Outbound Post Queue Interrupt - This bit is set when data in the prefetch buffer is valid. This bit is
4980144411Sscottl**                                                          cleared when any prefetch data has been read from the Outbound Queue Port.
4981144411Sscottl**  02        0 2                           Outbound Doorbell Interrupt - This bit is set when at least one Software Interrupt bit in the Outbound
4982165155Sscottl**                                          Doorbell Register is set. To clear this bit (and the interrupt), the Software Interrupt bits in the Outbound
4983165155Sscottl**                                          Doorbell Register must all be clear.
4984144411Sscottl**  01        0 2                           Outbound Message 1 Interrupt - This bit is set by the MU when the Outbound Message 1 Register is
4985144411Sscottl**                                                          written. Clearing this bit clears the interrupt.
4986144411Sscottl**  00        0 2                           Outbound Message 0 Interrupt - This bit is set by the MU when the Outbound Message 0 Register is
4987144411Sscottl**                                                          written. Clearing this bit clears the interrupt.
4988144411Sscottl**************************************************************************
4989144411Sscottl*/
4990144411Sscottl#define     ARCMSR_MU_OUTBOUND_INTERRUPT_STATUS_REG	      0x30    /*dword 0x33,0x32,0x31,0x30*/
4991144411Sscottl#define     ARCMSR_MU_OUTBOUND_PCI_INT       	              0x10
4992144411Sscottl#define     ARCMSR_MU_OUTBOUND_POSTQUEUE_INT    	          0x08
4993144411Sscottl#define     ARCMSR_MU_OUTBOUND_DOORBELL_INT 		          0x04
4994144411Sscottl#define     ARCMSR_MU_OUTBOUND_MESSAGE1_INT 		          0x02
4995144411Sscottl#define     ARCMSR_MU_OUTBOUND_MESSAGE0_INT 		          0x01
4996144411Sscottl/*
4997144411Sscottl**************************************************************************
4998144411Sscottl**  Outbound Interrupt Mask Register - OIMR
4999144411Sscottl**  The Outbound Interrupt Mask Register (OIMR) provides the ability to mask outbound PCI
5000144411Sscottl**  interrupts generated by the Messaging Unit. Each bit in the mask register corresponds to a
5001144411Sscottl**  hardware interrupt bit in the Outbound Interrupt Status Register. When the bit is set, the PCI
5002144411Sscottl**  interrupt is not generated. When the bit is clear, the interrupt is allowed to be generated.
5003144411Sscottl**  Setting or clearing bits in this register does not affect the Outbound Interrupt Status Register. They
5004144411Sscottl**  only affect the generation of the PCI interrupt.
5005144411Sscottl**  ----------------------------------------------------------------------
5006144411Sscottl**  Bit       Default                       Description
5007144411Sscottl**  31:05     000000H                       Reserved
5008144411Sscottl**  04          0 2                         PCI Interrupt Mask - When set, this bit masks the interrupt generation when the PCI Interrupt bit (bit 28)
5009144411Sscottl**                                                               in the Outbound Doorbell Register is set.
5010144411Sscottl**  03          0 2                         Outbound Post Queue Interrupt Mask - When set, this bit masks the interrupt generated when data in
5011144411Sscottl**                                                               the prefetch buffer is valid.
5012144411Sscottl**  02          0 2                         Outbound Doorbell Interrupt Mask - When set, this bit masks the interrupt generated by the Outbound
5013144411Sscottl**                                                               Doorbell Register.
5014144411Sscottl**  01          0 2                         Outbound Message 1 Interrupt Mask - When set, this bit masks the Outbound Message 1 Interrupt
5015144411Sscottl**                                                               generated by a write to the Outbound Message 1 Register.
5016144411Sscottl**  00          0 2                         Outbound Message 0 Interrupt Mask- When set, this bit masks the Outbound Message 0 Interrupt
5017144411Sscottl**                                                               generated by a write to the Outbound Message 0 Register.
5018144411Sscottl**************************************************************************
5019144411Sscottl*/
5020144411Sscottl#define     ARCMSR_MU_OUTBOUND_INTERRUPT_MASK_REG		  0x34    /*dword 0x37,0x36,0x35,0x34*/
5021144411Sscottl#define     ARCMSR_MU_OUTBOUND_PCI_INTMASKENABLE   	          0x10
5022144411Sscottl#define     ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE	      0x08
5023144411Sscottl#define     ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE		  0x04
5024144411Sscottl#define     ARCMSR_MU_OUTBOUND_MESSAGE1_INTMASKENABLE		  0x02
5025144411Sscottl#define     ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE		  0x01
5026144411Sscottl#define     ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE		      0x1F
5027144411Sscottl/*
5028144411Sscottl**************************************************************************
5029144411Sscottl**
5030144411Sscottl**************************************************************************
5031144411Sscottl*/
5032144411Sscottl#define     ARCMSR_MU_INBOUND_QUEUE_PORT_REG        	  0x40    /*dword 0x43,0x42,0x41,0x40*/
5033144411Sscottl#define     ARCMSR_MU_OUTBOUND_QUEUE_PORT_REG  	          0x44    /*dword 0x47,0x46,0x45,0x44*/
5034144411Sscottl/*
5035144411Sscottl**************************************************************************
5036144411Sscottl**                          Circular Queues
5037144411Sscottl**  ======================================================================
5038144411Sscottl**  The MU implements four circular queues. There are 2 inbound queues and 2 outbound queues. In
5039144411Sscottl**  this case, inbound and outbound refer to the direction of the flow of posted messages.
5040144411Sscottl**  Inbound messages are either:
5041144411Sscottl**  						�E posted messages by other processors for the Intel XScale core to process or
5042144411Sscottl**  						�E free (or empty) messages that can be reused by other processors.
5043144411Sscottl**  Outbound messages are either:
5044144411Sscottl** 							�E posted messages by the Intel XScale core for other processors to process or
5045144411Sscottl** 							�E free (or empty) messages that can be reused by the Intel XScale core.
5046144411Sscottl**  Therefore, free inbound messages flow away from the 80331 and free outbound messages flow toward the 80331.
5047144411Sscottl**  The four Circular Queues are used to pass messages in the following manner.
5048144411Sscottl**  	. The two inbound queues are used to handle inbound messages
5049144411Sscottl**  	  and the two outbound queues are used to handle  outbound messages.
5050144411Sscottl**  	. One of the inbound queues is designated the Free queue and it contains inbound free messages.
5051144411Sscottl**  	  The other inbound queue is designated the Post queue and it contains inbound posted messages.
5052144411Sscottl**  	  Similarly, one of the outbound queues is designated the Free queue and the other outbound queue is designated the Post queue.
5053165155Sscottl**
5054144411Sscottl**  =============================================================================================================
5055144411Sscottl**  Circular Queue Summary
5056144411Sscottl**   _____________________________________________________________________________________________________________
5057144411Sscottl**  |    Queue Name        |                     Purpose                                |  Action on PCI Interface|
5058144411Sscottl**  |______________________|____________________________________________________________|_________________________|
5059144411Sscottl**  |Inbound Post  Queue   |    Queue for inbound messages from other processors        |          Written        |
5060144411Sscottl**  |                      |     waiting to be processed by the 80331                   |                         |
5061144411Sscottl**  |Inbound Free  Queue   |    Queue for empty inbound messages from the 80331         |          Read           |
5062144411Sscottl**  |                      |    available for use by other processors                   |                         |
5063144411Sscottl**  |Outbound Post Queue   |    Queue for outbound messages from the 80331              |          Read           |
5064144411Sscottl**  |                      |    that are being posted to the other processors           |                         |
5065144411Sscottl**  |Outbound Free Queue   |    Queue for empty outbound messages from other processors |          Written        |
5066144411Sscottl**  |                      |    available for use by the 80331                          |                         |
5067144411Sscottl**  |______________________|____________________________________________________________|_________________________|
5068144411Sscottl**
5069144411Sscottl**  . The two inbound queues allow the host processor to post inbound messages for the 80331 in one
5070144411Sscottl**    queue and to receive free messages returning from the 80331.
5071144411Sscottl**    The host processor posts inbound messages,
5072144411Sscottl**    the Intel XScale core receives the posted message and when it is finished with the message,
5073144411Sscottl**    places it back on the inbound free queue for reuse by the host processor.
5074165155Sscottl**
5075144411Sscottl**  The circular queues are accessed by external PCI agents through two port locations in the PCI
5076144411Sscottl**  address space:
5077144411Sscottl**              Inbound Queue Port
5078144411Sscottl**          and Outbound Queue Port.
5079144411Sscottl**  The Inbound Queue Port is used by external PCI agents to read the Inbound Free Queue and write the Inbound Post Queue.
5080144411Sscottl**  The Outbound Queue Port is used by external PCI agents to read the Outbound Post Queue and write the Outbound Free Queue.
5081144411Sscottl**  Note that a PCI transaction to the inbound or outbound queue ports with null byte enables (P_C/BE[3:0]#=1111 2 )
5082144411Sscottl**  does not cause the MU hardware to increment the queue pointers.
5083144411Sscottl**  This is treated as when the PCI transaction did not occur.
5084144411Sscottl**  The Inbound and Outbound Queue Ports never respond with P_ACK64# on the PCI interface.
5085144411Sscottl**  ======================================================================================
5086144411Sscottl**  Overview of Circular Queue Operation
5087144411Sscottl**  ======================================================================================
5088144411Sscottl**  . The data storage for the circular queues must be provided by the 80331 local memory.
5089144411Sscottl**  . The base address of the circular queues is contained in the Queue Base Address Register.
5090144411Sscottl**    Each entry in the queue is a 32-bit data value.
5091144411Sscottl**  . Each read from or write to the queue may access only one queue entry.
5092144411Sscottl**  . Multi-DWORD accesses to the circular queues are not allowed.
5093144411Sscottl**    Sub-DWORD accesses are promoted to DWORD accesses.
5094144411Sscottl**  . Each circular queue has a head pointer and a tail pointer.
5095144411Sscottl**    The pointers are offsets from the Queue Base Address.
5096144411Sscottl**  . Writes to a queue occur at the head of the queue and reads occur from the tail.
5097144411Sscottl**    The head and tail pointers are incremented by either the Intel XScale core or the Messaging Unit hardware.
5098144411Sscottl**    Which unit maintains the pointer is determined by the writer of the queue.
5099144411Sscottl**    More details about the pointers are given in the queue descriptions below.
5100144411Sscottl**    The pointers are incremented after the queue access.
5101144411Sscottl**    Both pointers wrap around to the first address of the circular queue when they reach the circular queue size.
5102165155Sscottl**
5103144411Sscottl**  Messaging Unit...
5104144411Sscottl**
5105144411Sscottl**  The Messaging Unit generates an interrupt to the Intel XScale core or generate a PCI interrupt under certain conditions.
5106144411Sscottl**  . In general, when a Post queue is written, an interrupt is generated to notify the receiver that a message was posted.
5107144411Sscottl**    The size of each circular queue can range from 4K entries (16 Kbytes) to 64K entries (256 Kbytes).
5108144411Sscottl**  . All four queues must be the same size and may be contiguous.
5109144411Sscottl**    Therefore, the total amount of local memory needed by the circular queues ranges from 64 Kbytes to 1 Mbytes.
5110144411Sscottl**    The Queue size is determined by the Queue Size field in the MU Configuration Register.
5111144411Sscottl**  . There is one base address for all four queues.
5112144411Sscottl**    It is stored in the Queue Base Address Register (QBAR).
5113144411Sscottl**    The starting addresses of each queue is based on the Queue Base Address and the Queue Size field.
5114144411Sscottl**    here shows an example of how the circular queues should be set up based on the
5115144411Sscottl**    Intelligent I/O (I 2 O) Architecture Specification.
5116144411Sscottl**    Other ordering of the circular queues is possible.
5117165155Sscottl**
5118144411Sscottl**  				Queue                           Starting Address
5119144411Sscottl**  				Inbound Free Queue              QBAR
5120144411Sscottl**  				Inbound Post Queue              QBAR + Queue Size
5121144411Sscottl**  				Outbound Post Queue             QBAR + 2 * Queue Size
5122144411Sscottl**  				Outbound Free Queue             QBAR + 3 * Queue Size
5123144411Sscottl**  ===================================================================================
5124144411Sscottl**  Inbound Post Queue
5125144411Sscottl**  ------------------
5126144411Sscottl**  The Inbound Post Queue holds posted messages placed there by other processors for the Intel XScale core to process.
5127144411Sscottl**  This queue is read from the queue tail by the Intel XScale core. It is written to the queue head by external PCI agents.
5128144411Sscottl**  The tail pointer is maintained by the Intel XScale core. The head pointer is maintained by the MU hardware.
5129165155Sscottl**  For a PCI write transaction that accesses the Inbound Queue Port,
5130165155Sscottl**  the MU writes the data to the local memory location address in the Inbound Post Head Pointer Register.
5131144411Sscottl**  When the data written to the Inbound Queue Port is written to local memory, the MU hardware increments the Inbound Post Head Pointer Register.
5132144411Sscottl**  An Intel XScale core interrupt may be generated when the Inbound Post Queue is written.
5133144411Sscottl**  The Inbound Post Queue Interrupt bit in the Inbound Interrupt Status Register indicates the interrupt status.
5134144411Sscottl**  The interrupt is cleared when the Inbound Post Queue Interrupt bit is cleared.
5135144411Sscottl**  The interrupt can be masked by the Inbound Interrupt Mask Register.
5136165155Sscottl**  Software must be aware of the state of the Inbound Post Queue Interrupt Mask bit to guarantee
5137165155Sscottl**  that the full condition is recognized by the core processor.
5138165155Sscottl**  In addition, to guarantee that the queue does not get overwritten,
5139165155Sscottl**  software must process messages from the tail of the queue before incrementing the tail pointer and clearing this interrupt.
5140144411Sscottl**  Once cleared, an interrupt is NOT generated when the head and tail pointers remain unequal (i.e. queue status is Not Empty).
5141144411Sscottl**  Only a new message posting the in the inbound queue generates a new interrupt.
5142165155Sscottl**  Therefore, when software leaves any unprocessed messages in the post queue when the interrupt is cleared,
5143165155Sscottl**  software must retain the information that the Inbound Post queue status.
5144165155Sscottl**  From the time that the PCI write transaction is received until the data is written
5145165155Sscottl**  in local memory and the Inbound Post Head Pointer Register is incremented,
5146165155Sscottl**  any PCI transaction that attempts to access the Inbound Post Queue Port is signalled a Retry.
5147165155Sscottl**  The Intel XScale core may read messages from the Inbound Post Queue
5148165155Sscottl**  by reading the data from the local memory location pointed to by the Inbound Post Tail Pointer Register.
5149144411Sscottl**  The Intel XScale core must then increment the Inbound Post Tail Pointer Register.
5150165155Sscottl**  When the Inbound Post Queue is full (head and tail pointers are equal and the head pointer was last updated by hardware),
5151165155Sscottl**  the hardware retries any PCI writes until a slot in the queue becomes available.
5152144411Sscottl**  A slot in the post queue becomes available by the Intel XScale core incrementing the tail pointer.
5153144411Sscottl**  ===================================================================================
5154144411Sscottl**  Inbound Free Queue
5155144411Sscottl**  ------------------
5156144411Sscottl**  The Inbound Free Queue holds free inbound messages placed there by the Intel XScale core for other processors to use.
5157144411Sscottl**  This queue is read from the queue tail by external PCI agents.
5158144411Sscottl**  It is written to the queue head by the Intel XScale core.
5159144411Sscottl**  The tail pointer is maintained by the MU hardware.
5160144411Sscottl**  The head pointer is maintained by the Intel XScale core.
5161144411Sscottl**  For a PCI read transaction that accesses the Inbound Queue Port,
5162144411Sscottl**  the MU attempts to read the data at the local memory address in the Inbound Free Tail Pointer.
5163165155Sscottl**  When the queue is not empty (head and tail pointers are not equal)
5164165155Sscottl**  or full (head and tail pointers are equal but the head pointer was last written by software), the data is returned.
5165165155Sscottl**  When the queue is empty (head and tail pointers are equal and the head pointer was last updated by hardware),
5166165155Sscottl**  the value of -1 (FFFF.FFFFH) is  returned.
5167144411Sscottl**  When the queue was not empty and the MU succeeded in returning the data at the tail,
5168144411Sscottl**  the MU hardware must increment the value in the Inbound Free Tail Pointer Register.
5169144411Sscottl**  To reduce latency for the PCI read access, the MU implements a prefetch mechanism to anticipate accesses to the Inbound Free Queue.
5170144411Sscottl**  The MU hardware prefetches the data at the tail of the Inbound Free Queue and load it into an internal prefetch register.
5171144411Sscottl**  When the PCI read access occurs, the data is read directly from the prefetch register.
5172144411Sscottl**  The prefetch mechanism loads a value of -1 (FFFF.FFFFH) into the prefetch register
5173144411Sscottl**  when the head and tail pointers are equal and the queue is empty.
5174144411Sscottl**  In order to update the prefetch register when messages are added to the queue and it becomes non-empty,
5175165155Sscottl**  the prefetch mechanism automatically starts a prefetch when the prefetch register contains FFFF.FFFFH
5176165155Sscottl**  and the Inbound Free Head Pointer Register is written.
5177144411Sscottl**  The Intel XScale core needs to update the Inbound Free Head Pointer Register when it adds messages to the queue.
5178144411Sscottl**  A prefetch must appear atomic from the perspective of the external PCI agent.
5179144411Sscottl**  When a prefetch is started, any PCI transaction that attempts to access the Inbound Free Queue is signalled a Retry until the prefetch is completed.
5180144411Sscottl**  The Intel XScale core may place messages in the Inbound Free Queue by writing the data to the
5181144411Sscottl**  local memory location pointed to by the Inbound Free Head Pointer Register.
5182144411Sscottl**  The processor must then increment the Inbound Free Head Pointer Register.
5183144411Sscottl**  ==================================================================================
5184144411Sscottl**  Outbound Post Queue
5185144411Sscottl**  -------------------
5186144411Sscottl**  The Outbound Post Queue holds outbound posted messages placed there by the Intel XScale
5187144411Sscottl**  core for other processors to process. This queue is read from the queue tail by external PCI agents.
5188144411Sscottl**  It is written to the queue head by the Intel XScale  core. The tail pointer is maintained by the
5189144411Sscottl**  MU hardware. The head pointer is maintained by the Intel XScale  core.
5190144411Sscottl**  For a PCI read transaction that accesses the Outbound Queue Port, the MU attempts to read the
5191144411Sscottl**  data at the local memory address in the Outbound Post Tail Pointer Register. When the queue is not
5192144411Sscottl**  empty (head and tail pointers are not equal) or full (head and tail pointers are equal but the head
5193144411Sscottl**  pointer was last written by software), the data is returned. When the queue is empty (head and tail
5194144411Sscottl**  pointers are equal and the head pointer was last updated by hardware), the value of -1
5195144411Sscottl**  (FFFF.FFFFH) is returned. When the queue was not empty and the MU succeeded in returning the
5196144411Sscottl**  data at the tail, the MU hardware must increment the value in the Outbound Post Tail Pointer
5197144411Sscottl**  Register.
5198144411Sscottl**  To reduce latency for the PCI read access, the MU implements a prefetch mechanism to anticipate
5199144411Sscottl**  accesses to the Outbound Post Queue. The MU hardware prefetches the data at the tail of the
5200144411Sscottl**  Outbound Post Queue and load it into an internal prefetch register. When the PCI read access
5201144411Sscottl**  occurs, the data is read directly from the prefetch register.
5202144411Sscottl**  The prefetch mechanism loads a value of -1 (FFFF.FFFFH) into the prefetch register when the head
5203144411Sscottl**  and tail pointers are equal and the queue is empty. In order to update the prefetch register when
5204144411Sscottl**  messages are added to the queue and it becomes non-empty, the prefetch mechanism automatically
5205144411Sscottl**  starts a prefetch when the prefetch register contains FFFF.FFFFH and the Outbound Post Head
5206144411Sscottl**  Pointer Register is written. The Intel XScale  core needs to update the Outbound Post Head
5207144411Sscottl**  Pointer Register when it adds messages to the queue.
5208144411Sscottl**  A prefetch must appear atomic from the perspective of the external PCI agent. When a prefetch is
5209144411Sscottl**  started, any PCI transaction that attempts to access the Outbound Post Queue is signalled a Retry
5210144411Sscottl**  until the prefetch is completed.
5211144411Sscottl**  A PCI interrupt may be generated when data in the prefetch buffer is valid. When the prefetch
5212144411Sscottl**  queue is clear, no interrupt is generated. The Outbound Post Queue Interrupt bit in the Outbound
5213144411Sscottl**  Interrupt Status Register shall indicate the status of the prefetch buffer data and therefore the
5214144411Sscottl**  interrupt status. The interrupt is cleared when any prefetched data has been read from the Outbound
5215144411Sscottl**  Queue Port. The interrupt can be masked by the Outbound Interrupt Mask Register.
5216144411Sscottl**  The Intel XScale  core may place messages in the Outbound Post Queue by writing the data to
5217144411Sscottl**  the local memory address in the Outbound Post Head Pointer Register. The processor must then
5218144411Sscottl**  increment the Outbound Post Head Pointer Register.
5219144411Sscottl**  ==================================================
5220144411Sscottl**  Outbound Free Queue
5221144411Sscottl**  -----------------------
5222144411Sscottl**  The Outbound Free Queue holds free messages placed there by other processors for the Intel
5223144411Sscottl**  XScale  core to use. This queue is read from the queue tail by the Intel XScale  core. It is
5224144411Sscottl**  written to the queue head by external PCI agents. The tail pointer is maintained by the Intel
5225144411Sscottl**  XScale  core. The head pointer is maintained by the MU hardware.
5226144411Sscottl**  For a PCI write transaction that accesses the Outbound Queue Port, the MU writes the data to the
5227144411Sscottl**  local memory address in the Outbound Free Head Pointer Register. When the data written to the
5228144411Sscottl**  Outbound Queue Port is written to local memory, the MU hardware increments the Outbound Free
5229144411Sscottl**  Head Pointer Register.
5230144411Sscottl**  When the head pointer and the tail pointer become equal and the queue is full, the MU may signal
5231144411Sscottl**  an interrupt to the Intel XScale  core to register the queue full condition. This interrupt is
5232144411Sscottl**  recorded in the Inbound Interrupt Status Register. The interrupt is cleared when the Outbound Free
5233144411Sscottl**  Queue Full Interrupt bit is cleared and not by writing to the head or tail pointers. The interrupt can
5234144411Sscottl**  be masked by the Inbound Interrupt Mask Register. Software must be aware of the state of the
5235144411Sscottl**  Outbound Free Queue Interrupt Mask bit to guarantee that the full condition is recognized by the
5236144411Sscottl**  core processor.
5237144411Sscottl**  From the time that a PCI write transaction is received until the data is written in local memory and
5238144411Sscottl**  the Outbound Free Head Pointer Register is incremented, any PCI transaction that attempts to
5239144411Sscottl**  access the Outbound Free Queue Port is signalled a retry.
5240144411Sscottl**  The Intel XScale  core may read messages from the Outbound Free Queue by reading the data
5241144411Sscottl**  from the local memory address in the Outbound Free Tail Pointer Register. The processor must
5242144411Sscottl**  then increment the Outbound Free Tail Pointer Register. When the Outbound Free Queue is full,
5243144411Sscottl**  the hardware must retry any PCI writes until a slot in the queue becomes available.
5244165155Sscottl**
5245144411Sscottl**  ==================================================================================
5246144411Sscottl**  Circular Queue Summary
5247144411Sscottl**  ----------------------
5248144411Sscottl**  ________________________________________________________________________________________________________________________________________________
5249144411Sscottl** | Queue Name  |  PCI Port     |Generate PCI Interrupt |Generate Intel Xscale Core Interrupt|Head Pointer maintained by|Tail Pointer maintained by|
5250144411Sscottl** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________|
5251144411Sscottl** |Inbound Post | Inbound Queue |                       |                                    |                          |                          |
5252144411Sscottl** |    Queue    |     Port      |          NO           |      Yes, when queue is written    |         MU hardware      |     Intel XScale         |
5253144411Sscottl** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________|
5254144411Sscottl** |Inbound Free | Inbound Queue |                       |                                    |                          |                          |
5255144411Sscottl** |    Queue    |     Port      |          NO           |      NO                            |        Intel XScale      |      MU hardware         |
5256144411Sscottl** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________|
5257144411Sscottl** ==================================================================================
5258144411Sscottl**  Circular Queue Status Summary
5259144411Sscottl**  ----------------------
5260144411Sscottl**  ____________________________________________________________________________________________________
5261144411Sscottl** |     Queue Name      |  Queue Status  | Head & Tail Pointer |         Last Pointer Update           |
5262144411Sscottl** |_____________________|________________|_____________________|_______________________________________|
5263144411Sscottl** | Inbound Post Queue  |      Empty     |       Equal         | Tail pointer last updated by software |
5264144411Sscottl** |_____________________|________________|_____________________|_______________________________________|
5265144411Sscottl** | Inbound Free Queue  |      Empty     |       Equal         | Head pointer last updated by hardware |
5266144411Sscottl** |_____________________|________________|_____________________|_______________________________________|
5267144411Sscottl**************************************************************************
5268144411Sscottl*/
5269144411Sscottl
5270144411Sscottl/*
5271144411Sscottl**************************************************************************
5272144411Sscottl**       Index Registers
5273144411Sscottl**  ========================
5274144411Sscottl**  . The Index Registers are a set of 1004 registers that when written by an external PCI agent can generate an interrupt to the Intel XScale core.
5275144411Sscottl**    These registers are for inbound messages only.
5276144411Sscottl**    The interrupt is recorded in the Inbound Interrupt Status Register.
5277144411Sscottl**    The storage for the Index Registers is allocated from the 80331 local memory.
5278144411Sscottl**    PCI write accesses to the Index Registers write the data to local memory.
5279144411Sscottl**    PCI read accesses to the Index Registers read the data from local memory.
5280144411Sscottl**  . The local memory used for the Index Registers ranges from Inbound ATU Translate Value Register + 050H
5281144411Sscottl**                                                           to Inbound ATU Translate Value Register + FFFH.
5282144411Sscottl**  . The address of the first write access is stored in the Index Address Register.
5283144411Sscottl**    This register is written during the earliest write access and provides a means to determine which Index Register was written.
5284165155Sscottl**    Once updated by the MU, the Index Address Register is not updated until the Index Register
5285165155Sscottl**    Interrupt bit in the Inbound Interrupt Status Register is cleared.
5286144411Sscottl**  . When the interrupt is cleared, the Index Address Register is re-enabled and stores the address of the next Index Register write access.
5287165155Sscottl**    Writes by the Intel XScale core to the local memory used by the Index Registers
5288165155Sscottl**    does not cause an interrupt and does not update the Index Address Register.
5289144411Sscottl**  . The index registers can be accessed with Multi-DWORD reads and single QWORD aligned writes.
5290144411Sscottl**************************************************************************
5291144411Sscottl*/
5292144411Sscottl/*
5293144411Sscottl**************************************************************************
5294144411Sscottl**    Messaging Unit Internal Bus Memory Map
5295144411Sscottl**  =======================================
5296144411Sscottl**  Internal Bus Address___Register Description (Name)____________________|_PCI Configuration Space Register Number_
5297144411Sscottl**  FFFF E300H             reserved                                       |
5298144411Sscottl**    ..                     ..                                           |
5299165155Sscottl**  FFFF E30CH             reserved                                       |
5300144411Sscottl**  FFFF E310H             Inbound Message Register 0                     | Available through
5301144411Sscottl**  FFFF E314H             Inbound Message Register 1                     | ATU Inbound Translation Window
5302165155Sscottl**  FFFF E318H             Outbound Message Register 0                    |
5303165155Sscottl**  FFFF E31CH             Outbound Message Register 1                    | or
5304165155Sscottl**  FFFF E320H             Inbound Doorbell Register                      |
5305165155Sscottl**  FFFF E324H             Inbound Interrupt Status Register              | must translate PCI address to
5306144411Sscottl**  FFFF E328H             Inbound Interrupt Mask Register                | the Intel Xscale Core
5307144411Sscottl**  FFFF E32CH             Outbound Doorbell Register                     | Memory-Mapped Address
5308144411Sscottl**  FFFF E330H             Outbound Interrupt Status Register             |
5309144411Sscottl**  FFFF E334H             Outbound Interrupt Mask Register               |
5310144411Sscottl**  ______________________________________________________________________|________________________________________
5311144411Sscottl**  FFFF E338H             reserved                                       |
5312144411Sscottl**  FFFF E33CH             reserved                                       |
5313144411Sscottl**  FFFF E340H             reserved                                       |
5314144411Sscottl**  FFFF E344H             reserved                                       |
5315144411Sscottl**  FFFF E348H             reserved                                       |
5316144411Sscottl**  FFFF E34CH             reserved                                       |
5317144411Sscottl**  FFFF E350H             MU Configuration Register                      |
5318144411Sscottl**  FFFF E354H             Queue Base Address Register                    |
5319144411Sscottl**  FFFF E358H             reserved                                       |
5320165155Sscottl**  FFFF E35CH             reserved                                       | must translate PCI address to
5321165155Sscottl**  FFFF E360H             Inbound Free Head Pointer Register             | the Intel Xscale Core
5322144411Sscottl**  FFFF E364H             Inbound Free Tail Pointer Register             | Memory-Mapped Address
5323144411Sscottl**  FFFF E368H             Inbound Post Head pointer Register             |
5324144411Sscottl**  FFFF E36CH             Inbound Post Tail Pointer Register             |
5325165155Sscottl**  FFFF E370H             Outbound Free Head Pointer Register            |
5326144411Sscottl**  FFFF E374H             Outbound Free Tail Pointer Register            |
5327144411Sscottl**  FFFF E378H             Outbound Post Head pointer Register            |
5328144411Sscottl**  FFFF E37CH             Outbound Post Tail Pointer Register            |
5329144411Sscottl**  FFFF E380H             Index Address Register                         |
5330144411Sscottl**  FFFF E384H             reserved                                       |
5331144411Sscottl**   ..                       ..                                          |
5332144411Sscottl**  FFFF E3FCH             reserved                                       |
5333144411Sscottl**  ______________________________________________________________________|_______________________________________
5334144411Sscottl**************************************************************************
5335144411Sscottl*/
5336144411Sscottl/*
5337144411Sscottl**************************************************************************
5338144411Sscottl**  MU Configuration Register - MUCR  FFFF.E350H
5339144411Sscottl**
5340144411Sscottl**  . The MU Configuration Register (MUCR) contains the Circular Queue Enable bit and the size of one Circular Queue.
5341144411Sscottl**  . The Circular Queue Enable bit enables or disables the Circular Queues.
5342165155Sscottl**    The Circular Queues are disabled at reset to allow the software to initialize the head
5343165155Sscottl**    and tail pointer registers before any PCI accesses to the Queue Ports.
5344144411Sscottl**  . Each Circular Queue may range from 4 K entries (16 Kbytes) to 64 K entries (256 Kbytes) and there are four Circular Queues.
5345144411Sscottl**  ------------------------------------------------------------------------
5346144411Sscottl**  Bit       Default                       Description
5347144411Sscottl**  31:06     000000H 00 2                  Reserved
5348144411Sscottl**  05:01     00001 2                       Circular Queue Size - This field determines the size of each Circular Queue.
5349165155Sscottl**  					All four queues are the same size.
5350165155Sscottl**  					�E 00001 2 - 4K Entries (16 Kbytes)
5351165155Sscottl**  					�E 00010 2 - 8K Entries (32 Kbytes)
5352165155Sscottl**  					�E 00100 2 - 16K Entries (64 Kbytes)
5353165155Sscottl**  					�E 01000 2 - 32K Entries (128 Kbytes)
5354165155Sscottl**  					�E 10000 2 - 64K Entries (256 Kbytes)
5355165155Sscottl**  00        0 2                       Circular Queue Enable - This bit enables or disables the Circular Queues. When clear the Circular
5356165155Sscottl**  					Queues are disabled, however the MU accepts PCI accesses to the Circular Queue Ports but ignores
5357165155Sscottl** 					the data for Writes and return FFFF.FFFFH for Reads. Interrupts are not generated to the core when
5358165155Sscottl** 					disabled. When set, the Circular Queues are fully enabled.
5359144411Sscottl**************************************************************************
5360144411Sscottl*/
5361144411Sscottl#define     ARCMSR_MU_CONFIGURATION_REG  	          0xFFFFE350
5362144411Sscottl#define     ARCMSR_MU_CIRCULAR_QUEUE_SIZE64K  	          0x0020
5363144411Sscottl#define     ARCMSR_MU_CIRCULAR_QUEUE_SIZE32K  	          0x0010
5364144411Sscottl#define     ARCMSR_MU_CIRCULAR_QUEUE_SIZE16K  	          0x0008
5365144411Sscottl#define     ARCMSR_MU_CIRCULAR_QUEUE_SIZE8K  	          0x0004
5366144411Sscottl#define     ARCMSR_MU_CIRCULAR_QUEUE_SIZE4K  	          0x0002
5367144411Sscottl#define     ARCMSR_MU_CIRCULAR_QUEUE_ENABLE  	          0x0001        /*0:disable 1:enable*/
5368144411Sscottl/*
5369144411Sscottl**************************************************************************
5370144411Sscottl**  Queue Base Address Register - QBAR
5371144411Sscottl**
5372144411Sscottl**  . The Queue Base Address Register (QBAR) contains the local memory address of the Circular Queues.
5373144411Sscottl**    The base address is required to be located on a 1 Mbyte address boundary.
5374144411Sscottl**  . All Circular Queue head and tail pointers are based on the QBAR.
5375144411Sscottl**    When the head and tail pointer registers are read, the Queue Base Address is returned in the upper 12 bits.
5376144411Sscottl**    Writing to the upper 12 bits of the head and tail pointer registers does not affect the Queue Base Address or Queue Base Address Register.
5377144411Sscottl**  Warning:
5378144411Sscottl**         The QBAR must designate a range allocated to the 80331 DDR SDRAM interface
5379144411Sscottl**  ------------------------------------------------------------------------
5380144411Sscottl**  Bit       Default                       Description
5381144411Sscottl**  31:20     000H                          Queue Base Address - Local memory address of the circular queues.
5382144411Sscottl**  19:00     00000H                        Reserved
5383144411Sscottl**************************************************************************
5384144411Sscottl*/
5385144411Sscottl#define     ARCMSR_MU_QUEUE_BASE_ADDRESS_REG  	      0xFFFFE354
5386144411Sscottl/*
5387144411Sscottl**************************************************************************
5388144411Sscottl**  Inbound Free Head Pointer Register - IFHPR
5389144411Sscottl**
5390165155Sscottl**  . The Inbound Free Head Pointer Register (IFHPR) contains the local memory offset from
5391165155Sscottl**    the Queue Base Address of the head pointer for the Inbound Free Queue.
5392144411Sscottl**    The Head Pointer must be aligned on a DWORD address boundary.
5393144411Sscottl**    When read, the Queue Base Address is provided in the upper 12 bits of the register.
5394144411Sscottl**    Writes to the upper 12 bits of the register are ignored.
5395144411Sscottl**    This register is maintained by software.
5396144411Sscottl**  ------------------------------------------------------------------------
5397144411Sscottl**  Bit       Default                       Description
5398144411Sscottl**  31:20     000H                          Queue Base Address - Local memory address of the circular queues.
5399144411Sscottl**  19:02     0000H 00 2                    Inbound Free Head Pointer - Local memory offset of the head pointer for the Inbound Free Queue.
5400144411Sscottl**  01:00     00 2                          Reserved
5401144411Sscottl**************************************************************************
5402144411Sscottl*/
5403144411Sscottl#define     ARCMSR_MU_INBOUND_FREE_HEAD_PTR_REG       0xFFFFE360
5404144411Sscottl/*
5405144411Sscottl**************************************************************************
5406144411Sscottl**  Inbound Free Tail Pointer Register - IFTPR
5407144411Sscottl**
5408144411Sscottl**  . The Inbound Free Tail Pointer Register (IFTPR) contains the local memory offset from the Queue
5409144411Sscottl**    Base Address of the tail pointer for the Inbound Free Queue. The Tail Pointer must be aligned on a
5410144411Sscottl**    DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits
5411144411Sscottl**    of the register. Writes to the upper 12 bits of the register are ignored.
5412144411Sscottl**  ------------------------------------------------------------------------
5413144411Sscottl**  Bit       Default                       Description
5414144411Sscottl**  31:20     000H                          Queue Base Address - Local memory address of the circular queues.
5415144411Sscottl**  19:02     0000H 00 2                    Inbound Free Tail Pointer - Local memory offset of the tail pointer for the Inbound Free Queue.
5416144411Sscottl**  01:00     00 2                          Reserved
5417144411Sscottl**************************************************************************
5418144411Sscottl*/
5419144411Sscottl#define     ARCMSR_MU_INBOUND_FREE_TAIL_PTR_REG       0xFFFFE364
5420144411Sscottl/*
5421144411Sscottl**************************************************************************
5422144411Sscottl**  Inbound Post Head Pointer Register - IPHPR
5423144411Sscottl**
5424144411Sscottl**  . The Inbound Post Head Pointer Register (IPHPR) contains the local memory offset from the Queue
5425144411Sscottl**    Base Address of the head pointer for the Inbound Post Queue. The Head Pointer must be aligned on
5426144411Sscottl**    a DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits
5427144411Sscottl**    of the register. Writes to the upper 12 bits of the register are ignored.
5428144411Sscottl**  ------------------------------------------------------------------------
5429144411Sscottl**  Bit       Default                       Description
5430144411Sscottl**  31:20     000H                          Queue Base Address - Local memory address of the circular queues.
5431144411Sscottl**  19:02     0000H 00 2                    Inbound Post Head Pointer - Local memory offset of the head pointer for the Inbound Post Queue.
5432144411Sscottl**  01:00     00 2                          Reserved
5433144411Sscottl**************************************************************************
5434144411Sscottl*/
5435144411Sscottl#define     ARCMSR_MU_INBOUND_POST_HEAD_PTR_REG       0xFFFFE368
5436144411Sscottl/*
5437144411Sscottl**************************************************************************
5438144411Sscottl**  Inbound Post Tail Pointer Register - IPTPR
5439144411Sscottl**
5440144411Sscottl**  . The Inbound Post Tail Pointer Register (IPTPR) contains the local memory offset from the Queue
5441144411Sscottl**    Base Address of the tail pointer for the Inbound Post Queue. The Tail Pointer must be aligned on a
5442144411Sscottl**    DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits
5443144411Sscottl**    of the register. Writes to the upper 12 bits of the register are ignored.
5444144411Sscottl**  ------------------------------------------------------------------------
5445144411Sscottl**  Bit       Default                       Description
5446144411Sscottl**  31:20     000H                          Queue Base Address - Local memory address of the circular queues.
5447144411Sscottl**  19:02     0000H 00 2                    Inbound Post Tail Pointer - Local memory offset of the tail pointer for the Inbound Post Queue.
5448144411Sscottl**  01:00     00 2                          Reserved
5449144411Sscottl**************************************************************************
5450144411Sscottl*/
5451144411Sscottl#define     ARCMSR_MU_INBOUND_POST_TAIL_PTR_REG       0xFFFFE36C
5452144411Sscottl/*
5453144411Sscottl**************************************************************************
5454144411Sscottl**  Index Address Register - IAR
5455144411Sscottl**
5456144411Sscottl**  . The Index Address Register (IAR) contains the offset of the least recently accessed Index Register.
5457144411Sscottl**    It is written by the MU when the Index Registers are written by a PCI agent.
5458144411Sscottl**    The register is not updated until the Index Interrupt bit in the Inbound Interrupt Status Register is cleared.
5459165155Sscottl**  . The local memory address of the Index Register least recently accessed is computed
5460165155Sscottl**    by adding the Index Address Register to the Inbound ATU Translate Value Register.
5461144411Sscottl**  ------------------------------------------------------------------------
5462144411Sscottl**  Bit       Default                       Description
5463144411Sscottl**  31:12     000000H                       Reserved
5464144411Sscottl**  11:02     00H 00 2                      Index Address - is the local memory offset of the Index Register written (050H to FFCH)
5465144411Sscottl**  01:00     00 2                          Reserved
5466144411Sscottl**************************************************************************
5467144411Sscottl*/
5468144411Sscottl#define     ARCMSR_MU_LOCAL_MEMORY_INDEX_REG  	      0xFFFFE380    /*1004 dwords 0x0050....0x0FFC, 4016 bytes 0x0050...0x0FFF*/
5469144411Sscottl/*
5470144411Sscottl**********************************************************************************************************
5471144411Sscottl**                                RS-232 Interface for Areca Raid Controller
5472144411Sscottl**                    The low level command interface is exclusive with VT100 terminal
5473144411Sscottl**  --------------------------------------------------------------------
5474144411Sscottl**    1. Sequence of command execution
5475144411Sscottl**  --------------------------------------------------------------------
5476144411Sscottl**    	(A) Header : 3 bytes sequence (0x5E, 0x01, 0x61)
5477144411Sscottl**    	(B) Command block : variable length of data including length, command code, data and checksum byte
5478144411Sscottl**    	(C) Return data : variable length of data
5479144411Sscottl**  --------------------------------------------------------------------
5480144411Sscottl**    2. Command block
5481144411Sscottl**  --------------------------------------------------------------------
5482144411Sscottl**    	(A) 1st byte : command block length (low byte)
5483144411Sscottl**    	(B) 2nd byte : command block length (high byte)
5484144411Sscottl**                note ..command block length shouldn't > 2040 bytes, length excludes these two bytes
5485144411Sscottl**    	(C) 3rd byte : command code
5486144411Sscottl**    	(D) 4th and following bytes : variable length data bytes depends on command code
5487144411Sscottl**    	(E) last byte : checksum byte (sum of 1st byte until last data byte)
5488144411Sscottl**  --------------------------------------------------------------------
5489144411Sscottl**    3. Command code and associated data
5490144411Sscottl**  --------------------------------------------------------------------
5491165155Sscottl**    	The following are command code defined in raid controller Command code 0x10--0x1? are used for system level management,
5492165155Sscottl**    	no password checking is needed and should be implemented in separate well controlled utility and not for end user access.
5493144411Sscottl**    	Command code 0x20--0x?? always check the password, password must be entered to enable these command.
5494144411Sscottl**    	enum
5495144411Sscottl**    	{
5496144411Sscottl**    		GUI_SET_SERIAL=0x10,
5497144411Sscottl**    		GUI_SET_VENDOR,
5498144411Sscottl**    		GUI_SET_MODEL,
5499144411Sscottl**    		GUI_IDENTIFY,
5500144411Sscottl**    		GUI_CHECK_PASSWORD,
5501144411Sscottl**    		GUI_LOGOUT,
5502144411Sscottl**    		GUI_HTTP,
5503144411Sscottl**    		GUI_SET_ETHERNET_ADDR,
5504144411Sscottl**    		GUI_SET_LOGO,
5505144411Sscottl**    		GUI_POLL_EVENT,
5506144411Sscottl**    		GUI_GET_EVENT,
5507144411Sscottl**    		GUI_GET_HW_MONITOR,
5508165155Sscottl**
5509144411Sscottl**    		//    GUI_QUICK_CREATE=0x20, (function removed)
5510144411Sscottl**    		GUI_GET_INFO_R=0x20,
5511144411Sscottl**    		GUI_GET_INFO_V,
5512144411Sscottl**    		GUI_GET_INFO_P,
5513144411Sscottl**    		GUI_GET_INFO_S,
5514144411Sscottl**    		GUI_CLEAR_EVENT,
5515165155Sscottl**
5516144411Sscottl**    		GUI_MUTE_BEEPER=0x30,
5517144411Sscottl**    		GUI_BEEPER_SETTING,
5518144411Sscottl**    		GUI_SET_PASSWORD,
5519144411Sscottl**    		GUI_HOST_INTERFACE_MODE,
5520144411Sscottl**    		GUI_REBUILD_PRIORITY,
5521144411Sscottl**    		GUI_MAX_ATA_MODE,
5522144411Sscottl**    		GUI_RESET_CONTROLLER,
5523144411Sscottl**    		GUI_COM_PORT_SETTING,
5524144411Sscottl**    		GUI_NO_OPERATION,
5525144411Sscottl**    		GUI_DHCP_IP,
5526165155Sscottl**
5527144411Sscottl**    		GUI_CREATE_PASS_THROUGH=0x40,
5528144411Sscottl**    		GUI_MODIFY_PASS_THROUGH,
5529144411Sscottl**    		GUI_DELETE_PASS_THROUGH,
5530144411Sscottl**    		GUI_IDENTIFY_DEVICE,
5531165155Sscottl**
5532144411Sscottl**    		GUI_CREATE_RAIDSET=0x50,
5533144411Sscottl**    		GUI_DELETE_RAIDSET,
5534144411Sscottl**    		GUI_EXPAND_RAIDSET,
5535144411Sscottl**    		GUI_ACTIVATE_RAIDSET,
5536144411Sscottl**    		GUI_CREATE_HOT_SPARE,
5537144411Sscottl**    		GUI_DELETE_HOT_SPARE,
5538165155Sscottl**
5539144411Sscottl**    		GUI_CREATE_VOLUME=0x60,
5540144411Sscottl**    		GUI_MODIFY_VOLUME,
5541144411Sscottl**    		GUI_DELETE_VOLUME,
5542144411Sscottl**    		GUI_START_CHECK_VOLUME,
5543144411Sscottl**    		GUI_STOP_CHECK_VOLUME
5544144411Sscottl**    	};
5545165155Sscottl**
5546144411Sscottl**    Command description :
5547165155Sscottl**
5548144411Sscottl**    	GUI_SET_SERIAL : Set the controller serial#
5549144411Sscottl**    		byte 0,1        : length
5550144411Sscottl**    		byte 2          : command code 0x10
5551144411Sscottl**    		byte 3          : password length (should be 0x0f)
5552144411Sscottl**    		byte 4-0x13     : should be "ArEcATecHnoLogY"
5553144411Sscottl**    		byte 0x14--0x23 : Serial number string (must be 16 bytes)
5554144411Sscottl**      GUI_SET_VENDOR : Set vendor string for the controller
5555144411Sscottl**    		byte 0,1        : length
5556144411Sscottl**    		byte 2          : command code 0x11
5557144411Sscottl**    		byte 3          : password length (should be 0x08)
5558144411Sscottl**    		byte 4-0x13     : should be "ArEcAvAr"
5559144411Sscottl**    		byte 0x14--0x3B : vendor string (must be 40 bytes)
5560144411Sscottl**      GUI_SET_MODEL : Set the model name of the controller
5561144411Sscottl**    		byte 0,1        : length
5562144411Sscottl**    		byte 2          : command code 0x12
5563144411Sscottl**    		byte 3          : password length (should be 0x08)
5564144411Sscottl**    		byte 4-0x13     : should be "ArEcAvAr"
5565144411Sscottl**    		byte 0x14--0x1B : model string (must be 8 bytes)
5566144411Sscottl**      GUI_IDENTIFY : Identify device
5567144411Sscottl**    		byte 0,1        : length
5568144411Sscottl**    		byte 2          : command code 0x13
5569144411Sscottl**    		                  return "Areca RAID Subsystem "
5570144411Sscottl**      GUI_CHECK_PASSWORD : Verify password
5571144411Sscottl**    		byte 0,1        : length
5572144411Sscottl**    		byte 2          : command code 0x14
5573144411Sscottl**    		byte 3          : password length
5574144411Sscottl**    		byte 4-0x??     : user password to be checked
5575144411Sscottl**      GUI_LOGOUT : Logout GUI (force password checking on next command)
5576144411Sscottl**    		byte 0,1        : length
5577144411Sscottl**    		byte 2          : command code 0x15
5578144411Sscottl**      GUI_HTTP : HTTP interface (reserved for Http proxy service)(0x16)
5579144411Sscottl**
5580144411Sscottl**      GUI_SET_ETHERNET_ADDR : Set the ethernet MAC address
5581144411Sscottl**    		byte 0,1        : length
5582144411Sscottl**    		byte 2          : command code 0x17
5583144411Sscottl**    		byte 3          : password length (should be 0x08)
5584144411Sscottl**    		byte 4-0x13     : should be "ArEcAvAr"
5585144411Sscottl**    		byte 0x14--0x19 : Ethernet MAC address (must be 6 bytes)
5586144411Sscottl**      GUI_SET_LOGO : Set logo in HTTP
5587144411Sscottl**    		byte 0,1        : length
5588144411Sscottl**    		byte 2          : command code 0x18
5589144411Sscottl**    		byte 3          : Page# (0/1/2/3) (0xff --> clear OEM logo)
5590144411Sscottl**    		byte 4/5/6/7    : 0x55/0xaa/0xa5/0x5a
5591144411Sscottl**    		byte 8          : TITLE.JPG data (each page must be 2000 bytes)
5592144411Sscottl**    		                  note .... page0 1st 2 byte must be actual length of the JPG file
5593144411Sscottl**      GUI_POLL_EVENT : Poll If Event Log Changed
5594144411Sscottl**    		byte 0,1        : length
5595144411Sscottl**    		byte 2          : command code 0x19
5596144411Sscottl**      GUI_GET_EVENT : Read Event
5597144411Sscottl**    		byte 0,1        : length
5598144411Sscottl**    		byte 2          : command code 0x1a
5599144411Sscottl**    		byte 3          : Event Page (0:1st page/1/2/3:last page)
5600144411Sscottl**      GUI_GET_HW_MONITOR : Get HW monitor data
5601144411Sscottl**    		byte 0,1        : length
5602144411Sscottl**    		byte 2 			: command code 0x1b
5603144411Sscottl**    		byte 3 			: # of FANs(example 2)
5604144411Sscottl**    		byte 4 			: # of Voltage sensor(example 3)
5605144411Sscottl**    		byte 5 			: # of temperature sensor(example 2)
5606144411Sscottl**    		byte 6 			: # of power
5607144411Sscottl**    		byte 7/8        : Fan#0 (RPM)
5608144411Sscottl**    		byte 9/10       : Fan#1
5609144411Sscottl**    		byte 11/12 		: Voltage#0 original value in *1000
5610144411Sscottl**    		byte 13/14 		: Voltage#0 value
5611144411Sscottl**    		byte 15/16 		: Voltage#1 org
5612144411Sscottl**    		byte 17/18 		: Voltage#1
5613144411Sscottl**    		byte 19/20 		: Voltage#2 org
5614144411Sscottl**    		byte 21/22 		: Voltage#2
5615144411Sscottl**    		byte 23 		: Temp#0
5616144411Sscottl**    		byte 24 		: Temp#1
5617144411Sscottl**    		byte 25 		: Power indicator (bit0 : power#0, bit1 : power#1)
5618144411Sscottl**    		byte 26 		: UPS indicator
5619144411Sscottl**      GUI_QUICK_CREATE : Quick create raid/volume set
5620144411Sscottl**    	    byte 0,1        : length
5621144411Sscottl**    	    byte 2          : command code 0x20
5622144411Sscottl**    	    byte 3/4/5/6    : raw capacity
5623144411Sscottl**    	    byte 7 			: raid level
5624144411Sscottl**    	    byte 8 			: stripe size
5625144411Sscottl**    	    byte 9 			: spare
5626144411Sscottl**    	    byte 10/11/12/13: device mask (the devices to create raid/volume)
5627144411Sscottl**    		                  This function is removed, application like to implement quick create function
5628144411Sscottl**    		                  need to use GUI_CREATE_RAIDSET and GUI_CREATE_VOLUMESET function.
5629144411Sscottl**      GUI_GET_INFO_R : Get Raid Set Information
5630144411Sscottl**    		byte 0,1        : length
5631144411Sscottl**    		byte 2          : command code 0x20
5632144411Sscottl**    		byte 3          : raidset#
5633165155Sscottl**
5634144411Sscottl**    	typedef struct sGUI_RAIDSET
5635144411Sscottl**    	{
5636144411Sscottl**    		BYTE grsRaidSetName[16];
5637144411Sscottl**    		DWORD grsCapacity;
5638144411Sscottl**    		DWORD grsCapacityX;
5639144411Sscottl**    		DWORD grsFailMask;
5640144411Sscottl**    		BYTE grsDevArray[32];
5641144411Sscottl**    		BYTE grsMemberDevices;
5642144411Sscottl**    		BYTE grsNewMemberDevices;
5643144411Sscottl**    		BYTE grsRaidState;
5644144411Sscottl**    		BYTE grsVolumes;
5645144411Sscottl**    		BYTE grsVolumeList[16];
5646144411Sscottl**    		BYTE grsRes1;
5647144411Sscottl**    		BYTE grsRes2;
5648144411Sscottl**    		BYTE grsRes3;
5649144411Sscottl**    		BYTE grsFreeSegments;
5650144411Sscottl**    		DWORD grsRawStripes[8];
5651144411Sscottl**    		DWORD grsRes4;
5652144411Sscottl**    		DWORD grsRes5; //     Total to 128 bytes
5653144411Sscottl**    		DWORD grsRes6; //     Total to 128 bytes
5654144411Sscottl**    	} sGUI_RAIDSET, *pGUI_RAIDSET;
5655144411Sscottl**      GUI_GET_INFO_V : Get Volume Set Information
5656144411Sscottl**    		byte 0,1        : length
5657144411Sscottl**    		byte 2          : command code 0x21
5658144411Sscottl**    		byte 3          : volumeset#
5659165155Sscottl**
5660144411Sscottl**    	typedef struct sGUI_VOLUMESET
5661144411Sscottl**    	{
5662144411Sscottl**    		BYTE gvsVolumeName[16]; //     16
5663144411Sscottl**    		DWORD gvsCapacity;
5664144411Sscottl**    		DWORD gvsCapacityX;
5665144411Sscottl**    		DWORD gvsFailMask;
5666144411Sscottl**    		DWORD gvsStripeSize;
5667144411Sscottl**    		DWORD gvsNewFailMask;
5668144411Sscottl**    		DWORD gvsNewStripeSize;
5669144411Sscottl**    		DWORD gvsVolumeStatus;
5670144411Sscottl**    		DWORD gvsProgress; //     32
5671144411Sscottl**    		sSCSI_ATTR gvsScsi;
5672144411Sscottl**    		BYTE gvsMemberDisks;
5673144411Sscottl**    		BYTE gvsRaidLevel; //     8
5674165155Sscottl**
5675144411Sscottl**    		BYTE gvsNewMemberDisks;
5676144411Sscottl**    		BYTE gvsNewRaidLevel;
5677144411Sscottl**    		BYTE gvsRaidSetNumber;
5678144411Sscottl**    		BYTE gvsRes0; //     4
5679144411Sscottl**    		BYTE gvsRes1[4]; //     64 bytes
5680144411Sscottl**    	} sGUI_VOLUMESET, *pGUI_VOLUMESET;
5681165155Sscottl**
5682144411Sscottl**      GUI_GET_INFO_P : Get Physical Drive Information
5683144411Sscottl**    		byte 0,1        : length
5684144411Sscottl**    		byte 2          : command code 0x22
5685144411Sscottl**    		byte 3          : drive # (from 0 to max-channels - 1)
5686165155Sscottl**
5687144411Sscottl**    	typedef struct sGUI_PHY_DRV
5688144411Sscottl**    	{
5689144411Sscottl**    		BYTE gpdModelName[40];
5690144411Sscottl**    		BYTE gpdSerialNumber[20];
5691144411Sscottl**    		BYTE gpdFirmRev[8];
5692144411Sscottl**    		DWORD gpdCapacity;
5693144411Sscottl**    		DWORD gpdCapacityX; //     Reserved for expansion
5694144411Sscottl**    		BYTE gpdDeviceState;
5695144411Sscottl**    		BYTE gpdPioMode;
5696144411Sscottl**    		BYTE gpdCurrentUdmaMode;
5697144411Sscottl**    		BYTE gpdUdmaMode;
5698144411Sscottl**    		BYTE gpdDriveSelect;
5699144411Sscottl**    		BYTE gpdRaidNumber; //     0xff if not belongs to a raid set
5700144411Sscottl**    		sSCSI_ATTR gpdScsi;
5701144411Sscottl**    		BYTE gpdReserved[40]; //     Total to 128 bytes
5702144411Sscottl**    	} sGUI_PHY_DRV, *pGUI_PHY_DRV;
5703165155Sscottl**
5704144411Sscottl**    	GUI_GET_INFO_S : Get System Information
5705144411Sscottl**      	byte 0,1        : length
5706144411Sscottl**      	byte 2          : command code 0x23
5707165155Sscottl**
5708144411Sscottl**    	typedef struct sCOM_ATTR
5709144411Sscottl**    	{
5710144411Sscottl**    		BYTE comBaudRate;
5711144411Sscottl**    		BYTE comDataBits;
5712144411Sscottl**    		BYTE comStopBits;
5713144411Sscottl**    		BYTE comParity;
5714144411Sscottl**    		BYTE comFlowControl;
5715144411Sscottl**    	} sCOM_ATTR, *pCOM_ATTR;
5716165155Sscottl**
5717144411Sscottl**    	typedef struct sSYSTEM_INFO
5718144411Sscottl**    	{
5719144411Sscottl**    		BYTE gsiVendorName[40];
5720144411Sscottl**    		BYTE gsiSerialNumber[16];
5721144411Sscottl**    		BYTE gsiFirmVersion[16];
5722144411Sscottl**    		BYTE gsiBootVersion[16];
5723144411Sscottl**    		BYTE gsiMbVersion[16];
5724144411Sscottl**    		BYTE gsiModelName[8];
5725144411Sscottl**    		BYTE gsiLocalIp[4];
5726144411Sscottl**    		BYTE gsiCurrentIp[4];
5727144411Sscottl**    		DWORD gsiTimeTick;
5728144411Sscottl**    		DWORD gsiCpuSpeed;
5729144411Sscottl**    		DWORD gsiICache;
5730144411Sscottl**    		DWORD gsiDCache;
5731144411Sscottl**    		DWORD gsiScache;
5732144411Sscottl**    		DWORD gsiMemorySize;
5733144411Sscottl**    		DWORD gsiMemorySpeed;
5734144411Sscottl**    		DWORD gsiEvents;
5735144411Sscottl**    		BYTE gsiMacAddress[6];
5736144411Sscottl**    		BYTE gsiDhcp;
5737144411Sscottl**    		BYTE gsiBeeper;
5738144411Sscottl**    		BYTE gsiChannelUsage;
5739144411Sscottl**    		BYTE gsiMaxAtaMode;
5740144411Sscottl**    		BYTE gsiSdramEcc; //     1:if ECC enabled
5741144411Sscottl**    		BYTE gsiRebuildPriority;
5742144411Sscottl**    		sCOM_ATTR gsiComA; //     5 bytes
5743144411Sscottl**    		sCOM_ATTR gsiComB; //     5 bytes
5744144411Sscottl**    		BYTE gsiIdeChannels;
5745144411Sscottl**    		BYTE gsiScsiHostChannels;
5746144411Sscottl**    		BYTE gsiIdeHostChannels;
5747144411Sscottl**    		BYTE gsiMaxVolumeSet;
5748144411Sscottl**    		BYTE gsiMaxRaidSet;
5749144411Sscottl**    		BYTE gsiEtherPort; //     1:if ether net port supported
5750144411Sscottl**    		BYTE gsiRaid6Engine; //     1:Raid6 engine supported
5751144411Sscottl**    		BYTE gsiRes[75];
5752144411Sscottl**    	} sSYSTEM_INFO, *pSYSTEM_INFO;
5753165155Sscottl**
5754144411Sscottl**    	GUI_CLEAR_EVENT : Clear System Event
5755144411Sscottl**    		byte 0,1        : length
5756144411Sscottl**    		byte 2          : command code 0x24
5757165155Sscottl**
5758144411Sscottl**      GUI_MUTE_BEEPER : Mute current beeper
5759144411Sscottl**    		byte 0,1        : length
5760144411Sscottl**    		byte 2          : command code 0x30
5761165155Sscottl**
5762144411Sscottl**      GUI_BEEPER_SETTING : Disable beeper
5763144411Sscottl**    		byte 0,1        : length
5764144411Sscottl**    		byte 2          : command code 0x31
5765144411Sscottl**    		byte 3          : 0->disable, 1->enable
5766165155Sscottl**
5767144411Sscottl**      GUI_SET_PASSWORD : Change password
5768144411Sscottl**    		byte 0,1        : length
5769144411Sscottl**    		byte 2 			: command code 0x32
5770144411Sscottl**    		byte 3 			: pass word length ( must <= 15 )
5771144411Sscottl**    		byte 4 			: password (must be alpha-numerical)
5772165155Sscottl**
5773144411Sscottl**    	GUI_HOST_INTERFACE_MODE : Set host interface mode
5774144411Sscottl**    		byte 0,1        : length
5775144411Sscottl**    		byte 2 			: command code 0x33
5776144411Sscottl**    		byte 3 			: 0->Independent, 1->cluster
5777165155Sscottl**
5778144411Sscottl**      GUI_REBUILD_PRIORITY : Set rebuild priority
5779144411Sscottl**    		byte 0,1        : length
5780144411Sscottl**    		byte 2 			: command code 0x34
5781144411Sscottl**    		byte 3 			: 0/1/2/3 (low->high)
5782165155Sscottl**
5783144411Sscottl**      GUI_MAX_ATA_MODE : Set maximum ATA mode to be used
5784144411Sscottl**    		byte 0,1        : length
5785144411Sscottl**    		byte 2 			: command code 0x35
5786144411Sscottl**    		byte 3 			: 0/1/2/3 (133/100/66/33)
5787165155Sscottl**
5788144411Sscottl**      GUI_RESET_CONTROLLER : Reset Controller
5789144411Sscottl**    		byte 0,1        : length
5790144411Sscottl**    		byte 2          : command code 0x36
5791144411Sscottl**                            *Response with VT100 screen (discard it)
5792165155Sscottl**
5793144411Sscottl**      GUI_COM_PORT_SETTING : COM port setting
5794144411Sscottl**    		byte 0,1        : length
5795144411Sscottl**    		byte 2 			: command code 0x37
5796144411Sscottl**    		byte 3 			: 0->COMA (term port), 1->COMB (debug port)
5797144411Sscottl**    		byte 4 			: 0/1/2/3/4/5/6/7 (1200/2400/4800/9600/19200/38400/57600/115200)
5798144411Sscottl**    		byte 5 			: data bit (0:7 bit, 1:8 bit : must be 8 bit)
5799144411Sscottl**    		byte 6 			: stop bit (0:1, 1:2 stop bits)
5800144411Sscottl**    		byte 7 			: parity (0:none, 1:off, 2:even)
5801144411Sscottl**    		byte 8 			: flow control (0:none, 1:xon/xoff, 2:hardware => must use none)
5802165155Sscottl**
5803144411Sscottl**      GUI_NO_OPERATION : No operation
5804144411Sscottl**    		byte 0,1        : length
5805144411Sscottl**    		byte 2          : command code 0x38
5806165155Sscottl**
5807144411Sscottl**      GUI_DHCP_IP : Set DHCP option and local IP address
5808144411Sscottl**    		byte 0,1        : length
5809144411Sscottl**    		byte 2          : command code 0x39
5810144411Sscottl**    		byte 3          : 0:dhcp disabled, 1:dhcp enabled
5811144411Sscottl**    		byte 4/5/6/7    : IP address
5812165155Sscottl**
5813144411Sscottl**      GUI_CREATE_PASS_THROUGH : Create pass through disk
5814144411Sscottl**    		byte 0,1        : length
5815144411Sscottl**    		byte 2 			: command code 0x40
5816144411Sscottl**    		byte 3 			: device #
5817144411Sscottl**    		byte 4 			: scsi channel (0/1)
5818144411Sscottl**    		byte 5 			: scsi id (0-->15)
5819144411Sscottl**    		byte 6 			: scsi lun (0-->7)
5820144411Sscottl**    		byte 7 			: tagged queue (1 : enabled)
5821144411Sscottl**    		byte 8 			: cache mode (1 : enabled)
5822144411Sscottl**    		byte 9 			: max speed (0/1/2/3/4, async/20/40/80/160 for scsi)
5823144411Sscottl**    								    (0/1/2/3/4, 33/66/100/133/150 for ide  )
5824165155Sscottl**
5825144411Sscottl**      GUI_MODIFY_PASS_THROUGH : Modify pass through disk
5826144411Sscottl**    		byte 0,1        : length
5827144411Sscottl**    		byte 2 			: command code 0x41
5828144411Sscottl**    		byte 3 			: device #
5829144411Sscottl**    		byte 4 			: scsi channel (0/1)
5830144411Sscottl**    		byte 5 			: scsi id (0-->15)
5831144411Sscottl**    		byte 6 			: scsi lun (0-->7)
5832144411Sscottl**    		byte 7 			: tagged queue (1 : enabled)
5833144411Sscottl**    		byte 8 			: cache mode (1 : enabled)
5834144411Sscottl**    		byte 9 			: max speed (0/1/2/3/4, async/20/40/80/160 for scsi)
5835144411Sscottl**    							        (0/1/2/3/4, 33/66/100/133/150 for ide  )
5836165155Sscottl**
5837144411Sscottl**      GUI_DELETE_PASS_THROUGH : Delete pass through disk
5838144411Sscottl**    		byte 0,1        : length
5839144411Sscottl**    		byte 2          : command code 0x42
5840144411Sscottl**    		byte 3          : device# to be deleted
5841165155Sscottl**
5842144411Sscottl**      GUI_IDENTIFY_DEVICE : Identify Device
5843144411Sscottl**    		byte 0,1        : length
5844144411Sscottl**    		byte 2          : command code 0x43
5845144411Sscottl**    		byte 3          : Flash Method(0:flash selected, 1:flash not selected)
5846144411Sscottl**    		byte 4/5/6/7    : IDE device mask to be flashed
5847144411Sscottl**                           note .... no response data available
5848165155Sscottl**
5849144411Sscottl**    	GUI_CREATE_RAIDSET : Create Raid Set
5850144411Sscottl**    		byte 0,1        : length
5851144411Sscottl**    		byte 2          : command code 0x50
5852144411Sscottl**    		byte 3/4/5/6    : device mask
5853144411Sscottl**    		byte 7-22       : raidset name (if byte 7 == 0:use default)
5854165155Sscottl**
5855144411Sscottl**      GUI_DELETE_RAIDSET : Delete Raid Set
5856144411Sscottl**    		byte 0,1        : length
5857144411Sscottl**    		byte 2          : command code 0x51
5858144411Sscottl**    		byte 3          : raidset#
5859165155Sscottl**
5860144411Sscottl**    	GUI_EXPAND_RAIDSET : Expand Raid Set
5861144411Sscottl**    		byte 0,1        : length
5862144411Sscottl**    		byte 2          : command code 0x52
5863144411Sscottl**    		byte 3          : raidset#
5864144411Sscottl**    		byte 4/5/6/7    : device mask for expansion
5865144411Sscottl**    		byte 8/9/10     : (8:0 no change, 1 change, 0xff:terminate, 9:new raid level,10:new stripe size 0/1/2/3/4/5->4/8/16/32/64/128K )
5866144411Sscottl**    		byte 11/12/13   : repeat for each volume in the raidset ....
5867165155Sscottl**
5868144411Sscottl**      GUI_ACTIVATE_RAIDSET : Activate incomplete raid set
5869144411Sscottl**    		byte 0,1        : length
5870144411Sscottl**    		byte 2          : command code 0x53
5871144411Sscottl**    		byte 3          : raidset#
5872165155Sscottl**
5873144411Sscottl**      GUI_CREATE_HOT_SPARE : Create hot spare disk
5874144411Sscottl**    		byte 0,1        : length
5875144411Sscottl**    		byte 2          : command code 0x54
5876144411Sscottl**    		byte 3/4/5/6    : device mask for hot spare creation
5877165155Sscottl**
5878144411Sscottl**    	GUI_DELETE_HOT_SPARE : Delete hot spare disk
5879144411Sscottl**    		byte 0,1        : length
5880144411Sscottl**    		byte 2          : command code 0x55
5881144411Sscottl**    		byte 3/4/5/6    : device mask for hot spare deletion
5882165155Sscottl**
5883144411Sscottl**    	GUI_CREATE_VOLUME : Create volume set
5884144411Sscottl**    		byte 0,1        : length
5885144411Sscottl**    		byte 2          : command code 0x60
5886144411Sscottl**    		byte 3          : raidset#
5887144411Sscottl**    		byte 4-19       : volume set name (if byte4 == 0, use default)
5888144411Sscottl**    		byte 20-27      : volume capacity (blocks)
5889144411Sscottl**    		byte 28 		: raid level
5890144411Sscottl**    		byte 29 		: stripe size (0/1/2/3/4/5->4/8/16/32/64/128K)
5891144411Sscottl**    		byte 30 		: channel
5892144411Sscottl**    		byte 31 		: ID
5893144411Sscottl**    		byte 32 		: LUN
5894144411Sscottl**    		byte 33 		: 1 enable tag
5895144411Sscottl**    		byte 34 		: 1 enable cache
5896144411Sscottl**    		byte 35 		: speed (0/1/2/3/4->async/20/40/80/160 for scsi)
5897144411Sscottl**    								(0/1/2/3/4->33/66/100/133/150 for IDE  )
5898144411Sscottl**    		byte 36 		: 1 to select quick init
5899165155Sscottl**
5900144411Sscottl**    	GUI_MODIFY_VOLUME : Modify volume Set
5901144411Sscottl**    		byte 0,1        : length
5902144411Sscottl**    		byte 2          : command code 0x61
5903144411Sscottl**    		byte 3          : volumeset#
5904144411Sscottl**    		byte 4-19       : new volume set name (if byte4 == 0, not change)
5905144411Sscottl**    		byte 20-27      : new volume capacity (reserved)
5906144411Sscottl**    		byte 28 		: new raid level
5907144411Sscottl**    		byte 29 		: new stripe size (0/1/2/3/4/5->4/8/16/32/64/128K)
5908144411Sscottl**    		byte 30 		: new channel
5909144411Sscottl**    		byte 31 		: new ID
5910144411Sscottl**    		byte 32 		: new LUN
5911144411Sscottl**    		byte 33 		: 1 enable tag
5912144411Sscottl**    		byte 34 		: 1 enable cache
5913144411Sscottl**    		byte 35 		: speed (0/1/2/3/4->async/20/40/80/160 for scsi)
5914144411Sscottl**    								(0/1/2/3/4->33/66/100/133/150 for IDE  )
5915165155Sscottl**
5916144411Sscottl**    	GUI_DELETE_VOLUME : Delete volume set
5917144411Sscottl**    		byte 0,1        : length
5918144411Sscottl**    		byte 2          : command code 0x62
5919144411Sscottl**    		byte 3          : volumeset#
5920165155Sscottl**
5921144411Sscottl**    	GUI_START_CHECK_VOLUME : Start volume consistency check
5922144411Sscottl**    		byte 0,1        : length
5923144411Sscottl**    		byte 2          : command code 0x63
5924144411Sscottl**    		byte 3          : volumeset#
5925165155Sscottl**
5926144411Sscottl**    	GUI_STOP_CHECK_VOLUME : Stop volume consistency check
5927144411Sscottl**    		byte 0,1        : length
5928144411Sscottl**    		byte 2          : command code 0x64
5929144411Sscottl** ---------------------------------------------------------------------
5930144411Sscottl**    4. Returned data
5931144411Sscottl** ---------------------------------------------------------------------
5932144411Sscottl**    	(A) Header          : 3 bytes sequence (0x5E, 0x01, 0x61)
5933144411Sscottl**    	(B) Length          : 2 bytes (low byte 1st, excludes length and checksum byte)
5934144411Sscottl**    	(C) status or data  :
5935144411Sscottl**           <1> If length == 1 ==> 1 byte status code
5936144411Sscottl**    								#define GUI_OK                    0x41
5937144411Sscottl**    								#define GUI_RAIDSET_NOT_NORMAL    0x42
5938144411Sscottl**    								#define GUI_VOLUMESET_NOT_NORMAL  0x43
5939144411Sscottl**    								#define GUI_NO_RAIDSET            0x44
5940144411Sscottl**    								#define GUI_NO_VOLUMESET          0x45
5941144411Sscottl**    								#define GUI_NO_PHYSICAL_DRIVE     0x46
5942144411Sscottl**    								#define GUI_PARAMETER_ERROR       0x47
5943144411Sscottl**    								#define GUI_UNSUPPORTED_COMMAND   0x48
5944144411Sscottl**    								#define GUI_DISK_CONFIG_CHANGED   0x49
5945144411Sscottl**    								#define GUI_INVALID_PASSWORD      0x4a
5946144411Sscottl**    								#define GUI_NO_DISK_SPACE         0x4b
5947144411Sscottl**    								#define GUI_CHECKSUM_ERROR        0x4c
5948144411Sscottl**    								#define GUI_PASSWORD_REQUIRED     0x4d
5949144411Sscottl**           <2> If length > 1 ==> data block returned from controller and the contents depends on the command code
5950144411Sscottl**        (E) Checksum : checksum of length and status or data byte
5951144411Sscottl**************************************************************************
5952144411Sscottl*/
5953