1 /* 2 ******************************************************************************** 3 ** OS : FreeBSD 4 ** FILE NAME : arcmsr.h 5 ** BY : Erich Chen, Ching Huang 6 ** Description: SCSI RAID Device Driver for 7 ** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x) 8 ** SATA/SAS RAID HOST Adapter 9 ******************************************************************************** 10 ******************************************************************************** 11 ** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved. 12 ** 13 ** Redistribution and use in source and binary forms,with or without 14 ** modification,are permitted provided that the following conditions 15 ** are met: 16 ** 1. Redistributions of source code must retain the above copyright 17 ** notice,this list of conditions and the following disclaimer. 18 ** 2. Redistributions in binary form must reproduce the above copyright 19 ** notice,this list of conditions and the following disclaimer in the 20 ** documentation and/or other materials provided with the distribution. 21 ** 3. The name of the author may not be used to endorse or promote products 22 ** derived from this software without specific prior written permission. 23 ** 24 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 25 ** IMPLIED WARRANTIES,INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES 26 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 27 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,INDIRECT, 28 ** INCIDENTAL,SPECIAL,EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT 29 ** NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 30 ** DATA,OR PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY 31 ** THEORY OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY,OR TORT 32 **(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF 33 ** THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 ************************************************************************** 35 * $FreeBSD: head/sys/dev/arcmsr/arcmsr.h 259565 2013-12-18 19:25:40Z delphij $ 36 */ 37 #include <sys/ioccom.h> 38 #define ARCMSR_SCSI_INITIATOR_ID 255 39 #define ARCMSR_DEV_SECTOR_SIZE 512 40 #define ARCMSR_MAX_XFER_SECTORS 4096 41 #define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/ 42 #define ARCMSR_MAX_TARGETLUN 8 /*8*/ 43 #define ARCMSR_MAX_CHIPTYPE_NUM 4 44 #define ARCMSR_MAX_OUTSTANDING_CMD 256 45 #define ARCMSR_MAX_START_JOB 256 46 #define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD 47 #define ARCMSR_MAX_FREESRB_NUM 384 48 #define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */ 49 #define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/ 50 #define ARCMSR_MAX_ADAPTER 4 51 #define ARCMSR_RELEASE_SIMQ_LEVEL 230 52 #define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */ 53 #define ARCMSR_MAX_HBD_POSTQUEUE 256 54 #define ARCMSR_TIMEOUT_DELAY 60 /* in sec */ 55 #define ARCMSR_NUM_MSIX_VECTORS 4 56 /* 57 ********************************************************************* 58 */ 59 #ifndef TRUE 60 #define TRUE 1 61 #endif 62 #ifndef FALSE 63 #define FALSE 0 64 #endif 65 #ifndef INTR_ENTROPY 66 # define INTR_ENTROPY 0 67 #endif 68 69 #ifndef offsetof 70 #define offsetof(type, member) ((size_t)(&((type *)0)->member)) 71 #endif 72 73 #define ARCMSR_LOCK_INIT(l, s) lockinit(l, s, 0, LK_CANRECURSE) 74 #define ARCMSR_LOCK_DESTROY(l) lockuninit(l) 75 #define ARCMSR_LOCK_ACQUIRE(l) lockmgr(l, LK_EXCLUSIVE) 76 #define ARCMSR_LOCK_RELEASE(l) lockmgr(l, LK_RELEASE) 77 #define ARCMSR_LOCK_TRY(l) lockmgr_try(l, LK_EXCLUSIVE) 78 #define arcmsr_htole32(x) htole32(x) 79 typedef struct lock arcmsr_lock_t; 80 81 /* 82 ********************************************************************************** 83 ** 84 ********************************************************************************** 85 */ 86 #define PCI_VENDOR_ID_ARECA 0x17D3 /* Vendor ID */ 87 #define PCI_DEVICE_ID_ARECA_1110 0x1110 /* Device ID */ 88 #define PCI_DEVICE_ID_ARECA_1120 0x1120 /* Device ID */ 89 #define PCI_DEVICE_ID_ARECA_1130 0x1130 /* Device ID */ 90 #define PCI_DEVICE_ID_ARECA_1160 0x1160 /* Device ID */ 91 #define PCI_DEVICE_ID_ARECA_1170 0x1170 /* Device ID */ 92 #define PCI_DEVICE_ID_ARECA_1200 0x1200 /* Device ID */ 93 #define PCI_DEVICE_ID_ARECA_1201 0x1201 /* Device ID */ 94 #define PCI_DEVICE_ID_ARECA_1203 0x1203 /* Device ID */ 95 #define PCI_DEVICE_ID_ARECA_1210 0x1210 /* Device ID */ 96 #define PCI_DEVICE_ID_ARECA_1212 0x1212 /* Device ID */ 97 #define PCI_DEVICE_ID_ARECA_1214 0x1214 /* Device ID */ 98 #define PCI_DEVICE_ID_ARECA_1220 0x1220 /* Device ID */ 99 #define PCI_DEVICE_ID_ARECA_1222 0x1222 /* Device ID */ 100 #define PCI_DEVICE_ID_ARECA_1230 0x1230 /* Device ID */ 101 #define PCI_DEVICE_ID_ARECA_1231 0x1231 /* Device ID */ 102 #define PCI_DEVICE_ID_ARECA_1260 0x1260 /* Device ID */ 103 #define PCI_DEVICE_ID_ARECA_1261 0x1261 /* Device ID */ 104 #define PCI_DEVICE_ID_ARECA_1270 0x1270 /* Device ID */ 105 #define PCI_DEVICE_ID_ARECA_1280 0x1280 /* Device ID */ 106 #define PCI_DEVICE_ID_ARECA_1380 0x1380 /* Device ID */ 107 #define PCI_DEVICE_ID_ARECA_1381 0x1381 /* Device ID */ 108 #define PCI_DEVICE_ID_ARECA_1680 0x1680 /* Device ID */ 109 #define PCI_DEVICE_ID_ARECA_1681 0x1681 /* Device ID */ 110 #define PCI_DEVICE_ID_ARECA_1880 0x1880 /* Device ID */ 111 #define PCI_DEVICE_ID_ARECA_1884 0x1884 /* Device ID */ 112 113 #define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */ 114 #define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */ 115 #define ARECA_SUB_DEV_ID_1883 0x1883 /* Subsystem Device ID */ 116 #define ARECA_SUB_DEV_ID_1884 0x1884 /* Subsystem Device ID */ 117 #define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */ 118 #define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */ 119 #define ARECA_SUB_DEV_ID_1216 0x1216 /* Subsystem Device ID */ 120 #define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */ 121 #define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */ 122 #define ARECA_SUB_DEV_ID_1226 0x1226 /* Subsystem Device ID */ 123 124 #define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */ 125 #define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */ 126 #define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */ 127 #define PCIDevVenIDARC1160 0x116017D3 /* Vendor Device ID */ 128 #define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */ 129 #define PCIDevVenIDARC1200 0x120017D3 /* Vendor Device ID */ 130 #define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */ 131 #define PCIDevVenIDARC1203 0x120317D3 /* Vendor Device ID */ 132 #define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */ 133 #define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */ 134 #define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */ 135 #define PCIDevVenIDARC1214 0x121417D3 /* Vendor Device ID */ 136 #define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */ 137 #define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */ 138 #define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */ 139 #define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */ 140 #define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */ 141 #define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */ 142 #define PCIDevVenIDARC1261 0x126117D3 /* Vendor Device ID */ 143 #define PCIDevVenIDARC1270 0x127017D3 /* Vendor Device ID */ 144 #define PCIDevVenIDARC1280 0x128017D3 /* Vendor Device ID */ 145 #define PCIDevVenIDARC1380 0x138017D3 /* Vendor Device ID */ 146 #define PCIDevVenIDARC1381 0x138117D3 /* Vendor Device ID */ 147 #define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */ 148 #define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */ 149 #define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */ 150 #define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */ 151 #define PCIDevVenIDARC1884 0x188417D3 /* Vendor Device ID */ 152 153 #ifndef PCIR_BARS 154 #define PCIR_BARS 0x10 155 #define PCIR_BAR(x) (PCIR_BARS + (x) * 4) 156 #endif 157 158 #define PCI_BASE_ADDR0 0x10 159 #define PCI_BASE_ADDR1 0x14 160 #define PCI_BASE_ADDR2 0x18 161 #define PCI_BASE_ADDR3 0x1C 162 #define PCI_BASE_ADDR4 0x20 163 #define PCI_BASE_ADDR5 0x24 164 /* 165 ********************************************************************************** 166 ** 167 ********************************************************************************** 168 */ 169 #define ARCMSR_SCSICMD_IOCTL 0x77 170 #define ARCMSR_CDEVSW_IOCTL 0x88 171 #define ARCMSR_MESSAGE_FAIL 0x0001 172 #define ARCMSR_MESSAGE_SUCCESS 0x0000 173 /* 174 ********************************************************************************** 175 ** 176 ********************************************************************************** 177 */ 178 #define arcmsr_ccbsrb_ptr spriv_ptr0 179 #define arcmsr_ccbacb_ptr spriv_ptr1 180 #define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16) 181 #define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff) 182 #define get_min(x,y) ((x) < (y) ? (x) : (y)) 183 #define get_max(x,y) ((x) < (y) ? (y) : (x)) 184 /* 185 ************************************************************************** 186 ************************************************************************** 187 */ 188 #define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r)) 189 #define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d) 190 #define READ_CHIP_REG32(b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], r) 191 #define WRITE_CHIP_REG32(b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], r, d) 192 /* 193 ********************************************************************************** 194 ** IOCTL CONTROL Mail Box 195 ********************************************************************************** 196 */ 197 struct CMD_MESSAGE { 198 u_int32_t HeaderLength; 199 u_int8_t Signature[8]; 200 u_int32_t Timeout; 201 u_int32_t ControlCode; 202 u_int32_t ReturnCode; 203 u_int32_t Length; 204 }; 205 206 struct CMD_MESSAGE_FIELD { 207 struct CMD_MESSAGE cmdmessage; /* ioctl header */ 208 u_int8_t messagedatabuffer[1032]; /* areca gui program does not accept more than 1031 byte */ 209 }; 210 211 /************************************************************************/ 212 /************************************************************************/ 213 214 #define ARCMSR_IOP_ERROR_ILLEGALPCI 0x0001 215 #define ARCMSR_IOP_ERROR_VENDORID 0x0002 216 #define ARCMSR_IOP_ERROR_DEVICEID 0x0002 217 #define ARCMSR_IOP_ERROR_ILLEGALCDB 0x0003 218 #define ARCMSR_IOP_ERROR_UNKNOW_CDBERR 0x0004 219 #define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE 0x0005 220 #define ARCMSR_SYS_ERROR_MEMORY_CROSS4G 0x0006 221 #define ARCMSR_SYS_ERROR_MEMORY_LACK 0x0007 222 #define ARCMSR_SYS_ERROR_MEMORY_RANGE 0x0008 223 #define ARCMSR_SYS_ERROR_DEVICE_BASE 0x0009 224 #define ARCMSR_SYS_ERROR_PORT_VALIDATE 0x000A 225 226 /*DeviceType*/ 227 #define ARECA_SATA_RAID 0x90000000 228 229 /*FunctionCode*/ 230 #define FUNCTION_READ_RQBUFFER 0x0801 231 #define FUNCTION_WRITE_WQBUFFER 0x0802 232 #define FUNCTION_CLEAR_RQBUFFER 0x0803 233 #define FUNCTION_CLEAR_WQBUFFER 0x0804 234 #define FUNCTION_CLEAR_ALLQBUFFER 0x0805 235 #define FUNCTION_REQUEST_RETURNCODE_3F 0x0806 236 #define FUNCTION_SAY_HELLO 0x0807 237 #define FUNCTION_SAY_GOODBYE 0x0808 238 #define FUNCTION_FLUSH_ADAPTER_CACHE 0x0809 239 /* 240 ************************************************************************ 241 ** IOCTL CONTROL CODE 242 ************************************************************************ 243 */ 244 /* ARECA IO CONTROL CODE*/ 245 #define ARCMSR_MESSAGE_READ_RQBUFFER _IOWR('F', FUNCTION_READ_RQBUFFER, struct CMD_MESSAGE_FIELD) 246 #define ARCMSR_MESSAGE_WRITE_WQBUFFER _IOWR('F', FUNCTION_WRITE_WQBUFFER, struct CMD_MESSAGE_FIELD) 247 #define ARCMSR_MESSAGE_CLEAR_RQBUFFER _IOWR('F', FUNCTION_CLEAR_RQBUFFER, struct CMD_MESSAGE_FIELD) 248 #define ARCMSR_MESSAGE_CLEAR_WQBUFFER _IOWR('F', FUNCTION_CLEAR_WQBUFFER, struct CMD_MESSAGE_FIELD) 249 #define ARCMSR_MESSAGE_CLEAR_ALLQBUFFER _IOWR('F', FUNCTION_CLEAR_ALLQBUFFER, struct CMD_MESSAGE_FIELD) 250 #define ARCMSR_MESSAGE_REQUEST_RETURNCODE_3F _IOWR('F', FUNCTION_REQUEST_RETURNCODE_3F, struct CMD_MESSAGE_FIELD) 251 #define ARCMSR_MESSAGE_SAY_HELLO _IOWR('F', FUNCTION_SAY_HELLO, struct CMD_MESSAGE_FIELD) 252 #define ARCMSR_MESSAGE_SAY_GOODBYE _IOWR('F', FUNCTION_SAY_GOODBYE, struct CMD_MESSAGE_FIELD) 253 #define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD) 254 255 /* ARECA IOCTL ReturnCode */ 256 #define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001 257 #define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006 258 #define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F 259 #define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088 260 /* 261 ************************************************************************ 262 ** SPEC. for Areca HBA adapter 263 ************************************************************************ 264 */ 265 /* signature of set and get firmware config */ 266 #define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060 267 #define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063 268 /* message code of inbound message register */ 269 #define ARCMSR_INBOUND_MESG0_NOP 0x00000000 270 #define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001 271 #define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002 272 #define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003 273 #define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004 274 #define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005 275 #define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006 276 #define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007 277 #define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008 278 /* doorbell interrupt generator */ 279 #define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001 280 #define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002 281 #define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001 282 #define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002 283 /* srb areca cdb flag */ 284 #define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000 285 #define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000 286 #define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000 287 #define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000 288 #define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000 289 #define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001 290 /* outbound firmware ok */ 291 #define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000 292 293 #define ARCMSR_ARC1680_BUS_RESET 0x00000003 294 /* 295 ************************************************************************ 296 ** SPEC. for Areca HBB adapter 297 ************************************************************************ 298 */ 299 /* ARECA HBB COMMAND for its FIRMWARE */ 300 #define ARCMSR_DRV2IOP_DOORBELL 0x00020400 /* window of "instruction flags" from driver to iop */ 301 #define ARCMSR_DRV2IOP_DOORBELL_MASK 0x00020404 302 #define ARCMSR_IOP2DRV_DOORBELL 0x00020408 /* window of "instruction flags" from iop to driver */ 303 #define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C 304 305 #define ARCMSR_IOP2DRV_DOORBELL_1203 0x00021870 /* window of "instruction flags" from iop to driver */ 306 #define ARCMSR_IOP2DRV_DOORBELL_MASK_1203 0x00021874 307 #define ARCMSR_DRV2IOP_DOORBELL_1203 0x00021878 /* window of "instruction flags" from driver to iop */ 308 #define ARCMSR_DRV2IOP_DOORBELL_MASK_1203 0x0002187C 309 310 /* ARECA FLAG LANGUAGE */ 311 #define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001 /* ioctl transfer */ 312 #define ARCMSR_IOP2DRV_DATA_READ_OK 0x00000002 /* ioctl transfer */ 313 #define ARCMSR_IOP2DRV_CDB_DONE 0x00000004 314 #define ARCMSR_IOP2DRV_MESSAGE_CMD_DONE 0x00000008 315 316 #define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F 317 #define ARCMSR_DOORBELL_INT_CLEAR_PATTERN 0xFF00FFF0 318 #define ARCMSR_MESSAGE_INT_CLEAR_PATTERN 0xFF00FFF7 319 320 #define ARCMSR_MESSAGE_GET_CONFIG 0x00010008 /* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ 321 #define ARCMSR_MESSAGE_SET_CONFIG 0x00020008 /* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ 322 #define ARCMSR_MESSAGE_ABORT_CMD 0x00030008 /* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ 323 #define ARCMSR_MESSAGE_STOP_BGRB 0x00040008 /* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ 324 #define ARCMSR_MESSAGE_FLUSH_CACHE 0x00050008 /* (ARCMSR_INBOUND_MESG0_FLUSH_CACHE<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ 325 #define ARCMSR_MESSAGE_START_BGRB 0x00060008 /* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */ 326 #define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008 327 #define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008 328 #define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008 329 #define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */ 330 331 #define ARCMSR_DRV2IOP_DATA_WRITE_OK 0x00000001 /* ioctl transfer */ 332 #define ARCMSR_DRV2IOP_DATA_READ_OK 0x00000002 /* ioctl transfer */ 333 #define ARCMSR_DRV2IOP_CDB_POSTED 0x00000004 334 #define ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED 0x00000008 335 #define ARCMSR_DRV2IOP_END_OF_INTERRUPT 0x00000010 /* */ 336 337 /* data tunnel buffer between user space program and its firmware */ 338 #define ARCMSR_MSGCODE_RWBUFFER 0x0000fa00 /* iop msgcode_rwbuffer for message command */ 339 #define ARCMSR_IOCTL_WBUFFER 0x0000fe00 /* user space data to iop 128bytes */ 340 #define ARCMSR_IOCTL_RBUFFER 0x0000ff00 /* iop data to user space 128bytes */ 341 #define ARCMSR_HBB_BASE0_OFFSET 0x00000010 342 #define ARCMSR_HBB_BASE1_OFFSET 0x00000018 343 #define ARCMSR_HBB_BASE0_LEN 0x00021000 344 #define ARCMSR_HBB_BASE1_LEN 0x00010000 345 /* 346 ************************************************************************ 347 ** SPEC. for Areca HBC adapter 348 ************************************************************************ 349 */ 350 #define ARCMSR_HBC_ISR_THROTTLING_LEVEL 12 351 #define ARCMSR_HBC_ISR_MAX_DONE_QUEUE 20 352 /* Host Interrupt Mask */ 353 #define ARCMSR_HBCMU_UTILITY_A_ISR_MASK 0x00000001 /* When clear, the Utility_A interrupt routes to the host.*/ 354 #define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK 0x00000004 /* When clear, the General Outbound Doorbell interrupt routes to the host.*/ 355 #define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK 0x00000008 /* When clear, the Outbound Post List FIFO Not Empty interrupt routes to the host.*/ 356 #define ARCMSR_HBCMU_ALL_INTMASKENABLE 0x0000000D /* disable all ISR */ 357 /* Host Interrupt Status */ 358 #define ARCMSR_HBCMU_UTILITY_A_ISR 0x00000001 359 /* 360 ** Set when the Utility_A Interrupt bit is set in the Outbound Doorbell Register. 361 ** It clears by writing a 1 to the Utility_A bit in the Outbound Doorbell Clear Register or through automatic clearing (if enabled). 362 */ 363 #define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR 0x00000004 364 /* 365 ** Set if Outbound Doorbell register bits 30:1 have a non-zero 366 ** value. This bit clears only when Outbound Doorbell bits 367 ** 30:1 are ALL clear. Only a write to the Outbound Doorbell 368 ** Clear register clears bits in the Outbound Doorbell register. 369 */ 370 #define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR 0x00000008 371 /* 372 ** Set whenever the Outbound Post List Producer/Consumer 373 ** Register (FIFO) is not empty. It clears when the Outbound 374 ** Post List FIFO is empty. 375 */ 376 #define ARCMSR_HBCMU_SAS_ALL_INT 0x00000010 377 /* 378 ** This bit indicates a SAS interrupt from a source external to 379 ** the PCIe core. This bit is not maskable. 380 */ 381 /* DoorBell*/ 382 #define ARCMSR_HBCMU_DRV2IOP_DATA_WRITE_OK 0x00000002/**/ 383 #define ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK 0x00000004/**/ 384 #define ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE 0x00000008/*inbound message 0 ready*/ 385 #define ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING 0x00000010/*more than 12 request completed in a time*/ 386 #define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK 0x00000002/**/ 387 #define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_DOORBELL_CLEAR 0x00000002/*outbound DATA WRITE isr door bell clear*/ 388 #define ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK 0x00000004/**/ 389 #define ARCMSR_HBCMU_IOP2DRV_DATA_READ_DOORBELL_CLEAR 0x00000004/*outbound DATA READ isr door bell clear*/ 390 #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008/*outbound message 0 ready*/ 391 #define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR 0x00000008/*outbound message cmd isr door bell clear*/ 392 #define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/ 393 #define ARCMSR_HBCMU_RESET_ADAPTER 0x00000024 394 #define ARCMSR_HBCMU_DiagWrite_ENABLE 0x00000080 395 396 /* 397 ************************************************************************ 398 ** SPEC. for Areca HBD adapter 399 ************************************************************************ 400 */ 401 #define ARCMSR_HBDMU_CHIP_ID 0x00004 402 #define ARCMSR_HBDMU_CPU_MEMORY_CONFIGURATION 0x00008 403 #define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK 0x00034 404 #define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS 0x00200 405 #define ARCMSR_HBDMU_PCIE_F0_INTERRUPT_ENABLE 0x0020C 406 #define ARCMSR_HBDMU_INBOUND_MESSAGE0 0x00400 407 #define ARCMSR_HBDMU_INBOUND_MESSAGE1 0x00404 408 #define ARCMSR_HBDMU_OUTBOUND_MESSAGE0 0x00420 409 #define ARCMSR_HBDMU_OUTBOUND_MESSAGE1 0x00424 410 #define ARCMSR_HBDMU_INBOUND_DOORBELL 0x00460 411 #define ARCMSR_HBDMU_OUTBOUND_DOORBELL 0x00480 412 #define ARCMSR_HBDMU_OUTBOUND_DOORBELL_ENABLE 0x00484 413 #define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW 0x01000 414 #define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH 0x01004 415 #define ARCMSR_HBDMU_INBOUND_LIST_WRITE_POINTER 0x01018 416 #define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW 0x01060 417 #define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_HIGH 0x01064 418 #define ARCMSR_HBDMU_OUTBOUND_LIST_COPY_POINTER 0x0106C 419 #define ARCMSR_HBDMU_OUTBOUND_LIST_READ_POINTER 0x01070 420 #define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_CAUSE 0x01088 421 #define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_ENABLE 0x0108C 422 423 #define ARCMSR_HBDMU_MESSAGE_WBUFFER 0x02000 424 #define ARCMSR_HBDMU_MESSAGE_RBUFFER 0x02100 425 #define ARCMSR_HBDMU_MESSAGE_RWBUFFER 0x02200 426 427 #define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL 16 428 #define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE 20 429 430 /* Host Interrupt Mask */ 431 #define ARCMSR_HBDMU_ALL_INT_ENABLE 0x00001010 /* enable all ISR */ 432 #define ARCMSR_HBDMU_ALL_INT_DISABLE 0x00000000 /* disable all ISR */ 433 434 /* Host Interrupt Status */ 435 #define ARCMSR_HBDMU_OUTBOUND_INT 0x00001010 436 #define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT 0x00001000 437 #define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT 0x00000010 438 439 /* DoorBell*/ 440 #define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY 0x00000001 441 #define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ 0x00000002 442 443 #define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK 0x00000001 444 #define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK 0x00000002 445 446 /*outbound message 0 ready*/ 447 #define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE 0x02000000 448 449 #define ARCMSR_HBDMU_F0_DOORBELL_CAUSE 0x02000003 450 451 /*outbound message cmd isr door bell clear*/ 452 #define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE_CLEAR 0x02000000 453 454 /*outbound list */ 455 #define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT 0x00000001 456 #define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT_CLEAR 0x00000001 457 458 /*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/ 459 #define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000 460 /* 461 ******************************************************************************* 462 ** SPEC. for Areca HBE adapter 463 ******************************************************************************* 464 */ 465 #define ARCMSR_SIGNATURE_1884 0x188417D3 466 #define ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR 0x00000001 467 #define ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR 0x00000008 468 #define ARCMSR_HBEMU_ALL_INTMASKENABLE 0x00000009 /* disable all ISR */ 469 470 #define ARCMSR_HBEMU_DRV2IOP_DATA_WRITE_OK 0x00000002 471 #define ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK 0x00000004 472 #define ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE 0x00000008 /* inbound message 0 ready */ 473 #define ARCMSR_HBEMU_IOP2DRV_DATA_WRITE_OK 0x00000002 474 #define ARCMSR_HBEMU_IOP2DRV_DATA_READ_OK 0x00000004 475 #define ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008 /* outbound message 0 ready */ 476 #define ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK */ 477 /* ARC-1884 doorbell sync */ 478 #define ARCMSR_HBEMU_DOORBELL_SYNC 0x100 479 #define ARCMSR_ARC188X_RESET_ADAPTER 0x00000004 480 /* 481 ********************************************************************* 482 ** Message Unit structure 483 ********************************************************************* 484 */ 485 struct HBA_MessageUnit 486 { 487 u_int32_t resrved0[4]; /*0000 000F*/ 488 u_int32_t inbound_msgaddr0; /*0010 0013*/ 489 u_int32_t inbound_msgaddr1; /*0014 0017*/ 490 u_int32_t outbound_msgaddr0; /*0018 001B*/ 491 u_int32_t outbound_msgaddr1; /*001C 001F*/ 492 u_int32_t inbound_doorbell; /*0020 0023*/ 493 u_int32_t inbound_intstatus; /*0024 0027*/ 494 u_int32_t inbound_intmask; /*0028 002B*/ 495 u_int32_t outbound_doorbell; /*002C 002F*/ 496 u_int32_t outbound_intstatus; /*0030 0033*/ 497 u_int32_t outbound_intmask; /*0034 0037*/ 498 u_int32_t reserved1[2]; /*0038 003F*/ 499 u_int32_t inbound_queueport; /*0040 0043*/ 500 u_int32_t outbound_queueport; /*0044 0047*/ 501 u_int32_t reserved2[2]; /*0048 004F*/ 502 u_int32_t reserved3[492]; /*0050 07FF ......local_buffer 492*/ 503 u_int32_t reserved4[128]; /*0800 09FF 128*/ 504 u_int32_t msgcode_rwbuffer[256]; /*0a00 0DFF 256*/ 505 u_int32_t message_wbuffer[32]; /*0E00 0E7F 32*/ 506 u_int32_t reserved5[32]; /*0E80 0EFF 32*/ 507 u_int32_t message_rbuffer[32]; /*0F00 0F7F 32*/ 508 u_int32_t reserved6[32]; /*0F80 0FFF 32*/ 509 }; 510 /* 511 ********************************************************************* 512 ** 513 ********************************************************************* 514 */ 515 struct HBB_DOORBELL_1203 516 { 517 u_int8_t doorbell_reserved[ARCMSR_IOP2DRV_DOORBELL_1203]; /*reserved */ 518 u_int32_t iop2drv_doorbell; /*offset 0x00021870:00,01,02,03: window of "instruction flags" from iop to driver */ 519 u_int32_t iop2drv_doorbell_mask; /* 04,05,06,07: doorbell mask */ 520 u_int32_t drv2iop_doorbell; /* 08,09,10,11: window of "instruction flags" from driver to iop */ 521 u_int32_t drv2iop_doorbell_mask; /* 12,13,14,15: doorbell mask */ 522 }; 523 struct HBB_DOORBELL 524 { 525 u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */ 526 u_int32_t drv2iop_doorbell; /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */ 527 u_int32_t drv2iop_doorbell_mask; /* 04,05,06,07: doorbell mask */ 528 u_int32_t iop2drv_doorbell; /* 08,09,10,11: window of "instruction flags" from iop to driver */ 529 u_int32_t iop2drv_doorbell_mask; /* 12,13,14,15: doorbell mask */ 530 }; 531 /* 532 ********************************************************************* 533 ** 534 ********************************************************************* 535 */ 536 struct HBB_RWBUFFER 537 { 538 u_int8_t message_reserved0[ARCMSR_MSGCODE_RWBUFFER]; /*reserved */ 539 u_int32_t msgcode_rwbuffer[256]; /*offset 0x0000fa00: 0, 1, 2, 3,...,1023: message code read write 1024bytes */ 540 u_int32_t message_wbuffer[32]; /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */ 541 u_int32_t message_reserved1[32]; /* 1152,1153,1154,1155,...,1279: message reserved*/ 542 u_int32_t message_rbuffer[32]; /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */ 543 }; 544 /* 545 ********************************************************************* 546 ** 547 ********************************************************************* 548 */ 549 struct HBB_MessageUnit 550 { 551 u_int32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* post queue buffer for iop */ 552 u_int32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* done queue buffer for iop */ 553 int32_t postq_index; /* post queue index */ 554 int32_t doneq_index; /* done queue index */ 555 struct HBB_DOORBELL *hbb_doorbell; 556 struct HBB_RWBUFFER *hbb_rwbuffer; 557 bus_size_t drv2iop_doorbell; /* window of "instruction flags" from driver to iop */ 558 bus_size_t drv2iop_doorbell_mask; /* doorbell mask */ 559 bus_size_t iop2drv_doorbell; /* window of "instruction flags" from iop to driver */ 560 bus_size_t iop2drv_doorbell_mask; /* doorbell mask */ 561 }; 562 563 /* 564 ********************************************************************* 565 ** 566 ********************************************************************* 567 */ 568 struct HBC_MessageUnit { 569 u_int32_t message_unit_status; /*0000 0003*/ 570 u_int32_t slave_error_attribute; /*0004 0007*/ 571 u_int32_t slave_error_address; /*0008 000B*/ 572 u_int32_t posted_outbound_doorbell; /*000C 000F*/ 573 u_int32_t master_error_attribute; /*0010 0013*/ 574 u_int32_t master_error_address_low; /*0014 0017*/ 575 u_int32_t master_error_address_high; /*0018 001B*/ 576 u_int32_t hcb_size; /*001C 001F size of the PCIe window used for HCB_Mode accesses*/ 577 u_int32_t inbound_doorbell; /*0020 0023*/ 578 u_int32_t diagnostic_rw_data; /*0024 0027*/ 579 u_int32_t diagnostic_rw_address_low; /*0028 002B*/ 580 u_int32_t diagnostic_rw_address_high; /*002C 002F*/ 581 u_int32_t host_int_status; /*0030 0033 host interrupt status*/ 582 u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ 583 u_int32_t dcr_data; /*0038 003B*/ 584 u_int32_t dcr_address; /*003C 003F*/ 585 u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ 586 u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ 587 u_int32_t hcb_pci_address_low; /*0048 004B*/ 588 u_int32_t hcb_pci_address_high; /*004C 004F*/ 589 u_int32_t iop_int_status; /*0050 0053*/ 590 u_int32_t iop_int_mask; /*0054 0057*/ 591 u_int32_t iop_inbound_queue_port; /*0058 005B*/ 592 u_int32_t iop_outbound_queue_port; /*005C 005F*/ 593 u_int32_t inbound_free_list_index; /*0060 0063 inbound free list producer consumer index*/ 594 u_int32_t inbound_post_list_index; /*0064 0067 inbound post list producer consumer index*/ 595 u_int32_t outbound_free_list_index; /*0068 006B outbound free list producer consumer index*/ 596 u_int32_t outbound_post_list_index; /*006C 006F outbound post list producer consumer index*/ 597 u_int32_t inbound_doorbell_clear; /*0070 0073*/ 598 u_int32_t i2o_message_unit_control; /*0074 0077*/ 599 u_int32_t last_used_message_source_address_low; /*0078 007B*/ 600 u_int32_t last_used_message_source_address_high; /*007C 007F*/ 601 u_int32_t pull_mode_data_byte_count[4]; /*0080 008F pull mode data byte count0..count7*/ 602 u_int32_t message_dest_address_index; /*0090 0093*/ 603 u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ 604 u_int32_t utility_A_int_counter_timer; /*0098 009B*/ 605 u_int32_t outbound_doorbell; /*009C 009F*/ 606 u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ 607 u_int32_t message_source_address_index; /*00A4 00A7 message accelerator source address consumer producer index*/ 608 u_int32_t message_done_queue_index; /*00A8 00AB message accelerator completion queue consumer producer index*/ 609 u_int32_t reserved0; /*00AC 00AF*/ 610 u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ 611 u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ 612 u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ 613 u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ 614 u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ 615 u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ 616 u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ 617 u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ 618 u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ 619 u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ 620 u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ 621 u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ 622 u_int32_t message_dest_queue_port_low; /*00E0 00E3 message accelerator destination queue port low*/ 623 u_int32_t message_dest_queue_port_high; /*00E4 00E7 message accelerator destination queue port high*/ 624 u_int32_t last_used_message_dest_address_low; /*00E8 00EB last used message accelerator destination address low*/ 625 u_int32_t last_used_message_dest_address_high; /*00EC 00EF last used message accelerator destination address high*/ 626 u_int32_t message_done_queue_base_address_low; /*00F0 00F3 message accelerator completion queue base address low*/ 627 u_int32_t message_done_queue_base_address_high; /*00F4 00F7 message accelerator completion queue base address high*/ 628 u_int32_t host_diagnostic; /*00F8 00FB*/ 629 u_int32_t write_sequence; /*00FC 00FF*/ 630 u_int32_t reserved1[34]; /*0100 0187*/ 631 u_int32_t reserved2[1950]; /*0188 1FFF*/ 632 u_int32_t message_wbuffer[32]; /*2000 207F*/ 633 u_int32_t reserved3[32]; /*2080 20FF*/ 634 u_int32_t message_rbuffer[32]; /*2100 217F*/ 635 u_int32_t reserved4[32]; /*2180 21FF*/ 636 u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ 637 }; 638 /* 639 ********************************************************************* 640 ** 641 ********************************************************************* 642 */ 643 struct InBound_SRB { 644 uint32_t addressLow; //pointer to SRB block 645 uint32_t addressHigh; 646 uint32_t length; // in DWORDs 647 uint32_t reserved0; 648 }; 649 650 struct OutBound_SRB { 651 uint32_t addressLow; //pointer to SRB block 652 uint32_t addressHigh; 653 }; 654 655 struct HBD_MessageUnit { 656 uint32_t reserved0; 657 uint32_t chip_id; //0x0004 658 uint32_t cpu_mem_config; //0x0008 659 uint32_t reserved1[10]; //0x000C 660 uint32_t i2o_host_interrupt_mask; //0x0034 661 uint32_t reserved2[114]; //0x0038 662 uint32_t host_int_status; //0x0200 663 uint32_t host_int_enable; //0x0204 664 uint32_t reserved3[1]; //0x0208 665 uint32_t pcief0_int_enable; //0x020C 666 uint32_t reserved4[124]; //0x0210 667 uint32_t inbound_msgaddr0; //0x0400 668 uint32_t inbound_msgaddr1; //0x0404 669 uint32_t reserved5[6]; //0x0408 670 uint32_t outbound_msgaddr0; //0x0420 671 uint32_t outbound_msgaddr1; //0x0424 672 uint32_t reserved6[14]; //0x0428 673 uint32_t inbound_doorbell; //0x0460 674 uint32_t reserved7[7]; //0x0464 675 uint32_t outbound_doorbell; //0x0480 676 uint32_t outbound_doorbell_enable; //0x0484 677 uint32_t reserved8[734]; //0x0488 678 uint32_t inboundlist_base_low; //0x1000 679 uint32_t inboundlist_base_high; //0x1004 680 uint32_t reserved9[4]; //0x1008 681 uint32_t inboundlist_write_pointer; //0x1018 682 uint32_t inboundlist_read_pointer; //0x101C 683 uint32_t reserved10[16]; //0x1020 684 uint32_t outboundlist_base_low; //0x1060 685 uint32_t outboundlist_base_high; //0x1064 686 uint32_t reserved11; //0x1068 687 uint32_t outboundlist_copy_pointer; //0x106C 688 uint32_t outboundlist_read_pointer; //0x1070 0x1072 689 uint32_t reserved12[5]; //0x1074 690 uint32_t outboundlist_interrupt_cause; //0x1088 691 uint32_t outboundlist_interrupt_enable; //0x108C 692 uint32_t reserved13[988]; //0x1090 693 uint32_t message_wbuffer[32]; //0x2000 694 uint32_t reserved14[32]; //0x2080 695 uint32_t message_rbuffer[32]; //0x2100 696 uint32_t reserved15[32]; //0x2180 697 uint32_t msgcode_rwbuffer[256]; //0x2200 698 }; 699 700 struct HBD_MessageUnit0 { 701 struct InBound_SRB post_qbuffer[ARCMSR_MAX_HBD_POSTQUEUE]; 702 struct OutBound_SRB done_qbuffer[ARCMSR_MAX_HBD_POSTQUEUE+1]; 703 uint16_t postq_index; 704 uint16_t doneq_index; 705 struct HBD_MessageUnit *phbdmu; 706 }; 707 /* 708 ********************************************************************* 709 ** 710 ********************************************************************* 711 */ 712 struct HBE_MessageUnit { 713 u_int32_t iobound_doorbell; /*0000 0003*/ 714 u_int32_t write_sequence_3xxx; /*0004 0007*/ 715 u_int32_t host_diagnostic_3xxx; /*0008 000B*/ 716 u_int32_t posted_outbound_doorbell; /*000C 000F*/ 717 u_int32_t master_error_attribute; /*0010 0013*/ 718 u_int32_t master_error_address_low; /*0014 0017*/ 719 u_int32_t master_error_address_high; /*0018 001B*/ 720 u_int32_t hcb_size; /*001C 001F*/ 721 u_int32_t inbound_doorbell; /*0020 0023*/ 722 u_int32_t diagnostic_rw_data; /*0024 0027*/ 723 u_int32_t diagnostic_rw_address_low; /*0028 002B*/ 724 u_int32_t diagnostic_rw_address_high; /*002C 002F*/ 725 u_int32_t host_int_status; /*0030 0033 host interrupt status*/ 726 u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/ 727 u_int32_t dcr_data; /*0038 003B*/ 728 u_int32_t dcr_address; /*003C 003F*/ 729 u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/ 730 u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/ 731 u_int32_t hcb_pci_address_low; /*0048 004B*/ 732 u_int32_t hcb_pci_address_high; /*004C 004F*/ 733 u_int32_t iop_int_status; /*0050 0053*/ 734 u_int32_t iop_int_mask; /*0054 0057*/ 735 u_int32_t iop_inbound_queue_port; /*0058 005B*/ 736 u_int32_t iop_outbound_queue_port; /*005C 005F*/ 737 u_int32_t inbound_free_list_index; /*0060 0063*/ 738 u_int32_t inbound_post_list_index; /*0064 0067*/ 739 u_int32_t outbound_free_list_index; /*0068 006B*/ 740 u_int32_t outbound_post_list_index; /*006C 006F*/ 741 u_int32_t inbound_doorbell_clear; /*0070 0073*/ 742 u_int32_t i2o_message_unit_control; /*0074 0077*/ 743 u_int32_t last_used_message_source_address_low; /*0078 007B*/ 744 u_int32_t last_used_message_source_address_high; /*007C 007F*/ 745 u_int32_t pull_mode_data_byte_count[4]; /*0080 008F*/ 746 u_int32_t message_dest_address_index; /*0090 0093*/ 747 u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/ 748 u_int32_t utility_A_int_counter_timer; /*0098 009B*/ 749 u_int32_t outbound_doorbell; /*009C 009F*/ 750 u_int32_t outbound_doorbell_clear; /*00A0 00A3*/ 751 u_int32_t message_source_address_index; /*00A4 00A7*/ 752 u_int32_t message_done_queue_index; /*00A8 00AB*/ 753 u_int32_t reserved0; /*00AC 00AF*/ 754 u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/ 755 u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/ 756 u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/ 757 u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/ 758 u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/ 759 u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/ 760 u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/ 761 u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/ 762 u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/ 763 u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/ 764 u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/ 765 u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/ 766 u_int32_t message_dest_queue_port_low; /*00E0 00E3*/ 767 u_int32_t message_dest_queue_port_high; /*00E4 00E7*/ 768 u_int32_t last_used_message_dest_address_low; /*00E8 00EB*/ 769 u_int32_t last_used_message_dest_address_high; /*00EC 00EF*/ 770 u_int32_t message_done_queue_base_address_low; /*00F0 00F3*/ 771 u_int32_t message_done_queue_base_address_high; /*00F4 00F7*/ 772 u_int32_t host_diagnostic; /*00F8 00FB*/ 773 u_int32_t write_sequence; /*00FC 00FF*/ 774 u_int32_t reserved1[46]; /*0100 01B7*/ 775 u_int32_t reply_post_producer_index; /*01B8 01BB*/ 776 u_int32_t reply_post_consumer_index; /*01BC 01BF*/ 777 u_int32_t reserved2[1936]; /*01C0 1FFF*/ 778 u_int32_t message_wbuffer[32]; /*2000 207F*/ 779 u_int32_t reserved3[32]; /*2080 20FF*/ 780 u_int32_t message_rbuffer[32]; /*2100 217F*/ 781 u_int32_t reserved4[32]; /*2180 21FF*/ 782 u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/ 783 }; 784 785 typedef struct deliver_completeQ { 786 u_int16_t cmdFlag; 787 u_int16_t cmdSMID; 788 u_int16_t cmdLMID; // reserved (0) 789 u_int16_t cmdFlag2; // reserved (0) 790 } DeliverQ, CompletionQ, *pDeliver_Q, *pCompletion_Q; 791 792 #define COMPLETION_Q_POOL_SIZE (sizeof(struct deliver_completeQ) * 512 + 128) 793 794 /* 795 ********************************************************************* 796 ** 797 ********************************************************************* 798 */ 799 struct MessageUnit_UNION 800 { 801 union { 802 struct HBA_MessageUnit hbamu; 803 struct HBB_MessageUnit hbbmu; 804 struct HBC_MessageUnit hbcmu; 805 struct HBD_MessageUnit0 hbdmu; 806 struct HBE_MessageUnit hbemu; 807 } muu; 808 }; 809 /* 810 ************************************************************* 811 ** structure for holding DMA address data 812 ************************************************************* 813 */ 814 #define IS_SG64_ADDR 0x01000000 /* bit24 */ 815 /* 816 ************************************************************************************************ 817 ** ARECA FIRMWARE SPEC 818 ************************************************************************************************ 819 ** Usage of IOP331 adapter 820 ** (All In/Out is in IOP331's view) 821 ** 1. Message 0 --> InitThread message and retrun code 822 ** 2. Doorbell is used for RS-232 emulation 823 ** inDoorBell : bit0 -- data in ready (DRIVER DATA WRITE OK) 824 ** bit1 -- data out has been read (DRIVER DATA READ OK) 825 ** outDooeBell: bit0 -- data out ready (IOP331 DATA WRITE OK) 826 ** bit1 -- data in has been read (IOP331 DATA READ OK) 827 ** 3. Index Memory Usage 828 ** offset 0xf00 : for RS232 out (request buffer) 829 ** offset 0xe00 : for RS232 in (scratch buffer) 830 ** offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331) 831 ** offset 0xa00 : for outbound message code msgcode_rwbuffer (IOP331 send to driver) 832 ** 4. RS-232 emulation 833 ** Currently 128 byte buffer is used 834 ** 1st u_int32_t : Data length (1--124) 835 ** Byte 4--127 : Max 124 bytes of data 836 ** 5. PostQ 837 ** All SCSI Command must be sent through postQ: 838 ** (inbound queue port) Request frame must be 32 bytes aligned 839 ** # bit27--bit31 => flag for post ccb 840 ** # bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb 841 ** bit31 : 0 : 256 bytes frame 842 ** 1 : 512 bytes frame 843 ** bit30 : 0 : normal request 844 ** 1 : BIOS request 845 ** bit29 : reserved 846 ** bit28 : reserved 847 ** bit27 : reserved 848 ** ------------------------------------------------------------------------------- 849 ** (outbount queue port) Request reply 850 ** # bit27--bit31 => flag for reply 851 ** # bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb 852 ** bit31 : must be 0 (for this type of reply) 853 ** bit30 : reserved for BIOS handshake 854 ** bit29 : reserved 855 ** bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData 856 ** 1 : Error, error code in AdapStatus/DevStatus/SenseData 857 ** bit27 : reserved 858 ** 6. BIOS request 859 ** All BIOS request is the same with request from PostQ 860 ** Except : 861 ** Request frame is sent from configuration space 862 ** offset: 0x78 : Request Frame (bit30 == 1) 863 ** offset: 0x18 : writeonly to generate IRQ to IOP331 864 ** Completion of request: 865 ** (bit30 == 0, bit28==err flag) 866 ** 7. Definition of SGL entry (structure) 867 ** 8. Message1 Out - Diag Status Code (????) 868 ** 9. Message0 message code : 869 ** 0x00 : NOP 870 ** 0x01 : Get Config ->offset 0xa00 :for outbound message code msgcode_rwbuffer (IOP331 send to driver) 871 ** Signature 0x87974060(4) 872 ** Request len 0x00000200(4) 873 ** numbers of queue 0x00000100(4) 874 ** SDRAM Size 0x00000100(4)-->256 MB 875 ** IDE Channels 0x00000008(4) 876 ** vendor 40 bytes char 877 ** model 8 bytes char 878 ** FirmVer 16 bytes char 879 ** Device Map 16 bytes char 880 ** 881 ** FirmwareVersion DWORD <== Added for checking of new firmware capability 882 ** 0x02 : Set Config ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331) 883 ** Signature 0x87974063(4) 884 ** UPPER32 of Request Frame (4)-->Driver Only 885 ** 0x03 : Reset (Abort all queued Command) 886 ** 0x04 : Stop Background Activity 887 ** 0x05 : Flush Cache 888 ** 0x06 : Start Background Activity (re-start if background is halted) 889 ** 0x07 : Check If Host Command Pending (Novell May Need This Function) 890 ** 0x08 : Set controller time ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver to IOP331) 891 ** byte 0 : 0xaa <-- signature 892 ** byte 1 : 0x55 <-- signature 893 ** byte 2 : year (04) 894 ** byte 3 : month (1..12) 895 ** byte 4 : date (1..31) 896 ** byte 5 : hour (0..23) 897 ** byte 6 : minute (0..59) 898 ** byte 7 : second (0..59) 899 ** ********************************************************************************* 900 ** Porting Of LSI2108/2116 Based PCIE SAS/6G host raid adapter 901 ** ==> Difference from IOP348 902 ** <1> Message Register 0,1 (the same usage) Init Thread message and retrun code 903 ** Inbound Message 0 (inbound_msgaddr0) : at offset 0xB0 (Scratchpad0) for inbound message code msgcode_rwbuffer (driver send to IOP) 904 ** Inbound Message 1 (inbound_msgaddr1) : at offset 0xB4 (Scratchpad1) Out.... Diag Status Code 905 ** Outbound Message 0 (outbound_msgaddr0): at offset 0xB8 (Scratchpad3) Out.... Diag Status Code 906 ** Outbound Message 1 (outbound_msgaddr1): at offset 0xBC (Scratchpad2) for outbound message code msgcode_rwbuffer (IOP send to driver) 907 ** <A> use doorbell to generate interrupt 908 ** 909 ** inbound doorbell: bit3 -- inbound message 0 ready (driver to iop) 910 ** outbound doorbell: bit3 -- outbound message 0 ready (iop to driver) 911 ** 912 ** a. Message1: Out - Diag Status Code (????) 913 ** 914 ** b. Message0: message code 915 ** 0x00 : NOP 916 ** 0x01 : Get Config ->offset 0xB8 :for outbound message code msgcode_rwbuffer (IOP send to driver) 917 ** Signature 0x87974060(4) 918 ** Request len 0x00000200(4) 919 ** numbers of queue 0x00000100(4) 920 ** SDRAM Size 0x00000100(4)-->256 MB 921 ** IDE Channels 0x00000008(4) 922 ** vendor 40 bytes char 923 ** model 8 bytes char 924 ** FirmVer 16 bytes char 925 ** Device Map 16 bytes char 926 ** cfgVersion ULONG <== Added for checking of new firmware capability 927 ** 0x02 : Set Config ->offset 0xB0 :for inbound message code msgcode_rwbuffer (driver send to IOP) 928 ** Signature 0x87974063(4) 929 ** UPPER32 of Request Frame (4)-->Driver Only 930 ** 0x03 : Reset (Abort all queued Command) 931 ** 0x04 : Stop Background Activity 932 ** 0x05 : Flush Cache 933 ** 0x06 : Start Background Activity (re-start if background is halted) 934 ** 0x07 : Check If Host Command Pending (Novell May Need This Function) 935 ** 0x08 : Set controller time ->offset 0xB0 : for inbound message code msgcode_rwbuffer (driver to IOP) 936 ** byte 0 : 0xaa <-- signature 937 ** byte 1 : 0x55 <-- signature 938 ** byte 2 : year (04) 939 ** byte 3 : month (1..12) 940 ** byte 4 : date (1..31) 941 ** byte 5 : hour (0..23) 942 ** byte 6 : minute (0..59) 943 ** byte 7 : second (0..59) 944 ** 945 ** <2> Doorbell Register is used for RS-232 emulation 946 ** <A> different clear register 947 ** <B> different bit0 definition (bit0 is reserved) 948 ** 949 ** inbound doorbell : at offset 0x20 950 ** inbound doorbell clear : at offset 0x70 951 ** 952 ** inbound doorbell : bit0 -- reserved 953 ** bit1 -- data in ready (DRIVER DATA WRITE OK) 954 ** bit2 -- data out has been read (DRIVER DATA READ OK) 955 ** bit3 -- inbound message 0 ready 956 ** bit4 -- more than 12 request completed in a time 957 ** 958 ** outbound doorbell : at offset 0x9C 959 ** outbound doorbell clear : at offset 0xA0 960 ** 961 ** outbound doorbell : bit0 -- reserved 962 ** bit1 -- data out ready (IOP DATA WRITE OK) 963 ** bit2 -- data in has been read (IOP DATA READ OK) 964 ** bit3 -- outbound message 0 ready 965 ** 966 ** <3> Index Memory Usage (Buffer Area) 967 ** COMPORT_IN at 0x2000: message_wbuffer -- 128 bytes (to be sent to ROC) : for RS232 in (scratch buffer) 968 ** COMPORT_OUT at 0x2100: message_rbuffer -- 128 bytes (to be sent to host): for RS232 out (request buffer) 969 ** BIOS_CFG_AREA at 0x2200: msgcode_rwbuffer -- 1024 bytes for outbound message code msgcode_rwbuffer (IOP send to driver) 970 ** BIOS_CFG_AREA at 0x2200: msgcode_rwbuffer -- 1024 bytes for inbound message code msgcode_rwbuffer (driver send to IOP) 971 ** 972 ** <4> PostQ (Command Post Address) 973 ** All SCSI Command must be sent through postQ: 974 ** inbound queue port32 at offset 0x40 , 0x41, 0x42, 0x43 975 ** inbound queue port64 at offset 0xC0 (lower)/0xC4 (upper) 976 ** outbound queue port32 at offset 0x44 977 ** outbound queue port64 at offset 0xC8 (lower)/0xCC (upper) 978 ** <A> For 32bit queue, access low part is enough to send/receive request 979 ** i.e. write 0x40/0xC0, ROC will get the request with high part == 0, the 980 ** same for outbound queue port 981 ** <B> For 64bit queue, if 64bit instruction is supported, use 64bit instruction 982 ** to post inbound request in a single instruction, and use 64bit instruction 983 ** to retrieve outbound request in a single instruction. 984 ** If in 32bit environment, when sending inbound queue, write high part first 985 ** then write low part. For receiving outbound request, read high part first 986 ** then low part, to check queue empty, ONLY check high part to be 0xFFFFFFFF. 987 ** If high part is 0xFFFFFFFF, DO NOT read low part, this may corrupt the 988 ** consistency of the FIFO. Another way to check empty is to check status flag 989 ** at 0x30 bit3. 990 ** <C> Post Address IS NOT shifted (must be 16 bytes aligned) 991 ** For BIOS, 16bytes aligned is OK 992 ** For Driver, 32bytes alignment is recommended. 993 ** POST Command bit0 to bit3 is defined differently 994 ** ---------------------------- 995 ** bit0:1 for PULL mode (must be 1) 996 ** ---------------------------- 997 ** bit3/2/1: for arcmsr cdb size (arccdbsize) 998 ** 000: <= 0x0080 (128) 999 ** 001: <= 0x0100 (256) 1000 ** 010: <= 0x0180 (384) 1001 ** 011: <= 0x0200 (512) 1002 ** 100: <= 0x0280 (640) 1003 ** 101: <= 0x0300 (768) 1004 ** 110: <= 0x0300 (reserved) 1005 ** 111: <= 0x0300 (reserved) 1006 ** ----------------------------- 1007 ** if len > 0x300 the len always set as 0x300 1008 ** ----------------------------- 1009 ** post addr = addr | ((len-1) >> 6) | 1 1010 ** ----------------------------- 1011 ** page length in command buffer still required, 1012 ** 1013 ** if page length > 3, 1014 ** firmware will assume more request data need to be retrieved 1015 ** 1016 ** <D> Outbound Posting 1017 ** bit0:0 , no error, 1 with error, refer to status buffer 1018 ** bit1:0 , reserved (will be 0) 1019 ** bit2:0 , reserved (will be 0) 1020 ** bit3:0 , reserved (will be 0) 1021 ** bit63-4: Completed command address 1022 ** 1023 ** <E> BIOS support, no special support is required. 1024 ** LSI2108 support I/O register 1025 ** All driver functionality is supported through I/O address 1026 ** 1027 ************************************************************************************************ 1028 */ 1029 /* 1030 ********************************** 1031 ** 1032 ********************************** 1033 */ 1034 /* size 8 bytes */ 1035 /* 32bit Scatter-Gather list */ 1036 struct SG32ENTRY { /* length bit 24 == 0 */ 1037 u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ 1038 u_int32_t address; 1039 }; 1040 /* size 12 bytes */ 1041 /* 64bit Scatter-Gather list */ 1042 struct SG64ENTRY { /* length bit 24 == 1 */ 1043 u_int32_t length; /* high 8 bit == flag,low 24 bit == length */ 1044 u_int32_t address; 1045 u_int32_t addresshigh; 1046 }; 1047 struct SGENTRY_UNION { 1048 union { 1049 struct SG32ENTRY sg32entry; /* 30h Scatter gather address */ 1050 struct SG64ENTRY sg64entry; /* 30h */ 1051 }u; 1052 }; 1053 /* 1054 ********************************** 1055 ** 1056 ********************************** 1057 */ 1058 struct QBUFFER { 1059 u_int32_t data_len; 1060 u_int8_t data[124]; 1061 }; 1062 /* 1063 ********************************** 1064 */ 1065 typedef struct PHYS_ADDR64 { 1066 u_int32_t phyadd_low; 1067 u_int32_t phyadd_high; 1068 }PHYSADDR64; 1069 /* 1070 ************************************************************************************************ 1071 ** FIRMWARE INFO 1072 ************************************************************************************************ 1073 */ 1074 #define ARCMSR_FW_MODEL_OFFSET 15 1075 #define ARCMSR_FW_VERS_OFFSET 17 1076 #define ARCMSR_FW_DEVMAP_OFFSET 21 1077 #define ARCMSR_FW_CFGVER_OFFSET 25 1078 1079 struct FIRMWARE_INFO { 1080 u_int32_t signature; /*0,00-03*/ 1081 u_int32_t request_len; /*1,04-07*/ 1082 u_int32_t numbers_queue; /*2,08-11*/ 1083 u_int32_t sdram_size; /*3,12-15*/ 1084 u_int32_t ide_channels; /*4,16-19*/ 1085 char vendor[40]; /*5,20-59*/ 1086 char model[8]; /*15,60-67*/ 1087 char firmware_ver[16]; /*17,68-83*/ 1088 char device_map[16]; /*21,84-99*/ 1089 u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/ 1090 char cfgSerial[16]; /*26,104-119*/ 1091 u_int32_t cfgPicStatus; /*30,120-123*/ 1092 }; 1093 /* (A) For cfgVersion in FIRMWARE_INFO 1094 ** if low BYTE (byte#0) >= 3 (version 3) 1095 ** then byte#1 report the capability of the firmware can xfer in a single request 1096 ** 1097 ** byte#1 1098 ** 0 256K 1099 ** 1 512K 1100 ** 2 1M 1101 ** 3 2M 1102 ** 4 4M 1103 ** 5 8M 1104 ** 6 16M 1105 ** (B) Byte offset 7 (Reserved1) of CDB is changed to msgPages 1106 ** Driver support new xfer method need to set this field to indicate 1107 ** large CDB block in 0x100 unit (we use 0x100 byte as one page) 1108 ** e.g. If the length of CDB including MSG header and SGL is 0x1508 1109 ** driver need to set the msgPages to 0x16 1110 ** (C) REQ_LEN_512BYTE must be used also to indicate SRB length 1111 ** e.g. CDB len msgPages REQ_LEN_512BYTE flag 1112 ** <= 0x100 1 0 1113 ** <= 0x200 2 1 1114 ** <= 0x300 3 1 1115 ** <= 0x400 4 1 1116 ** . 1117 ** . 1118 */ 1119 1120 /* 1121 ************************************************************************************************ 1122 ** size 0x1F8 (504) 1123 ************************************************************************************************ 1124 */ 1125 struct ARCMSR_CDB { 1126 u_int8_t Bus; /* 00h should be 0 */ 1127 u_int8_t TargetID; /* 01h should be 0--15 */ 1128 u_int8_t LUN; /* 02h should be 0--7 */ 1129 u_int8_t Function; /* 03h should be 1 */ 1130 1131 u_int8_t CdbLength; /* 04h not used now */ 1132 u_int8_t sgcount; /* 05h */ 1133 u_int8_t Flags; /* 06h */ 1134 u_int8_t msgPages; /* 07h */ 1135 1136 u_int32_t Context; /* 08h Address of this request */ 1137 u_int32_t DataLength; /* 0ch not used now */ 1138 1139 u_int8_t Cdb[16]; /* 10h SCSI CDB */ 1140 /* 1141 ******************************************************** 1142 ** Device Status : the same from SCSI bus if error occur 1143 ** SCSI bus status codes. 1144 ******************************************************** 1145 */ 1146 u_int8_t DeviceStatus; /* 20h if error */ 1147 1148 u_int8_t SenseData[15]; /* 21h output */ 1149 1150 union { 1151 struct SG32ENTRY sg32entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h Scatter gather address */ 1152 struct SG64ENTRY sg64entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h */ 1153 } u; 1154 }; 1155 /* CDB flag */ 1156 #define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01 /* bit 0: 0(256) / 1(512) bytes */ 1157 #define ARCMSR_CDB_FLAG_BIOS 0x02 /* bit 1: 0(from driver) / 1(from BIOS) */ 1158 #define ARCMSR_CDB_FLAG_WRITE 0x04 /* bit 2: 0(Data in) / 1(Data out) */ 1159 #define ARCMSR_CDB_FLAG_SIMPLEQ 0x00 /* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */ 1160 #define ARCMSR_CDB_FLAG_HEADQ 0x08 1161 #define ARCMSR_CDB_FLAG_ORDEREDQ 0x10 1162 /* scsi status */ 1163 #define SCSISTAT_GOOD 0x00 1164 #define SCSISTAT_CHECK_CONDITION 0x02 1165 #define SCSISTAT_CONDITION_MET 0x04 1166 #define SCSISTAT_BUSY 0x08 1167 #define SCSISTAT_INTERMEDIATE 0x10 1168 #define SCSISTAT_INTERMEDIATE_COND_MET 0x14 1169 #define SCSISTAT_RESERVATION_CONFLICT 0x18 1170 #define SCSISTAT_COMMAND_TERMINATED 0x22 1171 #define SCSISTAT_QUEUE_FULL 0x28 1172 /* DeviceStatus */ 1173 #define ARCMSR_DEV_SELECT_TIMEOUT 0xF0 1174 #define ARCMSR_DEV_ABORTED 0xF1 1175 #define ARCMSR_DEV_INIT_FAIL 0xF2 1176 /* 1177 ********************************************************************* 1178 ** Command Control Block (SrbExtension) 1179 ** SRB must be not cross page boundary,and the order from offset 0 1180 ** structure describing an ATA disk request 1181 ** this SRB length must be 32 bytes boundary 1182 ********************************************************************* 1183 */ 1184 struct CommandControlBlock { 1185 struct ARCMSR_CDB arcmsr_cdb; /* 0 -503 (size of CDB=504): arcmsr messenger scsi command descriptor size 504 bytes */ 1186 u_int32_t cdb_phyaddr_low; /* 504-507 */ 1187 u_int32_t arc_cdb_size; /* 508-511 */ 1188 /* ======================512+32 bytes============================ */ 1189 union ccb *pccb; /* 512-515 516-519 pointer of freebsd scsi command */ 1190 struct AdapterControlBlock *acb; /* 520-523 524-527 */ 1191 bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */ 1192 u_int16_t srb_flags; /* 536-537 */ 1193 u_int16_t srb_state; /* 538-539 */ 1194 u_int32_t cdb_phyaddr_high; /* 540-543 */ 1195 struct callout ccb_callout; 1196 u_int32_t smid; 1197 /* ========================================================== */ 1198 }; 1199 /* srb_flags */ 1200 #define SRB_FLAG_READ 0x0000 1201 #define SRB_FLAG_WRITE 0x0001 1202 #define SRB_FLAG_ERROR 0x0002 1203 #define SRB_FLAG_FLUSHCACHE 0x0004 1204 #define SRB_FLAG_MASTER_ABORTED 0x0008 1205 #define SRB_FLAG_DMAVALID 0x0010 1206 #define SRB_FLAG_DMACONSISTENT 0x0020 1207 #define SRB_FLAG_DMAWRITE 0x0040 1208 #define SRB_FLAG_PKTBIND 0x0080 1209 #define SRB_FLAG_TIMER_START 0x0080 1210 /* srb_state */ 1211 #define ARCMSR_SRB_DONE 0x0000 1212 #define ARCMSR_SRB_UNBUILD 0x0000 1213 #define ARCMSR_SRB_TIMEOUT 0x1111 1214 #define ARCMSR_SRB_RETRY 0x2222 1215 #define ARCMSR_SRB_START 0x55AA 1216 #define ARCMSR_SRB_PENDING 0xAA55 1217 #define ARCMSR_SRB_RESET 0xA5A5 1218 #define ARCMSR_SRB_ABORTED 0x5A5A 1219 #define ARCMSR_SRB_ILLEGAL 0xFFFF 1220 1221 #define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0) 1222 #define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM) 1223 1224 /* 1225 ********************************************************************* 1226 ** Adapter Control Block 1227 ********************************************************************* 1228 */ 1229 #define ACB_ADAPTER_TYPE_A 0x00000000 /* hba I IOP */ 1230 #define ACB_ADAPTER_TYPE_B 0x00000001 /* hbb M IOP */ 1231 #define ACB_ADAPTER_TYPE_C 0x00000002 /* hbc L IOP */ 1232 #define ACB_ADAPTER_TYPE_D 0x00000003 /* hbd M IOP */ 1233 #define ACB_ADAPTER_TYPE_E 0x00000004 /* hbd L IOP */ 1234 1235 struct AdapterControlBlock { 1236 u_int32_t adapter_type; /* adapter A,B..... */ 1237 1238 bus_space_tag_t btag[2]; 1239 bus_space_handle_t bhandle[2]; 1240 bus_dma_tag_t parent_dmat; 1241 bus_dma_tag_t dm_segs_dmat; /* dmat for buffer I/O */ 1242 bus_dma_tag_t srb_dmat; /* dmat for freesrb */ 1243 bus_dmamap_t srb_dmamap; 1244 device_t pci_dev; 1245 struct cdev *ioctl_dev; 1246 int pci_unit; 1247 1248 struct resource *sys_res_arcmsr[2]; 1249 struct resource *irqres[ARCMSR_NUM_MSIX_VECTORS]; 1250 void *ih[ARCMSR_NUM_MSIX_VECTORS]; /* interrupt handle */ 1251 int irq_id[ARCMSR_NUM_MSIX_VECTORS]; 1252 int irq_type; 1253 1254 /* Hooks into the CAM XPT */ 1255 struct cam_sim *psim; 1256 struct cam_path *ppath; 1257 u_int8_t *uncacheptr; 1258 unsigned long vir2phy_offset; 1259 union { 1260 unsigned long phyaddr; 1261 struct { 1262 u_int32_t phyadd_low; 1263 u_int32_t phyadd_high; 1264 }B; 1265 }srb_phyaddr; 1266 // unsigned long srb_phyaddr; 1267 /* Offset is used in making arc cdb physical to virtual calculations */ 1268 u_int32_t outbound_int_enable; 1269 1270 struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */ 1271 1272 u_int8_t adapter_index; 1273 u_int8_t irq; 1274 u_int16_t acb_flags; 1275 1276 struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */ 1277 struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */ 1278 int32_t workingsrb_doneindex; /* done srb array index */ 1279 int32_t workingsrb_startindex; /* start srb array index */ 1280 int32_t srboutstandingcount; 1281 1282 u_int8_t rqbuffer[ARCMSR_MAX_QBUFFER]; /* data collection buffer for read from 80331 */ 1283 u_int32_t rqbuf_firstindex; /* first of read buffer */ 1284 u_int32_t rqbuf_lastindex; /* last of read buffer */ 1285 1286 u_int8_t wqbuffer[ARCMSR_MAX_QBUFFER]; /* data collection buffer for write to 80331 */ 1287 u_int32_t wqbuf_firstindex; /* first of write buffer */ 1288 u_int32_t wqbuf_lastindex; /* last of write buffer */ 1289 1290 arcmsr_lock_t isr_lock; 1291 arcmsr_lock_t srb_lock; 1292 arcmsr_lock_t postDone_lock; 1293 arcmsr_lock_t qbuffer_lock; 1294 arcmsr_lock_t io_lock; 1295 arcmsr_lock_t sim_lock; 1296 1297 u_int8_t devstate[ARCMSR_MAX_TARGETID][ARCMSR_MAX_TARGETLUN]; /* id0 ..... id15,lun0...lun7 */ 1298 u_int32_t num_resets; 1299 u_int32_t num_aborts; 1300 u_int32_t firm_request_len; /*1,04-07*/ 1301 u_int32_t firm_numbers_queue; /*2,08-11*/ 1302 u_int32_t firm_sdram_size; /*3,12-15*/ 1303 u_int32_t firm_ide_channels; /*4,16-19*/ 1304 u_int32_t firm_cfg_version; 1305 char firm_model[12]; /*15,60-67*/ 1306 char firm_version[20]; /*17,68-83*/ 1307 char device_map[20]; /*21,84-99 */ 1308 struct callout devmap_callout; 1309 u_int32_t pktRequestCount; 1310 u_int32_t pktReturnCount; 1311 u_int32_t vendor_device_id; 1312 u_int32_t adapter_bus_speed; 1313 u_int32_t maxOutstanding; 1314 u_int16_t sub_device_id; 1315 u_int32_t doneq_index; 1316 u_int32_t in_doorbell; 1317 u_int32_t out_doorbell; 1318 u_int32_t completionQ_entry; 1319 pCompletion_Q pCompletionQ; 1320 int msix_vectors; 1321 int rid[2]; 1322 };/* HW_DEVICE_EXTENSION */ 1323 /* acb_flags */ 1324 #define ACB_F_SCSISTOPADAPTER 0x0001 1325 #define ACB_F_MSG_STOP_BGRB 0x0002 /* stop RAID background rebuild */ 1326 #define ACB_F_MSG_START_BGRB 0x0004 /* stop RAID background rebuild */ 1327 #define ACB_F_IOPDATA_OVERFLOW 0x0008 /* iop ioctl data rqbuffer overflow */ 1328 #define ACB_F_MESSAGE_WQBUFFER_CLEARED 0x0010 /* ioctl clear wqbuffer */ 1329 #define ACB_F_MESSAGE_RQBUFFER_CLEARED 0x0020 /* ioctl clear rqbuffer */ 1330 #define ACB_F_MESSAGE_WQBUFFER_READ 0x0040 1331 #define ACB_F_BUS_RESET 0x0080 1332 #define ACB_F_IOP_INITED 0x0100 /* iop init */ 1333 #define ACB_F_MAPFREESRB_FAILD 0x0200 /* arcmsr_map_freesrb faild */ 1334 #define ACB_F_CAM_DEV_QFRZN 0x0400 1335 #define ACB_F_BUS_HANG_ON 0x0800 /* need hardware reset bus */ 1336 #define ACB_F_SRB_FUNCTION_POWER 0x1000 1337 #define ACB_F_MSIX_ENABLED 0x2000 1338 /* devstate */ 1339 #define ARECA_RAID_GONE 0x55 1340 #define ARECA_RAID_GOOD 0xaa 1341 /* adapter_bus_speed */ 1342 #define ACB_BUS_SPEED_3G 0 1343 #define ACB_BUS_SPEED_6G 1 1344 #define ACB_BUS_SPEED_12G 2 1345 /* 1346 ************************************************************* 1347 ************************************************************* 1348 */ 1349 struct SENSE_DATA { 1350 u_int8_t ErrorCode:7; 1351 u_int8_t Valid:1; 1352 u_int8_t SegmentNumber; 1353 u_int8_t SenseKey:4; 1354 u_int8_t Reserved:1; 1355 u_int8_t IncorrectLength:1; 1356 u_int8_t EndOfMedia:1; 1357 u_int8_t FileMark:1; 1358 u_int8_t Information[4]; 1359 u_int8_t AdditionalSenseLength; 1360 u_int8_t CommandSpecificInformation[4]; 1361 u_int8_t AdditionalSenseCode; 1362 u_int8_t AdditionalSenseCodeQualifier; 1363 u_int8_t FieldReplaceableUnitCode; 1364 u_int8_t SenseKeySpecific[3]; 1365 }; 1366 /* 1367 ********************************** 1368 ** Peripheral Device Type definitions 1369 ********************************** 1370 */ 1371 #define SCSI_DASD 0x00 /* Direct-access Device */ 1372 #define SCSI_SEQACESS 0x01 /* Sequential-access device */ 1373 #define SCSI_PRINTER 0x02 /* Printer device */ 1374 #define SCSI_PROCESSOR 0x03 /* Processor device */ 1375 #define SCSI_WRITEONCE 0x04 /* Write-once device */ 1376 #define SCSI_CDROM 0x05 /* CD-ROM device */ 1377 #define SCSI_SCANNER 0x06 /* Scanner device */ 1378 #define SCSI_OPTICAL 0x07 /* Optical memory device */ 1379 #define SCSI_MEDCHGR 0x08 /* Medium changer device */ 1380 #define SCSI_COMM 0x09 /* Communications device */ 1381 #define SCSI_NODEV 0x1F /* Unknown or no device type */ 1382 /* 1383 ************************************************************************************************************ 1384 ** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1385 ** 80331 PCI-to-PCI Bridge 1386 ** PCI Configuration Space 1387 ** 1388 ** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 1389 ** Programming Interface 1390 ** ======================== 1391 ** Configuration Register Address Space Groupings and Ranges 1392 ** ============================================================= 1393 ** Register Group Configuration Offset 1394 ** ------------------------------------------------------------- 1395 ** Standard PCI Configuration 00-3Fh 1396 ** ------------------------------------------------------------- 1397 ** Device Specific Registers 40-A7h 1398 ** ------------------------------------------------------------- 1399 ** Reserved A8-CBh 1400 ** ------------------------------------------------------------- 1401 ** Enhanced Capability List CC-FFh 1402 ** ========================================================================================================== 1403 ** Standard PCI [Type 1] Configuration Space Address Map 1404 ** ********************************************************************************************************** 1405 ** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configu-ration Byte Offset 1406 ** ---------------------------------------------------------------------------------------------------------- 1407 ** | Device ID | Vendor ID | 00h 1408 ** ---------------------------------------------------------------------------------------------------------- 1409 ** | Primary Status | Primary Command | 04h 1410 ** ---------------------------------------------------------------------------------------------------------- 1411 ** | Class Code | RevID | 08h 1412 ** ---------------------------------------------------------------------------------------------------------- 1413 ** | reserved | Header Type | Primary MLT | Primary CLS | 0Ch 1414 ** ---------------------------------------------------------------------------------------------------------- 1415 ** | Reserved | 10h 1416 ** ---------------------------------------------------------------------------------------------------------- 1417 ** | Reserved | 14h 1418 ** ---------------------------------------------------------------------------------------------------------- 1419 ** | Secondary MLT | Subordinate Bus Number | Secondary Bus Number | Primary Bus Number | 18h 1420 ** ---------------------------------------------------------------------------------------------------------- 1421 ** | Secondary Status | I/O Limit | I/O Base | 1Ch 1422 ** ---------------------------------------------------------------------------------------------------------- 1423 ** | Non-prefetchable Memory Limit Address | Non-prefetchable Memory Base Address | 20h 1424 ** ---------------------------------------------------------------------------------------------------------- 1425 ** | Prefetchable Memory Limit Address | Prefetchable Memory Base Address | 24h 1426 ** ---------------------------------------------------------------------------------------------------------- 1427 ** | Prefetchable Memory Base Address Upper 32 Bits | 28h 1428 ** ---------------------------------------------------------------------------------------------------------- 1429 ** | Prefetchable Memory Limit Address Upper 32 Bits | 2Ch 1430 ** ---------------------------------------------------------------------------------------------------------- 1431 ** | I/O Limit Upper 16 Bits | I/O Base Upper 16 | 30h 1432 ** ---------------------------------------------------------------------------------------------------------- 1433 ** | Reserved | Capabilities Pointer | 34h 1434 ** ---------------------------------------------------------------------------------------------------------- 1435 ** | Reserved | 38h 1436 ** ---------------------------------------------------------------------------------------------------------- 1437 ** | Bridge Control | Primary Interrupt Pin | Primary Interrupt Line | 3Ch 1438 **============================================================================================================= 1439 */ 1440 /* 1441 **============================================================================================================= 1442 ** 0x03-0x00 : 1443 ** Bit Default Description 1444 **31:16 0335h Device ID (DID): Indicates the unique device ID that is assigned to bridge by the PCI SIG. 1445 ** ID is unique per product speed as indicated. 1446 **15:00 8086h Vendor ID (VID): 16-bit field which indicates that Intel is the vendor. 1447 **============================================================================================================= 1448 */ 1449 #define ARCMSR_PCI2PCI_VENDORID_REG 0x00 /*word*/ 1450 #define ARCMSR_PCI2PCI_DEVICEID_REG 0x02 /*word*/ 1451 /* 1452 **============================================================================== 1453 ** 0x05-0x04 : command register 1454 ** Bit Default Description 1455 **15:11 00h Reserved 1456 ** 10 0 Interrupt Disable: Disables/Enables the generation of Interrupts on the primary bus. 1457 ** The bridge does not support interrupts. 1458 ** 09 0 FB2B Enable: Enables/Disables the generation of fast back to back 1459 ** transactions on the primary bus. 1460 ** The bridge does not generate fast back to back 1461 ** transactions on the primary bus. 1462 ** 08 0 SERR# Enable (SEE): Enables primary bus SERR# assertions. 1463 ** 0=The bridge does not assert P_SERR#. 1464 ** 1=The bridge may assert P_SERR#, subject to other programmable criteria. 1465 ** 07 0 Wait Cycle Control (WCC): Always returns 0bzero indicating 1466 ** that bridge does not perform address or data stepping, 1467 ** 06 0 Parity Error Response (PER): Controls bridge response to a detected primary bus parity error. 1468 ** 0=When a data parity error is detected bridge does not assert S_PERR#. 1469 ** Also bridge does not assert P_SERR# in response to 1470 ** a detected address or attribute parity error. 1471 ** 1=When a data parity error is detected bridge asserts S_PERR#. 1472 ** The bridge also asserts P_SERR# 1473 ** (when enabled globally via bit(8) of this register) 1474 ** in response to a detected address or attribute parity error. 1475 ** 05 0 VGA Palette Snoop Enable (VGA_PSE): Controls bridge response to VGA-compatible palette write transactions. 1476 ** VGA palette write transactions are I/O transactions 1477 ** whose address bits are: P_AD[9:0] equal to 3C6h, 3C8h or 3C9h 1478 ** P_AD[15:10] are not decoded (i.e. aliases are claimed), 1479 ** or are fully decoding 1480 ** (i.e., must be all 0's depending upon the VGA 1481 ** aliasing bit in the Bridge Control Register, offset 3Eh. 1482 ** P_AD[31:16] equal to 0000h 1483 ** 0=The bridge ignores VGA palette write transactions, 1484 ** unless decoded by the standard I/O address range window. 1485 ** 1=The bridge responds to VGA palette write transactions 1486 ** with medium DEVSEL# timing and forwards them to the secondary bus. 1487 ** 04 0 Memory Write and Invalidate Enable (MWIE): The bridge does not promote MW transactions to MWI transactions. 1488 ** MWI transactions targeting resources on the opposite side of the bridge, 1489 ** however, are forwarded as MWI transactions. 1490 ** 03 0 Special Cycle Enable (SCE): The bridge ignores special cycle transactions. 1491 ** This bit is read only and always returns 0 when read 1492 ** 02 0 Bus Master Enable (BME): Enables bridge to initiate memory and I/O transactions on the primary interface. 1493 ** Initiation of configuration transactions is not affected by the state of this bit. 1494 ** 0=The bridge does not initiate memory or I/O transactions on the primary interface. 1495 ** 1=The bridge is enabled to function as an initiator on the primary interface. 1496 ** 01 0 Memory Space Enable (MSE): Controls target response to memory transactions on the primary interface. 1497 ** 0=The bridge target response to memory transactions on the primary interface is disabled. 1498 ** 1=The bridge target response to memory transactions on the primary interface is enabled. 1499 ** 00 0 I/O Space Enable (IOSE): Controls target response to I/O transactions on the primary interface. 1500 ** 0=The bridge target response to I/O transactions on the primary interface is disabled. 1501 ** 1=The bridge target response to I/O transactions on the primary interface is enabled. 1502 **============================================================================== 1503 */ 1504 #define ARCMSR_PCI2PCI_PRIMARY_COMMAND_REG 0x04 /*word*/ 1505 #define PCI_DISABLE_INTERRUPT 0x0400 1506 /* 1507 **============================================================================== 1508 ** 0x07-0x06 : status register 1509 ** Bit Default Description 1510 ** 15 0 Detected Parity Error: The bridge sets this bit to a 1b whenever it detects an address, 1511 ** attribute or data parity error. 1512 ** This bit is set regardless of the state of the PER bit in the command register. 1513 ** 14 0 Signaled System Error: The bridge sets this bit to a 1b whenever it asserts SERR# on the primary bus. 1514 ** 13 0 Received Master Abort: The bridge sets this bit to a 1b when, 1515 ** acting as the initiator on the primary bus, 1516 ** its transaction (with the exception of special cycles) 1517 ** has been terminated with a Master Abort. 1518 ** 12 0 Received Target Abort: The bridge sets this bit to a 1b when, 1519 ** acting as the initiator on the primary bus, 1520 ** its transaction has been terminated with a Target Abort. 1521 ** 11 0 Signaled Target Abort: The bridge sets this bit to a 1b when it, 1522 ** as the target of a transaction, terminates it with a Target Abort. 1523 ** In PCI-X mode this bit is also set when it forwards a SCM with a target abort error code. 1524 ** 10:09 01 DEVSEL# Timing: Indicates slowest response to a non-configuration command on the primary interface. 1525 ** Returns "01b" when read, indicating that bridge responds no slower than with medium timing. 1526 ** 08 0 Master Data Parity Error: The bridge sets this bit to a 1b when all of the following conditions are true: 1527 ** The bridge is the current master on the primary bus 1528 ** S_PERR# is detected asserted or is asserted by bridge 1529 ** The Parity Error Response bit is set in the Command register 1530 ** 07 1 Fast Back to Back Capable: Returns a 1b when read indicating that bridge 1531 ** is able to respond to fast back to back transactions on its primary interface. 1532 ** 06 0 Reserved 1533 ** 05 1 66 MHz Capable Indication: Returns a 1b when read indicating that bridge primary interface is 66 MHz capable. 1534 ** 1 = 1535 ** 04 1 Capabilities List Enable: Returns 1b when read indicating that bridge supports PCI standard enhanced capabilities. 1536 ** Offset 34h (Capability Pointer register) 1537 ** provides the offset for the first entry 1538 ** in the linked list of enhanced capabilities. 1539 ** 03 0 Interrupt Status: Reflects the state of the interrupt in the device/function. 1540 ** The bridge does not support interrupts. 1541 ** 02:00 000 Reserved 1542 **============================================================================== 1543 */ 1544 #define ARCMSR_PCI2PCI_PRIMARY_STATUS_REG 0x06 /*word: 06,07 */ 1545 #define ARCMSR_ADAP_66MHZ 0x20 1546 /* 1547 **============================================================================== 1548 ** 0x08 : revision ID 1549 ** Bit Default Description 1550 ** 07:00 00000000 Revision ID (RID): '00h' indicating bridge A-0 stepping. 1551 **============================================================================== 1552 */ 1553 #define ARCMSR_PCI2PCI_REVISIONID_REG 0x08 /*byte*/ 1554 /* 1555 **============================================================================== 1556 ** 0x0b-0x09 : 0180_00 (class code 1,native pci mode ) 1557 ** Bit Default Description 1558 ** 23:16 06h Base Class Code (BCC): Indicates that this is a bridge device. 1559 ** 15:08 04h Sub Class Code (SCC): Indicates this is of type PCI-to-PCI bridge. 1560 ** 07:00 00h Programming Interface (PIF): Indicates that this is standard (non-subtractive) PCI-PCI bridge. 1561 **============================================================================== 1562 */ 1563 #define ARCMSR_PCI2PCI_CLASSCODE_REG 0x09 /*3bytes*/ 1564 /* 1565 **============================================================================== 1566 ** 0x0c : cache line size 1567 ** Bit Default Description 1568 ** 07:00 00h Cache Line Size (CLS): Designates the cache line size in 32-bit dword units. 1569 ** The contents of this register are factored into 1570 ** internal policy decisions associated with memory read prefetching, 1571 ** and the promotion of Memory Write transactions to MWI transactions. 1572 ** Valid cache line sizes are 8 and 16 dwords. 1573 ** When the cache line size is set to an invalid value, 1574 ** bridge behaves as though the cache line size was set to 00h. 1575 **============================================================================== 1576 */ 1577 #define ARCMSR_PCI2PCI_PRIMARY_CACHELINESIZE_REG 0x0C /*byte*/ 1578 /* 1579 **============================================================================== 1580 ** 0x0d : latency timer (number of pci clock 00-ff ) 1581 ** Bit Default Description 1582 ** Primary Latency Timer (PTV): 1583 ** 07:00 00h (Conventional PCI) Conventional PCI Mode: Primary bus Master latency timer. Indicates the number of PCI clock cycles, 1584 ** referenced from the assertion of FRAME# to the expiration of the timer, 1585 ** when bridge may continue as master of the current transaction. All bits are writable, 1586 ** resulting in a granularity of 1 PCI clock cycle. 1587 ** When the timer expires (i.e., equals 00h) 1588 ** bridge relinquishes the bus after the first data transfer 1589 ** when its PCI bus grant has been deasserted. 1590 ** or 40h (PCI-X) PCI-X Mode: Primary bus Master latency timer. 1591 ** Indicates the number of PCI clock cycles, 1592 ** referenced from the assertion of FRAME# to the expiration of the timer, 1593 ** when bridge may continue as master of the current transaction. 1594 ** All bits are writable, resulting in a granularity of 1 PCI clock cycle. 1595 ** When the timer expires (i.e., equals 00h) bridge relinquishes the bus at the next ADB. 1596 ** (Except in the case where MLT expires within 3 data phases 1597 ** of an ADB.In this case bridge continues on 1598 ** until it reaches the next ADB before relinquishing the bus.) 1599 **============================================================================== 1600 */ 1601 #define ARCMSR_PCI2PCI_PRIMARY_LATENCYTIMER_REG 0x0D /*byte*/ 1602 /* 1603 **============================================================================== 1604 ** 0x0e : (header type,single function ) 1605 ** Bit Default Description 1606 ** 07 0 Multi-function device (MVD): 80331 is a single-function device. 1607 ** 06:00 01h Header Type (HTYPE): Defines the layout of addresses 10h through 3Fh in configuration space. 1608 ** Returns "01h" when read indicating 1609 ** that the register layout conforms to the standard PCI-to-PCI bridge layout. 1610 **============================================================================== 1611 */ 1612 #define ARCMSR_PCI2PCI_HEADERTYPE_REG 0x0E /*byte*/ 1613 /* 1614 **============================================================================== 1615 ** 0x0f : 1616 **============================================================================== 1617 */ 1618 /* 1619 **============================================================================== 1620 ** 0x13-0x10 : 1621 ** PCI CFG Base Address #0 (0x10) 1622 **============================================================================== 1623 */ 1624 /* 1625 **============================================================================== 1626 ** 0x17-0x14 : 1627 ** PCI CFG Base Address #1 (0x14) 1628 **============================================================================== 1629 */ 1630 /* 1631 **============================================================================== 1632 ** 0x1b-0x18 : 1633 ** PCI CFG Base Address #2 (0x18) 1634 **-----------------0x1A,0x19,0x18--Bus Number Register - BNR 1635 ** Bit Default Description 1636 ** 23:16 00h Subordinate Bus Number (SBBN): Indicates the highest PCI bus number below this bridge. 1637 ** Any Type 1 configuration cycle 1638 ** on the primary bus whose bus number is greater than the secondary bus number, 1639 ** and less than or equal to the subordinate bus number 1640 ** is forwarded unaltered as a Type 1 configuration cycle on the secondary PCI bus. 1641 ** 15:08 00h Secondary Bus Number (SCBN): Indicates the bus number of PCI to which the secondary interface is connected. 1642 ** Any Type 1 configuration cycle matching this bus number 1643 ** is translated to a Type 0 configuration cycle (or a Special Cycle) 1644 ** before being executed on bridge's secondary PCI bus. 1645 ** 07:00 00h Primary Bus Number (PBN): Indicates bridge primary bus number. 1646 ** Any Type 1 configuration cycle on the primary interface 1647 ** with a bus number that is less than the contents 1648 ** of this register field does not be claimed by bridge. 1649 **-----------------0x1B--Secondary Latency Timer Register - SLTR 1650 ** Bit Default Description 1651 ** Secondary Latency Timer (STV): 1652 ** 07:00 00h (Conventional PCI) Conventional PCI Mode: Secondary bus Master latency timer. 1653 ** Indicates the number of PCI clock cycles, 1654 ** referenced from the assertion of FRAME# to the expiration of the timer, 1655 ** when bridge may continue as master of the current transaction. All bits are writable, 1656 ** resulting in a granularity of 1 PCI clock cycle. 1657 ** When the timer expires (i.e., equals 00h) 1658 ** bridge relinquishes the bus after the first data transfer 1659 ** when its PCI bus grant has been deasserted. 1660 ** or 40h (PCI-X) PCI-X Mode: Secondary bus Master latency timer. 1661 ** Indicates the number of PCI clock cycles,referenced from the assertion of FRAME# 1662 ** to the expiration of the timer, 1663 ** when bridge may continue as master of the current transaction. All bits are writable, 1664 ** resulting in a granularity of 1 PCI clock cycle. 1665 ** When the timer expires (i.e., equals 00h) bridge relinquishes the bus at the next ADB. 1666 ** (Except in the case where MLT expires within 3 data phases of an ADB. 1667 ** In this case bridge continues on until it reaches the next ADB 1668 ** before relinquishing the bus) 1669 **============================================================================== 1670 */ 1671 #define ARCMSR_PCI2PCI_PRIMARY_BUSNUMBER_REG 0x18 /*3byte 0x1A,0x19,0x18*/ 1672 #define ARCMSR_PCI2PCI_SECONDARY_BUSNUMBER_REG 0x19 /*byte*/ 1673 #define ARCMSR_PCI2PCI_SUBORDINATE_BUSNUMBER_REG 0x1A /*byte*/ 1674 #define ARCMSR_PCI2PCI_SECONDARY_LATENCYTIMER_REG 0x1B /*byte*/ 1675 /* 1676 **============================================================================== 1677 ** 0x1f-0x1c : 1678 ** PCI CFG Base Address #3 (0x1C) 1679 **-----------------0x1D,0x1C--I/O Base and Limit Register - IOBL 1680 ** Bit Default Description 1681 ** 15:12 0h I/O Limit Address Bits [15:12]: Defines the top address of an address range to 1682 ** determine when to forward I/O transactions from one interface to the other. 1683 ** These bits correspond to address lines 15:12 for 4KB alignment. 1684 ** Bits 11:0 are assumed to be FFFh. 1685 ** 11:08 1h I/O Limit Addressing Capability: This field is hard-wired to 1h, indicating support 32-bit I/O addressing. 1686 ** 07:04 0h I/O Base Address Bits [15:12]: Defines the bottom address of 1687 ** an address range to determine when to forward I/O transactions 1688 ** from one interface to the other. 1689 ** These bits correspond to address lines 15:12 for 4KB alignment. 1690 ** Bits 11:0 are assumed to be 000h. 1691 ** 03:00 1h I/O Base Addressing Capability: This is hard-wired to 1h, indicating support for 32-bit I/O addressing. 1692 **-----------------0x1F,0x1E--Secondary Status Register - SSR 1693 ** Bit Default Description 1694 ** 15 0b Detected Parity Error: The bridge sets this bit to a 1b whenever it detects an address, 1695 ** attribute or data parity error on its secondary interface. 1696 ** 14 0b Received System Error: The bridge sets this bit when it samples SERR# asserted on its secondary bus interface. 1697 ** 13 0b Received Master Abort: The bridge sets this bit to a 1b when, 1698 ** acting as the initiator on the secondary bus, 1699 ** it's transaction (with the exception of special cycles) 1700 ** has been terminated with a Master Abort. 1701 ** 12 0b Received Target Abort: The bridge sets this bit to a 1b when, 1702 ** acting as the initiator on the secondary bus, 1703 ** it's transaction has been terminated with a Target Abort. 1704 ** 11 0b Signaled Target Abort: The bridge sets this bit to a 1b when it, 1705 ** as the target of a transaction, terminates it with a Target Abort. 1706 ** In PCI-X mode this bit is also set when it forwards a SCM with a target abort error code. 1707 ** 10:09 01b DEVSEL# Timing: Indicates slowest response to a non-configuration command on the secondary interface. 1708 ** Returns "01b" when read, indicating that bridge responds no slower than with medium timing. 1709 ** 08 0b Master Data Parity Error: The bridge sets this bit to a 1b when all of the following conditions are true: 1710 ** The bridge is the current master on the secondary bus 1711 ** S_PERR# is detected asserted or is asserted by bridge 1712 ** The Parity Error Response bit is set in the Command register 1713 ** 07 1b Fast Back-to-Back Capable (FBC): Indicates that the secondary interface of bridge can receive fast back-to-back cycles. 1714 ** 06 0b Reserved 1715 ** 05 1b 66 MHz Capable (C66): Indicates the secondary interface of the bridge is 66 MHz capable. 1716 ** 1 = 1717 ** 04:00 00h Reserved 1718 **============================================================================== 1719 */ 1720 #define ARCMSR_PCI2PCI_IO_BASE_REG 0x1C /*byte*/ 1721 #define ARCMSR_PCI2PCI_IO_LIMIT_REG 0x1D /*byte*/ 1722 #define ARCMSR_PCI2PCI_SECONDARY_STATUS_REG 0x1E /*word: 0x1F,0x1E */ 1723 /* 1724 **============================================================================== 1725 ** 0x23-0x20 : 1726 ** PCI CFG Base Address #4 (0x20) 1727 **-----------------0x23,0x22,0x21,0x20--Memory Base and Limit Register - MBL 1728 ** Bit Default Description 1729 ** 31:20 000h Memory Limit: These 12 bits are compared with P_AD[31:20] of the incoming address to determine 1730 ** the upper 1MB aligned value (exclusive) of the range. 1731 ** The incoming address must be less than or equal to this value. 1732 ** For the purposes of address decoding the lower 20 address bits (P_AD[19:0] 1733 ** are assumed to be F FFFFh. 1734 ** 19:16 0h Reserved. 1735 ** 15:04 000h Memory Base: These 12 bits are compared with bits P_AD[31:20] 1736 ** of the incoming address to determine the lower 1MB 1737 ** aligned value (inclusive) of the range. 1738 ** The incoming address must be greater than or equal to this value. 1739 ** For the purposes of address decoding the lower 20 address bits (P_AD[19:0]) 1740 ** are assumed to be 0 0000h. 1741 ** 03:00 0h Reserved. 1742 **============================================================================== 1743 */ 1744 #define ARCMSR_PCI2PCI_NONPREFETCHABLE_MEMORY_BASE_REG 0x20 /*word: 0x21,0x20 */ 1745 #define ARCMSR_PCI2PCI_NONPREFETCHABLE_MEMORY_LIMIT_REG 0x22 /*word: 0x23,0x22 */ 1746 /* 1747 **============================================================================== 1748 ** 0x27-0x24 : 1749 ** PCI CFG Base Address #5 (0x24) 1750 **-----------------0x27,0x26,0x25,0x24--Prefetchable Memory Base and Limit Register - PMBL 1751 ** Bit Default Description 1752 ** 31:20 000h Prefetchable Memory Limit: These 12 bits are compared with P_AD[31:20] of the incoming address to determine 1753 ** the upper 1MB aligned value (exclusive) of the range. 1754 ** The incoming address must be less than or equal to this value. 1755 ** For the purposes of address decoding the lower 20 address bits (P_AD[19:0] 1756 ** are assumed to be F FFFFh. 1757 ** 19:16 1h 64-bit Indicator: Indicates that 64-bit addressing is supported. 1758 ** 15:04 000h Prefetchable Memory Base: These 12 bits are compared with bits P_AD[31:20] 1759 ** of the incoming address to determine the lower 1MB aligned value (inclusive) 1760 ** of the range. 1761 ** The incoming address must be greater than or equal to this value. 1762 ** For the purposes of address decoding the lower 20 address bits (P_AD[19:0]) 1763 ** are assumed to be 0 0000h. 1764 ** 03:00 1h 64-bit Indicator: Indicates that 64-bit addressing is supported. 1765 **============================================================================== 1766 */ 1767 #define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_BASE_REG 0x24 /*word: 0x25,0x24 */ 1768 #define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_LIMIT_REG 0x26 /*word: 0x27,0x26 */ 1769 /* 1770 **============================================================================== 1771 ** 0x2b-0x28 : 1772 ** Bit Default Description 1773 ** 31:00 00000000h Prefetchable Memory Base Upper Portion: All bits are read/writable 1774 ** bridge supports full 64-bit addressing. 1775 **============================================================================== 1776 */ 1777 #define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_BASE_UPPER32_REG 0x28 /*dword: 0x2b,0x2a,0x29,0x28 */ 1778 /* 1779 **============================================================================== 1780 ** 0x2f-0x2c : 1781 ** Bit Default Description 1782 ** 31:00 00000000h Prefetchable Memory Limit Upper Portion: All bits are read/writable 1783 ** bridge supports full 64-bit addressing. 1784 **============================================================================== 1785 */ 1786 #define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_LIMIT_UPPER32_REG 0x2C /*dword: 0x2f,0x2e,0x2d,0x2c */ 1787 /* 1788 **============================================================================== 1789 ** 0x33-0x30 : 1790 ** Bit Default Description 1791 ** 07:00 DCh Capabilities Pointer: Pointer to the first CAP ID entry in the capabilities list is at DCh in PCI configuration 1792 ** space. (Power Management Capability Registers) 1793 **============================================================================== 1794 */ 1795 #define ARCMSR_PCI2PCI_CAPABILITIES_POINTER_REG 0x34 /*byte*/ 1796 /* 1797 **============================================================================== 1798 ** 0x3b-0x35 : reserved 1799 **============================================================================== 1800 */ 1801 /* 1802 **============================================================================== 1803 ** 0x3d-0x3c : 1804 ** 1805 ** Bit Default Description 1806 ** 15:08 00h Interrupt Pin (PIN): Bridges do not support the generation of interrupts. 1807 ** 07:00 00h Interrupt Line (LINE): The bridge does not generate interrupts, so this is reserved as '00h'. 1808 **============================================================================== 1809 */ 1810 #define ARCMSR_PCI2PCI_PRIMARY_INTERRUPT_LINE_REG 0x3C /*byte*/ 1811 #define ARCMSR_PCI2PCI_PRIMARY_INTERRUPT_PIN_REG 0x3D /*byte*/ 1812 /* 1813 **============================================================================== 1814 ** 0x3f-0x3e : 1815 ** Bit Default Description 1816 ** 15:12 0h Reserved 1817 ** 11 0b Discard Timer SERR# Enable: Controls the generation of SERR# on the primary interface (P_SERR#) in response 1818 ** to a timer discard on either the primary or secondary interface. 1819 ** 0b=SERR# is not asserted. 1820 ** 1b=SERR# is asserted. 1821 ** 10 0b Discard Timer Status (DTS): This bit is set to a '1b' when either the primary or secondary discard timer expires. 1822 ** The delayed completion is then discarded. 1823 ** 09 0b Secondary Discard Timer (SDT): Sets the maximum number of PCI clock cycles 1824 ** that bridge waits for an initiator on the secondary bus 1825 ** to repeat a delayed transaction request. 1826 ** The counter starts when the delayed transaction completion is ready 1827 ** to be returned to the initiator. 1828 ** When the initiator has not repeated the transaction 1829 ** at least once before the counter expires,bridge 1830 ** discards the delayed transaction from its queues. 1831 ** 0b=The secondary master time-out counter is 2 15 PCI clock cycles. 1832 ** 1b=The secondary master time-out counter is 2 10 PCI clock cycles. 1833 ** 08 0b Primary Discard Timer (PDT): Sets the maximum number of PCI clock cycles 1834 ** that bridge waits for an initiator on the primary bus 1835 ** to repeat a delayed transaction request. 1836 ** The counter starts when the delayed transaction completion 1837 ** is ready to be returned to the initiator. 1838 ** When the initiator has not repeated the transaction 1839 ** at least once before the counter expires, 1840 ** bridge discards the delayed transaction from its queues. 1841 ** 0b=The primary master time-out counter is 2 15 PCI clock cycles. 1842 ** 1b=The primary master time-out counter is 2 10 PCI clock cycles. 1843 ** 07 0b Fast Back-to-Back Enable (FBE): The bridge does not initiate back to back transactions. 1844 ** 06 0b Secondary Bus Reset (SBR): 1845 ** When cleared to 0b: The bridge deasserts S_RST#, 1846 ** when it had been asserted by writing this bit to a 1b. 1847 ** When set to 1b: The bridge asserts S_RST#. 1848 ** 05 0b Master Abort Mode (MAM): Dictates bridge behavior on the initiator bus 1849 ** when a master abort termination occurs in response to 1850 ** a delayed transaction initiated by bridge on the target bus. 1851 ** 0b=The bridge asserts TRDY# in response to a non-locked delayed transaction, 1852 ** and returns FFFF FFFFh when a read. 1853 ** 1b=When the transaction had not yet been completed on the initiator bus 1854 ** (e.g.,delayed reads, or non-posted writes), 1855 ** then bridge returns a Target Abort in response to the original requester 1856 ** when it returns looking for its delayed completion on the initiator bus. 1857 ** When the transaction had completed on the initiator bus (e.g., a PMW), 1858 ** then bridge asserts P_SERR# (when enabled). 1859 ** For PCI-X transactions this bit is an enable for the assertion of P_SERR# due to a master abort 1860 ** while attempting to deliver a posted memory write on the destination bus. 1861 ** 04 0b VGA Alias Filter Enable: This bit dictates bridge behavior in conjunction with the VGA enable bit 1862 ** (also of this register), 1863 ** and the VGA Palette Snoop Enable bit (Command Register). 1864 ** When the VGA enable, or VGA Palette Snoop enable bits are on (i.e., 1b) 1865 ** the VGA Aliasing bit for the corresponding enabled functionality,: 1866 ** 0b=Ignores address bits AD[15:10] when decoding VGA I/O addresses. 1867 ** 1b=Ensures that address bits AD[15:10] equal 000000b when decoding VGA I/O addresses. 1868 ** When all VGA cycle forwarding is disabled, (i.e., VGA Enable bit =0b and VGA Palette Snoop bit =0b), 1869 ** then this bit has no impact on bridge behavior. 1870 ** 03 0b VGA Enable: Setting this bit enables address decoding 1871 ** and transaction forwarding of the following VGA transactions from the primary bus 1872 ** to the secondary bus: 1873 ** frame buffer memory addresses 000A0000h:000BFFFFh, 1874 ** VGA I/O addresses 3B0:3BBh and 3C0h:3DFh, where AD[31:16]="0000h" 1875 ** and AD[15:10] are either not decoded (i.e., don't cares), 1876 ** or must be "000000b" 1877 ** depending upon the state of the VGA Alias Filter Enable bit. (bit(4) of this register) 1878 ** I/O and Memory Enable bits must be set in the Command register 1879 ** to enable forwarding of VGA cycles. 1880 ** 02 0b ISA Enable: Setting this bit enables special handling 1881 ** for the forwarding of ISA I/O transactions that fall within the address range 1882 ** specified by the I/O Base and Limit registers, 1883 ** and are within the lowest 64Kbyte of the I/O address map 1884 ** (i.e., 0000 0000h - 0000 FFFFh). 1885 ** 0b=All I/O transactions that fall within the I/O Base 1886 ** and Limit registers' specified range are forwarded 1887 ** from primary to secondary unfiltered. 1888 ** 1b=Blocks the forwarding from primary to secondary 1889 ** of the top 768 bytes of each 1Kbyte alias. 1890 ** On the secondary the top 768 bytes of each 1K alias 1891 ** are inversely decoded and forwarded 1892 ** from secondary to primary. 1893 ** 01 0b SERR# Forward Enable: 0b=The bridge does not assert P_SERR# as a result of an S_SERR# assertion. 1894 ** 1b=The bridge asserts P_SERR# whenever S_SERR# is detected 1895 ** asserted provided the SERR# Enable bit is set (PCI Command Register bit(8)=1b). 1896 ** 00 0b Parity Error Response: This bit controls bridge response to a parity error 1897 ** that is detected on its secondary interface. 1898 ** 0b=When a data parity error is detected bridge does not assert S_PERR#. 1899 ** Also bridge does not assert P_SERR# in response to a detected address 1900 ** or attribute parity error. 1901 ** 1b=When a data parity error is detected bridge asserts S_PERR#. 1902 ** The bridge also asserts P_SERR# (when enabled globally via bit(8) 1903 ** of the Command register) 1904 ** in response to a detected address or attribute parity error. 1905 **============================================================================== 1906 */ 1907 #define ARCMSR_PCI2PCI_BRIDGE_CONTROL_REG 0x3E /*word*/ 1908 /* 1909 ************************************************************************** 1910 ** Device Specific Registers 40-A7h 1911 ************************************************************************** 1912 ** ---------------------------------------------------------------------------------------------------------- 1913 ** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configu-ration Byte Offset 1914 ** ---------------------------------------------------------------------------------------------------------- 1915 ** | Bridge Control 0 | Arbiter Control/Status | Reserved | 40h 1916 ** ---------------------------------------------------------------------------------------------------------- 1917 ** | Bridge Control 2 | Bridge Control 1 | 44h 1918 ** ---------------------------------------------------------------------------------------------------------- 1919 ** | Reserved | Bridge Status | 48h 1920 ** ---------------------------------------------------------------------------------------------------------- 1921 ** | Reserved | 4Ch 1922 ** ---------------------------------------------------------------------------------------------------------- 1923 ** | Prefetch Policy | Multi-Transaction Timer | 50h 1924 ** ---------------------------------------------------------------------------------------------------------- 1925 ** | Reserved | Pre-boot Status | P_SERR# Assertion Control | 54h 1926 ** ---------------------------------------------------------------------------------------------------------- 1927 ** | Reserved | Reserved | Secondary Decode Enable | 58h 1928 ** ---------------------------------------------------------------------------------------------------------- 1929 ** | Reserved | Secondary IDSEL | 5Ch 1930 ** ---------------------------------------------------------------------------------------------------------- 1931 ** | Reserved | 5Ch 1932 ** ---------------------------------------------------------------------------------------------------------- 1933 ** | Reserved | 68h:CBh 1934 ** ---------------------------------------------------------------------------------------------------------- 1935 ************************************************************************** 1936 **============================================================================== 1937 ** 0x42-0x41: Secondary Arbiter Control/Status Register - SACSR 1938 ** Bit Default Description 1939 ** 15:12 1111b Grant Time-out Violator: This field indicates the agent that violated the Grant Time-out rule 1940 ** (PCI=16 clocks,PCI-X=6 clocks). 1941 ** Note that this field is only meaningful when: 1942 ** # Bit[11] of this register is set to 1b, 1943 ** indicating that a Grant Time-out violation had occurred. 1944 ** # bridge internal arbiter is enabled. 1945 ** Bits[15:12] Violating Agent (REQ#/GNT# pair number) 1946 ** 0000b REQ#/GNT#[0] 1947 ** 0001b REQ#/GNT#[1] 1948 ** 0010b REQ#/GNT#[2] 1949 ** 0011b REQ#/GNT#[3] 1950 ** 1111b Default Value (no violation detected) 1951 ** When bit[11] is cleared by software, this field reverts back to its default value. 1952 ** All other values are Reserved 1953 ** 11 0b Grant Time-out Occurred: When set to 1b, 1954 ** this indicates that a Grant Time-out error had occurred involving one of the secondary bus agents. 1955 ** Software clears this bit by writing a 1b to it. 1956 ** 10 0b Bus Parking Control: 0=During bus idle, bridge parks the bus on the last master to use the bus. 1957 ** 1=During bus idle, bridge parks the bus on itself. 1958 ** The bus grant is removed from the last master and internally asserted to bridge. 1959 ** 09:08 00b Reserved 1960 ** 07:00 0000 0000b Secondary Bus Arbiter Priority Configuration: The bridge secondary arbiter provides two rings of arbitration priority. 1961 ** Each bit of this field assigns its corresponding secondary 1962 ** bus master to either the high priority arbiter ring (1b) 1963 ** or to the low priority arbiter ring (0b). 1964 ** Bits [3:0] correspond to request inputs S_REQ#[3:0], respectively. 1965 ** Bit [6] corresponds to the bridge internal secondary bus request 1966 ** while Bit [7] corresponds to the SATU secondary bus request. 1967 ** Bits [5:4] are unused. 1968 ** 0b=Indicates that the master belongs to the low priority group. 1969 ** 1b=Indicates that the master belongs to the high priority group 1970 **================================================================================= 1971 ** 0x43: Bridge Control Register 0 - BCR0 1972 ** Bit Default Description 1973 ** 07 0b Fully Dynamic Queue Mode: 0=The number of Posted write transactions is limited to eight 1974 ** and the Posted Write data is limited to 4KB. 1975 ** 1=Operation in fully dynamic queue mode. The bridge enqueues up to 1976 ** 14 Posted Memory Write transactions and 8KB of posted write data. 1977 ** 06:03 0H Reserved. 1978 ** 02 0b Upstream Prefetch Disable: This bit disables bridge ability 1979 ** to perform upstream prefetch operations for Memory 1980 ** Read requests received on its secondary interface. 1981 ** This bit also controls the bridge's ability to generate advanced read commands 1982 ** when forwarding a Memory Read Block transaction request upstream from a PCI-X bus 1983 ** to a Conventional PCI bus. 1984 ** 0b=bridge treats all upstream Memory Read requests as though they target prefetchable memory. 1985 ** The use of Memory Read Line and Memory Read 1986 ** Multiple is enabled when forwarding a PCI-X Memory Read Block request 1987 ** to an upstream bus operating in Conventional PCI mode. 1988 ** 1b=bridge treats upstream PCI Memory Read requests as though 1989 ** they target non-prefetchable memory and forwards upstream PCI-X Memory 1990 ** Read Block commands as Memory Read 1991 ** when the primary bus is operating 1992 ** in Conventional PCI mode. 1993 ** NOTE: This bit does not affect bridge ability to perform read prefetching 1994 ** when the received command is Memory Read Line or Memory Read Multiple. 1995 **================================================================================= 1996 ** 0x45-0x44: Bridge Control Register 1 - BCR1 (Sheet 2 of 2) 1997 ** Bit Default Description 1998 ** 15:08 0000000b Reserved 1999 ** 07:06 00b Alias Command Mapping: This two bit field determines how bridge handles PCI-X "Alias" commands, 2000 ** specifically the Alias to Memory Read Block and Alias to Memory Write Block commands. 2001 ** The three options for handling these alias commands are to either pass it as is, 2002 ** re-map to the actual block memory read/write command encoding, or ignore 2003 ** the transaction forcing a Master Abort to occur on the Origination Bus. 2004 ** Bit (7:6) Handling of command 2005 ** 0 0 Re-map to Memory Read/Write Block before forwarding 2006 ** 0 1 Enqueue and forward the alias command code unaltered 2007 ** 1 0 Ignore the transaction, forcing Master Abort 2008 ** 1 1 Reserved 2009 ** 05 1b Watchdog Timers Disable: Disables or enables all 2 24 Watchdog Timers in both directions. 2010 ** The watchdog timers are used to detect prohibitively long latencies in the system. 2011 ** The watchdog timer expires when any Posted Memory Write (PMW), Delayed Request, 2012 ** or Split Requests (PCI-X mode) is not completed within 2 24 events 2013 ** ("events" are defined as PCI Clocks when operating in PCI-X mode, 2014 ** and as the number of times being retried when operating in Conventional PCI mode) 2015 ** 0b=All 2 24 watchdog timers are enabled. 2016 ** 1b=All 2 24 watchdog timers are disabled and there is no limits to 2017 ** the number of attempts bridge makes when initiating a PMW, 2018 ** transacting a Delayed Transaction, or how long it waits for 2019 ** a split completion corresponding to one of its requests. 2020 ** 04 0b GRANT# time-out disable: This bit enables/disables the GNT# time-out mechanism. 2021 ** Grant time-out is 16 clocks for conventional PCI, and 6 clocks for PCI-X. 2022 ** 0b=The Secondary bus arbiter times out an agent 2023 ** that does not assert FRAME# within 16/6 clocks of receiving its grant, 2024 ** once the bus has gone idle. 2025 ** The time-out counter begins as soon as the bus goes idle with the new GNT# asserted. 2026 ** An infringing agent does not receive a subsequent GNT# 2027 ** until it de-asserts its REQ# for at least one clock cycle. 2028 ** 1b=GNT# time-out mechanism is disabled. 2029 ** 03 00b Reserved. 2030 ** 02 0b Secondary Discard Timer Disable: This bit enables/disables bridge secondary delayed transaction discard mechanism. 2031 ** The time out mechanism is used to ensure that initiators 2032 ** of delayed transactions return for their delayed completion data/status 2033 ** within a reasonable amount of time after it is available from bridge. 2034 ** 0b=The secondary master time-out counter is enabled 2035 ** and uses the value specified by the Secondary Discard Timer bit 2036 ** (see Bridge Control Register). 2037 ** 1b=The secondary master time-out counter is disabled. 2038 ** The bridge waits indefinitely for a secondary bus master 2039 ** to repeat a delayed transaction. 2040 ** 01 0b Primary Discard Timer Disable: This bit enables/disables bridge primary delayed transaction discard mechanism. 2041 ** The time out mechanism is used to ensure that initiators 2042 ** of delayed transactions return for their delayed completion data/status 2043 ** within a reasonable amount of time after it is available from bridge. 2044 ** 0b=The primary master time-out counter is enabled and uses the value specified 2045 ** by the Primary Discard Timer bit (see Bridge Control Register). 2046 ** 1b=The secondary master time-out counter is disabled. 2047 ** The bridge waits indefinitely for a secondary bus master 2048 ** to repeat a delayed transaction. 2049 ** 00 0b Reserved 2050 **================================================================================= 2051 ** 0x47-0x46: Bridge Control Register 2 - BCR2 2052 ** Bit Default Description 2053 ** 15:07 0000b Reserved. 2054 ** 06 0b Global Clock Out Disable (External Secondary Bus Clock Source Enable): 2055 ** This bit disables all of the secondary PCI clock outputs including 2056 ** the feedback clock S_CLKOUT. 2057 ** This means that the user is required to provide an S_CLKIN input source. 2058 ** 05:04 11 (66 MHz) Preserved. 2059 ** 01 (100 MHz) 2060 ** 00 (133 MHz) 2061 ** 03:00 Fh (100 MHz & 66 MHz) 2062 ** 7h (133 MHz) 2063 ** This 4 bit field provides individual enable/disable mask bits for each of bridge 2064 ** secondary PCI clock outputs. Some, or all secondary clock outputs (S_CLKO[3:0]) 2065 ** default to being enabled following the rising edge of P_RST#, depending on the 2066 ** frequency of the secondary bus clock: 2067 ** * Designs with 100 MHz (or lower) Secondary PCI clock power up with 2068 ** all four S_CLKOs enabled by default. (SCLKO[3:0]) 2069 ** * Designs with 133 MHz Secondary PCI clock power up 2070 ** with the lower order 3 S_CLKOs enabled by default. 2071 ** (S_CLKO[2:0]) Only those SCLKs that power up enabled by can be connected 2072 ** to downstream device clock inputs. 2073 **================================================================================= 2074 ** 0x49-0x48: Bridge Status Register - BSR 2075 ** Bit Default Description 2076 ** 15 0b Upstream Delayed Transaction Discard Timer Expired: This bit is set to a 1b and P_SERR# 2077 ** is conditionally asserted when the secondary discard timer expires. 2078 ** 14 0b Upstream Delayed/Split Read Watchdog Timer Expired: 2079 ** Conventional PCI Mode: This bit is set to a 1b and P_SERR# 2080 ** is conditionally asserted when bridge discards an upstream delayed read ** ** transaction request after 2 24 retries following the initial retry. 2081 ** PCI-X Mode: This bit is set to a 1b and P_SERR# is conditionally asserted 2082 ** when bridge discards an upstream split read request 2083 ** after waiting in excess of 2 24 clocks for the corresponding 2084 ** Split Completion to arrive. 2085 ** 13 0b Upstream Delayed/Split Write Watchdog Timer Expired: 2086 ** Conventional PCI Mode: This bit is set to a 1b and P_SERR# 2087 ** is conditionally asserted when bridge discards an upstream delayed write ** ** transaction request after 2 24 retries following the initial retry. 2088 ** PCI-X Mode: This bit is set to a 1b and P_SERR# 2089 ** is conditionally asserted when bridge discards an upstream split write request ** after waiting in excess of 2 24 clocks for the corresponding 2090 ** Split Completion to arrive. 2091 ** 12 0b Master Abort during Upstream Posted Write: This bit is set to a 1b and P_SERR# 2092 ** is conditionally asserted when a Master Abort occurs as a result of an attempt, 2093 ** by bridge, to retire a PMW upstream. 2094 ** 11 0b Target Abort during Upstream Posted Write: This bit is set to a 1b and P_SERR# 2095 ** is conditionally asserted when a Target Abort occurs as a result of an attempt, 2096 ** by bridge, to retire a PMW upstream. 2097 ** 10 0b Upstream Posted Write Data Discarded: This bit is set to a 1b and P_SERR# 2098 ** is conditionally asserted when bridge discards an upstream PMW transaction 2099 ** after receiving 2 24 target retries from the primary bus target 2100 ** 09 0b Upstream Posted Write Data Parity Error: This bit is set to a 1b and P_SERR# 2101 ** is conditionally asserted when a data parity error is detected by bridge 2102 ** while attempting to retire a PMW upstream 2103 ** 08 0b Secondary Bus Address Parity Error: This bit is set to a 1b and P_SERR# 2104 ** is conditionally asserted when bridge detects an address parity error on 2105 ** the secondary bus. 2106 ** 07 0b Downstream Delayed Transaction Discard Timer Expired: This bit is set to a 1b and P_SERR# 2107 ** is conditionally asserted when the primary bus discard timer expires. 2108 ** 06 0b Downstream Delayed/Split Read Watchdog Timer Expired: 2109 ** Conventional PCI Mode: This bit is set to a 1b and P_SERR# 2110 ** is conditionally asserted when bridge discards a downstream delayed read ** ** transaction request after receiving 2 24 target retries 2111 ** from the secondary bus target. 2112 ** PCI-X Mode: This bit is set to a 1b and P_SERR# is conditionally asserted 2113 ** when bridge discards a downstream split read request 2114 ** after waiting in excess of 2 24 clocks for the corresponding 2115 ** Split Completion to arrive. 2116 ** 05 0b Downstream Delayed Write/Split Watchdog Timer Expired: 2117 ** Conventional PCI Mode: This bit is set to a 1b and P_SERR# is conditionally asserted 2118 ** when bridge discards a downstream delayed write transaction request 2119 ** after receiving 2 24 target retries from the secondary bus target. 2120 ** PCI-X Mode: This bit is set to a 1b and P_SERR# 2121 ** is conditionally asserted when bridge discards a downstream 2122 ** split write request after waiting in excess of 2 24 clocks 2123 ** for the corresponding Split Completion to arrive. 2124 ** 04 0b Master Abort during Downstream Posted Write: This bit is set to a 1b and P_SERR# 2125 ** is conditionally asserted when a Master Abort occurs as a result of an attempt, 2126 ** by bridge, to retire a PMW downstream. 2127 ** 03 0b Target Abort during Downstream Posted Write: This bit is set to a 1b and P_SERR# is conditionally asserted 2128 ** when a Target Abort occurs as a result of an attempt, by bridge, 2129 ** to retire a PMW downstream. 2130 ** 02 0b Downstream Posted Write Data Discarded: This bit is set to a 1b and P_SERR# 2131 ** is conditionally asserted when bridge discards a downstream PMW transaction 2132 ** after receiving 2 24 target retries from the secondary bus target 2133 ** 01 0b Downstream Posted Write Data Parity Error: This bit is set to a 1b and P_SERR# 2134 ** is conditionally asserted when a data parity error is detected by bridge 2135 ** while attempting to retire a PMW downstream. 2136 ** 00 0b Primary Bus Address Parity Error: This bit is set to a 1b and P_SERR# is conditionally asserted 2137 ** when bridge detects an address parity error on the primary bus. 2138 **================================================================================== 2139 ** 0x51-0x50: Bridge Multi-Transaction Timer Register - BMTTR 2140 ** Bit Default Description 2141 ** 15:13 000b Reserved 2142 ** 12:10 000b GRANT# Duration: This field specifies the count (PCI clocks) 2143 ** that a secondary bus master has its grant maintained in order to enable 2144 ** multiple transactions to execute within the same arbitration cycle. 2145 ** Bit[02:00] GNT# Extended Duration 2146 ** 000 MTT Disabled (Default=no GNT# extension) 2147 ** 001 16 clocks 2148 ** 010 32 clocks 2149 ** 011 64 clocks 2150 ** 100 128 clocks 2151 ** 101 256 clocks 2152 ** 110 Invalid (treated as 000) 2153 ** 111 Invalid (treated as 000) 2154 ** 09:08 00b Reserved 2155 ** 07:00 FFh MTT Mask: This field enables/disables MTT usage for each REQ#/GNT# 2156 ** pair supported by bridge secondary arbiter. 2157 ** Bit(7) corresponds to SATU internal REQ#/GNT# pair, 2158 ** bit(6) corresponds to bridge internal REQ#/GNT# pair, 2159 ** bit(5) corresponds to REQ#/GNT#(5) pair, etc. 2160 ** When a given bit is set to 1b, its corresponding REQ#/GNT# 2161 ** pair is enabled for MTT functionality as determined by bits(12:10) of this register. 2162 ** When a given bit is cleared to 0b, its corresponding REQ#/GNT# pair is disabled from using the MTT. 2163 **================================================================================== 2164 ** 0x53-0x52: Read Prefetch Policy Register - RPPR 2165 ** Bit Default Description 2166 ** 15:13 000b ReRead_Primary Bus: 3-bit field indicating the multiplication factor 2167 ** 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 2168 ** using the FirstRead parameter. 2169 ** The default value of 000b correlates to: Command Type Hardwired pre-fetch amount Memory Read 4 DWORDs 2170 ** Memory Read Line 1 cache lines Memory Read Multiple 2 cache lines 2171 ** 12:10 000b FirstRead_Primary Bus: 3-bit field indicating the multiplication factor to be used in calculating 2172 ** the number of bytes to prefetch from the secondary bus interface 2173 ** on the initial PreFetch operation. 2174 ** The default value of 000b correlates to: Command Type Hardwired pre-fetch amount Memory Read 4 DWORDs 2175 ** Memory Read Line 1 cache line Memory Read Multiple 2 cache lines 2176 ** 09:07 010b ReRead_Secondary Bus: 3-bit field indicating the multiplication factor to be used 2177 ** in calculating the number of bytes to prefetch from the primary 2178 ** bus interface on subsequent PreFetch operations given 2179 ** that the read demands were not satisfied using 2180 ** the FirstRead parameter. 2181 ** The default value of 010b correlates to: Command Type Hardwired pre-fetch a 2182 ** mount Memory Read 3 cache lines Memory Read Line 3 cache lines 2183 ** Memory Read Multiple 6 cache lines 2184 ** 06:04 000b FirstRead_Secondary Bus: 3-bit field indicating the multiplication factor to be used 2185 ** in calculating the number of bytes to prefetch from 2186 ** the primary bus interface on the initial PreFetch operation. 2187 ** The default value of 000b correlates to: Command Type Hardwired pre-fetch amount 2188 ** Memory Read 4 DWORDs Memory Read Line 1 cache line Memory Read Multiple 2 cache lines 2189 ** 03:00 1111b Staged Prefetch Enable: This field enables/disables the FirstRead/ReRead pre-fetch 2190 ** algorithm for the secondary and the primary bus interfaces. 2191 ** Bit(3) is a ganged enable bit for REQ#/GNT#[7:3], and bits(2:0) provide individual 2192 ** enable bits for REQ#/GNT#[2:0]. 2193 ** (bit(2) is the enable bit for REQ#/GNT#[2], etc...) 2194 ** 1b: enables the staged pre-fetch feature 2195 ** 0b: disables staged pre-fetch, 2196 ** and hardwires read pre-fetch policy to the following for 2197 ** Memory Read, 2198 ** Memory Read Line, 2199 ** and Memory Read Multiple commands: 2200 ** Command Type Hardwired Pre-Fetch Amount... 2201 ** Memory Read 4 DWORDs 2202 ** Memory Read Line 1 cache line 2203 ** Memory Read Multiple 2 cache lines 2204 ** NOTE: When the starting address is not cache line aligned, bridge pre-fetches Memory Read line commands 2205 ** only to the next higher cache line boundary.For non-cache line aligned Memory Read 2206 ** Multiple commands bridge pre-fetches only to the second cache line boundary encountered. 2207 **================================================================================== 2208 ** 0x55-0x54: P_SERR# Assertion Control - SERR_CTL 2209 ** Bit Default Description 2210 ** 15 0b Upstream Delayed Transaction Discard Timer Expired: Dictates the bridge behavior 2211 ** in response to its discarding of a delayed transaction that was initiated from the primary bus. 2212 ** 0b=bridge asserts P_SERR#. 2213 ** 1b=bridge does not assert P_SERR# 2214 ** 14 0b Upstream Delayed/Split Read Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer. 2215 ** 0b=bridge asserts P_SERR#. 2216 ** 1b=bridge does not assert P_SERR# 2217 ** 13 0b Upstream Delayed/Split Write Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer. 2218 ** 0b=bridge asserts P_SERR#. 2219 ** 1b=bridge does not assert P_SERR# 2220 ** 12 0b Master Abort during Upstream Posted Write: Dictates bridge behavior following 2221 ** its having detected a Master Abort while attempting to retire one of its PMWs upstream. 2222 ** 0b=bridge asserts P_SERR#. 2223 ** 1b=bridge does not assert P_SERR# 2224 ** 11 0b Target Abort during Upstream Posted Write: Dictates bridge behavior following 2225 ** its having been terminated with Target Abort while attempting to retire one of its PMWs upstream. 2226 ** 0b=bridge asserts P_SERR#. 2227 ** 1b=bridge does not assert P_SERR# 2228 ** 10 0b Upstream Posted Write Data Discarded: Dictates bridge behavior in the event that 2229 ** it discards an upstream posted write transaction. 2230 ** 0b=bridge asserts P_SERR#. 2231 ** 1b=bridge does not assert P_SERR# 2232 ** 09 0b Upstream Posted Write Data Parity Error: Dictates bridge behavior 2233 ** when a data parity error is detected while attempting to retire on of its PMWs upstream. 2234 ** 0b=bridge asserts P_SERR#. 2235 ** 1b=bridge does not assert P_SERR# 2236 ** 08 0b Secondary Bus Address Parity Error: This bit dictates bridge behavior 2237 ** when it detects an address parity error on the secondary bus. 2238 ** 0b=bridge asserts P_SERR#. 2239 ** 1b=bridge does not assert P_SERR# 2240 ** 07 0b Downstream Delayed Transaction Discard Timer Expired: Dictates bridge behavior in response to 2241 ** its discarding of a delayed transaction that was initiated on the secondary bus. 2242 ** 0b=bridge asserts P_SERR#. 2243 ** 1b=bridge does not assert P_SERR# 2244 ** 06 0b Downstream Delayed/Split Read Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer. 2245 ** 0b=bridge asserts P_SERR#. 2246 ** 1b=bridge does not assert P_SERR# 2247 ** 05 0b Downstream Delayed/Split Write Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer. 2248 ** 0b=bridge asserts P_SERR#. 2249 ** 1b=bridge does not assert P_SERR# 2250 ** 04 0b Master Abort during Downstream Posted Write: Dictates bridge behavior following 2251 ** its having detected a Master Abort while attempting to retire one of its PMWs downstream. 2252 ** 0b=bridge asserts P_SERR#. 2253 ** 1b=bridge does not assert P_SERR# 2254 ** 03 0b Target Abort during Downstream Posted Write: Dictates bridge behavior following 2255 ** its having been terminated with Target Abort while attempting to retire one of its PMWs downstream. 2256 ** 0b=bridge asserts P_SERR#. 2257 ** 1b=bridge does not assert P_SERR# 2258 ** 02 0b Downstream Posted Write Data Discarded: Dictates bridge behavior in the event 2259 ** that it discards a downstream posted write transaction. 2260 ** 0b=bridge asserts P_SERR#. 2261 ** 1b=bridge does not assert P_SERR# 2262 ** 01 0b Downstream Posted Write Data Parity Error: Dictates bridge behavior 2263 ** when a data parity error is detected while attempting to retire on of its PMWs downstream. 2264 ** 0b=bridge asserts P_SERR#. 2265 ** 1b=bridge does not assert P_SERR# 2266 ** 00 0b Primary Bus Address Parity Error: This bit dictates bridge behavior 2267 ** when it detects an address parity error on the primary bus. 2268 ** 0b=bridge asserts P_SERR#. 2269 ** 1b=bridge does not assert P_SERR# 2270 **=============================================================================== 2271 ** 0x56: Pre-Boot Status Register - PBSR 2272 ** Bit Default Description 2273 ** 07 1 Reserved 2274 ** 06 - Reserved - value indeterminate 2275 ** 05:02 0 Reserved 2276 ** 01 Varies with External State of S_133EN at PCI Bus Reset Secondary Bus Max Frequency Setting: 2277 ** This bit reflect captured S_133EN strap, 2278 ** indicating the maximum secondary bus clock frequency when in PCI-X mode. 2279 ** Max Allowable Secondary Bus Frequency 2280 ** ** S_133EN PCI-X Mode 2281 ** ** 0 100 MHz 2282 ** ** 1 133 MH 2283 ** 00 0b Reserved 2284 **=============================================================================== 2285 ** 0x59-0x58: Secondary Decode Enable Register - SDER 2286 ** Bit Default Description 2287 ** 15:03 FFF1h Preserved. 2288 ** 02 Varies with External State of PRIVMEM at PCI Bus Reset Private Memory Space Enable - when set, 2289 ** bridge overrides its secondary inverse decode logic and not 2290 ** forward upstream any secondary bus initiated DAC Memory transactions with AD(63)=1b. 2291 ** This creates a private memory space on the Secondary PCI bus 2292 ** that allows peer-to-peer transactions. 2293 ** 01:00 10 2 Preserved. 2294 **=============================================================================== 2295 ** 0x5D-0x5C: Secondary IDSEL Select Register - SISR 2296 ** Bit Default Description 2297 ** 15:10 000000 2 Reserved. 2298 ** 09 Varies with External State of PRIVDEV at PCI Bus Reset AD25- IDSEL Disable - When this bit is set, 2299 ** AD25 is deasserted for any possible Type 1 to Type 0 conversion. 2300 ** When this bit is clear, 2301 ** AD25 is asserted when Primary addresses AD[15:11]=01001 2 during a Type 1 to Type 0 conversion. 2302 ** 08 Varies with External State of PRIVDEV at PCI Bus Reset AD24- IDSEL Disable - When this bit is set, 2303 ** AD24 is deasserted for any possible Type 1 to Type 0 conversion. 2304 ** When this bit is clear, 2305 ** AD24 is asserted when Primary addresses AD[15:11]=01000 2 during a Type 1 to Type 0 conversion. 2306 ** 07 Varies with External State of PRIVDEV at PCI Bus Reset AD23- IDSEL Disable - When this bit is set, 2307 ** AD23 is deasserted for any possible Type 1 to Type 0 conversion. 2308 ** When this bit is clear, 2309 ** AD23 is asserted when Primary addresses AD[15:11]=00111 2 during a Type 1 to Type 0 conversion. 2310 ** 06 Varies with External State of PRIVDEV at PCI Bus Reset AD22- IDSEL Disable - When this bit is set, 2311 ** AD22 is deasserted for any possible Type 1 to Type 0 conversion. 2312 ** When this bit is clear, 2313 ** AD22 is asserted when Primary addresses AD[15:11]=00110 2 during a Type 1 to Type 0 conversion. 2314 ** 05 Varies with External State of PRIVDEV at PCI Bus Reset AD21- IDSEL Disable - When this bit is set, 2315 ** AD21 is deasserted for any possible Type 1 to Type 0 conversion. 2316 ** When this bit is clear, 2317 ** AD21 is asserted when Primary addresses AD[15:11]=00101 2 during a Type 1 to Type 0 conversion. 2318 ** 04 Varies with External State of PRIVDEV at PCI Bus Reset AD20- IDSEL Disable - When this bit is set, 2319 ** AD20 is deasserted for any possible Type 1 to Type 0 conversion. 2320 ** When this bit is clear, 2321 ** AD20 is asserted when Primary addresses AD[15:11]=00100 2 during a Type 1 to Type 0 conversion. 2322 ** 03 Varies with External State of PRIVDEV at PCI Bus Reset AD19- IDSEL Disable - When this bit is set, 2323 ** AD19 is deasserted for any possible Type 1 to Type 0 conversion. 2324 ** When this bit is clear, 2325 ** AD19 is asserted when Primary addresses AD[15:11]=00011 2 during a Type 1 to Type 0 conversion. 2326 ** 02 Varies with External State of PRIVDEV at PCI Bus Reset AD18- IDSEL Disable - When this bit is set, 2327 ** AD18 is deasserted for any possible Type 1 to Type 0 conversion. 2328 ** When this bit is clear, 2329 ** AD18 is asserted when Primary addresses AD[15:11]=00010 2 during a Type 1 to Type 0 conversion. 2330 ** 01 Varies with External State of PRIVDEV at PCI Bus Reset AD17- IDSEL Disable - When this bit is set, 2331 ** AD17 is deasserted for any possible Type 1 to Type 0 conversion. 2332 ** When this bit is clear, 2333 ** AD17 is asserted when Primary addresses AD[15:11]=00001 2 during a Type 1 to Type 0 conversion. 2334 ** 00 Varies with External State of PRIVDEV at PCI Bus Reset AD16- IDSEL Disable - When this bit is set, 2335 ** AD16 is deasserted for any possible Type 1 to Type 0 conversion. 2336 ** When this bit is clear, 2337 ** AD16 is asserted when Primary addresses AD[15:11]=00000 2 during a Type 1 to Type 0 conversion. 2338 ************************************************************************** 2339 */ 2340 /* 2341 ************************************************************************** 2342 ** Reserved A8-CBh 2343 ************************************************************************** 2344 */ 2345 /* 2346 ************************************************************************** 2347 ** PCI Extended Enhanced Capabilities List CC-FFh 2348 ************************************************************************** 2349 ** ---------------------------------------------------------------------------------------------------------- 2350 ** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configu-ration Byte Offset 2351 ** ---------------------------------------------------------------------------------------------------------- 2352 ** | Power Management Capabilities | Next Item Ptr | Capability ID | DCh 2353 ** ---------------------------------------------------------------------------------------------------------- 2354 ** | PM Data | PPB Support | Extensions Power Management CSR | E0h 2355 ** ---------------------------------------------------------------------------------------------------------- 2356 ** | Reserved | Reserved | Reserved | E4h 2357 ** ---------------------------------------------------------------------------------------------------------- 2358 ** | Reserved | E8h 2359 ** ---------------------------------------------------------------------------------------------------------- 2360 ** | Reserved | Reserved | Reserved | Reserved | ECh 2361 ** ---------------------------------------------------------------------------------------------------------- 2362 ** | PCI-X Secondary Status | Next Item Ptr | Capability ID | F0h 2363 ** ---------------------------------------------------------------------------------------------------------- 2364 ** | PCI-X Bridge Status | F4h 2365 ** ---------------------------------------------------------------------------------------------------------- 2366 ** | PCI-X Upstream Split Transaction Control | F8h 2367 ** ---------------------------------------------------------------------------------------------------------- 2368 ** | PCI-X Downstream Split Transaction Control | FCh 2369 ** ---------------------------------------------------------------------------------------------------------- 2370 **=============================================================================== 2371 ** 0xDC: Power Management Capabilities Identifier - PM_CAPID 2372 ** Bit Default Description 2373 ** 07:00 01h Identifier (ID): PCI SIG assigned ID for PCI-PM register block 2374 **=============================================================================== 2375 ** 0xDD: Next Item Pointer - PM_NXTP 2376 ** Bit Default Description 2377 ** 07:00 F0H Next Capabilities Pointer (PTR): The register defaults to F0H pointing to the PCI-X Extended Capability Header. 2378 **=============================================================================== 2379 ** 0xDF-0xDE: Power Management Capabilities Register - PMCR 2380 ** Bit Default Description 2381 ** 15:11 00h PME Supported (PME): PME# cannot be asserted by bridge. 2382 ** 10 0h State D2 Supported (D2): Indicates no support for state D2. No power management action in this state. 2383 ** 09 1h State D1 Supported (D1): Indicates support for state D1. No power management action in this state. 2384 ** 08:06 0h Auxiliary Current (AUXC): This 3 bit field reports the 3.3Vaux auxiliary current requirements for the PCI function. 2385 ** This returns 000b as PME# wake-up for bridge is not implemented. 2386 ** 05 0 Special Initialization Required (SINT): Special initialization is not required for bridge. 2387 ** 04:03 00 Reserved 2388 ** 02:00 010 Version (VS): Indicates that this supports PCI Bus Power Management Interface Specification, Revision 1.1. 2389 **=============================================================================== 2390 ** 0xE1-0xE0: Power Management Control / Status - Register - PMCSR 2391 ** Bit Default Description 2392 ** 15:09 00h Reserved 2393 ** 08 0b PME_Enable: This bit, when set to 1b enables bridge to assert PME#. 2394 ** 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. 2395 ** 07:02 00h Reserved 2396 ** 01:00 00 Power State (PSTATE): This 2-bit field is used both to determine the current power state of 2397 ** a function and to set the Function into a new power state. 2398 ** 00 - D0 state 2399 ** 01 - D1 state 2400 ** 10 - D2 state 2401 ** 11 - D3 hot state 2402 **=============================================================================== 2403 ** 0xE2: Power Management Control / Status PCI to PCI Bridge Support - PMCSR_BSE 2404 ** Bit Default Description 2405 ** 07 0 Bus Power/Clock Control Enable (BPCC_En): Indicates that the bus power/clock control policies have been disabled. 2406 ** 06 0 B2/B3 support for D3 Hot (B2_B3#): The state of this bit determines the action that 2407 ** is to occur as a direct result of programming the function to D3 hot. 2408 ** This bit is only meaningful when bit 7 (BPCC_En) is a "1". 2409 ** 05:00 00h Reserved 2410 **=============================================================================== 2411 ** 0xE3: Power Management Data Register - PMDR 2412 ** Bit Default Description 2413 ** 07:00 00h Reserved 2414 **=============================================================================== 2415 ** 0xF0: PCI-X Capabilities Identifier - PX_CAPID 2416 ** Bit Default Description 2417 ** 07:00 07h Identifier (ID): Indicates this is a PCI-X capabilities list. 2418 **=============================================================================== 2419 ** 0xF1: Next Item Pointer - PX_NXTP 2420 ** Bit Default Description 2421 ** 07:00 00h Next Item Pointer: Points to the next capability in the linked list The power on default value of this 2422 ** register is 00h indicating that this is the last entry in the linked list of capabilities. 2423 **=============================================================================== 2424 ** 0xF3-0xF2: PCI-X Secondary Status - PX_SSTS 2425 ** Bit Default Description 2426 ** 15:09 00h Reserved 2427 ** 08:06 Xxx Secondary Clock Frequency (SCF): This field is set with the frequency of the secondary bus. 2428 ** The values are: 2429 ** ** BitsMax FrequencyClock Period 2430 ** ** 000PCI ModeN/A 2431 ** ** 00166 15 2432 ** ** 01010010 2433 ** ** 0111337.5 2434 ** ** 1xxreservedreserved 2435 ** ** The default value for this register is the operating frequency of the secondary bus 2436 ** 05 0b Split Request Delayed. (SRD): This bit is supposed to be set by a bridge when it cannot forward a transaction on the 2437 ** secondary bus to the primary bus because there is not enough room within the limit 2438 ** specified in the Split Transaction Commitment Limit field in the Downstream Split 2439 ** Transaction Control register. The bridge does not set this bit. 2440 ** 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. 2441 ** The bridge does not set this bit. 2442 ** 03 0b Unexpected Split Completion (USC): This bit is set when an unexpected split completion with a requester ID 2443 ** equal to bridge secondary bus number, device number 00h, 2444 ** and function number 0 is received on the secondary interface. 2445 ** This bit is cleared by software writing a '1'. 2446 ** 02 0b Split Completion Discarded (SCD): This bit is set 2447 ** when bridge discards a split completion moving toward the secondary bus 2448 ** because the requester would not accept it. This bit cleared by software writing a '1'. 2449 ** 01 1b 133 MHz Capable: Indicates that bridge is capable of running its secondary bus at 133 MHz 2450 ** 00 1b 64-bit Device (D64): Indicates the width of the secondary bus as 64-bits. 2451 **=============================================================================== 2452 ** 0xF7-0xF6-0xf5-0xF4: PCI-X Bridge Status - PX_BSTS 2453 ** Bit Default Description 2454 ** 31:22 0 Reserved 2455 ** 21 0 Split Request Delayed (SRD): This bit does not be set by bridge. 2456 ** 20 0 Split Completion Overrun (SCO): This bit does not be set by bridge 2457 ** because bridge throttles traffic on the completion side. 2458 ** 19 0 Unexpected Split Completion (USC): The bridge sets this bit to 1b 2459 ** when it encounters a corrupted Split Completion, possibly with an ** ** inconsistent remaining byte count.Software clears 2460 ** this bit by writing a 1b to it. 2461 ** 18 0 Split Completion Discarded (SCD): The bridge sets this bit to 1b 2462 ** when it has discarded a Split Completion.Software clears this bit by ** ** writing a 1b to it. 2463 ** 17 1 133 MHz Capable: This bit indicates that the bridge primary interface is ** capable of 133 MHz operation in PCI-X mode. 2464 ** 0=The maximum operating frequency is 66 MHz. 2465 ** 1=The maximum operating frequency is 133 MHz. 2466 ** 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. 2467 ** 0=Primary Interface is connected as a 32-bit PCI bus. 2468 ** 1=Primary Interface is connected as a 64-bit PCI bus. 2469 ** 15:08 00h Bus Number (BNUM): This field is simply an alias to the PBN field 2470 ** of the BNUM register at offset 18h. 2471 ** Apparently it was deemed necessary reflect it here for diagnostic purposes. 2472 ** 07:03 1fh Device Number (DNUM): Indicates which IDSEL bridge consumes. 2473 ** May be updated whenever a PCI-X 2474 ** configuration write cycle that targets bridge scores a hit. 2475 ** 02:00 0h Function Number (FNUM): The bridge Function # 2476 **=============================================================================== 2477 ** 0xFB-0xFA-0xF9-0xF8: PCI-X Upstream Split Transaction Control - PX_USTC 2478 ** Bit Default Description 2479 ** 31:16 003Eh Split Transaction Limit (STL): This register indicates the size of the commitment limit in units of ADQs. 2480 ** Software is permitted to program this register to any value greater than or equal to 2481 ** the contents of the Split Transaction Capacity register. A value less than the contents 2482 ** of the Split Transaction Capacity register causes unspecified results. 2483 ** A value of 003Eh or greater enables the bridge to forward all Split Requests of any 2484 ** size regardless of the amount of buffer space available. 2485 ** 15:00 003Eh Split Transaction Capacity (STC): This read-only field indicates the size of the buffer (number of ADQs) for storing 2486 ** split completions. This register controls behavior of the bridge buffers for forwarding 2487 ** Split Transactions from a primary bus requester to a secondary bus completer. 2488 ** The default value of 003Eh indicates there is available buffer space for 62 ADQs (7936 bytes). 2489 **=============================================================================== 2490 ** 0xFF-0xFE-0xFD-0xFC: PCI-X Downstream Split Transaction Control - PX_DSTC 2491 ** Bit Default Description 2492 ** 31:16 003Eh Split Transaction Limit (STL): This register indicates the size of the commitment limit in units of ADQs. 2493 ** Software is permitted to program this register to any value greater than or equal to 2494 ** the contents of the Split Transaction Capacity register. A value less than the contents 2495 ** of the Split Transaction Capacity register causes unspecified results. 2496 ** A value of 003Eh or greater enables the bridge to forward all Split Requests of any 2497 ** size regardless of the amount of buffer space available. 2498 ** 15:00 003Eh Split Transaction Capacity (STC): This read-only field indicates the size of the buffer (number of ADQs) for storing 2499 ** split completions. This register controls behavior of the bridge buffers for forwarding 2500 ** Split Transactions from a primary bus requester to a secondary bus completer. 2501 ** The default value of 003Eh indicates there is available buffer space for 62 ADQs 2502 ** (7936 bytes). 2503 ************************************************************************** 2504 */ 2505 2506 2507 2508 2509 /* 2510 ************************************************************************************************************************************* 2511 ** 80331 Address Translation Unit Register Definitions 2512 ** ATU Interface Configuration Header Format 2513 ** The ATU is programmed via a [Type 0] configuration command on the PCI interface. 2514 ************************************************************************************************************************************* 2515 ** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configuration Byte Offset 2516 **=================================================================================================================================== 2517 ** | ATU Device ID | Vendor ID | 00h 2518 ** ---------------------------------------------------------------------------------------------------------- 2519 ** | Status | Command | 04H 2520 ** ---------------------------------------------------------------------------------------------------------- 2521 ** | ATU Class Code | Revision ID | 08H 2522 ** ---------------------------------------------------------------------------------------------------------- 2523 ** | ATUBISTR | Header Type | Latency Timer | Cacheline Size | 0CH 2524 ** ---------------------------------------------------------------------------------------------------------- 2525 ** | Inbound ATU Base Address 0 | 10H 2526 ** ---------------------------------------------------------------------------------------------------------- 2527 ** | Inbound ATU Upper Base Address 0 | 14H 2528 ** ---------------------------------------------------------------------------------------------------------- 2529 ** | Inbound ATU Base Address 1 | 18H 2530 ** ---------------------------------------------------------------------------------------------------------- 2531 ** | Inbound ATU Upper Base Address 1 | 1CH 2532 ** ---------------------------------------------------------------------------------------------------------- 2533 ** | Inbound ATU Base Address 2 | 20H 2534 ** ---------------------------------------------------------------------------------------------------------- 2535 ** | Inbound ATU Upper Base Address 2 | 24H 2536 ** ---------------------------------------------------------------------------------------------------------- 2537 ** | Reserved | 28H 2538 ** ---------------------------------------------------------------------------------------------------------- 2539 ** | ATU Subsystem ID | ATU Subsystem Vendor ID | 2CH 2540 ** ---------------------------------------------------------------------------------------------------------- 2541 ** | Expansion ROM Base Address | 30H 2542 ** ---------------------------------------------------------------------------------------------------------- 2543 ** | Reserved Capabilities Pointer | 34H 2544 ** ---------------------------------------------------------------------------------------------------------- 2545 ** | Reserved | 38H 2546 ** ---------------------------------------------------------------------------------------------------------- 2547 ** | Maximum Latency | Minimum Grant | Interrupt Pin | Interrupt Line | 3CH 2548 ** ---------------------------------------------------------------------------------------------------------- 2549 ********************************************************************************************************************* 2550 */ 2551 /* 2552 *********************************************************************************** 2553 ** ATU Vendor ID Register - ATUVID 2554 ** ----------------------------------------------------------------- 2555 ** Bit Default Description 2556 ** 15:00 8086H (0x17D3) ATU Vendor ID - This is a 16-bit value assigned to Intel. 2557 ** This register, combined with the DID, uniquely identify the PCI device. 2558 ** Access type is Read/Write to allow the 80331 to configure the register as a different vendor ID 2559 ** to simulate the interface of a standard mechanism currently used by existing application software. 2560 *********************************************************************************** 2561 */ 2562 #define ARCMSR_ATU_VENDOR_ID_REG 0x00 /*word*/ 2563 /* 2564 *********************************************************************************** 2565 ** ATU Device ID Register - ATUDID 2566 ** ----------------------------------------------------------------- 2567 ** Bit Default Description 2568 ** 15:00 0336H (0x1110) ATU Device ID - This is a 16-bit value assigned to the ATU. 2569 ** This ID, combined with the VID, uniquely identify any PCI device. 2570 *********************************************************************************** 2571 */ 2572 #define ARCMSR_ATU_DEVICE_ID_REG 0x02 /*word*/ 2573 /* 2574 *********************************************************************************** 2575 ** ATU Command Register - ATUCMD 2576 ** ----------------------------------------------------------------- 2577 ** Bit Default Description 2578 ** 15:11 000000 2 Reserved 2579 ** 10 0 Interrupt Disable - This bit disables 80331 from asserting the ATU interrupt signal. 2580 ** 0=enables the assertion of interrupt signal. 2581 ** 1=disables the assertion of its interrupt signal. 2582 ** 09 0 2 Fast Back to Back Enable - When cleared, 2583 ** the ATU interface is not allowed to generate fast back-to-back cycles on its bus. 2584 ** Ignored when operating in the PCI-X mode. 2585 ** 08 0 2 SERR# Enable - When cleared, the ATU interface is not allowed to assert SERR# on the PCI interface. 2586 ** 07 1 2 Address/Data Stepping Control - Address stepping is implemented for configuration transactions. The 2587 ** ATU inserts 2 clock cycles of address stepping for Conventional Mode and 4 clock cycles 2588 ** of address stepping for PCI-X mode. 2589 ** 06 0 2 Parity Error Response - When set, the ATU takes normal action when a parity error 2590 ** is detected. When cleared, parity checking is disabled. 2591 ** 05 0 2 VGA Palette Snoop Enable - The ATU interface does not support I/O writes and therefore, 2592 ** does not perform VGA palette snooping. 2593 ** 04 0 2 Memory Write and Invalidate Enable - When set, ATU may generate MWI commands. 2594 ** When clear, ATU use Memory Write commands instead of MWI. Ignored when operating in the PCI-X mode. 2595 ** 03 0 2 Special Cycle Enable - The ATU interface does not respond to special cycle commands in any way. 2596 ** Not implemented and a reserved bit field. 2597 ** 02 0 2 Bus Master Enable - The ATU interface can act as a master on the PCI bus. 2598 ** When cleared, disables the device from generating PCI accesses. 2599 ** When set, allows the device to behave as a PCI bus master. 2600 ** When operating in the PCI-X mode, ATU initiates a split completion transaction regardless 2601 ** of the state of this bit. 2602 ** 01 0 2 Memory Enable - Controls the ATU interface's response to PCI memory addresses. 2603 ** When cleared, the ATU interface does not respond to any memory access on the PCI bus. 2604 ** 00 0 2 I/O Space Enable - Controls the ATU interface response to I/O transactions. 2605 ** Not implemented and a reserved bit field. 2606 *********************************************************************************** 2607 */ 2608 #define ARCMSR_ATU_COMMAND_REG 0x04 /*word*/ 2609 /* 2610 *********************************************************************************** 2611 ** ATU Status Register - ATUSR (Sheet 1 of 2) 2612 ** ----------------------------------------------------------------- 2613 ** Bit Default Description 2614 ** 15 0 2 Detected Parity Error - set when a parity error is detected in data received by the ATU on the PCI bus even 2615 ** when the ATUCMD register's Parity Error Response bit is cleared. Set under the following conditions: 2616 ** * Write Data Parity Error when the ATU is a target (inbound write). 2617 ** * Read Data Parity Error when the ATU is a requester (outbound read). 2618 ** * Any Address or Attribute (PCI-X Only) Parity Error on the Bus 2619 ** (including one generated by the ATU). 2620 ** 14 0 2 SERR# Asserted - set when SERR# is asserted on the PCI bus by the ATU. 2621 ** 13 0 2 Master Abort - set when a transaction initiated by the ATU PCI master interface, ends in a Master-Abort 2622 ** or when the ATU receives a Master Abort Split Completion Error Message in PCI-X mode. 2623 ** 12 0 2 Target Abort (master) - set when a transaction initiated by the ATU PCI master interface, ends in a target 2624 ** abort or when the ATU receives a Target Abort Split Completion Error Message in PCI-X mode. 2625 ** 11 0 2 Target Abort (target) - set when the ATU interface, acting as a target, 2626 ** terminates the transaction on the PCI bus with a target abort. 2627 ** 10:09 01 2 DEVSEL# Timing - These bits are read-only and define the slowest DEVSEL# 2628 ** timing for a target device in Conventional PCI Mode regardless of the operating mode 2629 ** (except configuration accesses). 2630 ** 00 2=Fast 2631 ** 01 2=Medium 2632 ** 10 2=Slow 2633 ** 11 2=Reserved 2634 ** The ATU interface uses Medium timing. 2635 ** 08 0 2 Master Parity Error - The ATU interface sets this bit under the following conditions: 2636 ** * The ATU asserted PERR# itself or the ATU observed PERR# asserted. 2637 ** * And the ATU acted as the requester 2638 ** for the operation in which the error occurred. 2639 ** * And the ATUCMD register's Parity Error Response bit is set 2640 ** * Or (PCI-X Mode Only) the ATU received a Write Data Parity Error Message 2641 ** * And the ATUCMD register's Parity Error Response bit is set 2642 ** 07 1 2 (Conventional mode) 2643 ** 0 2 (PCI-X mode) 2644 ** Fast Back-to-Back - The ATU/Messaging Unit interface is capable of accepting fast back-to-back 2645 ** transactions in Conventional PCI mode when the transactions are not to the same target. Since fast 2646 ** back-to-back transactions do not exist in PCI-X mode, this bit is forced to 0 in the PCI-X mode. 2647 ** 06 0 2 UDF Supported - User Definable Features are not supported 2648 ** 05 1 2 66 MHz. Capable - 66 MHz operation is supported. 2649 ** 04 1 2 Capabilities - When set, this function implements extended capabilities. 2650 ** 03 0 Interrupt Status - reflects the state of the ATU interrupt 2651 ** when the Interrupt Disable bit in the command register is a 0. 2652 ** 0=ATU interrupt signal deasserted. 2653 ** 1=ATU interrupt signal asserted. 2654 ** NOTE: Setting the Interrupt Disable bit to a 1 has no effect on the state of this bit. Refer to 2655 ** Section 3.10.23, "ATU Interrupt Pin Register - ATUIPR" on page 236 for details on the ATU 2656 ** interrupt signal. 2657 ** 02:00 00000 2 Reserved. 2658 *********************************************************************************** 2659 */ 2660 #define ARCMSR_ATU_STATUS_REG 0x06 /*word*/ 2661 /* 2662 *********************************************************************************** 2663 ** ATU Revision ID Register - ATURID 2664 ** ----------------------------------------------------------------- 2665 ** Bit Default Description 2666 ** 07:00 00H ATU Revision - identifies the 80331 revision number. 2667 *********************************************************************************** 2668 */ 2669 #define ARCMSR_ATU_REVISION_REG 0x08 /*byte*/ 2670 /* 2671 *********************************************************************************** 2672 ** ATU Class Code Register - ATUCCR 2673 ** ----------------------------------------------------------------- 2674 ** Bit Default Description 2675 ** 23:16 05H Base Class - Memory Controller 2676 ** 15:08 80H Sub Class - Other Memory Controller 2677 ** 07:00 00H Programming Interface - None defined 2678 *********************************************************************************** 2679 */ 2680 #define ARCMSR_ATU_CLASS_CODE_REG 0x09 /*3bytes 0x0B,0x0A,0x09*/ 2681 /* 2682 *********************************************************************************** 2683 ** ATU Cacheline Size Register - ATUCLSR 2684 ** ----------------------------------------------------------------- 2685 ** Bit Default Description 2686 ** 07:00 00H ATU Cacheline Size - specifies the system cacheline size in DWORDs. Cacheline size is restricted to either 0, 8 or 16 DWORDs. 2687 *********************************************************************************** 2688 */ 2689 #define ARCMSR_ATU_CACHELINE_SIZE_REG 0x0C /*byte*/ 2690 /* 2691 *********************************************************************************** 2692 ** ATU Latency Timer Register - ATULT 2693 ** ----------------------------------------------------------------- 2694 ** Bit Default Description 2695 ** 07:03 00000 2 (for Conventional mode) 2696 ** 01000 2 (for PCI-X mode) 2697 ** Programmable Latency Timer - This field varies the latency timer for the interface from 0 to 248 clocks. 2698 ** The default value is 0 clocks for Conventional PCI mode, and 64 clocks for PCI-X mode. 2699 ** 02:00 000 2 Latency Timer Granularity - These Bits are read only giving a programmable granularity of 8 clocks for the latency timer. 2700 *********************************************************************************** 2701 */ 2702 #define ARCMSR_ATU_LATENCY_TIMER_REG 0x0D /*byte*/ 2703 /* 2704 *********************************************************************************** 2705 ** ATU Header Type Register - ATUHTR 2706 ** ----------------------------------------------------------------- 2707 ** Bit Default Description 2708 ** 07 0 2 Single Function/Multi-Function Device - Identifies the 80331 as a single-function PCI device. 2709 ** 06:00 000000 2 PCI Header Type - This bit field indicates the type of PCI header implemented. The ATU interface 2710 ** header conforms to PCI Local Bus Specification, Revision 2.3. 2711 *********************************************************************************** 2712 */ 2713 #define ARCMSR_ATU_HEADER_TYPE_REG 0x0E /*byte*/ 2714 /* 2715 *********************************************************************************** 2716 ** ATU BIST Register - ATUBISTR 2717 ** 2718 ** The ATU BIST Register controls the functions the Intel XScale core performs when BIST is 2719 ** initiated. This register is the interface between the host processor requesting BIST functions and 2720 ** the 80331 replying with the results from the software implementation of the BIST functionality. 2721 ** ----------------------------------------------------------------- 2722 ** Bit Default Description 2723 ** 07 0 2 BIST Capable - This bit value is always equal to the ATUCR ATU BIST Interrupt Enable bit. 2724 ** 06 0 2 Start BIST - When the ATUCR BIST Interrupt Enable bit is set: 2725 ** Setting this bit generates an interrupt to the Intel XScale core to perform a software BIST function. 2726 ** The Intel XScale core clears this bit when the BIST software has completed with the BIST results 2727 ** found in ATUBISTR register bits [3:0]. 2728 ** When the ATUCR BIST Interrupt Enable bit is clear: 2729 ** Setting this bit does not generate an interrupt to the Intel XScale core and no BIST functions is performed. 2730 ** The Intel XScale core does not clear this bit. 2731 ** 05:04 00 2 Reserved 2732 ** 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): 2733 ** The Intel XScale core places the results of the software BIST in these bits. 2734 ** A nonzero value indicates a device-specific error. 2735 *********************************************************************************** 2736 */ 2737 #define ARCMSR_ATU_BIST_REG 0x0F /*byte*/ 2738 2739 /* 2740 *************************************************************************************** 2741 ** ATU Base Registers and Associated Limit Registers 2742 *************************************************************************************** 2743 ** Base Address Register Limit Register Description 2744 ** Inbound ATU Base Address Register 0 Inbound ATU Limit Register 0 Defines the inbound translation window 0 from the PCI bus. 2745 ** 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. 2746 ** Inbound ATU Base Address Register 1 Inbound ATU Limit Register 1 Defines inbound window 1 from the PCI bus. 2747 ** 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. 2748 ** Inbound ATU Base Address Register 2 Inbound ATU Limit Register 2 Defines the inbound translation window 2 from the PCI bus. 2749 ** 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. 2750 ** Inbound ATU Base Address Register 3 Inbound ATU Limit Register 3 Defines the inbound translation window 3 from the PCI bus. 2751 ** 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. 2752 ** NOTE: This is a private BAR that resides outside of the standard PCI configuration header space (offsets 00H-3FH). 2753 ** 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. 2754 **-------------------------------------------------------------------------------------- 2755 ** ATU Inbound Window 1 is not a translate window. 2756 ** The ATU does not claim any PCI accesses that fall within this range. 2757 ** This window is used to allocate host memory for use by Private Devices. 2758 ** When enabled, the ATU interrupts the Intel XScale core when either the IABAR1 register or the IAUBAR1 register is written from the PCI bus. 2759 *********************************************************************************** 2760 */ 2761 2762 /* 2763 *********************************************************************************** 2764 ** Inbound ATU Base Address Register 0 - IABAR0 2765 ** 2766 ** . The Inbound ATU Base Address Register 0 (IABAR0) together with the Inbound ATU Upper Base Address Register 0 (IAUBAR0) 2767 ** defines the block of memory addresses where the inbound translation window 0 begins. 2768 ** . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory. 2769 ** . The IABAR0 and IAUBAR0 define the base address and describes the required memory block size. 2770 ** . Bits 31 through 12 of the IABAR0 is either read/write bits or read only with a value of 0 2771 ** depending on the value located within the IALR0. 2772 ** This configuration allows the IABAR0 to be programmed per PCI Local Bus Specification. 2773 ** The first 4 Kbytes of memory defined by the IABAR0, IAUBAR0 and the IALR0 is reserved for the Messaging Unit. 2774 ** The programmed value within the base address register must comply with the PCI programming requirements for address alignment. 2775 ** Warning: 2776 ** When IALR0 is cleared prior to host configuration: 2777 ** the user should also clear the Prefetchable Indicator and the Type Indicator. 2778 ** Assuming IALR0 is not cleared: 2779 ** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary, 2780 ** when the Prefetchable Indicator is cleared prior to host configuration, 2781 ** the user should also set the Type Indicator for 32 bit addressability. 2782 ** b. For compliance to the PCI-X Addendum to the PCI Local Bus Specification, 2783 ** when the Prefetchable Indicator is set prior to host configuration, the user 2784 ** should also set the Type Indicator for 64 bit addressability. 2785 ** This is the default for IABAR0. 2786 ** ----------------------------------------------------------------- 2787 ** Bit Default Description 2788 ** 31:12 00000H Translation Base Address 0 - These bits define the actual location 2789 ** the translation function is to respond to when addressed from the PCI bus. 2790 ** 11:04 00H Reserved. 2791 ** 03 1 2 Prefetchable Indicator - When set, defines the memory space as prefetchable. 2792 ** 02:01 10 2 Type Indicator - Defines the width of the addressability for this memory window: 2793 ** 00 - Memory Window is locatable anywhere in 32 bit address space 2794 ** 10 - Memory Window is locatable anywhere in 64 bit address space 2795 ** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address. 2796 ** The ATU does not occupy I/O space, 2797 ** thus this bit must be zero. 2798 *********************************************************************************** 2799 */ 2800 #define ARCMSR_INBOUND_ATU_BASE_ADDRESS0_REG 0x10 /*dword 0x13,0x12,0x11,0x10*/ 2801 #define ARCMSR_INBOUND_ATU_MEMORY_PREFETCHABLE 0x08 2802 #define ARCMSR_INBOUND_ATU_MEMORY_WINDOW64 0x04 2803 /* 2804 *********************************************************************************** 2805 ** Inbound ATU Upper Base Address Register 0 - IAUBAR0 2806 ** 2807 ** This register contains the upper base address when decoding PCI addresses beyond 4 GBytes. 2808 ** Together with the Translation Base Address this register defines the actual location the translation 2809 ** function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs). 2810 ** The programmed value within the base address register must comply with the PCI programming requirements for address alignment. 2811 ** Note: 2812 ** When the Type indicator of IABAR0 is set to indicate 32 bit addressability, 2813 ** the IAUBAR0 register attributes are read-only. 2814 ** ----------------------------------------------------------------- 2815 ** Bit Default Description 2816 ** 31:0 00000H Translation Upper Base Address 0 - Together with the Translation Base Address 0 these bits define the 2817 ** actual location the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes. 2818 *********************************************************************************** 2819 */ 2820 #define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS0_REG 0x14 /*dword 0x17,0x16,0x15,0x14*/ 2821 /* 2822 *********************************************************************************** 2823 ** Inbound ATU Base Address Register 1 - IABAR1 2824 ** 2825 ** . The Inbound ATU Base Address Register (IABAR1) together with the Inbound ATU Upper Base Address Register 1 (IAUBAR1) 2826 ** defines the block of memory addresses where the inbound translation window 1 begins. 2827 ** . 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. 2828 ** . The programmed value within the base address register must comply with the PCI programming requirements for address alignment. 2829 ** . When enabled, the ATU interrupts the Intel XScale core when the IABAR1 register is written from the PCI bus. 2830 ** Warning: 2831 ** When a non-zero value is not written to IALR1 prior to host configuration, 2832 ** the user should not set either the Prefetchable Indicator or the Type Indicator for 64 bit addressability. 2833 ** This is the default for IABAR1. 2834 ** Assuming a non-zero value is written to IALR1, 2835 ** the user may set the Prefetchable Indicator 2836 ** or the Type Indicator: 2837 ** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address 2838 ** boundary, when the Prefetchable Indicator is not set prior to host configuration, 2839 ** the user should also leave the Type Indicator set for 32 bit addressability. 2840 ** This is the default for IABAR1. 2841 ** b. when the Prefetchable Indicator is set prior to host configuration, 2842 ** the user should also set the Type Indicator for 64 bit addressability. 2843 ** ----------------------------------------------------------------- 2844 ** Bit Default Description 2845 ** 31:12 00000H Translation Base Address 1 - These bits define the actual location of window 1 on the PCI bus. 2846 ** 11:04 00H Reserved. 2847 ** 03 0 2 Prefetchable Indicator - When set, defines the memory space as prefetchable. 2848 ** 02:01 00 2 Type Indicator - Defines the width of the addressability for this memory window: 2849 ** 00 - Memory Window is locatable anywhere in 32 bit address space 2850 ** 10 - Memory Window is locatable anywhere in 64 bit address space 2851 ** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address. 2852 ** The ATU does not occupy I/O space, 2853 ** thus this bit must be zero. 2854 *********************************************************************************** 2855 */ 2856 #define ARCMSR_INBOUND_ATU_BASE_ADDRESS1_REG 0x18 /*dword 0x1B,0x1A,0x19,0x18*/ 2857 /* 2858 *********************************************************************************** 2859 ** Inbound ATU Upper Base Address Register 1 - IAUBAR1 2860 ** 2861 ** This register contains the upper base address when locating this window for PCI addresses beyond 4 GBytes. 2862 ** Together with the IABAR1 this register defines the actual location for this memory window for addresses > 4GBytes (for DACs). 2863 ** 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. 2864 ** The programmed value within the base address register must comply with the PCI programming 2865 ** requirements for address alignment. 2866 ** When enabled, the ATU interrupts the Intel XScale core when the IAUBAR1 register is written 2867 ** from the PCI bus. 2868 ** Note: 2869 ** When the Type indicator of IABAR1 is set to indicate 32 bit addressability, 2870 ** the IAUBAR1 register attributes are read-only. 2871 ** This is the default for IABAR1. 2872 ** ----------------------------------------------------------------- 2873 ** Bit Default Description 2874 ** 31:0 00000H Translation Upper Base Address 1 - Together with the Translation Base Address 1 2875 ** these bits define the actual location for this memory window on the PCI bus for addresses > 4GBytes. 2876 *********************************************************************************** 2877 */ 2878 #define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS1_REG 0x1C /*dword 0x1F,0x1E,0x1D,0x1C*/ 2879 /* 2880 *********************************************************************************** 2881 ** Inbound ATU Base Address Register 2 - IABAR2 2882 ** 2883 ** . The Inbound ATU Base Address Register 2 (IABAR2) together with the Inbound ATU Upper Base Address Register 2 (IAUBAR2) 2884 ** defines the block of memory addresses where the inbound translation window 2 begins. 2885 ** . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory. 2886 ** . The IABAR2 and IAUBAR2 define the base address and describes the required memory block size 2887 ** . 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. 2888 ** The programmed value within the base address register must comply with the PCI programming requirements for address alignment. 2889 ** Warning: 2890 ** When a non-zero value is not written to IALR2 prior to host configuration, 2891 ** the user should not set either the Prefetchable Indicator 2892 ** or the Type Indicator for 64 bit addressability. 2893 ** This is the default for IABAR2. 2894 ** Assuming a non-zero value is written to IALR2, 2895 ** the user may set the Prefetchable Indicator 2896 ** or the Type Indicator: 2897 ** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary, 2898 ** when the Prefetchable Indicator is not set prior to host configuration, 2899 ** the user should also leave the Type Indicator set for 32 bit addressability. 2900 ** This is the default for IABAR2. 2901 ** b. when the Prefetchable Indicator is set prior to host configuration, 2902 ** the user should also set the Type Indicator for 64 bit addressability. 2903 ** ----------------------------------------------------------------- 2904 ** Bit Default Description 2905 ** 31:12 00000H Translation Base Address 2 - These bits define the actual location 2906 ** the translation function is to respond to when addressed from the PCI bus. 2907 ** 11:04 00H Reserved. 2908 ** 03 0 2 Prefetchable Indicator - When set, defines the memory space as prefetchable. 2909 ** 02:01 00 2 Type Indicator - Defines the width of the addressability for this memory window: 2910 ** 00 - Memory Window is locatable anywhere in 32 bit address space 2911 ** 10 - Memory Window is locatable anywhere in 64 bit address space 2912 ** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address. 2913 ** The ATU does not occupy I/O space, 2914 ** thus this bit must be zero. 2915 *********************************************************************************** 2916 */ 2917 #define ARCMSR_INBOUND_ATU_BASE_ADDRESS2_REG 0x20 /*dword 0x23,0x22,0x21,0x20*/ 2918 /* 2919 *********************************************************************************** 2920 ** Inbound ATU Upper Base Address Register 2 - IAUBAR2 2921 ** 2922 ** This register contains the upper base address when decoding PCI addresses beyond 4 GBytes. 2923 ** Together with the Translation Base Address this register defines the actual location 2924 ** the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs). 2925 ** The programmed value within the base address register must comply with the PCI programming 2926 ** requirements for address alignment. 2927 ** Note: 2928 ** When the Type indicator of IABAR2 is set to indicate 32 bit addressability, 2929 ** the IAUBAR2 register attributes are read-only. 2930 ** This is the default for IABAR2. 2931 ** ----------------------------------------------------------------- 2932 ** Bit Default Description 2933 ** 31:0 00000H Translation Upper Base Address 2 - Together with the Translation Base Address 2 2934 ** these bits define the actual location the translation function is to respond to 2935 ** when addressed from the PCI bus for addresses > 4GBytes. 2936 *********************************************************************************** 2937 */ 2938 #define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS2_REG 0x24 /*dword 0x27,0x26,0x25,0x24*/ 2939 /* 2940 *********************************************************************************** 2941 ** ATU Subsystem Vendor ID Register - ASVIR 2942 ** ----------------------------------------------------------------- 2943 ** Bit Default Description 2944 ** 15:0 0000H Subsystem Vendor ID - This register uniquely identifies the add-in board or subsystem vendor. 2945 *********************************************************************************** 2946 */ 2947 #define ARCMSR_ATU_SUBSYSTEM_VENDOR_ID_REG 0x2C /*word 0x2D,0x2C*/ 2948 /* 2949 *********************************************************************************** 2950 ** ATU Subsystem ID Register - ASIR 2951 ** ----------------------------------------------------------------- 2952 ** Bit Default Description 2953 ** 15:0 0000H Subsystem ID - uniquely identifies the add-in board or subsystem. 2954 *********************************************************************************** 2955 */ 2956 #define ARCMSR_ATU_SUBSYSTEM_ID_REG 0x2E /*word 0x2F,0x2E*/ 2957 /* 2958 *********************************************************************************** 2959 ** Expansion ROM Base Address Register -ERBAR 2960 ** ----------------------------------------------------------------- 2961 ** Bit Default Description 2962 ** 31:12 00000H Expansion ROM Base Address - These bits define the actual location 2963 ** where the Expansion ROM address window resides when addressed from the PCI bus on any 4 Kbyte boundary. 2964 ** 11:01 000H Reserved 2965 ** 00 0 2 Address Decode Enable - This bit field shows the ROM address 2966 ** decoder is enabled or disabled. When cleared, indicates the address decoder is disabled. 2967 *********************************************************************************** 2968 */ 2969 #define ARCMSR_EXPANSION_ROM_BASE_ADDRESS_REG 0x30 /*dword 0x33,0x32,0v31,0x30*/ 2970 #define ARCMSR_EXPANSION_ROM_ADDRESS_DECODE_ENABLE 0x01 2971 /* 2972 *********************************************************************************** 2973 ** ATU Capabilities Pointer Register - ATU_CAP_PTR 2974 ** ----------------------------------------------------------------- 2975 ** Bit Default Description 2976 ** 07:00 C0H Capability List Pointer - This provides an offset in this function's configuration space 2977 ** that points to the 80331 PCl Bus Power Management extended capability. 2978 *********************************************************************************** 2979 */ 2980 #define ARCMSR_ATU_CAPABILITY_PTR_REG 0x34 /*byte*/ 2981 /* 2982 *********************************************************************************** 2983 ** Determining Block Sizes for Base Address Registers 2984 ** The required address size and type can be determined by writing ones to a base address register and 2985 ** reading from the registers. By scanning the returned value from the least-significant bit of the base 2986 ** address registers upwards, the programmer can determine the required address space size. The 2987 ** binary-weighted value of the first non-zero bit found indicates the required amount of space. 2988 ** Table 105 describes the relationship between the values read back and the byte sizes the base 2989 ** address register requires. 2990 ** As an example, assume that FFFF.FFFFH is written to the ATU Inbound Base Address Register 0 2991 ** (IABAR0) and the value read back is FFF0.0008H. Bit zero is a zero, so the device requires 2992 ** memory address space. Bit three is one, so the memory does supports prefetching. Scanning 2993 ** upwards starting at bit four, bit twenty is the first one bit found. The binary-weighted value of this 2994 ** bit is 1,048,576, indicated that the device requires 1 Mbyte of memory space. 2995 ** The ATU Base Address Registers and the Expansion ROM Base Address Register use their 2996 ** associated limit registers to enable which bits within the base address register are read/write and 2997 ** which bits are read only (0). This allows the programming of these registers in a manner similar to 2998 ** other PCI devices even though the limit is variable. 2999 ** Table 105. Memory Block Size Read Response 3000 ** Response After Writing all 1s 3001 ** to the Base Address Register 3002 ** Size 3003 ** (Bytes) 3004 ** Response After Writing all 1s 3005 ** to the Base Address Register 3006 ** Size 3007 ** (Bytes) 3008 ** FFFFFFF0H 16 FFF00000H 1 M 3009 ** FFFFFFE0H 32 FFE00000H 2 M 3010 ** FFFFFFC0H 64 FFC00000H 4 M 3011 ** FFFFFF80H 128 FF800000H 8 M 3012 ** FFFFFF00H 256 FF000000H 16 M 3013 ** FFFFFE00H 512 FE000000H 32 M 3014 ** FFFFFC00H 1K FC000000H 64 M 3015 ** FFFFF800H 2K F8000000H 128 M 3016 ** FFFFF000H 4K F0000000H 256 M 3017 ** FFFFE000H 8K E0000000H 512 M 3018 ** FFFFC000H 16K C0000000H 1 G 3019 ** FFFF8000H 32K 80000000H 2 G 3020 ** FFFF0000H 64K 3021 ** 00000000H 3022 ** Register not 3023 ** imple-mented, 3024 ** no 3025 ** address 3026 ** space 3027 ** required. 3028 ** FFFE0000H 128K 3029 ** FFFC0000H 256K 3030 ** FFF80000H 512K 3031 ** 3032 *************************************************************************************** 3033 */ 3034 3035 3036 3037 /* 3038 *********************************************************************************** 3039 ** ATU Interrupt Line Register - ATUILR 3040 ** ----------------------------------------------------------------- 3041 ** Bit Default Description 3042 ** 07:00 FFH Interrupt Assigned - system-assigned value identifies which system interrupt controller's interrupt 3043 ** request line connects to the device's PCI interrupt request lines 3044 ** (as specified in the interrupt pin register). 3045 ** A value of FFH signifies "no connection" or "unknown". 3046 *********************************************************************************** 3047 */ 3048 #define ARCMSR_ATU_INTERRUPT_LINE_REG 0x3C /*byte*/ 3049 /* 3050 *********************************************************************************** 3051 ** ATU Interrupt Pin Register - ATUIPR 3052 ** ----------------------------------------------------------------- 3053 ** Bit Default Description 3054 ** 07:00 01H Interrupt Used - A value of 01H signifies that the ATU interface unit uses INTA# as the interrupt pin. 3055 *********************************************************************************** 3056 */ 3057 #define ARCMSR_ATU_INTERRUPT_PIN_REG 0x3D /*byte*/ 3058 /* 3059 *********************************************************************************** 3060 ** ATU Minimum Grant Register - ATUMGNT 3061 ** ----------------------------------------------------------------- 3062 ** Bit Default Description 3063 ** 07:00 80H This register specifies how long a burst period the device needs in increments of 8 PCI clocks. 3064 *********************************************************************************** 3065 */ 3066 #define ARCMSR_ATU_MINIMUM_GRANT_REG 0x3E /*byte*/ 3067 /* 3068 *********************************************************************************** 3069 ** ATU Maximum Latency Register - ATUMLAT 3070 ** ----------------------------------------------------------------- 3071 ** Bit Default Description 3072 ** 07:00 00H Specifies frequency (how often) the device needs to access the PCI bus 3073 ** in increments of 8 PCI clocks. A zero value indicates the device has no stringent requirement. 3074 *********************************************************************************** 3075 */ 3076 #define ARCMSR_ATU_MAXIMUM_LATENCY_REG 0x3F /*byte*/ 3077 /* 3078 *********************************************************************************** 3079 ** Inbound Address Translation 3080 ** 3081 ** The ATU allows external PCI bus initiators to directly access the internal bus. 3082 ** These PCI bus initiators can read or write 80331 memory-mapped registers or 80331 local memory space. 3083 ** The process of inbound address translation involves two steps: 3084 ** 1. Address Detection. 3085 ** * Determine when the 32-bit PCI address (64-bit PCI address during DACs) is 3086 ** within the address windows defined for the inbound ATU. 3087 ** * Claim the PCI transaction with medium DEVSEL# timing in the conventional PCI 3088 ** mode and with Decode A DEVSEL# timing in the PCI-X mode. 3089 ** 2. Address Translation. 3090 ** * Translate the 32-bit PCI address (lower 32-bit PCI address during DACs) to a 32-bit 80331 internal bus address. 3091 ** The ATU uses the following registers in inbound address window 0 translation: 3092 ** * Inbound ATU Base Address Register 0 3093 ** * Inbound ATU Limit Register 0 3094 ** * Inbound ATU Translate Value Register 0 3095 ** The ATU uses the following registers in inbound address window 2 translation: 3096 ** * Inbound ATU Base Address Register 2 3097 ** * Inbound ATU Limit Register 2 3098 ** * Inbound ATU Translate Value Register 2 3099 ** The ATU uses the following registers in inbound address window 3 translation: 3100 ** * Inbound ATU Base Address Register 3 3101 ** * Inbound ATU Limit Register 3 3102 ** * Inbound ATU Translate Value Register 3 3103 ** Note: Inbound Address window 1 is not a translate window. 3104 ** Instead, window 1 may be used to allocate host memory for Private Devices. 3105 ** Inbound Address window 3 does not reside in the standard section of the configuration header (offsets 00H - 3CH), 3106 ** thus the host BIOS does not configure window 3. 3107 ** Window 3 is intended to be used as a special window into local memory for private PCI 3108 ** agents controlled by the 80331 in conjunction with the Private Memory Space of the bridge. 3109 ** PCI-to-PCI Bridge in 80331 or 3110 ** Inbound address detection is determined from the 32-bit PCI address, 3111 ** (64-bit PCI address during DACs) the base address register and the limit register. 3112 ** In the case of DACs none of the upper 32-bits of the address is masked during address comparison. 3113 ** 3114 ** The algorithm for detection is: 3115 ** 3116 ** Equation 1. Inbound Address Detection 3117 ** When (PCI_Address [31:0] & Limit_Register[31:0]) == (Base_Register[31:0] & PCI_Address [63:32]) == Base_Register[63:32] (for DACs only) 3118 ** the PCI Address is claimed by the Inbound ATU. 3119 ** 3120 ** The incoming 32-bit PCI address (lower 32-bits of the address in case of DACs) is bitwise ANDed 3121 ** with the associated inbound limit register. 3122 ** When the result matches the base register (and upper base address matches upper PCI address in case of DACs), 3123 ** the inbound PCI address is detected as being within the inbound translation window and is claimed by the ATU. 3124 ** 3125 ** Note: The first 4 Kbytes of the ATU inbound address translation window 0 are reserved for the Messaging Unit. 3126 ** Once the transaction is claimed, the address must be translated from a PCI address to a 32-bit 3127 ** internal bus address. In case of DACs upper 32-bits of the address is simply discarded and only the 3128 ** lower 32-bits are used during address translation. 3129 ** The algorithm is: 3130 ** 3131 ** 3132 ** Equation 2. Inbound Translation 3133 ** Intel I/O processor Internal Bus Address=(PCI_Address[31:0] & ~Limit_Register[31:0]) | ATU_Translate_Value_Register[31:0]. 3134 ** 3135 ** The incoming 32-bit PCI address (lower 32-bits in case of DACs) is first bitwise ANDed with the 3136 ** bitwise inverse of the limit register. This result is bitwise ORed with the ATU Translate Value and 3137 ** the result is the internal bus address. This translation mechanism is used for all inbound memory 3138 ** read and write commands excluding inbound configuration read and writes. 3139 ** In the PCI mode for inbound memory transactions, the only burst order supported is Linear 3140 ** Incrementing. For any other burst order, the ATU signals a Disconnect after the first data phase. 3141 ** The PCI-X supports linear incrementing only, and hence above situation is not encountered in the PCI-X mode. 3142 ** example: 3143 ** Register Values 3144 ** Base_Register=3A00 0000H 3145 ** Limit_Register=FF80 0000H (8 Mbyte limit value) 3146 ** Value_Register=B100 0000H 3147 ** Inbound Translation Window ranges from 3A00 0000H to 3A7F FFFFH (8 Mbytes) 3148 ** 3149 ** Address Detection (32-bit address) 3150 ** 3151 ** PCI_Address & Limit_Register == Base_Register 3152 ** 3A45 012CH & FF80 0000H == 3A00 0000H 3153 ** 3154 ** ANS: PCI_Address is in the Inbound Translation Window 3155 ** Address Translation (to get internal bus address) 3156 ** 3157 ** IB_Address=(PCI_Address & ~Limit_Register) | Value_Reg 3158 ** IB_Address=(3A45 012CH & 007F FFFFH) | B100 0000H 3159 ** 3160 ** ANS:IB_Address=B145 012CH 3161 *********************************************************************************** 3162 */ 3163 3164 3165 3166 /* 3167 *********************************************************************************** 3168 ** Inbound ATU Limit Register 0 - IALR0 3169 ** 3170 ** Inbound address translation for memory window 0 occurs for data transfers occurring from the PCI 3171 ** bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts 3172 ** PCI addresses to internal bus addresses. 3173 ** The 80331 translate value register's programmed value must be naturally aligned with the base 3174 ** address register's programmed value. The limit register is used as a mask; thus, the lower address 3175 ** bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus 3176 ** Specification, Revision 2.3 for additional information on programming base address registers. 3177 ** Bits 31 to 12 within the IALR0 have a direct effect on the IABAR0 register, bits 31 to 12, with a 3178 ** one to one correspondence. A value of 0 in a bit within the IALR0 makes the corresponding bit 3179 ** within the IABAR0 a read only bit which always returns 0. A value of 1 in a bit within the IALR0 3180 ** makes the corresponding bit within the IABAR0 read/write from PCI. Note that a consequence of 3181 ** this programming scheme is that unless a valid value exists within the IALR0, all writes to the 3182 ** IABAR0 has no effect since a value of all zeros within the IALR0 makes the IABAR0 a read only register. 3183 ** ----------------------------------------------------------------- 3184 ** Bit Default Description 3185 ** 31:12 FF000H Inbound Translation Limit 0 - This readback value determines the memory block size required for 3186 ** inbound memory window 0 of the address translation unit. This defaults to an inbound window of 16MB. 3187 ** 11:00 000H Reserved 3188 *********************************************************************************** 3189 */ 3190 #define ARCMSR_INBOUND_ATU_LIMIT0_REG 0x40 /*dword 0x43,0x42,0x41,0x40*/ 3191 /* 3192 *********************************************************************************** 3193 ** Inbound ATU Translate Value Register 0 - IATVR0 3194 ** 3195 ** The Inbound ATU Translate Value Register 0 (IATVR0) contains the internal bus address used to 3196 ** convert PCI bus addresses. The converted address is driven on the internal bus as a result of the 3197 ** inbound ATU address translation. 3198 ** ----------------------------------------------------------------- 3199 ** Bit Default Description 3200 ** 31:12 FF000H Inbound ATU Translation Value 0 - This value is used to convert the PCI address to internal bus addresses. 3201 ** This value must be 64-bit aligned on the internal bus. 3202 ** The default address allows the ATU to access the internal 80331 memory-mapped registers. 3203 ** 11:00 000H Reserved 3204 *********************************************************************************** 3205 */ 3206 #define ARCMSR_INBOUND_ATU_TRANSLATE_VALUE0_REG 0x44 /*dword 0x47,0x46,0x45,0x44*/ 3207 /* 3208 *********************************************************************************** 3209 ** Expansion ROM Limit Register - ERLR 3210 ** 3211 ** The Expansion ROM Limit Register (ERLR) defines the block size of addresses the ATU defines 3212 ** as Expansion ROM address space. The block size is programmed by writing a value into the ERLR. 3213 ** Bits 31 to 12 within the ERLR have a direct effect on the ERBAR register, bits 31 to 12, with a one 3214 ** to one correspondence. A value of 0 in a bit within the ERLR makes the corresponding bit within 3215 ** the ERBAR a read only bit which always returns 0. A value of 1 in a bit within the ERLR makes 3216 ** the corresponding bit within the ERBAR read/write from PCI. 3217 ** ----------------------------------------------------------------- 3218 ** Bit Default Description 3219 ** 31:12 000000H Expansion ROM Limit - Block size of memory required for the Expansion ROM translation unit. Default 3220 ** value is 0, which indicates no Expansion ROM address space and all bits within the ERBAR are read only with a value of 0. 3221 ** 11:00 000H Reserved. 3222 *********************************************************************************** 3223 */ 3224 #define ARCMSR_EXPANSION_ROM_LIMIT_REG 0x48 /*dword 0x4B,0x4A,0x49,0x48*/ 3225 /* 3226 *********************************************************************************** 3227 ** Expansion ROM Translate Value Register - ERTVR 3228 ** 3229 ** The Expansion ROM Translate Value Register contains the 80331 internal bus address which the 3230 ** ATU converts the PCI bus access. This address is driven on the internal bus as a result of the 3231 ** Expansion ROM address translation. 3232 ** ----------------------------------------------------------------- 3233 ** Bit Default Description 3234 ** 31:12 00000H Expansion ROM Translation Value - Used to convert PCI addresses to 80331 internal bus addresses 3235 ** for Expansion ROM accesses. The Expansion ROM address translation value must be word aligned on the internal bus. 3236 ** 11:00 000H Reserved 3237 *********************************************************************************** 3238 */ 3239 #define ARCMSR_EXPANSION_ROM_TRANSLATE_VALUE_REG 0x4C /*dword 0x4F,0x4E,0x4D,0x4C*/ 3240 /* 3241 *********************************************************************************** 3242 ** Inbound ATU Limit Register 1 - IALR1 3243 ** 3244 ** Bits 31 to 12 within the IALR1 have a direct effect on the IABAR1 register, bits 31 to 12, with a 3245 ** one to one correspondence. A value of 0 in a bit within the IALR1 makes the corresponding bit 3246 ** within the IABAR1 a read only bit which always returns 0. A value of 1 in a bit within the IALR1 3247 ** makes the corresponding bit within the IABAR1 read/write from PCI. Note that a consequence of 3248 ** this programming scheme is that unless a valid value exists within the IALR1, all writes to the 3249 ** IABAR1 has no effect since a value of all zeros within the IALR1 makes the IABAR1 a read only 3250 ** register. 3251 ** The inbound memory window 1 is used merely to allocate memory on the PCI bus. The ATU does 3252 ** not process any PCI bus transactions to this memory range. 3253 ** Warning: The ATU does not claim any PCI accesses that fall within the range defined by IABAR1, 3254 ** IAUBAR1, and IALR1. 3255 ** ----------------------------------------------------------------- 3256 ** Bit Default Description 3257 ** 31:12 00000H Inbound Translation Limit 1 - This readback value determines the memory block size 3258 ** required for the ATUs memory window 1. 3259 ** 11:00 000H Reserved 3260 *********************************************************************************** 3261 */ 3262 #define ARCMSR_INBOUND_ATU_LIMIT1_REG 0x50 /*dword 0x53,0x52,0x51,0x50*/ 3263 /* 3264 *********************************************************************************** 3265 ** Inbound ATU Limit Register 2 - IALR2 3266 ** 3267 ** Inbound address translation for memory window 2 occurs for data transfers occurring from the PCI 3268 ** bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts 3269 ** PCI addresses to internal bus addresses. 3270 ** The inbound translation base address for inbound window 2 is specified in Section 3.10.15. When 3271 ** determining block size requirements ( as described in Section 3.10.21 ) the translation limit 3272 ** register provides the block size requirements for the base address register. The remaining registers 3273 ** used for performing address translation are discussed in Section 3.2.1.1. 3274 ** The 80331 translate value register's programmed value must be naturally aligned with the base 3275 ** address register's programmed value. The limit register is used as a mask; thus, the lower address 3276 ** bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus 3277 ** Specification, Revision 2.3 for additional information on programming base address registers. 3278 ** Bits 31 to 12 within the IALR2 have a direct effect on the IABAR2 register, bits 31 to 12, with a 3279 ** one to one correspondence. A value of 0 in a bit within the IALR2 makes the corresponding bit 3280 ** within the IABAR2 a read only bit which always returns 0. A value of 1 in a bit within the IALR2 3281 ** makes the corresponding bit within the IABAR2 read/write from PCI. Note that a consequence of 3282 ** this programming scheme is that unless a valid value exists within the IALR2, all writes to the 3283 ** IABAR2 has no effect since a value of all zeros within the IALR2 makes the IABAR2 a read only 3284 ** register. 3285 ** ----------------------------------------------------------------- 3286 ** Bit Default Description 3287 ** 31:12 00000H Inbound Translation Limit 2 - This readback value determines the memory block size 3288 ** required for the ATUs memory window 2. 3289 ** 11:00 000H Reserved 3290 *********************************************************************************** 3291 */ 3292 #define ARCMSR_INBOUND_ATU_LIMIT2_REG 0x54 /*dword 0x57,0x56,0x55,0x54*/ 3293 /* 3294 *********************************************************************************** 3295 ** Inbound ATU Translate Value Register 2 - IATVR2 3296 ** 3297 ** The Inbound ATU Translate Value Register 2 (IATVR2) contains the internal bus address used to 3298 ** convert PCI bus addresses. The converted address is driven on the internal bus as a result of the 3299 ** inbound ATU address translation. 3300 ** ----------------------------------------------------------------- 3301 ** Bit Default Description 3302 ** 31:12 00000H Inbound ATU Translation Value 2 - This value is used to convert the PCI address to internal bus addresses. 3303 ** This value must be 64-bit aligned on the internal bus. 3304 ** The default address allows the ATU to access the internal 80331 ** ** memory-mapped registers. 3305 ** 11:00 000H Reserved 3306 *********************************************************************************** 3307 */ 3308 #define ARCMSR_INBOUND_ATU_TRANSLATE_VALUE2_REG 0x58 /*dword 0x5B,0x5A,0x59,0x58*/ 3309 /* 3310 *********************************************************************************** 3311 ** Outbound I/O Window Translate Value Register - OIOWTVR 3312 ** 3313 ** The Outbound I/O Window Translate Value Register (OIOWTVR) contains the PCI I/O address 3314 ** used to convert the internal bus access to a PCI address. This address is driven on the PCI bus as a 3315 ** result of the outbound ATU address translation. 3316 ** The I/O window is from 80331 internal bus address 9000 000H to 9000 FFFFH with the fixed 3317 ** length of 64 Kbytes. 3318 ** ----------------------------------------------------------------- 3319 ** Bit Default Description 3320 ** 31:16 0000H Outbound I/O Window Translate Value - Used to convert internal bus addresses to PCI addresses. 3321 ** 15:00 0000H Reserved 3322 *********************************************************************************** 3323 */ 3324 #define ARCMSR_OUTBOUND_IO_WINDOW_TRANSLATE_VALUE_REG 0x5C /*dword 0x5F,0x5E,0x5D,0x5C*/ 3325 /* 3326 *********************************************************************************** 3327 ** Outbound Memory Window Translate Value Register 0 -OMWTVR0 3328 ** 3329 ** The Outbound Memory Window Translate Value Register 0 (OMWTVR0) contains the PCI 3330 ** address used to convert 80331 internal bus addresses for outbound transactions. This address is 3331 ** driven on the PCI bus as a result of the outbound ATU address translation. 3332 ** The memory window is from internal bus address 8000 000H to 83FF FFFFH with the fixed length 3333 ** of 64 Mbytes. 3334 ** ----------------------------------------------------------------- 3335 ** Bit Default Description 3336 ** 31:26 00H Outbound MW Translate Value - Used to convert 80331 internal bus addresses to PCI addresses. 3337 ** 25:02 00 0000H Reserved 3338 ** 01:00 00 2 Burst Order - This bit field shows the address sequence during a memory burst. 3339 ** Only linear incrementing mode is supported. 3340 *********************************************************************************** 3341 */ 3342 #define ARCMSR_OUTBOUND_MEMORY_WINDOW_TRANSLATE_VALUE0_REG 0x60 /*dword 0x63,0x62,0x61,0x60*/ 3343 /* 3344 *********************************************************************************** 3345 ** Outbound Upper 32-bit Memory Window Translate Value Register 0 - OUMWTVR0 3346 ** 3347 ** The Outbound Upper 32-bit Memory Window Translate Value Register 0 (OUMWTVR0) defines 3348 ** the upper 32-bits of address used during a dual address cycle. This enables the outbound ATU to 3349 ** directly address anywhere within the 64-bit host address space. When this register is all-zero, then 3350 ** a SAC is generated on the PCI bus. 3351 ** The memory window is from internal bus address 8000 000H to 83FF FFFFH with the fixed 3352 ** length of 64 Mbytes. 3353 ** ----------------------------------------------------------------- 3354 ** Bit Default Description 3355 ** 31:00 0000 0000H These bits define the upper 32-bits of address driven during the dual address cycle (DAC). 3356 *********************************************************************************** 3357 */ 3358 #define ARCMSR_OUTBOUND_UPPER32_MEMORY_WINDOW_TRANSLATE_VALUE0_REG 0x64 /*dword 0x67,0x66,0x65,0x64*/ 3359 /* 3360 *********************************************************************************** 3361 ** Outbound Memory Window Translate Value Register 1 -OMWTVR1 3362 ** 3363 ** The Outbound Memory Window Translate Value Register 1 (OMWTVR1) contains the PCI 3364 ** address used to convert 80331 internal bus addresses for outbound transactions. This address is 3365 ** driven on the PCI bus as a result of the outbound ATU address translation. 3366 ** The memory window is from internal bus address 8400 000H to 87FF FFFFH with the fixed length 3367 ** of 64 Mbytes. 3368 ** ----------------------------------------------------------------- 3369 ** Bit Default Description 3370 ** 31:26 00H Outbound MW Translate Value - Used to convert 80331 internal bus addresses to PCI addresses. 3371 ** 25:02 00 0000H Reserved 3372 ** 01:00 00 2 Burst Order - This bit field shows the address sequence during a memory burst. 3373 ** Only linear incrementing mode is supported. 3374 *********************************************************************************** 3375 */ 3376 #define ARCMSR_OUTBOUND_MEMORY_WINDOW_TRANSLATE_VALUE1_REG 0x68 /*dword 0x6B,0x6A,0x69,0x68*/ 3377 /* 3378 *********************************************************************************** 3379 ** Outbound Upper 32-bit Memory Window Translate Value Register 1 - OUMWTVR1 3380 ** 3381 ** The Outbound Upper 32-bit Memory Window Translate Value Register 1 (OUMWTVR1) defines 3382 ** the upper 32-bits of address used during a dual address cycle. This enables the outbound ATU to 3383 ** directly address anywhere within the 64-bit host address space. When this register is all-zero, then 3384 ** a SAC is generated on the PCI bus. 3385 ** The memory window is from internal bus address 8400 000H to 87FF FFFFH with the fixed length 3386 ** of 64 Mbytes. 3387 ** ----------------------------------------------------------------- 3388 ** Bit Default Description 3389 ** 31:00 0000 0000H These bits define the upper 32-bits of address driven during the dual address cycle (DAC). 3390 *********************************************************************************** 3391 */ 3392 #define ARCMSR_OUTBOUND_UPPER32_MEMORY_WINDOW_TRANSLATE_VALUE1_REG 0x6C /*dword 0x6F,0x6E,0x6D,0x6C*/ 3393 /* 3394 *********************************************************************************** 3395 ** Outbound Upper 32-bit Direct Window Translate Value Register - OUDWTVR 3396 ** 3397 ** The Outbound Upper 32-bit Direct Window Translate Value Register (OUDWTVR) defines the 3398 ** upper 32-bits of address used during a dual address cycle for the transactions via Direct Addressing 3399 ** Window. This enables the outbound ATU to directly address anywhere within the 64-bit host 3400 ** address space. When this register is all-zero, then a SAC is generated on the PCI bus. 3401 ** ----------------------------------------------------------------- 3402 ** Bit Default Description 3403 ** 31:00 0000 0000H These bits define the upper 32-bits of address driven during the dual address cycle (DAC). 3404 *********************************************************************************** 3405 */ 3406 #define ARCMSR_OUTBOUND_UPPER32_DIRECT_WINDOW_TRANSLATE_VALUE_REG 0x78 /*dword 0x7B,0x7A,0x79,0x78*/ 3407 /* 3408 *********************************************************************************** 3409 ** ATU Configuration Register - ATUCR 3410 ** 3411 ** The ATU Configuration Register controls the outbound address translation for address translation 3412 ** unit. It also contains bits for Conventional PCI Delayed Read Command (DRC) aliasing, discard 3413 ** timer status, SERR# manual assertion, SERR# detection interrupt masking, and ATU BIST 3414 ** interrupt enabling. 3415 ** ----------------------------------------------------------------- 3416 ** Bit Default Description 3417 ** 31:20 00H Reserved 3418 ** 19 0 2 ATU DRC Alias - when set, the ATU does not distinguish read commands when attempting to match a 3419 ** current PCI read transaction with read data enqueued within the DRC buffer. When clear, a current read 3420 ** transaction must have the exact same read command as the DRR for the ATU to deliver DRC data. Not 3421 ** applicable in the PCI-X mode. 3422 ** 18 0 2 Direct Addressing Upper 2Gbytes Translation Enable - When set, 3423 ** with Direct Addressing enabled (bit 7 of the ATUCR set), 3424 ** the ATU forwards internal bus cycles with an address between 0000.0040H and 3425 ** 7FFF.FFFFH to the PCI bus with bit 31 of the address set (8000.0000H - FFFF.FFFFH). 3426 ** When clear, no translation occurs. 3427 ** 17 0 2 Reserved 3428 ** 16 0 2 SERR# Manual Assertion - when set, the ATU asserts SERR# for one clock on the PCI interface. Until 3429 ** cleared, SERR# may not be manually asserted again. Once cleared, operation proceeds as specified. 3430 ** 15 0 2 ATU Discard Timer Status - when set, one of the 4 discard timers within the ATU has expired and 3431 ** discarded the delayed completion transaction within the queue. When clear, no timer has expired. 3432 ** 14:10 00000 2 Reserved 3433 ** 09 0 2 SERR# Detected Interrupt Enable - When set, the Intel XScale core is signalled an HPI# interrupt 3434 ** when the ATU detects that SERR# was asserted. When clear, 3435 ** the Intel XScale core is not interrupted when SERR# is detected. 3436 ** 08 0 2 Direct Addressing Enable - Setting this bit enables direct outbound addressing through the ATU. 3437 ** Internal bus cycles with an address between 0000.0040H and 7FFF.FFFFH automatically forwards to 3438 ** the PCI bus with or without translation of address bit 31 based on the setting of bit 18 of 3439 ** the ATUCR. 3440 ** 07:04 0000 2 Reserved 3441 ** 03 0 2 ATU BIST Interrupt Enable - When set, enables an interrupt to the Intel XScale core when the start 3442 ** BIST bit is set in the ATUBISTR register. This bit is also reflected as the BIST Capable bit 7 3443 ** in the ATUBISTR register. 3444 ** 02 0 2 Reserved 3445 ** 01 0 2 Outbound ATU Enable - When set, enables the outbound address translation unit. 3446 ** When cleared, disables the outbound ATU. 3447 ** 00 0 2 Reserved 3448 *********************************************************************************** 3449 */ 3450 #define ARCMSR_ATU_CONFIGURATION_REG 0x80 /*dword 0x83,0x82,0x81,0x80*/ 3451 /* 3452 *********************************************************************************** 3453 ** PCI Configuration and Status Register - PCSR 3454 ** 3455 ** The PCI Configuration and Status Register has additional bits for controlling and monitoring 3456 ** various features of the PCI bus interface. 3457 ** ----------------------------------------------------------------- 3458 ** Bit Default Description 3459 ** 31:19 0000H Reserved 3460 ** 18 0 2 Detected Address or Attribute Parity Error - set when a parity error is detected during either the address 3461 ** or attribute phase of a transaction on the PCI bus even when the ATUCMD register Parity Error 3462 ** Response bit is cleared. Set under the following conditions: 3463 ** * Any Address or Attribute (PCI-X Only) Parity Error on the Bus (including one generated by the ATU). 3464 ** 17:16 Varies with 3465 ** external state 3466 ** of DEVSEL#, 3467 ** STOP#, and 3468 ** TRDY#, 3469 ** during 3470 ** P_RST# 3471 ** PCI-X capability - These two bits define the mode of 3472 ** the PCI bus (conventional or PCI-X) as well as the 3473 ** operating frequency in the case of PCI-X mode. 3474 ** 00 - Conventional PCI mode 3475 ** 01 - PCI-X 66 3476 ** 10 - PCI-X 100 3477 ** 11 - PCI-X 133 3478 ** As defined by the PCI-X Addendum to the PCI Local Bus Specification, 3479 ** Revision 1.0a, the operating 3480 ** mode is determined by an initialization pattern on the PCI bus during 3481 ** P_RST# assertion: 3482 ** DEVSEL# STOP# TRDY# Mode 3483 ** Deasserted Deasserted Deasserted Conventional 3484 ** Deasserted Deasserted Asserted PCI-X 66 3485 ** Deasserted Asserted Deasserted PCI-X 100 3486 ** Deasserted Asserted Asserted PCI-X 133 3487 ** All other patterns are reserved. 3488 ** 15 0 2 3489 ** Outbound Transaction Queue Busy: 3490 ** 0=Outbound Transaction Queue Empty 3491 ** 1=Outbound Transaction Queue Busy 3492 ** 14 0 2 3493 ** Inbound Transaction Queue Busy: 3494 ** 0=Inbound Transaction Queue Empty 3495 ** 1=Inbound Transaction Queue Busy 3496 ** 13 0 2 Reserved. 3497 ** 12 0 2 Discard Timer Value - This bit controls the time-out value 3498 ** for the four discard timers attached to the queues holding read data. 3499 ** A value of 0 indicates the time-out value is 2 15 clocks. 3500 ** A value of 1 indicates the time-out value is 2 10 clocks. 3501 ** 11 0 2 Reserved. 3502 ** 10 Varies with 3503 ** external state 3504 ** of M66EN 3505 ** during 3506 ** P_RST# 3507 ** Bus Operating at 66 MHz - When set, the interface has been initialized to function at 66 MHz in 3508 ** Conventional PCI mode by the assertion of M66EN during bus initialization. 3509 ** When clear, the interface 3510 ** has been initialized as a 33 MHz bus. 3511 ** 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. 3512 ** 09 0 2 Reserved 3513 ** 08 Varies with 3514 ** external state 3515 ** of REQ64# 3516 ** during 3517 ** P_RST# 3518 ** PCI Bus 64-Bit Capable - When clear, the PCI bus interface has been 3519 ** configured as 64-bit capable by 3520 ** the assertion of REQ64# on the rising edge of P_RST#. When set, 3521 ** the PCI interface is configured as 3522 ** 32-bit only. 3523 ** 07:06 00 2 Reserved. 3524 ** 05 0 2 Reset Internal Bus - This bit controls the reset of the Intel XScale core 3525 ** and all units on the internal 3526 ** bus. In addition to the internal bus initialization, 3527 ** this bit triggers the assertion of the M_RST# pin for 3528 ** initialization of registered DIMMs. When set: 3529 ** When operating in the conventional PCI mode: 3530 ** * All current PCI transactions being mastered by the ATU completes, 3531 ** and the ATU master interfaces 3532 ** proceeds to an idle state. No additional transactions is mastered by these units 3533 ** until the internal bus reset is complete. 3534 ** * All current transactions being slaved by the ATU on either the PCI bus 3535 ** or the internal bus 3536 ** completes, and the ATU target interfaces proceeds to an idle state. 3537 ** All future slave transactions master aborts, 3538 ** with the exception of the completion cycle for the transaction that set the Reset 3539 ** Internal Bus bit in the PCSR. 3540 ** * When the value of the Core Processor Reset bit in the PCSR (upon P_RST# assertion) 3541 ** is set, the Intel XScale core is held in reset when the internal bus reset is complete. 3542 ** * The ATU ignores configuration cycles, and they appears as master aborts for: 32 3543 ** Internal Bus clocks. 3544 ** * The 80331 hardware clears this bit after the reset operation completes. 3545 ** When operating in the PCI-X mode: 3546 ** The ATU hardware responds the same as in Conventional PCI-X mode. 3547 ** However, this may create a problem in PCI-X mode for split requests in 3548 ** that there may still be an outstanding split completion that the 3549 ** ATU is either waiting to receive (Outbound Request) or initiate 3550 ** (Inbound Read Request). For a cleaner 3551 ** internal bus reset, host software can take the following steps prior 3552 ** to asserting Reset Internal bus: 3553 ** 1. Clear the Bus Master (bit 2 of the ATUCMD) and the Memory Enable (bit 1 of the ATUCMD) bits in 3554 ** the ATUCMD. This ensures that no new transactions, either outbound or inbound are enqueued. 3555 ** 2. Wait for both the Outbound (bit 15 of the PCSR) and Inbound Read (bit 14 of the PCSR) Transaction 3556 ** queue busy bits to be clear. 3557 ** 3. Set the Reset Internal Bus bit 3558 ** As a result, the ATU hardware resets the internal bus using the same logic as in conventional mode, 3559 ** however the user is now assured that the ATU no longer has any pending inbound or outbound split 3560 ** completion transactions. 3561 ** NOTE: Since the Reset Internal Bus bit is set using an inbound configuration cycle, the user is 3562 ** guaranteed that any prior configuration cycles have properly completed since there is only a one 3563 ** deep transaction queue for configuration transaction requests. The ATU sends the appropriate 3564 ** Split Write Completion Message to the Requester prior to the onset of Internal Bus Reset. 3565 ** 04 0 2 Bus Master Indicator Enable: Provides software control for the 3566 ** Bus Master Indicator signal P_BMI used 3567 ** for external RAIDIOS logic control of private devices. Only valid when operating with the bridge and 3568 ** central resource/arbiter disabled (BRG_EN =low, ARB_EN=low). 3569 ** 03 Varies with external state of PRIVDEV during 3570 ** P_RST# 3571 ** Private Device Enable - This bit indicates the state of the reset strap which enables the private device 3572 ** control mechanism within the PCI-to-PCI Bridge SISR configuration register. 3573 ** 0=Private Device control Disabled - SISR register bits default to zero 3574 ** 1=Private Device control Enabled - SISR register bits default to one 3575 ** 02 Varies with external state of RETRY during P_RST# 3576 ** Configuration Cycle Retry - When this bit is set, the PCI interface of the 80331 responds to all 3577 ** configuration cycles with a Retry condition. When clear, the 80331 responds to the appropriate 3578 ** configuration cycles. 3579 ** The default condition for this bit is based on the external state of the RETRY pin at the rising edge of 3580 ** P_RST#. When the external state of the pin is high, the bit is set. When the external state of the pin is 3581 ** low, the bit is cleared. 3582 ** 01 Varies with external state of CORE_RST# during P_RST# 3583 ** Core Processor Reset - This bit is set to its default value by the hardware when either P_RST# is 3584 ** asserted or the Reset Internal Bus bit in PCSR is set. When this bit is set, the Intel XScale core is 3585 ** being held in reset. Software cannot set this bit. Software is required to clear this bit to deassert Intel 3586 ** XScale core reset. 3587 ** The default condition for this bit is based on the external state of the CORE_RST# pin at the rising edge 3588 ** of P_RST#. When the external state of the pin is low, the bit is set. When the external state of the pin is 3589 ** high, the bit is clear. 3590 ** 00 Varies with external state of PRIVMEM during P_RST# 3591 ** Private Memory Enable - This bit indicates the state of the reset strap which enables the private device 3592 ** control mechanism within the PCI-to-PCI Bridge SDER configuration register. 3593 ** 0=Private Memory control Disabled - SDER register bit 2 default to zero 3594 ** 1=Private Memory control Enabled - SDER register bits 2 default to one 3595 *********************************************************************************** 3596 */ 3597 #define ARCMSR_PCI_CONFIGURATION_STATUS_REG 0x84 /*dword 0x87,0x86,0x85,0x84*/ 3598 /* 3599 *********************************************************************************** 3600 ** ATU Interrupt Status Register - ATUISR 3601 ** 3602 ** The ATU Interrupt Status Register is used to notify the core processor of the source of an ATU 3603 ** interrupt. In addition, this register is written to clear the source of the interrupt to the interrupt unit 3604 ** of the 80331. All bits in this register are Read/Clear. 3605 ** Bits 4:0 are a direct reflection of bits 14:11 and bit 8 (respectively) of the ATU Status Register 3606 ** (these bits are set at the same time by hardware but need to be cleared independently). Bit 7 is set 3607 ** by an error associated with the internal bus of the 80331. Bit 8 is for software BIST. The 3608 ** conditions that result in an ATU interrupt are cleared by writing a 1 to the appropriate bits in this 3609 ** register. 3610 ** Note: Bits 4:0, and bits 15 and 13:7 can result in an interrupt being driven to the Intel XScale core. 3611 ** ----------------------------------------------------------------- 3612 ** Bit Default Description 3613 ** 31:18 0000H Reserved 3614 ** 17 0 2 VPD Address Register Updated - This bit is set when a PCI bus configuration write occurs to the VPDAR 3615 ** register. Configuration register writes to the VPDAR does NOT result in bit 15 also being set. When set, 3616 ** this bit results in the assertion of the ATU Configure Register Write Interrupt. 3617 ** 16 0 2 Reserved 3618 ** 15 0 2 ATU Configuration Write - This bit is set when a PCI bus configuration write occurs to any ATU register. 3619 ** When set, this bit results in the assertion of the ATU Configure Register Write Interrupt. 3620 ** 14 0 2 ATU Inbound Memory Window 1 Base Updated - This bit is set when a PCI bus configuration write 3621 ** occurs to either the IABAR1 register or the IAUBAR1 register. Configuration register writes to these 3622 ** registers deos NOT result in bit 15 also being set. When set, this bit results in the assertion of the ATU 3623 ** Configure Register Write Interrupt. 3624 ** 13 0 2 Initiated Split Completion Error Message - This bit is set when the device initiates a Split Completion 3625 ** Message on the PCI Bus with the Split Completion Error attribute bit set. 3626 ** 12 0 2 Received Split Completion Error Message - This bit is set when the device receives a Split Completion 3627 ** Message from the PCI Bus with the Split Completion Error attribute bit set. 3628 ** 11 0 2 Power State Transition - When the Power State Field of the ATU Power Management Control/Status 3629 ** Register is written to transition the ATU function Power State from D0 to D3, D0 to D1, or D3 to D0 and 3630 ** the ATU Power State Transition Interrupt mask bit is cleared, this bit is set. 3631 ** 10 0 2 P_SERR# Asserted - set when P_SERR# is asserted on the PCI bus by the ATU. 3632 ** 09 0 2 Detected Parity Error - set when a parity error is detected on the PCI bus even when the ATUCMD 3633 ** register's Parity Error Response bit is cleared. Set under the following conditions: 3634 ** * Write Data Parity Error when the ATU is a target (inbound write). 3635 ** * Read Data Parity Error when the ATU is an initiator (outbound read). 3636 ** * Any Address or Attribute (PCI-X Only) Parity Error on the Bus. 3637 ** 08 0 2 ATU BIST Interrupt - When set, generates the ATU BIST Start Interrupt and indicates the host processor 3638 ** has set the Start BIST bit (ATUBISTR register bit 6), when the ATU BIST interrupt is enabled (ATUCR 3639 ** register bit 3). The Intel XScale core can initiate the software BIST and store the result in ATUBISTR 3640 ** register bits 3:0. 3641 ** Configuration register writes to the ATUBISTR does NOT result in bit 15 also being set or the assertion 3642 ** of the ATU Configure Register Write Interrupt. 3643 ** 07 0 2 Internal Bus Master Abort - set when a transaction initiated by the ATU internal bus initiator interface ends in a Master-abort. 3644 ** 06:05 00 2 Reserved. 3645 ** 04 0 2 P_SERR# Detected - set when P_SERR# is detected on the PCI bus by the ATU. 3646 ** 03 0 2 PCI Master Abort - set when a transaction initiated by the ATU PCI initiator interface ends in a Master-abort. 3647 ** 02 0 2 PCI Target Abort (master) - set when a transaction initiated by the ATU PCI master interface ends in a Target-abort. 3648 ** 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. 3649 ** 00 0 2 PCI Master Parity Error - Master Parity Error - The ATU interface sets this bit under the following 3650 ** conditions: 3651 ** * The ATU asserted PERR# itself or the ATU observed PERR# asserted. 3652 ** * And the ATU acted as the requester for the operation in which the error occurred. 3653 ** * And the ATUCMD register's Parity Error Response bit is set 3654 ** * Or (PCI-X Mode Only) the ATU received a Write Data Parity Error Message 3655 ** * And the ATUCMD register's Parity Error Response bit is set 3656 *********************************************************************************** 3657 */ 3658 #define ARCMSR_ATU_INTERRUPT_STATUS_REG 0x88 /*dword 0x8B,0x8A,0x89,0x88*/ 3659 /* 3660 *********************************************************************************** 3661 ** ATU Interrupt Mask Register - ATUIMR 3662 ** 3663 ** The ATU Interrupt Mask Register contains the control bit to enable and disable interrupts 3664 ** generated by the ATU. 3665 ** ----------------------------------------------------------------- 3666 ** Bit Default Description 3667 ** 31:15 0 0000H Reserved 3668 ** 14 0 2 VPD Address Register Updated Mask - Controls the setting of bit 17 of the ATUISR and generation of the 3669 ** ATU Configuration Register Write interrupt when a PCI bus write occurs to the VPDAR register. 3670 ** 0=Not Masked 3671 ** 1=Masked 3672 ** 13 0 2 Reserved 3673 ** 12 0 2 Configuration Register Write Mask - Controls the setting of bit 15 of the ATUISR and generation of the 3674 ** ATU Configuration Register Write interrupt when a PCI bus write occurs to any ATU configuration register 3675 ** except those covered by mask bit 11 and bit 14 of this register, and ATU BIST enable bit 3 of the ATUCR. 3676 ** 0=Not Masked 3677 ** 1=Masked 3678 ** 11 1 2 ATU Inbound Memory Window 1 Base Updated Mask - Controls the setting of bit 14 of the ATUISR and 3679 ** generation of the ATU Configuration Register Write interrupt when a PCI bus write occurs to either the 3680 ** IABAR1 register or the IAUBAR1 register. 3681 ** 0=Not Masked 3682 ** 1=Masked 3683 ** 10 0 2 Initiated Split Completion Error Message Interrupt Mask - Controls the setting of bit 13 of the ATUISR and 3684 ** generation of the ATU Error interrupt when the ATU initiates a Split Completion Error Message. 3685 ** 0=Not Masked 3686 ** 1=Masked 3687 ** 09 0 2 Received Split Completion Error Message Interrupt Mask- Controls the setting of bit 12 of the ATUISR 3688 ** and generation of the ATU Error interrupt when a Split Completion Error Message results in bit 29 of the 3689 ** PCIXSR being set. 3690 ** 0=Not Masked 3691 ** 1=Masked 3692 ** 08 1 2 Power State Transition Interrupt Mask - Controls the setting of bit 12 of the ATUISR and generation of the 3693 ** ATU Error interrupt when ATU Power Management Control/Status Register is written to transition the 3694 ** ATU Function Power State from D0 to D3, D0 to D1, D1 to D3 or D3 to D0. 3695 ** 0=Not Masked 3696 ** 1=Masked 3697 ** 07 0 2 ATU Detected Parity Error Interrupt Mask - Controls the setting of bit 9 of the ATUISR and generation of 3698 ** the ATU Error interrupt when a parity error detected on the PCI bus that sets bit 15 of the ATUSR. 3699 ** 0=Not Masked 3700 ** 1=Masked 3701 ** 06 0 2 ATU SERR# Asserted Interrupt Mask - Controls the setting of bit 10 of the ATUISR and generation of the 3702 ** ATU Error interrupt when SERR# is asserted on the PCI interface resulting in bit 14 of the ATUSR being set. 3703 ** 0=Not Masked 3704 ** 1=Masked 3705 ** NOTE: This bit is specific to the ATU asserting SERR# and not detecting SERR# from another master. 3706 ** 05 0 2 ATU PCI Master Abort Interrupt Mask - Controls the setting of bit 3 of the ATUISR and generation of the 3707 ** ATU Error interrupt when a master abort error resulting in bit 13 of the ATUSR being set. 3708 ** 0=Not Masked 3709 ** 1=Masked 3710 ** 04 0 2 ATU PCI Target Abort (Master) Interrupt Mask- Controls the setting of bit 12 of the ATUISR and ATU Error 3711 ** generation of the interrupt when a target abort error resulting in bit 12 of the ATUSR being set 3712 ** 0=Not Masked 3713 ** 1=Masked 3714 ** 03 0 2 ATU PCI Target Abort (Target) Interrupt Mask- Controls the setting of bit 1 of the ATUISR and generation 3715 ** of the ATU Error interrupt when a target abort error resulting in bit 11 of the ATUSR being set. 3716 ** 0=Not Masked 3717 ** 1=Masked 3718 ** 02 0 2 ATU PCI Master Parity Error Interrupt Mask - Controls the setting of bit 0 of the ATUISR and generation 3719 ** of the ATU Error interrupt when a parity error resulting in bit 8 of the ATUSR being set. 3720 ** 0=Not Masked 3721 ** 1=Masked 3722 ** 01 0 2 ATU Inbound Error SERR# Enable - Controls when the ATU asserts (when enabled through the 3723 ** ATUCMD) SERR# on the PCI interface in response to a master abort on the internal bus during an 3724 ** inbound write transaction. 3725 ** 0=SERR# Not Asserted due to error 3726 ** 1=SERR# Asserted due to error 3727 ** 00 0 2 ATU ECC Target Abort Enable - Controls the ATU response on the PCI interface to a target abort (ECC 3728 ** error) from the memory controller on the internal bus. In conventional mode, this action only occurs 3729 ** during an inbound read transaction where the data phase that was target aborted on the internal bus is 3730 ** actually requested from the inbound read queue. 3731 ** 0=Disconnect with data 3732 ** (the data being up to 64 bits of 1's) 3733 ** 1=Target Abort 3734 ** NOTE: In PCI-X Mode, The ATU initiates a Split Completion Error Message (with message class=2h - 3735 ** completer error and message index=81h - 80331 internal bus target abort) on the PCI bus, 3736 ** independent of the setting of this bit. 3737 *********************************************************************************** 3738 */ 3739 #define ARCMSR_ATU_INTERRUPT_MASK_REG 0x8C /*dword 0x8F,0x8E,0x8D,0x8C*/ 3740 /* 3741 *********************************************************************************** 3742 ** Inbound ATU Base Address Register 3 - IABAR3 3743 ** 3744 ** . The Inbound ATU Base Address Register 3 (IABAR3) together with the Inbound ATU Upper Base Address Register 3 (IAUBAR3) defines the block 3745 ** of memory addresses where the inbound translation window 3 begins. 3746 ** . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory. 3747 ** . The IABAR3 and IAUBAR3 define the base address and describes the required memory block size. 3748 ** . 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. 3749 ** The programmed value within the base address register must comply with the PCI programming requirements for address alignment. 3750 ** Note: 3751 ** Since IABAR3 does not appear in the standard PCI configuration header space (offsets 00H - 3CH), 3752 ** IABAR3 is not configured by the host during normal system initialization. 3753 ** Warning: 3754 ** When a non-zero value is not written to IALR3, 3755 ** the user should not set either the Prefetchable Indicator 3756 ** or the Type Indicator for 64 bit addressability. 3757 ** This is the default for IABAR3. 3758 ** Assuming a non-zero value is written to IALR3, 3759 ** the user may set the Prefetchable Indicator 3760 ** or the Type Indicator: 3761 ** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary, 3762 ** when the Prefetchable Indicator is not set, 3763 ** the user should also leave the Type Indicator set for 32 bit addressability. 3764 ** This is the default for IABAR3. 3765 ** b. when the Prefetchable Indicator is set, 3766 ** the user should also set the Type Indicator for 64 bit addressability. 3767 ** ----------------------------------------------------------------- 3768 ** Bit Default Description 3769 ** 31:12 00000H Translation Base Address 3 - These bits define the actual location 3770 ** the translation function is to respond to when addressed from the PCI bus. 3771 ** 11:04 00H Reserved. 3772 ** 03 0 2 Prefetchable Indicator - When set, defines the memory space as prefetchable. 3773 ** 02:01 00 2 Type Indicator - Defines the width of the addressability for this memory window: 3774 ** 00 - Memory Window is locatable anywhere in 32 bit address space 3775 ** 10 - Memory Window is locatable anywhere in 64 bit address space 3776 ** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address. 3777 ** The ATU does not occupy I/O space, 3778 ** thus this bit must be zero. 3779 *********************************************************************************** 3780 */ 3781 #define ARCMSR_INBOUND_ATU_BASE_ADDRESS3_REG 0x90 /*dword 0x93,0x92,0x91,0x90*/ 3782 /* 3783 *********************************************************************************** 3784 ** Inbound ATU Upper Base Address Register 3 - IAUBAR3 3785 ** 3786 ** This register contains the upper base address when decoding PCI addresses beyond 4 GBytes. 3787 ** Together with the Translation Base Address this register defines the actual location 3788 ** the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs). 3789 ** The programmed value within the base address register must comply with the PCI programming 3790 ** requirements for address alignment. 3791 ** Note: 3792 ** When the Type indicator of IABAR3 is set to indicate 32 bit addressability, 3793 ** the IAUBAR3 register attributes are read-only. 3794 ** This is the default for IABAR3. 3795 ** ----------------------------------------------------------------- 3796 ** Bit Default Description 3797 ** 31:0 00000H Translation Upper Base Address 3 - Together with the Translation Base Address 3 these bits define 3798 ** the actual location the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes. 3799 *********************************************************************************** 3800 */ 3801 #define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS3_REG 0x94 /*dword 0x97,0x96,0x95,0x94*/ 3802 /* 3803 *********************************************************************************** 3804 ** Inbound ATU Limit Register 3 - IALR3 3805 ** 3806 ** Inbound address translation for memory window 3 occurs for data transfers occurring from the PCI 3807 ** bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts 3808 ** PCI addresses to internal bus addresses. 3809 ** The inbound translation base address for inbound window 3 is specified in Section 3.10.15. When 3810 ** determining block size requirements ( as described in Section 3.10.21 ) the translation limit 3811 ** register provides the block size requirements for the base address register. The remaining registers 3812 ** used for performing address translation are discussed in Section 3.2.1.1. 3813 ** The 80331 translate value register's programmed value must be naturally aligned with the base 3814 ** address register's programmed value. The limit register is used as a mask; thus, the lower address 3815 ** bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus 3816 ** Specification, Revision 2.3 for additional information on programming base address registers. 3817 ** Bits 31 to 12 within the IALR3 have a direct effect on the IABAR3 register, bits 31 to 12, with a 3818 ** one to one correspondence. A value of 0 in a bit within the IALR3 makes the corresponding bit 3819 ** within the IABAR3 a read only bit which always returns 0. A value of 1 in a bit within the IALR3 3820 ** makes the corresponding bit within the IABAR3 read/write from PCI. Note that a consequence of 3821 ** this programming scheme is that unless a valid value exists within the IALR3, all writes to the 3822 ** IABAR3 has no effect since a value of all zeros within the IALR3 makes the IABAR3 a read only 3823 ** register. 3824 ** ----------------------------------------------------------------- 3825 ** Bit Default Description 3826 ** 31:12 00000H Inbound Translation Limit 3 - This readback value determines the memory block size required 3827 ** for the ATUs memory window 3. 3828 ** 11:00 000H Reserved 3829 *********************************************************************************** 3830 */ 3831 #define ARCMSR_INBOUND_ATU_LIMIT3_REG 0x98 /*dword 0x9B,0x9A,0x99,0x98*/ 3832 /* 3833 *********************************************************************************** 3834 ** Inbound ATU Translate Value Register 3 - IATVR3 3835 ** 3836 ** The Inbound ATU Translate Value Register 3 (IATVR3) contains the internal bus address used to 3837 ** convert PCI bus addresses. The converted address is driven on the internal bus as a result of the 3838 ** inbound ATU address translation. 3839 ** ----------------------------------------------------------------- 3840 ** Bit Default Description 3841 ** 31:12 00000H Inbound ATU Translation Value 3 - This value is used to convert the PCI address to internal bus addresses. 3842 ** This value must be 64-bit aligned on the internal bus. The default address allows the ATU to 3843 ** access the internal 80331 memory-mapped registers. 3844 ** 11:00 000H Reserved 3845 *********************************************************************************** 3846 */ 3847 #define ARCMSR_INBOUND_ATU_TRANSLATE_VALUE3_REG 0x9C /*dword 0x9F,0x9E,0x9D,0x9C*/ 3848 /* 3849 *********************************************************************************** 3850 ** Outbound Configuration Cycle Address Register - OCCAR 3851 ** 3852 ** The Outbound Configuration Cycle Address Register is used to hold the 32-bit PCI configuration 3853 ** cycle address. The Intel XScale core writes the PCI configuration cycles address which then 3854 ** enables the outbound configuration read or write. The Intel XScale core then performs a read or 3855 ** write to the Outbound Configuration Cycle Data Register to initiate the configuration cycle on the 3856 ** PCI bus. 3857 ** Note: Bits 15:11 of the configuration cycle address for Type 0 configuration cycles are defined differently 3858 ** for Conventional versus PCI-X modes. When 80331 software programs the OCCAR to initiate a 3859 ** Type 0 configuration cycle, the OCCAR should always be loaded based on the PCI-X definition for 3860 ** the Type 0 configuration cycle address. When operating in Conventional mode, the 80331 clears 3861 ** bits 15:11 of the OCCAR prior to initiating an outbound Type 0 configuration cycle. See the PCI-X 3862 ** Addendum to the PCI Local Bus Specification, Revision 1.0a for details on the two formats. 3863 ** ----------------------------------------------------------------- 3864 ** Bit Default Description 3865 ** 31:00 0000 0000H Configuration Cycle Address - These bits define the 32-bit PCI address used during an outbound 3866 ** configuration read or write cycle. 3867 *********************************************************************************** 3868 */ 3869 #define ARCMSR_OUTBOUND_CONFIGURATION_CYCLE_ADDRESS_REG 0xA4 /*dword 0xA7,0xA6,0xA5,0xA4*/ 3870 /* 3871 *********************************************************************************** 3872 ** Outbound Configuration Cycle Data Register - OCCDR 3873 ** 3874 ** The Outbound Configuration Cycle Data Register is used to initiate a configuration read or write 3875 ** on the PCI bus. The register is logical rather than physical meaning that it is an address not a 3876 ** register. The Intel XScale core reads or writes the data registers memory-mapped address to 3877 ** initiate the configuration cycle on the PCI bus with the address found in the OCCAR. For a 3878 ** configuration write, the data is latched from the internal bus and forwarded directly to the OWQ. 3879 ** For a read, the data is returned directly from the ORQ to the Intel XScale core and is never 3880 ** actually entered into the data register (which does not physically exist). 3881 ** The OCCDR is only visible from 80331 internal bus address space and appears as a reserved value 3882 ** within the ATU configuration space. 3883 ** ----------------------------------------------------------------- 3884 ** Bit Default Description 3885 ** 31:00 0000 0000H Configuration Cycle Data - These bits define the data used during an outbound configuration read 3886 ** or write cycle. 3887 *********************************************************************************** 3888 */ 3889 #define ARCMSR_OUTBOUND_CONFIGURATION_CYCLE_DATA_REG 0xAC /*dword 0xAF,0xAE,0xAD,0xAC*/ 3890 /* 3891 *********************************************************************************** 3892 ** VPD Capability Identifier Register - VPD_CAPID 3893 ** 3894 ** The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification, 3895 ** Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended 3896 ** Capability contained in that header. In the case of the 80331, this is the VPD extended capability 3897 ** with an ID of 03H as defined by the PCI Local Bus Specification, Revision 2.3. 3898 ** ----------------------------------------------------------------- 3899 ** Bit Default Description 3900 ** 07:00 03H Cap_Id - This field with its' 03H value identifies this item in the linked list of Extended Capability 3901 ** Headers as being the VPD capability registers. 3902 *********************************************************************************** 3903 */ 3904 #define ARCMSR_VPD_CAPABILITY_IDENTIFIER_REG 0xB8 /*byte*/ 3905 /* 3906 *********************************************************************************** 3907 ** VPD Next Item Pointer Register - VPD_NXTP 3908 ** 3909 ** The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification, 3910 ** Revision 2.3. This register describes the location of the next item in the function's capability list. 3911 ** For the 80331, this the final capability list, and hence, this register is set to 00H. 3912 ** ----------------------------------------------------------------- 3913 ** Bit Default Description 3914 ** 07:00 00H Next_ Item_ Pointer - This field provides an offset into the function's configuration space pointing to the 3915 ** next item in the function's capability list. Since the VPD capabilities are the last in the linked list of 3916 ** extended capabilities in the 80331, the register is set to 00H. 3917 *********************************************************************************** 3918 */ 3919 #define ARCMSR_VPD_NEXT_ITEM_PTR_REG 0xB9 /*byte*/ 3920 /* 3921 *********************************************************************************** 3922 ** VPD Address Register - VPD_AR 3923 ** 3924 ** The VPD Address register (VPDAR) contains the DWORD-aligned byte address of the VPD to be 3925 ** accessed. The register is read/write and the initial value at power-up is indeterminate. 3926 ** A PCI Configuration Write to the VPDAR interrupts the Intel XScale core. Software can use 3927 ** the Flag setting to determine whether the configuration write was intended to initiate a read or 3928 ** write of the VPD through the VPD Data Register. 3929 ** ----------------------------------------------------------------- 3930 ** Bit Default Description 3931 ** 15 0 2 Flag - A flag is used to indicate when a transfer of data between the VPD Data Register and the storage 3932 ** component has completed. Please see Section 3.9, "Vital Product Data" on page 201 for more details on 3933 ** how the 80331 handles the data transfer. 3934 ** 14:0 0000H VPD Address - This register is written to set the DWORD-aligned byte address used to read or write 3935 ** Vital Product Data from the VPD storage component. 3936 *********************************************************************************** 3937 */ 3938 #define ARCMSR_VPD_ADDRESS_REG 0xBA /*word 0xBB,0xBA*/ 3939 /* 3940 *********************************************************************************** 3941 ** VPD Data Register - VPD_DR 3942 ** 3943 ** This register is used to transfer data between the 80331 and the VPD storage component. 3944 ** ----------------------------------------------------------------- 3945 ** Bit Default Description 3946 ** 31:00 0000H VPD Data - Four bytes are always read or written through this register to/from the VPD storage component. 3947 *********************************************************************************** 3948 */ 3949 #define ARCMSR_VPD_DATA_REG 0xBC /*dword 0xBF,0xBE,0xBD,0xBC*/ 3950 /* 3951 *********************************************************************************** 3952 ** Power Management Capability Identifier Register -PM_CAPID 3953 ** 3954 ** The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification, 3955 ** Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended 3956 ** Capability contained in that header. In the case of the 80331, this is the PCI Bus Power 3957 ** Management extended capability with an ID of 01H as defined by the PCI Bus Power Management 3958 ** Interface Specification, Revision 1.1. 3959 ** ----------------------------------------------------------------- 3960 ** Bit Default Description 3961 ** 07:00 01H Cap_Id - This field with its' 01H value identifies this item in the linked list of Extended Capability 3962 ** Headers as being the PCI Power Management Registers. 3963 *********************************************************************************** 3964 */ 3965 #define ARCMSR_POWER_MANAGEMENT_CAPABILITY_IDENTIFIER_REG 0xC0 /*byte*/ 3966 /* 3967 *********************************************************************************** 3968 ** Power Management Next Item Pointer Register - PM_NXTP 3969 ** 3970 ** The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification, 3971 ** Revision 2.3. This register describes the location of the next item in the function's capability list. 3972 ** For the 80331, the next capability (MSI capability list) is located at off-set D0H. 3973 ** ----------------------------------------------------------------- 3974 ** Bit Default Description 3975 ** 07:00 D0H Next_ Item_ Pointer - This field provides an offset into the function's configuration space pointing to the 3976 ** next item in the function's capability list which in the 80331 is the MSI extended capabilities header. 3977 *********************************************************************************** 3978 */ 3979 #define ARCMSR_POWER_NEXT_ITEM_PTR_REG 0xC1 /*byte*/ 3980 /* 3981 *********************************************************************************** 3982 ** Power Management Capabilities Register - PM_CAP 3983 ** 3984 ** Power Management Capabilities bits adhere to the definitions in the PCI Bus Power Management 3985 ** Interface Specification, Revision 1.1. This register is a 16-bit read-only register which provides 3986 ** information on the capabilities of the ATU function related to power management. 3987 ** ----------------------------------------------------------------- 3988 ** Bit Default Description 3989 ** 15:11 00000 2 PME_Support - This function is not capable of asserting the PME# signal in any state, since PME# 3990 ** is not supported by the 80331. 3991 ** 10 0 2 D2_Support - This bit is set to 0 2 indicating that the 80331 does not support the D2 Power Management State 3992 ** 9 1 2 D1_Support - This bit is set to 1 2 indicating that the 80331 supports the D1 Power Management State 3993 ** 8:6 000 2 Aux_Current - This field is set to 000 2 indicating that the 80331 has no current requirements for the 3994 ** 3.3Vaux signal as defined in the PCI Bus Power Management Interface Specification, Revision 1.1 3995 ** 5 0 2 DSI - This field is set to 0 2 meaning that this function requires a device specific initialization sequence 3996 ** following the transition to the D0 uninitialized state. 3997 ** 4 0 2 Reserved. 3998 ** 3 0 2 PME Clock - Since the 80331 does not support PME# signal generation this bit is cleared to 0 2 . 3999 ** 2:0 010 2 Version - Setting these bits to 010 2 means that this function complies with PCI Bus Power Management 4000 ** Interface Specification, Revision 1.1 4001 *********************************************************************************** 4002 */ 4003 #define ARCMSR_POWER_MANAGEMENT_CAPABILITY_REG 0xC2 /*word 0xC3,0xC2*/ 4004 /* 4005 *********************************************************************************** 4006 ** Power Management Control/Status Register - PM_CSR 4007 ** 4008 ** Power Management Control/Status bits adhere to the definitions in the PCI Bus Power 4009 ** Management Interface Specification, Revision 1.1. This 16-bit register is the control and status 4010 ** interface for the power management extended capability. 4011 ** ----------------------------------------------------------------- 4012 ** Bit Default Description 4013 ** 15 0 2 PME_Status - This function is not capable of asserting the PME# signal in any state, since PME## is not 4014 ** supported by the 80331. 4015 ** 14:9 00H Reserved 4016 ** 8 0 2 PME_En - This bit is hardwired to read-only 0 2 since this function does not support PME# 4017 ** generation from any power state. 4018 ** 7:2 000000 2 Reserved 4019 ** 1:0 00 2 Power State - This 2-bit field is used both to determine the current power state 4020 ** of a function and to set the function into a new power state. The definition of the values is: 4021 ** 00 2 - D0 4022 ** 01 2 - D1 4023 ** 10 2 - D2 (Unsupported) 4024 ** 11 2 - D3 hot 4025 ** The 80331 supports only the D0 and D3 hot states. 4026 ** 4027 *********************************************************************************** 4028 */ 4029 #define ARCMSR_POWER_MANAGEMENT_CONTROL_STATUS_REG 0xC4 /*word 0xC5,0xC4*/ 4030 /* 4031 *********************************************************************************** 4032 ** PCI-X Capability Identifier Register - PX_CAPID 4033 ** 4034 ** The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification, 4035 ** Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended 4036 ** Capability contained in that header. In the case of the 80331, this is the PCI-X extended capability with 4037 ** an ID of 07H as defined by the PCI-X Addendum to the PCI Local Bus Specification, Revision 1.0a. 4038 ** ----------------------------------------------------------------- 4039 ** Bit Default Description 4040 ** 07:00 07H Cap_Id - This field with its' 07H value identifies this item in the linked list of Extended Capability 4041 ** Headers as being the PCI-X capability registers. 4042 *********************************************************************************** 4043 */ 4044 #define ARCMSR_PCIX_CAPABILITY_IDENTIFIER_REG 0xE0 /*byte*/ 4045 /* 4046 *********************************************************************************** 4047 ** PCI-X Next Item Pointer Register - PX_NXTP 4048 ** 4049 ** The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification, 4050 ** Revision 2.3. This register describes the location of the next item in the function's capability list. 4051 ** By default, the PCI-X capability is the last capabilities list for the 80331, thus this register defaults 4052 ** to 00H. 4053 ** However, this register may be written to B8H prior to host configuration to include the VPD 4054 ** capability located at off-set B8H. 4055 ** Warning: Writing this register to any value other than 00H (default) or B8H is not supported and may 4056 ** produce unpredictable system behavior. 4057 ** In order to guarantee that this register is written prior to host configuration, the 80331 must be 4058 ** initialized at P_RST# assertion to Retry Type 0 configuration cycles (bit 2 of PCSR). Typically, 4059 ** the Intel XScale core would be enabled to boot immediately following P_RST# assertion in 4060 ** this case (bit 1 of PCSR), as well. Please see Table 125, "PCI Configuration and Status Register - 4061 ** PCSR" on page 253 for more details on the 80331 initialization modes. 4062 ** ----------------------------------------------------------------- 4063 ** Bit Default Description 4064 ** 07:00 00H Next_ Item_ Pointer - This field provides an offset into the function's configuration space pointing to the 4065 ** next item in the function's capability list. Since the PCI-X capabilities are the last in the linked list of 4066 ** extended capabilities in the 80331, the register is set to 00H. 4067 ** However, this field may be written prior to host configuration with B8H to extend the list to include the 4068 ** VPD extended capabilities header. 4069 *********************************************************************************** 4070 */ 4071 #define ARCMSR_PCIX_NEXT_ITEM_PTR_REG 0xE1 /*byte*/ 4072 /* 4073 *********************************************************************************** 4074 ** PCI-X Command Register - PX_CMD 4075 ** 4076 ** This register controls various modes and features of ATU and Message Unit when operating in the 4077 ** PCI-X mode. 4078 ** ----------------------------------------------------------------- 4079 ** Bit Default Description 4080 ** 15:7 000000000 2 Reserved. 4081 ** 6:4 011 2 Maximum Outstanding Split Transactions - This register sets the maximum number of Split Transactions 4082 ** the device is permitted to have outstanding at one time. 4083 ** Register Maximum Outstanding 4084 ** 0 1 4085 ** 1 2 4086 ** 2 3 4087 ** 3 4 4088 ** 4 8 4089 ** 5 12 4090 ** 6 16 4091 ** 7 32 4092 ** 3:2 00 2 Maximum Memory Read Byte Count - This register sets the maximum byte count the device uses when 4093 ** initiating a Sequence with one of the burst memory read commands. 4094 ** Register Maximum Byte Count 4095 ** 0 512 4096 ** 1 1024 4097 ** 2 2048 4098 ** 3 4096 4099 ** 1 0 2 4100 ** Enable Relaxed Ordering - The 80331 does not set the relaxed ordering bit in the Requester Attributes 4101 ** of Transactions. 4102 ** 0 0 2 Data Parity Error Recovery Enable - The device driver sets this bit to enable the device to attempt to 4103 ** recover from data parity errors. When this bit is 0 and the device is in PCI-X mode, the device asserts 4104 ** SERR# (when enabled) whenever the Master Data Parity Error bit (Status register, bit 8) is set. 4105 *********************************************************************************** 4106 */ 4107 #define ARCMSR_PCIX_COMMAND_REG 0xE2 /*word 0xE3,0xE2*/ 4108 /* 4109 *********************************************************************************** 4110 ** PCI-X Status Register - PX_SR 4111 ** 4112 ** This register identifies the capabilities and current operating mode of ATU, DMAs and Message 4113 ** Unit when operating in the PCI-X mode. 4114 ** ----------------------------------------------------------------- 4115 ** Bit Default Description 4116 ** 31:30 00 2 Reserved 4117 ** 29 0 2 Received Split Completion Error Message - This bit is set when the device receives a Split Completion 4118 ** Message with the Split Completion Error attribute bit set. Once set, this bit remains set until software 4119 ** writes a 1 to this location. 4120 ** 0=no Split Completion error message received. 4121 ** 1=a Split Completion error message has been received. 4122 ** 28:26 001 2 Designed Maximum Cumulative Read Size (DMCRS) - The value of this register depends on the setting 4123 ** of the Maximum Memory Read Byte Count field of the PCIXCMD register: 4124 ** DMCRS Max ADQs Maximum Memory Read Byte Count Register Setting 4125 ** 1 16 512 (Default) 4126 ** 2 32 1024 4127 ** 2 32 2048 4128 ** 2 32 4096 4129 ** 25:23 011 2 Designed Maximum Outstanding Split Transactions - The 80331 can have up to four outstanding split transactions. 4130 ** 22:21 01 2 Designed Maximum Memory Read Byte Count - The 80331 can generate memory reads with byte counts up 4131 ** to 1024 bytes. 4132 ** 20 1 2 80331 is a complex device. 4133 ** 19 0 2 Unexpected Split Completion - This bit is set when an unexpected Split Completion with this device's 4134 ** Requester ID is received. Once set, this bit remains set until software writes a 1 to this location. 4135 ** 0=no unexpected Split Completion has been received. 4136 ** 1=an unexpected Split Completion has been received. 4137 ** 18 0 2 Split Completion Discarded - This bit is set when the device discards a Split Completion because the 4138 ** requester would not accept it. See Section 5.4.4 of the PCI-X Addendum to the PCI Local Bus 4139 ** Specification, Revision 1.0a for details. Once set, this bit remains set until software writes a 1 to this 4140 ** location. 4141 ** 0=no Split Completion has been discarded. 4142 ** 1=a Split Completion has been discarded. 4143 ** NOTE: The 80331 does not set this bit since there is no Inbound address responding to Inbound Read 4144 ** Requests with Split Responses (Memory or Register) that has "read side effects." 4145 ** 17 1 2 80331 is a 133 MHz capable device. 4146 ** 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, 4147 ** therefore this bit is always set. 4148 ** 80331 with no bridge and central resource disabled (BRG_EN=0, ARB_EN=0), 4149 ** 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#). 4150 ** This strap, by default, identifies the add in card based on 80331 with bridge disabled 4151 ** as 64-bit unless the user attaches the appropriate pull-down resistor to the strap. 4152 ** 0=The bus is 32 bits wide. 4153 ** 1=The bus is 64 bits wide. 4154 ** 15:8 FFH Bus Number - This register is read for diagnostic purposes only. It indicates the number of the bus 4155 ** segment for the device containing this function. The function uses this number as part of its Requester 4156 ** ID and Completer ID. For all devices other than the source bridge, each time the function is addressed 4157 ** by a Configuration Write transaction, the function must update this register with the contents of AD[7::0] 4158 ** of the attribute phase of the Configuration Write, regardless of which register in the function is 4159 ** addressed by the transaction. The function is addressed by a Configuration Write transaction when all of 4160 ** the following are true: 4161 ** 1. The transaction uses a Configuration Write command. 4162 ** 2. IDSEL is asserted during the address phase. 4163 ** 3. AD[1::0] are 00b (Type 0 configuration transaction). 4164 ** 4. AD[10::08] of the configuration address contain the appropriate function number. 4165 ** 7:3 1FH Device Number - This register is read for diagnostic purposes only. It indicates the number of the device 4166 ** containing this function, i.e., the number in the Device Number field (AD[15::11]) of the address of a 4167 ** Type 0 configuration transaction that is assigned to the device containing this function by the connection 4168 ** of the system hardware. The system must assign a device number other than 00h (00h is reserved for 4169 ** the source bridge). The function uses this number as part of its Requester ID and Completer ID. Each 4170 ** time the function is addressed by a Configuration Write transaction, the device must update this register 4171 ** with the contents of AD[15::11] of the address phase of the Configuration Write, regardless of which 4172 ** register in the function is addressed by the transaction. The function is addressed by a Configuration 4173 ** Write transaction when all of the following are true: 4174 ** 1. The transaction uses a Configuration Write command. 4175 ** 2. IDSEL is asserted during the address phase. 4176 ** 3. AD[1::0] are 00b (Type 0 configuration transaction). 4177 ** 4. AD[10::08] of the configuration address contain the appropriate function number. 4178 ** 2:0 000 2 Function Number - This register is read for diagnostic purposes only. It indicates the number of this 4179 ** function; i.e., the number in the Function Number field (AD[10::08]) of the address of a Type 0 4180 ** configuration transaction to which this function responds. The function uses this number as part of its 4181 ** Requester ID and Completer ID. 4182 ** 4183 ************************************************************************** 4184 */ 4185 #define ARCMSR_PCIX_STATUS_REG 0xE4 /*dword 0xE7,0xE6,0xE5,0xE4*/ 4186 4187 /* 4188 ************************************************************************** 4189 ** Inbound Read Transaction 4190 ** ======================================================================== 4191 ** An inbound read transaction is initiated by a PCI initiator and is targeted at either 80331 local 4192 ** memory or a 80331 memory-mapped register space. The read transaction is propagated through 4193 ** the inbound transaction queue (ITQ) and read data is returned through the inbound read queue 4194 ** (IRQ). 4195 ** When operating in the conventional PCI mode, all inbound read transactions are processed as 4196 ** delayed read transactions. When operating in the PCI-X mode, all inbound read transactions are 4197 ** processed as split transactions. The ATUs PCI interface claims the read transaction and forwards 4198 ** the read request through to the internal bus and returns the read data to the PCI bus. Data flow for 4199 ** an inbound read transaction on the PCI bus is summarized in the following statements: 4200 ** * The ATU claims the PCI read transaction when the PCI address is within the inbound 4201 ** translation window defined by ATU Inbound Base Address Register (and Inbound Upper Base 4202 ** Address Register during DACs) and Inbound Limit Register. 4203 ** * When operating in the conventional PCI mode, when the ITQ is currently holding transaction 4204 ** information from a previous delayed read, the current transaction information is compared to 4205 ** the previous transaction information (based on the setting of the DRC Alias bit in 4206 ** Section 3.10.39, "ATU Configuration Register - ATUCR" on page 252). When there is a 4207 ** match and the data is in the IRQ, return the data to the master on the PCI bus. When there is a 4208 ** match and the data is not available, a Retry is signaled with no other action taken. When there 4209 ** is not a match and when the ITQ has less than eight entries, capture the transaction 4210 ** information, signal a Retry and initiate a delayed transaction. When there is not a match and 4211 ** when the ITQ is full, then signal a Retry with no other action taken. 4212 ** + When an address parity error is detected, the address parity response defined in 4213 ** Section 3.7 is used. 4214 ** * When operating in the conventional PCI mode, once read data is driven onto the PCI bus from 4215 ** the IRQ, it continues until one of the following is true: 4216 ** + The initiator completes the PCI transaction. When there is data left unread in the IRQ, the 4217 ** data is flushed. 4218 ** + An internal bus Target Abort was detected. In this case, the QWORD associated with the 4219 ** Target Abort is never entered into the IRQ, and therefore is never returned. 4220 ** + Target Abort or a Disconnect with Data is returned in response to the Internal Bus Error. 4221 ** + The IRQ becomes empty. In this case, the PCI interface signals a Disconnect with data to 4222 ** the initiator on the last data word available. 4223 ** * When operating in the PCI-X mode, when ITQ is not full, the PCI address, attribute and 4224 ** command are latched into the available ITQ and a Split Response Termination is signalled to 4225 ** the initiator. 4226 ** * When operating in the PCI-X mode, when the transaction does not cross a 1024 byte aligned 4227 ** boundary, then the ATU waits until it receives the full byte count from the internal bus target 4228 ** before returning read data by generating the split completion transaction on the PCI-X bus. 4229 ** When the read requested crosses at least one 1024 byte boundary, then ATU completes the 4230 ** transfer by returning data in 1024 byte aligned chunks. 4231 ** * When operating in the PCI-X mode, once a split completion transaction has started, it 4232 ** continues until one of the following is true: 4233 ** + The requester (now the target) generates a Retry Termination, or a Disconnection at Next 4234 ** ADB (when the requester is a bridge) 4235 ** + The byte count is satisfied. 4236 ** + An internal bus Target Abort was detected. The ATU generates a Split Completion 4237 ** Message (message class=2h - completer error, and message index=81h - target abort) to 4238 ** inform the requester about the abnormal condition. The ITQ for this transaction is flushed. 4239 ** Refer to Section 3.7.1. 4240 ** + An internal bus Master Abort was detected. The ATU generates a Split Completion 4241 ** Message (message class=2h - completer error, and message index=80h - Master abort) to 4242 ** inform the requester about the abnormal condition. The ITQ for this transaction is flushed. 4243 ** Refer to Section 3.7.1 4244 ** * When operating in the conventional PCI mode, when the master inserts wait states on the PCI 4245 ** bus, the ATU PCI slave interface waits with no premature disconnects. 4246 ** * When a data parity error occurs signified by PERR# asserted from the initiator, no action is 4247 ** taken by the target interface. Refer to Section 3.7.2.5. 4248 ** * When operating in the conventional PCI mode, when the read on the internal bus is 4249 ** target-aborted, either a target-abort or a disconnect with data is signaled to the initiator. This is 4250 ** based on the ATU ECC Target Abort Enable bit (bit 0 of the ATUIMR for ATU). When set, a 4251 ** target abort is used, when clear, a disconnect is used. 4252 ** * When operating in the PCI-X mode (with the exception of the MU queue ports at offsets 40h 4253 ** and 44h), when the transaction on the internal bus resulted in a target abort, the ATU generates 4254 ** a Split Completion Message (message class=2h - completer error, and message index=81h - 4255 ** internal bus target abort) to inform the requester about the abnormal condition. For the MU 4256 ** queue ports, the ATU returns either a target abort or a single data phase disconnect depending 4257 ** on the ATU ECC Target Abort Enable bit (bit 0 of the ATUIMR for ATU). The ITQ for this 4258 ** transaction is flushed. Refer to Section 3.7.1. 4259 ** * When operating in the conventional PCI mode, when the transaction on the internal bus 4260 ** resulted in a master abort, the ATU returns a target abort to inform the requester about the 4261 ** abnormal condition. The ITQ for this transaction is flushed. Refer to Section 3.7.1 4262 ** * When operating in the PCI-X mode, when the transaction on the internal bus resulted in a 4263 ** master abort, the ATU generates a Split Completion Message (message class=2h - completer 4264 ** error, and message index=80h - internal bus master abort) to inform the requester about the 4265 ** abnormal condition. The ITQ for this transaction is flushed. Refer to Section 3.7.1. 4266 ** * When operating in the PCI-X mode, when the Split Completion transaction completes with 4267 ** either Master-Abort or Target-Abort, the requester is indicating a failure condition that 4268 ** prevents it from accepting the completion it requested. In this case, since the Split Request 4269 ** addresses a location that has no read side effects, the completer must discard the Split 4270 ** Completion and take no further action. 4271 ** The data flow for an inbound read transaction on the internal bus is summarized in the following 4272 ** statements: 4273 ** * The ATU internal bus master interface requests the internal bus when a PCI address appears in 4274 ** an ITQ and transaction ordering has been satisfied. When operating in the PCI-X mode the 4275 ** ATU does not use the information provided by the Relax Ordering Attribute bit. That is, ATU 4276 ** always uses conventional PCI ordering rules. 4277 ** * Once the internal bus is granted, the internal bus master interface drives the translated address 4278 ** onto the bus and wait for IB_DEVSEL#. When a Retry is signaled, the request is repeated. 4279 ** When a master abort occurs, the transaction is considered complete and a target abort is loaded 4280 ** into the associated IRQ for return to the PCI initiator (transaction is flushed once the PCI 4281 ** master has been delivered the target abort). 4282 ** * Once the translated address is on the bus and the transaction has been accepted, the internal 4283 ** bus target starts returning data with the assertion of IB_TRDY#. Read data is continuously 4284 ** received by the IRQ until one of the following is true: 4285 ** + The full byte count requested by the ATU read request is received. The ATU internal bus 4286 ** initiator interface performs a initiator completion in this case. 4287 ** + When operating in the conventional PCI mode, a Target Abort is received on the internal 4288 ** bus from the internal bus target. In this case, the transaction is aborted and the PCI side is 4289 ** informed. 4290 ** + When operating in the PCI-X mode, a Target Abort is received on the internal bus from 4291 ** the internal bus target. In this case, the transaction is aborted. The ATU generates a Split 4292 ** Completion Message (message class=2h - completer error, and message index=81h - 4293 ** target abort) on the PCI bus to inform the requester about the abnormal condition. The 4294 ** ITQ for this transaction is flushed. 4295 ** + When operating in the conventional PCI mode, a single data phase disconnection is 4296 ** received from the internal bus target. When the data has not been received up to the next 4297 ** QWORD boundary, the ATU internal bus master interface attempts to reacquire the bus. 4298 ** When not, the bus returns to idle. 4299 ** + When operating in the PCI-X mode, a single data phase disconnection is received from 4300 ** the internal bus target. The ATU IB initiator interface attempts to reacquire the bus to 4301 ** obtain remaining data. 4302 ** + When operating in the conventional PCI mode, a disconnection at Next ADB is received 4303 ** from the internal bus target. The bus returns to idle. 4304 ** + When operating in the PCI-X mode, a disconnection at Next ADB is received from the 4305 ** internal bus target. The ATU IB initiator interface attempts to reacquire the bus to obtain 4306 ** remaining data. 4307 ** To support PCI Local Bus Specification, Revision 2.0 devices, the ATU can be programmed to 4308 ** ignore the memory read command (Memory Read, Memory Read Line, and Memory Read 4309 ** Multiple) when trying to match the current inbound read transaction with data in a DRC queue 4310 ** which was read previously (DRC on target bus). When the Read Command Alias Bit in the 4311 ** ATUCR register is set, the ATU does not distinguish the read commands on transactions. For 4312 ** example, the ATU enqueues a DRR with a Memory Read Multiple command and performs the read 4313 ** on the internal bus. Some time later, a PCI master attempts a Memory Read with the same address 4314 ** as the previous Memory Read Multiple. When the Read Command Bit is set, the ATU would return 4315 ** the read data from the DRC queue and consider the Delayed Read transaction complete. When the 4316 ** Read Command bit in the ATUCR was clear, the ATU would not return data since the PCI read 4317 ** commands did not match, only the address. 4318 ************************************************************************** 4319 */ 4320 /* 4321 ************************************************************************** 4322 ** Inbound Write Transaction 4323 **======================================================================== 4324 ** An inbound write transaction is initiated by a PCI master and is targeted at either 80331 local 4325 ** memory or a 80331 memory-mapped register. 4326 ** Data flow for an inbound write transaction on the PCI bus is summarized as: 4327 ** * The ATU claims the PCI write transaction when the PCI address is within the inbound 4328 ** translation window defined by the ATU Inbound Base Address Register (and Inbound Upper 4329 ** Base Address Register during DACs) and Inbound Limit Register. 4330 ** * When the IWADQ has at least one address entry available and the IWQ has at least one buffer 4331 ** available, the address is captured and the first data phase is accepted. 4332 ** * The PCI interface continues to accept write data until one of the following is true: 4333 ** + The initiator performs a disconnect. 4334 ** + The transaction crosses a buffer boundary. 4335 ** * When an address parity error is detected during the address phase of the transaction, the 4336 ** address parity error mechanisms are used. Refer to Section 3.7.1 for details of the address 4337 ** parity error response. 4338 ** * When operating in the PCI-X mode when an attribute parity error is detected, the attribute 4339 ** parity error mechanism described in Section 3.7.1 is used. 4340 ** * When a data parity error is detected while accepting data, the slave interface sets the 4341 ** appropriate bits based on PCI specifications. No other action is taken. Refer to Section 3.7.2.6 4342 ** for details of the inbound write data parity error response. 4343 ** Once the PCI interface places a PCI address in the IWADQ, when IWQ has received data sufficient 4344 ** to cross a buffer boundary or the master disconnects on the PCI bus, the ATUs internal bus 4345 ** interface becomes aware of the inbound write. When there are additional write transactions ahead 4346 ** in the IWQ/IWADQ, the current transaction remains posted until ordering and priority have been 4347 ** satisfied (Refer to Section 3.5.3) and the transaction is attempted on the internal bus by the ATU 4348 ** internal master interface. The ATU does not insert target wait states nor do data merging on the PCI 4349 ** interface, when operating in the PCI mode. 4350 ** In the PCI-X mode memory writes are always executed as immediate transactions, while 4351 ** configuration write transactions are processed as split transactions. The ATU generates a Split 4352 ** Completion Message, (with Message class=0h - Write Completion Class and Message index = 4353 ** 00h - Write Completion Message) once a configuration write is successfully executed. 4354 ** Also, when operating in the PCI-X mode a write sequence may contain multiple write transactions. 4355 ** The ATU handles such transactions as independent transactions. 4356 ** Data flow for the inbound write transaction on the internal bus is summarized as: 4357 ** * The ATU internal bus master requests the internal bus when IWADQ has at least one entry 4358 ** with associated data in the IWQ. 4359 ** * When the internal bus is granted, the internal bus master interface initiates the write 4360 ** transaction by driving the translated address onto the internal bus. For details on inbound 4361 ** address translation. 4362 ** * When IB_DEVSEL# is not returned, a master abort condition is signaled on the internal bus. 4363 ** The current transaction is flushed from the queue and SERR# may be asserted on the PCI 4364 ** interface. 4365 ** * The ATU initiator interface asserts IB_REQ64# to attempt a 64-bit transfer. When 4366 ** IB_ACK64# is not returned, a 32-bit transfer is used. Transfers of less than 64-bits use the 4367 ** IB_C/BE[7:0]# to mask the bytes not written in the 64-bit data phase. Write data is transferred 4368 ** from the IWQ to the internal bus when data is available and the internal bus interface retains 4369 ** internal bus ownership. 4370 ** * The internal bus interface stops transferring data from the current transaction to the internal 4371 ** bus when one of the following conditions becomes true: 4372 ** + The internal bus initiator interface loses bus ownership. The ATU internal initiator 4373 ** terminates the transfer (initiator disconnection) at the next ADB (for the internal bus ADB 4374 ** is defined as a naturally aligned 128-byte boundary) and attempt to reacquire the bus to 4375 ** complete the delivery of remaining data using the same sequence ID but with the 4376 ** modified starting address and byte count. 4377 ** + A Disconnect at Next ADB is signaled on the internal bus from the internal target. When 4378 ** the transaction in the IWQ completes at that ADB, the initiator returns to idle. When the 4379 ** transaction in the IWQ is not complete, the initiator attempts to reacquire the bus to 4380 ** complete the delivery of remaining data using the same sequence ID but with the 4381 ** modified starting address and byte count. 4382 ** + A Single Data Phase Disconnect is signaled on the internal bus from the internal target. 4383 ** When the transaction in the IWQ needs only a single data phase, the master returns to idle. 4384 ** When the transaction in the IWQ is not complete, the initiator attempts to reacquire the 4385 ** bus to complete the delivery of remaining data using the same sequence ID but with the 4386 ** modified starting address and byte count. 4387 ** + The data from the current transaction has completed (satisfaction of byte count). An 4388 ** initiator termination is performed and the bus returns to idle. 4389 ** + A Master Abort is signaled on the internal bus. SERR# may be asserted on the PCI bus. 4390 ** Data is flushed from the IWQ. 4391 ***************************************************************** 4392 */ 4393 4394 4395 4396 /* 4397 ************************************************************************** 4398 ** Inbound Read Completions Data Parity Errors 4399 **======================================================================== 4400 ** As an initiator, the ATU may encounter this error condition when operating in the PCI-X mode. 4401 ** When as the completer of a Split Read Request the ATU observes PERR# assertion during the split 4402 ** completion transaction, the ATU attempts to complete the transaction normally and no further 4403 ** action is taken. 4404 ************************************************************************** 4405 */ 4406 4407 /* 4408 ************************************************************************** 4409 ** Inbound Configuration Write Completion Message Data Parity Errors 4410 **======================================================================== 4411 ** As an initiator, the ATU may encounter this error condition when operating in the PCI-X mode. 4412 ** When as the completer of a Configuration (Split) Write Request the ATU observes PERR# 4413 ** assertion during the split completion transaction, the ATU attempts to complete the transaction 4414 ** normally and no further action is taken. 4415 ************************************************************************** 4416 */ 4417 4418 /* 4419 ************************************************************************** 4420 ** Inbound Read Request Data Parity Errors 4421 **===================== Immediate Data Transfer ========================== 4422 ** As a target, the ATU may encounter this error when operating in the Conventional PCI or PCI-X modes. 4423 ** Inbound read data parity errors occur when read data delivered from the IRQ is detected as having 4424 ** bad parity by the initiator of the transaction who is receiving the data. The initiator may optionally 4425 ** report the error to the system by asserting PERR#. As a target device in this scenario, no action is 4426 ** required and no error bits are set. 4427 **=====================Split Response Termination========================= 4428 ** As a target, the ATU may encounter this error when operating in the PCI-X mode. 4429 ** Inbound read data parity errors occur during the Split Response Termination. The initiator may 4430 ** optionally report the error to the system by asserting PERR#. As a target device in this scenario, no 4431 ** action is required and no error bits are set. 4432 ************************************************************************** 4433 */ 4434 4435 /* 4436 ************************************************************************** 4437 ** Inbound Write Request Data Parity Errors 4438 **======================================================================== 4439 ** As a target, the ATU may encounter this error when operating in the Conventional or PCI-X modes. 4440 ** Data parity errors occurring during write operations received by the ATU may assert PERR# on 4441 ** the PCI Bus. When an error occurs, the ATU continues accepting data until the initiator of the write 4442 ** transaction completes or a queue fill condition is reached. Specifically, the following actions with 4443 ** the given constraints are taken by the ATU: 4444 ** * PERR# is asserted two clocks cycles (three clock cycles when operating in the PCI-X mode) 4445 ** following the data phase in which the data parity error is detected on the bus. This is only 4446 ** done when the Parity Error Response bit in the ATUCMD is set. 4447 ** * The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional 4448 ** actions is taken: 4449 ** + When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the 4450 ** Detected Parity Error bit in the ATUISR. When set, no action. 4451 *************************************************************************** 4452 */ 4453 4454 4455 /* 4456 *************************************************************************** 4457 ** Inbound Configuration Write Request 4458 ** ===================================================================== 4459 ** As a target, the ATU may encounter this error when operating in the Conventional or PCI-X modes. 4460 ** =============================================== 4461 ** Conventional PCI Mode 4462 ** =============================================== 4463 ** To allow for correct data parity calculations for delayed write transactions, the ATU delays the 4464 ** assertion of STOP# (signalling a Retry) until PAR is driven by the master. A parity error during a 4465 ** delayed write transaction (inbound configuration write cycle) can occur in any of the following 4466 ** parts of the transactions: 4467 ** * During the initial Delayed Write Request cycle on the PCI bus when the ATU latches the 4468 ** address/command and data for delayed delivery to the internal configuration register. 4469 ** * During the Delayed Write Completion cycle on the PCI bus when the ATU delivers the status 4470 ** of the operation back to the original master. 4471 ** The 80331 ATU PCI interface has the following responses to a delayed write parity error for 4472 ** inbound transactions during Delayed Write Request cycles with the given constraints: 4473 ** * When the Parity Error Response bit in the ATUCMD is set, the ATU asserts TRDY# 4474 ** (disconnects with data) and two clock cycles later asserts PERR# notifying the initiator of the 4475 ** parity error. The delayed write cycle is not enqueued and forwarded to the internal bus. 4476 ** When the Parity Error Response bit in the ATUCMD is cleared, the ATU retries the 4477 ** transaction by asserting STOP# and enqueues the Delayed Write Request cycle to be 4478 ** forwarded to the internal bus. PERR# is not asserted. 4479 ** * The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional 4480 ** actions is taken: 4481 ** + When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the 4482 ** Detected Parity Error bit in the ATUISR. When set, no action. 4483 ** For the original write transaction to be completed, the initiator retries the transaction on the PCI 4484 ** bus and the ATU returns the status from the internal bus, completing the transaction. 4485 ** For the Delayed Write Completion transaction on the PCI bus where a data parity error occurs and 4486 ** therefore does not agree with the status being returned from the internal bus (i.e. status being 4487 ** returned is normal completion) the ATU performs the following actions with the given constraints: 4488 ** * When the Parity Error Response Bit is set in the ATUCMD, the ATU asserts TRDY# 4489 ** (disconnects with data) and two clocks later asserts PERR#. The Delayed Completion cycle in 4490 ** the IDWQ remains since the data of retried command did not match the data within the queue. 4491 ** * The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional 4492 ** actions is taken: 4493 ** + When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the 4494 ** Detected Parity Error bit in the ATUISR. When set, no action. 4495 ** =================================================== 4496 ** PCI-X Mode 4497 ** =================================================== 4498 ** Data parity errors occurring during configuration write operations received by the ATU may cause 4499 ** PERR# assertion and delivery of a Split Completion Error Message on the PCI Bus. When an error 4500 ** occurs, the ATU accepts the write data and complete with a Split Response Termination. 4501 ** Specifically, the following actions with the given constraints are then taken by the ATU: 4502 ** * When the Parity Error Response bit in the ATUCMD is set, PERR# is asserted three clocks 4503 ** cycles following the Split Response Termination in which the data parity error is detected on 4504 ** the bus. When the ATU asserts PERR#, additional actions is taken: 4505 ** + A Split Write Data Parity Error message (with message class=2h - completer error and 4506 ** message index=01h - Split Write Data Parity Error) is initiated by the ATU on the PCI bus 4507 ** that addresses the requester of the configuration write. 4508 ** + When the Initiated Split Completion Error Message Interrupt Mask in the ATUIMR is 4509 ** clear, set the Initiated Split Completion Error Message bit in the ATUISR. When set, no 4510 ** action. 4511 ** + The Split Write Request is not enqueued and forwarded to the internal bus. 4512 ** * The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional 4513 ** actions is taken: 4514 ** + When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the 4515 ** Detected Parity Error bit in the ATUISR. When set, no action. 4516 ** 4517 *************************************************************************** 4518 */ 4519 4520 /* 4521 *************************************************************************** 4522 ** Split Completion Messages 4523 ** ======================================================================= 4524 ** As a target, the ATU may encounter this error when operating in the PCI-X mode. 4525 ** Data parity errors occurring during Split Completion Messages claimed by the ATU may assert 4526 ** PERR# (when enabled) or SERR# (when enabled) on the PCI Bus. When an error occurs, the 4527 ** ATU accepts the data and complete normally. Specifically, the following actions with the given 4528 ** constraints are taken by the ATU: 4529 ** * PERR# is asserted three clocks cycles following the data phase in which the data parity error 4530 ** is detected on the bus. This is only done when the Parity Error Response bit in the ATUCMD 4531 ** is set. When the ATU asserts PERR#, additional actions is taken: 4532 ** + The Master Parity Error bit in the ATUSR is set. 4533 ** + When the ATU PCI Master Parity Error Interrupt Mask Bit in the ATUIMR is clear, set the 4534 ** PCI Master Parity Error bit in the ATUISR. When set, no action. 4535 ** + When the SERR# Enable bit in the ATUCMD is set, and the Data Parity Error Recover 4536 ** Enable bit in the PCIXCMD register is clear, assert SERR#; otherwise no action is taken. 4537 ** When the ATU asserts SERR#, additional actions is taken: 4538 ** Set the SERR# Asserted bit in the ATUSR. 4539 ** When the ATU SERR# Asserted Interrupt Mask Bit in the ATUIMR is clear, set the 4540 ** SERR# Asserted bit in the ATUISR. When set, no action. 4541 ** When the ATU SERR# Detected Interrupt Enable Bit in the ATUCR is set, set the 4542 ** SERR# Detected bit in the ATUISR. When clear, no action. 4543 ** * When the SCE bit (Split Completion Error -- bit 30 of the Completer Attributes) is set during 4544 ** the Attribute phase, the Received Split Completion Error Message bit in the PCIXSR is set. 4545 ** When the ATU sets this bit, additional actions is taken: 4546 ** + When the ATU Received Split Completion Error Message Interrupt Mask bit in the 4547 ** ATUIMR is clear, set the Received Split Completion Error Message bit in the ATUISR. 4548 ** When set, no action. 4549 ** * The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional 4550 ** actions is taken: 4551 ** + When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the 4552 ** Detected Parity Error bit in the ATUISR. When set, no action. 4553 ** * The transaction associated with the Split Completion Message is discarded. 4554 ** * When the discarded transaction was a read, a completion error message (with message 4555 ** class=2h - completer error and message index=82h - PCI bus read parity error) is generated on 4556 ** the internal bus of the 80331. 4557 ***************************************************************************** 4558 */ 4559 4560 4561 /* 4562 ****************************************************************************************************** 4563 ** Messaging Unit (MU) of the Intel R 80331 I/O processor (80331) 4564 ** ================================================================================================== 4565 ** The Messaging Unit (MU) transfers data between the PCI system and the 80331 4566 ** notifies the respective system when new data arrives. 4567 ** The PCI window for messaging transactions is always the first 4 Kbytes of the inbound translation. 4568 ** window defined by: 4569 ** 1.Inbound ATU Base Address Register 0 (IABAR0) 4570 ** 2.Inbound ATU Limit Register 0 (IALR0) 4571 ** All of the Messaging Unit errors are reported in the same manner as ATU errors. 4572 ** Error conditions and status can be found in : 4573 ** 1.ATUSR 4574 ** 2.ATUISR 4575 **==================================================================================================== 4576 ** Mechanism Quantity Assert PCI Interrupt Signals Generate I/O Processor Interrupt 4577 **---------------------------------------------------------------------------------------------------- 4578 ** Message Registers 2 Inbound Optional Optional 4579 ** 2 Outbound 4580 **---------------------------------------------------------------------------------------------------- 4581 ** Doorbell Registers 1 Inbound Optional Optional 4582 ** 1 Outbound 4583 **---------------------------------------------------------------------------------------------------- 4584 ** Circular Queues 4 Circular Queues Under certain conditions Under certain conditions 4585 **---------------------------------------------------------------------------------------------------- 4586 ** Index Registers 1004 32-bit Memory Locations No Optional 4587 **==================================================================================================== 4588 ** PCI Memory Map: First 4 Kbytes of the ATU Inbound PCI Address Space 4589 **==================================================================================================== 4590 ** 0000H Reserved 4591 ** 0004H Reserved 4592 ** 0008H Reserved 4593 ** 000CH Reserved 4594 **------------------------------------------------------------------------ 4595 ** 0010H Inbound Message Register 0 ] 4596 ** 0014H Inbound Message Register 1 ] 4597 ** 0018H Outbound Message Register 0 ] 4598 ** 001CH Outbound Message Register 1 ] 4 Message Registers 4599 **------------------------------------------------------------------------ 4600 ** 0020H Inbound Doorbell Register ] 4601 ** 0024H Inbound Interrupt Status Register ] 4602 ** 0028H Inbound Interrupt Mask Register ] 4603 ** 002CH Outbound Doorbell Register ] 4604 ** 0030H Outbound Interrupt Status Register ] 4605 ** 0034H Outbound Interrupt Mask Register ] 2 Doorbell Registers and 4 Interrupt Registers 4606 **------------------------------------------------------------------------ 4607 ** 0038H Reserved 4608 ** 003CH Reserved 4609 **------------------------------------------------------------------------ 4610 ** 0040H Inbound Queue Port ] 4611 ** 0044H Outbound Queue Port ] 2 Queue Ports 4612 **------------------------------------------------------------------------ 4613 ** 0048H Reserved 4614 ** 004CH Reserved 4615 **------------------------------------------------------------------------ 4616 ** 0050H ] 4617 ** : ] 4618 ** : Intel Xscale Microarchitecture Local Memory ] 4619 ** : ] 4620 ** 0FFCH ] 1004 Index Registers 4621 ******************************************************************************* 4622 */ 4623 /* 4624 ***************************************************************************** 4625 ** Theory of MU Operation 4626 ***************************************************************************** 4627 **-------------------- 4628 ** inbound_msgaddr0: 4629 ** inbound_msgaddr1: 4630 ** outbound_msgaddr0: 4631 ** outbound_msgaddr1: 4632 ** . The MU has four independent messaging mechanisms. 4633 ** There are four Message Registers that are similar to a combination of mailbox and doorbell registers. 4634 ** Each holds a 32-bit value and generates an interrupt when written. 4635 **-------------------- 4636 ** inbound_doorbell: 4637 ** outbound_doorbell: 4638 ** . The two Doorbell Registers support software interrupts. 4639 ** When a bit is set in a Doorbell Register, an interrupt is generated. 4640 **-------------------- 4641 ** inbound_queueport: 4642 ** outbound_queueport: 4643 ** 4644 ** 4645 ** . The Circular Queues support a message passing scheme that uses 4 circular queues. 4646 ** The 4 circular queues are implemented in 80331 local memory. 4647 ** Two queues are used for inbound messages and two are used for outbound messages. 4648 ** Interrupts may be generated when the queue is written. 4649 **-------------------- 4650 ** local_buffer 0x0050 ....0x0FFF 4651 ** . The Index Registers use a portion of the 80331 local memory to implement a large set of message registers. 4652 ** When one of the Index Registers is written, an interrupt is generated and the address of the register written is captured. 4653 ** Interrupt status for all interrupts is recorded in the Inbound Interrupt Status Register and the Outbound Interrupt Status Register. 4654 ** Each interrupt generated by the Messaging Unit can be masked. 4655 **-------------------- 4656 ** . Multi-DWORD PCI burst accesses are not supported by the Messaging Unit, 4657 ** with the exception of Multi-DWORD reads to the index registers. 4658 ** In Conventional mode: the MU terminates Multi-DWORD PCI transactions 4659 ** (other than index register reads) with a disconnect at the next Qword boundary, with the exception of queue ports. 4660 ** In PCI-X mode : the MU terminates a Multi-DWORD PCI read transaction with a Split Response 4661 ** and the data is returned through split completion transaction(s). 4662 ** however, when the burst request crosses into or through the range of offsets 40h to 4Ch 4663 ** (e.g., this includes the queue ports) the transaction is signaled target-abort immediately on the PCI bus. 4664 ** In PCI-X mode, Multi-DWORD PCI writes is signaled a Single-Data-Phase Disconnect 4665 ** which means that no data beyond the first Qword (Dword when the MU does not assert P_ACK64#) is written. 4666 **-------------------- 4667 ** . All registers needed to configure and control the Messaging Unit are memory-mapped registers. 4668 ** The MU uses the first 4 Kbytes of the inbound translation window in the Address Translation Unit (ATU). 4669 ** This PCI address window is used for PCI transactions that access the 80331 local memory. 4670 ** The PCI address of the inbound translation window is contained in the Inbound ATU Base Address Register. 4671 **-------------------- 4672 ** . From the PCI perspective, the Messaging Unit is part of the Address Translation Unit. 4673 ** The Messaging Unit uses the PCI configuration registers of the ATU for control and status information. 4674 ** The Messaging Unit must observe all PCI control bits in the ATU Command Register and ATU Configuration Register. 4675 ** The Messaging Unit reports all PCI errors in the ATU Status Register. 4676 **-------------------- 4677 ** . Parts of the Messaging Unit can be accessed as a 64-bit PCI device. 4678 ** The register interface, message registers, doorbell registers, 4679 ** and index registers returns a P_ACK64# in response to a P_REQ64# on the PCI interface. 4680 ** Up to 1 Qword of data can be read or written per transaction (except Index Register reads). 4681 ** The Inbound and Outbound Queue Ports are always 32-bit addresses and the MU does not assert P_ACK64# to offsets 40H and 44H. 4682 ************************************************************************** 4683 */ 4684 /* 4685 ************************************************************************** 4686 ** Message Registers 4687 ** ============================== 4688 ** . Messages can be sent and received by the 80331 through the use of the Message Registers. 4689 ** . When written, the message registers may cause an interrupt to be generated to either the Intel XScale core or the host processor. 4690 ** . Inbound messages are sent by the host processor and received by the 80331. 4691 ** Outbound messages are sent by the 80331 and received by the host processor. 4692 ** . The interrupt status for outbound messages is recorded in the Outbound Interrupt Status Register. 4693 ** Interrupt status for inbound messages is recorded in the Inbound Interrupt Status Register. 4694 ** 4695 ** Inbound Messages: 4696 ** ----------------- 4697 ** . When an inbound message register is written by an external PCI agent, an interrupt may be generated to the Intel XScale core. 4698 ** . The interrupt may be masked by the mask bits in the Inbound Interrupt Mask Register. 4699 ** . The Intel XScale core interrupt is recorded in the Inbound Interrupt Status Register. 4700 ** The interrupt causes the Inbound Message Interrupt bit to be set in the Inbound Interrupt Status Register. 4701 ** This is a Read/Clear bit that is set by the MU hardware and cleared by software. 4702 ** The interrupt is cleared when the Intel XScale core writes a value of 4703 ** 1 to the Inbound Message Interrupt bit in the Inbound Interrupt Status Register. 4704 ** ------------------------------------------------------------------------ 4705 ** Inbound Message Register - IMRx 4706 ** 4707 ** . There are two Inbound Message Registers: IMR0 and IMR1. 4708 ** . When the IMR register is written, an interrupt to the Intel XScale core may be generated. 4709 ** The interrupt is recorded in the Inbound Interrupt Status Register and may be masked 4710 ** by the Inbound Message Interrupt Mask bit in the Inbound Interrupt Mask Register. 4711 ** ----------------------------------------------------------------- 4712 ** Bit Default Description 4713 ** 31:00 0000 0000H Inbound Message - This is a 32-bit message written by an external PCI agent. 4714 ** When written, an interrupt to the Intel XScale core may be generated. 4715 ************************************************************************** 4716 */ 4717 #define ARCMSR_MU_INBOUND_MESSAGE_REG0 0x10 /*dword 0x13,0x12,0x11,0x10*/ 4718 #define ARCMSR_MU_INBOUND_MESSAGE_REG1 0x14 /*dword 0x17,0x16,0x15,0x14*/ 4719 /* 4720 ************************************************************************** 4721 ** Outbound Message Register - OMRx 4722 ** -------------------------------- 4723 ** There are two Outbound Message Registers: OMR0 and OMR1. When the OMR register is 4724 ** written, a PCI interrupt may be generated. The interrupt is recorded in the Outbound Interrupt 4725 ** Status Register and may be masked by the Outbound Message Interrupt Mask bit in the Outbound 4726 ** Interrupt Mask Register. 4727 ** 4728 ** Bit Default Description 4729 ** 31:00 00000000H Outbound Message - This is 32-bit message written by the Intel XScale core. When written, an 4730 ** interrupt may be generated on the PCI Interrupt pin determined by the ATU Interrupt Pin Register. 4731 ************************************************************************** 4732 */ 4733 #define ARCMSR_MU_OUTBOUND_MESSAGE_REG0 0x18 /*dword 0x1B,0x1A,0x19,0x18*/ 4734 #define ARCMSR_MU_OUTBOUND_MESSAGE_REG1 0x1C /*dword 0x1F,0x1E,0x1D,0x1C*/ 4735 /* 4736 ************************************************************************** 4737 ** Doorbell Registers 4738 ** ============================== 4739 ** There are two Doorbell Registers: 4740 ** Inbound Doorbell Register 4741 ** Outbound Doorbell Register 4742 ** The Inbound Doorbell Register allows external PCI agents to generate interrupts to the Intel R XScale core. 4743 ** The Outbound Doorbell Register allows the Intel R XScale core to generate a PCI interrupt. 4744 ** Both Doorbell Registers may generate interrupts whenever a bit in the register is set. 4745 ** 4746 ** Inbound Doorbells: 4747 ** ------------------ 4748 ** . When the Inbound Doorbell Register is written by an external PCI agent, an interrupt may be generated to the Intel R XScale core. 4749 ** An interrupt is generated when any of the bits in the doorbell register is written to a value of 1. 4750 ** 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. 4751 ** . Once a bit is set in the Inbound Doorbell Register, it cannot be cleared by any external PCI agent. 4752 ** The interrupt is recorded in the Inbound Interrupt Status Register. 4753 ** . The interrupt may be masked by the Inbound Doorbell Interrupt mask bit in the Inbound Interrupt Mask Register. 4754 ** When the mask bit is set for a particular bit, no interrupt is generated for that bit. 4755 ** The Inbound Interrupt Mask Register affects only the generation of the normal messaging unit interrupt 4756 ** and not the values written to the Inbound Doorbell Register. 4757 ** One bit in the Inbound Doorbell Register is reserved for an Error Doorbell interrupt. 4758 ** . 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. 4759 ** Writing a value of 0 to any bit does not change the value of that bit and does not clear the interrupt. 4760 ** ------------------------------------------------------------------------ 4761 ** Inbound Doorbell Register - IDR 4762 ** 4763 ** . The Inbound Doorbell Register (IDR) is used to generate interrupts to the Intel XScale core. 4764 ** . Bit 31 is reserved for generating an Error Doorbell interrupt. 4765 ** When bit 31 is set, an Error interrupt may be generated to the Intel XScale core. 4766 ** All other bits, when set, cause the Normal Messaging Unit interrupt line of the Intel XScale core to be asserted, 4767 ** when the interrupt is not masked by the Inbound Doorbell Interrupt Mask bit in the Inbound Interrupt Mask Register. 4768 ** 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. 4769 ** ------------------------------------------------------------------------ 4770 ** Bit Default Description 4771 ** 31 0 2 Error Interrupt - Generate an Error Interrupt to the Intel XScale core. 4772 ** 30:00 00000000H Normal Interrupt - When any bit is set, generate a Normal interrupt to the Intel XScale core. 4773 ** When all bits are clear, do not generate a Normal Interrupt. 4774 ************************************************************************** 4775 */ 4776 #define ARCMSR_MU_INBOUND_DOORBELL_REG 0x20 /*dword 0x23,0x22,0x21,0x20*/ 4777 /* 4778 ************************************************************************** 4779 ** Inbound Interrupt Status Register - IISR 4780 ** 4781 ** . The Inbound Interrupt Status Register (IISR) contains hardware interrupt status. 4782 ** It records the status of Intel XScale core interrupts generated by the Message Registers, Doorbell Registers, and the Circular Queues. 4783 ** All interrupts are routed to the Normal Messaging Unit interrupt input of the Intel XScale core, 4784 ** except for the Error Doorbell Interrupt and the Outbound Free Queue Full interrupt; 4785 ** these two are routed to the Messaging Unit Error interrupt input. 4786 ** The generation of interrupts recorded in the Inbound Interrupt Status Register 4787 ** may be masked by setting the corresponding bit in the Inbound Interrupt Mask Register. 4788 ** Some of the bits in this register are Read Only. 4789 ** For those bits, the interrupt must be cleared through another register. 4790 ** 4791 ** Bit Default Description 4792 ** 31:07 0000000H 0 2 Reserved 4793 ** 06 0 2 Index Register Interrupt - This bit is set by the MU hardware 4794 ** when an Index Register has been written after a PCI transaction. 4795 ** 05 0 2 Outbound Free Queue Full Interrupt - This bit is set 4796 ** when the Outbound Free Head Pointer becomes equal to the Tail Pointer and the queue is full. 4797 ** An Error interrupt is generated for this condition. 4798 ** 04 0 2 Inbound Post Queue Interrupt - This bit is set by the MU hardware when the Inbound Post Queue has been written. 4799 ** Once cleared, an interrupt does NOT be generated 4800 ** when the head and tail pointers remain unequal (i.e. queue status is Not Empty). 4801 ** Therefore, when software leaves any unprocessed messages in the post queue when the interrupt is cleared, 4802 ** software must retain the information that the Inbound Post queue status is not empty. 4803 ** NOTE: This interrupt is provided with dedicated support in the 80331 Interrupt Controller. 4804 ** 03 0 2 Error Doorbell Interrupt - This bit is set when the Error Interrupt of the Inbound Doorbell Register is set. 4805 ** To clear this bit (and the interrupt), the Error Interrupt bit of the Inbound Doorbell Register must be clear. 4806 ** 02 0 2 Inbound Doorbell Interrupt - This bit is set when at least one 4807 ** Normal Interrupt bit in the Inbound Doorbell Register is set. 4808 ** To clear this bit (and the interrupt), the Normal Interrupt bits in the Inbound Doorbell Register must all be clear. 4809 ** 01 0 2 Inbound Message 1 Interrupt - This bit is set by the MU hardware when the Inbound Message 1 Register has been written. 4810 ** 00 0 2 Inbound Message 0 Interrupt - This bit is set by the MU hardware when the Inbound Message 0 Register has been written. 4811 ************************************************************************** 4812 */ 4813 #define ARCMSR_MU_INBOUND_INTERRUPT_STATUS_REG 0x24 /*dword 0x27,0x26,0x25,0x24*/ 4814 #define ARCMSR_MU_INBOUND_INDEX_INT 0x40 4815 #define ARCMSR_MU_INBOUND_QUEUEFULL_INT 0x20 4816 #define ARCMSR_MU_INBOUND_POSTQUEUE_INT 0x10 4817 #define ARCMSR_MU_INBOUND_ERROR_DOORBELL_INT 0x08 4818 #define ARCMSR_MU_INBOUND_DOORBELL_INT 0x04 4819 #define ARCMSR_MU_INBOUND_MESSAGE1_INT 0x02 4820 #define ARCMSR_MU_INBOUND_MESSAGE0_INT 0x01 4821 /* 4822 ************************************************************************** 4823 ** Inbound Interrupt Mask Register - IIMR 4824 ** 4825 ** . The Inbound Interrupt Mask Register (IIMR) provides the ability to mask Intel XScale core interrupts generated by the Messaging Unit. 4826 ** Each bit in the Mask register corresponds to an interrupt bit in the Inbound Interrupt Status Register. 4827 ** Setting or clearing bits in this register does not affect the Inbound Interrupt Status Register. 4828 ** They only affect the generation of the Intel XScale core interrupt. 4829 ** ------------------------------------------------------------------------ 4830 ** Bit Default Description 4831 ** 31:07 000000H 0 2 Reserved 4832 ** 06 0 2 Index Register Interrupt Mask - When set, this bit masks the interrupt generated by the MU hardware 4833 ** when an Index Register has been written after a PCI transaction. 4834 ** 05 0 2 Outbound Free Queue Full Interrupt Mask - When set, this bit masks the Error interrupt generated 4835 ** when the Outbound Free Head Pointer becomes equal to the Tail Pointer and the queue is full. 4836 ** 04 0 2 Inbound Post Queue Interrupt Mask - When set, this bit masks the interrupt generated 4837 ** by the MU hardware when the Inbound Post Queue has been written. 4838 ** 03 0 2 Error Doorbell Interrupt Mask - When set, this bit masks the Error Interrupt 4839 ** when the Error Interrupt bit of the Inbound Doorbell Register is set. 4840 ** 02 0 2 Inbound Doorbell Interrupt Mask - When set, this bit masks the interrupt generated 4841 ** when at least one Normal Interrupt bit in the Inbound Doorbell Register is set. 4842 ** 01 0 2 Inbound Message 1 Interrupt Mask - When set, this bit masks the Inbound Message 1 4843 ** Interrupt generated by a write to the Inbound Message 1 Register. 4844 ** 00 0 2 Inbound Message 0 Interrupt Mask - When set, 4845 ** this bit masks the Inbound Message 0 Interrupt generated by a write to the Inbound Message 0 Register. 4846 ************************************************************************** 4847 */ 4848 #define ARCMSR_MU_INBOUND_INTERRUPT_MASK_REG 0x28 /*dword 0x2B,0x2A,0x29,0x28*/ 4849 #define ARCMSR_MU_INBOUND_INDEX_INTMASKENABLE 0x40 4850 #define ARCMSR_MU_INBOUND_QUEUEFULL_INTMASKENABLE 0x20 4851 #define ARCMSR_MU_INBOUND_POSTQUEUE_INTMASKENABLE 0x10 4852 #define ARCMSR_MU_INBOUND_DOORBELL_ERROR_INTMASKENABLE 0x08 4853 #define ARCMSR_MU_INBOUND_DOORBELL_INTMASKENABLE 0x04 4854 #define ARCMSR_MU_INBOUND_MESSAGE1_INTMASKENABLE 0x02 4855 #define ARCMSR_MU_INBOUND_MESSAGE0_INTMASKENABLE 0x01 4856 /* 4857 ************************************************************************** 4858 ** Outbound Doorbell Register - ODR 4859 ** 4860 ** The Outbound Doorbell Register (ODR) allows software interrupt generation. It allows the Intel 4861 ** XScale core to generate PCI interrupts to the host processor by writing to this register. The 4862 ** generation of PCI interrupts through the Outbound Doorbell Register may be masked by setting the 4863 ** Outbound Doorbell Interrupt Mask bit in the Outbound Interrupt Mask Register. 4864 ** The Software Interrupt bits in this register can only be set by the Intel XScale core and can only 4865 ** be cleared by an external PCI agent. 4866 ** ---------------------------------------------------------------------- 4867 ** Bit Default Description 4868 ** 31 0 2 Reserved 4869 ** 30 0 2 Reserved. 4870 ** 29 0 2 Reserved 4871 ** 28 0000 0000H PCI Interrupt - When set, this bit causes the P_INTC# interrupt output 4872 ** (P_INTA# with BRG_EN and ARB_EN straps low) 4873 ** signal to be asserted or a Message-signaled Interrupt is generated (when enabled). 4874 ** When this bit is cleared, the P_INTC# interrupt output 4875 ** (P_INTA# with BRG_EN and ARB_EN straps low) 4876 ** signal is deasserted. 4877 ** 27:00 000 0000H Software Interrupts - When any bit is set the P_INTC# interrupt output 4878 ** (P_INTA# with BRG_EN and ARB_EN straps low) 4879 ** signal is asserted or a Message-signaled Interrupt is generated (when enabled). 4880 ** When all bits are cleared, the P_INTC# interrupt output (P_INTA# with BRG_EN and ARB_EN straps low) 4881 ** signal is deasserted. 4882 ************************************************************************** 4883 */ 4884 #define ARCMSR_MU_OUTBOUND_DOORBELL_REG 0x2C /*dword 0x2F,0x2E,0x2D,0x2C*/ 4885 /* 4886 ************************************************************************** 4887 ** Outbound Interrupt Status Register - OISR 4888 ** 4889 ** The Outbound Interrupt Status Register (OISR) contains hardware interrupt status. It records the 4890 ** status of PCI interrupts generated by the Message Registers, Doorbell Registers, and the Circular 4891 ** Queues. The generation of PCI interrupts recorded in the Outbound Interrupt Status Register may 4892 ** be masked by setting the corresponding bit in the Outbound Interrupt Mask Register. Some of the 4893 ** bits in this register are Read Only. For those bits, the interrupt must be cleared through another 4894 ** register. 4895 ** ---------------------------------------------------------------------- 4896 ** Bit Default Description 4897 ** 31:05 000000H 000 2 Reserved 4898 ** 04 0 2 PCI Interrupt - This bit is set when the PCI Interrupt bit (bit 28) is set in the Outbound Doorbell Register. 4899 ** To clear this bit (and the interrupt), the PCI Interrupt bit must be cleared. 4900 ** 03 0 2 Outbound Post Queue Interrupt - This bit is set when data in the prefetch buffer is valid. This bit is 4901 ** cleared when any prefetch data has been read from the Outbound Queue Port. 4902 ** 02 0 2 Outbound Doorbell Interrupt - This bit is set when at least one Software Interrupt bit in the Outbound 4903 ** Doorbell Register is set. To clear this bit (and the interrupt), the Software Interrupt bits in the Outbound 4904 ** Doorbell Register must all be clear. 4905 ** 01 0 2 Outbound Message 1 Interrupt - This bit is set by the MU when the Outbound Message 1 Register is 4906 ** written. Clearing this bit clears the interrupt. 4907 ** 00 0 2 Outbound Message 0 Interrupt - This bit is set by the MU when the Outbound Message 0 Register is 4908 ** written. Clearing this bit clears the interrupt. 4909 ************************************************************************** 4910 */ 4911 #define ARCMSR_MU_OUTBOUND_INTERRUPT_STATUS_REG 0x30 /*dword 0x33,0x32,0x31,0x30*/ 4912 #define ARCMSR_MU_OUTBOUND_PCI_INT 0x10 4913 #define ARCMSR_MU_OUTBOUND_POSTQUEUE_INT 0x08 4914 #define ARCMSR_MU_OUTBOUND_DOORBELL_INT 0x04 4915 #define ARCMSR_MU_OUTBOUND_MESSAGE1_INT 0x02 4916 #define ARCMSR_MU_OUTBOUND_MESSAGE0_INT 0x01 4917 /* 4918 ************************************************************************** 4919 ** Outbound Interrupt Mask Register - OIMR 4920 ** The Outbound Interrupt Mask Register (OIMR) provides the ability to mask outbound PCI 4921 ** interrupts generated by the Messaging Unit. Each bit in the mask register corresponds to a 4922 ** hardware interrupt bit in the Outbound Interrupt Status Register. When the bit is set, the PCI 4923 ** interrupt is not generated. When the bit is clear, the interrupt is allowed to be generated. 4924 ** Setting or clearing bits in this register does not affect the Outbound Interrupt Status Register. They 4925 ** only affect the generation of the PCI interrupt. 4926 ** ---------------------------------------------------------------------- 4927 ** Bit Default Description 4928 ** 31:05 000000H Reserved 4929 ** 04 0 2 PCI Interrupt Mask - When set, this bit masks the interrupt generation when the PCI Interrupt bit (bit 28) 4930 ** in the Outbound Doorbell Register is set. 4931 ** 03 0 2 Outbound Post Queue Interrupt Mask - When set, this bit masks the interrupt generated when data in 4932 ** the prefetch buffer is valid. 4933 ** 02 0 2 Outbound Doorbell Interrupt Mask - When set, this bit masks the interrupt generated by the Outbound 4934 ** Doorbell Register. 4935 ** 01 0 2 Outbound Message 1 Interrupt Mask - When set, this bit masks the Outbound Message 1 Interrupt 4936 ** generated by a write to the Outbound Message 1 Register. 4937 ** 00 0 2 Outbound Message 0 Interrupt Mask- When set, this bit masks the Outbound Message 0 Interrupt 4938 ** generated by a write to the Outbound Message 0 Register. 4939 ************************************************************************** 4940 */ 4941 #define ARCMSR_MU_OUTBOUND_INTERRUPT_MASK_REG 0x34 /*dword 0x37,0x36,0x35,0x34*/ 4942 #define ARCMSR_MU_OUTBOUND_PCI_INTMASKENABLE 0x10 4943 #define ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE 0x08 4944 #define ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE 0x04 4945 #define ARCMSR_MU_OUTBOUND_MESSAGE1_INTMASKENABLE 0x02 4946 #define ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE 0x01 4947 #define ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE 0x1F 4948 /* 4949 ************************************************************************** 4950 ** 4951 ************************************************************************** 4952 */ 4953 #define ARCMSR_MU_INBOUND_QUEUE_PORT_REG 0x40 /*dword 0x43,0x42,0x41,0x40*/ 4954 #define ARCMSR_MU_OUTBOUND_QUEUE_PORT_REG 0x44 /*dword 0x47,0x46,0x45,0x44*/ 4955 /* 4956 ************************************************************************** 4957 ** Circular Queues 4958 ** ====================================================================== 4959 ** The MU implements four circular queues. There are 2 inbound queues and 2 outbound queues. In 4960 ** this case, inbound and outbound refer to the direction of the flow of posted messages. 4961 ** Inbound messages are either: 4962 ** * posted messages by other processors for the Intel XScale core to process or 4963 ** * free (or empty) messages that can be reused by other processors. 4964 ** Outbound messages are either: 4965 ** * posted messages by the Intel XScale core for other processors to process or 4966 ** * free (or empty) messages that can be reused by the Intel XScale core. 4967 ** Therefore, free inbound messages flow away from the 80331 and free outbound messages flow toward the 80331. 4968 ** The four Circular Queues are used to pass messages in the following manner. 4969 ** . The two inbound queues are used to handle inbound messages 4970 ** and the two outbound queues are used to handle outbound messages. 4971 ** . One of the inbound queues is designated the Free queue and it contains inbound free messages. 4972 ** The other inbound queue is designated the Post queue and it contains inbound posted messages. 4973 ** Similarly, one of the outbound queues is designated the Free queue and the other outbound queue is designated the Post queue. 4974 ** 4975 ** ============================================================================================================= 4976 ** Circular Queue Summary 4977 ** _____________________________________________________________________________________________________________ 4978 ** | Queue Name | Purpose | Action on PCI Interface| 4979 ** |______________________|____________________________________________________________|_________________________| 4980 ** |Inbound Post Queue | Queue for inbound messages from other processors | Written | 4981 ** | | waiting to be processed by the 80331 | | 4982 ** |Inbound Free Queue | Queue for empty inbound messages from the 80331 | Read | 4983 ** | | available for use by other processors | | 4984 ** |Outbound Post Queue | Queue for outbound messages from the 80331 | Read | 4985 ** | | that are being posted to the other processors | | 4986 ** |Outbound Free Queue | Queue for empty outbound messages from other processors | Written | 4987 ** | | available for use by the 80331 | | 4988 ** |______________________|____________________________________________________________|_________________________| 4989 ** 4990 ** . The two inbound queues allow the host processor to post inbound messages for the 80331 in one 4991 ** queue and to receive free messages returning from the 80331. 4992 ** The host processor posts inbound messages, 4993 ** the Intel XScale core receives the posted message and when it is finished with the message, 4994 ** places it back on the inbound free queue for reuse by the host processor. 4995 ** 4996 ** The circular queues are accessed by external PCI agents through two port locations in the PCI 4997 ** address space: 4998 ** Inbound Queue Port 4999 ** and Outbound Queue Port. 5000 ** The Inbound Queue Port is used by external PCI agents to read the Inbound Free Queue and write the Inbound Post Queue. 5001 ** The Outbound Queue Port is used by external PCI agents to read the Outbound Post Queue and write the Outbound Free Queue. 5002 ** Note that a PCI transaction to the inbound or outbound queue ports with null byte enables (P_C/BE[3:0]#=1111 2 ) 5003 ** does not cause the MU hardware to increment the queue pointers. 5004 ** This is treated as when the PCI transaction did not occur. 5005 ** The Inbound and Outbound Queue Ports never respond with P_ACK64# on the PCI interface. 5006 ** ====================================================================================== 5007 ** Overview of Circular Queue Operation 5008 ** ====================================================================================== 5009 ** . The data storage for the circular queues must be provided by the 80331 local memory. 5010 ** . The base address of the circular queues is contained in the Queue Base Address Register. 5011 ** Each entry in the queue is a 32-bit data value. 5012 ** . Each read from or write to the queue may access only one queue entry. 5013 ** . Multi-DWORD accesses to the circular queues are not allowed. 5014 ** Sub-DWORD accesses are promoted to DWORD accesses. 5015 ** . Each circular queue has a head pointer and a tail pointer. 5016 ** The pointers are offsets from the Queue Base Address. 5017 ** . Writes to a queue occur at the head of the queue and reads occur from the tail. 5018 ** The head and tail pointers are incremented by either the Intel XScale core or the Messaging Unit hardware. 5019 ** Which unit maintains the pointer is determined by the writer of the queue. 5020 ** More details about the pointers are given in the queue descriptions below. 5021 ** The pointers are incremented after the queue access. 5022 ** Both pointers wrap around to the first address of the circular queue when they reach the circular queue size. 5023 ** 5024 ** Messaging Unit... 5025 ** 5026 ** The Messaging Unit generates an interrupt to the Intel XScale core or generate a PCI interrupt under certain conditions. 5027 ** . In general, when a Post queue is written, an interrupt is generated to notify the receiver that a message was posted. 5028 ** The size of each circular queue can range from 4K entries (16 Kbytes) to 64K entries (256 Kbytes). 5029 ** . All four queues must be the same size and may be contiguous. 5030 ** Therefore, the total amount of local memory needed by the circular queues ranges from 64 Kbytes to 1 Mbytes. 5031 ** The Queue size is determined by the Queue Size field in the MU Configuration Register. 5032 ** . There is one base address for all four queues. 5033 ** It is stored in the Queue Base Address Register (QBAR). 5034 ** The starting addresses of each queue is based on the Queue Base Address and the Queue Size field. 5035 ** here shows an example of how the circular queues should be set up based on the 5036 ** Intelligent I/O (I 2 O) Architecture Specification. 5037 ** Other ordering of the circular queues is possible. 5038 ** 5039 ** Queue Starting Address 5040 ** Inbound Free Queue QBAR 5041 ** Inbound Post Queue QBAR + Queue Size 5042 ** Outbound Post Queue QBAR + 2 * Queue Size 5043 ** Outbound Free Queue QBAR + 3 * Queue Size 5044 ** =================================================================================== 5045 ** Inbound Post Queue 5046 ** ------------------ 5047 ** The Inbound Post Queue holds posted messages placed there by other processors for the Intel XScale core to process. 5048 ** This queue is read from the queue tail by the Intel XScale core. It is written to the queue head by external PCI agents. 5049 ** The tail pointer is maintained by the Intel XScale core. The head pointer is maintained by the MU hardware. 5050 ** For a PCI write transaction that accesses the Inbound Queue Port, 5051 ** the MU writes the data to the local memory location address in the Inbound Post Head Pointer Register. 5052 ** When the data written to the Inbound Queue Port is written to local memory, the MU hardware increments the Inbound Post Head Pointer Register. 5053 ** An Intel XScale core interrupt may be generated when the Inbound Post Queue is written. 5054 ** The Inbound Post Queue Interrupt bit in the Inbound Interrupt Status Register indicates the interrupt status. 5055 ** The interrupt is cleared when the Inbound Post Queue Interrupt bit is cleared. 5056 ** The interrupt can be masked by the Inbound Interrupt Mask Register. 5057 ** Software must be aware of the state of the Inbound Post Queue Interrupt Mask bit to guarantee 5058 ** that the full condition is recognized by the core processor. 5059 ** In addition, to guarantee that the queue does not get overwritten, 5060 ** software must process messages from the tail of the queue before incrementing the tail pointer and clearing this interrupt. 5061 ** Once cleared, an interrupt is NOT generated when the head and tail pointers remain unequal (i.e. queue status is Not Empty). 5062 ** Only a new message posting the in the inbound queue generates a new interrupt. 5063 ** Therefore, when software leaves any unprocessed messages in the post queue when the interrupt is cleared, 5064 ** software must retain the information that the Inbound Post queue status. 5065 ** From the time that the PCI write transaction is received until the data is written 5066 ** in local memory and the Inbound Post Head Pointer Register is incremented, 5067 ** any PCI transaction that attempts to access the Inbound Post Queue Port is signalled a Retry. 5068 ** The Intel XScale core may read messages from the Inbound Post Queue 5069 ** by reading the data from the local memory location pointed to by the Inbound Post Tail Pointer Register. 5070 ** The Intel XScale core must then increment the Inbound Post Tail Pointer Register. 5071 ** When the Inbound Post Queue is full (head and tail pointers are equal and the head pointer was last updated by hardware), 5072 ** the hardware retries any PCI writes until a slot in the queue becomes available. 5073 ** A slot in the post queue becomes available by the Intel XScale core incrementing the tail pointer. 5074 ** =================================================================================== 5075 ** Inbound Free Queue 5076 ** ------------------ 5077 ** The Inbound Free Queue holds free inbound messages placed there by the Intel XScale core for other processors to use. 5078 ** This queue is read from the queue tail by external PCI agents. 5079 ** It is written to the queue head by the Intel XScale core. 5080 ** The tail pointer is maintained by the MU hardware. 5081 ** The head pointer is maintained by the Intel XScale core. 5082 ** For a PCI read transaction that accesses the Inbound Queue Port, 5083 ** the MU attempts to read the data at the local memory address in the Inbound Free Tail Pointer. 5084 ** When the queue is not empty (head and tail pointers are not equal) 5085 ** or full (head and tail pointers are equal but the head pointer was last written by software), the data is returned. 5086 ** When the queue is empty (head and tail pointers are equal and the head pointer was last updated by hardware), 5087 ** the value of -1 (FFFF.FFFFH) is returned. 5088 ** When the queue was not empty and the MU succeeded in returning the data at the tail, 5089 ** the MU hardware must increment the value in the Inbound Free Tail Pointer Register. 5090 ** To reduce latency for the PCI read access, the MU implements a prefetch mechanism to anticipate accesses to the Inbound Free Queue. 5091 ** The MU hardware prefetches the data at the tail of the Inbound Free Queue and load it into an internal prefetch register. 5092 ** When the PCI read access occurs, the data is read directly from the prefetch register. 5093 ** The prefetch mechanism loads a value of -1 (FFFF.FFFFH) into the prefetch register 5094 ** when the head and tail pointers are equal and the queue is empty. 5095 ** In order to update the prefetch register when messages are added to the queue and it becomes non-empty, 5096 ** the prefetch mechanism automatically starts a prefetch when the prefetch register contains FFFF.FFFFH 5097 ** and the Inbound Free Head Pointer Register is written. 5098 ** The Intel XScale core needs to update the Inbound Free Head Pointer Register when it adds messages to the queue. 5099 ** A prefetch must appear atomic from the perspective of the external PCI agent. 5100 ** 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. 5101 ** The Intel XScale core may place messages in the Inbound Free Queue by writing the data to the 5102 ** local memory location pointed to by the Inbound Free Head Pointer Register. 5103 ** The processor must then increment the Inbound Free Head Pointer Register. 5104 ** ================================================================================== 5105 ** Outbound Post Queue 5106 ** ------------------- 5107 ** The Outbound Post Queue holds outbound posted messages placed there by the Intel XScale 5108 ** core for other processors to process. This queue is read from the queue tail by external PCI agents. 5109 ** It is written to the queue head by the Intel XScale core. The tail pointer is maintained by the 5110 ** MU hardware. The head pointer is maintained by the Intel XScale core. 5111 ** For a PCI read transaction that accesses the Outbound Queue Port, the MU attempts to read the 5112 ** data at the local memory address in the Outbound Post Tail Pointer Register. When the queue is not 5113 ** empty (head and tail pointers are not equal) or full (head and tail pointers are equal but the head 5114 ** pointer was last written by software), the data is returned. When the queue is empty (head and tail 5115 ** pointers are equal and the head pointer was last updated by hardware), the value of -1 5116 ** (FFFF.FFFFH) is returned. When the queue was not empty and the MU succeeded in returning the 5117 ** data at the tail, the MU hardware must increment the value in the Outbound Post Tail Pointer 5118 ** Register. 5119 ** To reduce latency for the PCI read access, the MU implements a prefetch mechanism to anticipate 5120 ** accesses to the Outbound Post Queue. The MU hardware prefetches the data at the tail of the 5121 ** Outbound Post Queue and load it into an internal prefetch register. When the PCI read access 5122 ** occurs, the data is read directly from the prefetch register. 5123 ** The prefetch mechanism loads a value of -1 (FFFF.FFFFH) into the prefetch register when the head 5124 ** and tail pointers are equal and the queue is empty. In order to update the prefetch register when 5125 ** messages are added to the queue and it becomes non-empty, the prefetch mechanism automatically 5126 ** starts a prefetch when the prefetch register contains FFFF.FFFFH and the Outbound Post Head 5127 ** Pointer Register is written. The Intel XScale core needs to update the Outbound Post Head 5128 ** Pointer Register when it adds messages to the queue. 5129 ** A prefetch must appear atomic from the perspective of the external PCI agent. When a prefetch is 5130 ** started, any PCI transaction that attempts to access the Outbound Post Queue is signalled a Retry 5131 ** until the prefetch is completed. 5132 ** A PCI interrupt may be generated when data in the prefetch buffer is valid. When the prefetch 5133 ** queue is clear, no interrupt is generated. The Outbound Post Queue Interrupt bit in the Outbound 5134 ** Interrupt Status Register shall indicate the status of the prefetch buffer data and therefore the 5135 ** interrupt status. The interrupt is cleared when any prefetched data has been read from the Outbound 5136 ** Queue Port. The interrupt can be masked by the Outbound Interrupt Mask Register. 5137 ** The Intel XScale core may place messages in the Outbound Post Queue by writing the data to 5138 ** the local memory address in the Outbound Post Head Pointer Register. The processor must then 5139 ** increment the Outbound Post Head Pointer Register. 5140 ** ================================================== 5141 ** Outbound Free Queue 5142 ** ----------------------- 5143 ** The Outbound Free Queue holds free messages placed there by other processors for the Intel 5144 ** XScale core to use. This queue is read from the queue tail by the Intel XScale core. It is 5145 ** written to the queue head by external PCI agents. The tail pointer is maintained by the Intel 5146 ** XScale core. The head pointer is maintained by the MU hardware. 5147 ** For a PCI write transaction that accesses the Outbound Queue Port, the MU writes the data to the 5148 ** local memory address in the Outbound Free Head Pointer Register. When the data written to the 5149 ** Outbound Queue Port is written to local memory, the MU hardware increments the Outbound Free 5150 ** Head Pointer Register. 5151 ** When the head pointer and the tail pointer become equal and the queue is full, the MU may signal 5152 ** an interrupt to the Intel XScale core to register the queue full condition. This interrupt is 5153 ** recorded in the Inbound Interrupt Status Register. The interrupt is cleared when the Outbound Free 5154 ** Queue Full Interrupt bit is cleared and not by writing to the head or tail pointers. The interrupt can 5155 ** be masked by the Inbound Interrupt Mask Register. Software must be aware of the state of the 5156 ** Outbound Free Queue Interrupt Mask bit to guarantee that the full condition is recognized by the 5157 ** core processor. 5158 ** From the time that a PCI write transaction is received until the data is written in local memory and 5159 ** the Outbound Free Head Pointer Register is incremented, any PCI transaction that attempts to 5160 ** access the Outbound Free Queue Port is signalled a retry. 5161 ** The Intel XScale core may read messages from the Outbound Free Queue by reading the data 5162 ** from the local memory address in the Outbound Free Tail Pointer Register. The processor must 5163 ** then increment the Outbound Free Tail Pointer Register. When the Outbound Free Queue is full, 5164 ** the hardware must retry any PCI writes until a slot in the queue becomes available. 5165 ** 5166 ** ================================================================================== 5167 ** Circular Queue Summary 5168 ** ---------------------- 5169 ** ________________________________________________________________________________________________________________________________________________ 5170 ** | Queue Name | PCI Port |Generate PCI Interrupt |Generate Intel Xscale Core Interrupt|Head Pointer maintained by|Tail Pointer maintained by| 5171 ** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________| 5172 ** |Inbound Post | Inbound Queue | | | | | 5173 ** | Queue | Port | NO | Yes, when queue is written | MU hardware | Intel XScale | 5174 ** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________| 5175 ** |Inbound Free | Inbound Queue | | | | | 5176 ** | Queue | Port | NO | NO | Intel XScale | MU hardware | 5177 ** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________| 5178 ** ================================================================================== 5179 ** Circular Queue Status Summary 5180 ** ---------------------- 5181 ** ____________________________________________________________________________________________________ 5182 ** | Queue Name | Queue Status | Head & Tail Pointer | Last Pointer Update | 5183 ** |_____________________|________________|_____________________|_______________________________________| 5184 ** | Inbound Post Queue | Empty | Equal | Tail pointer last updated by software | 5185 ** |_____________________|________________|_____________________|_______________________________________| 5186 ** | Inbound Free Queue | Empty | Equal | Head pointer last updated by hardware | 5187 ** |_____________________|________________|_____________________|_______________________________________| 5188 ************************************************************************** 5189 */ 5190 5191 /* 5192 ************************************************************************** 5193 ** Index Registers 5194 ** ======================== 5195 ** . 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. 5196 ** These registers are for inbound messages only. 5197 ** The interrupt is recorded in the Inbound Interrupt Status Register. 5198 ** The storage for the Index Registers is allocated from the 80331 local memory. 5199 ** PCI write accesses to the Index Registers write the data to local memory. 5200 ** PCI read accesses to the Index Registers read the data from local memory. 5201 ** . The local memory used for the Index Registers ranges from Inbound ATU Translate Value Register + 050H 5202 ** to Inbound ATU Translate Value Register + FFFH. 5203 ** . The address of the first write access is stored in the Index Address Register. 5204 ** This register is written during the earliest write access and provides a means to determine which Index Register was written. 5205 ** Once updated by the MU, the Index Address Register is not updated until the Index Register 5206 ** Interrupt bit in the Inbound Interrupt Status Register is cleared. 5207 ** . When the interrupt is cleared, the Index Address Register is re-enabled and stores the address of the next Index Register write access. 5208 ** Writes by the Intel XScale core to the local memory used by the Index Registers 5209 ** does not cause an interrupt and does not update the Index Address Register. 5210 ** . The index registers can be accessed with Multi-DWORD reads and single QWORD aligned writes. 5211 ************************************************************************** 5212 */ 5213 /* 5214 ************************************************************************** 5215 ** Messaging Unit Internal Bus Memory Map 5216 ** ======================================= 5217 ** Internal Bus Address___Register Description (Name)____________________|_PCI Configuration Space Register Number_ 5218 ** FFFF E300H reserved | 5219 ** .. .. | 5220 ** FFFF E30CH reserved | 5221 ** FFFF E310H Inbound Message Register 0 | Available through 5222 ** FFFF E314H Inbound Message Register 1 | ATU Inbound Translation Window 5223 ** FFFF E318H Outbound Message Register 0 | 5224 ** FFFF E31CH Outbound Message Register 1 | or 5225 ** FFFF E320H Inbound Doorbell Register | 5226 ** FFFF E324H Inbound Interrupt Status Register | must translate PCI address to 5227 ** FFFF E328H Inbound Interrupt Mask Register | the Intel Xscale Core 5228 ** FFFF E32CH Outbound Doorbell Register | Memory-Mapped Address 5229 ** FFFF E330H Outbound Interrupt Status Register | 5230 ** FFFF E334H Outbound Interrupt Mask Register | 5231 ** ______________________________________________________________________|________________________________________ 5232 ** FFFF E338H reserved | 5233 ** FFFF E33CH reserved | 5234 ** FFFF E340H reserved | 5235 ** FFFF E344H reserved | 5236 ** FFFF E348H reserved | 5237 ** FFFF E34CH reserved | 5238 ** FFFF E350H MU Configuration Register | 5239 ** FFFF E354H Queue Base Address Register | 5240 ** FFFF E358H reserved | 5241 ** FFFF E35CH reserved | must translate PCI address to 5242 ** FFFF E360H Inbound Free Head Pointer Register | the Intel Xscale Core 5243 ** FFFF E364H Inbound Free Tail Pointer Register | Memory-Mapped Address 5244 ** FFFF E368H Inbound Post Head pointer Register | 5245 ** FFFF E36CH Inbound Post Tail Pointer Register | 5246 ** FFFF E370H Outbound Free Head Pointer Register | 5247 ** FFFF E374H Outbound Free Tail Pointer Register | 5248 ** FFFF E378H Outbound Post Head pointer Register | 5249 ** FFFF E37CH Outbound Post Tail Pointer Register | 5250 ** FFFF E380H Index Address Register | 5251 ** FFFF E384H reserved | 5252 ** .. .. | 5253 ** FFFF E3FCH reserved | 5254 ** ______________________________________________________________________|_______________________________________ 5255 ************************************************************************** 5256 */ 5257 /* 5258 ************************************************************************** 5259 ** MU Configuration Register - MUCR FFFF.E350H 5260 ** 5261 ** . The MU Configuration Register (MUCR) contains the Circular Queue Enable bit and the size of one Circular Queue. 5262 ** . The Circular Queue Enable bit enables or disables the Circular Queues. 5263 ** The Circular Queues are disabled at reset to allow the software to initialize the head 5264 ** and tail pointer registers before any PCI accesses to the Queue Ports. 5265 ** . Each Circular Queue may range from 4 K entries (16 Kbytes) to 64 K entries (256 Kbytes) and there are four Circular Queues. 5266 ** ------------------------------------------------------------------------ 5267 ** Bit Default Description 5268 ** 31:06 000000H 00 2 Reserved 5269 ** 05:01 00001 2 Circular Queue Size - This field determines the size of each Circular Queue. 5270 ** All four queues are the same size. 5271 ** * 00001 2 - 4K Entries (16 Kbytes) 5272 ** * 00010 2 - 8K Entries (32 Kbytes) 5273 ** * 00100 2 - 16K Entries (64 Kbytes) 5274 ** * 01000 2 - 32K Entries (128 Kbytes) 5275 ** * 10000 2 - 64K Entries (256 Kbytes) 5276 ** 00 0 2 Circular Queue Enable - This bit enables or disables the Circular Queues. When clear the Circular 5277 ** Queues are disabled, however the MU accepts PCI accesses to the Circular Queue Ports but ignores 5278 ** the data for Writes and return FFFF.FFFFH for Reads. Interrupts are not generated to the core when 5279 ** disabled. When set, the Circular Queues are fully enabled. 5280 ************************************************************************** 5281 */ 5282 #define ARCMSR_MU_CONFIGURATION_REG 0xFFFFE350 5283 #define ARCMSR_MU_CIRCULAR_QUEUE_SIZE64K 0x0020 5284 #define ARCMSR_MU_CIRCULAR_QUEUE_SIZE32K 0x0010 5285 #define ARCMSR_MU_CIRCULAR_QUEUE_SIZE16K 0x0008 5286 #define ARCMSR_MU_CIRCULAR_QUEUE_SIZE8K 0x0004 5287 #define ARCMSR_MU_CIRCULAR_QUEUE_SIZE4K 0x0002 5288 #define ARCMSR_MU_CIRCULAR_QUEUE_ENABLE 0x0001 /*0:disable 1:enable*/ 5289 /* 5290 ************************************************************************** 5291 ** Queue Base Address Register - QBAR 5292 ** 5293 ** . The Queue Base Address Register (QBAR) contains the local memory address of the Circular Queues. 5294 ** The base address is required to be located on a 1 Mbyte address boundary. 5295 ** . All Circular Queue head and tail pointers are based on the QBAR. 5296 ** When the head and tail pointer registers are read, the Queue Base Address is returned in the upper 12 bits. 5297 ** 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. 5298 ** Warning: 5299 ** The QBAR must designate a range allocated to the 80331 DDR SDRAM interface 5300 ** ------------------------------------------------------------------------ 5301 ** Bit Default Description 5302 ** 31:20 000H Queue Base Address - Local memory address of the circular queues. 5303 ** 19:00 00000H Reserved 5304 ************************************************************************** 5305 */ 5306 #define ARCMSR_MU_QUEUE_BASE_ADDRESS_REG 0xFFFFE354 5307 /* 5308 ************************************************************************** 5309 ** Inbound Free Head Pointer Register - IFHPR 5310 ** 5311 ** . The Inbound Free Head Pointer Register (IFHPR) contains the local memory offset from 5312 ** the Queue Base Address of the head pointer for the Inbound Free Queue. 5313 ** The Head Pointer must be aligned on a DWORD address boundary. 5314 ** When read, the Queue Base Address is provided in the upper 12 bits of the register. 5315 ** Writes to the upper 12 bits of the register are ignored. 5316 ** This register is maintained by software. 5317 ** ------------------------------------------------------------------------ 5318 ** Bit Default Description 5319 ** 31:20 000H Queue Base Address - Local memory address of the circular queues. 5320 ** 19:02 0000H 00 2 Inbound Free Head Pointer - Local memory offset of the head pointer for the Inbound Free Queue. 5321 ** 01:00 00 2 Reserved 5322 ************************************************************************** 5323 */ 5324 #define ARCMSR_MU_INBOUND_FREE_HEAD_PTR_REG 0xFFFFE360 5325 /* 5326 ************************************************************************** 5327 ** Inbound Free Tail Pointer Register - IFTPR 5328 ** 5329 ** . The Inbound Free Tail Pointer Register (IFTPR) contains the local memory offset from the Queue 5330 ** Base Address of the tail pointer for the Inbound Free Queue. The Tail Pointer must be aligned on a 5331 ** DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits 5332 ** of the register. Writes to the upper 12 bits of the register are ignored. 5333 ** ------------------------------------------------------------------------ 5334 ** Bit Default Description 5335 ** 31:20 000H Queue Base Address - Local memory address of the circular queues. 5336 ** 19:02 0000H 00 2 Inbound Free Tail Pointer - Local memory offset of the tail pointer for the Inbound Free Queue. 5337 ** 01:00 00 2 Reserved 5338 ************************************************************************** 5339 */ 5340 #define ARCMSR_MU_INBOUND_FREE_TAIL_PTR_REG 0xFFFFE364 5341 /* 5342 ************************************************************************** 5343 ** Inbound Post Head Pointer Register - IPHPR 5344 ** 5345 ** . The Inbound Post Head Pointer Register (IPHPR) contains the local memory offset from the Queue 5346 ** Base Address of the head pointer for the Inbound Post Queue. The Head Pointer must be aligned on 5347 ** a DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits 5348 ** of the register. Writes to the upper 12 bits of the register are ignored. 5349 ** ------------------------------------------------------------------------ 5350 ** Bit Default Description 5351 ** 31:20 000H Queue Base Address - Local memory address of the circular queues. 5352 ** 19:02 0000H 00 2 Inbound Post Head Pointer - Local memory offset of the head pointer for the Inbound Post Queue. 5353 ** 01:00 00 2 Reserved 5354 ************************************************************************** 5355 */ 5356 #define ARCMSR_MU_INBOUND_POST_HEAD_PTR_REG 0xFFFFE368 5357 /* 5358 ************************************************************************** 5359 ** Inbound Post Tail Pointer Register - IPTPR 5360 ** 5361 ** . The Inbound Post Tail Pointer Register (IPTPR) contains the local memory offset from the Queue 5362 ** Base Address of the tail pointer for the Inbound Post Queue. The Tail Pointer must be aligned on a 5363 ** DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits 5364 ** of the register. Writes to the upper 12 bits of the register are ignored. 5365 ** ------------------------------------------------------------------------ 5366 ** Bit Default Description 5367 ** 31:20 000H Queue Base Address - Local memory address of the circular queues. 5368 ** 19:02 0000H 00 2 Inbound Post Tail Pointer - Local memory offset of the tail pointer for the Inbound Post Queue. 5369 ** 01:00 00 2 Reserved 5370 ************************************************************************** 5371 */ 5372 #define ARCMSR_MU_INBOUND_POST_TAIL_PTR_REG 0xFFFFE36C 5373 /* 5374 ************************************************************************** 5375 ** Index Address Register - IAR 5376 ** 5377 ** . The Index Address Register (IAR) contains the offset of the least recently accessed Index Register. 5378 ** It is written by the MU when the Index Registers are written by a PCI agent. 5379 ** The register is not updated until the Index Interrupt bit in the Inbound Interrupt Status Register is cleared. 5380 ** . The local memory address of the Index Register least recently accessed is computed 5381 ** by adding the Index Address Register to the Inbound ATU Translate Value Register. 5382 ** ------------------------------------------------------------------------ 5383 ** Bit Default Description 5384 ** 31:12 000000H Reserved 5385 ** 11:02 00H 00 2 Index Address - is the local memory offset of the Index Register written (050H to FFCH) 5386 ** 01:00 00 2 Reserved 5387 ************************************************************************** 5388 */ 5389 #define ARCMSR_MU_LOCAL_MEMORY_INDEX_REG 0xFFFFE380 /*1004 dwords 0x0050....0x0FFC, 4016 bytes 0x0050...0x0FFF*/ 5390 /* 5391 ********************************************************************************************************** 5392 ** RS-232 Interface for Areca Raid Controller 5393 ** The low level command interface is exclusive with VT100 terminal 5394 ** -------------------------------------------------------------------- 5395 ** 1. Sequence of command execution 5396 ** -------------------------------------------------------------------- 5397 ** (A) Header : 3 bytes sequence (0x5E, 0x01, 0x61) 5398 ** (B) Command block : variable length of data including length, command code, data and checksum byte 5399 ** (C) Return data : variable length of data 5400 ** -------------------------------------------------------------------- 5401 ** 2. Command block 5402 ** -------------------------------------------------------------------- 5403 ** (A) 1st byte : command block length (low byte) 5404 ** (B) 2nd byte : command block length (high byte) 5405 ** note ..command block length shouldn't > 2040 bytes, length excludes these two bytes 5406 ** (C) 3rd byte : command code 5407 ** (D) 4th and following bytes : variable length data bytes depends on command code 5408 ** (E) last byte : checksum byte (sum of 1st byte until last data byte) 5409 ** -------------------------------------------------------------------- 5410 ** 3. Command code and associated data 5411 ** -------------------------------------------------------------------- 5412 ** The following are command code defined in raid controller Command code 0x10--0x1? are used for system level management, 5413 ** no password checking is needed and should be implemented in separate well controlled utility and not for end user access. 5414 ** Command code 0x20--0x?? always check the password, password must be entered to enable these command. 5415 ** enum 5416 ** { 5417 ** GUI_SET_SERIAL=0x10, 5418 ** GUI_SET_VENDOR, 5419 ** GUI_SET_MODEL, 5420 ** GUI_IDENTIFY, 5421 ** GUI_CHECK_PASSWORD, 5422 ** GUI_LOGOUT, 5423 ** GUI_HTTP, 5424 ** GUI_SET_ETHERNET_ADDR, 5425 ** GUI_SET_LOGO, 5426 ** GUI_POLL_EVENT, 5427 ** GUI_GET_EVENT, 5428 ** GUI_GET_HW_MONITOR, 5429 ** 5430 ** // GUI_QUICK_CREATE=0x20, (function removed) 5431 ** GUI_GET_INFO_R=0x20, 5432 ** GUI_GET_INFO_V, 5433 ** GUI_GET_INFO_P, 5434 ** GUI_GET_INFO_S, 5435 ** GUI_CLEAR_EVENT, 5436 ** 5437 ** GUI_MUTE_BEEPER=0x30, 5438 ** GUI_BEEPER_SETTING, 5439 ** GUI_SET_PASSWORD, 5440 ** GUI_HOST_INTERFACE_MODE, 5441 ** GUI_REBUILD_PRIORITY, 5442 ** GUI_MAX_ATA_MODE, 5443 ** GUI_RESET_CONTROLLER, 5444 ** GUI_COM_PORT_SETTING, 5445 ** GUI_NO_OPERATION, 5446 ** GUI_DHCP_IP, 5447 ** 5448 ** GUI_CREATE_PASS_THROUGH=0x40, 5449 ** GUI_MODIFY_PASS_THROUGH, 5450 ** GUI_DELETE_PASS_THROUGH, 5451 ** GUI_IDENTIFY_DEVICE, 5452 ** 5453 ** GUI_CREATE_RAIDSET=0x50, 5454 ** GUI_DELETE_RAIDSET, 5455 ** GUI_EXPAND_RAIDSET, 5456 ** GUI_ACTIVATE_RAIDSET, 5457 ** GUI_CREATE_HOT_SPARE, 5458 ** GUI_DELETE_HOT_SPARE, 5459 ** 5460 ** GUI_CREATE_VOLUME=0x60, 5461 ** GUI_MODIFY_VOLUME, 5462 ** GUI_DELETE_VOLUME, 5463 ** GUI_START_CHECK_VOLUME, 5464 ** GUI_STOP_CHECK_VOLUME 5465 ** }; 5466 ** 5467 ** Command description : 5468 ** 5469 ** GUI_SET_SERIAL : Set the controller serial# 5470 ** byte 0,1 : length 5471 ** byte 2 : command code 0x10 5472 ** byte 3 : password length (should be 0x0f) 5473 ** byte 4-0x13 : should be "ArEcATecHnoLogY" 5474 ** byte 0x14--0x23 : Serial number string (must be 16 bytes) 5475 ** GUI_SET_VENDOR : Set vendor string for the controller 5476 ** byte 0,1 : length 5477 ** byte 2 : command code 0x11 5478 ** byte 3 : password length (should be 0x08) 5479 ** byte 4-0x13 : should be "ArEcAvAr" 5480 ** byte 0x14--0x3B : vendor string (must be 40 bytes) 5481 ** GUI_SET_MODEL : Set the model name of the controller 5482 ** byte 0,1 : length 5483 ** byte 2 : command code 0x12 5484 ** byte 3 : password length (should be 0x08) 5485 ** byte 4-0x13 : should be "ArEcAvAr" 5486 ** byte 0x14--0x1B : model string (must be 8 bytes) 5487 ** GUI_IDENTIFY : Identify device 5488 ** byte 0,1 : length 5489 ** byte 2 : command code 0x13 5490 ** return "Areca RAID Subsystem " 5491 ** GUI_CHECK_PASSWORD : Verify password 5492 ** byte 0,1 : length 5493 ** byte 2 : command code 0x14 5494 ** byte 3 : password length 5495 ** byte 4-0x?? : user password to be checked 5496 ** GUI_LOGOUT : Logout GUI (force password checking on next command) 5497 ** byte 0,1 : length 5498 ** byte 2 : command code 0x15 5499 ** GUI_HTTP : HTTP interface (reserved for Http proxy service)(0x16) 5500 ** 5501 ** GUI_SET_ETHERNET_ADDR : Set the ethernet MAC address 5502 ** byte 0,1 : length 5503 ** byte 2 : command code 0x17 5504 ** byte 3 : password length (should be 0x08) 5505 ** byte 4-0x13 : should be "ArEcAvAr" 5506 ** byte 0x14--0x19 : Ethernet MAC address (must be 6 bytes) 5507 ** GUI_SET_LOGO : Set logo in HTTP 5508 ** byte 0,1 : length 5509 ** byte 2 : command code 0x18 5510 ** byte 3 : Page# (0/1/2/3) (0xff --> clear OEM logo) 5511 ** byte 4/5/6/7 : 0x55/0xaa/0xa5/0x5a 5512 ** byte 8 : TITLE.JPG data (each page must be 2000 bytes) 5513 ** note .... page0 1st 2 byte must be actual length of the JPG file 5514 ** GUI_POLL_EVENT : Poll If Event Log Changed 5515 ** byte 0,1 : length 5516 ** byte 2 : command code 0x19 5517 ** GUI_GET_EVENT : Read Event 5518 ** byte 0,1 : length 5519 ** byte 2 : command code 0x1a 5520 ** byte 3 : Event Page (0:1st page/1/2/3:last page) 5521 ** GUI_GET_HW_MONITOR : Get HW monitor data 5522 ** byte 0,1 : length 5523 ** byte 2 : command code 0x1b 5524 ** byte 3 : # of FANs(example 2) 5525 ** byte 4 : # of Voltage sensor(example 3) 5526 ** byte 5 : # of temperature sensor(example 2) 5527 ** byte 6 : # of power 5528 ** byte 7/8 : Fan#0 (RPM) 5529 ** byte 9/10 : Fan#1 5530 ** byte 11/12 : Voltage#0 original value in *1000 5531 ** byte 13/14 : Voltage#0 value 5532 ** byte 15/16 : Voltage#1 org 5533 ** byte 17/18 : Voltage#1 5534 ** byte 19/20 : Voltage#2 org 5535 ** byte 21/22 : Voltage#2 5536 ** byte 23 : Temp#0 5537 ** byte 24 : Temp#1 5538 ** byte 25 : Power indicator (bit0 : power#0, bit1 : power#1) 5539 ** byte 26 : UPS indicator 5540 ** GUI_QUICK_CREATE : Quick create raid/volume set 5541 ** byte 0,1 : length 5542 ** byte 2 : command code 0x20 5543 ** byte 3/4/5/6 : raw capacity 5544 ** byte 7 : raid level 5545 ** byte 8 : stripe size 5546 ** byte 9 : spare 5547 ** byte 10/11/12/13: device mask (the devices to create raid/volume) 5548 ** This function is removed, application like to implement quick create function 5549 ** need to use GUI_CREATE_RAIDSET and GUI_CREATE_VOLUMESET function. 5550 ** GUI_GET_INFO_R : Get Raid Set Information 5551 ** byte 0,1 : length 5552 ** byte 2 : command code 0x20 5553 ** byte 3 : raidset# 5554 ** 5555 ** typedef struct sGUI_RAIDSET 5556 ** { 5557 ** BYTE grsRaidSetName[16]; 5558 ** DWORD grsCapacity; 5559 ** DWORD grsCapacityX; 5560 ** DWORD grsFailMask; 5561 ** BYTE grsDevArray[32]; 5562 ** BYTE grsMemberDevices; 5563 ** BYTE grsNewMemberDevices; 5564 ** BYTE grsRaidState; 5565 ** BYTE grsVolumes; 5566 ** BYTE grsVolumeList[16]; 5567 ** BYTE grsRes1; 5568 ** BYTE grsRes2; 5569 ** BYTE grsRes3; 5570 ** BYTE grsFreeSegments; 5571 ** DWORD grsRawStripes[8]; 5572 ** DWORD grsRes4; 5573 ** DWORD grsRes5; // Total to 128 bytes 5574 ** DWORD grsRes6; // Total to 128 bytes 5575 ** } sGUI_RAIDSET, *pGUI_RAIDSET; 5576 ** GUI_GET_INFO_V : Get Volume Set Information 5577 ** byte 0,1 : length 5578 ** byte 2 : command code 0x21 5579 ** byte 3 : volumeset# 5580 ** 5581 ** typedef struct sGUI_VOLUMESET 5582 ** { 5583 ** BYTE gvsVolumeName[16]; // 16 5584 ** DWORD gvsCapacity; 5585 ** DWORD gvsCapacityX; 5586 ** DWORD gvsFailMask; 5587 ** DWORD gvsStripeSize; 5588 ** DWORD gvsNewFailMask; 5589 ** DWORD gvsNewStripeSize; 5590 ** DWORD gvsVolumeStatus; 5591 ** DWORD gvsProgress; // 32 5592 ** sSCSI_ATTR gvsScsi; 5593 ** BYTE gvsMemberDisks; 5594 ** BYTE gvsRaidLevel; // 8 5595 ** 5596 ** BYTE gvsNewMemberDisks; 5597 ** BYTE gvsNewRaidLevel; 5598 ** BYTE gvsRaidSetNumber; 5599 ** BYTE gvsRes0; // 4 5600 ** BYTE gvsRes1[4]; // 64 bytes 5601 ** } sGUI_VOLUMESET, *pGUI_VOLUMESET; 5602 ** 5603 ** GUI_GET_INFO_P : Get Physical Drive Information 5604 ** byte 0,1 : length 5605 ** byte 2 : command code 0x22 5606 ** byte 3 : drive # (from 0 to max-channels - 1) 5607 ** 5608 ** typedef struct sGUI_PHY_DRV 5609 ** { 5610 ** BYTE gpdModelName[40]; 5611 ** BYTE gpdSerialNumber[20]; 5612 ** BYTE gpdFirmRev[8]; 5613 ** DWORD gpdCapacity; 5614 ** DWORD gpdCapacityX; // Reserved for expansion 5615 ** BYTE gpdDeviceState; 5616 ** BYTE gpdPioMode; 5617 ** BYTE gpdCurrentUdmaMode; 5618 ** BYTE gpdUdmaMode; 5619 ** BYTE gpdDriveSelect; 5620 ** BYTE gpdRaidNumber; // 0xff if not belongs to a raid set 5621 ** sSCSI_ATTR gpdScsi; 5622 ** BYTE gpdReserved[40]; // Total to 128 bytes 5623 ** } sGUI_PHY_DRV, *pGUI_PHY_DRV; 5624 ** 5625 ** GUI_GET_INFO_S : Get System Information 5626 ** byte 0,1 : length 5627 ** byte 2 : command code 0x23 5628 ** 5629 ** typedef struct sCOM_ATTR 5630 ** { 5631 ** BYTE comBaudRate; 5632 ** BYTE comDataBits; 5633 ** BYTE comStopBits; 5634 ** BYTE comParity; 5635 ** BYTE comFlowControl; 5636 ** } sCOM_ATTR, *pCOM_ATTR; 5637 ** 5638 ** typedef struct sSYSTEM_INFO 5639 ** { 5640 ** BYTE gsiVendorName[40]; 5641 ** BYTE gsiSerialNumber[16]; 5642 ** BYTE gsiFirmVersion[16]; 5643 ** BYTE gsiBootVersion[16]; 5644 ** BYTE gsiMbVersion[16]; 5645 ** BYTE gsiModelName[8]; 5646 ** BYTE gsiLocalIp[4]; 5647 ** BYTE gsiCurrentIp[4]; 5648 ** DWORD gsiTimeTick; 5649 ** DWORD gsiCpuSpeed; 5650 ** DWORD gsiICache; 5651 ** DWORD gsiDCache; 5652 ** DWORD gsiScache; 5653 ** DWORD gsiMemorySize; 5654 ** DWORD gsiMemorySpeed; 5655 ** DWORD gsiEvents; 5656 ** BYTE gsiMacAddress[6]; 5657 ** BYTE gsiDhcp; 5658 ** BYTE gsiBeeper; 5659 ** BYTE gsiChannelUsage; 5660 ** BYTE gsiMaxAtaMode; 5661 ** BYTE gsiSdramEcc; // 1:if ECC enabled 5662 ** BYTE gsiRebuildPriority; 5663 ** sCOM_ATTR gsiComA; // 5 bytes 5664 ** sCOM_ATTR gsiComB; // 5 bytes 5665 ** BYTE gsiIdeChannels; 5666 ** BYTE gsiScsiHostChannels; 5667 ** BYTE gsiIdeHostChannels; 5668 ** BYTE gsiMaxVolumeSet; 5669 ** BYTE gsiMaxRaidSet; 5670 ** BYTE gsiEtherPort; // 1:if ether net port supported 5671 ** BYTE gsiRaid6Engine; // 1:Raid6 engine supported 5672 ** BYTE gsiRes[75]; 5673 ** } sSYSTEM_INFO, *pSYSTEM_INFO; 5674 ** 5675 ** GUI_CLEAR_EVENT : Clear System Event 5676 ** byte 0,1 : length 5677 ** byte 2 : command code 0x24 5678 ** 5679 ** GUI_MUTE_BEEPER : Mute current beeper 5680 ** byte 0,1 : length 5681 ** byte 2 : command code 0x30 5682 ** 5683 ** GUI_BEEPER_SETTING : Disable beeper 5684 ** byte 0,1 : length 5685 ** byte 2 : command code 0x31 5686 ** byte 3 : 0->disable, 1->enable 5687 ** 5688 ** GUI_SET_PASSWORD : Change password 5689 ** byte 0,1 : length 5690 ** byte 2 : command code 0x32 5691 ** byte 3 : pass word length ( must <= 15 ) 5692 ** byte 4 : password (must be alpha-numerical) 5693 ** 5694 ** GUI_HOST_INTERFACE_MODE : Set host interface mode 5695 ** byte 0,1 : length 5696 ** byte 2 : command code 0x33 5697 ** byte 3 : 0->Independent, 1->cluster 5698 ** 5699 ** GUI_REBUILD_PRIORITY : Set rebuild priority 5700 ** byte 0,1 : length 5701 ** byte 2 : command code 0x34 5702 ** byte 3 : 0/1/2/3 (low->high) 5703 ** 5704 ** GUI_MAX_ATA_MODE : Set maximum ATA mode to be used 5705 ** byte 0,1 : length 5706 ** byte 2 : command code 0x35 5707 ** byte 3 : 0/1/2/3 (133/100/66/33) 5708 ** 5709 ** GUI_RESET_CONTROLLER : Reset Controller 5710 ** byte 0,1 : length 5711 ** byte 2 : command code 0x36 5712 ** *Response with VT100 screen (discard it) 5713 ** 5714 ** GUI_COM_PORT_SETTING : COM port setting 5715 ** byte 0,1 : length 5716 ** byte 2 : command code 0x37 5717 ** byte 3 : 0->COMA (term port), 1->COMB (debug port) 5718 ** byte 4 : 0/1/2/3/4/5/6/7 (1200/2400/4800/9600/19200/38400/57600/115200) 5719 ** byte 5 : data bit (0:7 bit, 1:8 bit : must be 8 bit) 5720 ** byte 6 : stop bit (0:1, 1:2 stop bits) 5721 ** byte 7 : parity (0:none, 1:off, 2:even) 5722 ** byte 8 : flow control (0:none, 1:xon/xoff, 2:hardware => must use none) 5723 ** 5724 ** GUI_NO_OPERATION : No operation 5725 ** byte 0,1 : length 5726 ** byte 2 : command code 0x38 5727 ** 5728 ** GUI_DHCP_IP : Set DHCP option and local IP address 5729 ** byte 0,1 : length 5730 ** byte 2 : command code 0x39 5731 ** byte 3 : 0:dhcp disabled, 1:dhcp enabled 5732 ** byte 4/5/6/7 : IP address 5733 ** 5734 ** GUI_CREATE_PASS_THROUGH : Create pass through disk 5735 ** byte 0,1 : length 5736 ** byte 2 : command code 0x40 5737 ** byte 3 : device # 5738 ** byte 4 : scsi channel (0/1) 5739 ** byte 5 : scsi id (0-->15) 5740 ** byte 6 : scsi lun (0-->7) 5741 ** byte 7 : tagged queue (1 : enabled) 5742 ** byte 8 : cache mode (1 : enabled) 5743 ** byte 9 : max speed (0/1/2/3/4, async/20/40/80/160 for scsi) 5744 ** (0/1/2/3/4, 33/66/100/133/150 for ide ) 5745 ** 5746 ** GUI_MODIFY_PASS_THROUGH : Modify pass through disk 5747 ** byte 0,1 : length 5748 ** byte 2 : command code 0x41 5749 ** byte 3 : device # 5750 ** byte 4 : scsi channel (0/1) 5751 ** byte 5 : scsi id (0-->15) 5752 ** byte 6 : scsi lun (0-->7) 5753 ** byte 7 : tagged queue (1 : enabled) 5754 ** byte 8 : cache mode (1 : enabled) 5755 ** byte 9 : max speed (0/1/2/3/4, async/20/40/80/160 for scsi) 5756 ** (0/1/2/3/4, 33/66/100/133/150 for ide ) 5757 ** 5758 ** GUI_DELETE_PASS_THROUGH : Delete pass through disk 5759 ** byte 0,1 : length 5760 ** byte 2 : command code 0x42 5761 ** byte 3 : device# to be deleted 5762 ** 5763 ** GUI_IDENTIFY_DEVICE : Identify Device 5764 ** byte 0,1 : length 5765 ** byte 2 : command code 0x43 5766 ** byte 3 : Flash Method(0:flash selected, 1:flash not selected) 5767 ** byte 4/5/6/7 : IDE device mask to be flashed 5768 ** note .... no response data available 5769 ** 5770 ** GUI_CREATE_RAIDSET : Create Raid Set 5771 ** byte 0,1 : length 5772 ** byte 2 : command code 0x50 5773 ** byte 3/4/5/6 : device mask 5774 ** byte 7-22 : raidset name (if byte 7 == 0:use default) 5775 ** 5776 ** GUI_DELETE_RAIDSET : Delete Raid Set 5777 ** byte 0,1 : length 5778 ** byte 2 : command code 0x51 5779 ** byte 3 : raidset# 5780 ** 5781 ** GUI_EXPAND_RAIDSET : Expand Raid Set 5782 ** byte 0,1 : length 5783 ** byte 2 : command code 0x52 5784 ** byte 3 : raidset# 5785 ** byte 4/5/6/7 : device mask for expansion 5786 ** 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 ) 5787 ** byte 11/12/13 : repeat for each volume in the raidset .... 5788 ** 5789 ** GUI_ACTIVATE_RAIDSET : Activate incomplete raid set 5790 ** byte 0,1 : length 5791 ** byte 2 : command code 0x53 5792 ** byte 3 : raidset# 5793 ** 5794 ** GUI_CREATE_HOT_SPARE : Create hot spare disk 5795 ** byte 0,1 : length 5796 ** byte 2 : command code 0x54 5797 ** byte 3/4/5/6 : device mask for hot spare creation 5798 ** 5799 ** GUI_DELETE_HOT_SPARE : Delete hot spare disk 5800 ** byte 0,1 : length 5801 ** byte 2 : command code 0x55 5802 ** byte 3/4/5/6 : device mask for hot spare deletion 5803 ** 5804 ** GUI_CREATE_VOLUME : Create volume set 5805 ** byte 0,1 : length 5806 ** byte 2 : command code 0x60 5807 ** byte 3 : raidset# 5808 ** byte 4-19 : volume set name (if byte4 == 0, use default) 5809 ** byte 20-27 : volume capacity (blocks) 5810 ** byte 28 : raid level 5811 ** byte 29 : stripe size (0/1/2/3/4/5->4/8/16/32/64/128K) 5812 ** byte 30 : channel 5813 ** byte 31 : ID 5814 ** byte 32 : LUN 5815 ** byte 33 : 1 enable tag 5816 ** byte 34 : 1 enable cache 5817 ** byte 35 : speed (0/1/2/3/4->async/20/40/80/160 for scsi) 5818 ** (0/1/2/3/4->33/66/100/133/150 for IDE ) 5819 ** byte 36 : 1 to select quick init 5820 ** 5821 ** GUI_MODIFY_VOLUME : Modify volume Set 5822 ** byte 0,1 : length 5823 ** byte 2 : command code 0x61 5824 ** byte 3 : volumeset# 5825 ** byte 4-19 : new volume set name (if byte4 == 0, not change) 5826 ** byte 20-27 : new volume capacity (reserved) 5827 ** byte 28 : new raid level 5828 ** byte 29 : new stripe size (0/1/2/3/4/5->4/8/16/32/64/128K) 5829 ** byte 30 : new channel 5830 ** byte 31 : new ID 5831 ** byte 32 : new LUN 5832 ** byte 33 : 1 enable tag 5833 ** byte 34 : 1 enable cache 5834 ** byte 35 : speed (0/1/2/3/4->async/20/40/80/160 for scsi) 5835 ** (0/1/2/3/4->33/66/100/133/150 for IDE ) 5836 ** 5837 ** GUI_DELETE_VOLUME : Delete volume set 5838 ** byte 0,1 : length 5839 ** byte 2 : command code 0x62 5840 ** byte 3 : volumeset# 5841 ** 5842 ** GUI_START_CHECK_VOLUME : Start volume consistency check 5843 ** byte 0,1 : length 5844 ** byte 2 : command code 0x63 5845 ** byte 3 : volumeset# 5846 ** 5847 ** GUI_STOP_CHECK_VOLUME : Stop volume consistency check 5848 ** byte 0,1 : length 5849 ** byte 2 : command code 0x64 5850 ** --------------------------------------------------------------------- 5851 ** 4. Returned data 5852 ** --------------------------------------------------------------------- 5853 ** (A) Header : 3 bytes sequence (0x5E, 0x01, 0x61) 5854 ** (B) Length : 2 bytes (low byte 1st, excludes length and checksum byte) 5855 ** (C) status or data : 5856 ** <1> If length == 1 ==> 1 byte status code 5857 ** #define GUI_OK 0x41 5858 ** #define GUI_RAIDSET_NOT_NORMAL 0x42 5859 ** #define GUI_VOLUMESET_NOT_NORMAL 0x43 5860 ** #define GUI_NO_RAIDSET 0x44 5861 ** #define GUI_NO_VOLUMESET 0x45 5862 ** #define GUI_NO_PHYSICAL_DRIVE 0x46 5863 ** #define GUI_PARAMETER_ERROR 0x47 5864 ** #define GUI_UNSUPPORTED_COMMAND 0x48 5865 ** #define GUI_DISK_CONFIG_CHANGED 0x49 5866 ** #define GUI_INVALID_PASSWORD 0x4a 5867 ** #define GUI_NO_DISK_SPACE 0x4b 5868 ** #define GUI_CHECKSUM_ERROR 0x4c 5869 ** #define GUI_PASSWORD_REQUIRED 0x4d 5870 ** <2> If length > 1 ==> data block returned from controller and the contents depends on the command code 5871 ** (E) Checksum : checksum of length and status or data byte 5872 ************************************************************************** 5873 */ 5874