/*1********************************************************************************2** OS : FreeBSD3** FILE NAME : arcmsr.h4** BY : Erich Chen, Ching Huang5** Description: SCSI RAID Device Driver for6** ARECA (ARC11XX/ARC12XX/ARC13XX/ARC16XX/ARC188x)7** SATA/SAS RAID HOST Adapter8********************************************************************************9********************************************************************************10** SPDX-License-Identifier: BSD-3-Clause11**12** Copyright (C) 2002 - 2012, Areca Technology Corporation All rights reserved.13**14** Redistribution and use in source and binary forms,with or without15** modification,are permitted provided that the following conditions16** are met:17** 1. Redistributions of source code must retain the above copyright18** notice,this list of conditions and the following disclaimer.19** 2. Redistributions in binary form must reproduce the above copyright20** notice,this list of conditions and the following disclaimer in the21** documentation and/or other materials provided with the distribution.22** 3. The name of the author may not be used to endorse or promote products23** derived from this software without specific prior written permission.24**25** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR26** IMPLIED WARRANTIES,INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES27** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.28** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,INDIRECT,29** INCIDENTAL,SPECIAL,EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT30** NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,31** DATA,OR PROFITS; OR BUSINESS INTERRUPTION)HOWEVER CAUSED AND ON ANY32** THEORY OF LIABILITY,WHETHER IN CONTRACT,STRICT LIABILITY,OR TORT33**(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY OUT OF THE USE OF34** THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.35**************************************************************************36*/37#define ARCMSR_SCSI_INITIATOR_ID 25538#define ARCMSR_DEV_SECTOR_SIZE 51239#define ARCMSR_MAX_XFER_SECTORS 409640#define ARCMSR_MAX_TARGETID 17 /*16 max target id + 1*/41#define ARCMSR_MAX_TARGETLUN 8 /*8*/42#define ARCMSR_VIRTUAL_DEVICE_ID (ARCMSR_MAX_TARGETID - 1)43#define ARCMSR_MAX_CHIPTYPE_NUM 444#define ARCMSR_MAX_OUTSTANDING_CMD 25645#define ARCMSR_MAX_START_JOB 25646#define ARCMSR_MAX_CMD_PERLUN ARCMSR_MAX_OUTSTANDING_CMD47#define ARCMSR_MAX_FREESRB_NUM 38448#define ARCMSR_MAX_QBUFFER 4096 /* ioctl QBUFFER */49#define ARCMSR_MAX_SG_ENTRIES 38 /* max 38*/50#define ARCMSR_MAX_ADAPTER 451#define ARCMSR_RELEASE_SIMQ_LEVEL 23052#define ARCMSR_MAX_HBB_POSTQUEUE 264 /* (ARCMSR_MAX_OUTSTANDING_CMD+8) */53#define ARCMSR_MAX_HBD_POSTQUEUE 25654#define ARCMSR_TIMEOUT_DELAY 60 /* in sec */55#define ARCMSR_NUM_MSIX_VECTORS 456/*57*********************************************************************58*/59#ifndef TRUE60#define TRUE 161#endif62#ifndef FALSE63#define FALSE 064#endif65#ifndef INTR_ENTROPY66# define INTR_ENTROPY 067#endif6869#ifndef offsetof70#define offsetof(type, member) ((size_t)(&((type *)0)->member))71#endif7273#define ARCMSR_LOCK_INIT(l, s) mtx_init(l, s, NULL, MTX_DEF)74#define ARCMSR_LOCK_DESTROY(l) mtx_destroy(l)75#define ARCMSR_LOCK_ACQUIRE(l) mtx_lock(l)76#define ARCMSR_LOCK_RELEASE(l) mtx_unlock(l)77#define ARCMSR_LOCK_TRY(l) mtx_trylock(l)78#define arcmsr_htole32(x) htole32(x)79typedef struct mtx arcmsr_lock_t;8081/*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_1883 0x1883 /* Device ID */112#define PCI_DEVICE_ID_ARECA_1884 0x1884 /* Device ID */113114#define ARECA_SUB_DEV_ID_1880 0x1880 /* Subsystem Device ID */115#define ARECA_SUB_DEV_ID_1882 0x1882 /* Subsystem Device ID */116#define ARECA_SUB_DEV_ID_1883 0x1883 /* Subsystem Device ID */117#define ARECA_SUB_DEV_ID_1884 0x1884 /* Subsystem Device ID */118#define ARECA_SUB_DEV_ID_1212 0x1212 /* Subsystem Device ID */119#define ARECA_SUB_DEV_ID_1213 0x1213 /* Subsystem Device ID */120#define ARECA_SUB_DEV_ID_1214 0x1214 /* Subsystem Device ID */121#define ARECA_SUB_DEV_ID_1216 0x1216 /* Subsystem Device ID */122#define ARECA_SUB_DEV_ID_1222 0x1222 /* Subsystem Device ID */123#define ARECA_SUB_DEV_ID_1223 0x1223 /* Subsystem Device ID */124#define ARECA_SUB_DEV_ID_1224 0x1224 /* Subsystem Device ID */125#define ARECA_SUB_DEV_ID_1226 0x1226 /* Subsystem Device ID */126127#define PCIDevVenIDARC1110 0x111017D3 /* Vendor Device ID */128#define PCIDevVenIDARC1120 0x112017D3 /* Vendor Device ID */129#define PCIDevVenIDARC1130 0x113017D3 /* Vendor Device ID */130#define PCIDevVenIDARC1160 0x116017D3 /* Vendor Device ID */131#define PCIDevVenIDARC1170 0x117017D3 /* Vendor Device ID */132#define PCIDevVenIDARC1200 0x120017D3 /* Vendor Device ID */133#define PCIDevVenIDARC1201 0x120117D3 /* Vendor Device ID */134#define PCIDevVenIDARC1203 0x120317D3 /* Vendor Device ID */135#define PCIDevVenIDARC1210 0x121017D3 /* Vendor Device ID */136#define PCIDevVenIDARC1212 0x121217D3 /* Vendor Device ID */137#define PCIDevVenIDARC1213 0x121317D3 /* Vendor Device ID */138#define PCIDevVenIDARC1214 0x121417D3 /* Vendor Device ID */139#define PCIDevVenIDARC1220 0x122017D3 /* Vendor Device ID */140#define PCIDevVenIDARC1222 0x122217D3 /* Vendor Device ID */141#define PCIDevVenIDARC1223 0x122317D3 /* Vendor Device ID */142#define PCIDevVenIDARC1224 0x122417D3 /* Vendor Device ID */143#define PCIDevVenIDARC1230 0x123017D3 /* Vendor Device ID */144#define PCIDevVenIDARC1231 0x123117D3 /* Vendor Device ID */145#define PCIDevVenIDARC1260 0x126017D3 /* Vendor Device ID */146#define PCIDevVenIDARC1261 0x126117D3 /* Vendor Device ID */147#define PCIDevVenIDARC1270 0x127017D3 /* Vendor Device ID */148#define PCIDevVenIDARC1280 0x128017D3 /* Vendor Device ID */149#define PCIDevVenIDARC1380 0x138017D3 /* Vendor Device ID */150#define PCIDevVenIDARC1381 0x138117D3 /* Vendor Device ID */151#define PCIDevVenIDARC1680 0x168017D3 /* Vendor Device ID */152#define PCIDevVenIDARC1681 0x168117D3 /* Vendor Device ID */153#define PCIDevVenIDARC1880 0x188017D3 /* Vendor Device ID */154#define PCIDevVenIDARC1882 0x188217D3 /* Vendor Device ID */155#define PCIDevVenIDARC1883 0x188317D3 /* Vendor Device ID */156#define PCIDevVenIDARC1884 0x188417D3 /* Vendor Device ID */157#define PCIDevVenIDARC1886_0 0x188617D3 /* Vendor Device ID */158#define PCIDevVenIDARC1886_ 0x188917D3 /* Vendor Device ID */159#define PCIDevVenIDARC1886 0x188A17D3 /* Vendor Device ID */160161#ifndef PCIR_BARS162#define PCIR_BARS 0x10163#define PCIR_BAR(x) (PCIR_BARS + (x) * 4)164#endif165166#define PCI_BASE_ADDR0 0x10167#define PCI_BASE_ADDR1 0x14168#define PCI_BASE_ADDR2 0x18169#define PCI_BASE_ADDR3 0x1C170#define PCI_BASE_ADDR4 0x20171#define PCI_BASE_ADDR5 0x24172/*173**********************************************************************************174**175**********************************************************************************176*/177#define ARCMSR_SCSICMD_IOCTL 0x77178#define ARCMSR_CDEVSW_IOCTL 0x88179#define ARCMSR_MESSAGE_FAIL 0x0001180#define ARCMSR_MESSAGE_SUCCESS 0x0000181/*182**********************************************************************************183**184**********************************************************************************185*/186#define arcmsr_ccbsrb_ptr spriv_ptr0187#define arcmsr_ccbacb_ptr spriv_ptr1188#define dma_addr_hi32(addr) (u_int32_t) ((addr>>16)>>16)189#define dma_addr_lo32(addr) (u_int32_t) (addr & 0xffffffff)190#define get_min(x,y) ((x) < (y) ? (x) : (y))191#define get_max(x,y) ((x) < (y) ? (y) : (x))192/*193**************************************************************************194**************************************************************************195*/196#define CHIP_REG_READ32(s, b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r))197#define CHIP_REG_WRITE32(s, b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], offsetof(struct s, r), d)198#define READ_CHIP_REG32(b, r) bus_space_read_4(acb->btag[b], acb->bhandle[b], r)199#define WRITE_CHIP_REG32(b, r, d) bus_space_write_4(acb->btag[b], acb->bhandle[b], r, d)200/*201**********************************************************************************202** IOCTL CONTROL Mail Box203**********************************************************************************204*/205struct CMD_MESSAGE {206u_int32_t HeaderLength;207u_int8_t Signature[8];208u_int32_t Timeout;209u_int32_t ControlCode;210u_int32_t ReturnCode;211u_int32_t Length;212};213214struct CMD_MESSAGE_FIELD {215struct CMD_MESSAGE cmdmessage; /* ioctl header */216u_int8_t messagedatabuffer[1032]; /* areca gui program does not accept more than 1031 byte */217};218219/************************************************************************/220/************************************************************************/221222#define ARCMSR_IOP_ERROR_ILLEGALPCI 0x0001223#define ARCMSR_IOP_ERROR_VENDORID 0x0002224#define ARCMSR_IOP_ERROR_DEVICEID 0x0002225#define ARCMSR_IOP_ERROR_ILLEGALCDB 0x0003226#define ARCMSR_IOP_ERROR_UNKNOW_CDBERR 0x0004227#define ARCMSR_SYS_ERROR_MEMORY_ALLOCATE 0x0005228#define ARCMSR_SYS_ERROR_MEMORY_CROSS4G 0x0006229#define ARCMSR_SYS_ERROR_MEMORY_LACK 0x0007230#define ARCMSR_SYS_ERROR_MEMORY_RANGE 0x0008231#define ARCMSR_SYS_ERROR_DEVICE_BASE 0x0009232#define ARCMSR_SYS_ERROR_PORT_VALIDATE 0x000A233234/*DeviceType*/235#define ARECA_SATA_RAID 0x90000000236237/*FunctionCode*/238#define FUNCTION_READ_RQBUFFER 0x0801239#define FUNCTION_WRITE_WQBUFFER 0x0802240#define FUNCTION_CLEAR_RQBUFFER 0x0803241#define FUNCTION_CLEAR_WQBUFFER 0x0804242#define FUNCTION_CLEAR_ALLQBUFFER 0x0805243#define FUNCTION_REQUEST_RETURNCODE_3F 0x0806244#define FUNCTION_SAY_HELLO 0x0807245#define FUNCTION_SAY_GOODBYE 0x0808246#define FUNCTION_FLUSH_ADAPTER_CACHE 0x0809247/*248************************************************************************249** IOCTL CONTROL CODE250************************************************************************251*/252/* ARECA IO CONTROL CODE*/253#define ARCMSR_MESSAGE_READ_RQBUFFER _IOWR('F', FUNCTION_READ_RQBUFFER, struct CMD_MESSAGE_FIELD)254#define ARCMSR_MESSAGE_WRITE_WQBUFFER _IOWR('F', FUNCTION_WRITE_WQBUFFER, struct CMD_MESSAGE_FIELD)255#define ARCMSR_MESSAGE_CLEAR_RQBUFFER _IOWR('F', FUNCTION_CLEAR_RQBUFFER, struct CMD_MESSAGE_FIELD)256#define ARCMSR_MESSAGE_CLEAR_WQBUFFER _IOWR('F', FUNCTION_CLEAR_WQBUFFER, struct CMD_MESSAGE_FIELD)257#define ARCMSR_MESSAGE_CLEAR_ALLQBUFFER _IOWR('F', FUNCTION_CLEAR_ALLQBUFFER, struct CMD_MESSAGE_FIELD)258#define ARCMSR_MESSAGE_REQUEST_RETURNCODE_3F _IOWR('F', FUNCTION_REQUEST_RETURNCODE_3F, struct CMD_MESSAGE_FIELD)259#define ARCMSR_MESSAGE_SAY_HELLO _IOWR('F', FUNCTION_SAY_HELLO, struct CMD_MESSAGE_FIELD)260#define ARCMSR_MESSAGE_SAY_GOODBYE _IOWR('F', FUNCTION_SAY_GOODBYE, struct CMD_MESSAGE_FIELD)261#define ARCMSR_MESSAGE_FLUSH_ADAPTER_CACHE _IOWR('F', FUNCTION_FLUSH_ADAPTER_CACHE, struct CMD_MESSAGE_FIELD)262263/* ARECA IOCTL ReturnCode */264#define ARCMSR_MESSAGE_RETURNCODE_OK 0x00000001265#define ARCMSR_MESSAGE_RETURNCODE_ERROR 0x00000006266#define ARCMSR_MESSAGE_RETURNCODE_3F 0x0000003F267#define ARCMSR_IOCTL_RETURNCODE_BUS_HANG_ON 0x00000088268/*269************************************************************************270** SPEC. for Areca HBA adapter271************************************************************************272*/273/* signature of set and get firmware config */274#define ARCMSR_SIGNATURE_GET_CONFIG 0x87974060275#define ARCMSR_SIGNATURE_SET_CONFIG 0x87974063276/* message code of inbound message register */277#define ARCMSR_INBOUND_MESG0_NOP 0x00000000278#define ARCMSR_INBOUND_MESG0_GET_CONFIG 0x00000001279#define ARCMSR_INBOUND_MESG0_SET_CONFIG 0x00000002280#define ARCMSR_INBOUND_MESG0_ABORT_CMD 0x00000003281#define ARCMSR_INBOUND_MESG0_STOP_BGRB 0x00000004282#define ARCMSR_INBOUND_MESG0_FLUSH_CACHE 0x00000005283#define ARCMSR_INBOUND_MESG0_START_BGRB 0x00000006284#define ARCMSR_INBOUND_MESG0_CHK331PENDING 0x00000007285#define ARCMSR_INBOUND_MESG0_SYNC_TIMER 0x00000008286/* doorbell interrupt generator */287#define ARCMSR_INBOUND_DRIVER_DATA_WRITE_OK 0x00000001288#define ARCMSR_INBOUND_DRIVER_DATA_READ_OK 0x00000002289#define ARCMSR_OUTBOUND_IOP331_DATA_WRITE_OK 0x00000001290#define ARCMSR_OUTBOUND_IOP331_DATA_READ_OK 0x00000002291/* srb areca cdb flag */292#define ARCMSR_SRBPOST_FLAG_SGL_BSIZE 0x80000000293#define ARCMSR_SRBPOST_FLAG_IAM_BIOS 0x40000000294#define ARCMSR_SRBREPLY_FLAG_IAM_BIOS 0x40000000295#define ARCMSR_SRBREPLY_FLAG_ERROR 0x10000000296#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE0 0x10000000297#define ARCMSR_SRBREPLY_FLAG_ERROR_MODE1 0x00000001298/* outbound firmware ok */299#define ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK 0x80000000300301#define ARCMSR_ARC1680_BUS_RESET 0x00000003302/*303************************************************************************304** SPEC. for Areca HBB adapter305************************************************************************306*/307/* ARECA HBB COMMAND for its FIRMWARE */308#define ARCMSR_DRV2IOP_DOORBELL 0x00020400 /* window of "instruction flags" from driver to iop */309#define ARCMSR_DRV2IOP_DOORBELL_MASK 0x00020404310#define ARCMSR_IOP2DRV_DOORBELL 0x00020408 /* window of "instruction flags" from iop to driver */311#define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C312313#define ARCMSR_IOP2DRV_DOORBELL_1203 0x00021870 /* window of "instruction flags" from iop to driver */314#define ARCMSR_IOP2DRV_DOORBELL_MASK_1203 0x00021874315#define ARCMSR_DRV2IOP_DOORBELL_1203 0x00021878 /* window of "instruction flags" from driver to iop */316#define ARCMSR_DRV2IOP_DOORBELL_MASK_1203 0x0002187C317318/* ARECA FLAG LANGUAGE */319#define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001 /* ioctl transfer */320#define ARCMSR_IOP2DRV_DATA_READ_OK 0x00000002 /* ioctl transfer */321#define ARCMSR_IOP2DRV_CDB_DONE 0x00000004322#define ARCMSR_IOP2DRV_MESSAGE_CMD_DONE 0x00000008323324#define ARCMSR_DOORBELL_HANDLE_INT 0x0000000F325#define ARCMSR_DOORBELL_INT_CLEAR_PATTERN 0xFF00FFF0326#define ARCMSR_MESSAGE_INT_CLEAR_PATTERN 0xFF00FFF7327328#define ARCMSR_MESSAGE_GET_CONFIG 0x00010008 /* (ARCMSR_INBOUND_MESG0_GET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */329#define ARCMSR_MESSAGE_SET_CONFIG 0x00020008 /* (ARCMSR_INBOUND_MESG0_SET_CONFIG<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */330#define ARCMSR_MESSAGE_ABORT_CMD 0x00030008 /* (ARCMSR_INBOUND_MESG0_ABORT_CMD<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */331#define ARCMSR_MESSAGE_STOP_BGRB 0x00040008 /* (ARCMSR_INBOUND_MESG0_STOP_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */332#define ARCMSR_MESSAGE_FLUSH_CACHE 0x00050008 /* (ARCMSR_INBOUND_MESG0_FLUSH_CACHE<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */333#define ARCMSR_MESSAGE_START_BGRB 0x00060008 /* (ARCMSR_INBOUND_MESG0_START_BGRB<<16)|ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED) */334#define ARCMSR_MESSAGE_START_DRIVER_MODE 0x000E0008335#define ARCMSR_MESSAGE_SET_POST_WINDOW 0x000F0008336#define ARCMSR_MESSAGE_ACTIVE_EOI_MODE 0x00100008337#define ARCMSR_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK */338339#define ARCMSR_DRV2IOP_DATA_WRITE_OK 0x00000001 /* ioctl transfer */340#define ARCMSR_DRV2IOP_DATA_READ_OK 0x00000002 /* ioctl transfer */341#define ARCMSR_DRV2IOP_CDB_POSTED 0x00000004342#define ARCMSR_DRV2IOP_MESSAGE_CMD_POSTED 0x00000008343#define ARCMSR_DRV2IOP_END_OF_INTERRUPT 0x00000010 /* */344345/* data tunnel buffer between user space program and its firmware */346#define ARCMSR_MSGCODE_RWBUFFER 0x0000fa00 /* iop msgcode_rwbuffer for message command */347#define ARCMSR_IOCTL_WBUFFER 0x0000fe00 /* user space data to iop 128bytes */348#define ARCMSR_IOCTL_RBUFFER 0x0000ff00 /* iop data to user space 128bytes */349#define ARCMSR_HBB_BASE0_OFFSET 0x00000010350#define ARCMSR_HBB_BASE1_OFFSET 0x00000018351#define ARCMSR_HBB_BASE0_LEN 0x00021000352#define ARCMSR_HBB_BASE1_LEN 0x00010000353/*354************************************************************************355** SPEC. for Areca HBC adapter356************************************************************************357*/358#define ARCMSR_HBC_ISR_THROTTLING_LEVEL 12359#define ARCMSR_HBC_ISR_MAX_DONE_QUEUE 20360/* Host Interrupt Mask */361#define ARCMSR_HBCMU_UTILITY_A_ISR_MASK 0x00000001 /* When clear, the Utility_A interrupt routes to the host.*/362#define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR_MASK 0x00000004 /* When clear, the General Outbound Doorbell interrupt routes to the host.*/363#define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR_MASK 0x00000008 /* When clear, the Outbound Post List FIFO Not Empty interrupt routes to the host.*/364#define ARCMSR_HBCMU_ALL_INTMASKENABLE 0x0000000D /* disable all ISR */365/* Host Interrupt Status */366#define ARCMSR_HBCMU_UTILITY_A_ISR 0x00000001367/*368** Set when the Utility_A Interrupt bit is set in the Outbound Doorbell Register.369** It clears by writing a 1 to the Utility_A bit in the Outbound Doorbell Clear Register or through automatic clearing (if enabled).370*/371#define ARCMSR_HBCMU_OUTBOUND_DOORBELL_ISR 0x00000004372/*373** Set if Outbound Doorbell register bits 30:1 have a non-zero374** value. This bit clears only when Outbound Doorbell bits375** 30:1 are ALL clear. Only a write to the Outbound Doorbell376** Clear register clears bits in the Outbound Doorbell register.377*/378#define ARCMSR_HBCMU_OUTBOUND_POSTQUEUE_ISR 0x00000008379/*380** Set whenever the Outbound Post List Producer/Consumer381** Register (FIFO) is not empty. It clears when the Outbound382** Post List FIFO is empty.383*/384#define ARCMSR_HBCMU_SAS_ALL_INT 0x00000010385/*386** This bit indicates a SAS interrupt from a source external to387** the PCIe core. This bit is not maskable.388*/389/* DoorBell*/390#define ARCMSR_HBCMU_DRV2IOP_DATA_WRITE_OK 0x00000002/**/391#define ARCMSR_HBCMU_DRV2IOP_DATA_READ_OK 0x00000004/**/392#define ARCMSR_HBCMU_DRV2IOP_MESSAGE_CMD_DONE 0x00000008/*inbound message 0 ready*/393#define ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING 0x00000010/*more than 12 request completed in a time*/394#define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK 0x00000002/**/395#define ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_DOORBELL_CLEAR 0x00000002/*outbound DATA WRITE isr door bell clear*/396#define ARCMSR_HBCMU_IOP2DRV_DATA_READ_OK 0x00000004/**/397#define ARCMSR_HBCMU_IOP2DRV_DATA_READ_DOORBELL_CLEAR 0x00000004/*outbound DATA READ isr door bell clear*/398#define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008/*outbound message 0 ready*/399#define ARCMSR_HBCMU_IOP2DRV_MESSAGE_CMD_DONE_DOORBELL_CLEAR 0x00000008/*outbound message cmd isr door bell clear*/400#define ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK 0x80000000/*ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK*/401#define ARCMSR_HBCMU_RESET_ADAPTER 0x00000024402#define ARCMSR_HBCMU_DiagWrite_ENABLE 0x00000080403404/*405************************************************************************406** SPEC. for Areca HBD adapter407************************************************************************408*/409#define ARCMSR_HBDMU_CHIP_ID 0x00004410#define ARCMSR_HBDMU_CPU_MEMORY_CONFIGURATION 0x00008411#define ARCMSR_HBDMU_I2_HOST_INTERRUPT_MASK 0x00034412#define ARCMSR_HBDMU_MAIN_INTERRUPT_STATUS 0x00200413#define ARCMSR_HBDMU_PCIE_F0_INTERRUPT_ENABLE 0x0020C414#define ARCMSR_HBDMU_INBOUND_MESSAGE0 0x00400415#define ARCMSR_HBDMU_INBOUND_MESSAGE1 0x00404416#define ARCMSR_HBDMU_OUTBOUND_MESSAGE0 0x00420417#define ARCMSR_HBDMU_OUTBOUND_MESSAGE1 0x00424418#define ARCMSR_HBDMU_INBOUND_DOORBELL 0x00460419#define ARCMSR_HBDMU_OUTBOUND_DOORBELL 0x00480420#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_ENABLE 0x00484421#define ARCMSR_HBDMU_INBOUND_LIST_BASE_LOW 0x01000422#define ARCMSR_HBDMU_INBOUND_LIST_BASE_HIGH 0x01004423#define ARCMSR_HBDMU_INBOUND_LIST_WRITE_POINTER 0x01018424#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_LOW 0x01060425#define ARCMSR_HBDMU_OUTBOUND_LIST_BASE_HIGH 0x01064426#define ARCMSR_HBDMU_OUTBOUND_LIST_COPY_POINTER 0x0106C427#define ARCMSR_HBDMU_OUTBOUND_LIST_READ_POINTER 0x01070428#define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_CAUSE 0x01088429#define ARCMSR_HBDMU_OUTBOUND_INTERRUPT_ENABLE 0x0108C430431#define ARCMSR_HBDMU_MESSAGE_WBUFFER 0x02000432#define ARCMSR_HBDMU_MESSAGE_RBUFFER 0x02100433#define ARCMSR_HBDMU_MESSAGE_RWBUFFER 0x02200434435#define ARCMSR_HBDMU_ISR_THROTTLING_LEVEL 16436#define ARCMSR_HBDMU_ISR_MAX_DONE_QUEUE 20437438/* Host Interrupt Mask */439#define ARCMSR_HBDMU_ALL_INT_ENABLE 0x00001010 /* enable all ISR */440#define ARCMSR_HBDMU_ALL_INT_DISABLE 0x00000000 /* disable all ISR */441442/* Host Interrupt Status */443#define ARCMSR_HBDMU_OUTBOUND_INT 0x00001010444#define ARCMSR_HBDMU_OUTBOUND_DOORBELL_INT 0x00001000445#define ARCMSR_HBDMU_OUTBOUND_POSTQUEUE_INT 0x00000010446447/* DoorBell*/448#define ARCMSR_HBDMU_DRV2IOP_DATA_IN_READY 0x00000001449#define ARCMSR_HBDMU_DRV2IOP_DATA_OUT_READ 0x00000002450451#define ARCMSR_HBDMU_IOP2DRV_DATA_WRITE_OK 0x00000001452#define ARCMSR_HBDMU_IOP2DRV_DATA_READ_OK 0x00000002453454/*outbound message 0 ready*/455#define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE 0x02000000456457#define ARCMSR_HBDMU_F0_DOORBELL_CAUSE 0x02000003458459/*outbound message cmd isr door bell clear*/460#define ARCMSR_HBDMU_IOP2DRV_MESSAGE_CMD_DONE_CLEAR 0x02000000461462/*outbound list */463#define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT 0x00000001464#define ARCMSR_HBDMU_OUTBOUND_LIST_INTERRUPT_CLEAR 0x00000001465466/*ARCMSR_HBAMU_MESSAGE_FIRMWARE_OK*/467#define ARCMSR_HBDMU_MESSAGE_FIRMWARE_OK 0x80000000468/*469*******************************************************************************470** SPEC. for Areca HBE adapter471*******************************************************************************472*/473#define ARCMSR_SIGNATURE_1884 0x188417D3474#define ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR 0x00000001475#define ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR 0x00000008476#define ARCMSR_HBEMU_ALL_INTMASKENABLE 0x00000009 /* disable all ISR */477478#define ARCMSR_HBEMU_DRV2IOP_DATA_WRITE_OK 0x00000002479#define ARCMSR_HBEMU_DRV2IOP_DATA_READ_OK 0x00000004480#define ARCMSR_HBEMU_DRV2IOP_MESSAGE_CMD_DONE 0x00000008 /* inbound message 0 ready */481#define ARCMSR_HBEMU_IOP2DRV_DATA_WRITE_OK 0x00000002482#define ARCMSR_HBEMU_IOP2DRV_DATA_READ_OK 0x00000004483#define ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE 0x00000008 /* outbound message 0 ready */484#define ARCMSR_HBEMU_MESSAGE_FIRMWARE_OK 0x80000000 /* ARCMSR_HBCMU_MESSAGE_FIRMWARE_OK */485/* ARC-1884 doorbell sync */486#define ARCMSR_HBEMU_DOORBELL_SYNC 0x100487#define ARCMSR_ARC188X_RESET_ADAPTER 0x00000004488/*489*******************************************************************************490** SPEC. for Areca HBF adapter491*******************************************************************************492*/493#define ARCMSR_SIGNATURE_1886 0x188617D3494// Doorbell and interrupt definition are same as Type E adapter495/* ARC-1886 doorbell sync */496#define ARCMSR_HBFMU_DOORBELL_SYNC 0x100497//set host rw buffer physical address at inbound message 0, 1 (low,high)498#define ARCMSR_HBFMU_DOORBELL_SYNC1 0x300499#define ARCMSR_HBFMU_MESSAGE_FIRMWARE_OK 0x80000000500#define ARCMSR_HBFMU_MESSAGE_NO_VOLUME_CHANGE 0x20000000501502/*503*********************************************************************504** Messaging Unit (MU) of Type A processor505*********************************************************************506*/507struct HBA_MessageUnit508{509u_int32_t resrved0[4]; /*0000 000F*/510u_int32_t inbound_msgaddr0; /*0010 0013*/511u_int32_t inbound_msgaddr1; /*0014 0017*/512u_int32_t outbound_msgaddr0; /*0018 001B*/513u_int32_t outbound_msgaddr1; /*001C 001F*/514u_int32_t inbound_doorbell; /*0020 0023*/515u_int32_t inbound_intstatus; /*0024 0027*/516u_int32_t inbound_intmask; /*0028 002B*/517u_int32_t outbound_doorbell; /*002C 002F*/518u_int32_t outbound_intstatus; /*0030 0033*/519u_int32_t outbound_intmask; /*0034 0037*/520u_int32_t reserved1[2]; /*0038 003F*/521u_int32_t inbound_queueport; /*0040 0043*/522u_int32_t outbound_queueport; /*0044 0047*/523u_int32_t reserved2[2]; /*0048 004F*/524u_int32_t reserved3[492]; /*0050 07FF ......local_buffer 492*/525u_int32_t reserved4[128]; /*0800 09FF 128*/526u_int32_t msgcode_rwbuffer[256]; /*0a00 0DFF 256*/527u_int32_t message_wbuffer[32]; /*0E00 0E7F 32*/528u_int32_t reserved5[32]; /*0E80 0EFF 32*/529u_int32_t message_rbuffer[32]; /*0F00 0F7F 32*/530u_int32_t reserved6[32]; /*0F80 0FFF 32*/531};532/*533*********************************************************************534**535*********************************************************************536*/537struct HBB_DOORBELL_1203538{539u_int8_t doorbell_reserved[ARCMSR_IOP2DRV_DOORBELL_1203]; /*reserved */540u_int32_t iop2drv_doorbell; /*offset 0x00021870:00,01,02,03: window of "instruction flags" from iop to driver */541u_int32_t iop2drv_doorbell_mask; /* 04,05,06,07: doorbell mask */542u_int32_t drv2iop_doorbell; /* 08,09,10,11: window of "instruction flags" from driver to iop */543u_int32_t drv2iop_doorbell_mask; /* 12,13,14,15: doorbell mask */544};545struct HBB_DOORBELL546{547u_int8_t doorbell_reserved[ARCMSR_DRV2IOP_DOORBELL]; /*reserved */548u_int32_t drv2iop_doorbell; /*offset 0x00020400:00,01,02,03: window of "instruction flags" from driver to iop */549u_int32_t drv2iop_doorbell_mask; /* 04,05,06,07: doorbell mask */550u_int32_t iop2drv_doorbell; /* 08,09,10,11: window of "instruction flags" from iop to driver */551u_int32_t iop2drv_doorbell_mask; /* 12,13,14,15: doorbell mask */552};553/*554*********************************************************************555**556*********************************************************************557*/558struct HBB_RWBUFFER559{560u_int8_t message_reserved0[ARCMSR_MSGCODE_RWBUFFER]; /*reserved */561u_int32_t msgcode_rwbuffer[256]; /*offset 0x0000fa00: 0, 1, 2, 3,...,1023: message code read write 1024bytes */562u_int32_t message_wbuffer[32]; /*offset 0x0000fe00:1024,1025,1026,1027,...,1151: user space data to iop 128bytes */563u_int32_t message_reserved1[32]; /* 1152,1153,1154,1155,...,1279: message reserved*/564u_int32_t message_rbuffer[32]; /*offset 0x0000ff00:1280,1281,1282,1283,...,1407: iop data to user space 128bytes */565};566/*567*********************************************************************568** Messaging Unit (MU) of Type B processor(MARVEL)569*********************************************************************570*/571struct HBB_MessageUnit572{573u_int32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* post queue buffer for iop */574u_int32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; /* done queue buffer for iop */575int32_t postq_index; /* post queue index */576int32_t doneq_index; /* done queue index */577struct HBB_DOORBELL *hbb_doorbell;578struct HBB_RWBUFFER *hbb_rwbuffer;579bus_size_t drv2iop_doorbell; /* window of "instruction flags" from driver to iop */580bus_size_t drv2iop_doorbell_mask; /* doorbell mask */581bus_size_t iop2drv_doorbell; /* window of "instruction flags" from iop to driver */582bus_size_t iop2drv_doorbell_mask; /* doorbell mask */583};584585/*586*********************************************************************587** Messaging Unit (MU) of Type C processor(LSI)588*********************************************************************589*/590struct HBC_MessageUnit {591u_int32_t message_unit_status; /*0000 0003*/592u_int32_t slave_error_attribute; /*0004 0007*/593u_int32_t slave_error_address; /*0008 000B*/594u_int32_t posted_outbound_doorbell; /*000C 000F*/595u_int32_t master_error_attribute; /*0010 0013*/596u_int32_t master_error_address_low; /*0014 0017*/597u_int32_t master_error_address_high; /*0018 001B*/598u_int32_t hcb_size; /*001C 001F size of the PCIe window used for HCB_Mode accesses*/599u_int32_t inbound_doorbell; /*0020 0023*/600u_int32_t diagnostic_rw_data; /*0024 0027*/601u_int32_t diagnostic_rw_address_low; /*0028 002B*/602u_int32_t diagnostic_rw_address_high; /*002C 002F*/603u_int32_t host_int_status; /*0030 0033 host interrupt status*/604u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/605u_int32_t dcr_data; /*0038 003B*/606u_int32_t dcr_address; /*003C 003F*/607u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/608u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/609u_int32_t hcb_pci_address_low; /*0048 004B*/610u_int32_t hcb_pci_address_high; /*004C 004F*/611u_int32_t iop_int_status; /*0050 0053*/612u_int32_t iop_int_mask; /*0054 0057*/613u_int32_t iop_inbound_queue_port; /*0058 005B*/614u_int32_t iop_outbound_queue_port; /*005C 005F*/615u_int32_t inbound_free_list_index; /*0060 0063 inbound free list producer consumer index*/616u_int32_t inbound_post_list_index; /*0064 0067 inbound post list producer consumer index*/617u_int32_t outbound_free_list_index; /*0068 006B outbound free list producer consumer index*/618u_int32_t outbound_post_list_index; /*006C 006F outbound post list producer consumer index*/619u_int32_t inbound_doorbell_clear; /*0070 0073*/620u_int32_t i2o_message_unit_control; /*0074 0077*/621u_int32_t last_used_message_source_address_low; /*0078 007B*/622u_int32_t last_used_message_source_address_high; /*007C 007F*/623u_int32_t pull_mode_data_byte_count[4]; /*0080 008F pull mode data byte count0..count7*/624u_int32_t message_dest_address_index; /*0090 0093*/625u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/626u_int32_t utility_A_int_counter_timer; /*0098 009B*/627u_int32_t outbound_doorbell; /*009C 009F*/628u_int32_t outbound_doorbell_clear; /*00A0 00A3*/629u_int32_t message_source_address_index; /*00A4 00A7 message accelerator source address consumer producer index*/630u_int32_t message_done_queue_index; /*00A8 00AB message accelerator completion queue consumer producer index*/631u_int32_t reserved0; /*00AC 00AF*/632u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/633u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/634u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/635u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/636u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/637u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/638u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/639u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/640u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/641u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/642u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/643u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/644u_int32_t message_dest_queue_port_low; /*00E0 00E3 message accelerator destination queue port low*/645u_int32_t message_dest_queue_port_high; /*00E4 00E7 message accelerator destination queue port high*/646u_int32_t last_used_message_dest_address_low; /*00E8 00EB last used message accelerator destination address low*/647u_int32_t last_used_message_dest_address_high; /*00EC 00EF last used message accelerator destination address high*/648u_int32_t message_done_queue_base_address_low; /*00F0 00F3 message accelerator completion queue base address low*/649u_int32_t message_done_queue_base_address_high; /*00F4 00F7 message accelerator completion queue base address high*/650u_int32_t host_diagnostic; /*00F8 00FB*/651u_int32_t write_sequence; /*00FC 00FF*/652u_int32_t reserved1[34]; /*0100 0187*/653u_int32_t reserved2[1950]; /*0188 1FFF*/654u_int32_t message_wbuffer[32]; /*2000 207F*/655u_int32_t reserved3[32]; /*2080 20FF*/656u_int32_t message_rbuffer[32]; /*2100 217F*/657u_int32_t reserved4[32]; /*2180 21FF*/658u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/659};660/*661*********************************************************************662** Messaging Unit (MU) of Type D processor663*********************************************************************664*/665struct InBound_SRB {666uint32_t addressLow; //pointer to SRB block667uint32_t addressHigh;668uint32_t length; // in DWORDs669uint32_t reserved0;670};671672struct OutBound_SRB {673uint32_t addressLow; //pointer to SRB block674uint32_t addressHigh;675};676677struct HBD_MessageUnit {678uint32_t reserved0;679uint32_t chip_id; //0x0004680uint32_t cpu_mem_config; //0x0008681uint32_t reserved1[10]; //0x000C682uint32_t i2o_host_interrupt_mask; //0x0034683uint32_t reserved2[114]; //0x0038684uint32_t host_int_status; //0x0200685uint32_t host_int_enable; //0x0204686uint32_t reserved3[1]; //0x0208687uint32_t pcief0_int_enable; //0x020C688uint32_t reserved4[124]; //0x0210689uint32_t inbound_msgaddr0; //0x0400690uint32_t inbound_msgaddr1; //0x0404691uint32_t reserved5[6]; //0x0408692uint32_t outbound_msgaddr0; //0x0420693uint32_t outbound_msgaddr1; //0x0424694uint32_t reserved6[14]; //0x0428695uint32_t inbound_doorbell; //0x0460696uint32_t reserved7[7]; //0x0464697uint32_t outbound_doorbell; //0x0480698uint32_t outbound_doorbell_enable; //0x0484699uint32_t reserved8[734]; //0x0488700uint32_t inboundlist_base_low; //0x1000701uint32_t inboundlist_base_high; //0x1004702uint32_t reserved9[4]; //0x1008703uint32_t inboundlist_write_pointer; //0x1018704uint32_t inboundlist_read_pointer; //0x101C705uint32_t reserved10[16]; //0x1020706uint32_t outboundlist_base_low; //0x1060707uint32_t outboundlist_base_high; //0x1064708uint32_t reserved11; //0x1068709uint32_t outboundlist_copy_pointer; //0x106C710uint32_t outboundlist_read_pointer; //0x1070 0x1072711uint32_t reserved12[5]; //0x1074712uint32_t outboundlist_interrupt_cause; //0x1088713uint32_t outboundlist_interrupt_enable; //0x108C714uint32_t reserved13[988]; //0x1090715uint32_t message_wbuffer[32]; //0x2000716uint32_t reserved14[32]; //0x2080717uint32_t message_rbuffer[32]; //0x2100718uint32_t reserved15[32]; //0x2180719uint32_t msgcode_rwbuffer[256]; //0x2200720};721722struct HBD_MessageUnit0 {723struct InBound_SRB post_qbuffer[ARCMSR_MAX_HBD_POSTQUEUE];724struct OutBound_SRB done_qbuffer[ARCMSR_MAX_HBD_POSTQUEUE+1];725uint16_t postq_index;726uint16_t doneq_index;727struct HBD_MessageUnit *phbdmu;728};729/*730*********************************************************************731** Messaging Unit (MU) of Type E processor(LSI)732*********************************************************************733*/734struct HBE_MessageUnit {735u_int32_t iobound_doorbell; /*0000 0003*/736u_int32_t write_sequence_3xxx; /*0004 0007*/737u_int32_t host_diagnostic_3xxx; /*0008 000B*/738u_int32_t posted_outbound_doorbell; /*000C 000F*/739u_int32_t master_error_attribute; /*0010 0013*/740u_int32_t master_error_address_low; /*0014 0017*/741u_int32_t master_error_address_high; /*0018 001B*/742u_int32_t hcb_size; /*001C 001F*/743u_int32_t inbound_doorbell; /*0020 0023*/744u_int32_t diagnostic_rw_data; /*0024 0027*/745u_int32_t diagnostic_rw_address_low; /*0028 002B*/746u_int32_t diagnostic_rw_address_high; /*002C 002F*/747u_int32_t host_int_status; /*0030 0033 host interrupt status*/748u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/749u_int32_t dcr_data; /*0038 003B*/750u_int32_t dcr_address; /*003C 003F*/751u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/752u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/753u_int32_t hcb_pci_address_low; /*0048 004B*/754u_int32_t hcb_pci_address_high; /*004C 004F*/755u_int32_t iop_int_status; /*0050 0053*/756u_int32_t iop_int_mask; /*0054 0057*/757u_int32_t iop_inbound_queue_port; /*0058 005B*/758u_int32_t iop_outbound_queue_port; /*005C 005F*/759u_int32_t inbound_free_list_index; /*0060 0063*/760u_int32_t inbound_post_list_index; /*0064 0067*/761u_int32_t outbound_free_list_index; /*0068 006B*/762u_int32_t outbound_post_list_index; /*006C 006F*/763u_int32_t inbound_doorbell_clear; /*0070 0073*/764u_int32_t i2o_message_unit_control; /*0074 0077*/765u_int32_t last_used_message_source_address_low; /*0078 007B*/766u_int32_t last_used_message_source_address_high; /*007C 007F*/767u_int32_t pull_mode_data_byte_count[4]; /*0080 008F*/768u_int32_t message_dest_address_index; /*0090 0093*/769u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/770u_int32_t utility_A_int_counter_timer; /*0098 009B*/771u_int32_t outbound_doorbell; /*009C 009F*/772u_int32_t outbound_doorbell_clear; /*00A0 00A3*/773u_int32_t message_source_address_index; /*00A4 00A7*/774u_int32_t message_done_queue_index; /*00A8 00AB*/775u_int32_t reserved0; /*00AC 00AF*/776u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/777u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/778u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/779u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/780u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/781u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/782u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/783u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/784u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/785u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/786u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/787u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/788u_int32_t message_dest_queue_port_low; /*00E0 00E3*/789u_int32_t message_dest_queue_port_high; /*00E4 00E7*/790u_int32_t last_used_message_dest_address_low; /*00E8 00EB*/791u_int32_t last_used_message_dest_address_high; /*00EC 00EF*/792u_int32_t message_done_queue_base_address_low; /*00F0 00F3*/793u_int32_t message_done_queue_base_address_high; /*00F4 00F7*/794u_int32_t host_diagnostic; /*00F8 00FB*/795u_int32_t write_sequence; /*00FC 00FF*/796u_int32_t reserved1[46]; /*0100 01B7*/797u_int32_t reply_post_producer_index; /*01B8 01BB*/798u_int32_t reply_post_consumer_index; /*01BC 01BF*/799u_int32_t reserved2[1936]; /*01C0 1FFF*/800u_int32_t message_wbuffer[32]; /*2000 207F*/801u_int32_t reserved3[32]; /*2080 20FF*/802u_int32_t message_rbuffer[32]; /*2100 217F*/803u_int32_t reserved4[32]; /*2180 21FF*/804u_int32_t msgcode_rwbuffer[256]; /*2200 23FF*/805};806807/*808*********************************************************************809** Messaging Unit (MU) of Type F processor(LSI)810*********************************************************************811*/812struct HBF_MessageUnit {813u_int32_t iobound_doorbell; /*0000 0003*/814u_int32_t write_sequence_3xxx; /*0004 0007*/815u_int32_t host_diagnostic_3xxx; /*0008 000B*/816u_int32_t posted_outbound_doorbell; /*000C 000F*/817u_int32_t master_error_attribute; /*0010 0013*/818u_int32_t master_error_address_low; /*0014 0017*/819u_int32_t master_error_address_high; /*0018 001B*/820u_int32_t hcb_size; /*001C 001F*/821u_int32_t inbound_doorbell; /*0020 0023*/822u_int32_t diagnostic_rw_data; /*0024 0027*/823u_int32_t diagnostic_rw_address_low; /*0028 002B*/824u_int32_t diagnostic_rw_address_high; /*002C 002F*/825u_int32_t host_int_status; /*0030 0033 host interrupt status*/826u_int32_t host_int_mask; /*0034 0037 host interrupt mask*/827u_int32_t dcr_data; /*0038 003B*/828u_int32_t dcr_address; /*003C 003F*/829u_int32_t inbound_queueport; /*0040 0043 port32 host inbound queue port*/830u_int32_t outbound_queueport; /*0044 0047 port32 host outbound queue port*/831u_int32_t hcb_pci_address_low; /*0048 004B*/832u_int32_t hcb_pci_address_high; /*004C 004F*/833u_int32_t iop_int_status; /*0050 0053*/834u_int32_t iop_int_mask; /*0054 0057*/835u_int32_t iop_inbound_queue_port; /*0058 005B*/836u_int32_t iop_outbound_queue_port; /*005C 005F*/837u_int32_t inbound_free_list_index; /*0060 0063*/838u_int32_t inbound_post_list_index; /*0064 0067*/839u_int32_t reply_post_producer_index; /*0068 006B*/840u_int32_t reply_post_consumer_index; /*006C 006F*/841u_int32_t inbound_doorbell_clear; /*0070 0073*/842u_int32_t i2o_message_unit_control; /*0074 0077*/843u_int32_t last_used_message_source_address_low; /*0078 007B*/844u_int32_t last_used_message_source_address_high; /*007C 007F*/845u_int32_t pull_mode_data_byte_count[4]; /*0080 008F*/846u_int32_t message_dest_address_index; /*0090 0093*/847u_int32_t done_queue_not_empty_int_counter_timer; /*0094 0097*/848u_int32_t utility_A_int_counter_timer; /*0098 009B*/849u_int32_t outbound_doorbell; /*009C 009F*/850u_int32_t outbound_doorbell_clear; /*00A0 00A3*/851u_int32_t message_source_address_index; /*00A4 00A7*/852u_int32_t message_done_queue_index; /*00A8 00AB*/853u_int32_t reserved0; /*00AC 00AF*/854u_int32_t inbound_msgaddr0; /*00B0 00B3 scratchpad0*/855u_int32_t inbound_msgaddr1; /*00B4 00B7 scratchpad1*/856u_int32_t outbound_msgaddr0; /*00B8 00BB scratchpad2*/857u_int32_t outbound_msgaddr1; /*00BC 00BF scratchpad3*/858u_int32_t inbound_queueport_low; /*00C0 00C3 port64 host inbound queue port low*/859u_int32_t inbound_queueport_high; /*00C4 00C7 port64 host inbound queue port high*/860u_int32_t outbound_queueport_low; /*00C8 00CB port64 host outbound queue port low*/861u_int32_t outbound_queueport_high; /*00CC 00CF port64 host outbound queue port high*/862u_int32_t iop_inbound_queue_port_low; /*00D0 00D3*/863u_int32_t iop_inbound_queue_port_high; /*00D4 00D7*/864u_int32_t iop_outbound_queue_port_low; /*00D8 00DB*/865u_int32_t iop_outbound_queue_port_high; /*00DC 00DF*/866u_int32_t message_dest_queue_port_low; /*00E0 00E3*/867u_int32_t message_dest_queue_port_high; /*00E4 00E7*/868u_int32_t last_used_message_dest_address_low; /*00E8 00EB*/869u_int32_t last_used_message_dest_address_high; /*00EC 00EF*/870u_int32_t message_done_queue_base_address_low; /*00F0 00F3*/871u_int32_t message_done_queue_base_address_high; /*00F4 00F7*/872u_int32_t host_diagnostic; /*00F8 00FB*/873u_int32_t write_sequence; /*00FC 00FF*/874u_int32_t reserved1[46]; /*0100 01B7*/875u_int32_t reply_post_producer_index1; /*01B8 01BB*/876u_int32_t reply_post_consumer_index1; /*01BC 01BF*/877};878879#define MESG_RW_BUFFER_SIZE (256 * 3)880881typedef struct deliver_completeQ {882u_int16_t cmdFlag;883u_int16_t cmdSMID;884u_int16_t cmdLMID; // reserved (0)885u_int16_t cmdFlag2; // reserved (0)886} DeliverQ, CompletionQ, *pDeliver_Q, *pCompletion_Q;887888#define COMPLETION_Q_POOL_SIZE (sizeof(struct deliver_completeQ) * 512 + 128)889890/*891*********************************************************************892**893*********************************************************************894*/895struct MessageUnit_UNION896{897union {898struct HBA_MessageUnit hbamu;899struct HBB_MessageUnit hbbmu;900struct HBC_MessageUnit hbcmu;901struct HBD_MessageUnit0 hbdmu;902struct HBE_MessageUnit hbemu;903struct HBF_MessageUnit hbfmu;904} muu;905};906/*907*************************************************************908** structure for holding DMA address data909*************************************************************910*/911#define IS_SG64_ADDR 0x01000000 /* bit24 */912/*913************************************************************************************************914** ARECA FIRMWARE SPEC915************************************************************************************************916** Usage of IOP331 adapter917** (All In/Out is in IOP331's view)918** 1. Message 0 --> InitThread message and retrun code919** 2. Doorbell is used for RS-232 emulation920** inDoorBell : bit0 -- data in ready (DRIVER DATA WRITE OK)921** bit1 -- data out has been read (DRIVER DATA READ OK)922** outDooeBell: bit0 -- data out ready (IOP331 DATA WRITE OK)923** bit1 -- data in has been read (IOP331 DATA READ OK)924** 3. Index Memory Usage925** offset 0xf00 : for RS232 out (request buffer)926** offset 0xe00 : for RS232 in (scratch buffer)927** offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331)928** offset 0xa00 : for outbound message code msgcode_rwbuffer (IOP331 send to driver)929** 4. RS-232 emulation930** Currently 128 byte buffer is used931** 1st u_int32_t : Data length (1--124)932** Byte 4--127 : Max 124 bytes of data933** 5. PostQ934** All SCSI Command must be sent through postQ:935** (inbound queue port) Request frame must be 32 bytes aligned936** # bit27--bit31 => flag for post ccb937** # bit0--bit26 => real address (bit27--bit31) of post arcmsr_cdb938** bit31 : 0 : 256 bytes frame939** 1 : 512 bytes frame940** bit30 : 0 : normal request941** 1 : BIOS request942** bit29 : reserved943** bit28 : reserved944** bit27 : reserved945** -------------------------------------------------------------------------------946** (outbount queue port) Request reply947** # bit27--bit31 => flag for reply948** # bit0--bit26 => real address (bit27--bit31) of reply arcmsr_cdb949** bit31 : must be 0 (for this type of reply)950** bit30 : reserved for BIOS handshake951** bit29 : reserved952** bit28 : 0 : no error, ignore AdapStatus/DevStatus/SenseData953** 1 : Error, error code in AdapStatus/DevStatus/SenseData954** bit27 : reserved955** 6. BIOS request956** All BIOS request is the same with request from PostQ957** Except :958** Request frame is sent from configuration space959** offset: 0x78 : Request Frame (bit30 == 1)960** offset: 0x18 : writeonly to generate IRQ to IOP331961** Completion of request:962** (bit30 == 0, bit28==err flag)963** 7. Definition of SGL entry (structure)964** 8. Message1 Out - Diag Status Code (????)965** 9. Message0 message code :966** 0x00 : NOP967** 0x01 : Get Config ->offset 0xa00 :for outbound message code msgcode_rwbuffer (IOP331 send to driver)968** Signature 0x87974060(4)969** Request len 0x00000200(4)970** numbers of queue 0x00000100(4)971** SDRAM Size 0x00000100(4)-->256 MB972** IDE Channels 0x00000008(4)973** vendor 40 bytes char974** model 8 bytes char975** FirmVer 16 bytes char976** Device Map 16 bytes char977**978** FirmwareVersion DWORD <== Added for checking of new firmware capability979** 0x02 : Set Config ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver send to IOP331)980** Signature 0x87974063(4)981** UPPER32 of Request Frame (4)-->Driver Only982** 0x03 : Reset (Abort all queued Command)983** 0x04 : Stop Background Activity984** 0x05 : Flush Cache985** 0x06 : Start Background Activity (re-start if background is halted)986** 0x07 : Check If Host Command Pending (Novell May Need This Function)987** 0x08 : Set controller time ->offset 0xa00 : for inbound message code msgcode_rwbuffer (driver to IOP331)988** byte 0 : 0xaa <-- signature989** byte 1 : 0x55 <-- signature990** byte 2 : year (04)991** byte 3 : month (1..12)992** byte 4 : date (1..31)993** byte 5 : hour (0..23)994** byte 6 : minute (0..59)995** byte 7 : second (0..59)996** *********************************************************************************997** Porting Of LSI2108/2116 Based PCIE SAS/6G host raid adapter998** ==> Difference from IOP348999** <1> Message Register 0,1 (the same usage) Init Thread message and retrun code1000** Inbound Message 0 (inbound_msgaddr0) : at offset 0xB0 (Scratchpad0) for inbound message code msgcode_rwbuffer (driver send to IOP)1001** Inbound Message 1 (inbound_msgaddr1) : at offset 0xB4 (Scratchpad1) Out.... Diag Status Code1002** Outbound Message 0 (outbound_msgaddr0): at offset 0xB8 (Scratchpad3) Out.... Diag Status Code1003** Outbound Message 1 (outbound_msgaddr1): at offset 0xBC (Scratchpad2) for outbound message code msgcode_rwbuffer (IOP send to driver)1004** <A> use doorbell to generate interrupt1005**1006** inbound doorbell: bit3 -- inbound message 0 ready (driver to iop)1007** outbound doorbell: bit3 -- outbound message 0 ready (iop to driver)1008**1009** a. Message1: Out - Diag Status Code (????)1010**1011** b. Message0: message code1012** 0x00 : NOP1013** 0x01 : Get Config ->offset 0xB8 :for outbound message code msgcode_rwbuffer (IOP send to driver)1014** Signature 0x87974060(4)1015** Request len 0x00000200(4)1016** numbers of queue 0x00000100(4)1017** SDRAM Size 0x00000100(4)-->256 MB1018** IDE Channels 0x00000008(4)1019** vendor 40 bytes char1020** model 8 bytes char1021** FirmVer 16 bytes char1022** Device Map 16 bytes char1023** cfgVersion ULONG <== Added for checking of new firmware capability1024** 0x02 : Set Config ->offset 0xB0 :for inbound message code msgcode_rwbuffer (driver send to IOP)1025** Signature 0x87974063(4)1026** UPPER32 of Request Frame (4)-->Driver Only1027** 0x03 : Reset (Abort all queued Command)1028** 0x04 : Stop Background Activity1029** 0x05 : Flush Cache1030** 0x06 : Start Background Activity (re-start if background is halted)1031** 0x07 : Check If Host Command Pending (Novell May Need This Function)1032** 0x08 : Set controller time ->offset 0xB0 : for inbound message code msgcode_rwbuffer (driver to IOP)1033** byte 0 : 0xaa <-- signature1034** byte 1 : 0x55 <-- signature1035** byte 2 : year (04)1036** byte 3 : month (1..12)1037** byte 4 : date (1..31)1038** byte 5 : hour (0..23)1039** byte 6 : minute (0..59)1040** byte 7 : second (0..59)1041**1042** <2> Doorbell Register is used for RS-232 emulation1043** <A> different clear register1044** <B> different bit0 definition (bit0 is reserved)1045**1046** inbound doorbell : at offset 0x201047** inbound doorbell clear : at offset 0x701048**1049** inbound doorbell : bit0 -- reserved1050** bit1 -- data in ready (DRIVER DATA WRITE OK)1051** bit2 -- data out has been read (DRIVER DATA READ OK)1052** bit3 -- inbound message 0 ready1053** bit4 -- more than 12 request completed in a time1054**1055** outbound doorbell : at offset 0x9C1056** outbound doorbell clear : at offset 0xA01057**1058** outbound doorbell : bit0 -- reserved1059** bit1 -- data out ready (IOP DATA WRITE OK)1060** bit2 -- data in has been read (IOP DATA READ OK)1061** bit3 -- outbound message 0 ready1062**1063** <3> Index Memory Usage (Buffer Area)1064** COMPORT_IN at 0x2000: message_wbuffer -- 128 bytes (to be sent to ROC) : for RS232 in (scratch buffer)1065** COMPORT_OUT at 0x2100: message_rbuffer -- 128 bytes (to be sent to host): for RS232 out (request buffer)1066** BIOS_CFG_AREA at 0x2200: msgcode_rwbuffer -- 1024 bytes for outbound message code msgcode_rwbuffer (IOP send to driver)1067** BIOS_CFG_AREA at 0x2200: msgcode_rwbuffer -- 1024 bytes for inbound message code msgcode_rwbuffer (driver send to IOP)1068**1069** <4> PostQ (Command Post Address)1070** All SCSI Command must be sent through postQ:1071** inbound queue port32 at offset 0x40 , 0x41, 0x42, 0x431072** inbound queue port64 at offset 0xC0 (lower)/0xC4 (upper)1073** outbound queue port32 at offset 0x441074** outbound queue port64 at offset 0xC8 (lower)/0xCC (upper)1075** <A> For 32bit queue, access low part is enough to send/receive request1076** i.e. write 0x40/0xC0, ROC will get the request with high part == 0, the1077** same for outbound queue port1078** <B> For 64bit queue, if 64bit instruction is supported, use 64bit instruction1079** to post inbound request in a single instruction, and use 64bit instruction1080** to retrieve outbound request in a single instruction.1081** If in 32bit environment, when sending inbound queue, write high part first1082** then write low part. For receiving outbound request, read high part first1083** then low part, to check queue empty, ONLY check high part to be 0xFFFFFFFF.1084** If high part is 0xFFFFFFFF, DO NOT read low part, this may corrupt the1085** consistency of the FIFO. Another way to check empty is to check status flag1086** at 0x30 bit3.1087** <C> Post Address IS NOT shifted (must be 16 bytes aligned)1088** For BIOS, 16bytes aligned is OK1089** For Driver, 32bytes alignment is recommended.1090** POST Command bit0 to bit3 is defined differently1091** ----------------------------1092** bit0:1 for PULL mode (must be 1)1093** ----------------------------1094** bit3/2/1: for arcmsr cdb size (arccdbsize)1095** 000: <= 0x0080 (128)1096** 001: <= 0x0100 (256)1097** 010: <= 0x0180 (384)1098** 011: <= 0x0200 (512)1099** 100: <= 0x0280 (640)1100** 101: <= 0x0300 (768)1101** 110: <= 0x0300 (reserved)1102** 111: <= 0x0300 (reserved)1103** -----------------------------1104** if len > 0x300 the len always set as 0x3001105** -----------------------------1106** post addr = addr | ((len-1) >> 6) | 11107** -----------------------------1108** page length in command buffer still required,1109**1110** if page length > 3,1111** firmware will assume more request data need to be retrieved1112**1113** <D> Outbound Posting1114** bit0:0 , no error, 1 with error, refer to status buffer1115** bit1:0 , reserved (will be 0)1116** bit2:0 , reserved (will be 0)1117** bit3:0 , reserved (will be 0)1118** bit63-4: Completed command address1119**1120** <E> BIOS support, no special support is required.1121** LSI2108 support I/O register1122** All driver functionality is supported through I/O address1123**1124************************************************************************************************1125*/1126/*1127**********************************1128**1129**********************************1130*/1131/* size 8 bytes */1132/* 32bit Scatter-Gather list */1133struct SG32ENTRY { /* length bit 24 == 0 */1134u_int32_t length; /* high 8 bit == flag,low 24 bit == length */1135u_int32_t address;1136};1137/* size 12 bytes */1138/* 64bit Scatter-Gather list */1139struct SG64ENTRY { /* length bit 24 == 1 */1140u_int32_t length; /* high 8 bit == flag,low 24 bit == length */1141u_int32_t address;1142u_int32_t addresshigh;1143};1144struct SGENTRY_UNION {1145union {1146struct SG32ENTRY sg32entry; /* 30h Scatter gather address */1147struct SG64ENTRY sg64entry; /* 30h */1148}u;1149};1150/*1151**********************************1152**1153**********************************1154*/1155struct QBUFFER {1156u_int32_t data_len;1157u_int8_t data[124];1158};1159/*1160**********************************1161*/1162typedef struct PHYS_ADDR64 {1163u_int32_t phyadd_low;1164u_int32_t phyadd_high;1165}PHYSADDR64;1166/*1167************************************************************************************************1168** FIRMWARE INFO1169************************************************************************************************1170*/1171#define ARCMSR_FW_MODEL_OFFSET 151172#define ARCMSR_FW_VERS_OFFSET 171173#define ARCMSR_FW_DEVMAP_OFFSET 211174#define ARCMSR_FW_CFGVER_OFFSET 251175#define ARCMSR_FW_PICSTATUS 3011761177struct FIRMWARE_INFO {1178u_int32_t signature; /*0,00-03*/1179u_int32_t request_len; /*1,04-07*/1180u_int32_t numbers_queue; /*2,08-11*/1181u_int32_t sdram_size; /*3,12-15*/1182u_int32_t ide_channels; /*4,16-19*/1183char vendor[40]; /*5,20-59*/1184char model[8]; /*15,60-67*/1185char firmware_ver[16]; /*17,68-83*/1186char device_map[16]; /*21,84-99*/1187u_int32_t cfgVersion; /*25,100-103 Added for checking of new firmware capability*/1188char cfgSerial[16]; /*26,104-119*/1189u_int32_t cfgPicStatus; /*30,120-123*/1190};1191/* (A) For cfgVersion in FIRMWARE_INFO1192** if low BYTE (byte#0) >= 3 (version 3)1193** then byte#1 report the capability of the firmware can xfer in a single request1194**1195** byte#11196** 0 256K1197** 1 512K1198** 2 1M1199** 3 2M1200** 4 4M1201** 5 8M1202** 6 16M1203** (B) Byte offset 7 (Reserved1) of CDB is changed to msgPages1204** Driver support new xfer method need to set this field to indicate1205** large CDB block in 0x100 unit (we use 0x100 byte as one page)1206** e.g. If the length of CDB including MSG header and SGL is 0x15081207** driver need to set the msgPages to 0x161208** (C) REQ_LEN_512BYTE must be used also to indicate SRB length1209** e.g. CDB len msgPages REQ_LEN_512BYTE flag1210** <= 0x100 1 01211** <= 0x200 2 11212** <= 0x300 3 11213** <= 0x400 4 11214** .1215** .1216*/12171218/*1219************************************************************************************************1220** size 0x1F8 (504)1221************************************************************************************************1222*/1223struct ARCMSR_CDB {1224u_int8_t Bus; /* 00h should be 0 */1225u_int8_t TargetID; /* 01h should be 0--15 */1226u_int8_t LUN; /* 02h should be 0--7 */1227u_int8_t Function; /* 03h should be 1 */12281229u_int8_t CdbLength; /* 04h not used now */1230u_int8_t sgcount; /* 05h */1231u_int8_t Flags; /* 06h */1232u_int8_t msgPages; /* 07h */12331234u_int32_t Context; /* 08h Address of this request */1235u_int32_t DataLength; /* 0ch not used now */12361237u_int8_t Cdb[16]; /* 10h SCSI CDB */1238/*1239********************************************************1240** Device Status : the same from SCSI bus if error occur1241** SCSI bus status codes.1242********************************************************1243*/1244u_int8_t DeviceStatus; /* 20h if error */12451246u_int8_t SenseData[15]; /* 21h output */12471248union {1249struct SG32ENTRY sg32entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h Scatter gather address */1250struct SG64ENTRY sg64entry[ARCMSR_MAX_SG_ENTRIES]; /* 30h */1251} u;1252};1253/* CDB flag */1254#define ARCMSR_CDB_FLAG_SGL_BSIZE 0x01 /* bit 0: 0(256) / 1(512) bytes */1255#define ARCMSR_CDB_FLAG_BIOS 0x02 /* bit 1: 0(from driver) / 1(from BIOS) */1256#define ARCMSR_CDB_FLAG_WRITE 0x04 /* bit 2: 0(Data in) / 1(Data out) */1257#define ARCMSR_CDB_FLAG_SIMPLEQ 0x00 /* bit 4/3 ,00 : simple Q,01 : head of Q,10 : ordered Q */1258#define ARCMSR_CDB_FLAG_HEADQ 0x081259#define ARCMSR_CDB_FLAG_ORDEREDQ 0x101260/* scsi status */1261#define SCSISTAT_GOOD 0x001262#define SCSISTAT_CHECK_CONDITION 0x021263#define SCSISTAT_CONDITION_MET 0x041264#define SCSISTAT_BUSY 0x081265#define SCSISTAT_INTERMEDIATE 0x101266#define SCSISTAT_INTERMEDIATE_COND_MET 0x141267#define SCSISTAT_RESERVATION_CONFLICT 0x181268#define SCSISTAT_COMMAND_TERMINATED 0x221269#define SCSISTAT_QUEUE_FULL 0x281270/* DeviceStatus */1271#define ARCMSR_DEV_SELECT_TIMEOUT 0xF01272#define ARCMSR_DEV_ABORTED 0xF11273#define ARCMSR_DEV_INIT_FAIL 0xF21274/*1275*********************************************************************1276** Command Control Block (SrbExtension)1277** SRB must be not cross page boundary,and the order from offset 01278** structure describing an ATA disk request1279** this SRB length must be 32 bytes boundary1280*********************************************************************1281*/1282struct CommandControlBlock {1283struct ARCMSR_CDB arcmsr_cdb; /* 0 -503 (size of CDB=504): arcmsr messenger scsi command descriptor size 504 bytes */1284unsigned long cdb_phyaddr; /* 504-507 */1285/* ======================512+32 bytes============================ */1286union ccb *pccb; /* 512-515 516-519 pointer of freebsd scsi command */1287struct AdapterControlBlock *acb; /* 520-523 524-527 */1288bus_dmamap_t dm_segs_dmamap; /* 528-531 532-535 */1289u_int16_t srb_flags; /* 536-537 */1290u_int16_t srb_state; /* 538-539 */1291u_int32_t arc_cdb_size; /* 508-511 */1292struct callout ccb_callout;1293u_int32_t smid;1294/* ========================================================== */1295};1296/* srb_flags */1297#define SRB_FLAG_READ 0x00001298#define SRB_FLAG_WRITE 0x00011299#define SRB_FLAG_ERROR 0x00021300#define SRB_FLAG_FLUSHCACHE 0x00041301#define SRB_FLAG_MASTER_ABORTED 0x00081302#define SRB_FLAG_DMAVALID 0x00101303#define SRB_FLAG_DMACONSISTENT 0x00201304#define SRB_FLAG_DMAWRITE 0x00401305#define SRB_FLAG_PKTBIND 0x00801306#define SRB_FLAG_TIMER_START 0x00801307#define SRB_FLAG_DIRECT_IO 0x01001308#define SRB_FLAG_USE_SG 0x02001309/* srb_state */1310#define ARCMSR_SRB_DONE 0x00001311#define ARCMSR_SRB_UNBUILD 0x00001312#define ARCMSR_SRB_TIMEOUT 0x11111313#define ARCMSR_SRB_RETRY 0x22221314#define ARCMSR_SRB_START 0x55AA1315#define ARCMSR_SRB_PENDING 0xAA551316#define ARCMSR_SRB_RESET 0xA5A51317#define ARCMSR_SRB_ABORTED 0x5A5A1318#define ARCMSR_SRB_ILLEGAL 0xFFFF13191320#define SRB_SIZE ((sizeof(struct CommandControlBlock)+0x1f) & 0xffe0)1321#define ARCMSR_SRBS_POOL_SIZE (SRB_SIZE * ARCMSR_MAX_FREESRB_NUM)13221323/*1324*********************************************************************1325** Adapter Control Block1326*********************************************************************1327*/1328#define ACB_ADAPTER_TYPE_A 0x00000000 /* hba I IOP */1329#define ACB_ADAPTER_TYPE_B 0x00000001 /* hbb M IOP */1330#define ACB_ADAPTER_TYPE_C 0x00000002 /* hbc L IOP */1331#define ACB_ADAPTER_TYPE_D 0x00000003 /* hbd M IOP */1332#define ACB_ADAPTER_TYPE_E 0x00000004 /* hbd L IOP */1333#define ACB_ADAPTER_TYPE_F 0x00000005 /* hbd L IOP */13341335struct AdapterControlBlock {1336u_int32_t adapter_type; /* adapter A,B..... */13371338bus_space_tag_t btag[2];1339bus_space_handle_t bhandle[2];1340bus_dma_tag_t parent_dmat;1341bus_dma_tag_t dm_segs_dmat; /* dmat for buffer I/O */1342bus_dma_tag_t srb_dmat; /* dmat for freesrb */1343bus_dmamap_t srb_dmamap;1344device_t pci_dev;1345struct cdev *ioctl_dev;1346int pci_unit;13471348struct resource *sys_res_arcmsr[2];1349struct resource *irqres[ARCMSR_NUM_MSIX_VECTORS];1350void *ih[ARCMSR_NUM_MSIX_VECTORS]; /* interrupt handle */1351int irq_id[ARCMSR_NUM_MSIX_VECTORS];13521353/* Hooks into the CAM XPT */1354struct cam_sim *psim;1355struct cam_path *ppath;1356u_int8_t *uncacheptr;1357unsigned long vir2phy_offset;1358union {1359unsigned long phyaddr;1360struct {1361u_int32_t phyadd_low;1362u_int32_t phyadd_high;1363}B;1364}srb_phyaddr;1365// unsigned long srb_phyaddr;1366/* Offset is used in making arc cdb physical to virtual calculations */1367u_int32_t outbound_int_enable;13681369struct MessageUnit_UNION *pmu; /* message unit ATU inbound base address0 */1370vm_offset_t mem_base0;1371vm_offset_t mem_base1;1372uint32_t *message_wbuffer; //0x000 - COMPORT_IN (to be sent to ROC)1373uint32_t *message_rbuffer; //0x100 - COMPORT_OUT (to be sent to Host)1374uint32_t *msgcode_rwbuffer; //0x200 - BIOS_AREA13751376u_int8_t adapter_index;1377u_int8_t irq;1378u_int16_t acb_flags;13791380struct CommandControlBlock *psrb_pool[ARCMSR_MAX_FREESRB_NUM]; /* serial srb pointer array */1381struct CommandControlBlock *srbworkingQ[ARCMSR_MAX_FREESRB_NUM]; /* working srb pointer array */1382int32_t workingsrb_doneindex; /* done srb array index */1383int32_t workingsrb_startindex; /* start srb array index */1384int32_t srboutstandingcount;13851386u_int8_t rqbuffer[ARCMSR_MAX_QBUFFER]; /* data collection buffer for read from 80331 */1387u_int32_t rqbuf_firstindex; /* first of read buffer */1388u_int32_t rqbuf_lastindex; /* last of read buffer */13891390u_int8_t wqbuffer[ARCMSR_MAX_QBUFFER]; /* data collection buffer for write to 80331 */1391u_int32_t wqbuf_firstindex; /* first of write buffer */1392u_int32_t wqbuf_lastindex; /* last of write buffer */13931394arcmsr_lock_t isr_lock;1395arcmsr_lock_t srb_lock;1396arcmsr_lock_t postDone_lock;1397arcmsr_lock_t qbuffer_lock;13981399u_int8_t devstate[ARCMSR_MAX_TARGETID][ARCMSR_MAX_TARGETLUN]; /* id0 ..... id15,lun0...lun7 */1400u_int32_t num_resets;1401u_int32_t num_aborts;1402u_int32_t firm_request_len; /*1,04-07*/1403u_int32_t firm_numbers_queue; /*2,08-11*/1404u_int32_t firm_sdram_size; /*3,12-15*/1405u_int32_t firm_ide_channels; /*4,16-19*/1406u_int32_t firm_cfg_version;1407char firm_model[12]; /*15,60-67*/1408char firm_version[20]; /*17,68-83*/1409char device_map[20]; /*21,84-99 */1410u_int32_t firm_PicStatus;1411struct callout devmap_callout;1412u_int32_t pktRequestCount;1413u_int32_t pktReturnCount;1414u_int32_t vendor_device_id;1415u_int32_t adapter_bus_speed;1416u_int32_t maxOutstanding;1417u_int16_t sub_device_id;1418u_int32_t doneq_index;1419u_int32_t in_doorbell;1420u_int32_t out_doorbell;1421u_int32_t completionQ_entry;1422pCompletion_Q pCompletionQ;1423int xor_mega;1424int msix_vectors;1425int rid[2];1426unsigned long completeQ_phys;1427u_int32_t max_coherent_size;1428u_int8_t *xortable;1429unsigned long xor_sgtable_phy;1430bus_dma_tag_t xortable_dmat; /* dmat for xor table */1431bus_dmamap_t xortable_dmamap;1432u_int8_t *xorptr;1433bus_dma_tag_t xor_dmat; /* dmat for xor */1434bus_dmamap_t xor_dmamap;1435unsigned int init2cfg_size;1436unsigned int xorVirtOffset;1437};/* HW_DEVICE_EXTENSION */14381439struct HostRamBuf {1440u_int32_t hrbSignature; // must be "HRBS"1441u_int32_t hrbSize; // total buffer size(must be multiples of MB, this version should be 128+3 MB, i.e. 0x8300000)1442u_int32_t hrbRes[2]; // reserved, must be set to 01443};1444struct XorSg {1445u_int64_t xorPhys;1446u_int64_t xorBufLen;1447};1448#define ARCMSR_XOR_SEG_SIZE (1024 * 1024)1449#define ARCMSR_MAX_XOR_SEG 128 + 31450#define ARCMSR_DMA_ALLOC_FLAG (BUS_DMA_WAITOK | BUS_DMA_COHERENT | BUS_DMA_ZERO | BUS_DMA_NOCACHE)14511452/* acb_flags */1453#define ACB_F_SCSISTOPADAPTER 0x00011454#define ACB_F_MSG_STOP_BGRB 0x0002 /* stop RAID background rebuild */1455#define ACB_F_MSG_START_BGRB 0x0004 /* stop RAID background rebuild */1456#define ACB_F_IOPDATA_OVERFLOW 0x0008 /* iop ioctl data rqbuffer overflow */1457#define ACB_F_MESSAGE_WQBUFFER_CLEARED 0x0010 /* ioctl clear wqbuffer */1458#define ACB_F_MESSAGE_RQBUFFER_CLEARED 0x0020 /* ioctl clear rqbuffer */1459#define ACB_F_MESSAGE_WQBUFFER_READ 0x00401460#define ACB_F_BUS_RESET 0x00801461#define ACB_F_IOP_INITED 0x0100 /* iop init */1462#define ACB_F_MAPFREESRB_FAILD 0x0200 /* arcmsr_map_freesrb failed */1463#define ACB_F_CAM_DEV_QFRZN 0x04001464#define ACB_F_BUS_HANG_ON 0x0800 /* need hardware reset bus */1465#define ACB_F_SRB_FUNCTION_POWER 0x10001466#define ACB_F_MSIX_ENABLED 0x20001467#define ACB_F_MSG_GET_CONFIG 0x40001468#define ACB_F_DIRECT_IO 0x80001469#define ACB_F_DMAMAP_SRB 0x100001470#define ACB_F_DMAMAP_SGTABLE 0x200001471#define ACB_F_DMAMAP_SG 0x400001472#define ACB_F_MAPXOR_FAILD 0x800001473/* devstate */1474#define ARECA_RAID_GONE 0x551475#define ARECA_RAID_GOOD 0xaa1476/* adapter_bus_speed */1477#define ACB_BUS_SPEED_3G 01478#define ACB_BUS_SPEED_6G 11479#define ACB_BUS_SPEED_12G 21480/*1481*************************************************************1482*************************************************************1483*/1484struct SENSE_DATA {1485u_int8_t ErrorCode:7;1486u_int8_t Valid:1;1487u_int8_t SegmentNumber;1488u_int8_t SenseKey:4;1489u_int8_t Reserved:1;1490u_int8_t IncorrectLength:1;1491u_int8_t EndOfMedia:1;1492u_int8_t FileMark:1;1493u_int8_t Information[4];1494u_int8_t AdditionalSenseLength;1495u_int8_t CommandSpecificInformation[4];1496u_int8_t AdditionalSenseCode;1497u_int8_t AdditionalSenseCodeQualifier;1498u_int8_t FieldReplaceableUnitCode;1499u_int8_t SenseKeySpecific[3];1500};1501/*1502**********************************1503** Peripheral Device Type definitions1504**********************************1505*/1506#define SCSI_DASD 0x00 /* Direct-access Device */1507#define SCSI_SEQACESS 0x01 /* Sequential-access device */1508#define SCSI_PRINTER 0x02 /* Printer device */1509#define SCSI_PROCESSOR 0x03 /* Processor device */1510#define SCSI_WRITEONCE 0x04 /* Write-once device */1511#define SCSI_CDROM 0x05 /* CD-ROM device */1512#define SCSI_SCANNER 0x06 /* Scanner device */1513#define SCSI_OPTICAL 0x07 /* Optical memory device */1514#define SCSI_MEDCHGR 0x08 /* Medium changer device */1515#define SCSI_COMM 0x09 /* Communications device */1516#define SCSI_NODEV 0x1F /* Unknown or no device type */1517/*1518************************************************************************************************************1519** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@1520** 80331 PCI-to-PCI Bridge1521** PCI Configuration Space1522**1523** @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@1524** Programming Interface1525** ========================1526** Configuration Register Address Space Groupings and Ranges1527** =============================================================1528** Register Group Configuration Offset1529** -------------------------------------------------------------1530** Standard PCI Configuration 00-3Fh1531** -------------------------------------------------------------1532** Device Specific Registers 40-A7h1533** -------------------------------------------------------------1534** Reserved A8-CBh1535** -------------------------------------------------------------1536** Enhanced Capability List CC-FFh1537** ==========================================================================================================1538** Standard PCI [Type 1] Configuration Space Address Map1539** **********************************************************************************************************1540** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configu-ration Byte Offset1541** ----------------------------------------------------------------------------------------------------------1542** | Device ID | Vendor ID | 00h1543** ----------------------------------------------------------------------------------------------------------1544** | Primary Status | Primary Command | 04h1545** ----------------------------------------------------------------------------------------------------------1546** | Class Code | RevID | 08h1547** ----------------------------------------------------------------------------------------------------------1548** | reserved | Header Type | Primary MLT | Primary CLS | 0Ch1549** ----------------------------------------------------------------------------------------------------------1550** | Reserved | 10h1551** ----------------------------------------------------------------------------------------------------------1552** | Reserved | 14h1553** ----------------------------------------------------------------------------------------------------------1554** | Secondary MLT | Subordinate Bus Number | Secondary Bus Number | Primary Bus Number | 18h1555** ----------------------------------------------------------------------------------------------------------1556** | Secondary Status | I/O Limit | I/O Base | 1Ch1557** ----------------------------------------------------------------------------------------------------------1558** | Non-prefetchable Memory Limit Address | Non-prefetchable Memory Base Address | 20h1559** ----------------------------------------------------------------------------------------------------------1560** | Prefetchable Memory Limit Address | Prefetchable Memory Base Address | 24h1561** ----------------------------------------------------------------------------------------------------------1562** | Prefetchable Memory Base Address Upper 32 Bits | 28h1563** ----------------------------------------------------------------------------------------------------------1564** | Prefetchable Memory Limit Address Upper 32 Bits | 2Ch1565** ----------------------------------------------------------------------------------------------------------1566** | I/O Limit Upper 16 Bits | I/O Base Upper 16 | 30h1567** ----------------------------------------------------------------------------------------------------------1568** | Reserved | Capabilities Pointer | 34h1569** ----------------------------------------------------------------------------------------------------------1570** | Reserved | 38h1571** ----------------------------------------------------------------------------------------------------------1572** | Bridge Control | Primary Interrupt Pin | Primary Interrupt Line | 3Ch1573**=============================================================================================================1574*/1575/*1576**=============================================================================================================1577** 0x03-0x00 :1578** Bit Default Description1579**31:16 0335h Device ID (DID): Indicates the unique device ID that is assigned to bridge by the PCI SIG.1580** ID is unique per product speed as indicated.1581**15:00 8086h Vendor ID (VID): 16-bit field which indicates that Intel is the vendor.1582**=============================================================================================================1583*/1584#define ARCMSR_PCI2PCI_VENDORID_REG 0x00 /*word*/1585#define ARCMSR_PCI2PCI_DEVICEID_REG 0x02 /*word*/1586/*1587**==============================================================================1588** 0x05-0x04 : command register1589** Bit Default Description1590**15:11 00h Reserved1591** 10 0 Interrupt Disable: Disables/Enables the generation of Interrupts on the primary bus.1592** The bridge does not support interrupts.1593** 09 0 FB2B Enable: Enables/Disables the generation of fast back to back1594** transactions on the primary bus.1595** The bridge does not generate fast back to back1596** transactions on the primary bus.1597** 08 0 SERR# Enable (SEE): Enables primary bus SERR# assertions.1598** 0=The bridge does not assert P_SERR#.1599** 1=The bridge may assert P_SERR#, subject to other programmable criteria.1600** 07 0 Wait Cycle Control (WCC): Always returns 0bzero indicating1601** that bridge does not perform address or data stepping,1602** 06 0 Parity Error Response (PER): Controls bridge response to a detected primary bus parity error.1603** 0=When a data parity error is detected bridge does not assert S_PERR#.1604** Also bridge does not assert P_SERR# in response to1605** a detected address or attribute parity error.1606** 1=When a data parity error is detected bridge asserts S_PERR#.1607** The bridge also asserts P_SERR#1608** (when enabled globally via bit(8) of this register)1609** in response to a detected address or attribute parity error.1610** 05 0 VGA Palette Snoop Enable (VGA_PSE): Controls bridge response to VGA-compatible palette write transactions.1611** VGA palette write transactions are I/O transactions1612** whose address bits are: P_AD[9:0] equal to 3C6h, 3C8h or 3C9h1613** P_AD[15:10] are not decoded (i.e. aliases are claimed),1614** or are fully decoding1615** (i.e., must be all 0's depending upon the VGA1616** aliasing bit in the Bridge Control Register, offset 3Eh.1617** P_AD[31:16] equal to 0000h1618** 0=The bridge ignores VGA palette write transactions,1619** unless decoded by the standard I/O address range window.1620** 1=The bridge responds to VGA palette write transactions1621** with medium DEVSEL# timing and forwards them to the secondary bus.1622** 04 0 Memory Write and Invalidate Enable (MWIE): The bridge does not promote MW transactions to MWI transactions.1623** MWI transactions targeting resources on the opposite side of the bridge,1624** however, are forwarded as MWI transactions.1625** 03 0 Special Cycle Enable (SCE): The bridge ignores special cycle transactions.1626** This bit is read only and always returns 0 when read1627** 02 0 Bus Master Enable (BME): Enables bridge to initiate memory and I/O transactions on the primary interface.1628** Initiation of configuration transactions is not affected by the state of this bit.1629** 0=The bridge does not initiate memory or I/O transactions on the primary interface.1630** 1=The bridge is enabled to function as an initiator on the primary interface.1631** 01 0 Memory Space Enable (MSE): Controls target response to memory transactions on the primary interface.1632** 0=The bridge target response to memory transactions on the primary interface is disabled.1633** 1=The bridge target response to memory transactions on the primary interface is enabled.1634** 00 0 I/O Space Enable (IOSE): Controls target response to I/O transactions on the primary interface.1635** 0=The bridge target response to I/O transactions on the primary interface is disabled.1636** 1=The bridge target response to I/O transactions on the primary interface is enabled.1637**==============================================================================1638*/1639#define ARCMSR_PCI2PCI_PRIMARY_COMMAND_REG 0x04 /*word*/1640#define PCI_DISABLE_INTERRUPT 0x04001641/*1642**==============================================================================1643** 0x07-0x06 : status register1644** Bit Default Description1645** 15 0 Detected Parity Error: The bridge sets this bit to a 1b whenever it detects an address,1646** attribute or data parity error.1647** This bit is set regardless of the state of the PER bit in the command register.1648** 14 0 Signaled System Error: The bridge sets this bit to a 1b whenever it asserts SERR# on the primary bus.1649** 13 0 Received Master Abort: The bridge sets this bit to a 1b when,1650** acting as the initiator on the primary bus,1651** its transaction (with the exception of special cycles)1652** has been terminated with a Master Abort.1653** 12 0 Received Target Abort: The bridge sets this bit to a 1b when,1654** acting as the initiator on the primary bus,1655** its transaction has been terminated with a Target Abort.1656** 11 0 Signaled Target Abort: The bridge sets this bit to a 1b when it,1657** as the target of a transaction, terminates it with a Target Abort.1658** In PCI-X mode this bit is also set when it forwards a SCM with a target abort error code.1659** 10:09 01 DEVSEL# Timing: Indicates slowest response to a non-configuration command on the primary interface.1660** Returns ��01b�� when read, indicating that bridge responds no slower than with medium timing.1661** 08 0 Master Data Parity Error: The bridge sets this bit to a 1b when all of the following conditions are true:1662** The bridge is the current master on the primary bus1663** S_PERR# is detected asserted or is asserted by bridge1664** The Parity Error Response bit is set in the Command register1665** 07 1 Fast Back to Back Capable: Returns a 1b when read indicating that bridge1666** is able to respond to fast back to back transactions on its primary interface.1667** 06 0 Reserved1668** 05 1 66 MHz Capable Indication: Returns a 1b when read indicating that bridge primary interface is 66 MHz capable.1669** 1 =1670** 04 1 Capabilities List Enable: Returns 1b when read indicating that bridge supports PCI standard enhanced capabilities.1671** Offset 34h (Capability Pointer register)1672** provides the offset for the first entry1673** in the linked list of enhanced capabilities.1674** 03 0 Interrupt Status: Reflects the state of the interrupt in the device/function.1675** The bridge does not support interrupts.1676** 02:00 000 Reserved1677**==============================================================================1678*/1679#define ARCMSR_PCI2PCI_PRIMARY_STATUS_REG 0x06 /*word: 06,07 */1680#define ARCMSR_ADAP_66MHZ 0x201681/*1682**==============================================================================1683** 0x08 : revision ID1684** Bit Default Description1685** 07:00 00000000 Revision ID (RID): '00h' indicating bridge A-0 stepping.1686**==============================================================================1687*/1688#define ARCMSR_PCI2PCI_REVISIONID_REG 0x08 /*byte*/1689/*1690**==============================================================================1691** 0x0b-0x09 : 0180_00 (class code 1,native pci mode )1692** Bit Default Description1693** 23:16 06h Base Class Code (BCC): Indicates that this is a bridge device.1694** 15:08 04h Sub Class Code (SCC): Indicates this is of type PCI-to-PCI bridge.1695** 07:00 00h Programming Interface (PIF): Indicates that this is standard (non-subtractive) PCI-PCI bridge.1696**==============================================================================1697*/1698#define ARCMSR_PCI2PCI_CLASSCODE_REG 0x09 /*3bytes*/1699/*1700**==============================================================================1701** 0x0c : cache line size1702** Bit Default Description1703** 07:00 00h Cache Line Size (CLS): Designates the cache line size in 32-bit dword units.1704** The contents of this register are factored into1705** internal policy decisions associated with memory read prefetching,1706** and the promotion of Memory Write transactions to MWI transactions.1707** Valid cache line sizes are 8 and 16 dwords.1708** When the cache line size is set to an invalid value,1709** bridge behaves as though the cache line size was set to 00h.1710**==============================================================================1711*/1712#define ARCMSR_PCI2PCI_PRIMARY_CACHELINESIZE_REG 0x0C /*byte*/1713/*1714**==============================================================================1715** 0x0d : latency timer (number of pci clock 00-ff )1716** Bit Default Description1717** Primary Latency Timer (PTV):1718** 07:00 00h (Conventional PCI) Conventional PCI Mode: Primary bus Master latency timer. Indicates the number of PCI clock cycles,1719** referenced from the assertion of FRAME# to the expiration of the timer,1720** when bridge may continue as master of the current transaction. All bits are writable,1721** resulting in a granularity of 1 PCI clock cycle.1722** When the timer expires (i.e., equals 00h)1723** bridge relinquishes the bus after the first data transfer1724** when its PCI bus grant has been deasserted.1725** or 40h (PCI-X) PCI-X Mode: Primary bus Master latency timer.1726** Indicates the number of PCI clock cycles,1727** referenced from the assertion of FRAME# to the expiration of the timer,1728** when bridge may continue as master of the current transaction.1729** All bits are writable, resulting in a granularity of 1 PCI clock cycle.1730** When the timer expires (i.e., equals 00h) bridge relinquishes the bus at the next ADB.1731** (Except in the case where MLT expires within 3 data phases1732** of an ADB.In this case bridge continues on1733** until it reaches the next ADB before relinquishing the bus.)1734**==============================================================================1735*/1736#define ARCMSR_PCI2PCI_PRIMARY_LATENCYTIMER_REG 0x0D /*byte*/1737/*1738**==============================================================================1739** 0x0e : (header type,single function )1740** Bit Default Description1741** 07 0 Multi-function device (MVD): 80331 is a single-function device.1742** 06:00 01h Header Type (HTYPE): Defines the layout of addresses 10h through 3Fh in configuration space.1743** Returns ��01h�� when read indicating1744** that the register layout conforms to the standard PCI-to-PCI bridge layout.1745**==============================================================================1746*/1747#define ARCMSR_PCI2PCI_HEADERTYPE_REG 0x0E /*byte*/1748/*1749**==============================================================================1750** 0x0f :1751**==============================================================================1752*/1753/*1754**==============================================================================1755** 0x13-0x10 :1756** PCI CFG Base Address #0 (0x10)1757**==============================================================================1758*/1759/*1760**==============================================================================1761** 0x17-0x14 :1762** PCI CFG Base Address #1 (0x14)1763**==============================================================================1764*/1765/*1766**==============================================================================1767** 0x1b-0x18 :1768** PCI CFG Base Address #2 (0x18)1769**-----------------0x1A,0x19,0x18--Bus Number Register - BNR1770** Bit Default Description1771** 23:16 00h Subordinate Bus Number (SBBN): Indicates the highest PCI bus number below this bridge.1772** Any Type 1 configuration cycle1773** on the primary bus whose bus number is greater than the secondary bus number,1774** and less than or equal to the subordinate bus number1775** is forwarded unaltered as a Type 1 configuration cycle on the secondary PCI bus.1776** 15:08 00h Secondary Bus Number (SCBN): Indicates the bus number of PCI to which the secondary interface is connected.1777** Any Type 1 configuration cycle matching this bus number1778** is translated to a Type 0 configuration cycle (or a Special Cycle)1779** before being executed on bridge's secondary PCI bus.1780** 07:00 00h Primary Bus Number (PBN): Indicates bridge primary bus number.1781** Any Type 1 configuration cycle on the primary interface1782** with a bus number that is less than the contents1783** of this register field does not be claimed by bridge.1784**-----------------0x1B--Secondary Latency Timer Register - SLTR1785** Bit Default Description1786** Secondary Latency Timer (STV):1787** 07:00 00h (Conventional PCI) Conventional PCI Mode: Secondary bus Master latency timer.1788** Indicates the number of PCI clock cycles,1789** referenced from the assertion of FRAME# to the expiration of the timer,1790** when bridge may continue as master of the current transaction. All bits are writable,1791** resulting in a granularity of 1 PCI clock cycle.1792** When the timer expires (i.e., equals 00h)1793** bridge relinquishes the bus after the first data transfer1794** when its PCI bus grant has been deasserted.1795** or 40h (PCI-X) PCI-X Mode: Secondary bus Master latency timer.1796** Indicates the number of PCI clock cycles,referenced from the assertion of FRAME#1797** to the expiration of the timer,1798** when bridge may continue as master of the current transaction. All bits are writable,1799** resulting in a granularity of 1 PCI clock cycle.1800** When the timer expires (i.e., equals 00h) bridge relinquishes the bus at the next ADB.1801** (Except in the case where MLT expires within 3 data phases of an ADB.1802** In this case bridge continues on until it reaches the next ADB1803** before relinquishing the bus)1804**==============================================================================1805*/1806#define ARCMSR_PCI2PCI_PRIMARY_BUSNUMBER_REG 0x18 /*3byte 0x1A,0x19,0x18*/1807#define ARCMSR_PCI2PCI_SECONDARY_BUSNUMBER_REG 0x19 /*byte*/1808#define ARCMSR_PCI2PCI_SUBORDINATE_BUSNUMBER_REG 0x1A /*byte*/1809#define ARCMSR_PCI2PCI_SECONDARY_LATENCYTIMER_REG 0x1B /*byte*/1810/*1811**==============================================================================1812** 0x1f-0x1c :1813** PCI CFG Base Address #3 (0x1C)1814**-----------------0x1D,0x1C--I/O Base and Limit Register - IOBL1815** Bit Default Description1816** 15:12 0h I/O Limit Address Bits [15:12]: Defines the top address of an address range to1817** determine when to forward I/O transactions from one interface to the other.1818** These bits correspond to address lines 15:12 for 4KB alignment.1819** Bits 11:0 are assumed to be FFFh.1820** 11:08 1h I/O Limit Addressing Capability: This field is hard-wired to 1h, indicating support 32-bit I/O addressing.1821** 07:04 0h I/O Base Address Bits [15:12]: Defines the bottom address of1822** an address range to determine when to forward I/O transactions1823** from one interface to the other.1824** These bits correspond to address lines 15:12 for 4KB alignment.1825** Bits 11:0 are assumed to be 000h.1826** 03:00 1h I/O Base Addressing Capability: This is hard-wired to 1h, indicating support for 32-bit I/O addressing.1827**-----------------0x1F,0x1E--Secondary Status Register - SSR1828** Bit Default Description1829** 15 0b Detected Parity Error: The bridge sets this bit to a 1b whenever it detects an address,1830** attribute or data parity error on its secondary interface.1831** 14 0b Received System Error: The bridge sets this bit when it samples SERR# asserted on its secondary bus interface.1832** 13 0b Received Master Abort: The bridge sets this bit to a 1b when,1833** acting as the initiator on the secondary bus,1834** it's transaction (with the exception of special cycles)1835** has been terminated with a Master Abort.1836** 12 0b Received Target Abort: The bridge sets this bit to a 1b when,1837** acting as the initiator on the secondary bus,1838** it's transaction has been terminated with a Target Abort.1839** 11 0b Signaled Target Abort: The bridge sets this bit to a 1b when it,1840** as the target of a transaction, terminates it with a Target Abort.1841** In PCI-X mode this bit is also set when it forwards a SCM with a target abort error code.1842** 10:09 01b DEVSEL# Timing: Indicates slowest response to a non-configuration command on the secondary interface.1843** Returns ��01b�� when read, indicating that bridge responds no slower than with medium timing.1844** 08 0b Master Data Parity Error: The bridge sets this bit to a 1b when all of the following conditions are true:1845** The bridge is the current master on the secondary bus1846** S_PERR# is detected asserted or is asserted by bridge1847** The Parity Error Response bit is set in the Command register1848** 07 1b Fast Back-to-Back Capable (FBC): Indicates that the secondary interface of bridge can receive fast back-to-back cycles.1849** 06 0b Reserved1850** 05 1b 66 MHz Capable (C66): Indicates the secondary interface of the bridge is 66 MHz capable.1851** 1 =1852** 04:00 00h Reserved1853**==============================================================================1854*/1855#define ARCMSR_PCI2PCI_IO_BASE_REG 0x1C /*byte*/1856#define ARCMSR_PCI2PCI_IO_LIMIT_REG 0x1D /*byte*/1857#define ARCMSR_PCI2PCI_SECONDARY_STATUS_REG 0x1E /*word: 0x1F,0x1E */1858/*1859**==============================================================================1860** 0x23-0x20 :1861** PCI CFG Base Address #4 (0x20)1862**-----------------0x23,0x22,0x21,0x20--Memory Base and Limit Register - MBL1863** Bit Default Description1864** 31:20 000h Memory Limit: These 12 bits are compared with P_AD[31:20] of the incoming address to determine1865** the upper 1MB aligned value (exclusive) of the range.1866** The incoming address must be less than or equal to this value.1867** For the purposes of address decoding the lower 20 address bits (P_AD[19:0]1868** are assumed to be F FFFFh.1869** 19:16 0h Reserved.1870** 15:04 000h Memory Base: These 12 bits are compared with bits P_AD[31:20]1871** of the incoming address to determine the lower 1MB1872** aligned value (inclusive) of the range.1873** The incoming address must be greater than or equal to this value.1874** For the purposes of address decoding the lower 20 address bits (P_AD[19:0])1875** are assumed to be 0 0000h.1876** 03:00 0h Reserved.1877**==============================================================================1878*/1879#define ARCMSR_PCI2PCI_NONPREFETCHABLE_MEMORY_BASE_REG 0x20 /*word: 0x21,0x20 */1880#define ARCMSR_PCI2PCI_NONPREFETCHABLE_MEMORY_LIMIT_REG 0x22 /*word: 0x23,0x22 */1881/*1882**==============================================================================1883** 0x27-0x24 :1884** PCI CFG Base Address #5 (0x24)1885**-----------------0x27,0x26,0x25,0x24--Prefetchable Memory Base and Limit Register - PMBL1886** Bit Default Description1887** 31:20 000h Prefetchable Memory Limit: These 12 bits are compared with P_AD[31:20] of the incoming address to determine1888** the upper 1MB aligned value (exclusive) of the range.1889** The incoming address must be less than or equal to this value.1890** For the purposes of address decoding the lower 20 address bits (P_AD[19:0]1891** are assumed to be F FFFFh.1892** 19:16 1h 64-bit Indicator: Indicates that 64-bit addressing is supported.1893** 15:04 000h Prefetchable Memory Base: These 12 bits are compared with bits P_AD[31:20]1894** of the incoming address to determine the lower 1MB aligned value (inclusive)1895** of the range.1896** The incoming address must be greater than or equal to this value.1897** For the purposes of address decoding the lower 20 address bits (P_AD[19:0])1898** are assumed to be 0 0000h.1899** 03:00 1h 64-bit Indicator: Indicates that 64-bit addressing is supported.1900**==============================================================================1901*/1902#define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_BASE_REG 0x24 /*word: 0x25,0x24 */1903#define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_LIMIT_REG 0x26 /*word: 0x27,0x26 */1904/*1905**==============================================================================1906** 0x2b-0x28 :1907** Bit Default Description1908** 31:00 00000000h Prefetchable Memory Base Upper Portion: All bits are read/writable1909** bridge supports full 64-bit addressing.1910**==============================================================================1911*/1912#define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_BASE_UPPER32_REG 0x28 /*dword: 0x2b,0x2a,0x29,0x28 */1913/*1914**==============================================================================1915** 0x2f-0x2c :1916** Bit Default Description1917** 31:00 00000000h Prefetchable Memory Limit Upper Portion: All bits are read/writable1918** bridge supports full 64-bit addressing.1919**==============================================================================1920*/1921#define ARCMSR_PCI2PCI_PREFETCHABLE_MEMORY_LIMIT_UPPER32_REG 0x2C /*dword: 0x2f,0x2e,0x2d,0x2c */1922/*1923**==============================================================================1924** 0x33-0x30 :1925** Bit Default Description1926** 07:00 DCh Capabilities Pointer: Pointer to the first CAP ID entry in the capabilities list is at DCh in PCI configuration1927** space. (Power Management Capability Registers)1928**==============================================================================1929*/1930#define ARCMSR_PCI2PCI_CAPABILITIES_POINTER_REG 0x34 /*byte*/1931/*1932**==============================================================================1933** 0x3b-0x35 : reserved1934**==============================================================================1935*/1936/*1937**==============================================================================1938** 0x3d-0x3c :1939**1940** Bit Default Description1941** 15:08 00h Interrupt Pin (PIN): Bridges do not support the generation of interrupts.1942** 07:00 00h Interrupt Line (LINE): The bridge does not generate interrupts, so this is reserved as '00h'.1943**==============================================================================1944*/1945#define ARCMSR_PCI2PCI_PRIMARY_INTERRUPT_LINE_REG 0x3C /*byte*/1946#define ARCMSR_PCI2PCI_PRIMARY_INTERRUPT_PIN_REG 0x3D /*byte*/1947/*1948**==============================================================================1949** 0x3f-0x3e :1950** Bit Default Description1951** 15:12 0h Reserved1952** 11 0b Discard Timer SERR# Enable: Controls the generation of SERR# on the primary interface (P_SERR#) in response1953** to a timer discard on either the primary or secondary interface.1954** 0b=SERR# is not asserted.1955** 1b=SERR# is asserted.1956** 10 0b Discard Timer Status (DTS): This bit is set to a '1b' when either the primary or secondary discard timer expires.1957** The delayed completion is then discarded.1958** 09 0b Secondary Discard Timer (SDT): Sets the maximum number of PCI clock cycles1959** that bridge waits for an initiator on the secondary bus1960** to repeat a delayed transaction request.1961** The counter starts when the delayed transaction completion is ready1962** to be returned to the initiator.1963** When the initiator has not repeated the transaction1964** at least once before the counter expires,bridge1965** discards the delayed transaction from its queues.1966** 0b=The secondary master time-out counter is 2 15 PCI clock cycles.1967** 1b=The secondary master time-out counter is 2 10 PCI clock cycles.1968** 08 0b Primary Discard Timer (PDT): Sets the maximum number of PCI clock cycles1969** that bridge waits for an initiator on the primary bus1970** to repeat a delayed transaction request.1971** The counter starts when the delayed transaction completion1972** is ready to be returned to the initiator.1973** When the initiator has not repeated the transaction1974** at least once before the counter expires,1975** bridge discards the delayed transaction from its queues.1976** 0b=The primary master time-out counter is 2 15 PCI clock cycles.1977** 1b=The primary master time-out counter is 2 10 PCI clock cycles.1978** 07 0b Fast Back-to-Back Enable (FBE): The bridge does not initiate back to back transactions.1979** 06 0b Secondary Bus Reset (SBR):1980** When cleared to 0b: The bridge deasserts S_RST#,1981** when it had been asserted by writing this bit to a 1b.1982** When set to 1b: The bridge asserts S_RST#.1983** 05 0b Master Abort Mode (MAM): Dictates bridge behavior on the initiator bus1984** when a master abort termination occurs in response to1985** a delayed transaction initiated by bridge on the target bus.1986** 0b=The bridge asserts TRDY# in response to a non-locked delayed transaction,1987** and returns FFFF FFFFh when a read.1988** 1b=When the transaction had not yet been completed on the initiator bus1989** (e.g.,delayed reads, or non-posted writes),1990** then bridge returns a Target Abort in response to the original requester1991** when it returns looking for its delayed completion on the initiator bus.1992** When the transaction had completed on the initiator bus (e.g., a PMW),1993** then bridge asserts P_SERR# (when enabled).1994** For PCI-X transactions this bit is an enable for the assertion of P_SERR# due to a master abort1995** while attempting to deliver a posted memory write on the destination bus.1996** 04 0b VGA Alias Filter Enable: This bit dictates bridge behavior in conjunction with the VGA enable bit1997** (also of this register),1998** and the VGA Palette Snoop Enable bit (Command Register).1999** When the VGA enable, or VGA Palette Snoop enable bits are on (i.e., 1b)2000** the VGA Aliasing bit for the corresponding enabled functionality,:2001** 0b=Ignores address bits AD[15:10] when decoding VGA I/O addresses.2002** 1b=Ensures that address bits AD[15:10] equal 000000b when decoding VGA I/O addresses.2003** When all VGA cycle forwarding is disabled, (i.e., VGA Enable bit =0b and VGA Palette Snoop bit =0b),2004** then this bit has no impact on bridge behavior.2005** 03 0b VGA Enable: Setting this bit enables address decoding2006** and transaction forwarding of the following VGA transactions from the primary bus2007** to the secondary bus:2008** frame buffer memory addresses 000A0000h:000BFFFFh,2009** VGA I/O addresses 3B0:3BBh and 3C0h:3DFh, where AD[31:16]=��0000h?** ?and AD[15:10] are either not decoded (i.e., don't cares),2010** or must be ��000000b��2011** depending upon the state of the VGA Alias Filter Enable bit. (bit(4) of this register)2012** I/O and Memory Enable bits must be set in the Command register2013** to enable forwarding of VGA cycles.2014** 02 0b ISA Enable: Setting this bit enables special handling2015** for the forwarding of ISA I/O transactions that fall within the address range2016** specified by the I/O Base and Limit registers,2017** and are within the lowest 64Kbyte of the I/O address map2018** (i.e., 0000 0000h - 0000 FFFFh).2019** 0b=All I/O transactions that fall within the I/O Base2020** and Limit registers' specified range are forwarded2021** from primary to secondary unfiltered.2022** 1b=Blocks the forwarding from primary to secondary2023** of the top 768 bytes of each 1Kbyte alias.2024** On the secondary the top 768 bytes of each 1K alias2025** are inversely decoded and forwarded2026** from secondary to primary.2027** 01 0b SERR# Forward Enable: 0b=The bridge does not assert P_SERR# as a result of an S_SERR# assertion.2028** 1b=The bridge asserts P_SERR# whenever S_SERR# is detected2029** asserted provided the SERR# Enable bit is set (PCI Command Register bit(8)=1b).2030** 00 0b Parity Error Response: This bit controls bridge response to a parity error2031** that is detected on its secondary interface.2032** 0b=When a data parity error is detected bridge does not assert S_PERR#.2033** Also bridge does not assert P_SERR# in response to a detected address2034** or attribute parity error.2035** 1b=When a data parity error is detected bridge asserts S_PERR#.2036** The bridge also asserts P_SERR# (when enabled globally via bit(8)2037** of the Command register)2038** in response to a detected address or attribute parity error.2039**==============================================================================2040*/2041#define ARCMSR_PCI2PCI_BRIDGE_CONTROL_REG 0x3E /*word*/2042/*2043**************************************************************************2044** Device Specific Registers 40-A7h2045**************************************************************************2046** ----------------------------------------------------------------------------------------------------------2047** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configu-ration Byte Offset2048** ----------------------------------------------------------------------------------------------------------2049** | Bridge Control 0 | Arbiter Control/Status | Reserved | 40h2050** ----------------------------------------------------------------------------------------------------------2051** | Bridge Control 2 | Bridge Control 1 | 44h2052** ----------------------------------------------------------------------------------------------------------2053** | Reserved | Bridge Status | 48h2054** ----------------------------------------------------------------------------------------------------------2055** | Reserved | 4Ch2056** ----------------------------------------------------------------------------------------------------------2057** | Prefetch Policy | Multi-Transaction Timer | 50h2058** ----------------------------------------------------------------------------------------------------------2059** | Reserved | Pre-boot Status | P_SERR# Assertion Control | 54h2060** ----------------------------------------------------------------------------------------------------------2061** | Reserved | Reserved | Secondary Decode Enable | 58h2062** ----------------------------------------------------------------------------------------------------------2063** | Reserved | Secondary IDSEL | 5Ch2064** ----------------------------------------------------------------------------------------------------------2065** | Reserved | 5Ch2066** ----------------------------------------------------------------------------------------------------------2067** | Reserved | 68h:CBh2068** ----------------------------------------------------------------------------------------------------------2069**************************************************************************2070**==============================================================================2071** 0x42-0x41: Secondary Arbiter Control/Status Register - SACSR2072** Bit Default Description2073** 15:12 1111b Grant Time-out Violator: This field indicates the agent that violated the Grant Time-out rule2074** (PCI=16 clocks,PCI-X=6 clocks).2075** Note that this field is only meaningful when:2076** # Bit[11] of this register is set to 1b,2077** indicating that a Grant Time-out violation had occurred.2078** # bridge internal arbiter is enabled.2079** Bits[15:12] Violating Agent (REQ#/GNT# pair number)2080** 0000b REQ#/GNT#[0]2081** 0001b REQ#/GNT#[1]2082** 0010b REQ#/GNT#[2]2083** 0011b REQ#/GNT#[3]2084** 1111b Default Value (no violation detected)2085** When bit[11] is cleared by software, this field reverts back to its default value.2086** All other values are Reserved2087** 11 0b Grant Time-out Occurred: When set to 1b,2088** this indicates that a Grant Time-out error had occurred involving one of the secondary bus agents.2089** Software clears this bit by writing a 1b to it.2090** 10 0b Bus Parking Control: 0=During bus idle, bridge parks the bus on the last master to use the bus.2091** 1=During bus idle, bridge parks the bus on itself.2092** The bus grant is removed from the last master and internally asserted to bridge.2093** 09:08 00b Reserved2094** 07:00 0000 0000b Secondary Bus Arbiter Priority Configuration: The bridge secondary arbiter provides two rings of arbitration priority.2095** Each bit of this field assigns its corresponding secondary2096** bus master to either the high priority arbiter ring (1b)2097** or to the low priority arbiter ring (0b).2098** Bits [3:0] correspond to request inputs S_REQ#[3:0], respectively.2099** Bit [6] corresponds to the bridge internal secondary bus request2100** while Bit [7] corresponds to the SATU secondary bus request.2101** Bits [5:4] are unused.2102** 0b=Indicates that the master belongs to the low priority group.2103** 1b=Indicates that the master belongs to the high priority group2104**=================================================================================2105** 0x43: Bridge Control Register 0 - BCR02106** Bit Default Description2107** 07 0b Fully Dynamic Queue Mode: 0=The number of Posted write transactions is limited to eight2108** and the Posted Write data is limited to 4KB.2109** 1=Operation in fully dynamic queue mode. The bridge enqueues up to2110** 14 Posted Memory Write transactions and 8KB of posted write data.2111** 06:03 0H Reserved.2112** 02 0b Upstream Prefetch Disable: This bit disables bridge ability2113** to perform upstream prefetch operations for Memory2114** Read requests received on its secondary interface.2115** This bit also controls the bridge's ability to generate advanced read commands2116** when forwarding a Memory Read Block transaction request upstream from a PCI-X bus2117** to a Conventional PCI bus.2118** 0b=bridge treats all upstream Memory Read requests as though they target prefetchable memory.2119** The use of Memory Read Line and Memory Read2120** Multiple is enabled when forwarding a PCI-X Memory Read Block request2121** to an upstream bus operating in Conventional PCI mode.2122** 1b=bridge treats upstream PCI Memory Read requests as though2123** they target non-prefetchable memory and forwards upstream PCI-X Memory2124** Read Block commands as Memory Read2125** when the primary bus is operating2126** in Conventional PCI mode.2127** NOTE: This bit does not affect bridge ability to perform read prefetching2128** when the received command is Memory Read Line or Memory Read Multiple.2129**=================================================================================2130** 0x45-0x44: Bridge Control Register 1 - BCR1 (Sheet 2 of 2)2131** Bit Default Description2132** 15:08 0000000b Reserved2133** 07:06 00b Alias Command Mapping: This two bit field determines how bridge handles PCI-X ��Alias�� commands,2134** specifically the Alias to Memory Read Block and Alias to Memory Write Block commands.2135** The three options for handling these alias commands are to either pass it as is,2136** re-map to the actual block memory read/write command encoding, or ignore2137** the transaction forcing a Master Abort to occur on the Origination Bus.2138** Bit (7:6) Handling of command2139** 0 0 Re-map to Memory Read/Write Block before forwarding2140** 0 1 Enqueue and forward the alias command code unaltered2141** 1 0 Ignore the transaction, forcing Master Abort2142** 1 1 Reserved2143** 05 1b Watchdog Timers Disable: Disables or enables all 2 24 Watchdog Timers in both directions.2144** The watchdog timers are used to detect prohibitively long latencies in the system.2145** The watchdog timer expires when any Posted Memory Write (PMW), Delayed Request,2146** or Split Requests (PCI-X mode) is not completed within 2 24 events2147** (��events�� are defined as PCI Clocks when operating in PCI-X mode,2148** and as the number of times being retried when operating in Conventional PCI mode)2149** 0b=All 2 24 watchdog timers are enabled.2150** 1b=All 2 24 watchdog timers are disabled and there is no limits to2151** the number of attempts bridge makes when initiating a PMW,2152** transacting a Delayed Transaction, or how long it waits for2153** a split completion corresponding to one of its requests.2154** 04 0b GRANT# time-out disable: This bit enables/disables the GNT# time-out mechanism.2155** Grant time-out is 16 clocks for conventional PCI, and 6 clocks for PCI-X.2156** 0b=The Secondary bus arbiter times out an agent2157** that does not assert FRAME# within 16/6 clocks of receiving its grant,2158** once the bus has gone idle.2159** The time-out counter begins as soon as the bus goes idle with the new GNT# asserted.2160** An infringing agent does not receive a subsequent GNT#2161** until it de-asserts its REQ# for at least one clock cycle.2162** 1b=GNT# time-out mechanism is disabled.2163** 03 00b Reserved.2164** 02 0b Secondary Discard Timer Disable: This bit enables/disables bridge secondary delayed transaction discard mechanism.2165** The time out mechanism is used to ensure that initiators2166** of delayed transactions return for their delayed completion data/status2167** within a reasonable amount of time after it is available from bridge.2168** 0b=The secondary master time-out counter is enabled2169** and uses the value specified by the Secondary Discard Timer bit2170** (see Bridge Control Register).2171** 1b=The secondary master time-out counter is disabled.2172** The bridge waits indefinitely for a secondary bus master2173** to repeat a delayed transaction.2174** 01 0b Primary Discard Timer Disable: This bit enables/disables bridge primary delayed transaction discard mechanism.2175** The time out mechanism is used to ensure that initiators2176** of delayed transactions return for their delayed completion data/status2177** within a reasonable amount of time after it is available from bridge.2178** 0b=The primary master time-out counter is enabled and uses the value specified2179** by the Primary Discard Timer bit (see Bridge Control Register).2180** 1b=The secondary master time-out counter is disabled.2181** The bridge waits indefinitely for a secondary bus master2182** to repeat a delayed transaction.2183** 00 0b Reserved2184**=================================================================================2185** 0x47-0x46: Bridge Control Register 2 - BCR22186** Bit Default Description2187** 15:07 0000b Reserved.2188** 06 0b Global Clock Out Disable (External Secondary Bus Clock Source Enable):2189** This bit disables all of the secondary PCI clock outputs including2190** the feedback clock S_CLKOUT.2191** This means that the user is required to provide an S_CLKIN input source.2192** 05:04 11 (66 MHz) Preserved.2193** 01 (100 MHz)2194** 00 (133 MHz)2195** 03:00 Fh (100 MHz & 66 MHz)2196** 7h (133 MHz)2197** This 4 bit field provides individual enable/disable mask bits for each of bridge2198** secondary PCI clock outputs. Some, or all secondary clock outputs (S_CLKO[3:0])2199** default to being enabled following the rising edge of P_RST#, depending on the2200** frequency of the secondary bus clock:2201** �E Designs with 100 MHz (or lower) Secondary PCI clock power up with2202** all four S_CLKOs enabled by default. (SCLKO[3:0])�P2203** �E Designs with 133 MHz Secondary PCI clock power up2204** with the lower order 3 S_CLKOs enabled by default.2205** (S_CLKO[2:0]) Only those SCLKs that power up enabled by can be connected2206** to downstream device clock inputs.2207**=================================================================================2208** 0x49-0x48: Bridge Status Register - BSR2209** Bit Default Description2210** 15 0b Upstream Delayed Transaction Discard Timer Expired: This bit is set to a 1b and P_SERR#2211** is conditionally asserted when the secondary discard timer expires.2212** 14 0b Upstream Delayed/Split Read Watchdog Timer Expired:2213** Conventional PCI Mode: This bit is set to a 1b and P_SERR#2214** is conditionally asserted when bridge discards an upstream delayed read ** ** transaction request after 2 24 retries following the initial retry.2215** PCI-X Mode: This bit is set to a 1b and P_SERR# is conditionally asserted2216** when bridge discards an upstream split read request2217** after waiting in excess of 2 24 clocks for the corresponding2218** Split Completion to arrive.2219** 13 0b Upstream Delayed/Split Write Watchdog Timer Expired:2220** Conventional PCI Mode: This bit is set to a 1b and P_SERR#2221** is conditionally asserted when bridge discards an upstream delayed write ** ** transaction request after 2 24 retries following the initial retry.2222** PCI-X Mode: This bit is set to a 1b and P_SERR#2223** is conditionally asserted when bridge discards an upstream split write request ** after waiting in excess of 2 24 clocks for the corresponding2224** Split Completion to arrive.2225** 12 0b Master Abort during Upstream Posted Write: This bit is set to a 1b and P_SERR#2226** is conditionally asserted when a Master Abort occurs as a result of an attempt,2227** by bridge, to retire a PMW upstream.2228** 11 0b Target Abort during Upstream Posted Write: This bit is set to a 1b and P_SERR#2229** is conditionally asserted when a Target Abort occurs as a result of an attempt,2230** by bridge, to retire a PMW upstream.2231** 10 0b Upstream Posted Write Data Discarded: This bit is set to a 1b and P_SERR#2232** is conditionally asserted when bridge discards an upstream PMW transaction2233** after receiving 2 24 target retries from the primary bus target2234** 09 0b Upstream Posted Write Data Parity Error: This bit is set to a 1b and P_SERR#2235** is conditionally asserted when a data parity error is detected by bridge2236** while attempting to retire a PMW upstream2237** 08 0b Secondary Bus Address Parity Error: This bit is set to a 1b and P_SERR#2238** is conditionally asserted when bridge detects an address parity error on2239** the secondary bus.2240** 07 0b Downstream Delayed Transaction Discard Timer Expired: This bit is set to a 1b and P_SERR#2241** is conditionally asserted when the primary bus discard timer expires.2242** 06 0b Downstream Delayed/Split Read Watchdog Timer Expired:2243** Conventional PCI Mode: This bit is set to a 1b and P_SERR#2244** is conditionally asserted when bridge discards a downstream delayed read ** ** transaction request after receiving 2 24 target retries2245** from the secondary bus target.2246** PCI-X Mode: This bit is set to a 1b and P_SERR# is conditionally asserted2247** when bridge discards a downstream split read request2248** after waiting in excess of 2 24 clocks for the corresponding2249** Split Completion to arrive.2250** 05 0b Downstream Delayed Write/Split Watchdog Timer Expired:2251** Conventional PCI Mode: This bit is set to a 1b and P_SERR# is conditionally asserted2252** when bridge discards a downstream delayed write transaction request2253** after receiving 2 24 target retries from the secondary bus target.2254** PCI-X Mode: This bit is set to a 1b and P_SERR#2255** is conditionally asserted when bridge discards a downstream2256** split write request after waiting in excess of 2 24 clocks2257** for the corresponding Split Completion to arrive.2258** 04 0b Master Abort during Downstream Posted Write: This bit is set to a 1b and P_SERR#2259** is conditionally asserted when a Master Abort occurs as a result of an attempt,2260** by bridge, to retire a PMW downstream.2261** 03 0b Target Abort during Downstream Posted Write: This bit is set to a 1b and P_SERR# is conditionally asserted2262** when a Target Abort occurs as a result of an attempt, by bridge,2263** to retire a PMW downstream.2264** 02 0b Downstream Posted Write Data Discarded: This bit is set to a 1b and P_SERR#2265** is conditionally asserted when bridge discards a downstream PMW transaction2266** after receiving 2 24 target retries from the secondary bus target2267** 01 0b Downstream Posted Write Data Parity Error: This bit is set to a 1b and P_SERR#2268** is conditionally asserted when a data parity error is detected by bridge2269** while attempting to retire a PMW downstream.2270** 00 0b Primary Bus Address Parity Error: This bit is set to a 1b and P_SERR# is conditionally asserted2271** when bridge detects an address parity error on the primary bus.2272**==================================================================================2273** 0x51-0x50: Bridge Multi-Transaction Timer Register - BMTTR2274** Bit Default Description2275** 15:13 000b Reserved2276** 12:10 000b GRANT# Duration: This field specifies the count (PCI clocks)2277** that a secondary bus master has its grant maintained in order to enable2278** multiple transactions to execute within the same arbitration cycle.2279** Bit[02:00] GNT# Extended Duration2280** 000 MTT Disabled (Default=no GNT# extension)2281** 001 16 clocks2282** 010 32 clocks2283** 011 64 clocks2284** 100 128 clocks2285** 101 256 clocks2286** 110 Invalid (treated as 000)2287** 111 Invalid (treated as 000)2288** 09:08 00b Reserved2289** 07:00 FFh MTT Mask: This field enables/disables MTT usage for each REQ#/GNT#2290** pair supported by bridge secondary arbiter.2291** Bit(7) corresponds to SATU internal REQ#/GNT# pair,2292** bit(6) corresponds to bridge internal REQ#/GNT# pair,2293** bit(5) corresponds to REQ#/GNT#(5) pair, etc.2294** When a given bit is set to 1b, its corresponding REQ#/GNT#2295** pair is enabled for MTT functionality as determined by bits(12:10) of this register.2296** When a given bit is cleared to 0b, its corresponding REQ#/GNT# pair is disabled from using the MTT.2297**==================================================================================2298** 0x53-0x52: Read Prefetch Policy Register - RPPR2299** Bit Default Description2300** 15:13 000b ReRead_Primary Bus: 3-bit field indicating the multiplication factor2301** 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 satisfied2302** using the FirstRead parameter.2303** The default value of 000b correlates to: Command Type Hardwired pre-fetch amount Memory Read 4 DWORDs2304** Memory Read Line 1 cache lines Memory Read Multiple 2 cache lines2305** 12:10 000b FirstRead_Primary Bus: 3-bit field indicating the multiplication factor to be used in calculating2306** the number of bytes to prefetch from the secondary bus interface2307** on the initial PreFetch operation.2308** The default value of 000b correlates to: Command Type Hardwired pre-fetch amount Memory Read 4 DWORDs2309** Memory Read Line 1 cache line Memory Read Multiple 2 cache lines2310** 09:07 010b ReRead_Secondary Bus: 3-bit field indicating the multiplication factor to be used2311** in calculating the number of bytes to prefetch from the primary2312** bus interface on subsequent PreFetch operations given2313** that the read demands were not satisfied using2314** the FirstRead parameter.2315** The default value of 010b correlates to: Command Type Hardwired pre-fetch a2316** mount Memory Read 3 cache lines Memory Read Line 3 cache lines2317** Memory Read Multiple 6 cache lines2318** 06:04 000b FirstRead_Secondary Bus: 3-bit field indicating the multiplication factor to be used2319** in calculating the number of bytes to prefetch from2320** the primary bus interface on the initial PreFetch operation.2321** The default value of 000b correlates to: Command Type Hardwired pre-fetch amount2322** Memory Read 4 DWORDs Memory Read Line 1 cache line Memory Read Multiple 2 cache lines2323** 03:00 1111b Staged Prefetch Enable: This field enables/disables the FirstRead/ReRead pre-fetch2324** algorithm for the secondary and the primary bus interfaces.2325** Bit(3) is a ganged enable bit for REQ#/GNT#[7:3], and bits(2:0) provide individual2326** enable bits for REQ#/GNT#[2:0].2327** (bit(2) is the enable bit for REQ#/GNT#[2], etc...)2328** 1b: enables the staged pre-fetch feature2329** 0b: disables staged pre-fetch,2330** and hardwires read pre-fetch policy to the following for2331** Memory Read,2332** Memory Read Line,2333** and Memory Read Multiple commands:2334** Command Type Hardwired Pre-Fetch Amount...2335** Memory Read 4 DWORDs2336** Memory Read Line 1 cache line2337** Memory Read Multiple 2 cache lines2338** NOTE: When the starting address is not cache line aligned, bridge pre-fetches Memory Read line commands2339** only to the next higher cache line boundary.For non-cache line aligned Memory Read2340** Multiple commands bridge pre-fetches only to the second cache line boundary encountered.2341**==================================================================================2342** 0x55-0x54: P_SERR# Assertion Control - SERR_CTL2343** Bit Default Description2344** 15 0b Upstream Delayed Transaction Discard Timer Expired: Dictates the bridge behavior2345** in response to its discarding of a delayed transaction that was initiated from the primary bus.2346** 0b=bridge asserts P_SERR#.2347** 1b=bridge does not assert P_SERR#2348** 14 0b Upstream Delayed/Split Read Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.2349** 0b=bridge asserts P_SERR#.2350** 1b=bridge does not assert P_SERR#2351** 13 0b Upstream Delayed/Split Write Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.2352** 0b=bridge asserts P_SERR#.2353** 1b=bridge does not assert P_SERR#2354** 12 0b Master Abort during Upstream Posted Write: Dictates bridge behavior following2355** its having detected a Master Abort while attempting to retire one of its PMWs upstream.2356** 0b=bridge asserts P_SERR#.2357** 1b=bridge does not assert P_SERR#2358** 11 0b Target Abort during Upstream Posted Write: Dictates bridge behavior following2359** its having been terminated with Target Abort while attempting to retire one of its PMWs upstream.2360** 0b=bridge asserts P_SERR#.2361** 1b=bridge does not assert P_SERR#2362** 10 0b Upstream Posted Write Data Discarded: Dictates bridge behavior in the event that2363** it discards an upstream posted write transaction.2364** 0b=bridge asserts P_SERR#.2365** 1b=bridge does not assert P_SERR#2366** 09 0b Upstream Posted Write Data Parity Error: Dictates bridge behavior2367** when a data parity error is detected while attempting to retire on of its PMWs upstream.2368** 0b=bridge asserts P_SERR#.2369** 1b=bridge does not assert P_SERR#2370** 08 0b Secondary Bus Address Parity Error: This bit dictates bridge behavior2371** when it detects an address parity error on the secondary bus.2372** 0b=bridge asserts P_SERR#.2373** 1b=bridge does not assert P_SERR#2374** 07 0b Downstream Delayed Transaction Discard Timer Expired: Dictates bridge behavior in response to2375** its discarding of a delayed transaction that was initiated on the secondary bus.2376** 0b=bridge asserts P_SERR#.2377** 1b=bridge does not assert P_SERR#2378** 06 0b Downstream Delayed/Split Read Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.2379** 0b=bridge asserts P_SERR#.2380** 1b=bridge does not assert P_SERR#2381** 05 0b Downstream Delayed/Split Write Watchdog Timer Expired: Dictates bridge behavior following expiration of the subject watchdog timer.2382** 0b=bridge asserts P_SERR#.2383** 1b=bridge does not assert P_SERR#2384** 04 0b Master Abort during Downstream Posted Write: Dictates bridge behavior following2385** its having detected a Master Abort while attempting to retire one of its PMWs downstream.2386** 0b=bridge asserts P_SERR#.2387** 1b=bridge does not assert P_SERR#2388** 03 0b Target Abort during Downstream Posted Write: Dictates bridge behavior following2389** its having been terminated with Target Abort while attempting to retire one of its PMWs downstream.2390** 0b=bridge asserts P_SERR#.2391** 1b=bridge does not assert P_SERR#2392** 02 0b Downstream Posted Write Data Discarded: Dictates bridge behavior in the event2393** that it discards a downstream posted write transaction.2394** 0b=bridge asserts P_SERR#.2395** 1b=bridge does not assert P_SERR#2396** 01 0b Downstream Posted Write Data Parity Error: Dictates bridge behavior2397** when a data parity error is detected while attempting to retire on of its PMWs downstream.2398** 0b=bridge asserts P_SERR#.2399** 1b=bridge does not assert P_SERR#2400** 00 0b Primary Bus Address Parity Error: This bit dictates bridge behavior2401** when it detects an address parity error on the primary bus.2402** 0b=bridge asserts P_SERR#.2403** 1b=bridge does not assert P_SERR#2404**===============================================================================2405** 0x56: Pre-Boot Status Register - PBSR2406** Bit Default Description2407** 07 1 Reserved2408** 06 - Reserved - value indeterminate2409** 05:02 0 Reserved2410** 01 Varies with External State of S_133EN at PCI Bus Reset Secondary Bus Max Frequency Setting:2411** This bit reflect captured S_133EN strap,2412** indicating the maximum secondary bus clock frequency when in PCI-X mode.2413** Max Allowable Secondary Bus Frequency2414** ** S_133EN PCI-X Mode2415** ** 0 100 MHz2416** ** 1 133 MH2417** 00 0b Reserved2418**===============================================================================2419** 0x59-0x58: Secondary Decode Enable Register - SDER2420** Bit Default Description2421** 15:03 FFF1h Preserved.2422** 02 Varies with External State of PRIVMEM at PCI Bus Reset Private Memory Space Enable - when set,2423** bridge overrides its secondary inverse decode logic and not2424** forward upstream any secondary bus initiated DAC Memory transactions with AD(63)=1b.2425** This creates a private memory space on the Secondary PCI bus2426** that allows peer-to-peer transactions.2427** 01:00 10 2 Preserved.2428**===============================================================================2429** 0x5D-0x5C: Secondary IDSEL Select Register - SISR2430** Bit Default Description2431** 15:10 000000 2 Reserved.2432** 09 Varies with External State of PRIVDEV at PCI Bus Reset AD25- IDSEL Disable - When this bit is set,2433** AD25 is deasserted for any possible Type 1 to Type 0 conversion.2434** When this bit is clear,2435** AD25 is asserted when Primary addresses AD[15:11]=01001 2 during a Type 1 to Type 0 conversion.2436** 08 Varies with External State of PRIVDEV at PCI Bus Reset AD24- IDSEL Disable - When this bit is set,2437** AD24 is deasserted for any possible Type 1 to Type 0 conversion.2438** When this bit is clear,2439** AD24 is asserted when Primary addresses AD[15:11]=01000 2 during a Type 1 to Type 0 conversion.2440** 07 Varies with External State of PRIVDEV at PCI Bus Reset AD23- IDSEL Disable - When this bit is set,2441** AD23 is deasserted for any possible Type 1 to Type 0 conversion.2442** When this bit is clear,2443** AD23 is asserted when Primary addresses AD[15:11]=00111 2 during a Type 1 to Type 0 conversion.2444** 06 Varies with External State of PRIVDEV at PCI Bus Reset AD22- IDSEL Disable - When this bit is set,2445** AD22 is deasserted for any possible Type 1 to Type 0 conversion.2446** When this bit is clear,2447** AD22 is asserted when Primary addresses AD[15:11]=00110 2 during a Type 1 to Type 0 conversion.2448** 05 Varies with External State of PRIVDEV at PCI Bus Reset AD21- IDSEL Disable - When this bit is set,2449** AD21 is deasserted for any possible Type 1 to Type 0 conversion.2450** When this bit is clear,2451** AD21 is asserted when Primary addresses AD[15:11]=00101 2 during a Type 1 to Type 0 conversion.2452** 04 Varies with External State of PRIVDEV at PCI Bus Reset AD20- IDSEL Disable - When this bit is set,2453** AD20 is deasserted for any possible Type 1 to Type 0 conversion.2454** When this bit is clear,2455** AD20 is asserted when Primary addresses AD[15:11]=00100 2 during a Type 1 to Type 0 conversion.2456** 03 Varies with External State of PRIVDEV at PCI Bus Reset AD19- IDSEL Disable - When this bit is set,2457** AD19 is deasserted for any possible Type 1 to Type 0 conversion.2458** When this bit is clear,2459** AD19 is asserted when Primary addresses AD[15:11]=00011 2 during a Type 1 to Type 0 conversion.2460** 02 Varies with External State of PRIVDEV at PCI Bus Reset AD18- IDSEL Disable - When this bit is set,2461** AD18 is deasserted for any possible Type 1 to Type 0 conversion.2462** When this bit is clear,2463** AD18 is asserted when Primary addresses AD[15:11]=00010 2 during a Type 1 to Type 0 conversion.2464** 01 Varies with External State of PRIVDEV at PCI Bus Reset AD17- IDSEL Disable - When this bit is set,2465** AD17 is deasserted for any possible Type 1 to Type 0 conversion.2466** When this bit is clear,2467** AD17 is asserted when Primary addresses AD[15:11]=00001 2 during a Type 1 to Type 0 conversion.2468** 00 Varies with External State of PRIVDEV at PCI Bus Reset AD16- IDSEL Disable - When this bit is set,2469** AD16 is deasserted for any possible Type 1 to Type 0 conversion.2470** When this bit is clear,2471** AD16 is asserted when Primary addresses AD[15:11]=00000 2 during a Type 1 to Type 0 conversion.2472**************************************************************************2473*/2474/*2475**************************************************************************2476** Reserved A8-CBh2477**************************************************************************2478*/2479/*2480**************************************************************************2481** PCI Extended Enhanced Capabilities List CC-FFh2482**************************************************************************2483** ----------------------------------------------------------------------------------------------------------2484** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configu-ration Byte Offset2485** ----------------------------------------------------------------------------------------------------------2486** | Power Management Capabilities | Next Item Ptr | Capability ID | DCh2487** ----------------------------------------------------------------------------------------------------------2488** | PM Data | PPB Support | Extensions Power Management CSR | E0h2489** ----------------------------------------------------------------------------------------------------------2490** | Reserved | Reserved | Reserved | E4h2491** ----------------------------------------------------------------------------------------------------------2492** | Reserved | E8h2493** ----------------------------------------------------------------------------------------------------------2494** | Reserved | Reserved | Reserved | Reserved | ECh2495** ----------------------------------------------------------------------------------------------------------2496** | PCI-X Secondary Status | Next Item Ptr | Capability ID | F0h2497** ----------------------------------------------------------------------------------------------------------2498** | PCI-X Bridge Status | F4h2499** ----------------------------------------------------------------------------------------------------------2500** | PCI-X Upstream Split Transaction Control | F8h2501** ----------------------------------------------------------------------------------------------------------2502** | PCI-X Downstream Split Transaction Control | FCh2503** ----------------------------------------------------------------------------------------------------------2504**===============================================================================2505** 0xDC: Power Management Capabilities Identifier - PM_CAPID2506** Bit Default Description2507** 07:00 01h Identifier (ID): PCI SIG assigned ID for PCI-PM register block2508**===============================================================================2509** 0xDD: Next Item Pointer - PM_NXTP2510** Bit Default Description2511** 07:00 F0H Next Capabilities Pointer (PTR): The register defaults to F0H pointing to the PCI-X Extended Capability Header.2512**===============================================================================2513** 0xDF-0xDE: Power Management Capabilities Register - PMCR2514** Bit Default Description2515** 15:11 00h PME Supported (PME): PME# cannot be asserted by bridge.2516** 10 0h State D2 Supported (D2): Indicates no support for state D2. No power management action in this state.2517** 09 1h State D1 Supported (D1): Indicates support for state D1. No power management action in this state.2518** 08:06 0h Auxiliary Current (AUXC): This 3 bit field reports the 3.3Vaux auxiliary current requirements for the PCI function.2519** This returns 000b as PME# wake-up for bridge is not implemented.2520** 05 0 Special Initialization Required (SINT): Special initialization is not required for bridge.2521** 04:03 00 Reserved2522** 02:00 010 Version (VS): Indicates that this supports PCI Bus Power Management Interface Specification, Revision 1.1.2523**===============================================================================2524** 0xE1-0xE0: Power Management Control / Status - Register - PMCSR2525** Bit Default Description2526** 15:09 00h Reserved2527** 08 0b PME_Enable: This bit, when set to 1b enables bridge to assert PME#.2528** 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.2529** 07:02 00h Reserved2530** 01:00 00 Power State (PSTATE): This 2-bit field is used both to determine the current power state of2531** a function and to set the Function into a new power state.2532** 00 - D0 state2533** 01 - D1 state2534** 10 - D2 state2535** 11 - D3 hot state2536**===============================================================================2537** 0xE2: Power Management Control / Status PCI to PCI Bridge Support - PMCSR_BSE2538** Bit Default Description2539** 07 0 Bus Power/Clock Control Enable (BPCC_En): Indicates that the bus power/clock control policies have been disabled.2540** 06 0 B2/B3 support for D3 Hot (B2_B3#): The state of this bit determines the action that2541** is to occur as a direct result of programming the function to D3 hot.2542** This bit is only meaningful when bit 7 (BPCC_En) is a ��1��.2543** 05:00 00h Reserved2544**===============================================================================2545** 0xE3: Power Management Data Register - PMDR2546** Bit Default Description2547** 07:00 00h Reserved2548**===============================================================================2549** 0xF0: PCI-X Capabilities Identifier - PX_CAPID2550** Bit Default Description2551** 07:00 07h Identifier (ID): Indicates this is a PCI-X capabilities list.2552**===============================================================================2553** 0xF1: Next Item Pointer - PX_NXTP2554** Bit Default Description2555** 07:00 00h Next Item Pointer: Points to the next capability in the linked list The power on default value of this2556** register is 00h indicating that this is the last entry in the linked list of capabilities.2557**===============================================================================2558** 0xF3-0xF2: PCI-X Secondary Status - PX_SSTS2559** Bit Default Description2560** 15:09 00h Reserved2561** 08:06 Xxx Secondary Clock Frequency (SCF): This field is set with the frequency of the secondary bus.2562** The values are:2563** ** BitsMax FrequencyClock Period2564** ** 000PCI ModeN/A2565** ** 00166 152566** ** 010100102567** ** 0111337.52568** ** 1xxreservedreserved2569** ** The default value for this register is the operating frequency of the secondary bus2570** 05 0b Split Request Delayed. (SRD): This bit is supposed to be set by a bridge when it cannot forward a transaction on the2571** secondary bus to the primary bus because there is not enough room within the limit2572** specified in the Split Transaction Commitment Limit field in the Downstream Split2573** Transaction Control register. The bridge does not set this bit.2574** 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.2575** The bridge does not set this bit.2576** 03 0b Unexpected Split Completion (USC): This bit is set when an unexpected split completion with a requester ID2577** equal to bridge secondary bus number, device number 00h,2578** and function number 0 is received on the secondary interface.2579** This bit is cleared by software writing a '1'.2580** 02 0b Split Completion Discarded (SCD): This bit is set2581** when bridge discards a split completion moving toward the secondary bus2582** because the requester would not accept it. This bit cleared by software writing a '1'.2583** 01 1b 133 MHz Capable: Indicates that bridge is capable of running its secondary bus at 133 MHz2584** 00 1b 64-bit Device (D64): Indicates the width of the secondary bus as 64-bits.2585**===============================================================================2586** 0xF7-0xF6-0xf5-0xF4: PCI-X Bridge Status - PX_BSTS2587** Bit Default Description2588** 31:22 0 Reserved2589** 21 0 Split Request Delayed (SRD): This bit does not be set by bridge.2590** 20 0 Split Completion Overrun (SCO): This bit does not be set by bridge2591** because bridge throttles traffic on the completion side.2592** 19 0 Unexpected Split Completion (USC): The bridge sets this bit to 1b2593** when it encounters a corrupted Split Completion, possibly with an ** ** inconsistent remaining byte count.Software clears2594** this bit by writing a 1b to it.2595** 18 0 Split Completion Discarded (SCD): The bridge sets this bit to 1b2596** when it has discarded a Split Completion.Software clears this bit by ** ** writing a 1b to it.2597** 17 1 133 MHz Capable: This bit indicates that the bridge primary interface is ** capable of 133 MHz operation in PCI-X mode.2598** 0=The maximum operating frequency is 66 MHz.2599** 1=The maximum operating frequency is 133 MHz.2600** 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.2601** 0=Primary Interface is connected as a 32-bit PCI bus.2602** 1=Primary Interface is connected as a 64-bit PCI bus.2603** 15:08 00h Bus Number (BNUM): This field is simply an alias to the PBN field2604** of the BNUM register at offset 18h.2605** Apparently it was deemed necessary reflect it here for diagnostic purposes.2606** 07:03 1fh Device Number (DNUM): Indicates which IDSEL bridge consumes.2607** May be updated whenever a PCI-X2608** configuration write cycle that targets bridge scores a hit.2609** 02:00 0h Function Number (FNUM): The bridge Function #2610**===============================================================================2611** 0xFB-0xFA-0xF9-0xF8: PCI-X Upstream Split Transaction Control - PX_USTC2612** Bit Default Description2613** 31:16 003Eh Split Transaction Limit (STL): This register indicates the size of the commitment limit in units of ADQs.2614** Software is permitted to program this register to any value greater than or equal to2615** the contents of the Split Transaction Capacity register. A value less than the contents2616** of the Split Transaction Capacity register causes unspecified results.2617** A value of 003Eh or greater enables the bridge to forward all Split Requests of any2618** size regardless of the amount of buffer space available.2619** 15:00 003Eh Split Transaction Capacity (STC): This read-only field indicates the size of the buffer (number of ADQs) for storing2620** split completions. This register controls behavior of the bridge buffers for forwarding2621** Split Transactions from a primary bus requester to a secondary bus completer.2622** The default value of 003Eh indicates there is available buffer space for 62 ADQs (7936 bytes).2623**===============================================================================2624** 0xFF-0xFE-0xFD-0xFC: PCI-X Downstream Split Transaction Control - PX_DSTC2625** Bit Default Description2626** 31:16 003Eh Split Transaction Limit (STL): This register indicates the size of the commitment limit in units of ADQs.2627** Software is permitted to program this register to any value greater than or equal to2628** the contents of the Split Transaction Capacity register. A value less than the contents2629** of the Split Transaction Capacity register causes unspecified results.2630** A value of 003Eh or greater enables the bridge to forward all Split Requests of any2631** size regardless of the amount of buffer space available.2632** 15:00 003Eh Split Transaction Capacity (STC): This read-only field indicates the size of the buffer (number of ADQs) for storing2633** split completions. This register controls behavior of the bridge buffers for forwarding2634** Split Transactions from a primary bus requester to a secondary bus completer.2635** The default value of 003Eh indicates there is available buffer space for 62 ADQs2636** (7936 bytes).2637**************************************************************************2638*/26392640/*2641*************************************************************************************************************************************2642** 80331 Address Translation Unit Register Definitions2643** ATU Interface Configuration Header Format2644** The ATU is programmed via a [Type 0] configuration command on the PCI interface.2645*************************************************************************************************************************************2646** | Byte 3 | Byte 2 | Byte 1 | Byte 0 | Configuration Byte Offset2647**===================================================================================================================================2648** | ATU Device ID | Vendor ID | 00h2649** ----------------------------------------------------------------------------------------------------------2650** | Status | Command | 04H2651** ----------------------------------------------------------------------------------------------------------2652** | ATU Class Code | Revision ID | 08H2653** ----------------------------------------------------------------------------------------------------------2654** | ATUBISTR | Header Type | Latency Timer | Cacheline Size | 0CH2655** ----------------------------------------------------------------------------------------------------------2656** | Inbound ATU Base Address 0 | 10H2657** ----------------------------------------------------------------------------------------------------------2658** | Inbound ATU Upper Base Address 0 | 14H2659** ----------------------------------------------------------------------------------------------------------2660** | Inbound ATU Base Address 1 | 18H2661** ----------------------------------------------------------------------------------------------------------2662** | Inbound ATU Upper Base Address 1 | 1CH2663** ----------------------------------------------------------------------------------------------------------2664** | Inbound ATU Base Address 2 | 20H2665** ----------------------------------------------------------------------------------------------------------2666** | Inbound ATU Upper Base Address 2 | 24H2667** ----------------------------------------------------------------------------------------------------------2668** | Reserved | 28H2669** ----------------------------------------------------------------------------------------------------------2670** | ATU Subsystem ID | ATU Subsystem Vendor ID | 2CH2671** ----------------------------------------------------------------------------------------------------------2672** | Expansion ROM Base Address | 30H2673** ----------------------------------------------------------------------------------------------------------2674** | Reserved Capabilities Pointer | 34H2675** ----------------------------------------------------------------------------------------------------------2676** | Reserved | 38H2677** ----------------------------------------------------------------------------------------------------------2678** | Maximum Latency | Minimum Grant | Interrupt Pin | Interrupt Line | 3CH2679** ----------------------------------------------------------------------------------------------------------2680*********************************************************************************************************************2681*/2682/*2683***********************************************************************************2684** ATU Vendor ID Register - ATUVID2685** -----------------------------------------------------------------2686** Bit Default Description2687** 15:00 8086H (0x17D3) ATU Vendor ID - This is a 16-bit value assigned to Intel.2688** This register, combined with the DID, uniquely identify the PCI device.2689** Access type is Read/Write to allow the 80331 to configure the register as a different vendor ID2690** to simulate the interface of a standard mechanism currently used by existing application software.2691***********************************************************************************2692*/2693#define ARCMSR_ATU_VENDOR_ID_REG 0x00 /*word*/2694/*2695***********************************************************************************2696** ATU Device ID Register - ATUDID2697** -----------------------------------------------------------------2698** Bit Default Description2699** 15:00 0336H (0x1110) ATU Device ID - This is a 16-bit value assigned to the ATU.2700** This ID, combined with the VID, uniquely identify any PCI device.2701***********************************************************************************2702*/2703#define ARCMSR_ATU_DEVICE_ID_REG 0x02 /*word*/2704/*2705***********************************************************************************2706** ATU Command Register - ATUCMD2707** -----------------------------------------------------------------2708** Bit Default Description2709** 15:11 000000 2 Reserved2710** 10 0 Interrupt Disable - This bit disables 80331 from asserting the ATU interrupt signal.2711** 0=enables the assertion of interrupt signal.2712** 1=disables the assertion of its interrupt signal.2713** 09 0 2 Fast Back to Back Enable - When cleared,2714** the ATU interface is not allowed to generate fast back-to-back cycles on its bus.2715** Ignored when operating in the PCI-X mode.2716** 08 0 2 SERR# Enable - When cleared, the ATU interface is not allowed to assert SERR# on the PCI interface.2717** 07 1 2 Address/Data Stepping Control - Address stepping is implemented for configuration transactions. The2718** ATU inserts 2 clock cycles of address stepping for Conventional Mode and 4 clock cycles2719** of address stepping for PCI-X mode.2720** 06 0 2 Parity Error Response - When set, the ATU takes normal action when a parity error2721** is detected. When cleared, parity checking is disabled.2722** 05 0 2 VGA Palette Snoop Enable - The ATU interface does not support I/O writes and therefore,2723** does not perform VGA palette snooping.2724** 04 0 2 Memory Write and Invalidate Enable - When set, ATU may generate MWI commands.2725** When clear, ATU use Memory Write commands instead of MWI. Ignored when operating in the PCI-X mode.2726** 03 0 2 Special Cycle Enable - The ATU interface does not respond to special cycle commands in any way.2727** Not implemented and a reserved bit field.2728** 02 0 2 Bus Master Enable - The ATU interface can act as a master on the PCI bus.2729** When cleared, disables the device from generating PCI accesses.2730** When set, allows the device to behave as a PCI bus master.2731** When operating in the PCI-X mode, ATU initiates a split completion transaction regardless2732** of the state of this bit.2733** 01 0 2 Memory Enable - Controls the ATU interface��s response to PCI memory addresses.2734** When cleared, the ATU interface does not respond to any memory access on the PCI bus.2735** 00 0 2 I/O Space Enable - Controls the ATU interface response to I/O transactions.2736** Not implemented and a reserved bit field.2737***********************************************************************************2738*/2739#define ARCMSR_ATU_COMMAND_REG 0x04 /*word*/2740/*2741***********************************************************************************2742** ATU Status Register - ATUSR (Sheet 1 of 2)2743** -----------------------------------------------------------------2744** Bit Default Description2745** 15 0 2 Detected Parity Error - set when a parity error is detected in data received by the ATU on the PCI bus even2746** when the ATUCMD register��s Parity Error Response bit is cleared. Set under the following conditions:2747** �E Write Data Parity Error when the ATU is a target (inbound write).2748** �E Read Data Parity Error when the ATU is a requester (outbound read).2749** �E Any Address or Attribute (PCI-X Only) Parity Error on the Bus ** ** ** (including one generated by the ATU).2750** 14 0 2 SERR# Asserted - set when SERR# is asserted on the PCI bus by the ATU.2751** 13 0 2 Master Abort - set when a transaction initiated by the ATU PCI master interface, ends in a Master-Abort2752** or when the ATU receives a Master Abort Split Completion Error Message in PCI-X mode.2753** 12 0 2 Target Abort (master) - set when a transaction initiated by the ATU PCI master interface, ends in a target2754** abort or when the ATU receives a Target Abort Split Completion Error Message in PCI-X mode.2755** 11 0 2 Target Abort (target) - set when the ATU interface, acting as a target,2756** terminates the transaction on the PCI bus with a target abort.2757** 10:09 01 2 DEVSEL# Timing - These bits are read-only and define the slowest DEVSEL#2758** timing for a target device in Conventional PCI Mode regardless of the operating mode2759** (except configuration accesses).2760** 00 2=Fast2761** 01 2=Medium2762** 10 2=Slow2763** 11 2=Reserved2764** The ATU interface uses Medium timing.2765** 08 0 2 Master Parity Error - The ATU interface sets this bit under the following conditions:2766** �E The ATU asserted PERR# itself or the ATU observed PERR# asserted.2767** �E And the ATU acted as the requester2768** for the operation in which the error occurred.2769** �E And the ATUCMD register��s Parity Error Response bit is set2770** �E Or (PCI-X Mode Only) the ATU received a Write Data Parity Error Message2771** �E And the ATUCMD register��s Parity Error Response bit is set2772** 07 1 2 (Conventional mode)2773** 0 2 (PCI-X mode)2774** Fast Back-to-Back - The ATU/Messaging Unit interface is capable of accepting fast back-to-back2775** transactions in Conventional PCI mode when the transactions are not to the same target. Since fast2776** back-to-back transactions do not exist in PCI-X mode, this bit is forced to 0 in the PCI-X mode.2777** 06 0 2 UDF Supported - User Definable Features are not supported2778** 05 1 2 66 MHz. Capable - 66 MHz operation is supported.2779** 04 1 2 Capabilities - When set, this function implements extended capabilities.2780** 03 0 Interrupt Status - reflects the state of the ATU interrupt2781** when the Interrupt Disable bit in the command register is a 0.2782** 0=ATU interrupt signal deasserted.2783** 1=ATU interrupt signal asserted.2784** NOTE: Setting the Interrupt Disable bit to a 1 has no effect on the state of this bit. Refer to2785** Section 3.10.23, ��ATU Interrupt Pin Register - ATUIPR�� on page 236 for details on the ATU2786** interrupt signal.2787** 02:00 00000 2 Reserved.2788***********************************************************************************2789*/2790#define ARCMSR_ATU_STATUS_REG 0x06 /*word*/2791/*2792***********************************************************************************2793** ATU Revision ID Register - ATURID2794** -----------------------------------------------------------------2795** Bit Default Description2796** 07:00 00H ATU Revision - identifies the 80331 revision number.2797***********************************************************************************2798*/2799#define ARCMSR_ATU_REVISION_REG 0x08 /*byte*/2800/*2801***********************************************************************************2802** ATU Class Code Register - ATUCCR2803** -----------------------------------------------------------------2804** Bit Default Description2805** 23:16 05H Base Class - Memory Controller2806** 15:08 80H Sub Class - Other Memory Controller2807** 07:00 00H Programming Interface - None defined2808***********************************************************************************2809*/2810#define ARCMSR_ATU_CLASS_CODE_REG 0x09 /*3bytes 0x0B,0x0A,0x09*/2811/*2812***********************************************************************************2813** ATU Cacheline Size Register - ATUCLSR2814** -----------------------------------------------------------------2815** Bit Default Description2816** 07:00 00H ATU Cacheline Size - specifies the system cacheline size in DWORDs. Cacheline size is restricted to either 0, 8 or 16 DWORDs.2817***********************************************************************************2818*/2819#define ARCMSR_ATU_CACHELINE_SIZE_REG 0x0C /*byte*/2820/*2821***********************************************************************************2822** ATU Latency Timer Register - ATULT2823** -----------------------------------------------------------------2824** Bit Default Description2825** 07:03 00000 2 (for Conventional mode)2826** 01000 2 (for PCI-X mode)2827** Programmable Latency Timer - This field varies the latency timer for the interface from 0 to 248 clocks.2828** The default value is 0 clocks for Conventional PCI mode, and 64 clocks for PCI-X mode.2829** 02:00 000 2 Latency Timer Granularity - These Bits are read only giving a programmable granularity of 8 clocks for the latency timer.2830***********************************************************************************2831*/2832#define ARCMSR_ATU_LATENCY_TIMER_REG 0x0D /*byte*/2833/*2834***********************************************************************************2835** ATU Header Type Register - ATUHTR2836** -----------------------------------------------------------------2837** Bit Default Description2838** 07 0 2 Single Function/Multi-Function Device - Identifies the 80331 as a single-function PCI device.2839** 06:00 000000 2 PCI Header Type - This bit field indicates the type of PCI header implemented. The ATU interface2840** header conforms to PCI Local Bus Specification, Revision 2.3.2841***********************************************************************************2842*/2843#define ARCMSR_ATU_HEADER_TYPE_REG 0x0E /*byte*/2844/*2845***********************************************************************************2846** ATU BIST Register - ATUBISTR2847**2848** The ATU BIST Register controls the functions the Intel XScale core performs when BIST is2849** initiated. This register is the interface between the host processor requesting BIST functions and2850** the 80331 replying with the results from the software implementation of the BIST functionality.2851** -----------------------------------------------------------------2852** Bit Default Description2853** 07 0 2 BIST Capable - This bit value is always equal to the ATUCR ATU BIST Interrupt Enable bit.2854** 06 0 2 Start BIST - When the ATUCR BIST Interrupt Enable bit is set:2855** Setting this bit generates an interrupt to the Intel XScale core to perform a software BIST function.2856** The Intel XScale core clears this bit when the BIST software has completed with the BIST results2857** found in ATUBISTR register bits [3:0].2858** When the ATUCR BIST Interrupt Enable bit is clear:2859** Setting this bit does not generate an interrupt to the Intel XScale core and no BIST functions is performed.2860** The Intel XScale core does not clear this bit.2861** 05:04 00 2 Reserved2862** 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):2863** The Intel XScale core places the results of the software BIST in these bits.2864** A nonzero value indicates a device-specific error.2865***********************************************************************************2866*/2867#define ARCMSR_ATU_BIST_REG 0x0F /*byte*/28682869/*2870***************************************************************************************2871** ATU Base Registers and Associated Limit Registers2872***************************************************************************************2873** Base Address Register Limit Register Description2874** Inbound ATU Base Address Register 0 Inbound ATU Limit Register 0 Defines the inbound translation window 0 from the PCI bus.2875** 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.2876** Inbound ATU Base Address Register 1 Inbound ATU Limit Register 1 Defines inbound window 1 from the PCI bus.2877** 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.2878** Inbound ATU Base Address Register 2 Inbound ATU Limit Register 2 Defines the inbound translation window 2 from the PCI bus.2879** 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.2880** Inbound ATU Base Address Register 3 Inbound ATU Limit Register 3 Defines the inbound translation window 3 from the PCI bus.2881** 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.2882** NOTE: This is a private BAR that resides outside of the standard PCI configuration header space (offsets 00H-3FH).2883** 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.2884**--------------------------------------------------------------------------------------2885** ATU Inbound Window 1 is not a translate window.2886** The ATU does not claim any PCI accesses that fall within this range.2887** This window is used to allocate host memory for use by Private Devices.2888** When enabled, the ATU interrupts the Intel XScale core when either the IABAR1 register or the IAUBAR1 register is written from the PCI bus.2889***********************************************************************************2890*/28912892/*2893***********************************************************************************2894** Inbound ATU Base Address Register 0 - IABAR02895**2896** . The Inbound ATU Base Address Register 0 (IABAR0) together with the Inbound ATU Upper Base Address Register 0 (IAUBAR0)2897** defines the block of memory addresses where the inbound translation window 0 begins.2898** . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory.2899** . The IABAR0 and IAUBAR0 define the base address and describes the required memory block size.2900** . Bits 31 through 12 of the IABAR0 is either read/write bits or read only with a value of 02901** depending on the value located within the IALR0.2902** This configuration allows the IABAR0 to be programmed per PCI Local Bus Specification.2903** The first 4 Kbytes of memory defined by the IABAR0, IAUBAR0 and the IALR0 is reserved for the Messaging Unit.2904** The programmed value within the base address register must comply with the PCI programming requirements for address alignment.2905** Warning:2906** When IALR0 is cleared prior to host configuration:2907** the user should also clear the Prefetchable Indicator and the Type Indicator.2908** Assuming IALR0 is not cleared:2909** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary,2910** when the Prefetchable Indicator is cleared prior to host configuration,2911** the user should also set the Type Indicator for 32 bit addressability.2912** b. For compliance to the PCI-X Addendum to the PCI Local Bus Specification,2913** when the Prefetchable Indicator is set prior to host configuration, the user2914** should also set the Type Indicator for 64 bit addressability.2915** This is the default for IABAR0.2916** -----------------------------------------------------------------2917** Bit Default Description2918** 31:12 00000H Translation Base Address 0 - These bits define the actual location2919** the translation function is to respond to when addressed from the PCI bus.2920** 11:04 00H Reserved.2921** 03 1 2 Prefetchable Indicator - When set, defines the memory space as prefetchable.2922** 02:01 10 2 Type Indicator - Defines the width of the addressability for this memory window:2923** 00 - Memory Window is locatable anywhere in 32 bit address space2924** 10 - Memory Window is locatable anywhere in 64 bit address space2925** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address.2926** The ATU does not occupy I/O space,2927** thus this bit must be zero.2928***********************************************************************************2929*/2930#define ARCMSR_INBOUND_ATU_BASE_ADDRESS0_REG 0x10 /*dword 0x13,0x12,0x11,0x10*/2931#define ARCMSR_INBOUND_ATU_MEMORY_PREFETCHABLE 0x082932#define ARCMSR_INBOUND_ATU_MEMORY_WINDOW64 0x042933/*2934***********************************************************************************2935** Inbound ATU Upper Base Address Register 0 - IAUBAR02936**2937** This register contains the upper base address when decoding PCI addresses beyond 4 GBytes.2938** Together with the Translation Base Address this register defines the actual location the translation2939** function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs).2940** The programmed value within the base address register must comply with the PCI programming requirements for address alignment.2941** Note:2942** When the Type indicator of IABAR0 is set to indicate 32 bit addressability,2943** the IAUBAR0 register attributes are read-only.2944** -----------------------------------------------------------------2945** Bit Default Description2946** 31:0 00000H Translation Upper Base Address 0 - Together with the Translation Base Address 0 these bits define the2947** actual location the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes.2948***********************************************************************************2949*/2950#define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS0_REG 0x14 /*dword 0x17,0x16,0x15,0x14*/2951/*2952***********************************************************************************2953** Inbound ATU Base Address Register 1 - IABAR12954**2955** . The Inbound ATU Base Address Register (IABAR1) together with the Inbound ATU Upper Base Address Register 1 (IAUBAR1)2956** defines the block of memory addresses where the inbound translation window 1 begins.2957** . 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.2958** . The programmed value within the base address register must comply with the PCI programming requirements for address alignment.2959** . When enabled, the ATU interrupts the Intel XScale core when the IABAR1 register is written from the PCI bus.2960** Warning:2961** When a non-zero value is not written to IALR1 prior to host configuration,2962** the user should not set either the Prefetchable Indicator or the Type Indicator for 64 bit addressability.2963** This is the default for IABAR1.2964** Assuming a non-zero value is written to IALR1,2965** the user may set the Prefetchable Indicator2966** or the Type Indicator:2967** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address2968** boundary, when the Prefetchable Indicator is not set prior to host configuration,2969** the user should also leave the Type Indicator set for 32 bit addressability.2970** This is the default for IABAR1.2971** b. when the Prefetchable Indicator is set prior to host configuration,2972** the user should also set the Type Indicator for 64 bit addressability.2973** -----------------------------------------------------------------2974** Bit Default Description2975** 31:12 00000H Translation Base Address 1 - These bits define the actual location of window 1 on the PCI bus.2976** 11:04 00H Reserved.2977** 03 0 2 Prefetchable Indicator - When set, defines the memory space as prefetchable.2978** 02:01 00 2 Type Indicator - Defines the width of the addressability for this memory window:2979** 00 - Memory Window is locatable anywhere in 32 bit address space2980** 10 - Memory Window is locatable anywhere in 64 bit address space2981** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address.2982** The ATU does not occupy I/O space,2983** thus this bit must be zero.2984***********************************************************************************2985*/2986#define ARCMSR_INBOUND_ATU_BASE_ADDRESS1_REG 0x18 /*dword 0x1B,0x1A,0x19,0x18*/2987/*2988***********************************************************************************2989** Inbound ATU Upper Base Address Register 1 - IAUBAR12990**2991** This register contains the upper base address when locating this window for PCI addresses beyond 4 GBytes.2992** Together with the IABAR1 this register defines the actual location for this memory window for addresses > 4GBytes (for DACs).2993** 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.2994** The programmed value within the base address register must comply with the PCI programming2995** requirements for address alignment.2996** When enabled, the ATU interrupts the Intel XScale core when the IAUBAR1 register is written2997** from the PCI bus.2998** Note:2999** When the Type indicator of IABAR1 is set to indicate 32 bit addressability,3000** the IAUBAR1 register attributes are read-only.3001** This is the default for IABAR1.3002** -----------------------------------------------------------------3003** Bit Default Description3004** 31:0 00000H Translation Upper Base Address 1 - Together with the Translation Base Address 13005** these bits define the actual location for this memory window on the PCI bus for addresses > 4GBytes.3006***********************************************************************************3007*/3008#define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS1_REG 0x1C /*dword 0x1F,0x1E,0x1D,0x1C*/3009/*3010***********************************************************************************3011** Inbound ATU Base Address Register 2 - IABAR23012**3013** . The Inbound ATU Base Address Register 2 (IABAR2) together with the Inbound ATU Upper Base Address Register 2 (IAUBAR2)3014** defines the block of memory addresses where the inbound translation window 2 begins.3015** . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory.3016** . The IABAR2 and IAUBAR2 define the base address and describes the required memory block size3017** . 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.3018** The programmed value within the base address register must comply with the PCI programming requirements for address alignment.3019** Warning:3020** When a non-zero value is not written to IALR2 prior to host configuration,3021** the user should not set either the Prefetchable Indicator3022** or the Type Indicator for 64 bit addressability.3023** This is the default for IABAR2.3024** Assuming a non-zero value is written to IALR2,3025** the user may set the Prefetchable Indicator3026** or the Type Indicator:3027** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary,3028** when the Prefetchable Indicator is not set prior to host configuration,3029** the user should also leave the Type Indicator set for 32 bit addressability.3030** This is the default for IABAR2.3031** b. when the Prefetchable Indicator is set prior to host configuration,3032** the user should also set the Type Indicator for 64 bit addressability.3033** -----------------------------------------------------------------3034** Bit Default Description3035** 31:12 00000H Translation Base Address 2 - These bits define the actual location3036** the translation function is to respond to when addressed from the PCI bus.3037** 11:04 00H Reserved.3038** 03 0 2 Prefetchable Indicator - When set, defines the memory space as prefetchable.3039** 02:01 00 2 Type Indicator - Defines the width of the addressability for this memory window:3040** 00 - Memory Window is locatable anywhere in 32 bit address space3041** 10 - Memory Window is locatable anywhere in 64 bit address space3042** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address.3043** The ATU does not occupy I/O space,3044** thus this bit must be zero.3045***********************************************************************************3046*/3047#define ARCMSR_INBOUND_ATU_BASE_ADDRESS2_REG 0x20 /*dword 0x23,0x22,0x21,0x20*/3048/*3049***********************************************************************************3050** Inbound ATU Upper Base Address Register 2 - IAUBAR23051**3052** This register contains the upper base address when decoding PCI addresses beyond 4 GBytes.3053** Together with the Translation Base Address this register defines the actual location3054** the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs).3055** The programmed value within the base address register must comply with the PCI programming3056** requirements for address alignment.3057** Note:3058** When the Type indicator of IABAR2 is set to indicate 32 bit addressability,3059** the IAUBAR2 register attributes are read-only.3060** This is the default for IABAR2.3061** -----------------------------------------------------------------3062** Bit Default Description3063** 31:0 00000H Translation Upper Base Address 2 - Together with the Translation Base Address 23064** these bits define the actual location the translation function is to respond to3065** when addressed from the PCI bus for addresses > 4GBytes.3066***********************************************************************************3067*/3068#define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS2_REG 0x24 /*dword 0x27,0x26,0x25,0x24*/3069/*3070***********************************************************************************3071** ATU Subsystem Vendor ID Register - ASVIR3072** -----------------------------------------------------------------3073** Bit Default Description3074** 15:0 0000H Subsystem Vendor ID - This register uniquely identifies the add-in board or subsystem vendor.3075***********************************************************************************3076*/3077#define ARCMSR_ATU_SUBSYSTEM_VENDOR_ID_REG 0x2C /*word 0x2D,0x2C*/3078/*3079***********************************************************************************3080** ATU Subsystem ID Register - ASIR3081** -----------------------------------------------------------------3082** Bit Default Description3083** 15:0 0000H Subsystem ID - uniquely identifies the add-in board or subsystem.3084***********************************************************************************3085*/3086#define ARCMSR_ATU_SUBSYSTEM_ID_REG 0x2E /*word 0x2F,0x2E*/3087/*3088***********************************************************************************3089** Expansion ROM Base Address Register -ERBAR3090** -----------------------------------------------------------------3091** Bit Default Description3092** 31:12 00000H Expansion ROM Base Address - These bits define the actual location3093** where the Expansion ROM address window resides when addressed from the PCI bus on any 4 Kbyte boundary.3094** 11:01 000H Reserved3095** 00 0 2 Address Decode Enable - This bit field shows the ROM address3096** decoder is enabled or disabled. When cleared, indicates the address decoder is disabled.3097***********************************************************************************3098*/3099#define ARCMSR_EXPANSION_ROM_BASE_ADDRESS_REG 0x30 /*dword 0x33,0x32,0v31,0x30*/3100#define ARCMSR_EXPANSION_ROM_ADDRESS_DECODE_ENABLE 0x013101/*3102***********************************************************************************3103** ATU Capabilities Pointer Register - ATU_CAP_PTR3104** -----------------------------------------------------------------3105** Bit Default Description3106** 07:00 C0H Capability List Pointer - This provides an offset in this function��s configuration space3107** that points to the 80331 PCl Bus Power Management extended capability.3108***********************************************************************************3109*/3110#define ARCMSR_ATU_CAPABILITY_PTR_REG 0x34 /*byte*/3111/*3112***********************************************************************************3113** Determining Block Sizes for Base Address Registers3114** The required address size and type can be determined by writing ones to a base address register and3115** reading from the registers. By scanning the returned value from the least-significant bit of the base3116** address registers upwards, the programmer can determine the required address space size. The3117** binary-weighted value of the first non-zero bit found indicates the required amount of space.3118** Table 105 describes the relationship between the values read back and the byte sizes the base3119** address register requires.3120** As an example, assume that FFFF.FFFFH is written to the ATU Inbound Base Address Register 03121** (IABAR0) and the value read back is FFF0.0008H. Bit zero is a zero, so the device requires3122** memory address space. Bit three is one, so the memory does supports prefetching. Scanning3123** upwards starting at bit four, bit twenty is the first one bit found. The binary-weighted value of this3124** bit is 1,048,576, indicated that the device requires 1 Mbyte of memory space.3125** The ATU Base Address Registers and the Expansion ROM Base Address Register use their3126** associated limit registers to enable which bits within the base address register are read/write and3127** which bits are read only (0). This allows the programming of these registers in a manner similar to3128** other PCI devices even though the limit is variable.3129** Table 105. Memory Block Size Read Response3130** Response After Writing all 1s3131** to the Base Address Register3132** Size3133** (Bytes)3134** Response After Writing all 1s3135** to the Base Address Register3136** Size3137** (Bytes)3138** FFFFFFF0H 16 FFF00000H 1 M3139** FFFFFFE0H 32 FFE00000H 2 M3140** FFFFFFC0H 64 FFC00000H 4 M3141** FFFFFF80H 128 FF800000H 8 M3142** FFFFFF00H 256 FF000000H 16 M3143** FFFFFE00H 512 FE000000H 32 M3144** FFFFFC00H 1K FC000000H 64 M3145** FFFFF800H 2K F8000000H 128 M3146** FFFFF000H 4K F0000000H 256 M3147** FFFFE000H 8K E0000000H 512 M3148** FFFFC000H 16K C0000000H 1 G3149** FFFF8000H 32K 80000000H 2 G3150** FFFF0000H 64K3151** 00000000H3152** Register not3153** imple-mented,3154** no3155** address3156** space3157** required.3158** FFFE0000H 128K3159** FFFC0000H 256K3160** FFF80000H 512K3161**3162***************************************************************************************3163*/31643165/*3166***********************************************************************************3167** ATU Interrupt Line Register - ATUILR3168** -----------------------------------------------------------------3169** Bit Default Description3170** 07:00 FFH Interrupt Assigned - system-assigned value identifies which system interrupt controller��s interrupt3171** request line connects to the device's PCI interrupt request lines3172** (as specified in the interrupt pin register).3173** A value of FFH signifies ��no connection�� or ��unknown��.3174***********************************************************************************3175*/3176#define ARCMSR_ATU_INTERRUPT_LINE_REG 0x3C /*byte*/3177/*3178***********************************************************************************3179** ATU Interrupt Pin Register - ATUIPR3180** -----------------------------------------------------------------3181** Bit Default Description3182** 07:00 01H Interrupt Used - A value of 01H signifies that the ATU interface unit uses INTA# as the interrupt pin.3183***********************************************************************************3184*/3185#define ARCMSR_ATU_INTERRUPT_PIN_REG 0x3D /*byte*/3186/*3187***********************************************************************************3188** ATU Minimum Grant Register - ATUMGNT3189** -----------------------------------------------------------------3190** Bit Default Description3191** 07:00 80H This register specifies how long a burst period the device needs in increments of 8 PCI clocks.3192***********************************************************************************3193*/3194#define ARCMSR_ATU_MINIMUM_GRANT_REG 0x3E /*byte*/3195/*3196***********************************************************************************3197** ATU Maximum Latency Register - ATUMLAT3198** -----------------------------------------------------------------3199** Bit Default Description3200** 07:00 00H Specifies frequency (how often) the device needs to access the PCI bus3201** in increments of 8 PCI clocks. A zero value indicates the device has no stringent requirement.3202***********************************************************************************3203*/3204#define ARCMSR_ATU_MAXIMUM_LATENCY_REG 0x3F /*byte*/3205/*3206***********************************************************************************3207** Inbound Address Translation3208**3209** The ATU allows external PCI bus initiators to directly access the internal bus.3210** These PCI bus initiators can read or write 80331 memory-mapped registers or 80331 local memory space.3211** The process of inbound address translation involves two steps:3212** 1. Address Detection.3213** �E Determine when the 32-bit PCI address (64-bit PCI address during DACs) is3214** within the address windows defined for the inbound ATU.3215** �E Claim the PCI transaction with medium DEVSEL# timing in the conventional PCI3216** mode and with Decode A DEVSEL# timing in the PCI-X mode.3217** 2. Address Translation.3218** �E Translate the 32-bit PCI address (lower 32-bit PCI address during DACs) to a 32-bit 80331 internal bus address.3219** The ATU uses the following registers in inbound address window 0 translation:3220** �E Inbound ATU Base Address Register 03221** �E Inbound ATU Limit Register 03222** �E Inbound ATU Translate Value Register 03223** The ATU uses the following registers in inbound address window 2 translation:3224** �E Inbound ATU Base Address Register 23225** �E Inbound ATU Limit Register 23226** �E Inbound ATU Translate Value Register 23227** The ATU uses the following registers in inbound address window 3 translation:3228** �E Inbound ATU Base Address Register 33229** �E Inbound ATU Limit Register 33230** �E Inbound ATU Translate Value Register 33231** Note: Inbound Address window 1 is not a translate window.3232** Instead, window 1 may be used to allocate host memory for Private Devices.3233** Inbound Address window 3 does not reside in the standard section of the configuration header (offsets 00H - 3CH),3234** thus the host BIOS does not configure window 3.3235** Window 3 is intended to be used as a special window into local memory for private PCI3236** agents controlled by the 80331 in conjunction with the Private Memory Space of the bridge.3237** PCI-to-PCI Bridge in 80331 or3238** Inbound address detection is determined from the 32-bit PCI address,3239** (64-bit PCI address during DACs) the base address register and the limit register.3240** In the case of DACs none of the upper 32-bits of the address is masked during address comparison.3241**3242** The algorithm for detection is:3243**3244** Equation 1. Inbound Address Detection3245** When (PCI_Address [31:0] & Limit_Register[31:0]) == (Base_Register[31:0] & PCI_Address [63:32]) == Base_Register[63:32] (for DACs only)3246** the PCI Address is claimed by the Inbound ATU.3247**3248** The incoming 32-bit PCI address (lower 32-bits of the address in case of DACs) is bitwise ANDed3249** with the associated inbound limit register.3250** When the result matches the base register (and upper base address matches upper PCI address in case of DACs),3251** the inbound PCI address is detected as being within the inbound translation window and is claimed by the ATU.3252**3253** Note: The first 4 Kbytes of the ATU inbound address translation window 0 are reserved for the Messaging Unit.3254** Once the transaction is claimed, the address must be translated from a PCI address to a 32-bit3255** internal bus address. In case of DACs upper 32-bits of the address is simply discarded and only the3256** lower 32-bits are used during address translation.3257** The algorithm is:3258**3259**3260** Equation 2. Inbound Translation3261** Intel I/O processor Internal Bus Address=(PCI_Address[31:0] & ~Limit_Register[31:0]) | ATU_Translate_Value_Register[31:0].3262**3263** The incoming 32-bit PCI address (lower 32-bits in case of DACs) is first bitwise ANDed with the3264** bitwise inverse of the limit register. This result is bitwise ORed with the ATU Translate Value and3265** the result is the internal bus address. This translation mechanism is used for all inbound memory3266** read and write commands excluding inbound configuration read and writes.3267** In the PCI mode for inbound memory transactions, the only burst order supported is Linear3268** Incrementing. For any other burst order, the ATU signals a Disconnect after the first data phase.3269** The PCI-X supports linear incrementing only, and hence above situation is not encountered in the PCI-X mode.3270** example:3271** Register Values3272** Base_Register=3A00 0000H3273** Limit_Register=FF80 0000H (8 Mbyte limit value)3274** Value_Register=B100 0000H3275** Inbound Translation Window ranges from 3A00 0000H to 3A7F FFFFH (8 Mbytes)3276**3277** Address Detection (32-bit address)3278**3279** PCI_Address & Limit_Register == Base_Register3280** 3A45 012CH & FF80 0000H == 3A00 0000H3281**3282** ANS: PCI_Address is in the Inbound Translation Window3283** Address Translation (to get internal bus address)3284**3285** IB_Address=(PCI_Address & ~Limit_Register) | Value_Reg3286** IB_Address=(3A45 012CH & 007F FFFFH) | B100 0000H3287**3288** ANS:IB_Address=B145 012CH3289***********************************************************************************3290*/32913292/*3293***********************************************************************************3294** Inbound ATU Limit Register 0 - IALR03295**3296** Inbound address translation for memory window 0 occurs for data transfers occurring from the PCI3297** bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts3298** PCI addresses to internal bus addresses.3299** The 80331 translate value register��s programmed value must be naturally aligned with the base3300** address register��s programmed value. The limit register is used as a mask; thus, the lower address3301** bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus3302** Specification, Revision 2.3 for additional information on programming base address registers.3303** Bits 31 to 12 within the IALR0 have a direct effect on the IABAR0 register, bits 31 to 12, with a3304** one to one correspondence. A value of 0 in a bit within the IALR0 makes the corresponding bit3305** within the IABAR0 a read only bit which always returns 0. A value of 1 in a bit within the IALR03306** makes the corresponding bit within the IABAR0 read/write from PCI. Note that a consequence of3307** this programming scheme is that unless a valid value exists within the IALR0, all writes to the3308** IABAR0 has no effect since a value of all zeros within the IALR0 makes the IABAR0 a read only register.3309** -----------------------------------------------------------------3310** Bit Default Description3311** 31:12 FF000H Inbound Translation Limit 0 - This readback value determines the memory block size required for3312** inbound memory window 0 of the address translation unit. This defaults to an inbound window of 16MB.3313** 11:00 000H Reserved3314***********************************************************************************3315*/3316#define ARCMSR_INBOUND_ATU_LIMIT0_REG 0x40 /*dword 0x43,0x42,0x41,0x40*/3317/*3318***********************************************************************************3319** Inbound ATU Translate Value Register 0 - IATVR03320**3321** The Inbound ATU Translate Value Register 0 (IATVR0) contains the internal bus address used to3322** convert PCI bus addresses. The converted address is driven on the internal bus as a result of the3323** inbound ATU address translation.3324** -----------------------------------------------------------------3325** Bit Default Description3326** 31:12 FF000H Inbound ATU Translation Value 0 - This value is used to convert the PCI address to internal bus addresses.3327** This value must be 64-bit aligned on the internal bus.3328** The default address allows the ATU to access the internal 80331 memory-mapped registers.3329** 11:00 000H Reserved3330***********************************************************************************3331*/3332#define ARCMSR_INBOUND_ATU_TRANSLATE_VALUE0_REG 0x44 /*dword 0x47,0x46,0x45,0x44*/3333/*3334***********************************************************************************3335** Expansion ROM Limit Register - ERLR3336**3337** The Expansion ROM Limit Register (ERLR) defines the block size of addresses the ATU defines3338** as Expansion ROM address space. The block size is programmed by writing a value into the ERLR.3339** Bits 31 to 12 within the ERLR have a direct effect on the ERBAR register, bits 31 to 12, with a one3340** to one correspondence. A value of 0 in a bit within the ERLR makes the corresponding bit within3341** the ERBAR a read only bit which always returns 0. A value of 1 in a bit within the ERLR makes3342** the corresponding bit within the ERBAR read/write from PCI.3343** -----------------------------------------------------------------3344** Bit Default Description3345** 31:12 000000H Expansion ROM Limit - Block size of memory required for the Expansion ROM translation unit. Default3346** value is 0, which indicates no Expansion ROM address space and all bits within the ERBAR are read only with a value of 0.3347** 11:00 000H Reserved.3348***********************************************************************************3349*/3350#define ARCMSR_EXPANSION_ROM_LIMIT_REG 0x48 /*dword 0x4B,0x4A,0x49,0x48*/3351/*3352***********************************************************************************3353** Expansion ROM Translate Value Register - ERTVR3354**3355** The Expansion ROM Translate Value Register contains the 80331 internal bus address which the3356** ATU converts the PCI bus access. This address is driven on the internal bus as a result of the3357** Expansion ROM address translation.3358** -----------------------------------------------------------------3359** Bit Default Description3360** 31:12 00000H Expansion ROM Translation Value - Used to convert PCI addresses to 80331 internal bus addresses3361** for Expansion ROM accesses. The Expansion ROM address translation value must be word aligned on the internal bus.3362** 11:00 000H Reserved3363***********************************************************************************3364*/3365#define ARCMSR_EXPANSION_ROM_TRANSLATE_VALUE_REG 0x4C /*dword 0x4F,0x4E,0x4D,0x4C*/3366/*3367***********************************************************************************3368** Inbound ATU Limit Register 1 - IALR13369**3370** Bits 31 to 12 within the IALR1 have a direct effect on the IABAR1 register, bits 31 to 12, with a3371** one to one correspondence. A value of 0 in a bit within the IALR1 makes the corresponding bit3372** within the IABAR1 a read only bit which always returns 0. A value of 1 in a bit within the IALR13373** makes the corresponding bit within the IABAR1 read/write from PCI. Note that a consequence of3374** this programming scheme is that unless a valid value exists within the IALR1, all writes to the3375** IABAR1 has no effect since a value of all zeros within the IALR1 makes the IABAR1 a read only3376** register.3377** The inbound memory window 1 is used merely to allocate memory on the PCI bus. The ATU does3378** not process any PCI bus transactions to this memory range.3379** Warning: The ATU does not claim any PCI accesses that fall within the range defined by IABAR1,3380** IAUBAR1, and IALR1.3381** -----------------------------------------------------------------3382** Bit Default Description3383** 31:12 00000H Inbound Translation Limit 1 - This readback value determines the memory block size3384** required for the ATUs memory window 1.3385** 11:00 000H Reserved3386***********************************************************************************3387*/3388#define ARCMSR_INBOUND_ATU_LIMIT1_REG 0x50 /*dword 0x53,0x52,0x51,0x50*/3389/*3390***********************************************************************************3391** Inbound ATU Limit Register 2 - IALR23392**3393** Inbound address translation for memory window 2 occurs for data transfers occurring from the PCI3394** bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts3395** PCI addresses to internal bus addresses.3396** The inbound translation base address for inbound window 2 is specified in Section 3.10.15. When3397** determining block size requirements �X as described in Section 3.10.21 �X the translation limit3398** register provides the block size requirements for the base address register. The remaining registers3399** used for performing address translation are discussed in Section 3.2.1.1.3400** The 80331 translate value register��s programmed value must be naturally aligned with the base3401** address register��s programmed value. The limit register is used as a mask; thus, the lower address3402** bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus3403** Specification, Revision 2.3 for additional information on programming base address registers.3404** Bits 31 to 12 within the IALR2 have a direct effect on the IABAR2 register, bits 31 to 12, with a3405** one to one correspondence. A value of 0 in a bit within the IALR2 makes the corresponding bit3406** within the IABAR2 a read only bit which always returns 0. A value of 1 in a bit within the IALR23407** makes the corresponding bit within the IABAR2 read/write from PCI. Note that a consequence of3408** this programming scheme is that unless a valid value exists within the IALR2, all writes to the3409** IABAR2 has no effect since a value of all zeros within the IALR2 makes the IABAR2 a read only3410** register.3411** -----------------------------------------------------------------3412** Bit Default Description3413** 31:12 00000H Inbound Translation Limit 2 - This readback value determines the memory block size3414** required for the ATUs memory window 2.3415** 11:00 000H Reserved3416***********************************************************************************3417*/3418#define ARCMSR_INBOUND_ATU_LIMIT2_REG 0x54 /*dword 0x57,0x56,0x55,0x54*/3419/*3420***********************************************************************************3421** Inbound ATU Translate Value Register 2 - IATVR23422**3423** The Inbound ATU Translate Value Register 2 (IATVR2) contains the internal bus address used to3424** convert PCI bus addresses. The converted address is driven on the internal bus as a result of the3425** inbound ATU address translation.3426** -----------------------------------------------------------------3427** Bit Default Description3428** 31:12 00000H Inbound ATU Translation Value 2 - This value is used to convert the PCI address to internal bus addresses.3429** This value must be 64-bit aligned on the internal bus.3430** The default address allows the ATU to access the internal 80331 ** ** memory-mapped registers.3431** 11:00 000H Reserved3432***********************************************************************************3433*/3434#define ARCMSR_INBOUND_ATU_TRANSLATE_VALUE2_REG 0x58 /*dword 0x5B,0x5A,0x59,0x58*/3435/*3436***********************************************************************************3437** Outbound I/O Window Translate Value Register - OIOWTVR3438**3439** The Outbound I/O Window Translate Value Register (OIOWTVR) contains the PCI I/O address3440** used to convert the internal bus access to a PCI address. This address is driven on the PCI bus as a3441** result of the outbound ATU address translation.3442** The I/O window is from 80331 internal bus address 9000 000H to 9000 FFFFH with the fixed3443** length of 64 Kbytes.3444** -----------------------------------------------------------------3445** Bit Default Description3446** 31:16 0000H Outbound I/O Window Translate Value - Used to convert internal bus addresses to PCI addresses.3447** 15:00 0000H Reserved3448***********************************************************************************3449*/3450#define ARCMSR_OUTBOUND_IO_WINDOW_TRANSLATE_VALUE_REG 0x5C /*dword 0x5F,0x5E,0x5D,0x5C*/3451/*3452***********************************************************************************3453** Outbound Memory Window Translate Value Register 0 -OMWTVR03454**3455** The Outbound Memory Window Translate Value Register 0 (OMWTVR0) contains the PCI3456** address used to convert 80331 internal bus addresses for outbound transactions. This address is3457** driven on the PCI bus as a result of the outbound ATU address translation.3458** The memory window is from internal bus address 8000 000H to 83FF FFFFH with the fixed length3459** of 64 Mbytes.3460** -----------------------------------------------------------------3461** Bit Default Description3462** 31:26 00H Outbound MW Translate Value - Used to convert 80331 internal bus addresses to PCI addresses.3463** 25:02 00 0000H Reserved3464** 01:00 00 2 Burst Order - This bit field shows the address sequence during a memory burst.3465** Only linear incrementing mode is supported.3466***********************************************************************************3467*/3468#define ARCMSR_OUTBOUND_MEMORY_WINDOW_TRANSLATE_VALUE0_REG 0x60 /*dword 0x63,0x62,0x61,0x60*/3469/*3470***********************************************************************************3471** Outbound Upper 32-bit Memory Window Translate Value Register 0 - OUMWTVR03472**3473** The Outbound Upper 32-bit Memory Window Translate Value Register 0 (OUMWTVR0) defines3474** the upper 32-bits of address used during a dual address cycle. This enables the outbound ATU to3475** directly address anywhere within the 64-bit host address space. When this register is all-zero, then3476** a SAC is generated on the PCI bus.3477** The memory window is from internal bus address 8000 000H to 83FF FFFFH with the fixed3478** length of 64 Mbytes.3479** -----------------------------------------------------------------3480** Bit Default Description3481** 31:00 0000 0000H These bits define the upper 32-bits of address driven during the dual address cycle (DAC).3482***********************************************************************************3483*/3484#define ARCMSR_OUTBOUND_UPPER32_MEMORY_WINDOW_TRANSLATE_VALUE0_REG 0x64 /*dword 0x67,0x66,0x65,0x64*/3485/*3486***********************************************************************************3487** Outbound Memory Window Translate Value Register 1 -OMWTVR13488**3489** The Outbound Memory Window Translate Value Register 1 (OMWTVR1) contains the PCI3490** address used to convert 80331 internal bus addresses for outbound transactions. This address is3491** driven on the PCI bus as a result of the outbound ATU address translation.3492** The memory window is from internal bus address 8400 000H to 87FF FFFFH with the fixed length3493** of 64 Mbytes.3494** -----------------------------------------------------------------3495** Bit Default Description3496** 31:26 00H Outbound MW Translate Value - Used to convert 80331 internal bus addresses to PCI addresses.3497** 25:02 00 0000H Reserved3498** 01:00 00 2 Burst Order - This bit field shows the address sequence during a memory burst.3499** Only linear incrementing mode is supported.3500***********************************************************************************3501*/3502#define ARCMSR_OUTBOUND_MEMORY_WINDOW_TRANSLATE_VALUE1_REG 0x68 /*dword 0x6B,0x6A,0x69,0x68*/3503/*3504***********************************************************************************3505** Outbound Upper 32-bit Memory Window Translate Value Register 1 - OUMWTVR13506**3507** The Outbound Upper 32-bit Memory Window Translate Value Register 1 (OUMWTVR1) defines3508** the upper 32-bits of address used during a dual address cycle. This enables the outbound ATU to3509** directly address anywhere within the 64-bit host address space. When this register is all-zero, then3510** a SAC is generated on the PCI bus.3511** The memory window is from internal bus address 8400 000H to 87FF FFFFH with the fixed length3512** of 64 Mbytes.3513** -----------------------------------------------------------------3514** Bit Default Description3515** 31:00 0000 0000H These bits define the upper 32-bits of address driven during the dual address cycle (DAC).3516***********************************************************************************3517*/3518#define ARCMSR_OUTBOUND_UPPER32_MEMORY_WINDOW_TRANSLATE_VALUE1_REG 0x6C /*dword 0x6F,0x6E,0x6D,0x6C*/3519/*3520***********************************************************************************3521** Outbound Upper 32-bit Direct Window Translate Value Register - OUDWTVR3522**3523** The Outbound Upper 32-bit Direct Window Translate Value Register (OUDWTVR) defines the3524** upper 32-bits of address used during a dual address cycle for the transactions via Direct Addressing3525** Window. This enables the outbound ATU to directly address anywhere within the 64-bit host3526** address space. When this register is all-zero, then a SAC is generated on the PCI bus.3527** -----------------------------------------------------------------3528** Bit Default Description3529** 31:00 0000 0000H These bits define the upper 32-bits of address driven during the dual address cycle (DAC).3530***********************************************************************************3531*/3532#define ARCMSR_OUTBOUND_UPPER32_DIRECT_WINDOW_TRANSLATE_VALUE_REG 0x78 /*dword 0x7B,0x7A,0x79,0x78*/3533/*3534***********************************************************************************3535** ATU Configuration Register - ATUCR3536**3537** The ATU Configuration Register controls the outbound address translation for address translation3538** unit. It also contains bits for Conventional PCI Delayed Read Command (DRC) aliasing, discard3539** timer status, SERR# manual assertion, SERR# detection interrupt masking, and ATU BIST3540** interrupt enabling.3541** -----------------------------------------------------------------3542** Bit Default Description3543** 31:20 00H Reserved3544** 19 0 2 ATU DRC Alias - when set, the ATU does not distinguish read commands when attempting to match a3545** current PCI read transaction with read data enqueued within the DRC buffer. When clear, a current read3546** transaction must have the exact same read command as the DRR for the ATU to deliver DRC data. Not3547** applicable in the PCI-X mode.3548** 18 0 2 Direct Addressing Upper 2Gbytes Translation Enable - When set,3549** with Direct Addressing enabled (bit 7 of the ATUCR set),3550** the ATU forwards internal bus cycles with an address between 0000.0040H and3551** 7FFF.FFFFH to the PCI bus with bit 31 of the address set (8000.0000H - FFFF.FFFFH).3552** When clear, no translation occurs.3553** 17 0 2 Reserved3554** 16 0 2 SERR# Manual Assertion - when set, the ATU asserts SERR# for one clock on the PCI interface. Until3555** cleared, SERR# may not be manually asserted again. Once cleared, operation proceeds as specified.3556** 15 0 2 ATU Discard Timer Status - when set, one of the 4 discard timers within the ATU has expired and3557** discarded the delayed completion transaction within the queue. When clear, no timer has expired.3558** 14:10 00000 2 Reserved3559** 09 0 2 SERR# Detected Interrupt Enable - When set, the Intel XScale core is signalled an HPI# interrupt3560** when the ATU detects that SERR# was asserted. When clear,3561** the Intel XScale core is not interrupted when SERR# is detected.3562** 08 0 2 Direct Addressing Enable - Setting this bit enables direct outbound addressing through the ATU.3563** Internal bus cycles with an address between 0000.0040H and 7FFF.FFFFH automatically forwards to3564** the PCI bus with or without translation of address bit 31 based on the setting of bit 18 of3565** the ATUCR.3566** 07:04 0000 2 Reserved3567** 03 0 2 ATU BIST Interrupt Enable - When set, enables an interrupt to the Intel XScale core when the start3568** BIST bit is set in the ATUBISTR register. This bit is also reflected as the BIST Capable bit 73569** in the ATUBISTR register.3570** 02 0 2 Reserved3571** 01 0 2 Outbound ATU Enable - When set, enables the outbound address translation unit.3572** When cleared, disables the outbound ATU.3573** 00 0 2 Reserved3574***********************************************************************************3575*/3576#define ARCMSR_ATU_CONFIGURATION_REG 0x80 /*dword 0x83,0x82,0x81,0x80*/3577/*3578***********************************************************************************3579** PCI Configuration and Status Register - PCSR3580**3581** The PCI Configuration and Status Register has additional bits for controlling and monitoring3582** various features of the PCI bus interface.3583** -----------------------------------------------------------------3584** Bit Default Description3585** 31:19 0000H Reserved3586** 18 0 2 Detected Address or Attribute Parity Error - set when a parity error is detected during either the address3587** or attribute phase of a transaction on the PCI bus even when the ATUCMD register Parity Error3588** Response bit is cleared. Set under the following conditions:3589** �E Any Address or Attribute (PCI-X Only) Parity Error on the Bus (including one generated by the ATU).3590** 17:16 Varies with3591** external state3592** of DEVSEL#,3593** STOP#, and3594** TRDY#,3595** during3596** P_RST#3597** PCI-X capability - These two bits define the mode of3598** the PCI bus (conventional or PCI-X) as well as the3599** operating frequency in the case of PCI-X mode.3600** 00 - Conventional PCI mode3601** 01 - PCI-X 663602** 10 - PCI-X 1003603** 11 - PCI-X 1333604** As defined by the PCI-X Addendum to the PCI Local Bus Specification,3605** Revision 1.0a, the operating3606** mode is determined by an initialization pattern on the PCI bus during3607** P_RST# assertion:3608** DEVSEL# STOP# TRDY# Mode3609** Deasserted Deasserted Deasserted Conventional3610** Deasserted Deasserted Asserted PCI-X 663611** Deasserted Asserted Deasserted PCI-X 1003612** Deasserted Asserted Asserted PCI-X 1333613** All other patterns are reserved.3614** 15 0 23615** Outbound Transaction Queue Busy:3616** 0=Outbound Transaction Queue Empty3617** 1=Outbound Transaction Queue Busy3618** 14 0 23619** Inbound Transaction Queue Busy:3620** 0=Inbound Transaction Queue Empty3621** 1=Inbound Transaction Queue Busy3622** 13 0 2 Reserved.3623** 12 0 2 Discard Timer Value - This bit controls the time-out value3624** for the four discard timers attached to the queues holding read data.3625** A value of 0 indicates the time-out value is 2 15 clocks.3626** A value of 1 indicates the time-out value is 2 10 clocks.3627** 11 0 2 Reserved.3628** 10 Varies with3629** external state3630** of M66EN3631** during3632** P_RST#3633** Bus Operating at 66 MHz - When set, the interface has been initialized to function at 66 MHz in3634** Conventional PCI mode by the assertion of M66EN during bus initialization.3635** When clear, the interface3636** has been initialized as a 33 MHz bus.3637** 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.3638** 09 0 2 Reserved3639** 08 Varies with3640** external state3641** of REQ64#3642** during3643** P_RST#3644** PCI Bus 64-Bit Capable - When clear, the PCI bus interface has been3645** configured as 64-bit capable by3646** the assertion of REQ64# on the rising edge of P_RST#. When set,3647** the PCI interface is configured as3648** 32-bit only.3649** 07:06 00 2 Reserved.3650** 05 0 2 Reset Internal Bus - This bit controls the reset of the Intel XScale core3651** and all units on the internal3652** bus. In addition to the internal bus initialization,3653** this bit triggers the assertion of the M_RST# pin for3654** initialization of registered DIMMs. When set:3655** When operating in the conventional PCI mode:3656** �E All current PCI transactions being mastered by the ATU completes,3657** and the ATU master interfaces3658** proceeds to an idle state. No additional transactions is mastered by these units3659** until the internal bus reset is complete.3660** �E All current transactions being slaved by the ATU on either the PCI bus3661** or the internal bus3662** completes, and the ATU target interfaces proceeds to an idle state.3663** All future slave transactions master aborts,3664** with the exception of the completion cycle for the transaction that set the Reset3665** Internal Bus bit in the PCSR.3666** �E When the value of the Core Processor Reset bit in the PCSR (upon P_RST# assertion)3667** is set, the Intel XScale core is held in reset when the internal bus reset is complete.3668** �E The ATU ignores configuration cycles, and they appears as master aborts for: 323669** Internal Bus clocks.3670** �E The 80331 hardware clears this bit after the reset operation completes.3671** When operating in the PCI-X mode:3672** The ATU hardware responds the same as in Conventional PCI-X mode.3673** However, this may create a problem in PCI-X mode for split requests in3674** that there may still be an outstanding split completion that the3675** ATU is either waiting to receive (Outbound Request) or initiate3676** (Inbound Read Request). For a cleaner3677** internal bus reset, host software can take the following steps prior3678** to asserting Reset Internal bus:3679** 1. Clear the Bus Master (bit 2 of the ATUCMD) and the Memory Enable (bit 1 of the ATUCMD) bits in3680** the ATUCMD. This ensures that no new transactions, either outbound or inbound are enqueued.3681** 2. Wait for both the Outbound (bit 15 of the PCSR) and Inbound Read (bit 14 of the PCSR) Transaction3682** queue busy bits to be clear.3683** 3. Set the Reset Internal Bus bit3684** As a result, the ATU hardware resets the internal bus using the same logic as in conventional mode,3685** however the user is now assured that the ATU no longer has any pending inbound or outbound split3686** completion transactions.3687** NOTE: Since the Reset Internal Bus bit is set using an inbound configuration cycle, the user is3688** guaranteed that any prior configuration cycles have properly completed since there is only a one3689** deep transaction queue for configuration transaction requests. The ATU sends the appropriate3690** Split Write Completion Message to the Requester prior to the onset of Internal Bus Reset.3691** 04 0 2 Bus Master Indicator Enable: Provides software control for the3692** Bus Master Indicator signal P_BMI used3693** for external RAIDIOS logic control of private devices. Only valid when operating with the bridge and3694** central resource/arbiter disabled (BRG_EN =low, ARB_EN=low).3695** 03 Varies with external state of PRIVDEV during3696** P_RST#3697** Private Device Enable - This bit indicates the state of the reset strap which enables the private device3698** control mechanism within the PCI-to-PCI Bridge SISR configuration register.3699** 0=Private Device control Disabled - SISR register bits default to zero3700** 1=Private Device control Enabled - SISR register bits default to one3701** 02 Varies with external state of RETRY during P_RST#3702** Configuration Cycle Retry - When this bit is set, the PCI interface of the 80331 responds to all3703** configuration cycles with a Retry condition. When clear, the 80331 responds to the appropriate3704** configuration cycles.3705** The default condition for this bit is based on the external state of the RETRY pin at the rising edge of3706** P_RST#. When the external state of the pin is high, the bit is set. When the external state of the pin is3707** low, the bit is cleared.3708** 01 Varies with external state of CORE_RST# during P_RST#3709** Core Processor Reset - This bit is set to its default value by the hardware when either P_RST# is3710** asserted or the Reset Internal Bus bit in PCSR is set. When this bit is set, the Intel XScale core is3711** being held in reset. Software cannot set this bit. Software is required to clear this bit to deassert Intel3712** XScale core reset.3713** The default condition for this bit is based on the external state of the CORE_RST# pin at the rising edge3714** of P_RST#. When the external state of the pin is low, the bit is set. When the external state of the pin is3715** high, the bit is clear.3716** 00 Varies with external state of PRIVMEM during P_RST#3717** Private Memory Enable - This bit indicates the state of the reset strap which enables the private device3718** control mechanism within the PCI-to-PCI Bridge SDER configuration register.3719** 0=Private Memory control Disabled - SDER register bit 2 default to zero3720** 1=Private Memory control Enabled - SDER register bits 2 default to one3721***********************************************************************************3722*/3723#define ARCMSR_PCI_CONFIGURATION_STATUS_REG 0x84 /*dword 0x87,0x86,0x85,0x84*/3724/*3725***********************************************************************************3726** ATU Interrupt Status Register - ATUISR3727**3728** The ATU Interrupt Status Register is used to notify the core processor of the source of an ATU3729** interrupt. In addition, this register is written to clear the source of the interrupt to the interrupt unit3730** of the 80331. All bits in this register are Read/Clear.3731** Bits 4:0 are a direct reflection of bits 14:11 and bit 8 (respectively) of the ATU Status Register3732** (these bits are set at the same time by hardware but need to be cleared independently). Bit 7 is set3733** by an error associated with the internal bus of the 80331. Bit 8 is for software BIST. The3734** conditions that result in an ATU interrupt are cleared by writing a 1 to the appropriate bits in this3735** register.3736** Note: Bits 4:0, and bits 15 and 13:7 can result in an interrupt being driven to the Intel XScale core.3737** -----------------------------------------------------------------3738** Bit Default Description3739** 31:18 0000H Reserved3740** 17 0 2 VPD Address Register Updated - This bit is set when a PCI bus configuration write occurs to the VPDAR3741** register. Configuration register writes to the VPDAR does NOT result in bit 15 also being set. When set,3742** this bit results in the assertion of the ATU Configure Register Write Interrupt.3743** 16 0 2 Reserved3744** 15 0 2 ATU Configuration Write - This bit is set when a PCI bus configuration write occurs to any ATU register.3745** When set, this bit results in the assertion of the ATU Configure Register Write Interrupt.3746** 14 0 2 ATU Inbound Memory Window 1 Base Updated - This bit is set when a PCI bus configuration write3747** occurs to either the IABAR1 register or the IAUBAR1 register. Configuration register writes to these3748** registers deos NOT result in bit 15 also being set. When set, this bit results in the assertion of the ATU3749** Configure Register Write Interrupt.3750** 13 0 2 Initiated Split Completion Error Message - This bit is set when the device initiates a Split Completion3751** Message on the PCI Bus with the Split Completion Error attribute bit set.3752** 12 0 2 Received Split Completion Error Message - This bit is set when the device receives a Split Completion3753** Message from the PCI Bus with the Split Completion Error attribute bit set.3754** 11 0 2 Power State Transition - When the Power State Field of the ATU Power Management Control/Status3755** Register is written to transition the ATU function Power State from D0 to D3, D0 to D1, or D3 to D0 and3756** the ATU Power State Transition Interrupt mask bit is cleared, this bit is set.3757** 10 0 2 P_SERR# Asserted - set when P_SERR# is asserted on the PCI bus by the ATU.3758** 09 0 2 Detected Parity Error - set when a parity error is detected on the PCI bus even when the ATUCMD3759** register��s Parity Error Response bit is cleared. Set under the following conditions:3760** �E Write Data Parity Error when the ATU is a target (inbound write).3761** �E Read Data Parity Error when the ATU is an initiator (outbound read).3762** �E Any Address or Attribute (PCI-X Only) Parity Error on the Bus.3763** 08 0 2 ATU BIST Interrupt - When set, generates the ATU BIST Start Interrupt and indicates the host processor3764** has set the Start BIST bit (ATUBISTR register bit 6), when the ATU BIST interrupt is enabled (ATUCR3765** register bit 3). The Intel XScale core can initiate the software BIST and store the result in ATUBISTR3766** register bits 3:0.3767** Configuration register writes to the ATUBISTR does NOT result in bit 15 also being set or the assertion3768** of the ATU Configure Register Write Interrupt.3769** 07 0 2 Internal Bus Master Abort - set when a transaction initiated by the ATU internal bus initiator interface ends in a Master-abort.3770** 06:05 00 2 Reserved.3771** 04 0 2 P_SERR# Detected - set when P_SERR# is detected on the PCI bus by the ATU.3772** 03 0 2 PCI Master Abort - set when a transaction initiated by the ATU PCI initiator interface ends in a Master-abort.3773** 02 0 2 PCI Target Abort (master) - set when a transaction initiated by the ATU PCI master interface ends in a Target-abort.3774** 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.3775** 00 0 2 PCI Master Parity Error - Master Parity Error - The ATU interface sets this bit under the following3776** conditions:3777** �E The ATU asserted PERR# itself or the ATU observed PERR# asserted.3778** �E And the ATU acted as the requester for the operation in which the error occurred.3779** �E And the ATUCMD register��s Parity Error Response bit is set3780** �E Or (PCI-X Mode Only) the ATU received a Write Data Parity Error Message3781** �E And the ATUCMD register��s Parity Error Response bit is set3782***********************************************************************************3783*/3784#define ARCMSR_ATU_INTERRUPT_STATUS_REG 0x88 /*dword 0x8B,0x8A,0x89,0x88*/3785/*3786***********************************************************************************3787** ATU Interrupt Mask Register - ATUIMR3788**3789** The ATU Interrupt Mask Register contains the control bit to enable and disable interrupts3790** generated by the ATU.3791** -----------------------------------------------------------------3792** Bit Default Description3793** 31:15 0 0000H Reserved3794** 14 0 2 VPD Address Register Updated Mask - Controls the setting of bit 17 of the ATUISR and generation of the3795** ATU Configuration Register Write interrupt when a PCI bus write occurs to the VPDAR register.3796** 0=Not Masked3797** 1=Masked3798** 13 0 2 Reserved3799** 12 0 2 Configuration Register Write Mask - Controls the setting of bit 15 of the ATUISR and generation of the3800** ATU Configuration Register Write interrupt when a PCI bus write occurs to any ATU configuration register3801** except those covered by mask bit 11 and bit 14 of this register, and ATU BIST enable bit 3 of the ATUCR.3802** 0=Not Masked3803** 1=Masked3804** 11 1 2 ATU Inbound Memory Window 1 Base Updated Mask - Controls the setting of bit 14 of the ATUISR and3805** generation of the ATU Configuration Register Write interrupt when a PCI bus write occurs to either the3806** IABAR1 register or the IAUBAR1 register.3807** 0=Not Masked3808** 1=Masked3809** 10 0 2 Initiated Split Completion Error Message Interrupt Mask - Controls the setting of bit 13 of the ATUISR and3810** generation of the ATU Error interrupt when the ATU initiates a Split Completion Error Message.3811** 0=Not Masked3812** 1=Masked3813** 09 0 2 Received Split Completion Error Message Interrupt Mask- Controls the setting of bit 12 of the ATUISR3814** and generation of the ATU Error interrupt when a Split Completion Error Message results in bit 29 of the3815** PCIXSR being set.3816** 0=Not Masked3817** 1=Masked3818** 08 1 2 Power State Transition Interrupt Mask - Controls the setting of bit 12 of the ATUISR and generation of the3819** ATU Error interrupt when ATU Power Management Control/Status Register is written to transition the3820** ATU Function Power State from D0 to D3, D0 to D1, D1 to D3 or D3 to D0.3821** 0=Not Masked3822** 1=Masked3823** 07 0 2 ATU Detected Parity Error Interrupt Mask - Controls the setting of bit 9 of the ATUISR and generation of3824** the ATU Error interrupt when a parity error detected on the PCI bus that sets bit 15 of the ATUSR.3825** 0=Not Masked3826** 1=Masked3827** 06 0 2 ATU SERR# Asserted Interrupt Mask - Controls the setting of bit 10 of the ATUISR and generation of the3828** ATU Error interrupt when SERR# is asserted on the PCI interface resulting in bit 14 of the ATUSR being set.3829** 0=Not Masked3830** 1=Masked3831** NOTE: This bit is specific to the ATU asserting SERR# and not detecting SERR# from another master.3832** 05 0 2 ATU PCI Master Abort Interrupt Mask - Controls the setting of bit 3 of the ATUISR and generation of the3833** ATU Error interrupt when a master abort error resulting in bit 13 of the ATUSR being set.3834** 0=Not Masked3835** 1=Masked3836** 04 0 2 ATU PCI Target Abort (Master) Interrupt Mask- Controls the setting of bit 12 of the ATUISR and ATU Error3837** generation of the interrupt when a target abort error resulting in bit 12 of the ATUSR being set3838** 0=Not Masked3839** 1=Masked3840** 03 0 2 ATU PCI Target Abort (Target) Interrupt Mask- Controls the setting of bit 1 of the ATUISR and generation3841** of the ATU Error interrupt when a target abort error resulting in bit 11 of the ATUSR being set.3842** 0=Not Masked3843** 1=Masked3844** 02 0 2 ATU PCI Master Parity Error Interrupt Mask - Controls the setting of bit 0 of the ATUISR and generation3845** of the ATU Error interrupt when a parity error resulting in bit 8 of the ATUSR being set.3846** 0=Not Masked3847** 1=Masked3848** 01 0 2 ATU Inbound Error SERR# Enable - Controls when the ATU asserts (when enabled through the3849** ATUCMD) SERR# on the PCI interface in response to a master abort on the internal bus during an3850** inbound write transaction.3851** 0=SERR# Not Asserted due to error3852** 1=SERR# Asserted due to error3853** 00 0 2 ATU ECC Target Abort Enable - Controls the ATU response on the PCI interface to a target abort (ECC3854** error) from the memory controller on the internal bus. In conventional mode, this action only occurs3855** during an inbound read transaction where the data phase that was target aborted on the internal bus is3856** actually requested from the inbound read queue.3857** 0=Disconnect with data3858** (the data being up to 64 bits of 1��s)3859** 1=Target Abort3860** NOTE: In PCI-X Mode, The ATU initiates a Split Completion Error Message (with message class=2h -3861** completer error and message index=81h - 80331 internal bus target abort) on the PCI bus,3862** independent of the setting of this bit.3863***********************************************************************************3864*/3865#define ARCMSR_ATU_INTERRUPT_MASK_REG 0x8C /*dword 0x8F,0x8E,0x8D,0x8C*/3866/*3867***********************************************************************************3868** Inbound ATU Base Address Register 3 - IABAR33869**3870** . The Inbound ATU Base Address Register 3 (IABAR3) together with the Inbound ATU Upper Base Address Register 3 (IAUBAR3) defines the block3871** of memory addresses where the inbound translation window 3 begins.3872** . The inbound ATU decodes and forwards the bus request to the 80331 internal bus with a translated address to map into 80331 local memory.3873** . The IABAR3 and IAUBAR3 define the base address and describes the required memory block size.3874** . 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.3875** The programmed value within the base address register must comply with the PCI programming requirements for address alignment.3876** Note:3877** Since IABAR3 does not appear in the standard PCI configuration header space (offsets 00H - 3CH),3878** IABAR3 is not configured by the host during normal system initialization.3879** Warning:3880** When a non-zero value is not written to IALR3,3881** the user should not set either the Prefetchable Indicator3882** or the Type Indicator for 64 bit addressability.3883** This is the default for IABAR3.3884** Assuming a non-zero value is written to IALR3,3885** the user may set the Prefetchable Indicator3886** or the Type Indicator:3887** a. Since non prefetchable memory windows can never be placed above the 4 Gbyte address boundary,3888** when the Prefetchable Indicator is not set,3889** the user should also leave the Type Indicator set for 32 bit addressability.3890** This is the default for IABAR3.3891** b. when the Prefetchable Indicator is set,3892** the user should also set the Type Indicator for 64 bit addressability.3893** -----------------------------------------------------------------3894** Bit Default Description3895** 31:12 00000H Translation Base Address 3 - These bits define the actual location3896** the translation function is to respond to when addressed from the PCI bus.3897** 11:04 00H Reserved.3898** 03 0 2 Prefetchable Indicator - When set, defines the memory space as prefetchable.3899** 02:01 00 2 Type Indicator - Defines the width of the addressability for this memory window:3900** 00 - Memory Window is locatable anywhere in 32 bit address space3901** 10 - Memory Window is locatable anywhere in 64 bit address space3902** 00 0 2 Memory Space Indicator - This bit field describes memory or I/O space base address.3903** The ATU does not occupy I/O space,3904** thus this bit must be zero.3905***********************************************************************************3906*/3907#define ARCMSR_INBOUND_ATU_BASE_ADDRESS3_REG 0x90 /*dword 0x93,0x92,0x91,0x90*/3908/*3909***********************************************************************************3910** Inbound ATU Upper Base Address Register 3 - IAUBAR33911**3912** This register contains the upper base address when decoding PCI addresses beyond 4 GBytes.3913** Together with the Translation Base Address this register defines the actual location3914** the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes (for DACs).3915** The programmed value within the base address register must comply with the PCI programming3916** requirements for address alignment.3917** Note:3918** When the Type indicator of IABAR3 is set to indicate 32 bit addressability,3919** the IAUBAR3 register attributes are read-only.3920** This is the default for IABAR3.3921** -----------------------------------------------------------------3922** Bit Default Description3923** 31:0 00000H Translation Upper Base Address 3 - Together with the Translation Base Address 3 these bits define3924** the actual location the translation function is to respond to when addressed from the PCI bus for addresses > 4GBytes.3925***********************************************************************************3926*/3927#define ARCMSR_INBOUND_ATU_UPPER_BASE_ADDRESS3_REG 0x94 /*dword 0x97,0x96,0x95,0x94*/3928/*3929***********************************************************************************3930** Inbound ATU Limit Register 3 - IALR33931**3932** Inbound address translation for memory window 3 occurs for data transfers occurring from the PCI3933** bus (originated from the PCI bus) to the 80331 internal bus. The address translation block converts3934** PCI addresses to internal bus addresses.3935** The inbound translation base address for inbound window 3 is specified in Section 3.10.15. When3936** determining block size requirements �X as described in Section 3.10.21 �X the translation limit3937** register provides the block size requirements for the base address register. The remaining registers3938** used for performing address translation are discussed in Section 3.2.1.1.3939** The 80331 translate value register��s programmed value must be naturally aligned with the base3940** address register��s programmed value. The limit register is used as a mask; thus, the lower address3941** bits programmed into the 80331 translate value register are invalid. Refer to the PCI Local Bus3942** Specification, Revision 2.3 for additional information on programming base address registers.3943** Bits 31 to 12 within the IALR3 have a direct effect on the IABAR3 register, bits 31 to 12, with a3944** one to one correspondence. A value of 0 in a bit within the IALR3 makes the corresponding bit3945** within the IABAR3 a read only bit which always returns 0. A value of 1 in a bit within the IALR33946** makes the corresponding bit within the IABAR3 read/write from PCI. Note that a consequence of3947** this programming scheme is that unless a valid value exists within the IALR3, all writes to the3948** IABAR3 has no effect since a value of all zeros within the IALR3 makes the IABAR3 a read only3949** register.3950** -----------------------------------------------------------------3951** Bit Default Description3952** 31:12 00000H Inbound Translation Limit 3 - This readback value determines the memory block size required3953** for the ATUs memory window 3.3954** 11:00 000H Reserved3955***********************************************************************************3956*/3957#define ARCMSR_INBOUND_ATU_LIMIT3_REG 0x98 /*dword 0x9B,0x9A,0x99,0x98*/3958/*3959***********************************************************************************3960** Inbound ATU Translate Value Register 3 - IATVR33961**3962** The Inbound ATU Translate Value Register 3 (IATVR3) contains the internal bus address used to3963** convert PCI bus addresses. The converted address is driven on the internal bus as a result of the3964** inbound ATU address translation.3965** -----------------------------------------------------------------3966** Bit Default Description3967** 31:12 00000H Inbound ATU Translation Value 3 - This value is used to convert the PCI address to internal bus addresses.3968** This value must be 64-bit aligned on the internal bus. The default address allows the ATU to3969** access the internal 80331 memory-mapped registers.3970** 11:00 000H Reserved3971***********************************************************************************3972*/3973#define ARCMSR_INBOUND_ATU_TRANSLATE_VALUE3_REG 0x9C /*dword 0x9F,0x9E,0x9D,0x9C*/3974/*3975***********************************************************************************3976** Outbound Configuration Cycle Address Register - OCCAR3977**3978** The Outbound Configuration Cycle Address Register is used to hold the 32-bit PCI configuration3979** cycle address. The Intel XScale core writes the PCI configuration cycles address which then3980** enables the outbound configuration read or write. The Intel XScale core then performs a read or3981** write to the Outbound Configuration Cycle Data Register to initiate the configuration cycle on the3982** PCI bus.3983** Note: Bits 15:11 of the configuration cycle address for Type 0 configuration cycles are defined differently3984** for Conventional versus PCI-X modes. When 80331 software programs the OCCAR to initiate a3985** Type 0 configuration cycle, the OCCAR should always be loaded based on the PCI-X definition for3986** the Type 0 configuration cycle address. When operating in Conventional mode, the 80331 clears3987** bits 15:11 of the OCCAR prior to initiating an outbound Type 0 configuration cycle. See the PCI-X3988** Addendum to the PCI Local Bus Specification, Revision 1.0a for details on the two formats.3989** -----------------------------------------------------------------3990** Bit Default Description3991** 31:00 0000 0000H Configuration Cycle Address - These bits define the 32-bit PCI address used during an outbound3992** configuration read or write cycle.3993***********************************************************************************3994*/3995#define ARCMSR_OUTBOUND_CONFIGURATION_CYCLE_ADDRESS_REG 0xA4 /*dword 0xA7,0xA6,0xA5,0xA4*/3996/*3997***********************************************************************************3998** Outbound Configuration Cycle Data Register - OCCDR3999**4000** The Outbound Configuration Cycle Data Register is used to initiate a configuration read or write4001** on the PCI bus. The register is logical rather than physical meaning that it is an address not a4002** register. The Intel XScale core reads or writes the data registers memory-mapped address to4003** initiate the configuration cycle on the PCI bus with the address found in the OCCAR. For a4004** configuration write, the data is latched from the internal bus and forwarded directly to the OWQ.4005** For a read, the data is returned directly from the ORQ to the Intel XScale core and is never4006** actually entered into the data register (which does not physically exist).4007** The OCCDR is only visible from 80331 internal bus address space and appears as a reserved value4008** within the ATU configuration space.4009** -----------------------------------------------------------------4010** Bit Default Description4011** 31:00 0000 0000H Configuration Cycle Data - These bits define the data used during an outbound configuration read4012** or write cycle.4013***********************************************************************************4014*/4015#define ARCMSR_OUTBOUND_CONFIGURATION_CYCLE_DATA_REG 0xAC /*dword 0xAF,0xAE,0xAD,0xAC*/4016/*4017***********************************************************************************4018** VPD Capability Identifier Register - VPD_CAPID4019**4020** The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification,4021** Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended4022** Capability contained in that header. In the case of the 80331, this is the VPD extended capability4023** with an ID of 03H as defined by the PCI Local Bus Specification, Revision 2.3.4024** -----------------------------------------------------------------4025** Bit Default Description4026** 07:00 03H Cap_Id - This field with its�� 03H value identifies this item in the linked list of Extended Capability4027** Headers as being the VPD capability registers.4028***********************************************************************************4029*/4030#define ARCMSR_VPD_CAPABILITY_IDENTIFIER_REG 0xB8 /*byte*/4031/*4032***********************************************************************************4033** VPD Next Item Pointer Register - VPD_NXTP4034**4035** The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification,4036** Revision 2.3. This register describes the location of the next item in the function��s capability list.4037** For the 80331, this the final capability list, and hence, this register is set to 00H.4038** -----------------------------------------------------------------4039** Bit Default Description4040** 07:00 00H Next_ Item_ Pointer - This field provides an offset into the function��s configuration space pointing to the4041** next item in the function��s capability list. Since the VPD capabilities are the last in the linked list of4042** extended capabilities in the 80331, the register is set to 00H.4043***********************************************************************************4044*/4045#define ARCMSR_VPD_NEXT_ITEM_PTR_REG 0xB9 /*byte*/4046/*4047***********************************************************************************4048** VPD Address Register - VPD_AR4049**4050** The VPD Address register (VPDAR) contains the DWORD-aligned byte address of the VPD to be4051** accessed. The register is read/write and the initial value at power-up is indeterminate.4052** A PCI Configuration Write to the VPDAR interrupts the Intel XScale core. Software can use4053** the Flag setting to determine whether the configuration write was intended to initiate a read or4054** write of the VPD through the VPD Data Register.4055** -----------------------------------------------------------------4056** Bit Default Description4057** 15 0 2 Flag - A flag is used to indicate when a transfer of data between the VPD Data Register and the storage4058** component has completed. Please see Section 3.9, ��Vital Product Data�� on page 201 for more details on4059** how the 80331 handles the data transfer.4060** 14:0 0000H VPD Address - This register is written to set the DWORD-aligned byte address used to read or write4061** Vital Product Data from the VPD storage component.4062***********************************************************************************4063*/4064#define ARCMSR_VPD_ADDRESS_REG 0xBA /*word 0xBB,0xBA*/4065/*4066***********************************************************************************4067** VPD Data Register - VPD_DR4068**4069** This register is used to transfer data between the 80331 and the VPD storage component.4070** -----------------------------------------------------------------4071** Bit Default Description4072** 31:00 0000H VPD Data - Four bytes are always read or written through this register to/from the VPD storage component.4073***********************************************************************************4074*/4075#define ARCMSR_VPD_DATA_REG 0xBC /*dword 0xBF,0xBE,0xBD,0xBC*/4076/*4077***********************************************************************************4078** Power Management Capability Identifier Register -PM_CAPID4079**4080** The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification,4081** Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended4082** Capability contained in that header. In the case of the 80331, this is the PCI Bus Power4083** Management extended capability with an ID of 01H as defined by the PCI Bus Power Management4084** Interface Specification, Revision 1.1.4085** -----------------------------------------------------------------4086** Bit Default Description4087** 07:00 01H Cap_Id - This field with its�� 01H value identifies this item in the linked list of Extended Capability4088** Headers as being the PCI Power Management Registers.4089***********************************************************************************4090*/4091#define ARCMSR_POWER_MANAGEMENT_CAPABILITY_IDENTIFIER_REG 0xC0 /*byte*/4092/*4093***********************************************************************************4094** Power Management Next Item Pointer Register - PM_NXTP4095**4096** The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification,4097** Revision 2.3. This register describes the location of the next item in the function��s capability list.4098** For the 80331, the next capability (MSI capability list) is located at off-set D0H.4099** -----------------------------------------------------------------4100** Bit Default Description4101** 07:00 D0H Next_ Item_ Pointer - This field provides an offset into the function��s configuration space pointing to the4102** next item in the function��s capability list which in the 80331 is the MSI extended capabilities header.4103***********************************************************************************4104*/4105#define ARCMSR_POWER_NEXT_ITEM_PTR_REG 0xC1 /*byte*/4106/*4107***********************************************************************************4108** Power Management Capabilities Register - PM_CAP4109**4110** Power Management Capabilities bits adhere to the definitions in the PCI Bus Power Management4111** Interface Specification, Revision 1.1. This register is a 16-bit read-only register which provides4112** information on the capabilities of the ATU function related to power management.4113** -----------------------------------------------------------------4114** Bit Default Description4115** 15:11 00000 2 PME_Support - This function is not capable of asserting the PME# signal in any state, since PME#4116** is not supported by the 80331.4117** 10 0 2 D2_Support - This bit is set to 0 2 indicating that the 80331 does not support the D2 Power Management State4118** 9 1 2 D1_Support - This bit is set to 1 2 indicating that the 80331 supports the D1 Power Management State4119** 8:6 000 2 Aux_Current - This field is set to 000 2 indicating that the 80331 has no current requirements for the4120** 3.3Vaux signal as defined in the PCI Bus Power Management Interface Specification, Revision 1.14121** 5 0 2 DSI - This field is set to 0 2 meaning that this function requires a device specific initialization sequence4122** following the transition to the D0 uninitialized state.4123** 4 0 2 Reserved.4124** 3 0 2 PME Clock - Since the 80331 does not support PME# signal generation this bit is cleared to 0 2 .4125** 2:0 010 2 Version - Setting these bits to 010 2 means that this function complies with PCI Bus Power Management4126** Interface Specification, Revision 1.14127***********************************************************************************4128*/4129#define ARCMSR_POWER_MANAGEMENT_CAPABILITY_REG 0xC2 /*word 0xC3,0xC2*/4130/*4131***********************************************************************************4132** Power Management Control/Status Register - PM_CSR4133**4134** Power Management Control/Status bits adhere to the definitions in the PCI Bus Power4135** Management Interface Specification, Revision 1.1. This 16-bit register is the control and status4136** interface for the power management extended capability.4137** -----------------------------------------------------------------4138** Bit Default Description4139** 15 0 2 PME_Status - This function is not capable of asserting the PME# signal in any state, since PME## is not4140** supported by the 80331.4141** 14:9 00H Reserved4142** 8 0 2 PME_En - This bit is hardwired to read-only 0 2 since this function does not support PME#4143** generation from any power state.4144** 7:2 000000 2 Reserved4145** 1:0 00 2 Power State - This 2-bit field is used both to determine the current power state4146** of a function and to set the function into a new power state. The definition of the values is:4147** 00 2 - D04148** 01 2 - D14149** 10 2 - D2 (Unsupported)4150** 11 2 - D3 hot4151** The 80331 supports only the D0 and D3 hot states.4152**4153***********************************************************************************4154*/4155#define ARCMSR_POWER_MANAGEMENT_CONTROL_STATUS_REG 0xC4 /*word 0xC5,0xC4*/4156/*4157***********************************************************************************4158** PCI-X Capability Identifier Register - PX_CAPID4159**4160** The Capability Identifier Register bits adhere to the definitions in the PCI Local Bus Specification,4161** Revision 2.3. This register in the PCI Extended Capability header identifies the type of Extended4162** Capability contained in that header. In the case of the 80331, this is the PCI-X extended capability with4163** an ID of 07H as defined by the PCI-X Addendum to the PCI Local Bus Specification, Revision 1.0a.4164** -----------------------------------------------------------------4165** Bit Default Description4166** 07:00 07H Cap_Id - This field with its�� 07H value identifies this item in the linked list of Extended Capability4167** Headers as being the PCI-X capability registers.4168***********************************************************************************4169*/4170#define ARCMSR_PCIX_CAPABILITY_IDENTIFIER_REG 0xE0 /*byte*/4171/*4172***********************************************************************************4173** PCI-X Next Item Pointer Register - PX_NXTP4174**4175** The Next Item Pointer Register bits adhere to the definitions in the PCI Local Bus Specification,4176** Revision 2.3. This register describes the location of the next item in the function��s capability list.4177** By default, the PCI-X capability is the last capabilities list for the 80331, thus this register defaults4178** to 00H.4179** However, this register may be written to B8H prior to host configuration to include the VPD4180** capability located at off-set B8H.4181** Warning: Writing this register to any value other than 00H (default) or B8H is not supported and may4182** produce unpredictable system behavior.4183** In order to guarantee that this register is written prior to host configuration, the 80331 must be4184** initialized at P_RST# assertion to Retry Type 0 configuration cycles (bit 2 of PCSR). Typically,4185** the Intel XScale core would be enabled to boot immediately following P_RST# assertion in4186** this case (bit 1 of PCSR), as well. Please see Table 125, ��PCI Configuration and Status Register -4187** PCSR�� on page 253 for more details on the 80331 initialization modes.4188** -----------------------------------------------------------------4189** Bit Default Description4190** 07:00 00H Next_ Item_ Pointer - This field provides an offset into the function��s configuration space pointing to the4191** next item in the function��s capability list. Since the PCI-X capabilities are the last in the linked list of4192** extended capabilities in the 80331, the register is set to 00H.4193** However, this field may be written prior to host configuration with B8H to extend the list to include the4194** VPD extended capabilities header.4195***********************************************************************************4196*/4197#define ARCMSR_PCIX_NEXT_ITEM_PTR_REG 0xE1 /*byte*/4198/*4199***********************************************************************************4200** PCI-X Command Register - PX_CMD4201**4202** This register controls various modes and features of ATU and Message Unit when operating in the4203** PCI-X mode.4204** -----------------------------------------------------------------4205** Bit Default Description4206** 15:7 000000000 2 Reserved.4207** 6:4 011 2 Maximum Outstanding Split Transactions - This register sets the maximum number of Split Transactions4208** the device is permitted to have outstanding at one time.4209** Register Maximum Outstanding4210** 0 14211** 1 24212** 2 34213** 3 44214** 4 84215** 5 124216** 6 164217** 7 324218** 3:2 00 2 Maximum Memory Read Byte Count - This register sets the maximum byte count the device uses when4219** initiating a Sequence with one of the burst memory read commands.4220** Register Maximum Byte Count4221** 0 5124222** 1 10244223** 2 20484224** 3 40964225** 1 0 24226** Enable Relaxed Ordering - The 80331 does not set the relaxed ordering bit in the Requester Attributes4227** of Transactions.4228** 0 0 2 Data Parity Error Recovery Enable - The device driver sets this bit to enable the device to attempt to4229** recover from data parity errors. When this bit is 0 and the device is in PCI-X mode, the device asserts4230** SERR# (when enabled) whenever the Master Data Parity Error bit (Status register, bit 8) is set.4231***********************************************************************************4232*/4233#define ARCMSR_PCIX_COMMAND_REG 0xE2 /*word 0xE3,0xE2*/4234/*4235***********************************************************************************4236** PCI-X Status Register - PX_SR4237**4238** This register identifies the capabilities and current operating mode of ATU, DMAs and Message4239** Unit when operating in the PCI-X mode.4240** -----------------------------------------------------------------4241** Bit Default Description4242** 31:30 00 2 Reserved4243** 29 0 2 Received Split Completion Error Message - This bit is set when the device receives a Split Completion4244** Message with the Split Completion Error attribute bit set. Once set, this bit remains set until software4245** writes a 1 to this location.4246** 0=no Split Completion error message received.4247** 1=a Split Completion error message has been received.4248** 28:26 001 2 Designed Maximum Cumulative Read Size (DMCRS) - The value of this register depends on the setting4249** of the Maximum Memory Read Byte Count field of the PCIXCMD register:4250** DMCRS Max ADQs Maximum Memory Read Byte Count Register Setting4251** 1 16 512 (Default)4252** 2 32 10244253** 2 32 20484254** 2 32 40964255** 25:23 011 2 Designed Maximum Outstanding Split Transactions - The 80331 can have up to four outstanding split transactions.4256** 22:21 01 2 Designed Maximum Memory Read Byte Count - The 80331 can generate memory reads with byte counts up4257** to 1024 bytes.4258** 20 1 2 80331 is a complex device.4259** 19 0 2 Unexpected Split Completion - This bit is set when an unexpected Split Completion with this device��s4260** Requester ID is received. Once set, this bit remains set until software writes a 1 to this location.4261** 0=no unexpected Split Completion has been received.4262** 1=an unexpected Split Completion has been received.4263** 18 0 2 Split Completion Discarded - This bit is set when the device discards a Split Completion because the4264** requester would not accept it. See Section 5.4.4 of the PCI-X Addendum to the PCI Local Bus4265** Specification, Revision 1.0a for details. Once set, this bit remains set until software writes a 1 to this4266** location.4267** 0=no Split Completion has been discarded.4268** 1=a Split Completion has been discarded.4269** NOTE: The 80331 does not set this bit since there is no Inbound address responding to Inbound Read4270** Requests with Split Responses (Memory or Register) that has ��read side effects.��4271** 17 1 2 80331 is a 133 MHz capable device.4272** 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,4273** therefore this bit is always set.4274** 80331 with no bridge and central resource disabled (BRG_EN=0, ARB_EN=0),4275** 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#).4276** This strap, by default, identifies the add in card based on 80331 with bridge disabled4277** as 64-bit unless the user attaches the appropriate pull-down resistor to the strap.4278** 0=The bus is 32 bits wide.4279** 1=The bus is 64 bits wide.4280** 15:8 FFH Bus Number - This register is read for diagnostic purposes only. It indicates the number of the bus4281** segment for the device containing this function. The function uses this number as part of its Requester4282** ID and Completer ID. For all devices other than the source bridge, each time the function is addressed4283** by a Configuration Write transaction, the function must update this register with the contents of AD[7::0]4284** of the attribute phase of the Configuration Write, regardless of which register in the function is4285** addressed by the transaction. The function is addressed by a Configuration Write transaction when all of4286** the following are true:4287** 1. The transaction uses a Configuration Write command.4288** 2. IDSEL is asserted during the address phase.4289** 3. AD[1::0] are 00b (Type 0 configuration transaction).4290** 4. AD[10::08] of the configuration address contain the appropriate function number.4291** 7:3 1FH Device Number - This register is read for diagnostic purposes only. It indicates the number of the device4292** containing this function, i.e., the number in the Device Number field (AD[15::11]) of the address of a4293** Type 0 configuration transaction that is assigned to the device containing this function by the connection4294** of the system hardware. The system must assign a device number other than 00h (00h is reserved for4295** the source bridge). The function uses this number as part of its Requester ID and Completer ID. Each4296** time the function is addressed by a Configuration Write transaction, the device must update this register4297** with the contents of AD[15::11] of the address phase of the Configuration Write, regardless of which4298** register in the function is addressed by the transaction. The function is addressed by a Configuration4299** Write transaction when all of the following are true:4300** 1. The transaction uses a Configuration Write command.4301** 2. IDSEL is asserted during the address phase.4302** 3. AD[1::0] are 00b (Type 0 configuration transaction).4303** 4. AD[10::08] of the configuration address contain the appropriate function number.4304** 2:0 000 2 Function Number - This register is read for diagnostic purposes only. It indicates the number of this4305** function; i.e., the number in the Function Number field (AD[10::08]) of the address of a Type 04306** configuration transaction to which this function responds. The function uses this number as part of its4307** Requester ID and Completer ID.4308**4309**************************************************************************4310*/4311#define ARCMSR_PCIX_STATUS_REG 0xE4 /*dword 0xE7,0xE6,0xE5,0xE4*/43124313/*4314**************************************************************************4315** Inbound Read Transaction4316** ========================================================================4317** An inbound read transaction is initiated by a PCI initiator and is targeted at either 80331 local4318** memory or a 80331 memory-mapped register space. The read transaction is propagated through4319** the inbound transaction queue (ITQ) and read data is returned through the inbound read queue4320** (IRQ).4321** When operating in the conventional PCI mode, all inbound read transactions are processed as4322** delayed read transactions. When operating in the PCI-X mode, all inbound read transactions are4323** processed as split transactions. The ATUs PCI interface claims the read transaction and forwards4324** the read request through to the internal bus and returns the read data to the PCI bus. Data flow for4325** an inbound read transaction on the PCI bus is summarized in the following statements:4326** �E The ATU claims the PCI read transaction when the PCI address is within the inbound4327** translation window defined by ATU Inbound Base Address Register (and Inbound Upper Base4328** Address Register during DACs) and Inbound Limit Register.4329** �E When operating in the conventional PCI mode, when the ITQ is currently holding transaction4330** information from a previous delayed read, the current transaction information is compared to4331** the previous transaction information (based on the setting of the DRC Alias bit in4332** Section 3.10.39, ��ATU Configuration Register - ATUCR�� on page 252). When there is a4333** match and the data is in the IRQ, return the data to the master on the PCI bus. When there is a4334** match and the data is not available, a Retry is signaled with no other action taken. When there4335** is not a match and when the ITQ has less than eight entries, capture the transaction4336** information, signal a Retry and initiate a delayed transaction. When there is not a match and4337** when the ITQ is full, then signal a Retry with no other action taken.4338** �X When an address parity error is detected, the address parity response defined in4339** Section 3.7 is used.4340** �E When operating in the conventional PCI mode, once read data is driven onto the PCI bus from4341** the IRQ, it continues until one of the following is true:4342** �X The initiator completes the PCI transaction. When there is data left unread in the IRQ, the4343** data is flushed.4344** �X An internal bus Target Abort was detected. In this case, the QWORD associated with the4345** Target Abort is never entered into the IRQ, and therefore is never returned.4346** �X Target Abort or a Disconnect with Data is returned in response to the Internal Bus Error.4347** �X The IRQ becomes empty. In this case, the PCI interface signals a Disconnect with data to4348** the initiator on the last data word available.4349** �E When operating in the PCI-X mode, when ITQ is not full, the PCI address, attribute and4350** command are latched into the available ITQ and a Split Response Termination is signalled to4351** the initiator.4352** �E When operating in the PCI-X mode, when the transaction does not cross a 1024 byte aligned4353** boundary, then the ATU waits until it receives the full byte count from the internal bus target4354** before returning read data by generating the split completion transaction on the PCI-X bus.4355** When the read requested crosses at least one 1024 byte boundary, then ATU completes the4356** transfer by returning data in 1024 byte aligned chunks.4357** �E When operating in the PCI-X mode, once a split completion transaction has started, it4358** continues until one of the following is true:4359** �X The requester (now the target) generates a Retry Termination, or a Disconnection at Next4360** ADB (when the requester is a bridge)4361** �X The byte count is satisfied.4362** �X An internal bus Target Abort was detected. The ATU generates a Split Completion4363** Message (message class=2h - completer error, and message index=81h - target abort) to4364** inform the requester about the abnormal condition. The ITQ for this transaction is flushed.4365** Refer to Section 3.7.1.4366** �X An internal bus Master Abort was detected. The ATU generates a Split Completion4367** Message (message class=2h - completer error, and message index=80h - Master abort) to4368** inform the requester about the abnormal condition. The ITQ for this transaction is flushed.4369** Refer to Section 3.7.14370** �E When operating in the conventional PCI mode, when the master inserts wait states on the PCI4371** bus, the ATU PCI slave interface waits with no premature disconnects.4372** �E When a data parity error occurs signified by PERR# asserted from the initiator, no action is4373** taken by the target interface. Refer to Section 3.7.2.5.4374** �E When operating in the conventional PCI mode, when the read on the internal bus is4375** target-aborted, either a target-abort or a disconnect with data is signaled to the initiator. This is4376** based on the ATU ECC Target Abort Enable bit (bit 0 of the ATUIMR for ATU). When set, a4377** target abort is used, when clear, a disconnect is used.4378** �E When operating in the PCI-X mode (with the exception of the MU queue ports at offsets 40h4379** and 44h), when the transaction on the internal bus resulted in a target abort, the ATU generates4380** a Split Completion Message (message class=2h - completer error, and message index=81h -4381** internal bus target abort) to inform the requester about the abnormal condition. For the MU4382** queue ports, the ATU returns either a target abort or a single data phase disconnect depending4383** on the ATU ECC Target Abort Enable bit (bit 0 of the ATUIMR for ATU). The ITQ for this4384** transaction is flushed. Refer to Section 3.7.1.4385** �E When operating in the conventional PCI mode, when the transaction on the internal bus4386** resulted in a master abort, the ATU returns a target abort to inform the requester about the4387** abnormal condition. The ITQ for this transaction is flushed. Refer to Section 3.7.14388** �E When operating in the PCI-X mode, when the transaction on the internal bus resulted in a4389** master abort, the ATU generates a Split Completion Message (message class=2h - completer4390** error, and message index=80h - internal bus master abort) to inform the requester about the4391** abnormal condition. The ITQ for this transaction is flushed. Refer to Section 3.7.1.4392** �E When operating in the PCI-X mode, when the Split Completion transaction completes with4393** either Master-Abort or Target-Abort, the requester is indicating a failure condition that4394** prevents it from accepting the completion it requested. In this case, since the Split Request4395** addresses a location that has no read side effects, the completer must discard the Split4396** Completion and take no further action.4397** The data flow for an inbound read transaction on the internal bus is summarized in the following4398** statements:4399** �E The ATU internal bus master interface requests the internal bus when a PCI address appears in4400** an ITQ and transaction ordering has been satisfied. When operating in the PCI-X mode the4401** ATU does not use the information provided by the Relax Ordering Attribute bit. That is, ATU4402** always uses conventional PCI ordering rules.4403** �E Once the internal bus is granted, the internal bus master interface drives the translated address4404** onto the bus and wait for IB_DEVSEL#. When a Retry is signaled, the request is repeated.4405** When a master abort occurs, the transaction is considered complete and a target abort is loaded4406** into the associated IRQ for return to the PCI initiator (transaction is flushed once the PCI4407** master has been delivered the target abort).4408** �E Once the translated address is on the bus and the transaction has been accepted, the internal4409** bus target starts returning data with the assertion of IB_TRDY#. Read data is continuously4410** received by the IRQ until one of the following is true:4411** �X The full byte count requested by the ATU read request is received. The ATU internal bus4412** initiator interface performs a initiator completion in this case.4413** �X When operating in the conventional PCI mode, a Target Abort is received on the internal4414** bus from the internal bus target. In this case, the transaction is aborted and the PCI side is4415** informed.4416** �X When operating in the PCI-X mode, a Target Abort is received on the internal bus from4417** the internal bus target. In this case, the transaction is aborted. The ATU generates a Split4418** Completion Message (message class=2h - completer error, and message index=81h -4419** target abort) on the PCI bus to inform the requester about the abnormal condition. The4420** ITQ for this transaction is flushed.4421** �X When operating in the conventional PCI mode, a single data phase disconnection is4422** received from the internal bus target. When the data has not been received up to the next4423** QWORD boundary, the ATU internal bus master interface attempts to reacquire the bus.4424** When not, the bus returns to idle.4425** �X When operating in the PCI-X mode, a single data phase disconnection is received from4426** the internal bus target. The ATU IB initiator interface attempts to reacquire the bus to4427** obtain remaining data.4428** �X When operating in the conventional PCI mode, a disconnection at Next ADB is received4429** from the internal bus target. The bus returns to idle.4430** �X When operating in the PCI-X mode, a disconnection at Next ADB is received from the4431** internal bus target. The ATU IB initiator interface attempts to reacquire the bus to obtain4432** remaining data.4433** To support PCI Local Bus Specification, Revision 2.0 devices, the ATU can be programmed to4434** ignore the memory read command (Memory Read, Memory Read Line, and Memory Read4435** Multiple) when trying to match the current inbound read transaction with data in a DRC queue4436** which was read previously (DRC on target bus). When the Read Command Alias Bit in the4437** ATUCR register is set, the ATU does not distinguish the read commands on transactions. For4438** example, the ATU enqueues a DRR with a Memory Read Multiple command and performs the read4439** on the internal bus. Some time later, a PCI master attempts a Memory Read with the same address4440** as the previous Memory Read Multiple. When the Read Command Bit is set, the ATU would return4441** the read data from the DRC queue and consider the Delayed Read transaction complete. When the4442** Read Command bit in the ATUCR was clear, the ATU would not return data since the PCI read4443** commands did not match, only the address.4444**************************************************************************4445*/4446/*4447**************************************************************************4448** Inbound Write Transaction4449**========================================================================4450** An inbound write transaction is initiated by a PCI master and is targeted at either 80331 local4451** memory or a 80331 memory-mapped register.4452** Data flow for an inbound write transaction on the PCI bus is summarized as:4453** �E The ATU claims the PCI write transaction when the PCI address is within the inbound4454** translation window defined by the ATU Inbound Base Address Register (and Inbound Upper4455** Base Address Register during DACs) and Inbound Limit Register.4456** �E When the IWADQ has at least one address entry available and the IWQ has at least one buffer4457** available, the address is captured and the first data phase is accepted.4458** �E The PCI interface continues to accept write data until one of the following is true:4459** �X The initiator performs a disconnect.4460** �X The transaction crosses a buffer boundary.4461** �E When an address parity error is detected during the address phase of the transaction, the4462** address parity error mechanisms are used. Refer to Section 3.7.1 for details of the address4463** parity error response.4464** �E When operating in the PCI-X mode when an attribute parity error is detected, the attribute4465** parity error mechanism described in Section 3.7.1 is used.4466** �E When a data parity error is detected while accepting data, the slave interface sets the4467** appropriate bits based on PCI specifications. No other action is taken. Refer to Section 3.7.2.64468** for details of the inbound write data parity error response.4469** Once the PCI interface places a PCI address in the IWADQ, when IWQ has received data sufficient4470** to cross a buffer boundary or the master disconnects on the PCI bus, the ATUs internal bus4471** interface becomes aware of the inbound write. When there are additional write transactions ahead4472** in the IWQ/IWADQ, the current transaction remains posted until ordering and priority have been4473** satisfied (Refer to Section 3.5.3) and the transaction is attempted on the internal bus by the ATU4474** internal master interface. The ATU does not insert target wait states nor do data merging on the PCI4475** interface, when operating in the PCI mode.4476** In the PCI-X mode memory writes are always executed as immediate transactions, while4477** configuration write transactions are processed as split transactions. The ATU generates a Split4478** Completion Message, (with Message class=0h - Write Completion Class and Message index =4479** 00h - Write Completion Message) once a configuration write is successfully executed.4480** Also, when operating in the PCI-X mode a write sequence may contain multiple write transactions.4481** The ATU handles such transactions as independent transactions.4482** Data flow for the inbound write transaction on the internal bus is summarized as:4483** �E The ATU internal bus master requests the internal bus when IWADQ has at least one entry4484** with associated data in the IWQ.4485** �E When the internal bus is granted, the internal bus master interface initiates the write4486** transaction by driving the translated address onto the internal bus. For details on inbound4487** address translation.4488** �E When IB_DEVSEL# is not returned, a master abort condition is signaled on the internal bus.4489** The current transaction is flushed from the queue and SERR# may be asserted on the PCI4490** interface.4491** �E The ATU initiator interface asserts IB_REQ64# to attempt a 64-bit transfer. When4492** IB_ACK64# is not returned, a 32-bit transfer is used. Transfers of less than 64-bits use the4493** IB_C/BE[7:0]# to mask the bytes not written in the 64-bit data phase. Write data is transferred4494** from the IWQ to the internal bus when data is available and the internal bus interface retains4495** internal bus ownership.4496** �E The internal bus interface stops transferring data from the current transaction to the internal4497** bus when one of the following conditions becomes true:4498** �X The internal bus initiator interface loses bus ownership. The ATU internal initiator4499** terminates the transfer (initiator disconnection) at the next ADB (for the internal bus ADB4500** is defined as a naturally aligned 128-byte boundary) and attempt to reacquire the bus to4501** complete the delivery of remaining data using the same sequence ID but with the4502** modified starting address and byte count.4503** �X A Disconnect at Next ADB is signaled on the internal bus from the internal target. When4504** the transaction in the IWQ completes at that ADB, the initiator returns to idle. When the4505** transaction in the IWQ is not complete, the initiator attempts to reacquire the bus to4506** complete the delivery of remaining data using the same sequence ID but with the4507** modified starting address and byte count.4508** �X A Single Data Phase Disconnect is signaled on the internal bus from the internal target.4509** When the transaction in the IWQ needs only a single data phase, the master returns to idle.4510** When the transaction in the IWQ is not complete, the initiator attempts to reacquire the4511** bus to complete the delivery of remaining data using the same sequence ID but with the4512** modified starting address and byte count.4513** �X The data from the current transaction has completed (satisfaction of byte count). An4514** initiator termination is performed and the bus returns to idle.4515** �X A Master Abort is signaled on the internal bus. SERR# may be asserted on the PCI bus.4516** Data is flushed from the IWQ.4517*****************************************************************4518*/45194520/*4521**************************************************************************4522** Inbound Read Completions Data Parity Errors4523**========================================================================4524** As an initiator, the ATU may encounter this error condition when operating in the PCI-X mode.4525** When as the completer of a Split Read Request the ATU observes PERR# assertion during the split4526** completion transaction, the ATU attempts to complete the transaction normally and no further4527** action is taken.4528**************************************************************************4529*/45304531/*4532**************************************************************************4533** Inbound Configuration Write Completion Message Data Parity Errors4534**========================================================================4535** As an initiator, the ATU may encounter this error condition when operating in the PCI-X mode.4536** When as the completer of a Configuration (Split) Write Request the ATU observes PERR#4537** assertion during the split completion transaction, the ATU attempts to complete the transaction4538** normally and no further action is taken.4539**************************************************************************4540*/45414542/*4543**************************************************************************4544** Inbound Read Request Data Parity Errors4545**===================== Immediate Data Transfer ==========================4546** As a target, the ATU may encounter this error when operating in the Conventional PCI or PCI-X modes.4547** Inbound read data parity errors occur when read data delivered from the IRQ is detected as having4548** bad parity by the initiator of the transaction who is receiving the data. The initiator may optionally4549** report the error to the system by asserting PERR#. As a target device in this scenario, no action is4550** required and no error bits are set.4551**=====================Split Response Termination=========================4552** As a target, the ATU may encounter this error when operating in the PCI-X mode.4553** Inbound read data parity errors occur during the Split Response Termination. The initiator may4554** optionally report the error to the system by asserting PERR#. As a target device in this scenario, no4555** action is required and no error bits are set.4556**************************************************************************4557*/45584559/*4560**************************************************************************4561** Inbound Write Request Data Parity Errors4562**========================================================================4563** As a target, the ATU may encounter this error when operating in the Conventional or PCI-X modes.4564** Data parity errors occurring during write operations received by the ATU may assert PERR# on4565** the PCI Bus. When an error occurs, the ATU continues accepting data until the initiator of the write4566** transaction completes or a queue fill condition is reached. Specifically, the following actions with4567** the given constraints are taken by the ATU:4568** �E PERR# is asserted two clocks cycles (three clock cycles when operating in the PCI-X mode)4569** following the data phase in which the data parity error is detected on the bus. This is only4570** done when the Parity Error Response bit in the ATUCMD is set.4571** �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional4572** actions is taken:4573** �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the4574** Detected Parity Error bit in the ATUISR. When set, no action.4575***************************************************************************4576*/45774578/*4579***************************************************************************4580** Inbound Configuration Write Request4581** =====================================================================4582** As a target, the ATU may encounter this error when operating in the Conventional or PCI-X modes.4583** ===============================================4584** Conventional PCI Mode4585** ===============================================4586** To allow for correct data parity calculations for delayed write transactions, the ATU delays the4587** assertion of STOP# (signalling a Retry) until PAR is driven by the master. A parity error during a4588** delayed write transaction (inbound configuration write cycle) can occur in any of the following4589** parts of the transactions:4590** �E During the initial Delayed Write Request cycle on the PCI bus when the ATU latches the4591** address/command and data for delayed delivery to the internal configuration register.4592** �E During the Delayed Write Completion cycle on the PCI bus when the ATU delivers the status4593** of the operation back to the original master.4594** The 80331 ATU PCI interface has the following responses to a delayed write parity error for4595** inbound transactions during Delayed Write Request cycles with the given constraints:4596** �E When the Parity Error Response bit in the ATUCMD is set, the ATU asserts TRDY#4597** (disconnects with data) and two clock cycles later asserts PERR# notifying the initiator of the4598** parity error. The delayed write cycle is not enqueued and forwarded to the internal bus.4599** When the Parity Error Response bit in the ATUCMD is cleared, the ATU retries the4600** transaction by asserting STOP# and enqueues the Delayed Write Request cycle to be4601** forwarded to the internal bus. PERR# is not asserted.4602** �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional4603** actions is taken:4604** �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the4605** Detected Parity Error bit in the ATUISR. When set, no action.4606** For the original write transaction to be completed, the initiator retries the transaction on the PCI4607** bus and the ATU returns the status from the internal bus, completing the transaction.4608** For the Delayed Write Completion transaction on the PCI bus where a data parity error occurs and4609** therefore does not agree with the status being returned from the internal bus (i.e. status being4610** returned is normal completion) the ATU performs the following actions with the given constraints:4611** �E When the Parity Error Response Bit is set in the ATUCMD, the ATU asserts TRDY#4612** (disconnects with data) and two clocks later asserts PERR#. The Delayed Completion cycle in4613** the IDWQ remains since the data of retried command did not match the data within the queue.4614** �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional4615** actions is taken:4616** �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the4617** Detected Parity Error bit in the ATUISR. When set, no action.4618** ===================================================4619** PCI-X Mode4620** ===================================================4621** Data parity errors occurring during configuration write operations received by the ATU may cause4622** PERR# assertion and delivery of a Split Completion Error Message on the PCI Bus. When an error4623** occurs, the ATU accepts the write data and complete with a Split Response Termination.4624** Specifically, the following actions with the given constraints are then taken by the ATU:4625** �E When the Parity Error Response bit in the ATUCMD is set, PERR# is asserted three clocks4626** cycles following the Split Response Termination in which the data parity error is detected on4627** the bus. When the ATU asserts PERR#, additional actions is taken:4628** �X A Split Write Data Parity Error message (with message class=2h - completer error and4629** message index=01h - Split Write Data Parity Error) is initiated by the ATU on the PCI bus4630** that addresses the requester of the configuration write.4631** �X When the Initiated Split Completion Error Message Interrupt Mask in the ATUIMR is4632** clear, set the Initiated Split Completion Error Message bit in the ATUISR. When set, no4633** action.4634** �X The Split Write Request is not enqueued and forwarded to the internal bus.4635** �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional4636** actions is taken:4637** �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the4638** Detected Parity Error bit in the ATUISR. When set, no action.4639**4640***************************************************************************4641*/46424643/*4644***************************************************************************4645** Split Completion Messages4646** =======================================================================4647** As a target, the ATU may encounter this error when operating in the PCI-X mode.4648** Data parity errors occurring during Split Completion Messages claimed by the ATU may assert4649** PERR# (when enabled) or SERR# (when enabled) on the PCI Bus. When an error occurs, the4650** ATU accepts the data and complete normally. Specifically, the following actions with the given4651** constraints are taken by the ATU:4652** �E PERR# is asserted three clocks cycles following the data phase in which the data parity error4653** is detected on the bus. This is only done when the Parity Error Response bit in the ATUCMD4654** is set. When the ATU asserts PERR#, additional actions is taken:4655** �X The Master Parity Error bit in the ATUSR is set.4656** �X When the ATU PCI Master Parity Error Interrupt Mask Bit in the ATUIMR is clear, set the4657** PCI Master Parity Error bit in the ATUISR. When set, no action.4658** �X When the SERR# Enable bit in the ATUCMD is set, and the Data Parity Error Recover4659** Enable bit in the PCIXCMD register is clear, assert SERR#; otherwise no action is taken.4660** When the ATU asserts SERR#, additional actions is taken:4661** Set the SERR# Asserted bit in the ATUSR.4662** When the ATU SERR# Asserted Interrupt Mask Bit in the ATUIMR is clear, set the4663** SERR# Asserted bit in the ATUISR. When set, no action.4664** When the ATU SERR# Detected Interrupt Enable Bit in the ATUCR is set, set the4665** SERR# Detected bit in the ATUISR. When clear, no action.4666** �E When the SCE bit (Split Completion Error -- bit 30 of the Completer Attributes) is set during4667** the Attribute phase, the Received Split Completion Error Message bit in the PCIXSR is set.4668** When the ATU sets this bit, additional actions is taken:4669** �X When the ATU Received Split Completion Error Message Interrupt Mask bit in the4670** ATUIMR is clear, set the Received Split Completion Error Message bit in the ATUISR.4671** When set, no action.4672** �E The Detected Parity Error bit in the ATUSR is set. When the ATU sets this bit, additional4673** actions is taken:4674** �X When the ATU Detected Parity Error Interrupt Mask bit in the ATUIMR is clear, set the4675** Detected Parity Error bit in the ATUISR. When set, no action.4676** �E The transaction associated with the Split Completion Message is discarded.4677** �E When the discarded transaction was a read, a completion error message (with message4678** class=2h - completer error and message index=82h - PCI bus read parity error) is generated on4679** the internal bus of the 80331.4680*****************************************************************************4681*/46824683/*4684******************************************************************************************************4685** Messaging Unit (MU) of the Intel R 80331 I/O processor (80331)4686** ==================================================================================================4687** The Messaging Unit (MU) transfers data between the PCI system and the 803314688** notifies the respective system when new data arrives.4689** The PCI window for messaging transactions is always the first 4 Kbytes of the inbound translation.4690** window defined by:4691** 1.Inbound ATU Base Address Register 0 (IABAR0)4692** 2.Inbound ATU Limit Register 0 (IALR0)4693** All of the Messaging Unit errors are reported in the same manner as ATU errors.4694** Error conditions and status can be found in :4695** 1.ATUSR4696** 2.ATUISR4697**====================================================================================================4698** Mechanism Quantity Assert PCI Interrupt Signals Generate I/O Processor Interrupt4699**----------------------------------------------------------------------------------------------------4700** Message Registers 2 Inbound Optional Optional4701** 2 Outbound4702**----------------------------------------------------------------------------------------------------4703** Doorbell Registers 1 Inbound Optional Optional4704** 1 Outbound4705**----------------------------------------------------------------------------------------------------4706** Circular Queues 4 Circular Queues Under certain conditions Under certain conditions4707**----------------------------------------------------------------------------------------------------4708** Index Registers 1004 32-bit Memory Locations No Optional4709**====================================================================================================4710** PCI Memory Map: First 4 Kbytes of the ATU Inbound PCI Address Space4711**====================================================================================================4712** 0000H Reserved4713** 0004H Reserved4714** 0008H Reserved4715** 000CH Reserved4716**------------------------------------------------------------------------4717** 0010H Inbound Message Register 0 ]4718** 0014H Inbound Message Register 1 ]4719** 0018H Outbound Message Register 0 ]4720** 001CH Outbound Message Register 1 ] 4 Message Registers4721**------------------------------------------------------------------------4722** 0020H Inbound Doorbell Register ]4723** 0024H Inbound Interrupt Status Register ]4724** 0028H Inbound Interrupt Mask Register ]4725** 002CH Outbound Doorbell Register ]4726** 0030H Outbound Interrupt Status Register ]4727** 0034H Outbound Interrupt Mask Register ] 2 Doorbell Registers and 4 Interrupt Registers4728**------------------------------------------------------------------------4729** 0038H Reserved4730** 003CH Reserved4731**------------------------------------------------------------------------4732** 0040H Inbound Queue Port ]4733** 0044H Outbound Queue Port ] 2 Queue Ports4734**------------------------------------------------------------------------4735** 0048H Reserved4736** 004CH Reserved4737**------------------------------------------------------------------------4738** 0050H ]4739** : ]4740** : Intel Xscale Microarchitecture Local Memory ]4741** : ]4742** 0FFCH ] 1004 Index Registers4743*******************************************************************************4744*/4745/*4746*****************************************************************************4747** Theory of MU Operation4748*****************************************************************************4749**--------------------4750** inbound_msgaddr0:4751** inbound_msgaddr1:4752** outbound_msgaddr0:4753** outbound_msgaddr1:4754** . The MU has four independent messaging mechanisms.4755** There are four Message Registers that are similar to a combination of mailbox and doorbell registers.4756** Each holds a 32-bit value and generates an interrupt when written.4757**--------------------4758** inbound_doorbell:4759** outbound_doorbell:4760** . The two Doorbell Registers support software interrupts.4761** When a bit is set in a Doorbell Register, an interrupt is generated.4762**--------------------4763** inbound_queueport:4764** outbound_queueport:4765**4766**4767** . The Circular Queues support a message passing scheme that uses 4 circular queues.4768** The 4 circular queues are implemented in 80331 local memory.4769** Two queues are used for inbound messages and two are used for outbound messages.4770** Interrupts may be generated when the queue is written.4771**--------------------4772** local_buffer 0x0050 ....0x0FFF4773** . The Index Registers use a portion of the 80331 local memory to implement a large set of message registers.4774** When one of the Index Registers is written, an interrupt is generated and the address of the register written is captured.4775** Interrupt status for all interrupts is recorded in the Inbound Interrupt Status Register and the Outbound Interrupt Status Register.4776** Each interrupt generated by the Messaging Unit can be masked.4777**--------------------4778** . Multi-DWORD PCI burst accesses are not supported by the Messaging Unit,4779** with the exception of Multi-DWORD reads to the index registers.4780** In Conventional mode: the MU terminates Multi-DWORD PCI transactions4781** (other than index register reads) with a disconnect at the next Qword boundary, with the exception of queue ports.4782** In PCI-X mode : the MU terminates a Multi-DWORD PCI read transaction with a Split Response4783** and the data is returned through split completion transaction(s).4784** however, when the burst request crosses into or through the range of offsets 40h to 4Ch4785** (e.g., this includes the queue ports) the transaction is signaled target-abort immediately on the PCI bus.4786** In PCI-X mode, Multi-DWORD PCI writes is signaled a Single-Data-Phase Disconnect4787** which means that no data beyond the first Qword (Dword when the MU does not assert P_ACK64#) is written.4788**--------------------4789** . All registers needed to configure and control the Messaging Unit are memory-mapped registers.4790** The MU uses the first 4 Kbytes of the inbound translation window in the Address Translation Unit (ATU).4791** This PCI address window is used for PCI transactions that access the 80331 local memory.4792** The PCI address of the inbound translation window is contained in the Inbound ATU Base Address Register.4793**--------------------4794** . From the PCI perspective, the Messaging Unit is part of the Address Translation Unit.4795** The Messaging Unit uses the PCI configuration registers of the ATU for control and status information.4796** The Messaging Unit must observe all PCI control bits in the ATU Command Register and ATU Configuration Register.4797** The Messaging Unit reports all PCI errors in the ATU Status Register.4798**--------------------4799** . Parts of the Messaging Unit can be accessed as a 64-bit PCI device.4800** The register interface, message registers, doorbell registers,4801** and index registers returns a P_ACK64# in response to a P_REQ64# on the PCI interface.4802** Up to 1 Qword of data can be read or written per transaction (except Index Register reads).4803** The Inbound and Outbound Queue Ports are always 32-bit addresses and the MU does not assert P_ACK64# to offsets 40H and 44H.4804**************************************************************************4805*/4806/*4807**************************************************************************4808** Message Registers4809** ==============================4810** . Messages can be sent and received by the 80331 through the use of the Message Registers.4811** . When written, the message registers may cause an interrupt to be generated to either the Intel XScale core or the host processor.4812** . Inbound messages are sent by the host processor and received by the 80331.4813** Outbound messages are sent by the 80331 and received by the host processor.4814** . The interrupt status for outbound messages is recorded in the Outbound Interrupt Status Register.4815** Interrupt status for inbound messages is recorded in the Inbound Interrupt Status Register.4816**4817** Inbound Messages:4818** -----------------4819** . When an inbound message register is written by an external PCI agent, an interrupt may be generated to the Intel XScale core.4820** . The interrupt may be masked by the mask bits in the Inbound Interrupt Mask Register.4821** . The Intel XScale core interrupt is recorded in the Inbound Interrupt Status Register.4822** The interrupt causes the Inbound Message Interrupt bit to be set in the Inbound Interrupt Status Register.4823** This is a Read/Clear bit that is set by the MU hardware and cleared by software.4824** The interrupt is cleared when the Intel XScale core writes a value of4825** 1 to the Inbound Message Interrupt bit in the Inbound Interrupt Status Register.4826** ------------------------------------------------------------------------4827** Inbound Message Register - IMRx4828**4829** . There are two Inbound Message Registers: IMR0 and IMR1.4830** . When the IMR register is written, an interrupt to the Intel XScale core may be generated.4831** The interrupt is recorded in the Inbound Interrupt Status Register and may be masked4832** by the Inbound Message Interrupt Mask bit in the Inbound Interrupt Mask Register.4833** -----------------------------------------------------------------4834** Bit Default Description4835** 31:00 0000 0000H Inbound Message - This is a 32-bit message written by an external PCI agent.4836** When written, an interrupt to the Intel XScale core may be generated.4837**************************************************************************4838*/4839#define ARCMSR_MU_INBOUND_MESSAGE_REG0 0x10 /*dword 0x13,0x12,0x11,0x10*/4840#define ARCMSR_MU_INBOUND_MESSAGE_REG1 0x14 /*dword 0x17,0x16,0x15,0x14*/4841/*4842**************************************************************************4843** Outbound Message Register - OMRx4844** --------------------------------4845** There are two Outbound Message Registers: OMR0 and OMR1. When the OMR register is4846** written, a PCI interrupt may be generated. The interrupt is recorded in the Outbound Interrupt4847** Status Register and may be masked by the Outbound Message Interrupt Mask bit in the Outbound4848** Interrupt Mask Register.4849**4850** Bit Default Description4851** 31:00 00000000H Outbound Message - This is 32-bit message written by the Intel XScale core. When written, an4852** interrupt may be generated on the PCI Interrupt pin determined by the ATU Interrupt Pin Register.4853**************************************************************************4854*/4855#define ARCMSR_MU_OUTBOUND_MESSAGE_REG0 0x18 /*dword 0x1B,0x1A,0x19,0x18*/4856#define ARCMSR_MU_OUTBOUND_MESSAGE_REG1 0x1C /*dword 0x1F,0x1E,0x1D,0x1C*/4857/*4858**************************************************************************4859** Doorbell Registers4860** ==============================4861** There are two Doorbell Registers:4862** Inbound Doorbell Register4863** Outbound Doorbell Register4864** The Inbound Doorbell Register allows external PCI agents to generate interrupts to the Intel R XScale core.4865** The Outbound Doorbell Register allows the Intel R XScale core to generate a PCI interrupt.4866** Both Doorbell Registers may generate interrupts whenever a bit in the register is set.4867**4868** Inbound Doorbells:4869** ------------------4870** . When the Inbound Doorbell Register is written by an external PCI agent, an interrupt may be generated to the Intel R XScale core.4871** An interrupt is generated when any of the bits in the doorbell register is written to a value of 1.4872** 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.4873** . Once a bit is set in the Inbound Doorbell Register, it cannot be cleared by any external PCI agent.4874** The interrupt is recorded in the Inbound Interrupt Status Register.4875** . The interrupt may be masked by the Inbound Doorbell Interrupt mask bit in the Inbound Interrupt Mask Register.4876** When the mask bit is set for a particular bit, no interrupt is generated for that bit.4877** The Inbound Interrupt Mask Register affects only the generation of the normal messaging unit interrupt4878** and not the values written to the Inbound Doorbell Register.4879** One bit in the Inbound Doorbell Register is reserved for an Error Doorbell interrupt.4880** . 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.4881** Writing a value of 0 to any bit does not change the value of that bit and does not clear the interrupt.4882** ------------------------------------------------------------------------4883** Inbound Doorbell Register - IDR4884**4885** . The Inbound Doorbell Register (IDR) is used to generate interrupts to the Intel XScale core.4886** . Bit 31 is reserved for generating an Error Doorbell interrupt.4887** When bit 31 is set, an Error interrupt may be generated to the Intel XScale core.4888** All other bits, when set, cause the Normal Messaging Unit interrupt line of the Intel XScale core to be asserted,4889** when the interrupt is not masked by the Inbound Doorbell Interrupt Mask bit in the Inbound Interrupt Mask Register.4890** 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.4891** ------------------------------------------------------------------------4892** Bit Default Description4893** 31 0 2 Error Interrupt - Generate an Error Interrupt to the Intel XScale core.4894** 30:00 00000000H Normal Interrupt - When any bit is set, generate a Normal interrupt to the Intel XScale core.4895** When all bits are clear, do not generate a Normal Interrupt.4896**************************************************************************4897*/4898#define ARCMSR_MU_INBOUND_DOORBELL_REG 0x20 /*dword 0x23,0x22,0x21,0x20*/4899/*4900**************************************************************************4901** Inbound Interrupt Status Register - IISR4902**4903** . The Inbound Interrupt Status Register (IISR) contains hardware interrupt status.4904** It records the status of Intel XScale core interrupts generated by the Message Registers, Doorbell Registers, and the Circular Queues.4905** All interrupts are routed to the Normal Messaging Unit interrupt input of the Intel XScale core,4906** except for the Error Doorbell Interrupt and the Outbound Free Queue Full interrupt;4907** these two are routed to the Messaging Unit Error interrupt input.4908** The generation of interrupts recorded in the Inbound Interrupt Status Register4909** may be masked by setting the corresponding bit in the Inbound Interrupt Mask Register.4910** Some of the bits in this register are Read Only.4911** For those bits, the interrupt must be cleared through another register.4912**4913** Bit Default Description4914** 31:07 0000000H 0 2 Reserved4915** 06 0 2 Index Register Interrupt - This bit is set by the MU hardware4916** when an Index Register has been written after a PCI transaction.4917** 05 0 2 Outbound Free Queue Full Interrupt - This bit is set4918** when the Outbound Free Head Pointer becomes equal to the Tail Pointer and the queue is full.4919** An Error interrupt is generated for this condition.4920** 04 0 2 Inbound Post Queue Interrupt - This bit is set by the MU hardware when the Inbound Post Queue has been written.4921** Once cleared, an interrupt does NOT be generated4922** when the head and tail pointers remain unequal (i.e. queue status is Not Empty).4923** Therefore, when software leaves any unprocessed messages in the post queue when the interrupt is cleared,4924** software must retain the information that the Inbound Post queue status is not empty.4925** NOTE: This interrupt is provided with dedicated support in the 80331 Interrupt Controller.4926** 03 0 2 Error Doorbell Interrupt - This bit is set when the Error Interrupt of the Inbound Doorbell Register is set.4927** To clear this bit (and the interrupt), the Error Interrupt bit of the Inbound Doorbell Register must be clear.4928** 02 0 2 Inbound Doorbell Interrupt - This bit is set when at least one4929** Normal Interrupt bit in the Inbound Doorbell Register is set.4930** To clear this bit (and the interrupt), the Normal Interrupt bits in the Inbound Doorbell Register must all be clear.4931** 01 0 2 Inbound Message 1 Interrupt - This bit is set by the MU hardware when the Inbound Message 1 Register has been written.4932** 00 0 2 Inbound Message 0 Interrupt - This bit is set by the MU hardware when the Inbound Message 0 Register has been written.4933**************************************************************************4934*/4935#define ARCMSR_MU_INBOUND_INTERRUPT_STATUS_REG 0x24 /*dword 0x27,0x26,0x25,0x24*/4936#define ARCMSR_MU_INBOUND_INDEX_INT 0x404937#define ARCMSR_MU_INBOUND_QUEUEFULL_INT 0x204938#define ARCMSR_MU_INBOUND_POSTQUEUE_INT 0x104939#define ARCMSR_MU_INBOUND_ERROR_DOORBELL_INT 0x084940#define ARCMSR_MU_INBOUND_DOORBELL_INT 0x044941#define ARCMSR_MU_INBOUND_MESSAGE1_INT 0x024942#define ARCMSR_MU_INBOUND_MESSAGE0_INT 0x014943/*4944**************************************************************************4945** Inbound Interrupt Mask Register - IIMR4946**4947** . The Inbound Interrupt Mask Register (IIMR) provides the ability to mask Intel XScale core interrupts generated by the Messaging Unit.4948** Each bit in the Mask register corresponds to an interrupt bit in the Inbound Interrupt Status Register.4949** Setting or clearing bits in this register does not affect the Inbound Interrupt Status Register.4950** They only affect the generation of the Intel XScale core interrupt.4951** ------------------------------------------------------------------------4952** Bit Default Description4953** 31:07 000000H 0 2 Reserved4954** 06 0 2 Index Register Interrupt Mask - When set, this bit masks the interrupt generated by the MU hardware4955** when an Index Register has been written after a PCI transaction.4956** 05 0 2 Outbound Free Queue Full Interrupt Mask - When set, this bit masks the Error interrupt generated4957** when the Outbound Free Head Pointer becomes equal to the Tail Pointer and the queue is full.4958** 04 0 2 Inbound Post Queue Interrupt Mask - When set, this bit masks the interrupt generated4959** by the MU hardware when the Inbound Post Queue has been written.4960** 03 0 2 Error Doorbell Interrupt Mask - When set, this bit masks the Error Interrupt4961** when the Error Interrupt bit of the Inbound Doorbell Register is set.4962** 02 0 2 Inbound Doorbell Interrupt Mask - When set, this bit masks the interrupt generated4963** when at least one Normal Interrupt bit in the Inbound Doorbell Register is set.4964** 01 0 2 Inbound Message 1 Interrupt Mask - When set, this bit masks the Inbound Message 14965** Interrupt generated by a write to the Inbound Message 1 Register.4966** 00 0 2 Inbound Message 0 Interrupt Mask - When set,4967** this bit masks the Inbound Message 0 Interrupt generated by a write to the Inbound Message 0 Register.4968**************************************************************************4969*/4970#define ARCMSR_MU_INBOUND_INTERRUPT_MASK_REG 0x28 /*dword 0x2B,0x2A,0x29,0x28*/4971#define ARCMSR_MU_INBOUND_INDEX_INTMASKENABLE 0x404972#define ARCMSR_MU_INBOUND_QUEUEFULL_INTMASKENABLE 0x204973#define ARCMSR_MU_INBOUND_POSTQUEUE_INTMASKENABLE 0x104974#define ARCMSR_MU_INBOUND_DOORBELL_ERROR_INTMASKENABLE 0x084975#define ARCMSR_MU_INBOUND_DOORBELL_INTMASKENABLE 0x044976#define ARCMSR_MU_INBOUND_MESSAGE1_INTMASKENABLE 0x024977#define ARCMSR_MU_INBOUND_MESSAGE0_INTMASKENABLE 0x014978/*4979**************************************************************************4980** Outbound Doorbell Register - ODR4981**4982** The Outbound Doorbell Register (ODR) allows software interrupt generation. It allows the Intel4983** XScale core to generate PCI interrupts to the host processor by writing to this register. The4984** generation of PCI interrupts through the Outbound Doorbell Register may be masked by setting the4985** Outbound Doorbell Interrupt Mask bit in the Outbound Interrupt Mask Register.4986** The Software Interrupt bits in this register can only be set by the Intel XScale core and can only4987** be cleared by an external PCI agent.4988** ----------------------------------------------------------------------4989** Bit Default Description4990** 31 0 2 Reserved4991** 30 0 2 Reserved.4992** 29 0 2 Reserved4993** 28 0000 0000H PCI Interrupt - When set, this bit causes the P_INTC# interrupt output4994** (P_INTA# with BRG_EN and ARB_EN straps low)4995** signal to be asserted or a Message-signaled Interrupt is generated (when enabled).4996** When this bit is cleared, the P_INTC# interrupt output4997** (P_INTA# with BRG_EN and ARB_EN straps low)4998** signal is deasserted.4999** 27:00 000 0000H Software Interrupts - When any bit is set the P_INTC# interrupt output5000** (P_INTA# with BRG_EN and ARB_EN straps low)5001** signal is asserted or a Message-signaled Interrupt is generated (when enabled).5002** When all bits are cleared, the P_INTC# interrupt output (P_INTA# with BRG_EN and ARB_EN straps low)5003** signal is deasserted.5004**************************************************************************5005*/5006#define ARCMSR_MU_OUTBOUND_DOORBELL_REG 0x2C /*dword 0x2F,0x2E,0x2D,0x2C*/5007/*5008**************************************************************************5009** Outbound Interrupt Status Register - OISR5010**5011** The Outbound Interrupt Status Register (OISR) contains hardware interrupt status. It records the5012** status of PCI interrupts generated by the Message Registers, Doorbell Registers, and the Circular5013** Queues. The generation of PCI interrupts recorded in the Outbound Interrupt Status Register may5014** be masked by setting the corresponding bit in the Outbound Interrupt Mask Register. Some of the5015** bits in this register are Read Only. For those bits, the interrupt must be cleared through another5016** register.5017** ----------------------------------------------------------------------5018** Bit Default Description5019** 31:05 000000H 000 2 Reserved5020** 04 0 2 PCI Interrupt - This bit is set when the PCI Interrupt bit (bit 28) is set in the Outbound Doorbell Register.5021** To clear this bit (and the interrupt), the PCI Interrupt bit must be cleared.5022** 03 0 2 Outbound Post Queue Interrupt - This bit is set when data in the prefetch buffer is valid. This bit is5023** cleared when any prefetch data has been read from the Outbound Queue Port.5024** 02 0 2 Outbound Doorbell Interrupt - This bit is set when at least one Software Interrupt bit in the Outbound5025** Doorbell Register is set. To clear this bit (and the interrupt), the Software Interrupt bits in the Outbound5026** Doorbell Register must all be clear.5027** 01 0 2 Outbound Message 1 Interrupt - This bit is set by the MU when the Outbound Message 1 Register is5028** written. Clearing this bit clears the interrupt.5029** 00 0 2 Outbound Message 0 Interrupt - This bit is set by the MU when the Outbound Message 0 Register is5030** written. Clearing this bit clears the interrupt.5031**************************************************************************5032*/5033#define ARCMSR_MU_OUTBOUND_INTERRUPT_STATUS_REG 0x30 /*dword 0x33,0x32,0x31,0x30*/5034#define ARCMSR_MU_OUTBOUND_PCI_INT 0x105035#define ARCMSR_MU_OUTBOUND_POSTQUEUE_INT 0x085036#define ARCMSR_MU_OUTBOUND_DOORBELL_INT 0x045037#define ARCMSR_MU_OUTBOUND_MESSAGE1_INT 0x025038#define ARCMSR_MU_OUTBOUND_MESSAGE0_INT 0x015039/*5040**************************************************************************5041** Outbound Interrupt Mask Register - OIMR5042** The Outbound Interrupt Mask Register (OIMR) provides the ability to mask outbound PCI5043** interrupts generated by the Messaging Unit. Each bit in the mask register corresponds to a5044** hardware interrupt bit in the Outbound Interrupt Status Register. When the bit is set, the PCI5045** interrupt is not generated. When the bit is clear, the interrupt is allowed to be generated.5046** Setting or clearing bits in this register does not affect the Outbound Interrupt Status Register. They5047** only affect the generation of the PCI interrupt.5048** ----------------------------------------------------------------------5049** Bit Default Description5050** 31:05 000000H Reserved5051** 04 0 2 PCI Interrupt Mask - When set, this bit masks the interrupt generation when the PCI Interrupt bit (bit 28)5052** in the Outbound Doorbell Register is set.5053** 03 0 2 Outbound Post Queue Interrupt Mask - When set, this bit masks the interrupt generated when data in5054** the prefetch buffer is valid.5055** 02 0 2 Outbound Doorbell Interrupt Mask - When set, this bit masks the interrupt generated by the Outbound5056** Doorbell Register.5057** 01 0 2 Outbound Message 1 Interrupt Mask - When set, this bit masks the Outbound Message 1 Interrupt5058** generated by a write to the Outbound Message 1 Register.5059** 00 0 2 Outbound Message 0 Interrupt Mask- When set, this bit masks the Outbound Message 0 Interrupt5060** generated by a write to the Outbound Message 0 Register.5061**************************************************************************5062*/5063#define ARCMSR_MU_OUTBOUND_INTERRUPT_MASK_REG 0x34 /*dword 0x37,0x36,0x35,0x34*/5064#define ARCMSR_MU_OUTBOUND_PCI_INTMASKENABLE 0x105065#define ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE 0x085066#define ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE 0x045067#define ARCMSR_MU_OUTBOUND_MESSAGE1_INTMASKENABLE 0x025068#define ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE 0x015069#define ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE 0x1F5070/*5071**************************************************************************5072**5073**************************************************************************5074*/5075#define ARCMSR_MU_INBOUND_QUEUE_PORT_REG 0x40 /*dword 0x43,0x42,0x41,0x40*/5076#define ARCMSR_MU_OUTBOUND_QUEUE_PORT_REG 0x44 /*dword 0x47,0x46,0x45,0x44*/5077/*5078**************************************************************************5079** Circular Queues5080** ======================================================================5081** The MU implements four circular queues. There are 2 inbound queues and 2 outbound queues. In5082** this case, inbound and outbound refer to the direction of the flow of posted messages.5083** Inbound messages are either:5084** �E posted messages by other processors for the Intel XScale core to process or5085** �E free (or empty) messages that can be reused by other processors.5086** Outbound messages are either:5087** �E posted messages by the Intel XScale core for other processors to process or5088** �E free (or empty) messages that can be reused by the Intel XScale core.5089** Therefore, free inbound messages flow away from the 80331 and free outbound messages flow toward the 80331.5090** The four Circular Queues are used to pass messages in the following manner.5091** . The two inbound queues are used to handle inbound messages5092** and the two outbound queues are used to handle outbound messages.5093** . One of the inbound queues is designated the Free queue and it contains inbound free messages.5094** The other inbound queue is designated the Post queue and it contains inbound posted messages.5095** Similarly, one of the outbound queues is designated the Free queue and the other outbound queue is designated the Post queue.5096**5097** =============================================================================================================5098** Circular Queue Summary5099** _____________________________________________________________________________________________________________5100** | Queue Name | Purpose | Action on PCI Interface|5101** |______________________|____________________________________________________________|_________________________|5102** |Inbound Post Queue | Queue for inbound messages from other processors | Written |5103** | | waiting to be processed by the 80331 | |5104** |Inbound Free Queue | Queue for empty inbound messages from the 80331 | Read |5105** | | available for use by other processors | |5106** |Outbound Post Queue | Queue for outbound messages from the 80331 | Read |5107** | | that are being posted to the other processors | |5108** |Outbound Free Queue | Queue for empty outbound messages from other processors | Written |5109** | | available for use by the 80331 | |5110** |______________________|____________________________________________________________|_________________________|5111**5112** . The two inbound queues allow the host processor to post inbound messages for the 80331 in one5113** queue and to receive free messages returning from the 80331.5114** The host processor posts inbound messages,5115** the Intel XScale core receives the posted message and when it is finished with the message,5116** places it back on the inbound free queue for reuse by the host processor.5117**5118** The circular queues are accessed by external PCI agents through two port locations in the PCI5119** address space:5120** Inbound Queue Port5121** and Outbound Queue Port.5122** The Inbound Queue Port is used by external PCI agents to read the Inbound Free Queue and write the Inbound Post Queue.5123** The Outbound Queue Port is used by external PCI agents to read the Outbound Post Queue and write the Outbound Free Queue.5124** Note that a PCI transaction to the inbound or outbound queue ports with null byte enables (P_C/BE[3:0]#=1111 2 )5125** does not cause the MU hardware to increment the queue pointers.5126** This is treated as when the PCI transaction did not occur.5127** The Inbound and Outbound Queue Ports never respond with P_ACK64# on the PCI interface.5128** ======================================================================================5129** Overview of Circular Queue Operation5130** ======================================================================================5131** . The data storage for the circular queues must be provided by the 80331 local memory.5132** . The base address of the circular queues is contained in the Queue Base Address Register.5133** Each entry in the queue is a 32-bit data value.5134** . Each read from or write to the queue may access only one queue entry.5135** . Multi-DWORD accesses to the circular queues are not allowed.5136** Sub-DWORD accesses are promoted to DWORD accesses.5137** . Each circular queue has a head pointer and a tail pointer.5138** The pointers are offsets from the Queue Base Address.5139** . Writes to a queue occur at the head of the queue and reads occur from the tail.5140** The head and tail pointers are incremented by either the Intel XScale core or the Messaging Unit hardware.5141** Which unit maintains the pointer is determined by the writer of the queue.5142** More details about the pointers are given in the queue descriptions below.5143** The pointers are incremented after the queue access.5144** Both pointers wrap around to the first address of the circular queue when they reach the circular queue size.5145**5146** Messaging Unit...5147**5148** The Messaging Unit generates an interrupt to the Intel XScale core or generate a PCI interrupt under certain conditions.5149** . In general, when a Post queue is written, an interrupt is generated to notify the receiver that a message was posted.5150** The size of each circular queue can range from 4K entries (16 Kbytes) to 64K entries (256 Kbytes).5151** . All four queues must be the same size and may be contiguous.5152** Therefore, the total amount of local memory needed by the circular queues ranges from 64 Kbytes to 1 Mbytes.5153** The Queue size is determined by the Queue Size field in the MU Configuration Register.5154** . There is one base address for all four queues.5155** It is stored in the Queue Base Address Register (QBAR).5156** The starting addresses of each queue is based on the Queue Base Address and the Queue Size field.5157** here shows an example of how the circular queues should be set up based on the5158** Intelligent I/O (I 2 O) Architecture Specification.5159** Other ordering of the circular queues is possible.5160**5161** Queue Starting Address5162** Inbound Free Queue QBAR5163** Inbound Post Queue QBAR + Queue Size5164** Outbound Post Queue QBAR + 2 * Queue Size5165** Outbound Free Queue QBAR + 3 * Queue Size5166** ===================================================================================5167** Inbound Post Queue5168** ------------------5169** The Inbound Post Queue holds posted messages placed there by other processors for the Intel XScale core to process.5170** This queue is read from the queue tail by the Intel XScale core. It is written to the queue head by external PCI agents.5171** The tail pointer is maintained by the Intel XScale core. The head pointer is maintained by the MU hardware.5172** For a PCI write transaction that accesses the Inbound Queue Port,5173** the MU writes the data to the local memory location address in the Inbound Post Head Pointer Register.5174** When the data written to the Inbound Queue Port is written to local memory, the MU hardware increments the Inbound Post Head Pointer Register.5175** An Intel XScale core interrupt may be generated when the Inbound Post Queue is written.5176** The Inbound Post Queue Interrupt bit in the Inbound Interrupt Status Register indicates the interrupt status.5177** The interrupt is cleared when the Inbound Post Queue Interrupt bit is cleared.5178** The interrupt can be masked by the Inbound Interrupt Mask Register.5179** Software must be aware of the state of the Inbound Post Queue Interrupt Mask bit to guarantee5180** that the full condition is recognized by the core processor.5181** In addition, to guarantee that the queue does not get overwritten,5182** software must process messages from the tail of the queue before incrementing the tail pointer and clearing this interrupt.5183** Once cleared, an interrupt is NOT generated when the head and tail pointers remain unequal (i.e. queue status is Not Empty).5184** Only a new message posting the in the inbound queue generates a new interrupt.5185** Therefore, when software leaves any unprocessed messages in the post queue when the interrupt is cleared,5186** software must retain the information that the Inbound Post queue status.5187** From the time that the PCI write transaction is received until the data is written5188** in local memory and the Inbound Post Head Pointer Register is incremented,5189** any PCI transaction that attempts to access the Inbound Post Queue Port is signalled a Retry.5190** The Intel XScale core may read messages from the Inbound Post Queue5191** by reading the data from the local memory location pointed to by the Inbound Post Tail Pointer Register.5192** The Intel XScale core must then increment the Inbound Post Tail Pointer Register.5193** When the Inbound Post Queue is full (head and tail pointers are equal and the head pointer was last updated by hardware),5194** the hardware retries any PCI writes until a slot in the queue becomes available.5195** A slot in the post queue becomes available by the Intel XScale core incrementing the tail pointer.5196** ===================================================================================5197** Inbound Free Queue5198** ------------------5199** The Inbound Free Queue holds free inbound messages placed there by the Intel XScale core for other processors to use.5200** This queue is read from the queue tail by external PCI agents.5201** It is written to the queue head by the Intel XScale core.5202** The tail pointer is maintained by the MU hardware.5203** The head pointer is maintained by the Intel XScale core.5204** For a PCI read transaction that accesses the Inbound Queue Port,5205** the MU attempts to read the data at the local memory address in the Inbound Free Tail Pointer.5206** When the queue is not empty (head and tail pointers are not equal)5207** or full (head and tail pointers are equal but the head pointer was last written by software), the data is returned.5208** When the queue is empty (head and tail pointers are equal and the head pointer was last updated by hardware),5209** the value of -1 (FFFF.FFFFH) is returned.5210** When the queue was not empty and the MU succeeded in returning the data at the tail,5211** the MU hardware must increment the value in the Inbound Free Tail Pointer Register.5212** To reduce latency for the PCI read access, the MU implements a prefetch mechanism to anticipate accesses to the Inbound Free Queue.5213** The MU hardware prefetches the data at the tail of the Inbound Free Queue and load it into an internal prefetch register.5214** When the PCI read access occurs, the data is read directly from the prefetch register.5215** The prefetch mechanism loads a value of -1 (FFFF.FFFFH) into the prefetch register5216** when the head and tail pointers are equal and the queue is empty.5217** In order to update the prefetch register when messages are added to the queue and it becomes non-empty,5218** the prefetch mechanism automatically starts a prefetch when the prefetch register contains FFFF.FFFFH5219** and the Inbound Free Head Pointer Register is written.5220** The Intel XScale core needs to update the Inbound Free Head Pointer Register when it adds messages to the queue.5221** A prefetch must appear atomic from the perspective of the external PCI agent.5222** 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.5223** The Intel XScale core may place messages in the Inbound Free Queue by writing the data to the5224** local memory location pointed to by the Inbound Free Head Pointer Register.5225** The processor must then increment the Inbound Free Head Pointer Register.5226** ==================================================================================5227** Outbound Post Queue5228** -------------------5229** The Outbound Post Queue holds outbound posted messages placed there by the Intel XScale5230** core for other processors to process. This queue is read from the queue tail by external PCI agents.5231** It is written to the queue head by the Intel XScale core. The tail pointer is maintained by the5232** MU hardware. The head pointer is maintained by the Intel XScale core.5233** For a PCI read transaction that accesses the Outbound Queue Port, the MU attempts to read the5234** data at the local memory address in the Outbound Post Tail Pointer Register. When the queue is not5235** empty (head and tail pointers are not equal) or full (head and tail pointers are equal but the head5236** pointer was last written by software), the data is returned. When the queue is empty (head and tail5237** pointers are equal and the head pointer was last updated by hardware), the value of -15238** (FFFF.FFFFH) is returned. When the queue was not empty and the MU succeeded in returning the5239** data at the tail, the MU hardware must increment the value in the Outbound Post Tail Pointer5240** Register.5241** To reduce latency for the PCI read access, the MU implements a prefetch mechanism to anticipate5242** accesses to the Outbound Post Queue. The MU hardware prefetches the data at the tail of the5243** Outbound Post Queue and load it into an internal prefetch register. When the PCI read access5244** occurs, the data is read directly from the prefetch register.5245** The prefetch mechanism loads a value of -1 (FFFF.FFFFH) into the prefetch register when the head5246** and tail pointers are equal and the queue is empty. In order to update the prefetch register when5247** messages are added to the queue and it becomes non-empty, the prefetch mechanism automatically5248** starts a prefetch when the prefetch register contains FFFF.FFFFH and the Outbound Post Head5249** Pointer Register is written. The Intel XScale core needs to update the Outbound Post Head5250** Pointer Register when it adds messages to the queue.5251** A prefetch must appear atomic from the perspective of the external PCI agent. When a prefetch is5252** started, any PCI transaction that attempts to access the Outbound Post Queue is signalled a Retry5253** until the prefetch is completed.5254** A PCI interrupt may be generated when data in the prefetch buffer is valid. When the prefetch5255** queue is clear, no interrupt is generated. The Outbound Post Queue Interrupt bit in the Outbound5256** Interrupt Status Register shall indicate the status of the prefetch buffer data and therefore the5257** interrupt status. The interrupt is cleared when any prefetched data has been read from the Outbound5258** Queue Port. The interrupt can be masked by the Outbound Interrupt Mask Register.5259** The Intel XScale core may place messages in the Outbound Post Queue by writing the data to5260** the local memory address in the Outbound Post Head Pointer Register. The processor must then5261** increment the Outbound Post Head Pointer Register.5262** ==================================================5263** Outbound Free Queue5264** -----------------------5265** The Outbound Free Queue holds free messages placed there by other processors for the Intel5266** XScale core to use. This queue is read from the queue tail by the Intel XScale core. It is5267** written to the queue head by external PCI agents. The tail pointer is maintained by the Intel5268** XScale core. The head pointer is maintained by the MU hardware.5269** For a PCI write transaction that accesses the Outbound Queue Port, the MU writes the data to the5270** local memory address in the Outbound Free Head Pointer Register. When the data written to the5271** Outbound Queue Port is written to local memory, the MU hardware increments the Outbound Free5272** Head Pointer Register.5273** When the head pointer and the tail pointer become equal and the queue is full, the MU may signal5274** an interrupt to the Intel XScale core to register the queue full condition. This interrupt is5275** recorded in the Inbound Interrupt Status Register. The interrupt is cleared when the Outbound Free5276** Queue Full Interrupt bit is cleared and not by writing to the head or tail pointers. The interrupt can5277** be masked by the Inbound Interrupt Mask Register. Software must be aware of the state of the5278** Outbound Free Queue Interrupt Mask bit to guarantee that the full condition is recognized by the5279** core processor.5280** From the time that a PCI write transaction is received until the data is written in local memory and5281** the Outbound Free Head Pointer Register is incremented, any PCI transaction that attempts to5282** access the Outbound Free Queue Port is signalled a retry.5283** The Intel XScale core may read messages from the Outbound Free Queue by reading the data5284** from the local memory address in the Outbound Free Tail Pointer Register. The processor must5285** then increment the Outbound Free Tail Pointer Register. When the Outbound Free Queue is full,5286** the hardware must retry any PCI writes until a slot in the queue becomes available.5287**5288** ==================================================================================5289** Circular Queue Summary5290** ----------------------5291** ________________________________________________________________________________________________________________________________________________5292** | Queue Name | PCI Port |Generate PCI Interrupt |Generate Intel Xscale Core Interrupt|Head Pointer maintained by|Tail Pointer maintained by|5293** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________|5294** |Inbound Post | Inbound Queue | | | | |5295** | Queue | Port | NO | Yes, when queue is written | MU hardware | Intel XScale |5296** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________|5297** |Inbound Free | Inbound Queue | | | | |5298** | Queue | Port | NO | NO | Intel XScale | MU hardware |5299** |_____________|_______________|_______________________|____________________________________|__________________________|__________________________|5300** ==================================================================================5301** Circular Queue Status Summary5302** ----------------------5303** ____________________________________________________________________________________________________5304** | Queue Name | Queue Status | Head & Tail Pointer | Last Pointer Update |5305** |_____________________|________________|_____________________|_______________________________________|5306** | Inbound Post Queue | Empty | Equal | Tail pointer last updated by software |5307** |_____________________|________________|_____________________|_______________________________________|5308** | Inbound Free Queue | Empty | Equal | Head pointer last updated by hardware |5309** |_____________________|________________|_____________________|_______________________________________|5310**************************************************************************5311*/53125313/*5314**************************************************************************5315** Index Registers5316** ========================5317** . 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.5318** These registers are for inbound messages only.5319** The interrupt is recorded in the Inbound Interrupt Status Register.5320** The storage for the Index Registers is allocated from the 80331 local memory.5321** PCI write accesses to the Index Registers write the data to local memory.5322** PCI read accesses to the Index Registers read the data from local memory.5323** . The local memory used for the Index Registers ranges from Inbound ATU Translate Value Register + 050H5324** to Inbound ATU Translate Value Register + FFFH.5325** . The address of the first write access is stored in the Index Address Register.5326** This register is written during the earliest write access and provides a means to determine which Index Register was written.5327** Once updated by the MU, the Index Address Register is not updated until the Index Register5328** Interrupt bit in the Inbound Interrupt Status Register is cleared.5329** . When the interrupt is cleared, the Index Address Register is re-enabled and stores the address of the next Index Register write access.5330** Writes by the Intel XScale core to the local memory used by the Index Registers5331** does not cause an interrupt and does not update the Index Address Register.5332** . The index registers can be accessed with Multi-DWORD reads and single QWORD aligned writes.5333**************************************************************************5334*/5335/*5336**************************************************************************5337** Messaging Unit Internal Bus Memory Map5338** =======================================5339** Internal Bus Address___Register Description (Name)____________________|_PCI Configuration Space Register Number_5340** FFFF E300H reserved |5341** .. .. |5342** FFFF E30CH reserved |5343** FFFF E310H Inbound Message Register 0 | Available through5344** FFFF E314H Inbound Message Register 1 | ATU Inbound Translation Window5345** FFFF E318H Outbound Message Register 0 |5346** FFFF E31CH Outbound Message Register 1 | or5347** FFFF E320H Inbound Doorbell Register |5348** FFFF E324H Inbound Interrupt Status Register | must translate PCI address to5349** FFFF E328H Inbound Interrupt Mask Register | the Intel Xscale Core5350** FFFF E32CH Outbound Doorbell Register | Memory-Mapped Address5351** FFFF E330H Outbound Interrupt Status Register |5352** FFFF E334H Outbound Interrupt Mask Register |5353** ______________________________________________________________________|________________________________________5354** FFFF E338H reserved |5355** FFFF E33CH reserved |5356** FFFF E340H reserved |5357** FFFF E344H reserved |5358** FFFF E348H reserved |5359** FFFF E34CH reserved |5360** FFFF E350H MU Configuration Register |5361** FFFF E354H Queue Base Address Register |5362** FFFF E358H reserved |5363** FFFF E35CH reserved | must translate PCI address to5364** FFFF E360H Inbound Free Head Pointer Register | the Intel Xscale Core5365** FFFF E364H Inbound Free Tail Pointer Register | Memory-Mapped Address5366** FFFF E368H Inbound Post Head pointer Register |5367** FFFF E36CH Inbound Post Tail Pointer Register |5368** FFFF E370H Outbound Free Head Pointer Register |5369** FFFF E374H Outbound Free Tail Pointer Register |5370** FFFF E378H Outbound Post Head pointer Register |5371** FFFF E37CH Outbound Post Tail Pointer Register |5372** FFFF E380H Index Address Register |5373** FFFF E384H reserved |5374** .. .. |5375** FFFF E3FCH reserved |5376** ______________________________________________________________________|_______________________________________5377**************************************************************************5378*/5379/*5380**************************************************************************5381** MU Configuration Register - MUCR FFFF.E350H5382**5383** . The MU Configuration Register (MUCR) contains the Circular Queue Enable bit and the size of one Circular Queue.5384** . The Circular Queue Enable bit enables or disables the Circular Queues.5385** The Circular Queues are disabled at reset to allow the software to initialize the head5386** and tail pointer registers before any PCI accesses to the Queue Ports.5387** . Each Circular Queue may range from 4 K entries (16 Kbytes) to 64 K entries (256 Kbytes) and there are four Circular Queues.5388** ------------------------------------------------------------------------5389** Bit Default Description5390** 31:06 000000H 00 2 Reserved5391** 05:01 00001 2 Circular Queue Size - This field determines the size of each Circular Queue.5392** All four queues are the same size.5393** �E 00001 2 - 4K Entries (16 Kbytes)5394** �E 00010 2 - 8K Entries (32 Kbytes)5395** �E 00100 2 - 16K Entries (64 Kbytes)5396** �E 01000 2 - 32K Entries (128 Kbytes)5397** �E 10000 2 - 64K Entries (256 Kbytes)5398** 00 0 2 Circular Queue Enable - This bit enables or disables the Circular Queues. When clear the Circular5399** Queues are disabled, however the MU accepts PCI accesses to the Circular Queue Ports but ignores5400** the data for Writes and return FFFF.FFFFH for Reads. Interrupts are not generated to the core when5401** disabled. When set, the Circular Queues are fully enabled.5402**************************************************************************5403*/5404#define ARCMSR_MU_CONFIGURATION_REG 0xFFFFE3505405#define ARCMSR_MU_CIRCULAR_QUEUE_SIZE64K 0x00205406#define ARCMSR_MU_CIRCULAR_QUEUE_SIZE32K 0x00105407#define ARCMSR_MU_CIRCULAR_QUEUE_SIZE16K 0x00085408#define ARCMSR_MU_CIRCULAR_QUEUE_SIZE8K 0x00045409#define ARCMSR_MU_CIRCULAR_QUEUE_SIZE4K 0x00025410#define ARCMSR_MU_CIRCULAR_QUEUE_ENABLE 0x0001 /*0:disable 1:enable*/5411/*5412**************************************************************************5413** Queue Base Address Register - QBAR5414**5415** . The Queue Base Address Register (QBAR) contains the local memory address of the Circular Queues.5416** The base address is required to be located on a 1 Mbyte address boundary.5417** . All Circular Queue head and tail pointers are based on the QBAR.5418** When the head and tail pointer registers are read, the Queue Base Address is returned in the upper 12 bits.5419** 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.5420** Warning:5421** The QBAR must designate a range allocated to the 80331 DDR SDRAM interface5422** ------------------------------------------------------------------------5423** Bit Default Description5424** 31:20 000H Queue Base Address - Local memory address of the circular queues.5425** 19:00 00000H Reserved5426**************************************************************************5427*/5428#define ARCMSR_MU_QUEUE_BASE_ADDRESS_REG 0xFFFFE3545429/*5430**************************************************************************5431** Inbound Free Head Pointer Register - IFHPR5432**5433** . The Inbound Free Head Pointer Register (IFHPR) contains the local memory offset from5434** the Queue Base Address of the head pointer for the Inbound Free Queue.5435** The Head Pointer must be aligned on a DWORD address boundary.5436** When read, the Queue Base Address is provided in the upper 12 bits of the register.5437** Writes to the upper 12 bits of the register are ignored.5438** This register is maintained by software.5439** ------------------------------------------------------------------------5440** Bit Default Description5441** 31:20 000H Queue Base Address - Local memory address of the circular queues.5442** 19:02 0000H 00 2 Inbound Free Head Pointer - Local memory offset of the head pointer for the Inbound Free Queue.5443** 01:00 00 2 Reserved5444**************************************************************************5445*/5446#define ARCMSR_MU_INBOUND_FREE_HEAD_PTR_REG 0xFFFFE3605447/*5448**************************************************************************5449** Inbound Free Tail Pointer Register - IFTPR5450**5451** . The Inbound Free Tail Pointer Register (IFTPR) contains the local memory offset from the Queue5452** Base Address of the tail pointer for the Inbound Free Queue. The Tail Pointer must be aligned on a5453** DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits5454** of the register. Writes to the upper 12 bits of the register are ignored.5455** ------------------------------------------------------------------------5456** Bit Default Description5457** 31:20 000H Queue Base Address - Local memory address of the circular queues.5458** 19:02 0000H 00 2 Inbound Free Tail Pointer - Local memory offset of the tail pointer for the Inbound Free Queue.5459** 01:00 00 2 Reserved5460**************************************************************************5461*/5462#define ARCMSR_MU_INBOUND_FREE_TAIL_PTR_REG 0xFFFFE3645463/*5464**************************************************************************5465** Inbound Post Head Pointer Register - IPHPR5466**5467** . The Inbound Post Head Pointer Register (IPHPR) contains the local memory offset from the Queue5468** Base Address of the head pointer for the Inbound Post Queue. The Head Pointer must be aligned on5469** a DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits5470** of the register. Writes to the upper 12 bits of the register are ignored.5471** ------------------------------------------------------------------------5472** Bit Default Description5473** 31:20 000H Queue Base Address - Local memory address of the circular queues.5474** 19:02 0000H 00 2 Inbound Post Head Pointer - Local memory offset of the head pointer for the Inbound Post Queue.5475** 01:00 00 2 Reserved5476**************************************************************************5477*/5478#define ARCMSR_MU_INBOUND_POST_HEAD_PTR_REG 0xFFFFE3685479/*5480**************************************************************************5481** Inbound Post Tail Pointer Register - IPTPR5482**5483** . The Inbound Post Tail Pointer Register (IPTPR) contains the local memory offset from the Queue5484** Base Address of the tail pointer for the Inbound Post Queue. The Tail Pointer must be aligned on a5485** DWORD address boundary. When read, the Queue Base Address is provided in the upper 12 bits5486** of the register. Writes to the upper 12 bits of the register are ignored.5487** ------------------------------------------------------------------------5488** Bit Default Description5489** 31:20 000H Queue Base Address - Local memory address of the circular queues.5490** 19:02 0000H 00 2 Inbound Post Tail Pointer - Local memory offset of the tail pointer for the Inbound Post Queue.5491** 01:00 00 2 Reserved5492**************************************************************************5493*/5494#define ARCMSR_MU_INBOUND_POST_TAIL_PTR_REG 0xFFFFE36C5495/*5496**************************************************************************5497** Index Address Register - IAR5498**5499** . The Index Address Register (IAR) contains the offset of the least recently accessed Index Register.5500** It is written by the MU when the Index Registers are written by a PCI agent.5501** The register is not updated until the Index Interrupt bit in the Inbound Interrupt Status Register is cleared.5502** . The local memory address of the Index Register least recently accessed is computed5503** by adding the Index Address Register to the Inbound ATU Translate Value Register.5504** ------------------------------------------------------------------------5505** Bit Default Description5506** 31:12 000000H Reserved5507** 11:02 00H 00 2 Index Address - is the local memory offset of the Index Register written (050H to FFCH)5508** 01:00 00 2 Reserved5509**************************************************************************5510*/5511#define ARCMSR_MU_LOCAL_MEMORY_INDEX_REG 0xFFFFE380 /*1004 dwords 0x0050....0x0FFC, 4016 bytes 0x0050...0x0FFF*/5512/*5513**********************************************************************************************************5514** RS-232 Interface for Areca Raid Controller5515** The low level command interface is exclusive with VT100 terminal5516** --------------------------------------------------------------------5517** 1. Sequence of command execution5518** --------------------------------------------------------------------5519** (A) Header : 3 bytes sequence (0x5E, 0x01, 0x61)5520** (B) Command block : variable length of data including length, command code, data and checksum byte5521** (C) Return data : variable length of data5522** --------------------------------------------------------------------5523** 2. Command block5524** --------------------------------------------------------------------5525** (A) 1st byte : command block length (low byte)5526** (B) 2nd byte : command block length (high byte)5527** note ..command block length shouldn't > 2040 bytes, length excludes these two bytes5528** (C) 3rd byte : command code5529** (D) 4th and following bytes : variable length data bytes depends on command code5530** (E) last byte : checksum byte (sum of 1st byte until last data byte)5531** --------------------------------------------------------------------5532** 3. Command code and associated data5533** --------------------------------------------------------------------5534** The following are command code defined in raid controller Command code 0x10--0x1? are used for system level management,5535** no password checking is needed and should be implemented in separate well controlled utility and not for end user access.5536** Command code 0x20--0x?? always check the password, password must be entered to enable these command.5537** enum5538** {5539** GUI_SET_SERIAL=0x10,5540** GUI_SET_VENDOR,5541** GUI_SET_MODEL,5542** GUI_IDENTIFY,5543** GUI_CHECK_PASSWORD,5544** GUI_LOGOUT,5545** GUI_HTTP,5546** GUI_SET_ETHERNET_ADDR,5547** GUI_SET_LOGO,5548** GUI_POLL_EVENT,5549** GUI_GET_EVENT,5550** GUI_GET_HW_MONITOR,5551**5552** // GUI_QUICK_CREATE=0x20, (function removed)5553** GUI_GET_INFO_R=0x20,5554** GUI_GET_INFO_V,5555** GUI_GET_INFO_P,5556** GUI_GET_INFO_S,5557** GUI_CLEAR_EVENT,5558**5559** GUI_MUTE_BEEPER=0x30,5560** GUI_BEEPER_SETTING,5561** GUI_SET_PASSWORD,5562** GUI_HOST_INTERFACE_MODE,5563** GUI_REBUILD_PRIORITY,5564** GUI_MAX_ATA_MODE,5565** GUI_RESET_CONTROLLER,5566** GUI_COM_PORT_SETTING,5567** GUI_NO_OPERATION,5568** GUI_DHCP_IP,5569**5570** GUI_CREATE_PASS_THROUGH=0x40,5571** GUI_MODIFY_PASS_THROUGH,5572** GUI_DELETE_PASS_THROUGH,5573** GUI_IDENTIFY_DEVICE,5574**5575** GUI_CREATE_RAIDSET=0x50,5576** GUI_DELETE_RAIDSET,5577** GUI_EXPAND_RAIDSET,5578** GUI_ACTIVATE_RAIDSET,5579** GUI_CREATE_HOT_SPARE,5580** GUI_DELETE_HOT_SPARE,5581**5582** GUI_CREATE_VOLUME=0x60,5583** GUI_MODIFY_VOLUME,5584** GUI_DELETE_VOLUME,5585** GUI_START_CHECK_VOLUME,5586** GUI_STOP_CHECK_VOLUME5587** };5588**5589** Command description :5590**5591** GUI_SET_SERIAL : Set the controller serial#5592** byte 0,1 : length5593** byte 2 : command code 0x105594** byte 3 : password length (should be 0x0f)5595** byte 4-0x13 : should be "ArEcATecHnoLogY"5596** byte 0x14--0x23 : Serial number string (must be 16 bytes)5597** GUI_SET_VENDOR : Set vendor string for the controller5598** byte 0,1 : length5599** byte 2 : command code 0x115600** byte 3 : password length (should be 0x08)5601** byte 4-0x13 : should be "ArEcAvAr"5602** byte 0x14--0x3B : vendor string (must be 40 bytes)5603** GUI_SET_MODEL : Set the model name of the controller5604** byte 0,1 : length5605** byte 2 : command code 0x125606** byte 3 : password length (should be 0x08)5607** byte 4-0x13 : should be "ArEcAvAr"5608** byte 0x14--0x1B : model string (must be 8 bytes)5609** GUI_IDENTIFY : Identify device5610** byte 0,1 : length5611** byte 2 : command code 0x135612** return "Areca RAID Subsystem "5613** GUI_CHECK_PASSWORD : Verify password5614** byte 0,1 : length5615** byte 2 : command code 0x145616** byte 3 : password length5617** byte 4-0x?? : user password to be checked5618** GUI_LOGOUT : Logout GUI (force password checking on next command)5619** byte 0,1 : length5620** byte 2 : command code 0x155621** GUI_HTTP : HTTP interface (reserved for Http proxy service)(0x16)5622**5623** GUI_SET_ETHERNET_ADDR : Set the ethernet MAC address5624** byte 0,1 : length5625** byte 2 : command code 0x175626** byte 3 : password length (should be 0x08)5627** byte 4-0x13 : should be "ArEcAvAr"5628** byte 0x14--0x19 : Ethernet MAC address (must be 6 bytes)5629** GUI_SET_LOGO : Set logo in HTTP5630** byte 0,1 : length5631** byte 2 : command code 0x185632** byte 3 : Page# (0/1/2/3) (0xff --> clear OEM logo)5633** byte 4/5/6/7 : 0x55/0xaa/0xa5/0x5a5634** byte 8 : TITLE.JPG data (each page must be 2000 bytes)5635** note .... page0 1st 2 byte must be actual length of the JPG file5636** GUI_POLL_EVENT : Poll If Event Log Changed5637** byte 0,1 : length5638** byte 2 : command code 0x195639** GUI_GET_EVENT : Read Event5640** byte 0,1 : length5641** byte 2 : command code 0x1a5642** byte 3 : Event Page (0:1st page/1/2/3:last page)5643** GUI_GET_HW_MONITOR : Get HW monitor data5644** byte 0,1 : length5645** byte 2 : command code 0x1b5646** byte 3 : # of FANs(example 2)5647** byte 4 : # of Voltage sensor(example 3)5648** byte 5 : # of temperature sensor(example 2)5649** byte 6 : # of power5650** byte 7/8 : Fan#0 (RPM)5651** byte 9/10 : Fan#15652** byte 11/12 : Voltage#0 original value in *10005653** byte 13/14 : Voltage#0 value5654** byte 15/16 : Voltage#1 org5655** byte 17/18 : Voltage#15656** byte 19/20 : Voltage#2 org5657** byte 21/22 : Voltage#25658** byte 23 : Temp#05659** byte 24 : Temp#15660** byte 25 : Power indicator (bit0 : power#0, bit1 : power#1)5661** byte 26 : UPS indicator5662** GUI_QUICK_CREATE : Quick create raid/volume set5663** byte 0,1 : length5664** byte 2 : command code 0x205665** byte 3/4/5/6 : raw capacity5666** byte 7 : raid level5667** byte 8 : stripe size5668** byte 9 : spare5669** byte 10/11/12/13: device mask (the devices to create raid/volume)5670** This function is removed, application like to implement quick create function5671** need to use GUI_CREATE_RAIDSET and GUI_CREATE_VOLUMESET function.5672** GUI_GET_INFO_R : Get Raid Set Information5673** byte 0,1 : length5674** byte 2 : command code 0x205675** byte 3 : raidset#5676**5677** typedef struct sGUI_RAIDSET5678** {5679** BYTE grsRaidSetName[16];5680** DWORD grsCapacity;5681** DWORD grsCapacityX;5682** DWORD grsFailMask;5683** BYTE grsDevArray[32];5684** BYTE grsMemberDevices;5685** BYTE grsNewMemberDevices;5686** BYTE grsRaidState;5687** BYTE grsVolumes;5688** BYTE grsVolumeList[16];5689** BYTE grsRes1;5690** BYTE grsRes2;5691** BYTE grsRes3;5692** BYTE grsFreeSegments;5693** DWORD grsRawStripes[8];5694** DWORD grsRes4;5695** DWORD grsRes5; // Total to 128 bytes5696** DWORD grsRes6; // Total to 128 bytes5697** } sGUI_RAIDSET, *pGUI_RAIDSET;5698** GUI_GET_INFO_V : Get Volume Set Information5699** byte 0,1 : length5700** byte 2 : command code 0x215701** byte 3 : volumeset#5702**5703** typedef struct sGUI_VOLUMESET5704** {5705** BYTE gvsVolumeName[16]; // 165706** DWORD gvsCapacity;5707** DWORD gvsCapacityX;5708** DWORD gvsFailMask;5709** DWORD gvsStripeSize;5710** DWORD gvsNewFailMask;5711** DWORD gvsNewStripeSize;5712** DWORD gvsVolumeStatus;5713** DWORD gvsProgress; // 325714** sSCSI_ATTR gvsScsi;5715** BYTE gvsMemberDisks;5716** BYTE gvsRaidLevel; // 85717**5718** BYTE gvsNewMemberDisks;5719** BYTE gvsNewRaidLevel;5720** BYTE gvsRaidSetNumber;5721** BYTE gvsRes0; // 45722** BYTE gvsRes1[4]; // 64 bytes5723** } sGUI_VOLUMESET, *pGUI_VOLUMESET;5724**5725** GUI_GET_INFO_P : Get Physical Drive Information5726** byte 0,1 : length5727** byte 2 : command code 0x225728** byte 3 : drive # (from 0 to max-channels - 1)5729**5730** typedef struct sGUI_PHY_DRV5731** {5732** BYTE gpdModelName[40];5733** BYTE gpdSerialNumber[20];5734** BYTE gpdFirmRev[8];5735** DWORD gpdCapacity;5736** DWORD gpdCapacityX; // Reserved for expansion5737** BYTE gpdDeviceState;5738** BYTE gpdPioMode;5739** BYTE gpdCurrentUdmaMode;5740** BYTE gpdUdmaMode;5741** BYTE gpdDriveSelect;5742** BYTE gpdRaidNumber; // 0xff if not belongs to a raid set5743** sSCSI_ATTR gpdScsi;5744** BYTE gpdReserved[40]; // Total to 128 bytes5745** } sGUI_PHY_DRV, *pGUI_PHY_DRV;5746**5747** GUI_GET_INFO_S : Get System Information5748** byte 0,1 : length5749** byte 2 : command code 0x235750**5751** typedef struct sCOM_ATTR5752** {5753** BYTE comBaudRate;5754** BYTE comDataBits;5755** BYTE comStopBits;5756** BYTE comParity;5757** BYTE comFlowControl;5758** } sCOM_ATTR, *pCOM_ATTR;5759**5760** typedef struct sSYSTEM_INFO5761** {5762** BYTE gsiVendorName[40];5763** BYTE gsiSerialNumber[16];5764** BYTE gsiFirmVersion[16];5765** BYTE gsiBootVersion[16];5766** BYTE gsiMbVersion[16];5767** BYTE gsiModelName[8];5768** BYTE gsiLocalIp[4];5769** BYTE gsiCurrentIp[4];5770** DWORD gsiTimeTick;5771** DWORD gsiCpuSpeed;5772** DWORD gsiICache;5773** DWORD gsiDCache;5774** DWORD gsiScache;5775** DWORD gsiMemorySize;5776** DWORD gsiMemorySpeed;5777** DWORD gsiEvents;5778** BYTE gsiMacAddress[6];5779** BYTE gsiDhcp;5780** BYTE gsiBeeper;5781** BYTE gsiChannelUsage;5782** BYTE gsiMaxAtaMode;5783** BYTE gsiSdramEcc; // 1:if ECC enabled5784** BYTE gsiRebuildPriority;5785** sCOM_ATTR gsiComA; // 5 bytes5786** sCOM_ATTR gsiComB; // 5 bytes5787** BYTE gsiIdeChannels;5788** BYTE gsiScsiHostChannels;5789** BYTE gsiIdeHostChannels;5790** BYTE gsiMaxVolumeSet;5791** BYTE gsiMaxRaidSet;5792** BYTE gsiEtherPort; // 1:if ether net port supported5793** BYTE gsiRaid6Engine; // 1:Raid6 engine supported5794** BYTE gsiRes[75];5795** } sSYSTEM_INFO, *pSYSTEM_INFO;5796**5797** GUI_CLEAR_EVENT : Clear System Event5798** byte 0,1 : length5799** byte 2 : command code 0x245800**5801** GUI_MUTE_BEEPER : Mute current beeper5802** byte 0,1 : length5803** byte 2 : command code 0x305804**5805** GUI_BEEPER_SETTING : Disable beeper5806** byte 0,1 : length5807** byte 2 : command code 0x315808** byte 3 : 0->disable, 1->enable5809**5810** GUI_SET_PASSWORD : Change password5811** byte 0,1 : length5812** byte 2 : command code 0x325813** byte 3 : pass word length ( must <= 15 )5814** byte 4 : password (must be alpha-numerical)5815**5816** GUI_HOST_INTERFACE_MODE : Set host interface mode5817** byte 0,1 : length5818** byte 2 : command code 0x335819** byte 3 : 0->Independent, 1->cluster5820**5821** GUI_REBUILD_PRIORITY : Set rebuild priority5822** byte 0,1 : length5823** byte 2 : command code 0x345824** byte 3 : 0/1/2/3 (low->high)5825**5826** GUI_MAX_ATA_MODE : Set maximum ATA mode to be used5827** byte 0,1 : length5828** byte 2 : command code 0x355829** byte 3 : 0/1/2/3 (133/100/66/33)5830**5831** GUI_RESET_CONTROLLER : Reset Controller5832** byte 0,1 : length5833** byte 2 : command code 0x365834** *Response with VT100 screen (discard it)5835**5836** GUI_COM_PORT_SETTING : COM port setting5837** byte 0,1 : length5838** byte 2 : command code 0x375839** byte 3 : 0->COMA (term port), 1->COMB (debug port)5840** byte 4 : 0/1/2/3/4/5/6/7 (1200/2400/4800/9600/19200/38400/57600/115200)5841** byte 5 : data bit (0:7 bit, 1:8 bit : must be 8 bit)5842** byte 6 : stop bit (0:1, 1:2 stop bits)5843** byte 7 : parity (0:none, 1:off, 2:even)5844** byte 8 : flow control (0:none, 1:xon/xoff, 2:hardware => must use none)5845**5846** GUI_NO_OPERATION : No operation5847** byte 0,1 : length5848** byte 2 : command code 0x385849**5850** GUI_DHCP_IP : Set DHCP option and local IP address5851** byte 0,1 : length5852** byte 2 : command code 0x395853** byte 3 : 0:dhcp disabled, 1:dhcp enabled5854** byte 4/5/6/7 : IP address5855**5856** GUI_CREATE_PASS_THROUGH : Create pass through disk5857** byte 0,1 : length5858** byte 2 : command code 0x405859** byte 3 : device #5860** byte 4 : scsi channel (0/1)5861** byte 5 : scsi id (0-->15)5862** byte 6 : scsi lun (0-->7)5863** byte 7 : tagged queue (1 : enabled)5864** byte 8 : cache mode (1 : enabled)5865** byte 9 : max speed (0/1/2/3/4, async/20/40/80/160 for scsi)5866** (0/1/2/3/4, 33/66/100/133/150 for ide )5867**5868** GUI_MODIFY_PASS_THROUGH : Modify pass through disk5869** byte 0,1 : length5870** byte 2 : command code 0x415871** byte 3 : device #5872** byte 4 : scsi channel (0/1)5873** byte 5 : scsi id (0-->15)5874** byte 6 : scsi lun (0-->7)5875** byte 7 : tagged queue (1 : enabled)5876** byte 8 : cache mode (1 : enabled)5877** byte 9 : max speed (0/1/2/3/4, async/20/40/80/160 for scsi)5878** (0/1/2/3/4, 33/66/100/133/150 for ide )5879**5880** GUI_DELETE_PASS_THROUGH : Delete pass through disk5881** byte 0,1 : length5882** byte 2 : command code 0x425883** byte 3 : device# to be deleted5884**5885** GUI_IDENTIFY_DEVICE : Identify Device5886** byte 0,1 : length5887** byte 2 : command code 0x435888** byte 3 : Flash Method(0:flash selected, 1:flash not selected)5889** byte 4/5/6/7 : IDE device mask to be flashed5890** note .... no response data available5891**5892** GUI_CREATE_RAIDSET : Create Raid Set5893** byte 0,1 : length5894** byte 2 : command code 0x505895** byte 3/4/5/6 : device mask5896** byte 7-22 : raidset name (if byte 7 == 0:use default)5897**5898** GUI_DELETE_RAIDSET : Delete Raid Set5899** byte 0,1 : length5900** byte 2 : command code 0x515901** byte 3 : raidset#5902**5903** GUI_EXPAND_RAIDSET : Expand Raid Set5904** byte 0,1 : length5905** byte 2 : command code 0x525906** byte 3 : raidset#5907** byte 4/5/6/7 : device mask for expansion5908** 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 )5909** byte 11/12/13 : repeat for each volume in the raidset ....5910**5911** GUI_ACTIVATE_RAIDSET : Activate incomplete raid set5912** byte 0,1 : length5913** byte 2 : command code 0x535914** byte 3 : raidset#5915**5916** GUI_CREATE_HOT_SPARE : Create hot spare disk5917** byte 0,1 : length5918** byte 2 : command code 0x545919** byte 3/4/5/6 : device mask for hot spare creation5920**5921** GUI_DELETE_HOT_SPARE : Delete hot spare disk5922** byte 0,1 : length5923** byte 2 : command code 0x555924** byte 3/4/5/6 : device mask for hot spare deletion5925**5926** GUI_CREATE_VOLUME : Create volume set5927** byte 0,1 : length5928** byte 2 : command code 0x605929** byte 3 : raidset#5930** byte 4-19 : volume set name (if byte4 == 0, use default)5931** byte 20-27 : volume capacity (blocks)5932** byte 28 : raid level5933** byte 29 : stripe size (0/1/2/3/4/5->4/8/16/32/64/128K)5934** byte 30 : channel5935** byte 31 : ID5936** byte 32 : LUN5937** byte 33 : 1 enable tag5938** byte 34 : 1 enable cache5939** byte 35 : speed (0/1/2/3/4->async/20/40/80/160 for scsi)5940** (0/1/2/3/4->33/66/100/133/150 for IDE )5941** byte 36 : 1 to select quick init5942**5943** GUI_MODIFY_VOLUME : Modify volume Set5944** byte 0,1 : length5945** byte 2 : command code 0x615946** byte 3 : volumeset#5947** byte 4-19 : new volume set name (if byte4 == 0, not change)5948** byte 20-27 : new volume capacity (reserved)5949** byte 28 : new raid level5950** byte 29 : new stripe size (0/1/2/3/4/5->4/8/16/32/64/128K)5951** byte 30 : new channel5952** byte 31 : new ID5953** byte 32 : new LUN5954** byte 33 : 1 enable tag5955** byte 34 : 1 enable cache5956** byte 35 : speed (0/1/2/3/4->async/20/40/80/160 for scsi)5957** (0/1/2/3/4->33/66/100/133/150 for IDE )5958**5959** GUI_DELETE_VOLUME : Delete volume set5960** byte 0,1 : length5961** byte 2 : command code 0x625962** byte 3 : volumeset#5963**5964** GUI_START_CHECK_VOLUME : Start volume consistency check5965** byte 0,1 : length5966** byte 2 : command code 0x635967** byte 3 : volumeset#5968**5969** GUI_STOP_CHECK_VOLUME : Stop volume consistency check5970** byte 0,1 : length5971** byte 2 : command code 0x645972** ---------------------------------------------------------------------5973** 4. Returned data5974** ---------------------------------------------------------------------5975** (A) Header : 3 bytes sequence (0x5E, 0x01, 0x61)5976** (B) Length : 2 bytes (low byte 1st, excludes length and checksum byte)5977** (C) status or data :5978** <1> If length == 1 ==> 1 byte status code5979** #define GUI_OK 0x415980** #define GUI_RAIDSET_NOT_NORMAL 0x425981** #define GUI_VOLUMESET_NOT_NORMAL 0x435982** #define GUI_NO_RAIDSET 0x445983** #define GUI_NO_VOLUMESET 0x455984** #define GUI_NO_PHYSICAL_DRIVE 0x465985** #define GUI_PARAMETER_ERROR 0x475986** #define GUI_UNSUPPORTED_COMMAND 0x485987** #define GUI_DISK_CONFIG_CHANGED 0x495988** #define GUI_INVALID_PASSWORD 0x4a5989** #define GUI_NO_DISK_SPACE 0x4b5990** #define GUI_CHECKSUM_ERROR 0x4c5991** #define GUI_PASSWORD_REQUIRED 0x4d5992** <2> If length > 1 ==> data block returned from controller and the contents depends on the command code5993** (E) Checksum : checksum of length and status or data byte5994**************************************************************************5995*/599659975998