Lines Matching refs:iop_base

558 	PortAddr iop_base;  member
1918 AdvPortAddr iop_base; /* I/O port address */ member
1989 #define AdvReadByteRegister(iop_base, reg_off) \ argument
1990 (ADV_MEM_READB((iop_base) + (reg_off)))
1993 #define AdvWriteByteRegister(iop_base, reg_off, byte) \ argument
1994 (ADV_MEM_WRITEB((iop_base) + (reg_off), (byte)))
1997 #define AdvReadWordRegister(iop_base, reg_off) \ argument
1998 (ADV_MEM_READW((iop_base) + (reg_off)))
2001 #define AdvWriteWordRegister(iop_base, reg_off, word) \ argument
2002 (ADV_MEM_WRITEW((iop_base) + (reg_off), (word)))
2005 #define AdvWriteDWordRegister(iop_base, reg_off, dword) \ argument
2006 (ADV_MEM_WRITEDW((iop_base) + (reg_off), (dword)))
2009 #define AdvReadByteLram(iop_base, addr, byte) \ argument
2011 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)); \
2012 (byte) = ADV_MEM_READB((iop_base) + IOPB_RAM_DATA); \
2016 #define AdvWriteByteLram(iop_base, addr, byte) \ argument
2017 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
2018 ADV_MEM_WRITEB((iop_base) + IOPB_RAM_DATA, (byte)))
2021 #define AdvReadWordLram(iop_base, addr, word) \ argument
2023 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)); \
2024 (word) = (ADV_MEM_READW((iop_base) + IOPW_RAM_DATA)); \
2028 #define AdvWriteWordLram(iop_base, addr, word) \ argument
2029 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
2030 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word)))
2034 #define AdvWriteDWordLramNoSwap(iop_base, addr, dword) \ argument
2035 ((ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
2036 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
2038 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr) + 2), \
2039 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
2043 #define AdvReadWordAutoIncLram(iop_base) \ argument
2044 (ADV_MEM_READW((iop_base) + IOPW_RAM_DATA))
2047 #define AdvWriteWordAutoIncLram(iop_base, word) \ argument
2048 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word)))
2056 #define AdvFindSignature(iop_base) \ argument
2057 (((AdvReadByteRegister((iop_base), IOPB_CHIP_ID_1) == \
2059 (AdvReadWordRegister((iop_base), IOPW_CHIP_ID_0) == \
2067 #define AdvGetChipVersion(iop_base, bus_type) \ argument
2068 AdvReadByteRegister((iop_base), IOPB_CHIP_TYPE_REV)
2408 "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); in asc_prt_asc_dvc_var()
2465 (ulong)h->iop_base, h->err_code, (unsigned)h->ultra_able); in asc_prt_adv_dvc_var()
2852 ASC_VERSION, widename, (ulong)adv_dvc_varp->iop_base, in advansys_info()
2853 (ulong)adv_dvc_varp->iop_base + boardp->asc_n_io_port - 1, boardp->irq); in advansys_info()
3506 AdvPortAddr iop_base; in asc_prt_adv_board_info() local
3518 iop_base = v->iop_base; in asc_prt_adv_board_info()
3527 (unsigned long)v->iop_base, in asc_prt_adv_board_info()
3528 AdvReadWordRegister(iop_base,IOPW_SCSI_CFG1) & CABLE_DETECT, in asc_prt_adv_board_info()
3535 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in asc_prt_adv_board_info()
3555 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + i, in asc_prt_adv_board_info()
3568 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_QUEUED_CMD + i, in asc_prt_adv_board_info()
3575 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in asc_prt_adv_board_info()
3589 AdvReadWordLram(iop_base, ASC_MC_WDTR_DONE, wdtr_done); in asc_prt_adv_board_info()
3597 AdvReadWordLram(iop_base, in asc_prt_adv_board_info()
3612 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in asc_prt_adv_board_info()
3626 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, sdtr_done); in asc_prt_adv_board_info()
3629 AdvReadWordLram(iop_base, in asc_prt_adv_board_info()
3813 static void AscSetBank(PortAddr iop_base, uchar bank) in AscSetBank() argument
3817 val = AscGetChipControl(iop_base) & in AscSetBank()
3828 AscSetChipControl(iop_base, val); in AscSetBank()
3831 static void AscSetChipIH(PortAddr iop_base, ushort ins_code) in AscSetChipIH() argument
3833 AscSetBank(iop_base, 1); in AscSetChipIH()
3834 AscWriteChipIH(iop_base, ins_code); in AscSetChipIH()
3835 AscSetBank(iop_base, 0); in AscSetChipIH()
3838 static int AscStartChip(PortAddr iop_base) in AscStartChip() argument
3840 AscSetChipControl(iop_base, 0); in AscStartChip()
3841 if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { in AscStartChip()
3847 static int AscStopChip(PortAddr iop_base) in AscStopChip() argument
3852 AscGetChipControl(iop_base) & in AscStopChip()
3854 AscSetChipControl(iop_base, (uchar)(cc_val | CC_HALT)); in AscStopChip()
3855 AscSetChipIH(iop_base, INS_HALT); in AscStopChip()
3856 AscSetChipIH(iop_base, INS_RFLAG_WTM); in AscStopChip()
3857 if ((AscGetChipStatus(iop_base) & CSW_HALTED) == 0) { in AscStopChip()
3863 static int AscIsChipHalted(PortAddr iop_base) in AscIsChipHalted() argument
3865 if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { in AscIsChipHalted()
3866 if ((AscGetChipControl(iop_base) & CC_HALT) != 0) { in AscIsChipHalted()
3875 PortAddr iop_base; in AscResetChipAndScsiBus() local
3878 iop_base = asc_dvc->iop_base; in AscResetChipAndScsiBus()
3879 while ((AscGetChipStatus(iop_base) & CSW_SCSI_RESET_ACTIVE) in AscResetChipAndScsiBus()
3883 AscStopChip(iop_base); in AscResetChipAndScsiBus()
3884 AscSetChipControl(iop_base, CC_CHIP_RESET | CC_SCSI_RESET | CC_HALT); in AscResetChipAndScsiBus()
3886 AscSetChipIH(iop_base, INS_RFLAG_WTM); in AscResetChipAndScsiBus()
3887 AscSetChipIH(iop_base, INS_HALT); in AscResetChipAndScsiBus()
3888 AscSetChipControl(iop_base, CC_CHIP_RESET | CC_HALT); in AscResetChipAndScsiBus()
3889 AscSetChipControl(iop_base, CC_HALT); in AscResetChipAndScsiBus()
3891 AscSetChipStatus(iop_base, CIW_CLR_SCSI_RESET_INT); in AscResetChipAndScsiBus()
3892 AscSetChipStatus(iop_base, 0); in AscResetChipAndScsiBus()
3893 return (AscIsChipHalted(iop_base)); in AscResetChipAndScsiBus()
3896 static int AscFindSignature(PortAddr iop_base) in AscFindSignature() argument
3901 iop_base, AscGetChipSignatureByte(iop_base)); in AscFindSignature()
3902 if (AscGetChipSignatureByte(iop_base) == (uchar)ASC_1000_ID1B) { in AscFindSignature()
3904 iop_base, AscGetChipSignatureWord(iop_base)); in AscFindSignature()
3905 sig_word = AscGetChipSignatureWord(iop_base); in AscFindSignature()
3914 static void AscEnableInterrupt(PortAddr iop_base) in AscEnableInterrupt() argument
3918 cfg = AscGetChipCfgLsw(iop_base); in AscEnableInterrupt()
3919 AscSetChipCfgLsw(iop_base, cfg | ASC_CFG0_HOST_INT_ON); in AscEnableInterrupt()
3922 static void AscDisableInterrupt(PortAddr iop_base) in AscDisableInterrupt() argument
3926 cfg = AscGetChipCfgLsw(iop_base); in AscDisableInterrupt()
3927 AscSetChipCfgLsw(iop_base, cfg & (~ASC_CFG0_HOST_INT_ON)); in AscDisableInterrupt()
3930 static uchar AscReadLramByte(PortAddr iop_base, ushort addr) in AscReadLramByte() argument
3936 AscSetChipLramAddr(iop_base, addr - 1); in AscReadLramByte()
3937 word_data = AscGetChipLramData(iop_base); in AscReadLramByte()
3940 AscSetChipLramAddr(iop_base, addr); in AscReadLramByte()
3941 word_data = AscGetChipLramData(iop_base); in AscReadLramByte()
3947 static ushort AscReadLramWord(PortAddr iop_base, ushort addr) in AscReadLramWord() argument
3951 AscSetChipLramAddr(iop_base, addr); in AscReadLramWord()
3952 word_data = AscGetChipLramData(iop_base); in AscReadLramWord()
3957 static ASC_DCNT AscReadLramDWord(PortAddr iop_base, ushort addr) in AscReadLramDWord() argument
3962 AscSetChipLramAddr(iop_base, addr); in AscReadLramDWord()
3963 val_low = AscGetChipLramData(iop_base); in AscReadLramDWord()
3964 val_high = AscGetChipLramData(iop_base); in AscReadLramDWord()
3971 AscMemWordSetLram(PortAddr iop_base, ushort s_addr, ushort set_wval, int words) in AscMemWordSetLram() argument
3975 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordSetLram()
3977 AscSetChipLramData(iop_base, set_wval); in AscMemWordSetLram()
3981 static void AscWriteLramWord(PortAddr iop_base, ushort addr, ushort word_val) in AscWriteLramWord() argument
3983 AscSetChipLramAddr(iop_base, addr); in AscWriteLramWord()
3984 AscSetChipLramData(iop_base, word_val); in AscWriteLramWord()
3987 static void AscWriteLramByte(PortAddr iop_base, ushort addr, uchar byte_val) in AscWriteLramByte() argument
3993 word_data = AscReadLramWord(iop_base, addr); in AscWriteLramByte()
3997 word_data = AscReadLramWord(iop_base, addr); in AscWriteLramByte()
4001 AscWriteLramWord(iop_base, addr, word_data); in AscWriteLramByte()
4011 AscMemWordCopyPtrToLram(PortAddr iop_base, ushort s_addr, in AscMemWordCopyPtrToLram() argument
4016 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordCopyPtrToLram()
4026 outpw(iop_base + IOP_RAM_DATA, in AscMemWordCopyPtrToLram()
4038 AscMemDWordCopyPtrToLram(PortAddr iop_base, in AscMemDWordCopyPtrToLram() argument
4043 AscSetChipLramAddr(iop_base, s_addr); in AscMemDWordCopyPtrToLram()
4045 outpw(iop_base + IOP_RAM_DATA, ((ushort)s_buffer[i + 1] << 8) | s_buffer[i]); /* LSW */ in AscMemDWordCopyPtrToLram()
4046 outpw(iop_base + IOP_RAM_DATA, ((ushort)s_buffer[i + 3] << 8) | s_buffer[i + 2]); /* MSW */ in AscMemDWordCopyPtrToLram()
4057 AscMemWordCopyPtrFromLram(PortAddr iop_base, in AscMemWordCopyPtrFromLram() argument
4063 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordCopyPtrFromLram()
4065 word = inpw(iop_base + IOP_RAM_DATA); in AscMemWordCopyPtrFromLram()
4071 static ASC_DCNT AscMemSumLramWord(PortAddr iop_base, ushort s_addr, int words) in AscMemSumLramWord() argument
4078 sum += AscReadLramWord(iop_base, s_addr); in AscMemSumLramWord()
4087 PortAddr iop_base; in AscInitLram() local
4090 iop_base = asc_dvc->iop_base; in AscInitLram()
4092 AscMemWordSetLram(iop_base, ASC_QADR_BEG, 0, in AscInitLram()
4097 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
4099 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
4101 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
4106 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
4108 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
4110 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
4113 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
4115 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
4117 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
4123 AscWriteLramByte(iop_base, in AscInitLram()
4125 AscWriteLramByte(iop_base, in AscInitLram()
4127 AscWriteLramByte(iop_base, in AscInitLram()
4134 AscLoadMicroCode(PortAddr iop_base, ushort s_addr, in AscLoadMicroCode() argument
4143 AscMemWordSetLram(iop_base, s_addr, 0, mcode_word_size); in AscLoadMicroCode()
4144 AscMemWordCopyPtrToLram(iop_base, s_addr, mcode_buf, mcode_word_size); in AscLoadMicroCode()
4146 chksum = AscMemSumLramWord(iop_base, s_addr, mcode_word_size); in AscLoadMicroCode()
4148 mcode_chksum = (ushort)AscMemSumLramWord(iop_base, in AscLoadMicroCode()
4155 AscWriteLramWord(iop_base, ASCV_MCODE_CHKSUM_W, mcode_chksum); in AscLoadMicroCode()
4156 AscWriteLramWord(iop_base, ASCV_MCODE_SIZE_W, mcode_size); in AscLoadMicroCode()
4162 PortAddr iop_base; in AscInitQLinkVar() local
4166 iop_base = asc_dvc->iop_base; in AscInitQLinkVar()
4167 AscPutRiscVarFreeQHead(iop_base, 1); in AscInitQLinkVar()
4168 AscPutRiscVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
4169 AscPutVarFreeQHead(iop_base, 1); in AscInitQLinkVar()
4170 AscPutVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
4171 AscWriteLramByte(iop_base, ASCV_BUSY_QHEAD_B, in AscInitQLinkVar()
4173 AscWriteLramByte(iop_base, ASCV_DISC1_QHEAD_B, in AscInitQLinkVar()
4175 AscWriteLramByte(iop_base, (ushort)ASCV_TOTAL_READY_Q_B, in AscInitQLinkVar()
4177 AscWriteLramWord(iop_base, ASCV_ASCDVC_ERR_CODE_W, 0); in AscInitQLinkVar()
4178 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscInitQLinkVar()
4179 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, 0); in AscInitQLinkVar()
4180 AscWriteLramByte(iop_base, ASCV_SCSIBUSY_B, 0); in AscInitQLinkVar()
4181 AscWriteLramByte(iop_base, ASCV_WTM_FLAG_B, 0); in AscInitQLinkVar()
4182 AscPutQDoneInProgress(iop_base, 0); in AscInitQLinkVar()
4185 AscWriteLramWord(iop_base, lram_addr, 0); in AscInitQLinkVar()
4193 PortAddr iop_base; in AscInitMicroCodeVar() local
4198 iop_base = asc_dvc->iop_base; in AscInitMicroCodeVar()
4201 AscPutMCodeInitSDTRAtID(iop_base, i, in AscInitMicroCodeVar()
4206 AscWriteLramByte(iop_base, ASCV_DISC_ENABLE_B, in AscInitMicroCodeVar()
4208 AscWriteLramByte(iop_base, ASCV_HOSTSCSI_ID_B, in AscInitMicroCodeVar()
4220 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_PADDR_D, in AscInitMicroCodeVar()
4223 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_BSIZE_D, in AscInitMicroCodeVar()
4227 AscReadLramWord(iop_base, (ushort)ASCV_MC_DATE_W); in AscInitMicroCodeVar()
4229 AscReadLramWord(iop_base, (ushort)ASCV_MC_VER_W); in AscInitMicroCodeVar()
4231 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); in AscInitMicroCodeVar()
4232 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { in AscInitMicroCodeVar()
4237 if (AscStartChip(iop_base) != 1) { in AscInitMicroCodeVar()
4260 PortAddr iop_base; in AscInitAsc1000Driver() local
4262 iop_base = asc_dvc->iop_base; in AscInitAsc1000Driver()
4272 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitAsc1000Driver()
4276 AscDisableInterrupt(iop_base); in AscInitAsc1000Driver()
4298 if (AscLoadMicroCode(iop_base, 0, &fw->data[4], in AscInitAsc1000Driver()
4309 AscEnableInterrupt(iop_base); in AscInitAsc1000Driver()
4335 static int AdvLoadMicrocode(AdvPortAddr iop_base, const unsigned char *buf, in AdvLoadMicrocode() argument
4341 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, 0); in AdvLoadMicrocode()
4347 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4353 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4359 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4367 AdvWriteWordAutoIncLram(iop_base, 0); in AdvLoadMicrocode()
4373 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, 0); in AdvLoadMicrocode()
4376 sum += AdvReadWordAutoIncLram(iop_base); in AdvLoadMicrocode()
4439 AdvPortAddr iop_base; in AdvSendIdleCmd() local
4441 iop_base = asc_dvc->iop_base; in AdvSendIdleCmd()
4448 AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD_STATUS, (ushort)0); in AdvSendIdleCmd()
4456 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IDLE_CMD_PARAMETER, in AdvSendIdleCmd()
4458 AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD, idle_cmd); in AdvSendIdleCmd()
4463 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_B); in AdvSendIdleCmd()
4470 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_NOP); in AdvSendIdleCmd()
4477 AdvReadWordLram(iop_base, ASC_MC_IDLE_CMD_STATUS, in AdvSendIdleCmd()
4547 AdvPortAddr iop_base; in AdvInitAsc3550Driver() local
4575 iop_base = asc_dvc->iop_base; in AdvInitAsc3550Driver()
4586 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc3550Driver()
4602 AdvReadWordLram(iop_base, 0x120, wdtr_able); in AdvInitAsc3550Driver()
4604 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc3550Driver()
4607 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc3550Driver()
4608 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc3550Driver()
4610 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc3550Driver()
4630 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc3550Driver()
4641 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc3550Driver()
4649 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc3550Driver()
4650 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc3550Driver()
4652 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc3550Driver()
4654 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc3550Driver()
4656 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc3550Driver()
4661 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc3550Driver()
4663 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc3550Driver()
4669 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC3550); in AdvInitAsc3550Driver()
4678 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc3550Driver()
4680 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc3550Driver()
4687 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc3550Driver()
4703 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc3550Driver()
4705 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc3550Driver()
4741 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, word); in AdvInitAsc3550Driver()
4744 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, word); in AdvInitAsc3550Driver()
4747 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, word); in AdvInitAsc3550Driver()
4750 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, word); in AdvInitAsc3550Driver()
4758 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc3550Driver()
4767 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc3550Driver()
4779 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc3550Driver()
4795 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc3550Driver()
4873 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, in AdvInitAsc3550Driver()
4887 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc3550Driver()
4896 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc3550Driver()
4920 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc3550Driver()
4944 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc3550Driver()
4947 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc3550Driver()
4951 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc3550Driver()
4952 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc3550Driver()
4955 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc3550Driver()
4973 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc3550Driver()
4974 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc3550Driver()
4975 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc3550Driver()
4978 AdvWriteByteLram(iop_base, in AdvInitAsc3550Driver()
5006 AdvPortAddr iop_base; in AdvInitAsc38C0800Driver() local
5035 iop_base = asc_dvc->iop_base; in AdvInitAsc38C0800Driver()
5046 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C0800Driver()
5053 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C0800Driver()
5054 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C0800Driver()
5055 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc38C0800Driver()
5057 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc38C0800Driver()
5091 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, PRE_TEST_MODE); in AdvInitAsc38C0800Driver()
5093 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C0800Driver()
5100 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C0800Driver()
5102 if (AdvReadByteRegister(iop_base, IOPB_RAM_BIST) in AdvInitAsc38C0800Driver()
5116 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, RAM_TEST_MODE); in AdvInitAsc38C0800Driver()
5119 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C0800Driver()
5128 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C0800Driver()
5146 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc38C0800Driver()
5157 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C0800Driver()
5165 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc38C0800Driver()
5166 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc38C0800Driver()
5168 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc38C0800Driver()
5170 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc38C0800Driver()
5172 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc38C0800Driver()
5177 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc38C0800Driver()
5179 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc38C0800Driver()
5185 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC38C0800); in AdvInitAsc38C0800Driver()
5195 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C0800Driver()
5196 AdvWriteWordRegister(iop_base, IOPW_SCSI_CFG1, in AdvInitAsc38C0800Driver()
5206 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C0800Driver()
5208 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C0800Driver()
5219 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc38C0800Driver()
5236 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc38C0800Driver()
5238 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc38C0800Driver()
5251 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc38C0800Driver()
5253 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C0800Driver()
5254 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C0800Driver()
5255 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C0800Driver()
5256 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C0800Driver()
5264 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc38C0800Driver()
5276 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C0800Driver()
5283 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc38C0800Driver()
5371 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, scsi_cfg1); in AdvInitAsc38C0800Driver()
5384 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc38C0800Driver()
5393 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc38C0800Driver()
5418 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C0800Driver()
5444 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C0800Driver()
5447 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc38C0800Driver()
5451 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc38C0800Driver()
5452 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc38C0800Driver()
5455 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc38C0800Driver()
5473 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C0800Driver()
5474 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C0800Driver()
5475 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc38C0800Driver()
5478 AdvWriteByteLram(iop_base, in AdvInitAsc38C0800Driver()
5506 AdvPortAddr iop_base; in AdvInitAsc38C1600Driver() local
5536 iop_base = asc_dvc->iop_base; in AdvInitAsc38C1600Driver()
5547 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C1600Driver()
5554 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C1600Driver()
5555 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C1600Driver()
5556 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvInitAsc38C1600Driver()
5557 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc38C1600Driver()
5559 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc38C1600Driver()
5593 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, PRE_TEST_MODE); in AdvInitAsc38C1600Driver()
5595 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C1600Driver()
5602 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C1600Driver()
5604 if (AdvReadByteRegister(iop_base, IOPB_RAM_BIST) in AdvInitAsc38C1600Driver()
5618 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, RAM_TEST_MODE); in AdvInitAsc38C1600Driver()
5621 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C1600Driver()
5630 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C1600Driver()
5648 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc38C1600Driver()
5659 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C1600Driver()
5667 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc38C1600Driver()
5668 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc38C1600Driver()
5670 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc38C1600Driver()
5672 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc38C1600Driver()
5674 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc38C1600Driver()
5679 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc38C1600Driver()
5681 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc38C1600Driver()
5687 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC38C1600); in AdvInitAsc38C1600Driver()
5697 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C1600Driver()
5698 AdvWriteWordRegister(iop_base, IOPW_SCSI_CFG1, in AdvInitAsc38C1600Driver()
5708 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5710 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5720 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5722 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5729 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc38C1600Driver()
5745 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc38C1600Driver()
5747 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc38C1600Driver()
5760 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc38C1600Driver()
5762 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C1600Driver()
5763 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C1600Driver()
5764 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C1600Driver()
5765 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C1600Driver()
5773 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc38C1600Driver()
5786 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C1600Driver()
5793 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc38C1600Driver()
5874 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, scsi_cfg1); in AdvInitAsc38C1600Driver()
5895 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc38C1600Driver()
5904 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc38C1600Driver()
5929 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C1600Driver()
5930 AdvWriteDWordRegister(iop_base, IOPDW_COMMA, in AdvInitAsc38C1600Driver()
5955 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C1600Driver()
5958 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc38C1600Driver()
5961 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc38C1600Driver()
5962 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc38C1600Driver()
5965 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc38C1600Driver()
5982 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C1600Driver()
5983 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C1600Driver()
5984 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvInitAsc38C1600Driver()
5985 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc38C1600Driver()
5988 AdvWriteByteLram(iop_base, in AdvInitAsc38C1600Driver()
6015 AdvPortAddr iop_base; in AdvResetChipAndSB() local
6018 iop_base = asc_dvc->iop_base; in AdvResetChipAndSB()
6023 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvResetChipAndSB()
6024 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvResetChipAndSB()
6026 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvResetChipAndSB()
6028 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvResetChipAndSB()
6030 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvResetChipAndSB()
6040 AdvReadWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, bios_sig); in AdvResetChipAndSB()
6041 AdvWriteWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, 0); in AdvResetChipAndSB()
6046 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_STOP); in AdvResetChipAndSB()
6047 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, ADV_CTRL_REG_CMD_RESET); in AdvResetChipAndSB()
6049 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvResetChipAndSB()
6075 AdvWriteWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, bios_sig); in AdvResetChipAndSB()
6080 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvResetChipAndSB()
6081 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvResetChipAndSB()
6083 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvResetChipAndSB()
6085 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvResetChipAndSB()
6087 AdvWriteByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvResetChipAndSB()
6311 AdvPortAddr iop_base; in AdvISR() local
6318 iop_base = asc_dvc->iop_base; in AdvISR()
6321 int_stat = AdvReadByteRegister(iop_base, IOPB_INTR_STATUS_REG); in AdvISR()
6336 AdvReadByteLram(iop_base, ASC_MC_INTRB_CODE, intrb_code); in AdvISR()
6342 AdvWriteByteRegister(iop_base, IOPB_TICKLE, in AdvISR()
6345 AdvWriteByteRegister(iop_base, in AdvISR()
6425 AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W, in AscSetLibErrorCode()
6431 static void AscAckInterrupt(PortAddr iop_base) in AscAckInterrupt() argument
6439 risc_flag = AscReadLramByte(iop_base, ASCV_RISC_FLAG_B); in AscAckInterrupt()
6445 AscReadLramByte(iop_base, in AscAckInterrupt()
6447 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, in AscAckInterrupt()
6449 AscSetChipStatus(iop_base, CIW_INT_ACK); in AscAckInterrupt()
6451 while (AscGetChipStatus(iop_base) & CSW_INT_PENDING) { in AscAckInterrupt()
6452 AscSetChipStatus(iop_base, CIW_INT_ACK); in AscAckInterrupt()
6457 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, host_flag); in AscAckInterrupt()
6487 PortAddr iop_base; in AscMsgOutSDTR() local
6489 iop_base = asc_dvc->iop_base; in AscMsgOutSDTR()
6498 AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, in AscMsgOutSDTR()
6504 AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, in AscMsgOutSDTR()
6524 static int AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data) in AscSetChipSynRegAtID() argument
6530 AscSetBank(iop_base, 1); in AscSetChipSynRegAtID()
6531 org_id = AscReadChipDvcID(iop_base); in AscSetChipSynRegAtID()
6537 AscWriteChipDvcID(iop_base, id); in AscSetChipSynRegAtID()
6538 if (AscReadChipDvcID(iop_base) == (0x01 << id)) { in AscSetChipSynRegAtID()
6539 AscSetBank(iop_base, 0); in AscSetChipSynRegAtID()
6540 AscSetChipSyn(iop_base, sdtr_data); in AscSetChipSynRegAtID()
6541 if (AscGetChipSyn(iop_base) != sdtr_data) { in AscSetChipSynRegAtID()
6547 AscSetBank(iop_base, 1); in AscSetChipSynRegAtID()
6548 AscWriteChipDvcID(iop_base, org_id); in AscSetChipSynRegAtID()
6549 AscSetBank(iop_base, 0); in AscSetChipSynRegAtID()
6553 static void AscSetChipSDTR(PortAddr iop_base, uchar sdtr_data, uchar tid_no) in AscSetChipSDTR() argument
6555 AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); in AscSetChipSDTR()
6556 AscPutMCodeSDTRDoneAtID(iop_base, tid_no, sdtr_data); in AscSetChipSDTR()
6568 PortAddr iop_base; in AscIsrChipHalted() local
6583 iop_base = asc_dvc->iop_base; in AscIsrChipHalted()
6584 int_halt_code = AscReadLramWord(iop_base, ASCV_HALTCODE_W); in AscIsrChipHalted()
6586 halt_qp = AscReadLramByte(iop_base, ASCV_CURCDB_B); in AscIsrChipHalted()
6588 target_ix = AscReadLramByte(iop_base, in AscIsrChipHalted()
6591 q_cntl = AscReadLramByte(iop_base, in AscIsrChipHalted()
6602 AscSetChipSDTR(iop_base, 0, tid_no); in AscIsrChipHalted()
6605 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6609 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6612 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6615 AscMemWordCopyPtrFromLram(iop_base, in AscIsrChipHalted()
6648 AscSetChipSDTR(iop_base, asyn_sdtr, in AscIsrChipHalted()
6658 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6671 AscSetChipSDTR(iop_base, sdtr_data, in AscIsrChipHalted()
6686 AscSetChipSDTR(iop_base, sdtr_data, in AscIsrChipHalted()
6694 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6698 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6705 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6710 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6714 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6719 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6724 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6728 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6739 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscIsrChipHalted()
6751 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6755 tag_code = AscReadLramByte(iop_base, in AscIsrChipHalted()
6767 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6772 q_status = AscReadLramByte(iop_base, in AscIsrChipHalted()
6776 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6781 scsi_busy = AscReadLramByte(iop_base, (ushort)ASCV_SCSIBUSY_B); in AscIsrChipHalted()
6783 AscWriteLramByte(iop_base, (ushort)ASCV_SCSIBUSY_B, scsi_busy); in AscIsrChipHalted()
6785 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6789 AscMemWordCopyPtrFromLram(iop_base, in AscIsrChipHalted()
6800 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6804 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6807 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6811 scsi_status = AscReadLramByte(iop_base, in AscIsrChipHalted()
6816 AscReadLramByte(iop_base, in AscIsrChipHalted()
6821 scsi_busy = AscReadLramByte(iop_base, in AscIsrChipHalted()
6824 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6834 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6852 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6869 q_no = AscReadLramByte(iop_base, (ushort)ASCV_REQ_SG_LIST_QP); in AscIsrChipHalted()
6883 ASC_SRB2SCSIQ(ASC_U32_TO_VADDR(AscReadLramDWord(iop_base, in AscIsrChipHalted()
6891 sg_wk_q_no = AscReadLramByte(iop_base, in AscIsrChipHalted()
6895 first_sg_wk_q_no = AscReadLramByte(iop_base, in AscIsrChipHalted()
6903 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6976 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6981 AscMemDWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6998 next_qp = AscReadLramByte(iop_base, in AscIsrChipHalted()
7008 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
7026 DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) in DvcGetQinfo() argument
7031 AscSetChipLramAddr(iop_base, s_addr); in DvcGetQinfo()
7036 word = inpw(iop_base + IOP_RAM_DATA); in DvcGetQinfo()
7044 _AscCopyLramScsiDoneQ(PortAddr iop_base, in _AscCopyLramScsiDoneQ() argument
7051 DvcGetQinfo(iop_base, in _AscCopyLramScsiDoneQ()
7056 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
7060 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
7064 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
7073 scsiq->remain_bytes = (((ADV_DCNT)AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
7081 scsiq->remain_bytes += AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
7217 PortAddr iop_base; in AscIsrQDone() local
7225 iop_base = asc_dvc->iop_base; in AscIsrQDone()
7228 done_q_tail = (uchar)AscGetVarDoneQTail(iop_base); in AscIsrQDone()
7230 next_qp = AscReadLramByte(iop_base, in AscIsrQDone()
7233 AscPutVarDoneQTail(iop_base, next_qp); in AscIsrQDone()
7235 sg_queue_cnt = _AscCopyLramScsiDoneQ(iop_base, q_addr, scsiq, in AscIsrQDone()
7237 AscWriteLramByte(iop_base, in AscIsrQDone()
7249 sg_list_qp = AscReadLramByte(iop_base, in AscIsrQDone()
7262 AscWriteLramByte(iop_base, in AscIsrQDone()
7268 AscPutVarDoneQTail(iop_base, sg_list_qp); in AscIsrQDone()
7271 cur_target_qng = AscReadLramByte(iop_base, in AscIsrQDone()
7278 scsi_busy = AscReadLramByte(iop_base, (ushort) in AscIsrQDone()
7281 AscWriteLramByte(iop_base, in AscIsrQDone()
7324 AscStopChip(iop_base); in AscIsrQDone()
7325 AscSetChipControl(iop_base, in AscIsrQDone()
7329 AscSetChipControl(iop_base, CC_HALT); in AscIsrQDone()
7330 AscSetChipStatus(iop_base, in AscIsrQDone()
7332 AscSetChipStatus(iop_base, 0); in AscIsrQDone()
7333 AscSetChipControl(iop_base, 0); in AscIsrQDone()
7339 if ((AscReadLramByte(iop_base, in AscIsrQDone()
7366 PortAddr iop_base; in AscISR() local
7374 iop_base = asc_dvc->iop_base; in AscISR()
7377 if (AscIsIntPending(iop_base) == 0) in AscISR()
7392 ctrl_reg = AscGetChipControl(iop_base); in AscISR()
7395 chipstat = AscGetChipStatus(iop_base); in AscISR()
7402 while ((AscGetChipStatus(iop_base) & in AscISR()
7406 AscSetChipControl(iop_base, (CC_CHIP_RESET | CC_HALT)); in AscISR()
7407 AscSetChipControl(iop_base, CC_HALT); in AscISR()
7408 AscSetChipStatus(iop_base, CIW_CLR_SCSI_RESET_INT); in AscISR()
7409 AscSetChipStatus(iop_base, 0); in AscISR()
7410 chipstat = AscGetChipStatus(iop_base); in AscISR()
7413 saved_ram_addr = AscGetChipLramAddr(iop_base); in AscISR()
7414 host_flag = AscReadLramByte(iop_base, in AscISR()
7417 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, in AscISR()
7420 AscAckInterrupt(iop_base); in AscISR()
7446 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, host_flag); in AscISR()
7447 AscSetChipLramAddr(iop_base, saved_ram_addr); in AscISR()
7448 AscSetChipControl(iop_base, saved_ctrl_reg); in AscISR()
7610 static int AscHostReqRiscHalt(PortAddr iop_base) in AscHostReqRiscHalt() argument
7616 if (AscIsChipHalted(iop_base)) in AscHostReqRiscHalt()
7618 saved_stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B); in AscHostReqRiscHalt()
7619 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, in AscHostReqRiscHalt()
7622 if (AscIsChipHalted(iop_base)) { in AscHostReqRiscHalt()
7628 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, saved_stop_code); in AscHostReqRiscHalt()
7633 AscSetRunChipSynRegAtID(PortAddr iop_base, uchar tid_no, uchar sdtr_data) in AscSetRunChipSynRegAtID() argument
7637 if (AscHostReqRiscHalt(iop_base)) { in AscSetRunChipSynRegAtID()
7638 sta = AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); in AscSetRunChipSynRegAtID()
7639 AscStartChip(iop_base); in AscSetRunChipSynRegAtID()
7663 AscSetRunChipSynRegAtID(asc_dvc->iop_base, sdev->id, in AscAsyncFix()
7703 AscWriteLramByte(asc_dvc->iop_base, ASCV_DISC_ENABLE_B, in advansys_narrow_slave_configure()
7705 AscWriteLramByte(asc_dvc->iop_base, ASCV_USE_TAGGED_QNG_B, in advansys_narrow_slave_configure()
7707 AscWriteLramByte(asc_dvc->iop_base, ASCV_CAN_TAGGED_QNG_B, in advansys_narrow_slave_configure()
7712 AscWriteLramByte(asc_dvc->iop_base, in advansys_narrow_slave_configure()
7726 advansys_wide_enable_wdtr(AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_wdtr() argument
7729 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); in advansys_wide_enable_wdtr()
7734 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); in advansys_wide_enable_wdtr()
7742 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7744 AdvWriteWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7745 AdvReadWordLram(iop_base, ASC_MC_WDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7747 AdvWriteWordLram(iop_base, ASC_MC_WDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7758 advansys_wide_enable_sdtr(AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_sdtr() argument
7761 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); in advansys_wide_enable_sdtr()
7766 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); in advansys_wide_enable_sdtr()
7772 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_sdtr()
7774 AdvWriteWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_sdtr()
7786 AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_ppr() argument
7788 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, adv_dvc->ppr_able); in advansys_wide_enable_ppr()
7790 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, adv_dvc->ppr_able); in advansys_wide_enable_ppr()
7796 AdvPortAddr iop_base = adv_dvc->iop_base; in advansys_wide_slave_configure() local
7807 advansys_wide_enable_wdtr(iop_base, tidmask); in advansys_wide_slave_configure()
7809 advansys_wide_enable_sdtr(iop_base, tidmask); in advansys_wide_slave_configure()
7811 advansys_wide_enable_ppr(adv_dvc, iop_base, tidmask); in advansys_wide_slave_configure()
7822 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, cfg_word); in advansys_wide_slave_configure()
7824 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in advansys_wide_slave_configure()
7826 AdvWriteByteLram(iop_base, in advansys_wide_slave_configure()
8257 static uchar AscAllocFreeQueue(PortAddr iop_base, uchar free_q_head) in AscAllocFreeQueue() argument
8264 q_status = (uchar)AscReadLramByte(iop_base, in AscAllocFreeQueue()
8267 next_qp = AscReadLramByte(iop_base, (ushort)(q_addr + ASC_SCSIQ_B_FWD)); in AscAllocFreeQueue()
8274 AscAllocMultipleFreeQueue(PortAddr iop_base, uchar free_q_head, uchar n_free_q) in AscAllocMultipleFreeQueue() argument
8279 free_q_head = AscAllocFreeQueue(iop_base, free_q_head); in AscAllocMultipleFreeQueue()
8297 DvcPutScsiQ(PortAddr iop_base, ushort s_addr, uchar *outbuf, int words) in DvcPutScsiQ() argument
8302 AscSetChipLramAddr(iop_base, s_addr); in DvcPutScsiQ()
8307 outpw(iop_base + IOP_RAM_DATA, in DvcPutScsiQ()
8319 PortAddr iop_base; in AscPutReadyQueue() local
8321 iop_base = asc_dvc->iop_base; in AscPutReadyQueue()
8325 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscPutReadyQueue()
8339 AscMemWordCopyPtrToLram(iop_base, in AscPutReadyQueue()
8343 DvcPutScsiQ(iop_base, in AscPutReadyQueue()
8347 AscWriteLramWord(iop_base, in AscPutReadyQueue()
8363 PortAddr iop_base; in AscPutReadySgListQueue() local
8370 iop_base = asc_dvc->iop_base; in AscPutReadySgListQueue()
8462 next_qp = AscReadLramByte(iop_base, in AscPutReadySgListQueue()
8467 AscMemWordCopyPtrToLram(iop_base, in AscPutReadySgListQueue()
8471 AscMemDWordCopyPtrToLram(iop_base, in AscPutReadySgListQueue()
8491 PortAddr iop_base; in AscSendScsiQueue() local
8498 iop_base = asc_dvc->iop_base; in AscSendScsiQueue()
8502 free_q_head = (uchar)AscGetVarFreeQHead(iop_base); in AscSendScsiQueue()
8504 next_qp = AscAllocMultipleFreeQueue(iop_base, free_q_head, in AscSendScsiQueue()
8514 next_qp = AscAllocFreeQueue(iop_base, free_q_head); in AscSendScsiQueue()
8521 AscPutVarFreeQHead(iop_base, next_qp); in AscSendScsiQueue()
8550 PortAddr iop_base; in AscExeScsiQueue() local
8567 iop_base = asc_dvc->iop_base; in AscExeScsiQueue()
8582 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscExeScsiQueue()
8796 AdvPortAddr iop_base; in AdvExeScsiQueue() local
8809 iop_base = asc_dvc->iop_base; in AdvExeScsiQueue()
8874 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_A); in AdvExeScsiQueue()
8881 AdvWriteByteRegister(iop_base, IOPB_TICKLE, in AdvExeScsiQueue()
8889 AdvWriteDWordRegister(iop_base, IOPDW_COMMA, in AdvExeScsiQueue()
9013 static ushort AscGetEisaChipCfg(PortAddr iop_base) in DEF_SCSI_QCMD()
9015 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | in DEF_SCSI_QCMD()
9024 static unsigned short AscGetChipBiosAddress(PortAddr iop_base, in AscGetChipBiosAddress() argument
9039 cfg_lsw = AscGetEisaChipCfg(iop_base); in AscGetChipBiosAddress()
9045 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscGetChipBiosAddress()
9056 static uchar AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) in AscSetChipScsiID() argument
9060 if (AscGetChipScsiID(iop_base) == new_host_id) { in AscSetChipScsiID()
9063 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscSetChipScsiID()
9066 AscSetChipCfgLsw(iop_base, cfg_lsw); in AscSetChipScsiID()
9067 return (AscGetChipScsiID(iop_base)); in AscSetChipScsiID()
9070 static unsigned char AscGetChipScsiCtrl(PortAddr iop_base) in AscGetChipScsiCtrl() argument
9074 AscSetBank(iop_base, 1); in AscGetChipScsiCtrl()
9075 sc = inp(iop_base + IOP_REG_SC); in AscGetChipScsiCtrl()
9076 AscSetBank(iop_base, 0); in AscGetChipScsiCtrl()
9080 static unsigned char AscGetChipVersion(PortAddr iop_base, in AscGetChipVersion() argument
9086 eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | in AscGetChipVersion()
9091 return AscGetChipVerNo(iop_base); in AscGetChipVersion()
9107 static int AscStopQueueExe(PortAddr iop_base) in AscStopQueueExe() argument
9111 if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) == 0) { in AscStopQueueExe()
9112 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, in AscStopQueueExe()
9115 if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) & in AscStopQueueExe()
9135 static ushort AscGetIsaDmaChannel(PortAddr iop_base) in AscGetIsaDmaChannel() argument
9139 channel = AscGetChipCfgLsw(iop_base) & 0x0003; in AscGetIsaDmaChannel()
9147 static ushort AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel) in AscSetIsaDmaChannel() argument
9157 cfg_lsw = AscGetChipCfgLsw(iop_base) & 0xFFFC; in AscSetIsaDmaChannel()
9159 AscSetChipCfgLsw(iop_base, cfg_lsw); in AscSetIsaDmaChannel()
9160 return (AscGetIsaDmaChannel(iop_base)); in AscSetIsaDmaChannel()
9165 static uchar AscGetIsaDmaSpeed(PortAddr iop_base) in AscGetIsaDmaSpeed() argument
9169 AscSetBank(iop_base, 1); in AscGetIsaDmaSpeed()
9170 speed_value = AscReadChipDmaSpeed(iop_base); in AscGetIsaDmaSpeed()
9172 AscSetBank(iop_base, 0); in AscGetIsaDmaSpeed()
9176 static uchar AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value) in AscSetIsaDmaSpeed() argument
9179 AscSetBank(iop_base, 1); in AscSetIsaDmaSpeed()
9180 AscWriteChipDmaSpeed(iop_base, speed_value); in AscSetIsaDmaSpeed()
9181 AscSetBank(iop_base, 0); in AscSetIsaDmaSpeed()
9182 return AscGetIsaDmaSpeed(iop_base); in AscSetIsaDmaSpeed()
9189 PortAddr iop_base; in AscInitAscDvcVar() local
9193 iop_base = asc_dvc->iop_base; in AscInitAscDvcVar()
9200 AscSetChipControl(iop_base, CC_HALT); in AscInitAscDvcVar()
9201 AscSetChipStatus(iop_base, 0); in AscInitAscDvcVar()
9229 chip_version = AscGetChipVersion(iop_base, asc_dvc->bus_type); in AscInitAscDvcVar()
9239 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
9242 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
9248 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
9256 AscSetChipIFC(iop_base, IFC_INIT_DEFAULT); in AscInitAscDvcVar()
9260 (uchar)AscGetIsaDmaChannel(iop_base); in AscInitAscDvcVar()
9273 static int AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg) in AscWriteEEPCmdReg() argument
9279 AscSetChipEEPCmd(iop_base, cmd_reg); in AscWriteEEPCmdReg()
9281 read_back = AscGetChipEEPCmd(iop_base); in AscWriteEEPCmdReg()
9293 static ushort AscReadEEPWord(PortAddr iop_base, uchar addr) in AscReadEEPWord() argument
9298 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_DISABLE); in AscReadEEPWord()
9301 AscWriteEEPCmdReg(iop_base, cmd_reg); in AscReadEEPWord()
9303 read_wval = AscGetChipEEPData(iop_base); in AscReadEEPWord()
9308 static ushort AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscGetEEPConfig() argument
9323 *wbuf = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
9334 wval = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
9351 *wbuf = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
9357 PortAddr iop_base; in AscTestExternalLram() local
9362 iop_base = asc_dvc->iop_base; in AscTestExternalLram()
9365 saved_word = AscReadLramWord(iop_base, q_addr); in AscTestExternalLram()
9366 AscSetChipLramAddr(iop_base, q_addr); in AscTestExternalLram()
9367 AscSetChipLramData(iop_base, 0x55AA); in AscTestExternalLram()
9369 AscSetChipLramAddr(iop_base, q_addr); in AscTestExternalLram()
9370 if (AscGetChipLramData(iop_base) == 0x55AA) { in AscTestExternalLram()
9372 AscWriteLramWord(iop_base, q_addr, saved_word); in AscTestExternalLram()
9382 static int AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg) in AscWriteEEPDataReg() argument
9389 AscSetChipEEPData(iop_base, data_reg); in AscWriteEEPDataReg()
9391 read_back = AscGetChipEEPData(iop_base); in AscWriteEEPDataReg()
9401 static ushort AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val) in AscWriteEEPWord() argument
9405 read_wval = AscReadEEPWord(iop_base, addr); in AscWriteEEPWord()
9407 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_ABLE); in AscWriteEEPWord()
9409 AscWriteEEPDataReg(iop_base, word_val); in AscWriteEEPWord()
9411 AscWriteEEPCmdReg(iop_base, in AscWriteEEPWord()
9414 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_DISABLE); in AscWriteEEPWord()
9416 return (AscReadEEPWord(iop_base, addr)); in AscWriteEEPWord()
9421 static int AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscSetEEPConfigOnce() argument
9439 if (*wbuf != AscWriteEEPWord(iop_base, (uchar)s_addr, *wbuf)) { in AscSetEEPConfigOnce()
9458 AscWriteEEPWord(iop_base, (uchar)s_addr, word)) { in AscSetEEPConfigOnce()
9464 AscWriteEEPWord(iop_base, (uchar)s_addr, *wbuf)) { in AscSetEEPConfigOnce()
9472 if (sum != AscWriteEEPWord(iop_base, (uchar)s_addr, sum)) { in AscSetEEPConfigOnce()
9482 if (*wbuf != AscReadEEPWord(iop_base, (uchar)s_addr)) { in AscSetEEPConfigOnce()
9501 (iop_base, (uchar)s_addr)); in AscSetEEPConfigOnce()
9504 word = AscReadEEPWord(iop_base, (uchar)s_addr); in AscSetEEPConfigOnce()
9511 if (AscReadEEPWord(iop_base, (uchar)s_addr) != sum) { in AscSetEEPConfigOnce()
9517 static int AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscSetEEPConfig() argument
9525 if ((n_error = AscSetEEPConfigOnce(iop_base, cfg_buf, in AscSetEEPConfig()
9540 PortAddr iop_base; in AscInitFromEEP() local
9547 iop_base = asc_dvc->iop_base; in AscInitFromEEP()
9549 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0x00FE); in AscInitFromEEP()
9550 AscStopQueueExe(iop_base); in AscInitFromEEP()
9551 if ((AscStopChip(iop_base) == FALSE) || in AscInitFromEEP()
9552 (AscGetChipScsiCtrl(iop_base) != 0)) { in AscInitFromEEP()
9557 if (AscIsChipHalted(iop_base) == FALSE) { in AscInitFromEEP()
9561 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); in AscInitFromEEP()
9562 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { in AscInitFromEEP()
9567 cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9568 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscInitFromEEP()
9572 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitFromEEP()
9574 chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type); in AscInitFromEEP()
9579 if (AscGetChipStatus(iop_base) & CSW_AUTO_CONFIG) { in AscInitFromEEP()
9585 AscGetChipCfgLsw(iop_base); in AscInitFromEEP()
9590 AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9598 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) == in AscInitFromEEP()
9647 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitFromEEP()
9686 eep_config->cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9688 if ((i = AscSetEEPConfig(iop_base, eep_config, in AscInitFromEEP()
9711 if (AscFindSignature(asc_dvc->iop_base)) { in AscInitGetConfig()
9759 PortAddr iop_base = asc_dvc->iop_base; in AscInitSetConfig() local
9766 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitSetConfig()
9771 cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitSetConfig()
9775 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitSetConfig()
9782 if (AscGetChipStatus(iop_base) & CSW_AUTO_CONFIG) { in AscInitSetConfig()
9788 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitSetConfig()
9801 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) in AscInitSetConfig()
9806 if (AscSetChipScsiID(iop_base, asc_dvc->cfg->chip_scsi_id) != in AscInitSetConfig()
9812 AscSetIsaDmaChannel(iop_base, asc_dvc->cfg->isa_dma_channel); in AscInitSetConfig()
9813 AscSetIsaDmaSpeed(iop_base, asc_dvc->cfg->isa_dma_speed); in AscInitSetConfig()
10209 static void AdvWaitEEPCmd(AdvPortAddr iop_base) in AdvWaitEEPCmd() argument
10214 if (AdvReadWordRegister(iop_base, IOPW_EE_CMD) & in AdvWaitEEPCmd()
10220 if ((AdvReadWordRegister(iop_base, IOPW_EE_CMD) & ASC_EEP_CMD_DONE) == in AdvWaitEEPCmd()
10228 static ushort AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr) in AdvReadEEPWord() argument
10230 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvReadEEPWord()
10232 AdvWaitEEPCmd(iop_base); in AdvReadEEPWord()
10233 return AdvReadWordRegister(iop_base, IOPW_EE_DATA); in AdvReadEEPWord()
10239 static void AdvSet3550EEPConfig(AdvPortAddr iop_base, in AdvSet3550EEPConfig() argument
10250 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet3550EEPConfig()
10251 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
10266 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet3550EEPConfig()
10267 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet3550EEPConfig()
10269 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
10276 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet3550EEPConfig()
10277 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet3550EEPConfig()
10278 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
10294 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet3550EEPConfig()
10295 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet3550EEPConfig()
10297 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
10299 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet3550EEPConfig()
10300 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
10306 static void AdvSet38C0800EEPConfig(AdvPortAddr iop_base, in AdvSet38C0800EEPConfig() argument
10317 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet38C0800EEPConfig()
10318 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
10333 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C0800EEPConfig()
10334 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C0800EEPConfig()
10336 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
10343 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet38C0800EEPConfig()
10344 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet38C0800EEPConfig()
10345 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
10361 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C0800EEPConfig()
10362 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C0800EEPConfig()
10364 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
10366 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet38C0800EEPConfig()
10367 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
10373 static void AdvSet38C1600EEPConfig(AdvPortAddr iop_base, in AdvSet38C1600EEPConfig() argument
10384 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet38C1600EEPConfig()
10385 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10400 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C1600EEPConfig()
10401 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C1600EEPConfig()
10403 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10410 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet38C1600EEPConfig()
10411 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet38C1600EEPConfig()
10412 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10428 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C1600EEPConfig()
10429 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C1600EEPConfig()
10431 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10433 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet38C1600EEPConfig()
10434 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10442 static ushort AdvGet3550EEPConfig(AdvPortAddr iop_base, in AdvGet3550EEPConfig() argument
10456 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10465 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10472 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10485 static ushort AdvGet38C0800EEPConfig(AdvPortAddr iop_base, in AdvGet38C0800EEPConfig() argument
10499 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10508 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10515 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10528 static ushort AdvGet38C1600EEPConfig(AdvPortAddr iop_base, in AdvGet38C1600EEPConfig() argument
10542 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10551 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10558 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10580 AdvPortAddr iop_base; in AdvInitFrom3550EEP() local
10584 iop_base = asc_dvc->iop_base; in AdvInitFrom3550EEP()
10593 if (AdvGet3550EEPConfig(iop_base, &eep_config) != eep_config.check_sum) { in AdvInitFrom3550EEP()
10607 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom3550EEP()
10610 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom3550EEP()
10613 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom3550EEP()
10615 AdvSet3550EEPConfig(iop_base, &eep_config); in AdvInitFrom3550EEP()
10730 AdvPortAddr iop_base; in AdvInitFrom38C0800EEP() local
10736 iop_base = asc_dvc->iop_base; in AdvInitFrom38C0800EEP()
10745 if (AdvGet38C0800EEPConfig(iop_base, &eep_config) != in AdvInitFrom38C0800EEP()
10760 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom38C0800EEP()
10763 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom38C0800EEP()
10766 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom38C0800EEP()
10768 AdvSet38C0800EEPConfig(iop_base, &eep_config); in AdvInitFrom38C0800EEP()
10929 AdvPortAddr iop_base; in AdvInitFrom38C1600EEP() local
10935 iop_base = asc_dvc->iop_base; in AdvInitFrom38C1600EEP()
10944 if (AdvGet38C1600EEPConfig(iop_base, &eep_config) != in AdvInitFrom38C1600EEP()
10976 AdvWriteByteRegister(iop_base, IOPB_GPIO_CNTL, 0); in AdvInitFrom38C1600EEP()
10977 ints = AdvReadByteRegister(iop_base, IOPB_GPIO_DATA); in AdvInitFrom38C1600EEP()
10987 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom38C1600EEP()
10989 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom38C1600EEP()
10991 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom38C1600EEP()
10993 AdvSet38C1600EEPConfig(iop_base, &eep_config); in AdvInitFrom38C1600EEP()
11152 AdvPortAddr iop_base = asc_dvc->iop_base; in AdvInitGetConfig() local
11170 AdvGetChipVersion(iop_base, asc_dvc->bus_type); in AdvInitGetConfig()
11173 (ushort)AdvReadByteRegister(iop_base, IOPB_CHIP_ID_1), in AdvInitGetConfig()
11177 (ushort)AdvReadWordRegister(iop_base, IOPW_CHIP_ID_0), in AdvInitGetConfig()
11183 if (AdvFindSignature(iop_base) == 0) { in AdvInitGetConfig()
11200 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvInitGetConfig()
11203 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvInitGetConfig()
11384 asc_dvc_varp->iop_base = iop; in advansys_board_found()
11411 adv_dvc_varp->iop_base = (AdvPortAddr)boardp->ioremap_addr; in advansys_board_found()
11412 ASC_DBG(1, "iop_base: 0x%p\n", adv_dvc_varp->iop_base); in advansys_board_found()
11635 shost->io_port = asc_dvc_varp->iop_base; in advansys_board_found()
11710 shost->base = AscGetChipBiosAddress(asc_dvc_varp->iop_base, in advansys_board_found()
11717 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11719 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11721 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11723 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11896 static unsigned int advansys_isa_irq_no(PortAddr iop_base) in advansys_isa_irq_no() argument
11898 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); in advansys_isa_irq_no()
11908 PortAddr iop_base = _asc_def_iop_base[id]; in advansys_isa_probe() local
11912 if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) { in advansys_isa_probe()
11913 ASC_DBG(1, "I/O port 0x%x busy\n", iop_base); in advansys_isa_probe()
11916 ASC_DBG(1, "probing I/O port 0x%x\n", iop_base); in advansys_isa_probe()
11917 if (!AscFindSignature(iop_base)) in advansys_isa_probe()
11919 if (!(AscGetChipVersion(iop_base, ASC_IS_ISA) & ASC_CHIP_VER_ISA_BIT)) in advansys_isa_probe()
11928 board->irq = advansys_isa_irq_no(iop_base); in advansys_isa_probe()
11931 err = advansys_board_found(shost, iop_base, ASC_IS_ISA); in advansys_isa_probe()
11941 release_region(iop_base, ASC_IOADR_GAP); in advansys_isa_probe()
11973 static unsigned int advansys_vlb_irq_no(PortAddr iop_base) in advansys_vlb_irq_no() argument
11975 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); in advansys_vlb_irq_no()
11985 PortAddr iop_base = _asc_def_iop_base[id]; in advansys_vlb_probe() local
11989 if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) { in advansys_vlb_probe()
11990 ASC_DBG(1, "I/O port 0x%x busy\n", iop_base); in advansys_vlb_probe()
11993 ASC_DBG(1, "probing I/O port 0x%x\n", iop_base); in advansys_vlb_probe()
11994 if (!AscFindSignature(iop_base)) in advansys_vlb_probe()
12001 if (AscGetChipVersion(iop_base, ASC_IS_VL) > ASC_CHIP_MAX_VER_VL) in advansys_vlb_probe()
12010 board->irq = advansys_vlb_irq_no(iop_base); in advansys_vlb_probe()
12013 err = advansys_board_found(shost, iop_base, ASC_IS_VL); in advansys_vlb_probe()
12023 release_region(iop_base, ASC_IOADR_GAP); in advansys_vlb_probe()