Lines Matching refs:iop_base
503 PortAddr iop_base; member
1824 AdvPortAddr iop_base; /* I/O port address */ member
1895 #define AdvReadByteRegister(iop_base, reg_off) \ argument
1896 (ADV_MEM_READB((iop_base) + (reg_off)))
1899 #define AdvWriteByteRegister(iop_base, reg_off, byte) \ argument
1900 (ADV_MEM_WRITEB((iop_base) + (reg_off), (byte)))
1903 #define AdvReadWordRegister(iop_base, reg_off) \ argument
1904 (ADV_MEM_READW((iop_base) + (reg_off)))
1907 #define AdvWriteWordRegister(iop_base, reg_off, word) \ argument
1908 (ADV_MEM_WRITEW((iop_base) + (reg_off), (word)))
1911 #define AdvWriteDWordRegister(iop_base, reg_off, dword) \ argument
1912 (ADV_MEM_WRITEDW((iop_base) + (reg_off), (dword)))
1915 #define AdvReadByteLram(iop_base, addr, byte) \ argument
1917 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)); \
1918 (byte) = ADV_MEM_READB((iop_base) + IOPB_RAM_DATA); \
1922 #define AdvWriteByteLram(iop_base, addr, byte) \ argument
1923 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
1924 ADV_MEM_WRITEB((iop_base) + IOPB_RAM_DATA, (byte)))
1927 #define AdvReadWordLram(iop_base, addr, word) \ argument
1929 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)); \
1930 (word) = (ADV_MEM_READW((iop_base) + IOPW_RAM_DATA)); \
1934 #define AdvWriteWordLram(iop_base, addr, word) \ argument
1935 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
1936 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word)))
1940 #define AdvWriteDWordLramNoSwap(iop_base, addr, dword) \ argument
1941 ((ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
1942 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
1944 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr) + 2), \
1945 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
1949 #define AdvReadWordAutoIncLram(iop_base) \ argument
1950 (ADV_MEM_READW((iop_base) + IOPW_RAM_DATA))
1953 #define AdvWriteWordAutoIncLram(iop_base, word) \ argument
1954 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word)))
1962 #define AdvFindSignature(iop_base) \ argument
1963 (((AdvReadByteRegister((iop_base), IOPB_CHIP_ID_1) == \
1965 (AdvReadWordRegister((iop_base), IOPW_CHIP_ID_0) == \
1973 #define AdvGetChipVersion(iop_base, bus_type) \ argument
1974 AdvReadByteRegister((iop_base), IOPB_CHIP_TYPE_REV)
2314 "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); in asc_prt_asc_dvc_var()
2371 (ulong)h->iop_base, h->err_code, (unsigned)h->ultra_able); in asc_prt_adv_dvc_var()
2699 ASC_VERSION, widename, (ulong)adv_dvc_varp->iop_base, in advansys_info()
2700 (ulong)adv_dvc_varp->iop_base + boardp->asc_n_io_port - 1, boardp->irq); in advansys_info()
3353 AdvPortAddr iop_base; in asc_prt_adv_board_info() local
3365 iop_base = v->iop_base; in asc_prt_adv_board_info()
3374 (unsigned long)v->iop_base, in asc_prt_adv_board_info()
3375 AdvReadWordRegister(iop_base,IOPW_SCSI_CFG1) & CABLE_DETECT, in asc_prt_adv_board_info()
3382 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in asc_prt_adv_board_info()
3402 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + i, in asc_prt_adv_board_info()
3415 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_QUEUED_CMD + i, in asc_prt_adv_board_info()
3422 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in asc_prt_adv_board_info()
3436 AdvReadWordLram(iop_base, ASC_MC_WDTR_DONE, wdtr_done); in asc_prt_adv_board_info()
3444 AdvReadWordLram(iop_base, in asc_prt_adv_board_info()
3459 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in asc_prt_adv_board_info()
3473 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, sdtr_done); in asc_prt_adv_board_info()
3476 AdvReadWordLram(iop_base, in asc_prt_adv_board_info()
3660 static void AscSetBank(PortAddr iop_base, uchar bank) in AscSetBank() argument
3664 val = AscGetChipControl(iop_base) & in AscSetBank()
3675 AscSetChipControl(iop_base, val); in AscSetBank()
3678 static void AscSetChipIH(PortAddr iop_base, ushort ins_code) in AscSetChipIH() argument
3680 AscSetBank(iop_base, 1); in AscSetChipIH()
3681 AscWriteChipIH(iop_base, ins_code); in AscSetChipIH()
3682 AscSetBank(iop_base, 0); in AscSetChipIH()
3685 static int AscStartChip(PortAddr iop_base) in AscStartChip() argument
3687 AscSetChipControl(iop_base, 0); in AscStartChip()
3688 if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { in AscStartChip()
3694 static bool AscStopChip(PortAddr iop_base) in AscStopChip() argument
3699 AscGetChipControl(iop_base) & in AscStopChip()
3701 AscSetChipControl(iop_base, (uchar)(cc_val | CC_HALT)); in AscStopChip()
3702 AscSetChipIH(iop_base, INS_HALT); in AscStopChip()
3703 AscSetChipIH(iop_base, INS_RFLAG_WTM); in AscStopChip()
3704 if ((AscGetChipStatus(iop_base) & CSW_HALTED) == 0) { in AscStopChip()
3710 static bool AscIsChipHalted(PortAddr iop_base) in AscIsChipHalted() argument
3712 if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { in AscIsChipHalted()
3713 if ((AscGetChipControl(iop_base) & CC_HALT) != 0) { in AscIsChipHalted()
3722 PortAddr iop_base; in AscResetChipAndScsiBus() local
3725 iop_base = asc_dvc->iop_base; in AscResetChipAndScsiBus()
3726 while ((AscGetChipStatus(iop_base) & CSW_SCSI_RESET_ACTIVE) in AscResetChipAndScsiBus()
3730 AscStopChip(iop_base); in AscResetChipAndScsiBus()
3731 AscSetChipControl(iop_base, CC_CHIP_RESET | CC_SCSI_RESET | CC_HALT); in AscResetChipAndScsiBus()
3733 AscSetChipIH(iop_base, INS_RFLAG_WTM); in AscResetChipAndScsiBus()
3734 AscSetChipIH(iop_base, INS_HALT); in AscResetChipAndScsiBus()
3735 AscSetChipControl(iop_base, CC_CHIP_RESET | CC_HALT); in AscResetChipAndScsiBus()
3736 AscSetChipControl(iop_base, CC_HALT); in AscResetChipAndScsiBus()
3738 AscSetChipStatus(iop_base, CIW_CLR_SCSI_RESET_INT); in AscResetChipAndScsiBus()
3739 AscSetChipStatus(iop_base, 0); in AscResetChipAndScsiBus()
3740 return (AscIsChipHalted(iop_base)); in AscResetChipAndScsiBus()
3743 static int AscFindSignature(PortAddr iop_base) in AscFindSignature() argument
3748 iop_base, AscGetChipSignatureByte(iop_base)); in AscFindSignature()
3749 if (AscGetChipSignatureByte(iop_base) == (uchar)ASC_1000_ID1B) { in AscFindSignature()
3751 iop_base, AscGetChipSignatureWord(iop_base)); in AscFindSignature()
3752 sig_word = AscGetChipSignatureWord(iop_base); in AscFindSignature()
3761 static void AscEnableInterrupt(PortAddr iop_base) in AscEnableInterrupt() argument
3765 cfg = AscGetChipCfgLsw(iop_base); in AscEnableInterrupt()
3766 AscSetChipCfgLsw(iop_base, cfg | ASC_CFG0_HOST_INT_ON); in AscEnableInterrupt()
3769 static void AscDisableInterrupt(PortAddr iop_base) in AscDisableInterrupt() argument
3773 cfg = AscGetChipCfgLsw(iop_base); in AscDisableInterrupt()
3774 AscSetChipCfgLsw(iop_base, cfg & (~ASC_CFG0_HOST_INT_ON)); in AscDisableInterrupt()
3777 static uchar AscReadLramByte(PortAddr iop_base, ushort addr) in AscReadLramByte() argument
3783 AscSetChipLramAddr(iop_base, addr - 1); in AscReadLramByte()
3784 word_data = AscGetChipLramData(iop_base); in AscReadLramByte()
3787 AscSetChipLramAddr(iop_base, addr); in AscReadLramByte()
3788 word_data = AscGetChipLramData(iop_base); in AscReadLramByte()
3794 static ushort AscReadLramWord(PortAddr iop_base, ushort addr) in AscReadLramWord() argument
3798 AscSetChipLramAddr(iop_base, addr); in AscReadLramWord()
3799 word_data = AscGetChipLramData(iop_base); in AscReadLramWord()
3804 AscMemWordSetLram(PortAddr iop_base, ushort s_addr, ushort set_wval, int words) in AscMemWordSetLram() argument
3808 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordSetLram()
3810 AscSetChipLramData(iop_base, set_wval); in AscMemWordSetLram()
3814 static void AscWriteLramWord(PortAddr iop_base, ushort addr, ushort word_val) in AscWriteLramWord() argument
3816 AscSetChipLramAddr(iop_base, addr); in AscWriteLramWord()
3817 AscSetChipLramData(iop_base, word_val); in AscWriteLramWord()
3820 static void AscWriteLramByte(PortAddr iop_base, ushort addr, uchar byte_val) in AscWriteLramByte() argument
3826 word_data = AscReadLramWord(iop_base, addr); in AscWriteLramByte()
3830 word_data = AscReadLramWord(iop_base, addr); in AscWriteLramByte()
3834 AscWriteLramWord(iop_base, addr, word_data); in AscWriteLramByte()
3844 AscMemWordCopyPtrToLram(PortAddr iop_base, ushort s_addr, in AscMemWordCopyPtrToLram() argument
3849 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordCopyPtrToLram()
3859 outpw(iop_base + IOP_RAM_DATA, in AscMemWordCopyPtrToLram()
3871 AscMemDWordCopyPtrToLram(PortAddr iop_base, in AscMemDWordCopyPtrToLram() argument
3876 AscSetChipLramAddr(iop_base, s_addr); in AscMemDWordCopyPtrToLram()
3878 outpw(iop_base + IOP_RAM_DATA, ((ushort)s_buffer[i + 1] << 8) | s_buffer[i]); /* LSW */ in AscMemDWordCopyPtrToLram()
3879 outpw(iop_base + IOP_RAM_DATA, ((ushort)s_buffer[i + 3] << 8) | s_buffer[i + 2]); /* MSW */ in AscMemDWordCopyPtrToLram()
3890 AscMemWordCopyPtrFromLram(PortAddr iop_base, in AscMemWordCopyPtrFromLram() argument
3896 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordCopyPtrFromLram()
3898 word = inpw(iop_base + IOP_RAM_DATA); in AscMemWordCopyPtrFromLram()
3904 static u32 AscMemSumLramWord(PortAddr iop_base, ushort s_addr, int words) in AscMemSumLramWord() argument
3910 sum += AscReadLramWord(iop_base, s_addr); in AscMemSumLramWord()
3919 PortAddr iop_base; in AscInitLram() local
3921 iop_base = asc_dvc->iop_base; in AscInitLram()
3922 AscMemWordSetLram(iop_base, ASC_QADR_BEG, 0, in AscInitLram()
3927 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
3929 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
3931 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
3936 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
3938 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
3940 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
3943 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
3945 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
3947 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
3953 AscWriteLramByte(iop_base, in AscInitLram()
3955 AscWriteLramByte(iop_base, in AscInitLram()
3957 AscWriteLramByte(iop_base, in AscInitLram()
3963 AscLoadMicroCode(PortAddr iop_base, ushort s_addr, in AscLoadMicroCode() argument
3972 AscMemWordSetLram(iop_base, s_addr, 0, mcode_word_size); in AscLoadMicroCode()
3973 AscMemWordCopyPtrToLram(iop_base, s_addr, mcode_buf, mcode_word_size); in AscLoadMicroCode()
3975 chksum = AscMemSumLramWord(iop_base, s_addr, mcode_word_size); in AscLoadMicroCode()
3977 mcode_chksum = (ushort)AscMemSumLramWord(iop_base, in AscLoadMicroCode()
3984 AscWriteLramWord(iop_base, ASCV_MCODE_CHKSUM_W, mcode_chksum); in AscLoadMicroCode()
3985 AscWriteLramWord(iop_base, ASCV_MCODE_SIZE_W, mcode_size); in AscLoadMicroCode()
3991 PortAddr iop_base; in AscInitQLinkVar() local
3995 iop_base = asc_dvc->iop_base; in AscInitQLinkVar()
3996 AscPutRiscVarFreeQHead(iop_base, 1); in AscInitQLinkVar()
3997 AscPutRiscVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
3998 AscPutVarFreeQHead(iop_base, 1); in AscInitQLinkVar()
3999 AscPutVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
4000 AscWriteLramByte(iop_base, ASCV_BUSY_QHEAD_B, in AscInitQLinkVar()
4002 AscWriteLramByte(iop_base, ASCV_DISC1_QHEAD_B, in AscInitQLinkVar()
4004 AscWriteLramByte(iop_base, (ushort)ASCV_TOTAL_READY_Q_B, in AscInitQLinkVar()
4006 AscWriteLramWord(iop_base, ASCV_ASCDVC_ERR_CODE_W, 0); in AscInitQLinkVar()
4007 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscInitQLinkVar()
4008 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, 0); in AscInitQLinkVar()
4009 AscWriteLramByte(iop_base, ASCV_SCSIBUSY_B, 0); in AscInitQLinkVar()
4010 AscWriteLramByte(iop_base, ASCV_WTM_FLAG_B, 0); in AscInitQLinkVar()
4011 AscPutQDoneInProgress(iop_base, 0); in AscInitQLinkVar()
4014 AscWriteLramWord(iop_base, lram_addr, 0); in AscInitQLinkVar()
4022 PortAddr iop_base; in AscInitMicroCodeVar() local
4027 iop_base = asc_dvc->iop_base; in AscInitMicroCodeVar()
4030 AscPutMCodeInitSDTRAtID(iop_base, i, in AscInitMicroCodeVar()
4035 AscWriteLramByte(iop_base, ASCV_DISC_ENABLE_B, in AscInitMicroCodeVar()
4037 AscWriteLramByte(iop_base, ASCV_HOSTSCSI_ID_B, in AscInitMicroCodeVar()
4049 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_PADDR_D, in AscInitMicroCodeVar()
4052 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_BSIZE_D, in AscInitMicroCodeVar()
4056 AscReadLramWord(iop_base, (ushort)ASCV_MC_DATE_W); in AscInitMicroCodeVar()
4058 AscReadLramWord(iop_base, (ushort)ASCV_MC_VER_W); in AscInitMicroCodeVar()
4060 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); in AscInitMicroCodeVar()
4061 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { in AscInitMicroCodeVar()
4066 if (AscStartChip(iop_base) != 1) { in AscInitMicroCodeVar()
4089 PortAddr iop_base; in AscInitAsc1000Driver() local
4091 iop_base = asc_dvc->iop_base; in AscInitAsc1000Driver()
4101 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitAsc1000Driver()
4105 AscDisableInterrupt(iop_base); in AscInitAsc1000Driver()
4125 if (AscLoadMicroCode(iop_base, 0, &fw->data[4], in AscInitAsc1000Driver()
4136 AscEnableInterrupt(iop_base); in AscInitAsc1000Driver()
4162 static int AdvLoadMicrocode(AdvPortAddr iop_base, const unsigned char *buf, in AdvLoadMicrocode() argument
4168 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, 0); in AdvLoadMicrocode()
4174 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4180 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4186 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4194 AdvWriteWordAutoIncLram(iop_base, 0); in AdvLoadMicrocode()
4200 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, 0); in AdvLoadMicrocode()
4203 sum += AdvReadWordAutoIncLram(iop_base); in AdvLoadMicrocode()
4299 AdvPortAddr iop_base; in AdvSendIdleCmd() local
4301 iop_base = asc_dvc->iop_base; in AdvSendIdleCmd()
4308 AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD_STATUS, (ushort)0); in AdvSendIdleCmd()
4316 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IDLE_CMD_PARAMETER, in AdvSendIdleCmd()
4318 AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD, idle_cmd); in AdvSendIdleCmd()
4323 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_B); in AdvSendIdleCmd()
4330 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_NOP); in AdvSendIdleCmd()
4337 AdvReadWordLram(iop_base, ASC_MC_IDLE_CMD_STATUS, in AdvSendIdleCmd()
4407 AdvPortAddr iop_base; in AdvInitAsc3550Driver() local
4435 iop_base = asc_dvc->iop_base; in AdvInitAsc3550Driver()
4446 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc3550Driver()
4462 AdvReadWordLram(iop_base, 0x120, wdtr_able); in AdvInitAsc3550Driver()
4464 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc3550Driver()
4467 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc3550Driver()
4468 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc3550Driver()
4470 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc3550Driver()
4490 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc3550Driver()
4501 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc3550Driver()
4509 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc3550Driver()
4510 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc3550Driver()
4512 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc3550Driver()
4514 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc3550Driver()
4516 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc3550Driver()
4521 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc3550Driver()
4523 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc3550Driver()
4529 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC3550); in AdvInitAsc3550Driver()
4538 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc3550Driver()
4540 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc3550Driver()
4547 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc3550Driver()
4563 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc3550Driver()
4565 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc3550Driver()
4601 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, word); in AdvInitAsc3550Driver()
4604 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, word); in AdvInitAsc3550Driver()
4607 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, word); in AdvInitAsc3550Driver()
4610 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, word); in AdvInitAsc3550Driver()
4618 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc3550Driver()
4627 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc3550Driver()
4639 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc3550Driver()
4655 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc3550Driver()
4733 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, in AdvInitAsc3550Driver()
4747 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc3550Driver()
4756 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc3550Driver()
4774 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc3550Driver()
4788 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc3550Driver()
4791 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc3550Driver()
4795 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc3550Driver()
4796 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc3550Driver()
4799 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc3550Driver()
4817 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc3550Driver()
4818 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc3550Driver()
4819 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc3550Driver()
4822 AdvWriteByteLram(iop_base, in AdvInitAsc3550Driver()
4850 AdvPortAddr iop_base; in AdvInitAsc38C0800Driver() local
4879 iop_base = asc_dvc->iop_base; in AdvInitAsc38C0800Driver()
4890 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C0800Driver()
4897 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C0800Driver()
4898 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C0800Driver()
4899 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc38C0800Driver()
4901 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc38C0800Driver()
4935 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, PRE_TEST_MODE); in AdvInitAsc38C0800Driver()
4937 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C0800Driver()
4944 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C0800Driver()
4946 if (AdvReadByteRegister(iop_base, IOPB_RAM_BIST) in AdvInitAsc38C0800Driver()
4960 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, RAM_TEST_MODE); in AdvInitAsc38C0800Driver()
4963 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C0800Driver()
4972 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C0800Driver()
4990 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc38C0800Driver()
5001 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C0800Driver()
5009 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc38C0800Driver()
5010 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc38C0800Driver()
5012 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc38C0800Driver()
5014 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc38C0800Driver()
5016 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc38C0800Driver()
5021 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc38C0800Driver()
5023 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc38C0800Driver()
5029 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC38C0800); in AdvInitAsc38C0800Driver()
5039 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C0800Driver()
5040 AdvWriteWordRegister(iop_base, IOPW_SCSI_CFG1, in AdvInitAsc38C0800Driver()
5050 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C0800Driver()
5052 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C0800Driver()
5063 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc38C0800Driver()
5080 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc38C0800Driver()
5082 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc38C0800Driver()
5095 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc38C0800Driver()
5097 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C0800Driver()
5098 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C0800Driver()
5099 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C0800Driver()
5100 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C0800Driver()
5108 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc38C0800Driver()
5120 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C0800Driver()
5127 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc38C0800Driver()
5215 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, scsi_cfg1); in AdvInitAsc38C0800Driver()
5228 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc38C0800Driver()
5237 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc38C0800Driver()
5257 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C0800Driver()
5274 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C0800Driver()
5277 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc38C0800Driver()
5281 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc38C0800Driver()
5282 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc38C0800Driver()
5285 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc38C0800Driver()
5303 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C0800Driver()
5304 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C0800Driver()
5305 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc38C0800Driver()
5308 AdvWriteByteLram(iop_base, in AdvInitAsc38C0800Driver()
5336 AdvPortAddr iop_base; in AdvInitAsc38C1600Driver() local
5366 iop_base = asc_dvc->iop_base; in AdvInitAsc38C1600Driver()
5377 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C1600Driver()
5384 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C1600Driver()
5385 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C1600Driver()
5386 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvInitAsc38C1600Driver()
5387 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc38C1600Driver()
5389 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc38C1600Driver()
5423 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, PRE_TEST_MODE); in AdvInitAsc38C1600Driver()
5425 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C1600Driver()
5432 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C1600Driver()
5434 if (AdvReadByteRegister(iop_base, IOPB_RAM_BIST) in AdvInitAsc38C1600Driver()
5448 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, RAM_TEST_MODE); in AdvInitAsc38C1600Driver()
5451 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C1600Driver()
5460 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C1600Driver()
5478 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc38C1600Driver()
5489 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C1600Driver()
5497 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc38C1600Driver()
5498 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc38C1600Driver()
5500 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc38C1600Driver()
5502 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc38C1600Driver()
5504 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc38C1600Driver()
5509 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc38C1600Driver()
5511 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc38C1600Driver()
5517 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC38C1600); in AdvInitAsc38C1600Driver()
5527 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C1600Driver()
5528 AdvWriteWordRegister(iop_base, IOPW_SCSI_CFG1, in AdvInitAsc38C1600Driver()
5538 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5540 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5550 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5552 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5559 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc38C1600Driver()
5575 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc38C1600Driver()
5577 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc38C1600Driver()
5590 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc38C1600Driver()
5592 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C1600Driver()
5593 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C1600Driver()
5594 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C1600Driver()
5595 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C1600Driver()
5603 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc38C1600Driver()
5616 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C1600Driver()
5623 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc38C1600Driver()
5704 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, scsi_cfg1); in AdvInitAsc38C1600Driver()
5725 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc38C1600Driver()
5734 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc38C1600Driver()
5753 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C1600Driver()
5754 AdvWriteDWordRegister(iop_base, IOPDW_COMMA, in AdvInitAsc38C1600Driver()
5769 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C1600Driver()
5772 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc38C1600Driver()
5775 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc38C1600Driver()
5776 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc38C1600Driver()
5779 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc38C1600Driver()
5796 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C1600Driver()
5797 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C1600Driver()
5798 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvInitAsc38C1600Driver()
5799 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc38C1600Driver()
5802 AdvWriteByteLram(iop_base, in AdvInitAsc38C1600Driver()
5829 AdvPortAddr iop_base; in AdvResetChipAndSB() local
5832 iop_base = asc_dvc->iop_base; in AdvResetChipAndSB()
5837 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvResetChipAndSB()
5838 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvResetChipAndSB()
5840 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvResetChipAndSB()
5842 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvResetChipAndSB()
5844 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvResetChipAndSB()
5854 AdvReadWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, bios_sig); in AdvResetChipAndSB()
5855 AdvWriteWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, 0); in AdvResetChipAndSB()
5860 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_STOP); in AdvResetChipAndSB()
5861 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, ADV_CTRL_REG_CMD_RESET); in AdvResetChipAndSB()
5863 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvResetChipAndSB()
5889 AdvWriteWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, bios_sig); in AdvResetChipAndSB()
5894 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvResetChipAndSB()
5895 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvResetChipAndSB()
5897 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvResetChipAndSB()
5899 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvResetChipAndSB()
5901 AdvWriteByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvResetChipAndSB()
6118 AdvPortAddr iop_base; in AdvISR() local
6126 iop_base = asc_dvc->iop_base; in AdvISR()
6129 int_stat = AdvReadByteRegister(iop_base, IOPB_INTR_STATUS_REG); in AdvISR()
6144 AdvReadByteLram(iop_base, ASC_MC_INTRB_CODE, intrb_code); in AdvISR()
6150 AdvWriteByteRegister(iop_base, IOPB_TICKLE, in AdvISR()
6153 AdvWriteByteRegister(iop_base, in AdvISR()
6234 AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W, in AscSetLibErrorCode()
6240 static void AscAckInterrupt(PortAddr iop_base) in AscAckInterrupt() argument
6248 risc_flag = AscReadLramByte(iop_base, ASCV_RISC_FLAG_B); in AscAckInterrupt()
6254 AscReadLramByte(iop_base, in AscAckInterrupt()
6256 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, in AscAckInterrupt()
6258 AscSetChipStatus(iop_base, CIW_INT_ACK); in AscAckInterrupt()
6260 while (AscGetChipStatus(iop_base) & CSW_INT_PENDING) { in AscAckInterrupt()
6261 AscSetChipStatus(iop_base, CIW_INT_ACK); in AscAckInterrupt()
6266 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, host_flag); in AscAckInterrupt()
6296 PortAddr iop_base; in AscMsgOutSDTR() local
6298 iop_base = asc_dvc->iop_base; in AscMsgOutSDTR()
6307 AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, in AscMsgOutSDTR()
6313 AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, in AscMsgOutSDTR()
6333 static bool AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data) in AscSetChipSynRegAtID() argument
6339 AscSetBank(iop_base, 1); in AscSetChipSynRegAtID()
6340 org_id = AscReadChipDvcID(iop_base); in AscSetChipSynRegAtID()
6346 AscWriteChipDvcID(iop_base, id); in AscSetChipSynRegAtID()
6347 if (AscReadChipDvcID(iop_base) == (0x01 << id)) { in AscSetChipSynRegAtID()
6348 AscSetBank(iop_base, 0); in AscSetChipSynRegAtID()
6349 AscSetChipSyn(iop_base, sdtr_data); in AscSetChipSynRegAtID()
6350 if (AscGetChipSyn(iop_base) != sdtr_data) { in AscSetChipSynRegAtID()
6356 AscSetBank(iop_base, 1); in AscSetChipSynRegAtID()
6357 AscWriteChipDvcID(iop_base, org_id); in AscSetChipSynRegAtID()
6358 AscSetBank(iop_base, 0); in AscSetChipSynRegAtID()
6362 static void AscSetChipSDTR(PortAddr iop_base, uchar sdtr_data, uchar tid_no) in AscSetChipSDTR() argument
6364 AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); in AscSetChipSDTR()
6365 AscPutMCodeSDTRDoneAtID(iop_base, tid_no, sdtr_data); in AscSetChipSDTR()
6377 PortAddr iop_base; in AscIsrChipHalted() local
6392 iop_base = asc_dvc->iop_base; in AscIsrChipHalted()
6393 int_halt_code = AscReadLramWord(iop_base, ASCV_HALTCODE_W); in AscIsrChipHalted()
6395 halt_qp = AscReadLramByte(iop_base, ASCV_CURCDB_B); in AscIsrChipHalted()
6397 target_ix = AscReadLramByte(iop_base, in AscIsrChipHalted()
6400 q_cntl = AscReadLramByte(iop_base, in AscIsrChipHalted()
6411 AscSetChipSDTR(iop_base, 0, tid_no); in AscIsrChipHalted()
6414 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6418 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6421 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6424 AscMemWordCopyPtrFromLram(iop_base, in AscIsrChipHalted()
6457 AscSetChipSDTR(iop_base, asyn_sdtr, in AscIsrChipHalted()
6467 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6480 AscSetChipSDTR(iop_base, sdtr_data, in AscIsrChipHalted()
6495 AscSetChipSDTR(iop_base, sdtr_data, in AscIsrChipHalted()
6503 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6507 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6514 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6519 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6523 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6528 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6533 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6537 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6548 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscIsrChipHalted()
6560 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6564 tag_code = AscReadLramByte(iop_base, in AscIsrChipHalted()
6576 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6581 q_status = AscReadLramByte(iop_base, in AscIsrChipHalted()
6585 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6590 scsi_busy = AscReadLramByte(iop_base, (ushort)ASCV_SCSIBUSY_B); in AscIsrChipHalted()
6592 AscWriteLramByte(iop_base, (ushort)ASCV_SCSIBUSY_B, scsi_busy); in AscIsrChipHalted()
6594 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6598 AscMemWordCopyPtrFromLram(iop_base, in AscIsrChipHalted()
6609 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6613 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6616 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6620 scsi_status = AscReadLramByte(iop_base, in AscIsrChipHalted()
6625 AscReadLramByte(iop_base, in AscIsrChipHalted()
6630 scsi_busy = AscReadLramByte(iop_base, in AscIsrChipHalted()
6633 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6643 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6661 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6678 DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) in DvcGetQinfo() argument
6683 AscSetChipLramAddr(iop_base, s_addr); in DvcGetQinfo()
6688 word = inpw(iop_base + IOP_RAM_DATA); in DvcGetQinfo()
6696 _AscCopyLramScsiDoneQ(PortAddr iop_base, in _AscCopyLramScsiDoneQ() argument
6703 DvcGetQinfo(iop_base, in _AscCopyLramScsiDoneQ()
6708 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6712 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6716 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6725 scsiq->remain_bytes = (((u32)AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6733 scsiq->remain_bytes += AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6868 PortAddr iop_base; in AscIsrQDone() local
6876 iop_base = asc_dvc->iop_base; in AscIsrQDone()
6879 done_q_tail = (uchar)AscGetVarDoneQTail(iop_base); in AscIsrQDone()
6881 next_qp = AscReadLramByte(iop_base, in AscIsrQDone()
6884 AscPutVarDoneQTail(iop_base, next_qp); in AscIsrQDone()
6886 sg_queue_cnt = _AscCopyLramScsiDoneQ(iop_base, q_addr, scsiq, in AscIsrQDone()
6888 AscWriteLramByte(iop_base, in AscIsrQDone()
6900 sg_list_qp = AscReadLramByte(iop_base, in AscIsrQDone()
6913 AscWriteLramByte(iop_base, in AscIsrQDone()
6919 AscPutVarDoneQTail(iop_base, sg_list_qp); in AscIsrQDone()
6922 cur_target_qng = AscReadLramByte(iop_base, in AscIsrQDone()
6929 scsi_busy = AscReadLramByte(iop_base, (ushort) in AscIsrQDone()
6932 AscWriteLramByte(iop_base, in AscIsrQDone()
6978 AscStopChip(iop_base); in AscIsrQDone()
6979 AscSetChipControl(iop_base, in AscIsrQDone()
6983 AscSetChipControl(iop_base, CC_HALT); in AscIsrQDone()
6984 AscSetChipStatus(iop_base, in AscIsrQDone()
6986 AscSetChipStatus(iop_base, 0); in AscIsrQDone()
6987 AscSetChipControl(iop_base, 0); in AscIsrQDone()
6993 if ((AscReadLramByte(iop_base, in AscIsrQDone()
7020 PortAddr iop_base; in AscISR() local
7028 iop_base = asc_dvc->iop_base; in AscISR()
7031 if (AscIsIntPending(iop_base) == 0) in AscISR()
7046 ctrl_reg = AscGetChipControl(iop_base); in AscISR()
7049 chipstat = AscGetChipStatus(iop_base); in AscISR()
7056 while ((AscGetChipStatus(iop_base) & in AscISR()
7060 AscSetChipControl(iop_base, (CC_CHIP_RESET | CC_HALT)); in AscISR()
7061 AscSetChipControl(iop_base, CC_HALT); in AscISR()
7062 AscSetChipStatus(iop_base, CIW_CLR_SCSI_RESET_INT); in AscISR()
7063 AscSetChipStatus(iop_base, 0); in AscISR()
7064 chipstat = AscGetChipStatus(iop_base); in AscISR()
7067 saved_ram_addr = AscGetChipLramAddr(iop_base); in AscISR()
7068 host_flag = AscReadLramByte(iop_base, in AscISR()
7071 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, in AscISR()
7074 AscAckInterrupt(iop_base); in AscISR()
7096 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, host_flag); in AscISR()
7097 AscSetChipLramAddr(iop_base, saved_ram_addr); in AscISR()
7098 AscSetChipControl(iop_base, saved_ctrl_reg); in AscISR()
7257 static bool AscHostReqRiscHalt(PortAddr iop_base) in AscHostReqRiscHalt() argument
7263 if (AscIsChipHalted(iop_base)) in AscHostReqRiscHalt()
7265 saved_stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B); in AscHostReqRiscHalt()
7266 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, in AscHostReqRiscHalt()
7269 if (AscIsChipHalted(iop_base)) { in AscHostReqRiscHalt()
7275 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, saved_stop_code); in AscHostReqRiscHalt()
7280 AscSetRunChipSynRegAtID(PortAddr iop_base, uchar tid_no, uchar sdtr_data) in AscSetRunChipSynRegAtID() argument
7284 if (AscHostReqRiscHalt(iop_base)) { in AscSetRunChipSynRegAtID()
7285 sta = AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); in AscSetRunChipSynRegAtID()
7286 AscStartChip(iop_base); in AscSetRunChipSynRegAtID()
7310 AscSetRunChipSynRegAtID(asc_dvc->iop_base, sdev->id, in AscAsyncFix()
7350 AscWriteLramByte(asc_dvc->iop_base, ASCV_DISC_ENABLE_B, in advansys_narrow_slave_configure()
7352 AscWriteLramByte(asc_dvc->iop_base, ASCV_USE_TAGGED_QNG_B, in advansys_narrow_slave_configure()
7354 AscWriteLramByte(asc_dvc->iop_base, ASCV_CAN_TAGGED_QNG_B, in advansys_narrow_slave_configure()
7359 AscWriteLramByte(asc_dvc->iop_base, in advansys_narrow_slave_configure()
7373 advansys_wide_enable_wdtr(AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_wdtr() argument
7376 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); in advansys_wide_enable_wdtr()
7381 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); in advansys_wide_enable_wdtr()
7389 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7391 AdvWriteWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7392 AdvReadWordLram(iop_base, ASC_MC_WDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7394 AdvWriteWordLram(iop_base, ASC_MC_WDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7405 advansys_wide_enable_sdtr(AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_sdtr() argument
7408 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); in advansys_wide_enable_sdtr()
7413 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); in advansys_wide_enable_sdtr()
7419 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_sdtr()
7421 AdvWriteWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_sdtr()
7433 AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_ppr() argument
7435 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, adv_dvc->ppr_able); in advansys_wide_enable_ppr()
7437 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, adv_dvc->ppr_able); in advansys_wide_enable_ppr()
7443 AdvPortAddr iop_base = adv_dvc->iop_base; in advansys_wide_slave_configure() local
7454 advansys_wide_enable_wdtr(iop_base, tidmask); in advansys_wide_slave_configure()
7456 advansys_wide_enable_sdtr(iop_base, tidmask); in advansys_wide_slave_configure()
7458 advansys_wide_enable_ppr(adv_dvc, iop_base, tidmask); in advansys_wide_slave_configure()
7469 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, cfg_word); in advansys_wide_slave_configure()
7471 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in advansys_wide_slave_configure()
7473 AdvWriteByteLram(iop_base, in advansys_wide_slave_configure()
7909 static uchar AscAllocFreeQueue(PortAddr iop_base, uchar free_q_head) in AscAllocFreeQueue() argument
7916 q_status = (uchar)AscReadLramByte(iop_base, in AscAllocFreeQueue()
7919 next_qp = AscReadLramByte(iop_base, (ushort)(q_addr + ASC_SCSIQ_B_FWD)); in AscAllocFreeQueue()
7926 AscAllocMultipleFreeQueue(PortAddr iop_base, uchar free_q_head, uchar n_free_q) in AscAllocMultipleFreeQueue() argument
7931 free_q_head = AscAllocFreeQueue(iop_base, free_q_head); in AscAllocMultipleFreeQueue()
7949 DvcPutScsiQ(PortAddr iop_base, ushort s_addr, uchar *outbuf, int words) in DvcPutScsiQ() argument
7954 AscSetChipLramAddr(iop_base, s_addr); in DvcPutScsiQ()
7959 outpw(iop_base + IOP_RAM_DATA, in DvcPutScsiQ()
7971 PortAddr iop_base; in AscPutReadyQueue() local
7973 iop_base = asc_dvc->iop_base; in AscPutReadyQueue()
7977 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscPutReadyQueue()
7991 AscMemWordCopyPtrToLram(iop_base, in AscPutReadyQueue()
7995 DvcPutScsiQ(iop_base, in AscPutReadyQueue()
7999 AscWriteLramWord(iop_base, in AscPutReadyQueue()
8015 PortAddr iop_base; in AscPutReadySgListQueue() local
8022 iop_base = asc_dvc->iop_base; in AscPutReadySgListQueue()
8073 next_qp = AscReadLramByte(iop_base, in AscPutReadySgListQueue()
8078 AscMemWordCopyPtrToLram(iop_base, in AscPutReadySgListQueue()
8082 AscMemDWordCopyPtrToLram(iop_base, in AscPutReadySgListQueue()
8102 PortAddr iop_base; in AscSendScsiQueue() local
8109 iop_base = asc_dvc->iop_base; in AscSendScsiQueue()
8113 free_q_head = (uchar)AscGetVarFreeQHead(iop_base); in AscSendScsiQueue()
8115 next_qp = AscAllocMultipleFreeQueue(iop_base, free_q_head, in AscSendScsiQueue()
8125 next_qp = AscAllocFreeQueue(iop_base, free_q_head); in AscSendScsiQueue()
8132 AscPutVarFreeQHead(iop_base, next_qp); in AscSendScsiQueue()
8161 PortAddr iop_base; in AscExeScsiQueue() local
8178 iop_base = asc_dvc->iop_base; in AscExeScsiQueue()
8193 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscExeScsiQueue()
8389 AdvPortAddr iop_base; in AdvExeScsiQueue() local
8402 iop_base = asc_dvc->iop_base; in AdvExeScsiQueue()
8447 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_A); in AdvExeScsiQueue()
8454 AdvWriteByteRegister(iop_base, IOPB_TICKLE, in AdvExeScsiQueue()
8462 AdvWriteDWordRegister(iop_base, IOPDW_COMMA, in AdvExeScsiQueue()
8586 static ushort AscGetEisaChipCfg(PortAddr iop_base) in DEF_SCSI_QCMD()
8588 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | in DEF_SCSI_QCMD()
8597 static unsigned short AscGetChipBiosAddress(PortAddr iop_base, in AscGetChipBiosAddress() argument
8612 cfg_lsw = AscGetEisaChipCfg(iop_base); in AscGetChipBiosAddress()
8618 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscGetChipBiosAddress()
8629 static uchar AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) in AscSetChipScsiID() argument
8633 if (AscGetChipScsiID(iop_base) == new_host_id) { in AscSetChipScsiID()
8636 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscSetChipScsiID()
8639 AscSetChipCfgLsw(iop_base, cfg_lsw); in AscSetChipScsiID()
8640 return (AscGetChipScsiID(iop_base)); in AscSetChipScsiID()
8643 static unsigned char AscGetChipScsiCtrl(PortAddr iop_base) in AscGetChipScsiCtrl() argument
8647 AscSetBank(iop_base, 1); in AscGetChipScsiCtrl()
8648 sc = inp(iop_base + IOP_REG_SC); in AscGetChipScsiCtrl()
8649 AscSetBank(iop_base, 0); in AscGetChipScsiCtrl()
8653 static unsigned char AscGetChipVersion(PortAddr iop_base, in AscGetChipVersion() argument
8659 eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | in AscGetChipVersion()
8664 return AscGetChipVerNo(iop_base); in AscGetChipVersion()
8680 static int AscStopQueueExe(PortAddr iop_base) in AscStopQueueExe() argument
8684 if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) == 0) { in AscStopQueueExe()
8685 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, in AscStopQueueExe()
8688 if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) & in AscStopQueueExe()
8708 static ushort AscGetIsaDmaChannel(PortAddr iop_base) in AscGetIsaDmaChannel() argument
8712 channel = AscGetChipCfgLsw(iop_base) & 0x0003; in AscGetIsaDmaChannel()
8720 static ushort AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel) in AscSetIsaDmaChannel() argument
8730 cfg_lsw = AscGetChipCfgLsw(iop_base) & 0xFFFC; in AscSetIsaDmaChannel()
8732 AscSetChipCfgLsw(iop_base, cfg_lsw); in AscSetIsaDmaChannel()
8733 return (AscGetIsaDmaChannel(iop_base)); in AscSetIsaDmaChannel()
8738 static uchar AscGetIsaDmaSpeed(PortAddr iop_base) in AscGetIsaDmaSpeed() argument
8742 AscSetBank(iop_base, 1); in AscGetIsaDmaSpeed()
8743 speed_value = AscReadChipDmaSpeed(iop_base); in AscGetIsaDmaSpeed()
8745 AscSetBank(iop_base, 0); in AscGetIsaDmaSpeed()
8749 static uchar AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value) in AscSetIsaDmaSpeed() argument
8752 AscSetBank(iop_base, 1); in AscSetIsaDmaSpeed()
8753 AscWriteChipDmaSpeed(iop_base, speed_value); in AscSetIsaDmaSpeed()
8754 AscSetBank(iop_base, 0); in AscSetIsaDmaSpeed()
8755 return AscGetIsaDmaSpeed(iop_base); in AscSetIsaDmaSpeed()
8762 PortAddr iop_base; in AscInitAscDvcVar() local
8765 iop_base = asc_dvc->iop_base; in AscInitAscDvcVar()
8771 AscSetChipControl(iop_base, CC_HALT); in AscInitAscDvcVar()
8772 AscSetChipStatus(iop_base, 0); in AscInitAscDvcVar()
8800 chip_version = AscGetChipVersion(iop_base, asc_dvc->bus_type); in AscInitAscDvcVar()
8810 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
8813 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
8819 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
8827 AscSetChipIFC(iop_base, IFC_INIT_DEFAULT); in AscInitAscDvcVar()
8831 (uchar)AscGetIsaDmaChannel(iop_base); in AscInitAscDvcVar()
8843 static int AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg) in AscWriteEEPCmdReg() argument
8849 AscSetChipEEPCmd(iop_base, cmd_reg); in AscWriteEEPCmdReg()
8851 read_back = AscGetChipEEPCmd(iop_base); in AscWriteEEPCmdReg()
8863 static ushort AscReadEEPWord(PortAddr iop_base, uchar addr) in AscReadEEPWord() argument
8868 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_DISABLE); in AscReadEEPWord()
8871 AscWriteEEPCmdReg(iop_base, cmd_reg); in AscReadEEPWord()
8873 read_wval = AscGetChipEEPData(iop_base); in AscReadEEPWord()
8878 static ushort AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscGetEEPConfig() argument
8893 *wbuf = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
8904 wval = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
8921 *wbuf = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
8927 PortAddr iop_base; in AscTestExternalLram() local
8932 iop_base = asc_dvc->iop_base; in AscTestExternalLram()
8935 saved_word = AscReadLramWord(iop_base, q_addr); in AscTestExternalLram()
8936 AscSetChipLramAddr(iop_base, q_addr); in AscTestExternalLram()
8937 AscSetChipLramData(iop_base, 0x55AA); in AscTestExternalLram()
8939 AscSetChipLramAddr(iop_base, q_addr); in AscTestExternalLram()
8940 if (AscGetChipLramData(iop_base) == 0x55AA) { in AscTestExternalLram()
8942 AscWriteLramWord(iop_base, q_addr, saved_word); in AscTestExternalLram()
8952 static int AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg) in AscWriteEEPDataReg() argument
8959 AscSetChipEEPData(iop_base, data_reg); in AscWriteEEPDataReg()
8961 read_back = AscGetChipEEPData(iop_base); in AscWriteEEPDataReg()
8971 static ushort AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val) in AscWriteEEPWord() argument
8975 read_wval = AscReadEEPWord(iop_base, addr); in AscWriteEEPWord()
8977 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_ABLE); in AscWriteEEPWord()
8979 AscWriteEEPDataReg(iop_base, word_val); in AscWriteEEPWord()
8981 AscWriteEEPCmdReg(iop_base, in AscWriteEEPWord()
8984 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_DISABLE); in AscWriteEEPWord()
8986 return (AscReadEEPWord(iop_base, addr)); in AscWriteEEPWord()
8991 static int AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscSetEEPConfigOnce() argument
9009 if (*wbuf != AscWriteEEPWord(iop_base, (uchar)s_addr, *wbuf)) { in AscSetEEPConfigOnce()
9028 AscWriteEEPWord(iop_base, (uchar)s_addr, word)) { in AscSetEEPConfigOnce()
9034 AscWriteEEPWord(iop_base, (uchar)s_addr, *wbuf)) { in AscSetEEPConfigOnce()
9042 if (sum != AscWriteEEPWord(iop_base, (uchar)s_addr, sum)) { in AscSetEEPConfigOnce()
9052 if (*wbuf != AscReadEEPWord(iop_base, (uchar)s_addr)) { in AscSetEEPConfigOnce()
9071 (iop_base, (uchar)s_addr)); in AscSetEEPConfigOnce()
9074 word = AscReadEEPWord(iop_base, (uchar)s_addr); in AscSetEEPConfigOnce()
9081 if (AscReadEEPWord(iop_base, (uchar)s_addr) != sum) { in AscSetEEPConfigOnce()
9087 static int AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscSetEEPConfig() argument
9095 if ((n_error = AscSetEEPConfigOnce(iop_base, cfg_buf, in AscSetEEPConfig()
9110 PortAddr iop_base; in AscInitFromEEP() local
9117 iop_base = asc_dvc->iop_base; in AscInitFromEEP()
9119 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0x00FE); in AscInitFromEEP()
9120 AscStopQueueExe(iop_base); in AscInitFromEEP()
9121 if ((AscStopChip(iop_base)) || in AscInitFromEEP()
9122 (AscGetChipScsiCtrl(iop_base) != 0)) { in AscInitFromEEP()
9127 if (!AscIsChipHalted(iop_base)) { in AscInitFromEEP()
9131 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); in AscInitFromEEP()
9132 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { in AscInitFromEEP()
9137 cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9138 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscInitFromEEP()
9142 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitFromEEP()
9144 chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type); in AscInitFromEEP()
9149 if (AscGetChipStatus(iop_base) & CSW_AUTO_CONFIG) { in AscInitFromEEP()
9155 AscGetChipCfgLsw(iop_base); in AscInitFromEEP()
9160 AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9168 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) == in AscInitFromEEP()
9217 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitFromEEP()
9256 eep_config->cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9258 if ((i = AscSetEEPConfig(iop_base, eep_config, in AscInitFromEEP()
9281 if (AscFindSignature(asc_dvc->iop_base)) { in AscInitGetConfig()
9329 PortAddr iop_base = asc_dvc->iop_base; in AscInitSetConfig() local
9336 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitSetConfig()
9341 cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitSetConfig()
9345 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitSetConfig()
9352 if (AscGetChipStatus(iop_base) & CSW_AUTO_CONFIG) { in AscInitSetConfig()
9358 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitSetConfig()
9371 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) in AscInitSetConfig()
9376 if (AscSetChipScsiID(iop_base, asc_dvc->cfg->chip_scsi_id) != in AscInitSetConfig()
9382 AscSetIsaDmaChannel(iop_base, asc_dvc->cfg->isa_dma_channel); in AscInitSetConfig()
9383 AscSetIsaDmaSpeed(iop_base, asc_dvc->cfg->isa_dma_speed); in AscInitSetConfig()
9779 static void AdvWaitEEPCmd(AdvPortAddr iop_base) in AdvWaitEEPCmd() argument
9784 if (AdvReadWordRegister(iop_base, IOPW_EE_CMD) & in AdvWaitEEPCmd()
9790 if ((AdvReadWordRegister(iop_base, IOPW_EE_CMD) & ASC_EEP_CMD_DONE) == in AdvWaitEEPCmd()
9798 static ushort AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr) in AdvReadEEPWord() argument
9800 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvReadEEPWord()
9802 AdvWaitEEPCmd(iop_base); in AdvReadEEPWord()
9803 return AdvReadWordRegister(iop_base, IOPW_EE_DATA); in AdvReadEEPWord()
9809 static void AdvSet3550EEPConfig(AdvPortAddr iop_base, in AdvSet3550EEPConfig() argument
9820 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet3550EEPConfig()
9821 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9836 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet3550EEPConfig()
9837 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet3550EEPConfig()
9839 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9846 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet3550EEPConfig()
9847 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet3550EEPConfig()
9848 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9864 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet3550EEPConfig()
9865 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet3550EEPConfig()
9867 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9869 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet3550EEPConfig()
9870 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9876 static void AdvSet38C0800EEPConfig(AdvPortAddr iop_base, in AdvSet38C0800EEPConfig() argument
9887 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet38C0800EEPConfig()
9888 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9903 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C0800EEPConfig()
9904 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C0800EEPConfig()
9906 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9913 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet38C0800EEPConfig()
9914 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet38C0800EEPConfig()
9915 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9931 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C0800EEPConfig()
9932 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C0800EEPConfig()
9934 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9936 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet38C0800EEPConfig()
9937 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9943 static void AdvSet38C1600EEPConfig(AdvPortAddr iop_base, in AdvSet38C1600EEPConfig() argument
9954 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet38C1600EEPConfig()
9955 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9970 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C1600EEPConfig()
9971 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C1600EEPConfig()
9973 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9980 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet38C1600EEPConfig()
9981 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet38C1600EEPConfig()
9982 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9998 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C1600EEPConfig()
9999 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C1600EEPConfig()
10001 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10003 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet38C1600EEPConfig()
10004 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10012 static ushort AdvGet3550EEPConfig(AdvPortAddr iop_base, in AdvGet3550EEPConfig() argument
10026 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10035 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10042 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10055 static ushort AdvGet38C0800EEPConfig(AdvPortAddr iop_base, in AdvGet38C0800EEPConfig() argument
10069 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10078 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10085 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10098 static ushort AdvGet38C1600EEPConfig(AdvPortAddr iop_base, in AdvGet38C1600EEPConfig() argument
10112 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10121 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10128 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10150 AdvPortAddr iop_base; in AdvInitFrom3550EEP() local
10154 iop_base = asc_dvc->iop_base; in AdvInitFrom3550EEP()
10163 if (AdvGet3550EEPConfig(iop_base, &eep_config) != eep_config.check_sum) { in AdvInitFrom3550EEP()
10177 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom3550EEP()
10180 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom3550EEP()
10183 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom3550EEP()
10185 AdvSet3550EEPConfig(iop_base, &eep_config); in AdvInitFrom3550EEP()
10300 AdvPortAddr iop_base; in AdvInitFrom38C0800EEP() local
10306 iop_base = asc_dvc->iop_base; in AdvInitFrom38C0800EEP()
10315 if (AdvGet38C0800EEPConfig(iop_base, &eep_config) != in AdvInitFrom38C0800EEP()
10330 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom38C0800EEP()
10333 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom38C0800EEP()
10336 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom38C0800EEP()
10338 AdvSet38C0800EEPConfig(iop_base, &eep_config); in AdvInitFrom38C0800EEP()
10499 AdvPortAddr iop_base; in AdvInitFrom38C1600EEP() local
10505 iop_base = asc_dvc->iop_base; in AdvInitFrom38C1600EEP()
10514 if (AdvGet38C1600EEPConfig(iop_base, &eep_config) != in AdvInitFrom38C1600EEP()
10546 AdvWriteByteRegister(iop_base, IOPB_GPIO_CNTL, 0); in AdvInitFrom38C1600EEP()
10547 ints = AdvReadByteRegister(iop_base, IOPB_GPIO_DATA); in AdvInitFrom38C1600EEP()
10557 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom38C1600EEP()
10559 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom38C1600EEP()
10561 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom38C1600EEP()
10563 AdvSet38C1600EEPConfig(iop_base, &eep_config); in AdvInitFrom38C1600EEP()
10722 AdvPortAddr iop_base = asc_dvc->iop_base; in AdvInitGetConfig() local
10740 AdvGetChipVersion(iop_base, asc_dvc->bus_type); in AdvInitGetConfig()
10743 (ushort)AdvReadByteRegister(iop_base, IOPB_CHIP_ID_1), in AdvInitGetConfig()
10747 (ushort)AdvReadWordRegister(iop_base, IOPW_CHIP_ID_0), in AdvInitGetConfig()
10753 if (AdvFindSignature(iop_base) == 0) { in AdvInitGetConfig()
10770 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvInitGetConfig()
10773 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvInitGetConfig()
10938 asc_dvc_varp->iop_base = iop; in advansys_board_found()
10965 adv_dvc_varp->iop_base = (AdvPortAddr)boardp->ioremap_addr; in advansys_board_found()
10966 ASC_DBG(1, "iop_base: 0x%p\n", adv_dvc_varp->iop_base); in advansys_board_found()
11189 shost->io_port = asc_dvc_varp->iop_base; in advansys_board_found()
11246 shost->base = AscGetChipBiosAddress(asc_dvc_varp->iop_base, in advansys_board_found()
11253 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11255 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11257 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11259 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11434 static unsigned int advansys_isa_irq_no(PortAddr iop_base) in advansys_isa_irq_no() argument
11436 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); in advansys_isa_irq_no()
11446 PortAddr iop_base = _asc_def_iop_base[id]; in advansys_isa_probe() local
11450 if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) { in advansys_isa_probe()
11451 ASC_DBG(1, "I/O port 0x%x busy\n", iop_base); in advansys_isa_probe()
11454 ASC_DBG(1, "probing I/O port 0x%x\n", iop_base); in advansys_isa_probe()
11455 if (!AscFindSignature(iop_base)) in advansys_isa_probe()
11457 if (!(AscGetChipVersion(iop_base, ASC_IS_ISA) & ASC_CHIP_VER_ISA_BIT)) in advansys_isa_probe()
11466 board->irq = advansys_isa_irq_no(iop_base); in advansys_isa_probe()
11470 err = advansys_board_found(shost, iop_base, ASC_IS_ISA); in advansys_isa_probe()
11480 release_region(iop_base, ASC_IOADR_GAP); in advansys_isa_probe()
11512 static unsigned int advansys_vlb_irq_no(PortAddr iop_base) in advansys_vlb_irq_no() argument
11514 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); in advansys_vlb_irq_no()
11524 PortAddr iop_base = _asc_def_iop_base[id]; in advansys_vlb_probe() local
11528 if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) { in advansys_vlb_probe()
11529 ASC_DBG(1, "I/O port 0x%x busy\n", iop_base); in advansys_vlb_probe()
11532 ASC_DBG(1, "probing I/O port 0x%x\n", iop_base); in advansys_vlb_probe()
11533 if (!AscFindSignature(iop_base)) in advansys_vlb_probe()
11540 if (AscGetChipVersion(iop_base, ASC_IS_VL) > ASC_CHIP_MAX_VER_VL) in advansys_vlb_probe()
11549 board->irq = advansys_vlb_irq_no(iop_base); in advansys_vlb_probe()
11553 err = advansys_board_found(shost, iop_base, ASC_IS_VL); in advansys_vlb_probe()
11563 release_region(iop_base, ASC_IOADR_GAP); in advansys_vlb_probe()