Lines Matching refs:p_port

749 #define ARAM_ACCESS(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \  argument
750 (RD_HARPOON(p_port+hp_page_ctrl) | SGRAM_ARAM)))
752 #define SGRAM_ACCESS(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \ argument
753 (RD_HARPOON(p_port+hp_page_ctrl) & ~SGRAM_ARAM)))
755 #define MDISABLE_INT(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \ argument
756 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE)))
758 #define MENABLE_INT(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \ argument
759 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE)))
771 static void FPT_sssyncv(u32 p_port, unsigned char p_id,
775 static void FPT_sxfrp(u32 p_port, unsigned char p_card);
808 static void FPT_Wait1Second(u32 p_port);
809 static void FPT_Wait(u32 p_port, unsigned char p_delay);
810 static void FPT_utilEEWriteOnOff(u32 p_port, unsigned char p_mode);
811 static void FPT_utilEEWrite(u32 p_port, unsigned short ee_data,
813 static unsigned short FPT_utilEERead(u32 p_port,
815 static unsigned short FPT_utilEEReadOrg(u32 p_port,
817 static void FPT_utilEESendCmdAddr(u32 p_port, unsigned char ee_cmd,
830 static void FPT_phaseBusFree(u32 p_port, unsigned char p_card);
833 static void FPT_BusMasterInit(u32 p_port);
834 static void FPT_DiagEEPROM(u32 p_port);
846 static unsigned char FPT_SccbMgr_bad_isr(u32 p_port,
860 static int FPT_scarb(u32 p_port, unsigned char p_sel_type);
861 static void FPT_scbusf(u32 p_port);
862 static void FPT_scsel(u32 p_port);
863 static void FPT_scasid(unsigned char p_card, u32 p_port);
864 static unsigned char FPT_scxferc(u32 p_port, unsigned char p_data);
865 static unsigned char FPT_scsendi(u32 p_port,
867 static unsigned char FPT_sciso(u32 p_port,
869 static void FPT_scwirod(u32 p_port, unsigned char p_data_bit);
870 static void FPT_scwiros(u32 p_port, unsigned char p_data_bit);
872 static unsigned char FPT_scsell(u32 p_port, unsigned char targ_id);
873 static void FPT_scwtsel(u32 p_port);
874 static void FPT_inisci(unsigned char p_card, u32 p_port,
876 static void FPT_scsavdi(unsigned char p_card, u32 p_port);
880 static void FPT_autoCmdCmplt(u32 p_port, unsigned char p_card);
881 static void FPT_autoLoadDefaultMap(u32 p_port);
1960 static unsigned char FPT_SccbMgr_bad_isr(u32 p_port, unsigned char p_card, in FPT_SccbMgr_bad_isr() argument
1968 if (RD_HARPOON(p_port + hp_ext_status) & in FPT_SccbMgr_bad_isr()
1973 FPT_hostDataXferAbort(p_port, p_card, in FPT_SccbMgr_bad_isr()
1977 if (RD_HARPOON(p_port + hp_pci_stat_cfg) & REC_MASTER_ABORT) in FPT_SccbMgr_bad_isr()
1979 WR_HARPOON(p_port + hp_pci_stat_cfg, in FPT_SccbMgr_bad_isr()
1980 (RD_HARPOON(p_port + hp_pci_stat_cfg) & in FPT_SccbMgr_bad_isr()
1983 WR_HARPOON(p_port + hp_host_blk_cnt, 0x00); in FPT_SccbMgr_bad_isr()
1993 FPT_sxfrp(p_port, p_card); in FPT_SccbMgr_bad_isr()
1995 temp = (unsigned char)(RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_SccbMgr_bad_isr()
1997 WR_HARPOON(p_port + hp_ee_ctrl, in FPT_SccbMgr_bad_isr()
1999 WR_HARPOON(p_port + hp_ee_ctrl, temp); in FPT_SccbMgr_bad_isr()
2002 (RDW_HARPOON((p_port + hp_intstat)) & in FPT_SccbMgr_bad_isr()
2004 FPT_phaseDecode(p_port, p_card); in FPT_SccbMgr_bad_isr()
2011 WR_HARPOON(p_port + hp_clkctrl_0, CLKCTRL_DEFAULT); in FPT_SccbMgr_bad_isr()
2012 WR_HARPOON(p_port + hp_sys_ctrl, 0x00); in FPT_SccbMgr_bad_isr()
2017 FPT_hostDataXferAbort(p_port, p_card, in FPT_SccbMgr_bad_isr()
2021 DISABLE_AUTO(p_port); in FPT_SccbMgr_bad_isr()
2023 FPT_sresb(p_port, p_card); in FPT_SccbMgr_bad_isr()
2025 while (RD_HARPOON(p_port + hp_scsictrl_0) & SCSI_RST) { in FPT_SccbMgr_bad_isr()
2033 (unsigned char)FPT_utilEERead(p_port, in FPT_SccbMgr_bad_isr()
2037 FPT_XbowInit(p_port, ScamFlg); in FPT_SccbMgr_bad_isr()
2046 WRW_HARPOON((p_port + hp_intstat), FIFO); in FPT_SccbMgr_bad_isr()
2049 FPT_sxfrp(p_port, p_card); in FPT_SccbMgr_bad_isr()
2054 DISABLE_AUTO(p_port); in FPT_SccbMgr_bad_isr()
2056 WRW_HARPOON((p_port + hp_intstat), in FPT_SccbMgr_bad_isr()
2081 FPT_sssyncv(p_port, pCurrCard->currentSCCB->TargID, NARROW_SCSI, in FPT_SccbMgr_bad_isr()
2090 FPT_scarb(p_port, LEVEL2_TAR); in FPT_SccbMgr_bad_isr()
2091 FPT_scsel(p_port); in FPT_SccbMgr_bad_isr()
2092 FPT_scasid(p_card, p_port); in FPT_SccbMgr_bad_isr()
2094 FPT_scbusf(p_port); in FPT_SccbMgr_bad_isr()
2096 WRW_HARPOON((p_port + hp_intstat), SCAM_SEL); in FPT_SccbMgr_bad_isr()
3504 static void FPT_sssyncv(u32 p_port, unsigned char p_id, in FPT_sssyncv() argument
3564 WR_HARPOON(p_port + hp_synctarg_base + index, p_sync_value); in FPT_sssyncv()
3693 static void FPT_sxfrp(u32 p_port, unsigned char p_card) in FPT_sxfrp() argument
3697 DISABLE_AUTO(p_port); in FPT_sxfrp()
3701 FPT_hostDataXferAbort(p_port, p_card, in FPT_sxfrp()
3709 if (RDW_HARPOON((p_port + hp_intstat)) & in FPT_sxfrp()
3713 WR_HARPOON(p_port + hp_xfercnt_0, 0x00); in FPT_sxfrp()
3715 curr_phz = RD_HARPOON(p_port + hp_scsisig) & (unsigned char)S_SCSI_PHZ; in FPT_sxfrp()
3717 WRW_HARPOON((p_port + hp_intstat), XFER_CNT_0); in FPT_sxfrp()
3719 WR_HARPOON(p_port + hp_scsisig, curr_phz); in FPT_sxfrp()
3721 while (!(RDW_HARPOON((p_port + hp_intstat)) & (BUS_FREE | RESET)) && in FPT_sxfrp()
3723 (RD_HARPOON(p_port + hp_scsisig) & (unsigned char)S_SCSI_PHZ))) in FPT_sxfrp()
3726 WR_HARPOON(p_port + hp_portctrl_0, in FPT_sxfrp()
3729 if (!(RD_HARPOON(p_port + hp_xferstat) & FIFO_EMPTY)) { in FPT_sxfrp()
3730 RD_HARPOON(p_port + hp_fifodata_0); in FPT_sxfrp()
3733 WR_HARPOON(p_port + hp_portctrl_0, in FPT_sxfrp()
3735 if (RD_HARPOON(p_port + hp_xferstat) & FIFO_EMPTY) { in FPT_sxfrp()
3736 WR_HARPOON(p_port + hp_fifodata_0, 0xFA); in FPT_sxfrp()
3741 while (!(RDW_HARPOON((p_port + hp_intstat)) & (BUS_FREE | RESET))) { in FPT_sxfrp()
3742 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_REQ) in FPT_sxfrp()
3746 WR_HARPOON(p_port + hp_portctrl_0, in FPT_sxfrp()
3748 while (!(RD_HARPOON(p_port + hp_xferstat) & FIFO_EMPTY)) { in FPT_sxfrp()
3749 RD_HARPOON(p_port + hp_fifodata_0); in FPT_sxfrp()
3752 if (!(RDW_HARPOON((p_port + hp_intstat)) & (BUS_FREE | RESET))) { in FPT_sxfrp()
3753 WR_HARPOON(p_port + hp_autostart_0, in FPT_sxfrp()
3755 while (!(RDW_HARPOON((p_port + hp_intstat)) & AUTO_INT)) { in FPT_sxfrp()
3758 if (RDW_HARPOON((p_port + hp_intstat)) & in FPT_sxfrp()
3761 (RDW_HARPOON((p_port + hp_intstat)) & in FPT_sxfrp()
3950 static void FPT_phaseDecode(u32 p_port, unsigned char p_card) in FPT_phaseDecode() argument
3955 DISABLE_AUTO(p_port); in FPT_phaseDecode()
3958 (unsigned char)(RD_HARPOON(p_port + hp_scsisig) & S_SCSI_PHZ); in FPT_phaseDecode()
3962 (*phase) (p_port, p_card); /* Call the correct phase func */ in FPT_phaseDecode()
4058 static void FPT_phaseCommand(u32 p_port, unsigned char p_card) in FPT_phaseCommand() argument
4072 WR_HARPOON(p_port + hp_scsisig, 0x00); in FPT_phaseCommand()
4074 ARAM_ACCESS(p_port); in FPT_phaseCommand()
4076 cdb_reg = p_port + CMD_STRT; in FPT_phaseCommand()
4093 WR_HARPOON(p_port + hp_portctrl_0, (SCSI_PORT)); in FPT_phaseCommand()
4097 WR_HARPOON(p_port + hp_autostart_3, (AUTO_IMMED | CMD_ONLY_STRT)); in FPT_phaseCommand()
4098 SGRAM_ACCESS(p_port); in FPT_phaseCommand()
4509 static void FPT_autoLoadDefaultMap(u32 p_port) in FPT_autoLoadDefaultMap() argument
4513 ARAM_ACCESS(p_port); in FPT_autoLoadDefaultMap()
4514 map_addr = p_port + hp_aramBase; in FPT_autoLoadDefaultMap()
4603 SGRAM_ACCESS(p_port); in FPT_autoLoadDefaultMap()
4615 static void FPT_autoCmdCmplt(u32 p_port, unsigned char p_card) in FPT_autoCmdCmplt() argument
4622 status_byte = RD_HARPOON(p_port + hp_gp_reg_0); in FPT_autoCmdCmplt()
4921 static void FPT_busMstrSGDataXferStart(u32 p_port, struct sccb *pcurrSCCB) in FPT_busMstrSGDataXferStart() argument
4939 i = (unsigned char)(RD_HARPOON(p_port + hp_page_ctrl) & in FPT_busMstrSGDataXferStart()
4942 WR_HARPOON(p_port + hp_page_ctrl, i); in FPT_busMstrSGDataXferStart()
4962 WR_HARP32(p_port, reg_offset, addr); in FPT_busMstrSGDataXferStart()
4965 WR_HARP32(p_port, reg_offset, count); in FPT_busMstrSGDataXferStart()
4976 WR_HARPOON(p_port + hp_sg_addr, (sg_count << 4)); in FPT_busMstrSGDataXferStart()
4980 WR_HARP32(p_port, hp_xfercnt_0, tmpSGCnt); in FPT_busMstrSGDataXferStart()
4982 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrSGDataXferStart()
4984 WR_HARPOON(p_port + hp_scsisig, S_DATAI_PH); in FPT_busMstrSGDataXferStart()
4989 if ((!(RD_HARPOON(p_port + hp_synctarg_0) & NARROW_SCSI)) && in FPT_busMstrSGDataXferStart()
4996 WR_HARP32(p_port, hp_xfercnt_0, tmpSGCnt); in FPT_busMstrSGDataXferStart()
4998 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrSGDataXferStart()
5000 WR_HARPOON(p_port + hp_scsisig, S_DATAO_PH); in FPT_busMstrSGDataXferStart()
5003 WR_HARPOON(p_port + hp_page_ctrl, (unsigned char)(i | SCATTER_EN)); in FPT_busMstrSGDataXferStart()
5014 static void FPT_busMstrDataXferStart(u32 p_port, struct sccb *pcurrSCCB) in FPT_busMstrDataXferStart() argument
5031 HP_SETUP_ADDR_CNT(p_port, addr, count); in FPT_busMstrDataXferStart()
5035 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrDataXferStart()
5037 WR_HARPOON(p_port + hp_scsisig, S_DATAI_PH); in FPT_busMstrDataXferStart()
5039 WR_HARPOON(p_port + hp_xfer_cmd, in FPT_busMstrDataXferStart()
5045 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrDataXferStart()
5047 WR_HARPOON(p_port + hp_scsisig, S_DATAO_PH); in FPT_busMstrDataXferStart()
5049 WR_HARPOON(p_port + hp_xfer_cmd, in FPT_busMstrDataXferStart()
5067 static unsigned char FPT_busMstrTimeOut(u32 p_port) in FPT_busMstrTimeOut() argument
5073 WR_HARPOON(p_port + hp_sys_ctrl, HALT_MACH); in FPT_busMstrTimeOut()
5075 while ((!(RD_HARPOON(p_port + hp_ext_status) & CMD_ABORTED)) in FPT_busMstrTimeOut()
5079 if (RD_HARPOON(p_port + hp_ext_status) & BM_CMD_BUSY) { in FPT_busMstrTimeOut()
5080 WR_HARPOON(p_port + hp_sys_ctrl, HARD_ABORT); in FPT_busMstrTimeOut()
5083 while ((RD_HARPOON(p_port + hp_ext_status) & BM_CMD_BUSY) in FPT_busMstrTimeOut()
5088 RD_HARPOON(p_port + hp_int_status); /*Clear command complete */ in FPT_busMstrTimeOut()
5090 if (RD_HARPOON(p_port + hp_ext_status) & BM_CMD_BUSY) { in FPT_busMstrTimeOut()
5430 u32 p_port; in FPT_scini() local
5437 p_port = currCard->ioPort; in FPT_scini()
5445 (unsigned char)FPT_utilEERead(p_port, SCAM_CONFIG / 2); in FPT_scini()
5447 char)(FPT_utilEERead(p_port, (SYSTEM_CONFIG / 2))); in FPT_scini()
5452 FPT_inisci(p_card, p_port, p_our_id); in FPT_scini()
5462 FPT_Wait1Second(p_port); in FPT_scini()
5465 while (!(FPT_scarb(p_port, INIT_SELTD))) { in FPT_scini()
5468 FPT_scsel(p_port); in FPT_scini()
5471 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scini()
5472 FPT_scxferc(p_port, DOM_MSTR); in FPT_scini()
5474 FPT_scsendi(p_port, in FPT_scini()
5478 FPT_scbusf(p_port); in FPT_scini()
5481 FPT_sresb(p_port, p_card); in FPT_scini()
5482 FPT_Wait(p_port, TO_250ms); in FPT_scini()
5484 while (!(FPT_scarb(p_port, INIT_SELTD))) { in FPT_scini()
5487 FPT_scsel(p_port); in FPT_scini()
5490 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scini()
5491 FPT_scxferc(p_port, DOM_MSTR); in FPT_scini()
5493 FPT_scsendi(p_port, in FPT_scini()
5498 FPT_scbusf(p_port); in FPT_scini()
5515 if (FPT_scsell(p_port, i)) { in FPT_scini()
5536 FPT_sresb(p_port, p_card); in FPT_scini()
5537 FPT_Wait1Second(p_port); in FPT_scini()
5538 while (!(FPT_scarb(p_port, INIT_SELTD))) { in FPT_scini()
5540 FPT_scsel(p_port); in FPT_scini()
5541 FPT_scasid(p_card, p_port); in FPT_scini()
5549 FPT_scwtsel(p_port); in FPT_scini()
5552 while (FPT_scxferc(p_port, 0x00) != SYNC_PTRN) { in FPT_scini()
5555 i = FPT_scxferc(p_port, 0x00); in FPT_scini()
5559 (p_port, in FPT_scini()
5561 i = FPT_scxferc(p_port, 0x00); in FPT_scini()
5563 k = FPT_scxferc(p_port, 0x00); in FPT_scini()
5576 p_port, in FPT_scini()
5592 if (!(FPT_scsendi(p_port, in FPT_scini()
5600 while (FPT_scxferc(p_port, 0x00) != CFG_CMPLT) { in FPT_scini()
5605 FPT_scbusf(p_port); in FPT_scini()
5607 FPT_scsavdi(p_card, p_port); in FPT_scini()
5635 static int FPT_scarb(u32 p_port, unsigned char p_sel_type) in FPT_scarb() argument
5639 while (RD_HARPOON(p_port + hp_scsisig) & (SCSI_SEL | SCSI_BSY)) { in FPT_scarb()
5642 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_SEL) in FPT_scarb()
5645 if (RD_HARPOON(p_port + hp_scsidata_0) != 00) in FPT_scarb()
5648 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5649 (RD_HARPOON(p_port + hp_scsisig) | SCSI_BSY)); in FPT_scarb()
5651 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_SEL) { in FPT_scarb()
5653 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5654 (RD_HARPOON(p_port + hp_scsisig) & in FPT_scarb()
5659 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5660 (RD_HARPOON(p_port + hp_scsisig) | SCSI_SEL)); in FPT_scarb()
5662 if (RD_HARPOON(p_port + hp_scsidata_0) != 00) { in FPT_scarb()
5664 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5665 (RD_HARPOON(p_port + hp_scsisig) & in FPT_scarb()
5671 WR_HARPOON(p_port + hp_clkctrl_0, (RD_HARPOON(p_port + hp_clkctrl_0) in FPT_scarb()
5673 WR_HARPOON(p_port + hp_scsireset, SCAM_EN); in FPT_scarb()
5674 WR_HARPOON(p_port + hp_scsidata_0, 0x00); in FPT_scarb()
5675 WR_HARPOON(p_port + hp_scsidata_1, 0x00); in FPT_scarb()
5676 WR_HARPOON(p_port + hp_portctrl_0, SCSI_BUS_EN); in FPT_scarb()
5678 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5679 (RD_HARPOON(p_port + hp_scsisig) | SCSI_MSG)); in FPT_scarb()
5681 WR_HARPOON(p_port + hp_scsisig, (RD_HARPOON(p_port + hp_scsisig) in FPT_scarb()
5684 FPT_Wait(p_port, TO_250ms); in FPT_scarb()
5697 static void FPT_scbusf(u32 p_port) in FPT_scbusf() argument
5699 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scbusf()
5700 (RD_HARPOON(p_port + hp_page_ctrl) | G_INT_DISABLE)); in FPT_scbusf()
5702 WR_HARPOON(p_port + hp_scsidata_0, 0x00); in FPT_scbusf()
5704 WR_HARPOON(p_port + hp_portctrl_0, (RD_HARPOON(p_port + hp_portctrl_0) in FPT_scbusf()
5707 WR_HARPOON(p_port + hp_scsisig, 0x00); in FPT_scbusf()
5709 WR_HARPOON(p_port + hp_scsireset, (RD_HARPOON(p_port + hp_scsireset) in FPT_scbusf()
5712 WR_HARPOON(p_port + hp_clkctrl_0, (RD_HARPOON(p_port + hp_clkctrl_0) in FPT_scbusf()
5715 WRW_HARPOON((p_port + hp_intstat), (BUS_FREE | AUTO_INT | SCAM_SEL)); in FPT_scbusf()
5717 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scbusf()
5718 (RD_HARPOON(p_port + hp_page_ctrl) & ~G_INT_DISABLE)); in FPT_scbusf()
5729 static void FPT_scasid(unsigned char p_card, u32 p_port) in FPT_scasid() argument
5748 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scasid()
5749 FPT_scxferc(p_port, ASSIGN_ID); in FPT_scasid()
5751 if (!(FPT_sciso(p_port, &temp_id_string[0]))) { in FPT_scasid()
5765 FPT_scxferc(p_port, MISC_CODE); in FPT_scasid()
5766 FPT_scxferc(p_port, CLR_P_FLAG); in FPT_scasid()
5772 FPT_scxferc(p_port, ID_0_7); in FPT_scasid()
5774 FPT_scxferc(p_port, ID_8_F); in FPT_scasid()
5782 FPT_scxferc(p_port, scam_id); in FPT_scasid()
5794 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scasid()
5795 FPT_scxferc(p_port, CFG_CMPLT); in FPT_scasid()
5806 static void FPT_scsel(u32 p_port) in FPT_scsel() argument
5809 WR_HARPOON(p_port + hp_scsisig, SCSI_SEL); in FPT_scsel()
5810 FPT_scwiros(p_port, SCSI_MSG); in FPT_scsel()
5812 WR_HARPOON(p_port + hp_scsisig, (SCSI_SEL | SCSI_BSY)); in FPT_scsel()
5814 WR_HARPOON(p_port + hp_scsisig, in FPT_scsel()
5816 WR_HARPOON(p_port + hp_scsidata_0, in FPT_scsel()
5817 (unsigned char)(RD_HARPOON(p_port + hp_scsidata_0) | in FPT_scsel()
5820 WR_HARPOON(p_port + hp_scsisig, (SCSI_BSY | SCSI_IOBIT | SCSI_CD)); in FPT_scsel()
5821 FPT_scwiros(p_port, SCSI_SEL); in FPT_scsel()
5823 WR_HARPOON(p_port + hp_scsidata_0, in FPT_scsel()
5824 (unsigned char)(RD_HARPOON(p_port + hp_scsidata_0) & in FPT_scsel()
5826 FPT_scwirod(p_port, BIT(6)); in FPT_scsel()
5828 WR_HARPOON(p_port + hp_scsisig, in FPT_scsel()
5840 static unsigned char FPT_scxferc(u32 p_port, unsigned char p_data) in FPT_scxferc() argument
5846 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5850 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5852 FPT_scwirod(p_port, BIT(7)); /*Wait for DB7 to be released. */ in FPT_scxferc()
5853 while (!(RD_HARPOON(p_port + hp_scsidata_0) & BIT(5))) ; in FPT_scxferc()
5855 ret_data = (RD_HARPOON(p_port + hp_scsidata_0) & (unsigned char)0x1F); in FPT_scxferc()
5859 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5863 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5865 FPT_scwirod(p_port, BIT(5)); /*Wait for DB5 to be released. */ in FPT_scxferc()
5870 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5874 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5876 FPT_scwirod(p_port, BIT(6)); /*Wait for DB6 to be released. */ in FPT_scxferc()
5890 static unsigned char FPT_scsendi(u32 p_port, unsigned char p_id_string[]) in FPT_scsendi() argument
5901 ret_data = FPT_scxferc(p_port, 00); in FPT_scsendi()
5905 ret_data = FPT_scxferc(p_port, 02); in FPT_scsendi()
5909 ret_data = FPT_scxferc(p_port, 01); in FPT_scsendi()
5941 static unsigned char FPT_sciso(u32 p_port, unsigned char p_id_string[]) in FPT_sciso() argument
5951 ret_data = FPT_scxferc(p_port, 0); in FPT_sciso()
5999 static void FPT_scwirod(u32 p_port, unsigned char p_data_bit) in FPT_scwirod() argument
6006 if (RD_HARPOON(p_port + hp_scsidata_0) & p_data_bit) in FPT_scwirod()
6026 static void FPT_scwiros(u32 p_port, unsigned char p_data_bit) in FPT_scwiros() argument
6033 if (RD_HARPOON(p_port + hp_scsisig) & p_data_bit) in FPT_scwiros()
6078 static unsigned char FPT_scsell(u32 p_port, unsigned char targ_id) in FPT_scsell() argument
6082 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scsell()
6083 (RD_HARPOON(p_port + hp_page_ctrl) | G_INT_DISABLE)); in FPT_scsell()
6085 ARAM_ACCESS(p_port); in FPT_scsell()
6087 WR_HARPOON(p_port + hp_addstat, in FPT_scsell()
6088 (RD_HARPOON(p_port + hp_addstat) | SCAM_TIMER)); in FPT_scsell()
6089 WR_HARPOON(p_port + hp_seltimeout, TO_4ms); in FPT_scsell()
6091 for (i = p_port + CMD_STRT; i < p_port + CMD_STRT + 12; i += 2) { in FPT_scsell()
6096 WRW_HARPOON((p_port + hp_intstat), in FPT_scsell()
6099 WR_HARPOON(p_port + hp_select_id, targ_id); in FPT_scsell()
6101 WR_HARPOON(p_port + hp_portctrl_0, SCSI_PORT); in FPT_scsell()
6102 WR_HARPOON(p_port + hp_autostart_3, (SELECT | CMD_ONLY_STRT)); in FPT_scsell()
6103 WR_HARPOON(p_port + hp_scsictrl_0, (SEL_TAR | ENA_RESEL)); in FPT_scsell()
6105 while (!(RDW_HARPOON((p_port + hp_intstat)) & in FPT_scsell()
6109 if (RDW_HARPOON((p_port + hp_intstat)) & RESET) in FPT_scsell()
6110 FPT_Wait(p_port, TO_250ms); in FPT_scsell()
6112 DISABLE_AUTO(p_port); in FPT_scsell()
6114 WR_HARPOON(p_port + hp_addstat, in FPT_scsell()
6115 (RD_HARPOON(p_port + hp_addstat) & ~SCAM_TIMER)); in FPT_scsell()
6116 WR_HARPOON(p_port + hp_seltimeout, TO_290ms); in FPT_scsell()
6118 SGRAM_ACCESS(p_port); in FPT_scsell()
6120 if (RDW_HARPOON((p_port + hp_intstat)) & (RESET | TIMEOUT)) { in FPT_scsell()
6122 WRW_HARPOON((p_port + hp_intstat), in FPT_scsell()
6125 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scsell()
6126 (RD_HARPOON(p_port + hp_page_ctrl) & in FPT_scsell()
6134 while (!(RDW_HARPOON((p_port + hp_intstat)) & BUS_FREE)) { in FPT_scsell()
6135 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_REQ) { in FPT_scsell()
6136 WR_HARPOON(p_port + hp_scsisig, in FPT_scsell()
6138 ACCEPT_MSG(p_port); in FPT_scsell()
6142 WRW_HARPOON((p_port + hp_intstat), CLR_ALL_INT_1); in FPT_scsell()
6144 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scsell()
6145 (RD_HARPOON(p_port + hp_page_ctrl) & in FPT_scsell()
6160 static void FPT_scwtsel(u32 p_port) in FPT_scwtsel() argument
6162 while (!(RDW_HARPOON((p_port + hp_intstat)) & SCAM_SEL)) { in FPT_scwtsel()
6174 static void FPT_inisci(unsigned char p_card, u32 p_port, unsigned char p_our_id) in FPT_inisci() argument
6182 if (RD_HARPOON(p_port + hp_page_ctrl) & NARROW_SCSI_CARD) in FPT_inisci()
6208 FPT_utilEERead(p_port, in FPT_inisci()
6360 static void FPT_scsavdi(unsigned char p_card, u32 p_port) in FPT_scsavdi() argument
6368 sum_data += FPT_utilEERead(p_port, i); in FPT_scsavdi()
6371 FPT_utilEEWriteOnOff(p_port, 1); /* Enable write access to the EEPROM */ in FPT_scsavdi()
6373 if (RD_HARPOON(p_port + hp_page_ctrl) & NARROW_SCSI_CARD) in FPT_scsavdi()
6386 FPT_utilEEWrite(p_port, ee_data, in FPT_scsavdi()
6393 FPT_utilEEWrite(p_port, sum_data, EEPROM_CHECK_SUM / 2); in FPT_scsavdi()
6394 FPT_utilEEWriteOnOff(p_port, 0); /* Turn off write access */ in FPT_scsavdi()
6454 static void FPT_BusMasterInit(u32 p_port) in FPT_BusMasterInit() argument
6457 WR_HARPOON(p_port + hp_sys_ctrl, DRVR_RST); in FPT_BusMasterInit()
6458 WR_HARPOON(p_port + hp_sys_ctrl, 0x00); in FPT_BusMasterInit()
6460 WR_HARPOON(p_port + hp_host_blk_cnt, XFER_BLK64); in FPT_BusMasterInit()
6462 WR_HARPOON(p_port + hp_bm_ctrl, (BMCTRL_DEFAULT)); in FPT_BusMasterInit()
6464 WR_HARPOON(p_port + hp_ee_ctrl, (SCSI_TERM_ENA_H)); in FPT_BusMasterInit()
6466 RD_HARPOON(p_port + hp_int_status); /*Clear interrupts. */ in FPT_BusMasterInit()
6467 WR_HARPOON(p_port + hp_int_mask, (INT_CMD_COMPL | SCSI_INTERRUPT)); in FPT_BusMasterInit()
6468 WR_HARPOON(p_port + hp_page_ctrl, (RD_HARPOON(p_port + hp_page_ctrl) & in FPT_BusMasterInit()
6481 static void FPT_DiagEEPROM(u32 p_port) in FPT_DiagEEPROM() argument
6485 if (RD_HARPOON(p_port + hp_page_ctrl) & NARROW_SCSI_CARD) in FPT_DiagEEPROM()
6490 temp = FPT_utilEERead(p_port, FW_SIGNATURE / 2); in FPT_DiagEEPROM()
6496 temp += FPT_utilEERead(p_port, index); in FPT_DiagEEPROM()
6500 if (temp == FPT_utilEERead(p_port, EEPROM_CHECK_SUM / 2)) { in FPT_DiagEEPROM()
6506 FPT_utilEEWriteOnOff(p_port, (unsigned char)1); in FPT_DiagEEPROM()
6510 FPT_utilEEWrite(p_port, 0x0000, index); in FPT_DiagEEPROM()
6515 FPT_utilEEWrite(p_port, 0x4641, FW_SIGNATURE / 2); in FPT_DiagEEPROM()
6517 FPT_utilEEWrite(p_port, 0x3920, MODEL_NUMB_0 / 2); in FPT_DiagEEPROM()
6519 FPT_utilEEWrite(p_port, 0x3033, MODEL_NUMB_2 / 2); in FPT_DiagEEPROM()
6521 FPT_utilEEWrite(p_port, 0x2020, MODEL_NUMB_4 / 2); in FPT_DiagEEPROM()
6523 FPT_utilEEWrite(p_port, 0x70D3, SYSTEM_CONFIG / 2); in FPT_DiagEEPROM()
6525 FPT_utilEEWrite(p_port, 0x0010, BIOS_CONFIG / 2); in FPT_DiagEEPROM()
6527 FPT_utilEEWrite(p_port, 0x0003, SCAM_CONFIG / 2); in FPT_DiagEEPROM()
6529 FPT_utilEEWrite(p_port, 0x0007, ADAPTER_SCSI_ID / 2); in FPT_DiagEEPROM()
6532 FPT_utilEEWrite(p_port, 0x0000, IGNORE_B_SCAN / 2); in FPT_DiagEEPROM()
6534 FPT_utilEEWrite(p_port, 0x0000, SEND_START_ENA / 2); in FPT_DiagEEPROM()
6536 FPT_utilEEWrite(p_port, 0x0000, DEVICE_ENABLE / 2); in FPT_DiagEEPROM()
6539 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL01 / 2); in FPT_DiagEEPROM()
6541 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL23 / 2); in FPT_DiagEEPROM()
6543 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL45 / 2); in FPT_DiagEEPROM()
6545 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL67 / 2); in FPT_DiagEEPROM()
6547 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL89 / 2); in FPT_DiagEEPROM()
6549 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLab / 2); in FPT_DiagEEPROM()
6551 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLcd / 2); in FPT_DiagEEPROM()
6553 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLef / 2); in FPT_DiagEEPROM()
6556 FPT_utilEEWrite(p_port, 0x6C46, 64 / 2); /*PRODUCT ID */ in FPT_DiagEEPROM()
6558 FPT_utilEEWrite(p_port, 0x7361, 66 / 2); /* FlashPoint LT */ in FPT_DiagEEPROM()
6560 FPT_utilEEWrite(p_port, 0x5068, 68 / 2); in FPT_DiagEEPROM()
6562 FPT_utilEEWrite(p_port, 0x696F, 70 / 2); in FPT_DiagEEPROM()
6564 FPT_utilEEWrite(p_port, 0x746E, 72 / 2); in FPT_DiagEEPROM()
6566 FPT_utilEEWrite(p_port, 0x4C20, 74 / 2); in FPT_DiagEEPROM()
6568 FPT_utilEEWrite(p_port, 0x2054, 76 / 2); in FPT_DiagEEPROM()
6570 FPT_utilEEWrite(p_port, 0x2020, 78 / 2); in FPT_DiagEEPROM()
6574 FPT_utilEEWrite(p_port, (0x0700 + TYPE_CODE0), index); in FPT_DiagEEPROM()
6577 FPT_utilEEWrite(p_port, 0x5542, index); /*Vendor ID code */ in FPT_DiagEEPROM()
6580 FPT_utilEEWrite(p_port, 0x4C53, index); in FPT_DiagEEPROM()
6583 FPT_utilEEWrite(p_port, 0x474F, index); in FPT_DiagEEPROM()
6586 FPT_utilEEWrite(p_port, 0x4349, index); in FPT_DiagEEPROM()
6589 FPT_utilEEWrite(p_port, 0x5442, index); /*Vendor unique code */ in FPT_DiagEEPROM()
6592 FPT_utilEEWrite(p_port, 0x202D, index); in FPT_DiagEEPROM()
6595 FPT_utilEEWrite(p_port, 0x3339, index); in FPT_DiagEEPROM()
6598 FPT_utilEEWrite(p_port, 0x2030, index); /* 01234567 */ in FPT_DiagEEPROM()
6601 FPT_utilEEWrite(p_port, 0x5453, index); in FPT_DiagEEPROM()
6604 FPT_utilEEWrite(p_port, 0x5645, index); in FPT_DiagEEPROM()
6607 FPT_utilEEWrite(p_port, 0x2045, index); in FPT_DiagEEPROM()
6610 FPT_utilEEWrite(p_port, 0x202F, index); in FPT_DiagEEPROM()
6613 FPT_utilEEWrite(p_port, 0x4F4A, index); in FPT_DiagEEPROM()
6616 FPT_utilEEWrite(p_port, 0x204E, index); in FPT_DiagEEPROM()
6619 FPT_utilEEWrite(p_port, 0x3539, index); in FPT_DiagEEPROM()
6622 FPT_utilEEWrite(p_port, temp, EEPROM_CHECK_SUM / 2); in FPT_DiagEEPROM()
6624 FPT_utilEEWriteOnOff(p_port, (unsigned char)0); in FPT_DiagEEPROM()
7174 static void FPT_Wait1Second(u32 p_port) in FPT_Wait1Second() argument
7180 FPT_Wait(p_port, TO_250ms); in FPT_Wait1Second()
7182 if ((RD_HARPOON(p_port + hp_scsictrl_0) & SCSI_RST)) in FPT_Wait1Second()
7185 if ((RDW_HARPOON((p_port + hp_intstat)) & SCAM_SEL)) in FPT_Wait1Second()
7198 static void FPT_Wait(u32 p_port, unsigned char p_delay) in FPT_Wait() argument
7203 old_timer = RD_HARPOON(p_port + hp_seltimeout); in FPT_Wait()
7205 green_flag = RD_HARPOON(p_port + hp_clkctrl_0); in FPT_Wait()
7206 WR_HARPOON(p_port + hp_clkctrl_0, CLKCTRL_DEFAULT); in FPT_Wait()
7208 WR_HARPOON(p_port + hp_seltimeout, p_delay); in FPT_Wait()
7209 WRW_HARPOON((p_port + hp_intstat), TIMEOUT); in FPT_Wait()
7210 WRW_HARPOON((p_port + hp_intena), (FPT_default_intena & ~TIMEOUT)); in FPT_Wait()
7212 WR_HARPOON(p_port + hp_portctrl_0, in FPT_Wait()
7213 (RD_HARPOON(p_port + hp_portctrl_0) | START_TO)); in FPT_Wait()
7215 while (!(RDW_HARPOON((p_port + hp_intstat)) & TIMEOUT)) { in FPT_Wait()
7217 if ((RD_HARPOON(p_port + hp_scsictrl_0) & SCSI_RST)) in FPT_Wait()
7220 if ((RDW_HARPOON((p_port + hp_intstat)) & SCAM_SEL)) in FPT_Wait()
7224 WR_HARPOON(p_port + hp_portctrl_0, in FPT_Wait()
7225 (RD_HARPOON(p_port + hp_portctrl_0) & ~START_TO)); in FPT_Wait()
7227 WRW_HARPOON((p_port + hp_intstat), TIMEOUT); in FPT_Wait()
7228 WRW_HARPOON((p_port + hp_intena), FPT_default_intena); in FPT_Wait()
7230 WR_HARPOON(p_port + hp_clkctrl_0, green_flag); in FPT_Wait()
7232 WR_HARPOON(p_port + hp_seltimeout, old_timer); in FPT_Wait()
7244 static void FPT_utilEEWriteOnOff(u32 p_port, unsigned char p_mode) in FPT_utilEEWriteOnOff() argument
7249 (unsigned char)(RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_utilEEWriteOnOff()
7254 FPT_utilEESendCmdAddr(p_port, EWEN, EWEN_ADDR); in FPT_utilEEWriteOnOff()
7258 FPT_utilEESendCmdAddr(p_port, EWDS, EWDS_ADDR); in FPT_utilEEWriteOnOff()
7260 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); /*Turn off CS */ in FPT_utilEEWriteOnOff()
7261 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); /*Turn off Master Select */ in FPT_utilEEWriteOnOff()
7273 static void FPT_utilEEWrite(u32 p_port, unsigned short ee_data, in FPT_utilEEWrite() argument
7282 char)((RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_utilEEWrite()
7285 FPT_utilEESendCmdAddr(p_port, EE_WRITE, ee_addr); in FPT_utilEEWrite()
7296 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7297 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7299 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7300 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7302 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7303 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7306 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); in FPT_utilEEWrite()
7308 FPT_Wait(p_port, TO_10ms); in FPT_utilEEWrite()
7310 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS | SEE_CS)); /* Set CS to EEPROM */ in FPT_utilEEWrite()
7311 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); /* Turn off CS */ in FPT_utilEEWrite()
7312 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); /* Turn off Master Select */ in FPT_utilEEWrite()
7324 static unsigned short FPT_utilEERead(u32 p_port, in FPT_utilEERead() argument
7330 ee_data1 = FPT_utilEEReadOrg(p_port, ee_addr); in FPT_utilEERead()
7332 ee_data2 = FPT_utilEEReadOrg(p_port, ee_addr); in FPT_utilEERead()
7354 static unsigned short FPT_utilEEReadOrg(u32 p_port, unsigned short ee_addr) in FPT_utilEEReadOrg() argument
7362 char)((RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_utilEEReadOrg()
7365 FPT_utilEESendCmdAddr(p_port, EE_READ, ee_addr); in FPT_utilEEReadOrg()
7373 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7374 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7376 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7377 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7381 if (RD_HARPOON(p_port + hp_ee_ctrl) & SEE_DI) in FPT_utilEEReadOrg()
7386 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); /*Turn off CS */ in FPT_utilEEReadOrg()
7387 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); /*Turn off Master Select */ in FPT_utilEEReadOrg()
7401 static void FPT_utilEESendCmdAddr(u32 p_port, unsigned char ee_cmd, in FPT_utilEESendCmdAddr() argument
7410 (unsigned char)(RD_HARPOON(p_port + hp_page_ctrl) & in FPT_utilEESendCmdAddr()
7414 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7417 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7426 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7427 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7429 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7430 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7432 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7433 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7449 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7450 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7452 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7453 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7455 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7456 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()