Lines Matching refs:iop_base

499 	PortAddr iop_base;  member
1820 AdvPortAddr iop_base; /* I/O port address */ member
1891 #define AdvReadByteRegister(iop_base, reg_off) \ argument
1892 (ADV_MEM_READB((iop_base) + (reg_off)))
1895 #define AdvWriteByteRegister(iop_base, reg_off, byte) \ argument
1896 (ADV_MEM_WRITEB((iop_base) + (reg_off), (byte)))
1899 #define AdvReadWordRegister(iop_base, reg_off) \ argument
1900 (ADV_MEM_READW((iop_base) + (reg_off)))
1903 #define AdvWriteWordRegister(iop_base, reg_off, word) \ argument
1904 (ADV_MEM_WRITEW((iop_base) + (reg_off), (word)))
1907 #define AdvWriteDWordRegister(iop_base, reg_off, dword) \ argument
1908 (ADV_MEM_WRITEDW((iop_base) + (reg_off), (dword)))
1911 #define AdvReadByteLram(iop_base, addr, byte) \ argument
1913 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)); \
1914 (byte) = ADV_MEM_READB((iop_base) + IOPB_RAM_DATA); \
1918 #define AdvWriteByteLram(iop_base, addr, byte) \ argument
1919 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
1920 ADV_MEM_WRITEB((iop_base) + IOPB_RAM_DATA, (byte)))
1923 #define AdvReadWordLram(iop_base, addr, word) \ argument
1925 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)); \
1926 (word) = (ADV_MEM_READW((iop_base) + IOPW_RAM_DATA)); \
1930 #define AdvWriteWordLram(iop_base, addr, word) \ argument
1931 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
1932 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word)))
1936 #define AdvWriteDWordLramNoSwap(iop_base, addr, dword) \ argument
1937 ((ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr)), \
1938 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
1940 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_ADDR, (addr) + 2), \
1941 ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, \
1945 #define AdvReadWordAutoIncLram(iop_base) \ argument
1946 (ADV_MEM_READW((iop_base) + IOPW_RAM_DATA))
1949 #define AdvWriteWordAutoIncLram(iop_base, word) \ argument
1950 (ADV_MEM_WRITEW((iop_base) + IOPW_RAM_DATA, (word)))
1958 #define AdvFindSignature(iop_base) \ argument
1959 (((AdvReadByteRegister((iop_base), IOPB_CHIP_ID_1) == \
1961 (AdvReadWordRegister((iop_base), IOPW_CHIP_ID_0) == \
1969 #define AdvGetChipVersion(iop_base, bus_type) \ argument
1970 AdvReadByteRegister((iop_base), IOPB_CHIP_TYPE_REV)
2310 "%d,\n", h->iop_base, h->err_code, h->dvc_cntl, h->bug_fix_cntl); in asc_prt_asc_dvc_var()
2367 (ulong)h->iop_base, h->err_code, (unsigned)h->ultra_able); in asc_prt_adv_dvc_var()
2695 ASC_VERSION, widename, (ulong)adv_dvc_varp->iop_base, in advansys_info()
2696 (ulong)adv_dvc_varp->iop_base + boardp->asc_n_io_port - 1, boardp->irq); in advansys_info()
3349 AdvPortAddr iop_base; in asc_prt_adv_board_info() local
3361 iop_base = v->iop_base; in asc_prt_adv_board_info()
3370 v->iop_base, in asc_prt_adv_board_info()
3371 AdvReadWordRegister(iop_base,IOPW_SCSI_CFG1) & CABLE_DETECT, in asc_prt_adv_board_info()
3378 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in asc_prt_adv_board_info()
3398 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + i, in asc_prt_adv_board_info()
3411 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_QUEUED_CMD + i, in asc_prt_adv_board_info()
3418 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in asc_prt_adv_board_info()
3432 AdvReadWordLram(iop_base, ASC_MC_WDTR_DONE, wdtr_done); in asc_prt_adv_board_info()
3440 AdvReadWordLram(iop_base, in asc_prt_adv_board_info()
3455 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in asc_prt_adv_board_info()
3469 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, sdtr_done); in asc_prt_adv_board_info()
3472 AdvReadWordLram(iop_base, in asc_prt_adv_board_info()
3656 static void AscSetBank(PortAddr iop_base, uchar bank) in AscSetBank() argument
3660 val = AscGetChipControl(iop_base) & in AscSetBank()
3671 AscSetChipControl(iop_base, val); in AscSetBank()
3674 static void AscSetChipIH(PortAddr iop_base, ushort ins_code) in AscSetChipIH() argument
3676 AscSetBank(iop_base, 1); in AscSetChipIH()
3677 AscWriteChipIH(iop_base, ins_code); in AscSetChipIH()
3678 AscSetBank(iop_base, 0); in AscSetChipIH()
3681 static int AscStartChip(PortAddr iop_base) in AscStartChip() argument
3683 AscSetChipControl(iop_base, 0); in AscStartChip()
3684 if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { in AscStartChip()
3690 static bool AscStopChip(PortAddr iop_base) in AscStopChip() argument
3695 AscGetChipControl(iop_base) & in AscStopChip()
3697 AscSetChipControl(iop_base, (uchar)(cc_val | CC_HALT)); in AscStopChip()
3698 AscSetChipIH(iop_base, INS_HALT); in AscStopChip()
3699 AscSetChipIH(iop_base, INS_RFLAG_WTM); in AscStopChip()
3700 if ((AscGetChipStatus(iop_base) & CSW_HALTED) == 0) { in AscStopChip()
3706 static bool AscIsChipHalted(PortAddr iop_base) in AscIsChipHalted() argument
3708 if ((AscGetChipStatus(iop_base) & CSW_HALTED) != 0) { in AscIsChipHalted()
3709 if ((AscGetChipControl(iop_base) & CC_HALT) != 0) { in AscIsChipHalted()
3718 PortAddr iop_base; in AscResetChipAndScsiBus() local
3721 iop_base = asc_dvc->iop_base; in AscResetChipAndScsiBus()
3722 while ((AscGetChipStatus(iop_base) & CSW_SCSI_RESET_ACTIVE) in AscResetChipAndScsiBus()
3726 AscStopChip(iop_base); in AscResetChipAndScsiBus()
3727 AscSetChipControl(iop_base, CC_CHIP_RESET | CC_SCSI_RESET | CC_HALT); in AscResetChipAndScsiBus()
3729 AscSetChipIH(iop_base, INS_RFLAG_WTM); in AscResetChipAndScsiBus()
3730 AscSetChipIH(iop_base, INS_HALT); in AscResetChipAndScsiBus()
3731 AscSetChipControl(iop_base, CC_CHIP_RESET | CC_HALT); in AscResetChipAndScsiBus()
3732 AscSetChipControl(iop_base, CC_HALT); in AscResetChipAndScsiBus()
3734 AscSetChipStatus(iop_base, CIW_CLR_SCSI_RESET_INT); in AscResetChipAndScsiBus()
3735 AscSetChipStatus(iop_base, 0); in AscResetChipAndScsiBus()
3736 return (AscIsChipHalted(iop_base)); in AscResetChipAndScsiBus()
3739 static int AscFindSignature(PortAddr iop_base) in AscFindSignature() argument
3744 iop_base, AscGetChipSignatureByte(iop_base)); in AscFindSignature()
3745 if (AscGetChipSignatureByte(iop_base) == (uchar)ASC_1000_ID1B) { in AscFindSignature()
3747 iop_base, AscGetChipSignatureWord(iop_base)); in AscFindSignature()
3748 sig_word = AscGetChipSignatureWord(iop_base); in AscFindSignature()
3757 static void AscEnableInterrupt(PortAddr iop_base) in AscEnableInterrupt() argument
3761 cfg = AscGetChipCfgLsw(iop_base); in AscEnableInterrupt()
3762 AscSetChipCfgLsw(iop_base, cfg | ASC_CFG0_HOST_INT_ON); in AscEnableInterrupt()
3765 static void AscDisableInterrupt(PortAddr iop_base) in AscDisableInterrupt() argument
3769 cfg = AscGetChipCfgLsw(iop_base); in AscDisableInterrupt()
3770 AscSetChipCfgLsw(iop_base, cfg & (~ASC_CFG0_HOST_INT_ON)); in AscDisableInterrupt()
3773 static uchar AscReadLramByte(PortAddr iop_base, ushort addr) in AscReadLramByte() argument
3779 AscSetChipLramAddr(iop_base, addr - 1); in AscReadLramByte()
3780 word_data = AscGetChipLramData(iop_base); in AscReadLramByte()
3783 AscSetChipLramAddr(iop_base, addr); in AscReadLramByte()
3784 word_data = AscGetChipLramData(iop_base); in AscReadLramByte()
3790 static ushort AscReadLramWord(PortAddr iop_base, ushort addr) in AscReadLramWord() argument
3794 AscSetChipLramAddr(iop_base, addr); in AscReadLramWord()
3795 word_data = AscGetChipLramData(iop_base); in AscReadLramWord()
3800 AscMemWordSetLram(PortAddr iop_base, ushort s_addr, ushort set_wval, int words) in AscMemWordSetLram() argument
3804 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordSetLram()
3806 AscSetChipLramData(iop_base, set_wval); in AscMemWordSetLram()
3810 static void AscWriteLramWord(PortAddr iop_base, ushort addr, ushort word_val) in AscWriteLramWord() argument
3812 AscSetChipLramAddr(iop_base, addr); in AscWriteLramWord()
3813 AscSetChipLramData(iop_base, word_val); in AscWriteLramWord()
3816 static void AscWriteLramByte(PortAddr iop_base, ushort addr, uchar byte_val) in AscWriteLramByte() argument
3822 word_data = AscReadLramWord(iop_base, addr); in AscWriteLramByte()
3826 word_data = AscReadLramWord(iop_base, addr); in AscWriteLramByte()
3830 AscWriteLramWord(iop_base, addr, word_data); in AscWriteLramByte()
3840 AscMemWordCopyPtrToLram(PortAddr iop_base, ushort s_addr, in AscMemWordCopyPtrToLram() argument
3845 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordCopyPtrToLram()
3855 outpw(iop_base + IOP_RAM_DATA, in AscMemWordCopyPtrToLram()
3867 AscMemDWordCopyPtrToLram(PortAddr iop_base, in AscMemDWordCopyPtrToLram() argument
3872 AscSetChipLramAddr(iop_base, s_addr); in AscMemDWordCopyPtrToLram()
3874 outpw(iop_base + IOP_RAM_DATA, ((ushort)s_buffer[i + 1] << 8) | s_buffer[i]); /* LSW */ in AscMemDWordCopyPtrToLram()
3875 outpw(iop_base + IOP_RAM_DATA, ((ushort)s_buffer[i + 3] << 8) | s_buffer[i + 2]); /* MSW */ in AscMemDWordCopyPtrToLram()
3886 AscMemWordCopyPtrFromLram(PortAddr iop_base, in AscMemWordCopyPtrFromLram() argument
3892 AscSetChipLramAddr(iop_base, s_addr); in AscMemWordCopyPtrFromLram()
3894 word = inpw(iop_base + IOP_RAM_DATA); in AscMemWordCopyPtrFromLram()
3900 static u32 AscMemSumLramWord(PortAddr iop_base, ushort s_addr, int words) in AscMemSumLramWord() argument
3906 sum += AscReadLramWord(iop_base, s_addr); in AscMemSumLramWord()
3915 PortAddr iop_base; in AscInitLram() local
3917 iop_base = asc_dvc->iop_base; in AscInitLram()
3918 AscMemWordSetLram(iop_base, ASC_QADR_BEG, 0, in AscInitLram()
3923 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
3925 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
3927 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
3932 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
3934 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
3936 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
3939 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_FWD), in AscInitLram()
3941 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_BWD), in AscInitLram()
3943 AscWriteLramByte(iop_base, (ushort)(s_addr + ASC_SCSIQ_B_QNO), in AscInitLram()
3949 AscWriteLramByte(iop_base, in AscInitLram()
3951 AscWriteLramByte(iop_base, in AscInitLram()
3953 AscWriteLramByte(iop_base, in AscInitLram()
3959 AscLoadMicroCode(PortAddr iop_base, ushort s_addr, in AscLoadMicroCode() argument
3968 AscMemWordSetLram(iop_base, s_addr, 0, mcode_word_size); in AscLoadMicroCode()
3969 AscMemWordCopyPtrToLram(iop_base, s_addr, mcode_buf, mcode_word_size); in AscLoadMicroCode()
3971 chksum = AscMemSumLramWord(iop_base, s_addr, mcode_word_size); in AscLoadMicroCode()
3973 mcode_chksum = (ushort)AscMemSumLramWord(iop_base, in AscLoadMicroCode()
3980 AscWriteLramWord(iop_base, ASCV_MCODE_CHKSUM_W, mcode_chksum); in AscLoadMicroCode()
3981 AscWriteLramWord(iop_base, ASCV_MCODE_SIZE_W, mcode_size); in AscLoadMicroCode()
3987 PortAddr iop_base; in AscInitQLinkVar() local
3991 iop_base = asc_dvc->iop_base; in AscInitQLinkVar()
3992 AscPutRiscVarFreeQHead(iop_base, 1); in AscInitQLinkVar()
3993 AscPutRiscVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
3994 AscPutVarFreeQHead(iop_base, 1); in AscInitQLinkVar()
3995 AscPutVarDoneQTail(iop_base, asc_dvc->max_total_qng); in AscInitQLinkVar()
3996 AscWriteLramByte(iop_base, ASCV_BUSY_QHEAD_B, in AscInitQLinkVar()
3998 AscWriteLramByte(iop_base, ASCV_DISC1_QHEAD_B, in AscInitQLinkVar()
4000 AscWriteLramByte(iop_base, (ushort)ASCV_TOTAL_READY_Q_B, in AscInitQLinkVar()
4002 AscWriteLramWord(iop_base, ASCV_ASCDVC_ERR_CODE_W, 0); in AscInitQLinkVar()
4003 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscInitQLinkVar()
4004 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, 0); in AscInitQLinkVar()
4005 AscWriteLramByte(iop_base, ASCV_SCSIBUSY_B, 0); in AscInitQLinkVar()
4006 AscWriteLramByte(iop_base, ASCV_WTM_FLAG_B, 0); in AscInitQLinkVar()
4007 AscPutQDoneInProgress(iop_base, 0); in AscInitQLinkVar()
4010 AscWriteLramWord(iop_base, lram_addr, 0); in AscInitQLinkVar()
4018 PortAddr iop_base; in AscInitMicroCodeVar() local
4023 iop_base = asc_dvc->iop_base; in AscInitMicroCodeVar()
4026 AscPutMCodeInitSDTRAtID(iop_base, i, in AscInitMicroCodeVar()
4031 AscWriteLramByte(iop_base, ASCV_DISC_ENABLE_B, in AscInitMicroCodeVar()
4033 AscWriteLramByte(iop_base, ASCV_HOSTSCSI_ID_B, in AscInitMicroCodeVar()
4045 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_PADDR_D, in AscInitMicroCodeVar()
4048 AscMemDWordCopyPtrToLram(iop_base, ASCV_OVERRUN_BSIZE_D, in AscInitMicroCodeVar()
4052 AscReadLramWord(iop_base, (ushort)ASCV_MC_DATE_W); in AscInitMicroCodeVar()
4054 AscReadLramWord(iop_base, (ushort)ASCV_MC_VER_W); in AscInitMicroCodeVar()
4056 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); in AscInitMicroCodeVar()
4057 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { in AscInitMicroCodeVar()
4062 if (AscStartChip(iop_base) != 1) { in AscInitMicroCodeVar()
4085 PortAddr iop_base; in AscInitAsc1000Driver() local
4087 iop_base = asc_dvc->iop_base; in AscInitAsc1000Driver()
4097 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitAsc1000Driver()
4101 AscDisableInterrupt(iop_base); in AscInitAsc1000Driver()
4121 if (AscLoadMicroCode(iop_base, 0, &fw->data[4], in AscInitAsc1000Driver()
4132 AscEnableInterrupt(iop_base); in AscInitAsc1000Driver()
4158 static int AdvLoadMicrocode(AdvPortAddr iop_base, const unsigned char *buf, in AdvLoadMicrocode() argument
4164 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, 0); in AdvLoadMicrocode()
4170 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4176 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4182 AdvWriteWordAutoIncLram(iop_base, word); in AdvLoadMicrocode()
4190 AdvWriteWordAutoIncLram(iop_base, 0); in AdvLoadMicrocode()
4196 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, 0); in AdvLoadMicrocode()
4199 sum += AdvReadWordAutoIncLram(iop_base); in AdvLoadMicrocode()
4295 AdvPortAddr iop_base; in AdvSendIdleCmd() local
4297 iop_base = asc_dvc->iop_base; in AdvSendIdleCmd()
4304 AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD_STATUS, (ushort)0); in AdvSendIdleCmd()
4312 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IDLE_CMD_PARAMETER, in AdvSendIdleCmd()
4314 AdvWriteWordLram(iop_base, ASC_MC_IDLE_CMD, idle_cmd); in AdvSendIdleCmd()
4319 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_B); in AdvSendIdleCmd()
4326 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_NOP); in AdvSendIdleCmd()
4333 AdvReadWordLram(iop_base, ASC_MC_IDLE_CMD_STATUS, in AdvSendIdleCmd()
4403 AdvPortAddr iop_base; in AdvInitAsc3550Driver() local
4431 iop_base = asc_dvc->iop_base; in AdvInitAsc3550Driver()
4442 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc3550Driver()
4458 AdvReadWordLram(iop_base, 0x120, wdtr_able); in AdvInitAsc3550Driver()
4460 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc3550Driver()
4463 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc3550Driver()
4464 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc3550Driver()
4466 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc3550Driver()
4486 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc3550Driver()
4497 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc3550Driver()
4505 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc3550Driver()
4506 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc3550Driver()
4508 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc3550Driver()
4510 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc3550Driver()
4512 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc3550Driver()
4517 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc3550Driver()
4519 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc3550Driver()
4525 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC3550); in AdvInitAsc3550Driver()
4534 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc3550Driver()
4536 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc3550Driver()
4543 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc3550Driver()
4559 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc3550Driver()
4561 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc3550Driver()
4597 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, word); in AdvInitAsc3550Driver()
4600 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, word); in AdvInitAsc3550Driver()
4603 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, word); in AdvInitAsc3550Driver()
4606 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, word); in AdvInitAsc3550Driver()
4614 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc3550Driver()
4623 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc3550Driver()
4635 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc3550Driver()
4651 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc3550Driver()
4729 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, in AdvInitAsc3550Driver()
4743 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc3550Driver()
4752 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc3550Driver()
4770 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc3550Driver()
4784 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc3550Driver()
4787 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc3550Driver()
4791 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc3550Driver()
4792 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc3550Driver()
4795 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc3550Driver()
4813 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc3550Driver()
4814 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc3550Driver()
4815 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc3550Driver()
4818 AdvWriteByteLram(iop_base, in AdvInitAsc3550Driver()
4846 AdvPortAddr iop_base; in AdvInitAsc38C0800Driver() local
4875 iop_base = asc_dvc->iop_base; in AdvInitAsc38C0800Driver()
4886 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C0800Driver()
4893 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C0800Driver()
4894 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C0800Driver()
4895 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc38C0800Driver()
4897 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc38C0800Driver()
4931 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, PRE_TEST_MODE); in AdvInitAsc38C0800Driver()
4933 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C0800Driver()
4940 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C0800Driver()
4942 if (AdvReadByteRegister(iop_base, IOPB_RAM_BIST) in AdvInitAsc38C0800Driver()
4956 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, RAM_TEST_MODE); in AdvInitAsc38C0800Driver()
4959 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C0800Driver()
4968 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C0800Driver()
4986 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc38C0800Driver()
4997 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C0800Driver()
5005 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc38C0800Driver()
5006 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc38C0800Driver()
5008 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc38C0800Driver()
5010 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc38C0800Driver()
5012 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc38C0800Driver()
5017 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc38C0800Driver()
5019 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc38C0800Driver()
5025 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC38C0800); in AdvInitAsc38C0800Driver()
5035 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C0800Driver()
5036 AdvWriteWordRegister(iop_base, IOPW_SCSI_CFG1, in AdvInitAsc38C0800Driver()
5046 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C0800Driver()
5048 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C0800Driver()
5059 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc38C0800Driver()
5076 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc38C0800Driver()
5078 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc38C0800Driver()
5091 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc38C0800Driver()
5093 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C0800Driver()
5094 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C0800Driver()
5095 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C0800Driver()
5096 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C0800Driver()
5104 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc38C0800Driver()
5116 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C0800Driver()
5123 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc38C0800Driver()
5211 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, scsi_cfg1); in AdvInitAsc38C0800Driver()
5224 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc38C0800Driver()
5233 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc38C0800Driver()
5253 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C0800Driver()
5270 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C0800Driver()
5273 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc38C0800Driver()
5277 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc38C0800Driver()
5278 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc38C0800Driver()
5281 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc38C0800Driver()
5299 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C0800Driver()
5300 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C0800Driver()
5301 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc38C0800Driver()
5304 AdvWriteByteLram(iop_base, in AdvInitAsc38C0800Driver()
5332 AdvPortAddr iop_base; in AdvInitAsc38C1600Driver() local
5362 iop_base = asc_dvc->iop_base; in AdvInitAsc38C1600Driver()
5373 AdvReadWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C1600Driver()
5380 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C1600Driver()
5381 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C1600Driver()
5382 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvInitAsc38C1600Driver()
5383 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvInitAsc38C1600Driver()
5385 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvInitAsc38C1600Driver()
5419 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, PRE_TEST_MODE); in AdvInitAsc38C1600Driver()
5421 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C1600Driver()
5428 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C1600Driver()
5430 if (AdvReadByteRegister(iop_base, IOPB_RAM_BIST) in AdvInitAsc38C1600Driver()
5444 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, RAM_TEST_MODE); in AdvInitAsc38C1600Driver()
5447 byte = AdvReadByteRegister(iop_base, IOPB_RAM_BIST); in AdvInitAsc38C1600Driver()
5456 AdvWriteByteRegister(iop_base, IOPB_RAM_BIST, NORMAL_MODE); in AdvInitAsc38C1600Driver()
5474 asc_dvc->err_code = AdvLoadMicrocode(iop_base, &fw->data[4], in AdvInitAsc38C1600Driver()
5485 AdvWriteWordLram(iop_base, ASC_MC_BIOSMEM + (2 * i), in AdvInitAsc38C1600Driver()
5493 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, begin_addr); in AdvInitAsc38C1600Driver()
5494 AdvReadWordLram(iop_base, ASC_MC_CODE_END_ADDR, end_addr); in AdvInitAsc38C1600Driver()
5496 AdvWriteWordRegister(iop_base, IOPW_RAM_ADDR, begin_addr); in AdvInitAsc38C1600Driver()
5498 code_sum += AdvReadWordAutoIncLram(iop_base); in AdvInitAsc38C1600Driver()
5500 AdvWriteWordLram(iop_base, ASC_MC_CODE_CHK_SUM, code_sum); in AdvInitAsc38C1600Driver()
5505 AdvReadWordLram(iop_base, ASC_MC_VERSION_DATE, in AdvInitAsc38C1600Driver()
5507 AdvReadWordLram(iop_base, ASC_MC_VERSION_NUM, in AdvInitAsc38C1600Driver()
5513 AdvWriteWordLram(iop_base, ASC_MC_CHIP_TYPE, ADV_CHIP_ASC38C1600); in AdvInitAsc38C1600Driver()
5523 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C1600Driver()
5524 AdvWriteWordRegister(iop_base, IOPW_SCSI_CFG1, in AdvInitAsc38C1600Driver()
5534 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5536 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5546 AdvReadWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5548 AdvWriteWordLram(iop_base, ASC_MC_CONTROL_FLAG, word); in AdvInitAsc38C1600Driver()
5555 AdvWriteByteRegister(iop_base, IOPB_DMA_CFG0, in AdvInitAsc38C1600Driver()
5571 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, in AdvInitAsc38C1600Driver()
5573 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, in AdvInitAsc38C1600Driver()
5586 AdvWriteWordLram(iop_base, ASC_MC_DISC_ENABLE, in AdvInitAsc38C1600Driver()
5588 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED1, asc_dvc->sdtr_speed1); in AdvInitAsc38C1600Driver()
5589 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED2, asc_dvc->sdtr_speed2); in AdvInitAsc38C1600Driver()
5590 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED3, asc_dvc->sdtr_speed3); in AdvInitAsc38C1600Driver()
5591 AdvWriteWordLram(iop_base, ASC_MC_SDTR_SPEED4, asc_dvc->sdtr_speed4); in AdvInitAsc38C1600Driver()
5599 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG0, in AdvInitAsc38C1600Driver()
5612 scsi_cfg1 = AdvReadWordRegister(iop_base, IOPW_SCSI_CFG1); in AdvInitAsc38C1600Driver()
5619 if ((AdvReadWordRegister(iop_base, IOPW_SCSI_CTRL) & 0x3F07) == 0x3F07) { in AdvInitAsc38C1600Driver()
5700 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SCSI_CFG1, scsi_cfg1); in AdvInitAsc38C1600Driver()
5721 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_MEM_CFG, in AdvInitAsc38C1600Driver()
5730 AdvWriteWordLram(iop_base, ASC_MC_DEFAULT_SEL_MASK, in AdvInitAsc38C1600Driver()
5749 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_ICQ, asc_dvc->icq_sp->carr_pa); in AdvInitAsc38C1600Driver()
5750 AdvWriteDWordRegister(iop_base, IOPDW_COMMA, in AdvInitAsc38C1600Driver()
5765 AdvWriteDWordLramNoSwap(iop_base, ASC_MC_IRQ, asc_dvc->irq_sp->carr_pa); in AdvInitAsc38C1600Driver()
5768 AdvWriteByteRegister(iop_base, IOPB_INTR_ENABLES, in AdvInitAsc38C1600Driver()
5771 AdvReadWordLram(iop_base, ASC_MC_CODE_BEGIN_ADDR, word); in AdvInitAsc38C1600Driver()
5772 AdvWriteWordRegister(iop_base, IOPW_PC, word); in AdvInitAsc38C1600Driver()
5775 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_RUN); in AdvInitAsc38C1600Driver()
5792 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvInitAsc38C1600Driver()
5793 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvInitAsc38C1600Driver()
5794 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvInitAsc38C1600Driver()
5795 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in AdvInitAsc38C1600Driver()
5798 AdvWriteByteLram(iop_base, in AdvInitAsc38C1600Driver()
5825 AdvPortAddr iop_base; in AdvResetChipAndSB() local
5828 iop_base = asc_dvc->iop_base; in AdvResetChipAndSB()
5833 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvResetChipAndSB()
5834 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvResetChipAndSB()
5836 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvResetChipAndSB()
5838 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvResetChipAndSB()
5840 AdvReadByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvResetChipAndSB()
5850 AdvReadWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, bios_sig); in AdvResetChipAndSB()
5851 AdvWriteWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, 0); in AdvResetChipAndSB()
5856 AdvWriteWordRegister(iop_base, IOPW_RISC_CSR, ADV_RISC_CSR_STOP); in AdvResetChipAndSB()
5857 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, ADV_CTRL_REG_CMD_RESET); in AdvResetChipAndSB()
5859 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvResetChipAndSB()
5885 AdvWriteWordLram(iop_base, ASC_MC_BIOS_SIGNATURE, bios_sig); in AdvResetChipAndSB()
5890 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, wdtr_able); in AdvResetChipAndSB()
5891 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, sdtr_able); in AdvResetChipAndSB()
5893 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, ppr_able); in AdvResetChipAndSB()
5895 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, tagqng_able); in AdvResetChipAndSB()
5897 AdvWriteByteLram(iop_base, ASC_MC_NUMBER_OF_MAX_CMD + tid, in AdvResetChipAndSB()
6112 AdvPortAddr iop_base; in AdvISR() local
6120 iop_base = asc_dvc->iop_base; in AdvISR()
6123 int_stat = AdvReadByteRegister(iop_base, IOPB_INTR_STATUS_REG); in AdvISR()
6138 AdvReadByteLram(iop_base, ASC_MC_INTRB_CODE, intrb_code); in AdvISR()
6144 AdvWriteByteRegister(iop_base, IOPB_TICKLE, in AdvISR()
6147 AdvWriteByteRegister(iop_base, in AdvISR()
6228 AscWriteLramWord(asc_dvc->iop_base, ASCV_ASCDVC_ERR_CODE_W, in AscSetLibErrorCode()
6234 static void AscAckInterrupt(PortAddr iop_base) in AscAckInterrupt() argument
6242 risc_flag = AscReadLramByte(iop_base, ASCV_RISC_FLAG_B); in AscAckInterrupt()
6248 AscReadLramByte(iop_base, in AscAckInterrupt()
6250 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, in AscAckInterrupt()
6252 AscSetChipStatus(iop_base, CIW_INT_ACK); in AscAckInterrupt()
6254 while (AscGetChipStatus(iop_base) & CSW_INT_PENDING) { in AscAckInterrupt()
6255 AscSetChipStatus(iop_base, CIW_INT_ACK); in AscAckInterrupt()
6260 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, host_flag); in AscAckInterrupt()
6288 PortAddr iop_base = asc_dvc->iop_base; in AscMsgOutSDTR() local
6300 AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, in AscMsgOutSDTR()
6306 AscMemWordCopyPtrToLram(iop_base, ASCV_MSGOUT_BEG, in AscMsgOutSDTR()
6326 static bool AscSetChipSynRegAtID(PortAddr iop_base, uchar id, uchar sdtr_data) in AscSetChipSynRegAtID() argument
6332 AscSetBank(iop_base, 1); in AscSetChipSynRegAtID()
6333 org_id = AscReadChipDvcID(iop_base); in AscSetChipSynRegAtID()
6339 AscWriteChipDvcID(iop_base, id); in AscSetChipSynRegAtID()
6340 if (AscReadChipDvcID(iop_base) == (0x01 << id)) { in AscSetChipSynRegAtID()
6341 AscSetBank(iop_base, 0); in AscSetChipSynRegAtID()
6342 AscSetChipSyn(iop_base, sdtr_data); in AscSetChipSynRegAtID()
6343 if (AscGetChipSyn(iop_base) != sdtr_data) { in AscSetChipSynRegAtID()
6349 AscSetBank(iop_base, 1); in AscSetChipSynRegAtID()
6350 AscWriteChipDvcID(iop_base, org_id); in AscSetChipSynRegAtID()
6351 AscSetBank(iop_base, 0); in AscSetChipSynRegAtID()
6355 static void AscSetChipSDTR(PortAddr iop_base, uchar sdtr_data, uchar tid_no) in AscSetChipSDTR() argument
6357 AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); in AscSetChipSDTR()
6358 AscPutMCodeSDTRDoneAtID(iop_base, tid_no, sdtr_data); in AscSetChipSDTR()
6370 PortAddr iop_base; in AscIsrChipHalted() local
6385 iop_base = asc_dvc->iop_base; in AscIsrChipHalted()
6386 int_halt_code = AscReadLramWord(iop_base, ASCV_HALTCODE_W); in AscIsrChipHalted()
6388 halt_qp = AscReadLramByte(iop_base, ASCV_CURCDB_B); in AscIsrChipHalted()
6390 target_ix = AscReadLramByte(iop_base, in AscIsrChipHalted()
6393 q_cntl = AscReadLramByte(iop_base, in AscIsrChipHalted()
6404 AscSetChipSDTR(iop_base, 0, tid_no); in AscIsrChipHalted()
6407 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6411 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6414 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6417 AscMemWordCopyPtrFromLram(iop_base, in AscIsrChipHalted()
6450 AscSetChipSDTR(iop_base, asyn_sdtr, in AscIsrChipHalted()
6460 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6473 AscSetChipSDTR(iop_base, sdtr_data, in AscIsrChipHalted()
6488 AscSetChipSDTR(iop_base, sdtr_data, in AscIsrChipHalted()
6496 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6500 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6507 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6512 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6516 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6521 AscMemWordCopyPtrToLram(iop_base, in AscIsrChipHalted()
6526 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6530 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6541 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscIsrChipHalted()
6553 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6557 tag_code = AscReadLramByte(iop_base, in AscIsrChipHalted()
6569 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6574 q_status = AscReadLramByte(iop_base, in AscIsrChipHalted()
6578 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6583 scsi_busy = AscReadLramByte(iop_base, (ushort)ASCV_SCSIBUSY_B); in AscIsrChipHalted()
6585 AscWriteLramByte(iop_base, (ushort)ASCV_SCSIBUSY_B, scsi_busy); in AscIsrChipHalted()
6587 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6591 AscMemWordCopyPtrFromLram(iop_base, in AscIsrChipHalted()
6602 AscSetChipSDTR(iop_base, asyn_sdtr, tid_no); in AscIsrChipHalted()
6606 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6609 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6613 scsi_status = AscReadLramByte(iop_base, in AscIsrChipHalted()
6618 AscReadLramByte(iop_base, in AscIsrChipHalted()
6623 scsi_busy = AscReadLramByte(iop_base, in AscIsrChipHalted()
6626 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6636 AscWriteLramByte(iop_base, in AscIsrChipHalted()
6654 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0); in AscIsrChipHalted()
6671 DvcGetQinfo(PortAddr iop_base, ushort s_addr, uchar *inbuf, int words) in DvcGetQinfo() argument
6676 AscSetChipLramAddr(iop_base, s_addr); in DvcGetQinfo()
6681 word = inpw(iop_base + IOP_RAM_DATA); in DvcGetQinfo()
6689 _AscCopyLramScsiDoneQ(PortAddr iop_base, in _AscCopyLramScsiDoneQ() argument
6696 DvcGetQinfo(iop_base, in _AscCopyLramScsiDoneQ()
6701 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6705 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6709 _val = AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6718 scsiq->remain_bytes = (((u32)AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6726 scsiq->remain_bytes += AscReadLramWord(iop_base, in _AscCopyLramScsiDoneQ()
6861 PortAddr iop_base; in AscIsrQDone() local
6869 iop_base = asc_dvc->iop_base; in AscIsrQDone()
6872 done_q_tail = (uchar)AscGetVarDoneQTail(iop_base); in AscIsrQDone()
6874 next_qp = AscReadLramByte(iop_base, in AscIsrQDone()
6877 AscPutVarDoneQTail(iop_base, next_qp); in AscIsrQDone()
6879 sg_queue_cnt = _AscCopyLramScsiDoneQ(iop_base, q_addr, scsiq, in AscIsrQDone()
6881 AscWriteLramByte(iop_base, in AscIsrQDone()
6893 sg_list_qp = AscReadLramByte(iop_base, in AscIsrQDone()
6906 AscWriteLramByte(iop_base, in AscIsrQDone()
6912 AscPutVarDoneQTail(iop_base, sg_list_qp); in AscIsrQDone()
6915 cur_target_qng = AscReadLramByte(iop_base, in AscIsrQDone()
6922 scsi_busy = AscReadLramByte(iop_base, (ushort) in AscIsrQDone()
6925 AscWriteLramByte(iop_base, in AscIsrQDone()
6971 AscStopChip(iop_base); in AscIsrQDone()
6972 AscSetChipControl(iop_base, in AscIsrQDone()
6976 AscSetChipControl(iop_base, CC_HALT); in AscIsrQDone()
6977 AscSetChipStatus(iop_base, in AscIsrQDone()
6979 AscSetChipStatus(iop_base, 0); in AscIsrQDone()
6980 AscSetChipControl(iop_base, 0); in AscIsrQDone()
6986 if ((AscReadLramByte(iop_base, in AscIsrQDone()
7013 PortAddr iop_base; in AscISR() local
7021 iop_base = asc_dvc->iop_base; in AscISR()
7024 if (AscIsIntPending(iop_base) == 0) in AscISR()
7039 ctrl_reg = AscGetChipControl(iop_base); in AscISR()
7042 chipstat = AscGetChipStatus(iop_base); in AscISR()
7049 while ((AscGetChipStatus(iop_base) & in AscISR()
7053 AscSetChipControl(iop_base, (CC_CHIP_RESET | CC_HALT)); in AscISR()
7054 AscSetChipControl(iop_base, CC_HALT); in AscISR()
7055 AscSetChipStatus(iop_base, CIW_CLR_SCSI_RESET_INT); in AscISR()
7056 AscSetChipStatus(iop_base, 0); in AscISR()
7057 chipstat = AscGetChipStatus(iop_base); in AscISR()
7060 saved_ram_addr = AscGetChipLramAddr(iop_base); in AscISR()
7061 host_flag = AscReadLramByte(iop_base, in AscISR()
7064 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, in AscISR()
7067 AscAckInterrupt(iop_base); in AscISR()
7089 AscWriteLramByte(iop_base, ASCV_HOST_FLAG_B, host_flag); in AscISR()
7090 AscSetChipLramAddr(iop_base, saved_ram_addr); in AscISR()
7091 AscSetChipControl(iop_base, saved_ctrl_reg); in AscISR()
7250 static bool AscHostReqRiscHalt(PortAddr iop_base) in AscHostReqRiscHalt() argument
7256 if (AscIsChipHalted(iop_base)) in AscHostReqRiscHalt()
7258 saved_stop_code = AscReadLramByte(iop_base, ASCV_STOP_CODE_B); in AscHostReqRiscHalt()
7259 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, in AscHostReqRiscHalt()
7262 if (AscIsChipHalted(iop_base)) { in AscHostReqRiscHalt()
7268 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, saved_stop_code); in AscHostReqRiscHalt()
7273 AscSetRunChipSynRegAtID(PortAddr iop_base, uchar tid_no, uchar sdtr_data) in AscSetRunChipSynRegAtID() argument
7277 if (AscHostReqRiscHalt(iop_base)) { in AscSetRunChipSynRegAtID()
7278 sta = AscSetChipSynRegAtID(iop_base, tid_no, sdtr_data); in AscSetRunChipSynRegAtID()
7279 AscStartChip(iop_base); in AscSetRunChipSynRegAtID()
7303 AscSetRunChipSynRegAtID(asc_dvc->iop_base, sdev->id, in AscAsyncFix()
7343 AscWriteLramByte(asc_dvc->iop_base, ASCV_DISC_ENABLE_B, in advansys_narrow_slave_configure()
7345 AscWriteLramByte(asc_dvc->iop_base, ASCV_USE_TAGGED_QNG_B, in advansys_narrow_slave_configure()
7347 AscWriteLramByte(asc_dvc->iop_base, ASCV_CAN_TAGGED_QNG_B, in advansys_narrow_slave_configure()
7352 AscWriteLramByte(asc_dvc->iop_base, in advansys_narrow_slave_configure()
7366 advansys_wide_enable_wdtr(AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_wdtr() argument
7369 AdvReadWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); in advansys_wide_enable_wdtr()
7374 AdvWriteWordLram(iop_base, ASC_MC_WDTR_ABLE, cfg_word); in advansys_wide_enable_wdtr()
7382 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7384 AdvWriteWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7385 AdvReadWordLram(iop_base, ASC_MC_WDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7387 AdvWriteWordLram(iop_base, ASC_MC_WDTR_DONE, cfg_word); in advansys_wide_enable_wdtr()
7398 advansys_wide_enable_sdtr(AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_sdtr() argument
7401 AdvReadWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); in advansys_wide_enable_sdtr()
7406 AdvWriteWordLram(iop_base, ASC_MC_SDTR_ABLE, cfg_word); in advansys_wide_enable_sdtr()
7412 AdvReadWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_sdtr()
7414 AdvWriteWordLram(iop_base, ASC_MC_SDTR_DONE, cfg_word); in advansys_wide_enable_sdtr()
7426 AdvPortAddr iop_base, unsigned short tidmask) in advansys_wide_enable_ppr() argument
7428 AdvReadWordLram(iop_base, ASC_MC_PPR_ABLE, adv_dvc->ppr_able); in advansys_wide_enable_ppr()
7430 AdvWriteWordLram(iop_base, ASC_MC_PPR_ABLE, adv_dvc->ppr_able); in advansys_wide_enable_ppr()
7436 AdvPortAddr iop_base = adv_dvc->iop_base; in advansys_wide_slave_configure() local
7447 advansys_wide_enable_wdtr(iop_base, tidmask); in advansys_wide_slave_configure()
7449 advansys_wide_enable_sdtr(iop_base, tidmask); in advansys_wide_slave_configure()
7451 advansys_wide_enable_ppr(adv_dvc, iop_base, tidmask); in advansys_wide_slave_configure()
7462 AdvReadWordLram(iop_base, ASC_MC_TAGQNG_ABLE, cfg_word); in advansys_wide_slave_configure()
7464 AdvWriteWordLram(iop_base, ASC_MC_TAGQNG_ABLE, in advansys_wide_slave_configure()
7466 AdvWriteByteLram(iop_base, in advansys_wide_slave_configure()
7902 static uchar AscAllocFreeQueue(PortAddr iop_base, uchar free_q_head) in AscAllocFreeQueue() argument
7909 q_status = (uchar)AscReadLramByte(iop_base, in AscAllocFreeQueue()
7912 next_qp = AscReadLramByte(iop_base, (ushort)(q_addr + ASC_SCSIQ_B_FWD)); in AscAllocFreeQueue()
7919 AscAllocMultipleFreeQueue(PortAddr iop_base, uchar free_q_head, uchar n_free_q) in AscAllocMultipleFreeQueue() argument
7924 free_q_head = AscAllocFreeQueue(iop_base, free_q_head); in AscAllocMultipleFreeQueue()
7942 DvcPutScsiQ(PortAddr iop_base, ushort s_addr, uchar *outbuf, int words) in DvcPutScsiQ() argument
7947 AscSetChipLramAddr(iop_base, s_addr); in DvcPutScsiQ()
7952 outpw(iop_base + IOP_RAM_DATA, in DvcPutScsiQ()
7964 PortAddr iop_base; in AscPutReadyQueue() local
7966 iop_base = asc_dvc->iop_base; in AscPutReadyQueue()
7970 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscPutReadyQueue()
7984 AscMemWordCopyPtrToLram(iop_base, in AscPutReadyQueue()
7988 DvcPutScsiQ(iop_base, in AscPutReadyQueue()
7992 AscWriteLramWord(iop_base, in AscPutReadyQueue()
8008 PortAddr iop_base; in AscPutReadySgListQueue() local
8015 iop_base = asc_dvc->iop_base; in AscPutReadySgListQueue()
8066 next_qp = AscReadLramByte(iop_base, in AscPutReadySgListQueue()
8071 AscMemWordCopyPtrToLram(iop_base, in AscPutReadySgListQueue()
8075 AscMemDWordCopyPtrToLram(iop_base, in AscPutReadySgListQueue()
8095 PortAddr iop_base; in AscSendScsiQueue() local
8102 iop_base = asc_dvc->iop_base; in AscSendScsiQueue()
8106 free_q_head = (uchar)AscGetVarFreeQHead(iop_base); in AscSendScsiQueue()
8108 next_qp = AscAllocMultipleFreeQueue(iop_base, free_q_head, in AscSendScsiQueue()
8118 next_qp = AscAllocFreeQueue(iop_base, free_q_head); in AscSendScsiQueue()
8125 AscPutVarFreeQHead(iop_base, next_qp); in AscSendScsiQueue()
8154 PortAddr iop_base; in AscExeScsiQueue() local
8171 iop_base = asc_dvc->iop_base; in AscExeScsiQueue()
8186 sdtr_data = AscGetMCodeInitSDTRAtID(iop_base, tid_no); in AscExeScsiQueue()
8382 AdvPortAddr iop_base; in AdvExeScsiQueue() local
8395 iop_base = asc_dvc->iop_base; in AdvExeScsiQueue()
8440 AdvWriteByteRegister(iop_base, IOPB_TICKLE, ADV_TICKLE_A); in AdvExeScsiQueue()
8447 AdvWriteByteRegister(iop_base, IOPB_TICKLE, in AdvExeScsiQueue()
8455 AdvWriteDWordRegister(iop_base, IOPDW_COMMA, in AdvExeScsiQueue()
8579 static ushort AscGetEisaChipCfg(PortAddr iop_base) in DEF_SCSI_QCMD()
8581 PortAddr eisa_cfg_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | in DEF_SCSI_QCMD()
8590 static unsigned short AscGetChipBiosAddress(PortAddr iop_base, in AscGetChipBiosAddress() argument
8605 cfg_lsw = AscGetEisaChipCfg(iop_base); in AscGetChipBiosAddress()
8611 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscGetChipBiosAddress()
8622 static uchar AscSetChipScsiID(PortAddr iop_base, uchar new_host_id) in AscSetChipScsiID() argument
8626 if (AscGetChipScsiID(iop_base) == new_host_id) { in AscSetChipScsiID()
8629 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscSetChipScsiID()
8632 AscSetChipCfgLsw(iop_base, cfg_lsw); in AscSetChipScsiID()
8633 return (AscGetChipScsiID(iop_base)); in AscSetChipScsiID()
8636 static unsigned char AscGetChipScsiCtrl(PortAddr iop_base) in AscGetChipScsiCtrl() argument
8640 AscSetBank(iop_base, 1); in AscGetChipScsiCtrl()
8641 sc = inp(iop_base + IOP_REG_SC); in AscGetChipScsiCtrl()
8642 AscSetBank(iop_base, 0); in AscGetChipScsiCtrl()
8646 static unsigned char AscGetChipVersion(PortAddr iop_base, in AscGetChipVersion() argument
8652 eisa_iop = (PortAddr) ASC_GET_EISA_SLOT(iop_base) | in AscGetChipVersion()
8657 return AscGetChipVerNo(iop_base); in AscGetChipVersion()
8673 static int AscStopQueueExe(PortAddr iop_base) in AscStopQueueExe() argument
8677 if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) == 0) { in AscStopQueueExe()
8678 AscWriteLramByte(iop_base, ASCV_STOP_CODE_B, in AscStopQueueExe()
8681 if (AscReadLramByte(iop_base, ASCV_STOP_CODE_B) & in AscStopQueueExe()
8701 static ushort AscGetIsaDmaChannel(PortAddr iop_base) in AscGetIsaDmaChannel() argument
8705 channel = AscGetChipCfgLsw(iop_base) & 0x0003; in AscGetIsaDmaChannel()
8713 static ushort AscSetIsaDmaChannel(PortAddr iop_base, ushort dma_channel) in AscSetIsaDmaChannel() argument
8723 cfg_lsw = AscGetChipCfgLsw(iop_base) & 0xFFFC; in AscSetIsaDmaChannel()
8725 AscSetChipCfgLsw(iop_base, cfg_lsw); in AscSetIsaDmaChannel()
8726 return (AscGetIsaDmaChannel(iop_base)); in AscSetIsaDmaChannel()
8731 static uchar AscGetIsaDmaSpeed(PortAddr iop_base) in AscGetIsaDmaSpeed() argument
8735 AscSetBank(iop_base, 1); in AscGetIsaDmaSpeed()
8736 speed_value = AscReadChipDmaSpeed(iop_base); in AscGetIsaDmaSpeed()
8738 AscSetBank(iop_base, 0); in AscGetIsaDmaSpeed()
8742 static uchar AscSetIsaDmaSpeed(PortAddr iop_base, uchar speed_value) in AscSetIsaDmaSpeed() argument
8745 AscSetBank(iop_base, 1); in AscSetIsaDmaSpeed()
8746 AscWriteChipDmaSpeed(iop_base, speed_value); in AscSetIsaDmaSpeed()
8747 AscSetBank(iop_base, 0); in AscSetIsaDmaSpeed()
8748 return AscGetIsaDmaSpeed(iop_base); in AscSetIsaDmaSpeed()
8755 PortAddr iop_base; in AscInitAscDvcVar() local
8758 iop_base = asc_dvc->iop_base; in AscInitAscDvcVar()
8764 AscSetChipControl(iop_base, CC_HALT); in AscInitAscDvcVar()
8765 AscSetChipStatus(iop_base, 0); in AscInitAscDvcVar()
8793 chip_version = AscGetChipVersion(iop_base, asc_dvc->bus_type); in AscInitAscDvcVar()
8803 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
8806 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
8812 AscSetExtraControl(iop_base, in AscInitAscDvcVar()
8820 AscSetChipIFC(iop_base, IFC_INIT_DEFAULT); in AscInitAscDvcVar()
8824 (uchar)AscGetIsaDmaChannel(iop_base); in AscInitAscDvcVar()
8836 static int AscWriteEEPCmdReg(PortAddr iop_base, uchar cmd_reg) in AscWriteEEPCmdReg() argument
8842 AscSetChipEEPCmd(iop_base, cmd_reg); in AscWriteEEPCmdReg()
8844 read_back = AscGetChipEEPCmd(iop_base); in AscWriteEEPCmdReg()
8856 static ushort AscReadEEPWord(PortAddr iop_base, uchar addr) in AscReadEEPWord() argument
8861 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_DISABLE); in AscReadEEPWord()
8864 AscWriteEEPCmdReg(iop_base, cmd_reg); in AscReadEEPWord()
8866 read_wval = AscGetChipEEPData(iop_base); in AscReadEEPWord()
8871 static ushort AscGetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscGetEEPConfig() argument
8886 *wbuf = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
8897 wval = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
8914 *wbuf = AscReadEEPWord(iop_base, (uchar)s_addr); in AscGetEEPConfig()
8920 PortAddr iop_base; in AscTestExternalLram() local
8925 iop_base = asc_dvc->iop_base; in AscTestExternalLram()
8928 saved_word = AscReadLramWord(iop_base, q_addr); in AscTestExternalLram()
8929 AscSetChipLramAddr(iop_base, q_addr); in AscTestExternalLram()
8930 AscSetChipLramData(iop_base, 0x55AA); in AscTestExternalLram()
8932 AscSetChipLramAddr(iop_base, q_addr); in AscTestExternalLram()
8933 if (AscGetChipLramData(iop_base) == 0x55AA) { in AscTestExternalLram()
8935 AscWriteLramWord(iop_base, q_addr, saved_word); in AscTestExternalLram()
8945 static int AscWriteEEPDataReg(PortAddr iop_base, ushort data_reg) in AscWriteEEPDataReg() argument
8952 AscSetChipEEPData(iop_base, data_reg); in AscWriteEEPDataReg()
8954 read_back = AscGetChipEEPData(iop_base); in AscWriteEEPDataReg()
8964 static ushort AscWriteEEPWord(PortAddr iop_base, uchar addr, ushort word_val) in AscWriteEEPWord() argument
8968 read_wval = AscReadEEPWord(iop_base, addr); in AscWriteEEPWord()
8970 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_ABLE); in AscWriteEEPWord()
8972 AscWriteEEPDataReg(iop_base, word_val); in AscWriteEEPWord()
8974 AscWriteEEPCmdReg(iop_base, in AscWriteEEPWord()
8977 AscWriteEEPCmdReg(iop_base, ASC_EEP_CMD_WRITE_DISABLE); in AscWriteEEPWord()
8979 return (AscReadEEPWord(iop_base, addr)); in AscWriteEEPWord()
8984 static int AscSetEEPConfigOnce(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscSetEEPConfigOnce() argument
9002 if (*wbuf != AscWriteEEPWord(iop_base, (uchar)s_addr, *wbuf)) { in AscSetEEPConfigOnce()
9021 AscWriteEEPWord(iop_base, (uchar)s_addr, word)) { in AscSetEEPConfigOnce()
9027 AscWriteEEPWord(iop_base, (uchar)s_addr, *wbuf)) { in AscSetEEPConfigOnce()
9035 if (sum != AscWriteEEPWord(iop_base, (uchar)s_addr, sum)) { in AscSetEEPConfigOnce()
9045 if (*wbuf != AscReadEEPWord(iop_base, (uchar)s_addr)) { in AscSetEEPConfigOnce()
9064 (iop_base, (uchar)s_addr)); in AscSetEEPConfigOnce()
9067 word = AscReadEEPWord(iop_base, (uchar)s_addr); in AscSetEEPConfigOnce()
9074 if (AscReadEEPWord(iop_base, (uchar)s_addr) != sum) { in AscSetEEPConfigOnce()
9080 static int AscSetEEPConfig(PortAddr iop_base, ASCEEP_CONFIG *cfg_buf, in AscSetEEPConfig() argument
9088 if ((n_error = AscSetEEPConfigOnce(iop_base, cfg_buf, in AscSetEEPConfig()
9103 PortAddr iop_base; in AscInitFromEEP() local
9110 iop_base = asc_dvc->iop_base; in AscInitFromEEP()
9112 AscWriteLramWord(iop_base, ASCV_HALTCODE_W, 0x00FE); in AscInitFromEEP()
9113 AscStopQueueExe(iop_base); in AscInitFromEEP()
9114 if ((AscStopChip(iop_base)) || in AscInitFromEEP()
9115 (AscGetChipScsiCtrl(iop_base) != 0)) { in AscInitFromEEP()
9120 if (!AscIsChipHalted(iop_base)) { in AscInitFromEEP()
9124 AscSetPCAddr(iop_base, ASC_MCODE_START_ADDR); in AscInitFromEEP()
9125 if (AscGetPCAddr(iop_base) != ASC_MCODE_START_ADDR) { in AscInitFromEEP()
9130 cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9131 cfg_lsw = AscGetChipCfgLsw(iop_base); in AscInitFromEEP()
9135 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitFromEEP()
9137 chksum = AscGetEEPConfig(iop_base, eep_config, asc_dvc->bus_type); in AscInitFromEEP()
9142 if (AscGetChipStatus(iop_base) & CSW_AUTO_CONFIG) { in AscInitFromEEP()
9148 AscGetChipCfgLsw(iop_base); in AscInitFromEEP()
9153 AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9161 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) == in AscInitFromEEP()
9210 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitFromEEP()
9249 eep_config->cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitFromEEP()
9251 if ((i = AscSetEEPConfig(iop_base, eep_config, in AscInitFromEEP()
9274 if (AscFindSignature(asc_dvc->iop_base)) { in AscInitGetConfig()
9322 PortAddr iop_base = asc_dvc->iop_base; in AscInitSetConfig() local
9329 if (!AscFindSignature(asc_dvc->iop_base)) { in AscInitSetConfig()
9334 cfg_msw = AscGetChipCfgMsw(iop_base); in AscInitSetConfig()
9338 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitSetConfig()
9345 if (AscGetChipStatus(iop_base) & CSW_AUTO_CONFIG) { in AscInitSetConfig()
9351 AscSetChipCfgMsw(iop_base, cfg_msw); in AscInitSetConfig()
9364 if (AscGetChipVersion(iop_base, asc_dvc->bus_type) in AscInitSetConfig()
9369 if (AscSetChipScsiID(iop_base, asc_dvc->cfg->chip_scsi_id) != in AscInitSetConfig()
9375 AscSetIsaDmaChannel(iop_base, asc_dvc->cfg->isa_dma_channel); in AscInitSetConfig()
9376 AscSetIsaDmaSpeed(iop_base, asc_dvc->cfg->isa_dma_speed); in AscInitSetConfig()
9772 static void AdvWaitEEPCmd(AdvPortAddr iop_base) in AdvWaitEEPCmd() argument
9777 if (AdvReadWordRegister(iop_base, IOPW_EE_CMD) & in AdvWaitEEPCmd()
9783 if ((AdvReadWordRegister(iop_base, IOPW_EE_CMD) & ASC_EEP_CMD_DONE) == in AdvWaitEEPCmd()
9791 static ushort AdvReadEEPWord(AdvPortAddr iop_base, int eep_word_addr) in AdvReadEEPWord() argument
9793 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvReadEEPWord()
9795 AdvWaitEEPCmd(iop_base); in AdvReadEEPWord()
9796 return AdvReadWordRegister(iop_base, IOPW_EE_DATA); in AdvReadEEPWord()
9802 static void AdvSet3550EEPConfig(AdvPortAddr iop_base, in AdvSet3550EEPConfig() argument
9813 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet3550EEPConfig()
9814 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9829 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet3550EEPConfig()
9830 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet3550EEPConfig()
9832 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9839 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet3550EEPConfig()
9840 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet3550EEPConfig()
9841 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9857 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet3550EEPConfig()
9858 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet3550EEPConfig()
9860 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9862 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet3550EEPConfig()
9863 AdvWaitEEPCmd(iop_base); in AdvSet3550EEPConfig()
9869 static void AdvSet38C0800EEPConfig(AdvPortAddr iop_base, in AdvSet38C0800EEPConfig() argument
9880 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet38C0800EEPConfig()
9881 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9896 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C0800EEPConfig()
9897 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C0800EEPConfig()
9899 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9906 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet38C0800EEPConfig()
9907 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet38C0800EEPConfig()
9908 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9924 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C0800EEPConfig()
9925 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C0800EEPConfig()
9927 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9929 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet38C0800EEPConfig()
9930 AdvWaitEEPCmd(iop_base); in AdvSet38C0800EEPConfig()
9936 static void AdvSet38C1600EEPConfig(AdvPortAddr iop_base, in AdvSet38C1600EEPConfig() argument
9947 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_ABLE); in AdvSet38C1600EEPConfig()
9948 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9963 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C1600EEPConfig()
9964 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C1600EEPConfig()
9966 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9973 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, chksum); in AdvSet38C1600EEPConfig()
9974 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE | addr); in AdvSet38C1600EEPConfig()
9975 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9991 AdvWriteWordRegister(iop_base, IOPW_EE_DATA, word); in AdvSet38C1600EEPConfig()
9992 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, in AdvSet38C1600EEPConfig()
9994 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
9996 AdvWriteWordRegister(iop_base, IOPW_EE_CMD, ASC_EEP_CMD_WRITE_DISABLE); in AdvSet38C1600EEPConfig()
9997 AdvWaitEEPCmd(iop_base); in AdvSet38C1600EEPConfig()
10005 static ushort AdvGet3550EEPConfig(AdvPortAddr iop_base, in AdvGet3550EEPConfig() argument
10019 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10028 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10035 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet3550EEPConfig()
10048 static ushort AdvGet38C0800EEPConfig(AdvPortAddr iop_base, in AdvGet38C0800EEPConfig() argument
10062 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10071 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10078 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C0800EEPConfig()
10091 static ushort AdvGet38C1600EEPConfig(AdvPortAddr iop_base, in AdvGet38C1600EEPConfig() argument
10105 wval = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10114 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10121 *wbuf = AdvReadEEPWord(iop_base, eep_addr); in AdvGet38C1600EEPConfig()
10143 AdvPortAddr iop_base; in AdvInitFrom3550EEP() local
10147 iop_base = asc_dvc->iop_base; in AdvInitFrom3550EEP()
10156 if (AdvGet3550EEPConfig(iop_base, &eep_config) != eep_config.check_sum) { in AdvInitFrom3550EEP()
10170 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom3550EEP()
10173 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom3550EEP()
10176 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom3550EEP()
10178 AdvSet3550EEPConfig(iop_base, &eep_config); in AdvInitFrom3550EEP()
10293 AdvPortAddr iop_base; in AdvInitFrom38C0800EEP() local
10299 iop_base = asc_dvc->iop_base; in AdvInitFrom38C0800EEP()
10308 if (AdvGet38C0800EEPConfig(iop_base, &eep_config) != in AdvInitFrom38C0800EEP()
10323 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom38C0800EEP()
10326 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom38C0800EEP()
10329 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom38C0800EEP()
10331 AdvSet38C0800EEPConfig(iop_base, &eep_config); in AdvInitFrom38C0800EEP()
10492 AdvPortAddr iop_base; in AdvInitFrom38C1600EEP() local
10498 iop_base = asc_dvc->iop_base; in AdvInitFrom38C1600EEP()
10507 if (AdvGet38C1600EEPConfig(iop_base, &eep_config) != in AdvInitFrom38C1600EEP()
10539 AdvWriteByteRegister(iop_base, IOPB_GPIO_CNTL, 0); in AdvInitFrom38C1600EEP()
10540 ints = AdvReadByteRegister(iop_base, IOPB_GPIO_DATA); in AdvInitFrom38C1600EEP()
10550 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 1); in AdvInitFrom38C1600EEP()
10552 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 2); in AdvInitFrom38C1600EEP()
10554 AdvReadEEPWord(iop_base, ADV_EEP_DVC_CFG_END - 3); in AdvInitFrom38C1600EEP()
10556 AdvSet38C1600EEPConfig(iop_base, &eep_config); in AdvInitFrom38C1600EEP()
10715 AdvPortAddr iop_base = asc_dvc->iop_base; in AdvInitGetConfig() local
10733 AdvGetChipVersion(iop_base, asc_dvc->bus_type); in AdvInitGetConfig()
10736 (ushort)AdvReadByteRegister(iop_base, IOPB_CHIP_ID_1), in AdvInitGetConfig()
10740 (ushort)AdvReadWordRegister(iop_base, IOPW_CHIP_ID_0), in AdvInitGetConfig()
10746 if (AdvFindSignature(iop_base) == 0) { in AdvInitGetConfig()
10763 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvInitGetConfig()
10766 AdvWriteWordRegister(iop_base, IOPW_CTRL_REG, in AdvInitGetConfig()
10923 asc_dvc_varp->iop_base = iop; in advansys_board_found()
10950 adv_dvc_varp->iop_base = (AdvPortAddr)boardp->ioremap_addr; in advansys_board_found()
10951 ASC_DBG(1, "iop_base: 0x%p\n", adv_dvc_varp->iop_base); in advansys_board_found()
11177 shost->io_port = asc_dvc_varp->iop_base; in advansys_board_found()
11234 shost->base = AscGetChipBiosAddress(asc_dvc_varp->iop_base, in advansys_board_found()
11241 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11243 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11245 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11247 AdvReadWordLram(adv_dvc_varp->iop_base, in advansys_board_found()
11422 static unsigned int advansys_isa_irq_no(PortAddr iop_base) in advansys_isa_irq_no() argument
11424 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); in advansys_isa_irq_no()
11434 PortAddr iop_base = _asc_def_iop_base[id]; in advansys_isa_probe() local
11438 if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) { in advansys_isa_probe()
11439 ASC_DBG(1, "I/O port 0x%x busy\n", iop_base); in advansys_isa_probe()
11442 ASC_DBG(1, "probing I/O port 0x%x\n", iop_base); in advansys_isa_probe()
11443 if (!AscFindSignature(iop_base)) in advansys_isa_probe()
11445 if (!(AscGetChipVersion(iop_base, ASC_IS_ISA) & ASC_CHIP_VER_ISA_BIT)) in advansys_isa_probe()
11454 board->irq = advansys_isa_irq_no(iop_base); in advansys_isa_probe()
11458 err = advansys_board_found(shost, iop_base, ASC_IS_ISA); in advansys_isa_probe()
11468 release_region(iop_base, ASC_IOADR_GAP); in advansys_isa_probe()
11500 static unsigned int advansys_vlb_irq_no(PortAddr iop_base) in advansys_vlb_irq_no() argument
11502 unsigned short cfg_lsw = AscGetChipCfgLsw(iop_base); in advansys_vlb_irq_no()
11512 PortAddr iop_base = _asc_def_iop_base[id]; in advansys_vlb_probe() local
11516 if (!request_region(iop_base, ASC_IOADR_GAP, DRV_NAME)) { in advansys_vlb_probe()
11517 ASC_DBG(1, "I/O port 0x%x busy\n", iop_base); in advansys_vlb_probe()
11520 ASC_DBG(1, "probing I/O port 0x%x\n", iop_base); in advansys_vlb_probe()
11521 if (!AscFindSignature(iop_base)) in advansys_vlb_probe()
11528 if (AscGetChipVersion(iop_base, ASC_IS_VL) > ASC_CHIP_MAX_VER_VL) in advansys_vlb_probe()
11537 board->irq = advansys_vlb_irq_no(iop_base); in advansys_vlb_probe()
11541 err = advansys_board_found(shost, iop_base, ASC_IS_VL); in advansys_vlb_probe()
11551 release_region(iop_base, ASC_IOADR_GAP); in advansys_vlb_probe()