Lines Matching refs:p_port

777 #define ARAM_ACCESS(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \  argument
778 (RD_HARPOON(p_port+hp_page_ctrl) | SGRAM_ARAM)))
780 #define SGRAM_ACCESS(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \ argument
781 (RD_HARPOON(p_port+hp_page_ctrl) & ~SGRAM_ARAM)))
783 #define MDISABLE_INT(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \ argument
784 (RD_HARPOON(p_port+hp_page_ctrl) | G_INT_DISABLE)))
786 #define MENABLE_INT(p_port) (WR_HARPOON(p_port+hp_page_ctrl, \ argument
787 (RD_HARPOON(p_port+hp_page_ctrl) & ~G_INT_DISABLE)))
799 static void FPT_sssyncv(u32 p_port, unsigned char p_id,
803 static void FPT_sxfrp(u32 p_port, unsigned char p_card);
836 static void FPT_Wait1Second(u32 p_port);
837 static void FPT_Wait(u32 p_port, unsigned char p_delay);
838 static void FPT_utilEEWriteOnOff(u32 p_port, unsigned char p_mode);
839 static void FPT_utilEEWrite(u32 p_port, unsigned short ee_data,
841 static unsigned short FPT_utilEERead(u32 p_port,
843 static unsigned short FPT_utilEEReadOrg(u32 p_port,
845 static void FPT_utilEESendCmdAddr(u32 p_port, unsigned char ee_cmd,
858 static void FPT_phaseBusFree(u32 p_port, unsigned char p_card);
861 static void FPT_BusMasterInit(u32 p_port);
862 static void FPT_DiagEEPROM(u32 p_port);
874 static unsigned char FPT_SccbMgr_bad_isr(u32 p_port,
888 static int FPT_scarb(u32 p_port, unsigned char p_sel_type);
889 static void FPT_scbusf(u32 p_port);
890 static void FPT_scsel(u32 p_port);
891 static void FPT_scasid(unsigned char p_card, u32 p_port);
892 static unsigned char FPT_scxferc(u32 p_port, unsigned char p_data);
893 static unsigned char FPT_scsendi(u32 p_port,
895 static unsigned char FPT_sciso(u32 p_port,
897 static void FPT_scwirod(u32 p_port, unsigned char p_data_bit);
898 static void FPT_scwiros(u32 p_port, unsigned char p_data_bit);
900 static unsigned char FPT_scsell(u32 p_port, unsigned char targ_id);
901 static void FPT_scwtsel(u32 p_port);
902 static void FPT_inisci(unsigned char p_card, u32 p_port,
904 static void FPT_scsavdi(unsigned char p_card, u32 p_port);
908 static void FPT_autoCmdCmplt(u32 p_port, unsigned char p_card);
909 static void FPT_autoLoadDefaultMap(u32 p_port);
1989 static unsigned char FPT_SccbMgr_bad_isr(u32 p_port, unsigned char p_card, in FPT_SccbMgr_bad_isr() argument
1997 if (RD_HARPOON(p_port + hp_ext_status) & in FPT_SccbMgr_bad_isr()
2002 FPT_hostDataXferAbort(p_port, p_card, in FPT_SccbMgr_bad_isr()
2006 if (RD_HARPOON(p_port + hp_pci_stat_cfg) & REC_MASTER_ABORT) in FPT_SccbMgr_bad_isr()
2008 WR_HARPOON(p_port + hp_pci_stat_cfg, in FPT_SccbMgr_bad_isr()
2009 (RD_HARPOON(p_port + hp_pci_stat_cfg) & in FPT_SccbMgr_bad_isr()
2012 WR_HARPOON(p_port + hp_host_blk_cnt, 0x00); in FPT_SccbMgr_bad_isr()
2022 FPT_sxfrp(p_port, p_card); in FPT_SccbMgr_bad_isr()
2024 temp = (unsigned char)(RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_SccbMgr_bad_isr()
2026 WR_HARPOON(p_port + hp_ee_ctrl, in FPT_SccbMgr_bad_isr()
2028 WR_HARPOON(p_port + hp_ee_ctrl, temp); in FPT_SccbMgr_bad_isr()
2031 (RDW_HARPOON((p_port + hp_intstat)) & in FPT_SccbMgr_bad_isr()
2033 FPT_phaseDecode(p_port, p_card); in FPT_SccbMgr_bad_isr()
2040 WR_HARPOON(p_port + hp_clkctrl_0, CLKCTRL_DEFAULT); in FPT_SccbMgr_bad_isr()
2041 WR_HARPOON(p_port + hp_sys_ctrl, 0x00); in FPT_SccbMgr_bad_isr()
2046 FPT_hostDataXferAbort(p_port, p_card, in FPT_SccbMgr_bad_isr()
2050 DISABLE_AUTO(p_port); in FPT_SccbMgr_bad_isr()
2052 FPT_sresb(p_port, p_card); in FPT_SccbMgr_bad_isr()
2054 while (RD_HARPOON(p_port + hp_scsictrl_0) & SCSI_RST) { in FPT_SccbMgr_bad_isr()
2062 (unsigned char)FPT_utilEERead(p_port, in FPT_SccbMgr_bad_isr()
2066 FPT_XbowInit(p_port, ScamFlg); in FPT_SccbMgr_bad_isr()
2075 WRW_HARPOON((p_port + hp_intstat), FIFO); in FPT_SccbMgr_bad_isr()
2078 FPT_sxfrp(p_port, p_card); in FPT_SccbMgr_bad_isr()
2083 DISABLE_AUTO(p_port); in FPT_SccbMgr_bad_isr()
2085 WRW_HARPOON((p_port + hp_intstat), in FPT_SccbMgr_bad_isr()
2110 FPT_sssyncv(p_port, pCurrCard->currentSCCB->TargID, NARROW_SCSI, in FPT_SccbMgr_bad_isr()
2119 FPT_scarb(p_port, LEVEL2_TAR); in FPT_SccbMgr_bad_isr()
2120 FPT_scsel(p_port); in FPT_SccbMgr_bad_isr()
2121 FPT_scasid(p_card, p_port); in FPT_SccbMgr_bad_isr()
2123 FPT_scbusf(p_port); in FPT_SccbMgr_bad_isr()
2125 WRW_HARPOON((p_port + hp_intstat), SCAM_SEL); in FPT_SccbMgr_bad_isr()
3528 static void FPT_sssyncv(u32 p_port, unsigned char p_id, in FPT_sssyncv() argument
3588 WR_HARPOON(p_port + hp_synctarg_base + index, p_sync_value); in FPT_sssyncv()
3717 static void FPT_sxfrp(u32 p_port, unsigned char p_card) in FPT_sxfrp() argument
3721 DISABLE_AUTO(p_port); in FPT_sxfrp()
3725 FPT_hostDataXferAbort(p_port, p_card, in FPT_sxfrp()
3733 if (RDW_HARPOON((p_port + hp_intstat)) & in FPT_sxfrp()
3737 WR_HARPOON(p_port + hp_xfercnt_0, 0x00); in FPT_sxfrp()
3739 curr_phz = RD_HARPOON(p_port + hp_scsisig) & (unsigned char)S_SCSI_PHZ; in FPT_sxfrp()
3741 WRW_HARPOON((p_port + hp_intstat), XFER_CNT_0); in FPT_sxfrp()
3743 WR_HARPOON(p_port + hp_scsisig, curr_phz); in FPT_sxfrp()
3745 while (!(RDW_HARPOON((p_port + hp_intstat)) & (BUS_FREE | RESET)) && in FPT_sxfrp()
3747 (RD_HARPOON(p_port + hp_scsisig) & (unsigned char)S_SCSI_PHZ))) in FPT_sxfrp()
3750 WR_HARPOON(p_port + hp_portctrl_0, in FPT_sxfrp()
3753 if (!(RD_HARPOON(p_port + hp_xferstat) & FIFO_EMPTY)) { in FPT_sxfrp()
3754 RD_HARPOON(p_port + hp_fifodata_0); in FPT_sxfrp()
3757 WR_HARPOON(p_port + hp_portctrl_0, in FPT_sxfrp()
3759 if (RD_HARPOON(p_port + hp_xferstat) & FIFO_EMPTY) { in FPT_sxfrp()
3760 WR_HARPOON(p_port + hp_fifodata_0, 0xFA); in FPT_sxfrp()
3765 while (!(RDW_HARPOON((p_port + hp_intstat)) & (BUS_FREE | RESET))) { in FPT_sxfrp()
3766 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_REQ) in FPT_sxfrp()
3770 WR_HARPOON(p_port + hp_portctrl_0, in FPT_sxfrp()
3772 while (!(RD_HARPOON(p_port + hp_xferstat) & FIFO_EMPTY)) { in FPT_sxfrp()
3773 RD_HARPOON(p_port + hp_fifodata_0); in FPT_sxfrp()
3776 if (!(RDW_HARPOON((p_port + hp_intstat)) & (BUS_FREE | RESET))) { in FPT_sxfrp()
3777 WR_HARPOON(p_port + hp_autostart_0, in FPT_sxfrp()
3779 while (!(RDW_HARPOON((p_port + hp_intstat)) & AUTO_INT)) { in FPT_sxfrp()
3782 if (RDW_HARPOON((p_port + hp_intstat)) & in FPT_sxfrp()
3785 (RDW_HARPOON((p_port + hp_intstat)) & in FPT_sxfrp()
3978 static void FPT_phaseDecode(u32 p_port, unsigned char p_card) in FPT_phaseDecode() argument
3983 DISABLE_AUTO(p_port); in FPT_phaseDecode()
3986 (unsigned char)(RD_HARPOON(p_port + hp_scsisig) & S_SCSI_PHZ); in FPT_phaseDecode()
3990 (*phase) (p_port, p_card); /* Call the correct phase func */ in FPT_phaseDecode()
4086 static void FPT_phaseCommand(u32 p_port, unsigned char p_card) in FPT_phaseCommand() argument
4100 WR_HARPOON(p_port + hp_scsisig, 0x00); in FPT_phaseCommand()
4102 ARAM_ACCESS(p_port); in FPT_phaseCommand()
4104 cdb_reg = p_port + CMD_STRT; in FPT_phaseCommand()
4121 WR_HARPOON(p_port + hp_portctrl_0, (SCSI_PORT)); in FPT_phaseCommand()
4125 WR_HARPOON(p_port + hp_autostart_3, (AUTO_IMMED | CMD_ONLY_STRT)); in FPT_phaseCommand()
4126 SGRAM_ACCESS(p_port); in FPT_phaseCommand()
4537 static void FPT_autoLoadDefaultMap(u32 p_port) in FPT_autoLoadDefaultMap() argument
4541 ARAM_ACCESS(p_port); in FPT_autoLoadDefaultMap()
4542 map_addr = p_port + hp_aramBase; in FPT_autoLoadDefaultMap()
4631 SGRAM_ACCESS(p_port); in FPT_autoLoadDefaultMap()
4643 static void FPT_autoCmdCmplt(u32 p_port, unsigned char p_card) in FPT_autoCmdCmplt() argument
4650 status_byte = RD_HARPOON(p_port + hp_gp_reg_0); in FPT_autoCmdCmplt()
4949 static void FPT_busMstrSGDataXferStart(u32 p_port, struct sccb *pcurrSCCB) in FPT_busMstrSGDataXferStart() argument
4967 i = (unsigned char)(RD_HARPOON(p_port + hp_page_ctrl) & in FPT_busMstrSGDataXferStart()
4970 WR_HARPOON(p_port + hp_page_ctrl, i); in FPT_busMstrSGDataXferStart()
4990 WR_HARP32(p_port, reg_offset, addr); in FPT_busMstrSGDataXferStart()
4993 WR_HARP32(p_port, reg_offset, count); in FPT_busMstrSGDataXferStart()
5004 WR_HARPOON(p_port + hp_sg_addr, (sg_count << 4)); in FPT_busMstrSGDataXferStart()
5008 WR_HARP32(p_port, hp_xfercnt_0, tmpSGCnt); in FPT_busMstrSGDataXferStart()
5010 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrSGDataXferStart()
5012 WR_HARPOON(p_port + hp_scsisig, S_DATAI_PH); in FPT_busMstrSGDataXferStart()
5017 if ((!(RD_HARPOON(p_port + hp_synctarg_0) & NARROW_SCSI)) && in FPT_busMstrSGDataXferStart()
5024 WR_HARP32(p_port, hp_xfercnt_0, tmpSGCnt); in FPT_busMstrSGDataXferStart()
5026 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrSGDataXferStart()
5028 WR_HARPOON(p_port + hp_scsisig, S_DATAO_PH); in FPT_busMstrSGDataXferStart()
5031 WR_HARPOON(p_port + hp_page_ctrl, (unsigned char)(i | SCATTER_EN)); in FPT_busMstrSGDataXferStart()
5042 static void FPT_busMstrDataXferStart(u32 p_port, struct sccb *pcurrSCCB) in FPT_busMstrDataXferStart() argument
5059 HP_SETUP_ADDR_CNT(p_port, addr, count); in FPT_busMstrDataXferStart()
5063 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrDataXferStart()
5065 WR_HARPOON(p_port + hp_scsisig, S_DATAI_PH); in FPT_busMstrDataXferStart()
5067 WR_HARPOON(p_port + hp_xfer_cmd, in FPT_busMstrDataXferStart()
5073 WR_HARPOON(p_port + hp_portctrl_0, in FPT_busMstrDataXferStart()
5075 WR_HARPOON(p_port + hp_scsisig, S_DATAO_PH); in FPT_busMstrDataXferStart()
5077 WR_HARPOON(p_port + hp_xfer_cmd, in FPT_busMstrDataXferStart()
5095 static unsigned char FPT_busMstrTimeOut(u32 p_port) in FPT_busMstrTimeOut() argument
5101 WR_HARPOON(p_port + hp_sys_ctrl, HALT_MACH); in FPT_busMstrTimeOut()
5103 while ((!(RD_HARPOON(p_port + hp_ext_status) & CMD_ABORTED)) in FPT_busMstrTimeOut()
5107 if (RD_HARPOON(p_port + hp_ext_status) & BM_CMD_BUSY) { in FPT_busMstrTimeOut()
5108 WR_HARPOON(p_port + hp_sys_ctrl, HARD_ABORT); in FPT_busMstrTimeOut()
5111 while ((RD_HARPOON(p_port + hp_ext_status) & BM_CMD_BUSY) in FPT_busMstrTimeOut()
5116 RD_HARPOON(p_port + hp_int_status); /*Clear command complete */ in FPT_busMstrTimeOut()
5118 if (RD_HARPOON(p_port + hp_ext_status) & BM_CMD_BUSY) { in FPT_busMstrTimeOut()
5458 u32 p_port; in FPT_scini() local
5465 p_port = currCard->ioPort; in FPT_scini()
5473 (unsigned char)FPT_utilEERead(p_port, SCAM_CONFIG / 2); in FPT_scini()
5475 char)(FPT_utilEERead(p_port, (SYSTEM_CONFIG / 2))); in FPT_scini()
5480 FPT_inisci(p_card, p_port, p_our_id); in FPT_scini()
5490 FPT_Wait1Second(p_port); in FPT_scini()
5493 while (!(FPT_scarb(p_port, INIT_SELTD))) { in FPT_scini()
5496 FPT_scsel(p_port); in FPT_scini()
5499 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scini()
5500 FPT_scxferc(p_port, DOM_MSTR); in FPT_scini()
5502 FPT_scsendi(p_port, in FPT_scini()
5506 FPT_scbusf(p_port); in FPT_scini()
5509 FPT_sresb(p_port, p_card); in FPT_scini()
5510 FPT_Wait(p_port, TO_250ms); in FPT_scini()
5512 while (!(FPT_scarb(p_port, INIT_SELTD))) { in FPT_scini()
5515 FPT_scsel(p_port); in FPT_scini()
5518 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scini()
5519 FPT_scxferc(p_port, DOM_MSTR); in FPT_scini()
5521 FPT_scsendi(p_port, in FPT_scini()
5526 FPT_scbusf(p_port); in FPT_scini()
5543 if (FPT_scsell(p_port, i)) { in FPT_scini()
5564 FPT_sresb(p_port, p_card); in FPT_scini()
5565 FPT_Wait1Second(p_port); in FPT_scini()
5566 while (!(FPT_scarb(p_port, INIT_SELTD))) { in FPT_scini()
5568 FPT_scsel(p_port); in FPT_scini()
5569 FPT_scasid(p_card, p_port); in FPT_scini()
5577 FPT_scwtsel(p_port); in FPT_scini()
5580 while (FPT_scxferc(p_port, 0x00) != SYNC_PTRN) { in FPT_scini()
5583 i = FPT_scxferc(p_port, 0x00); in FPT_scini()
5587 (p_port, in FPT_scini()
5589 i = FPT_scxferc(p_port, 0x00); in FPT_scini()
5591 k = FPT_scxferc(p_port, 0x00); in FPT_scini()
5604 p_port, in FPT_scini()
5620 if (!(FPT_scsendi(p_port, in FPT_scini()
5628 while (FPT_scxferc(p_port, 0x00) != CFG_CMPLT) { in FPT_scini()
5633 FPT_scbusf(p_port); in FPT_scini()
5635 FPT_scsavdi(p_card, p_port); in FPT_scini()
5663 static int FPT_scarb(u32 p_port, unsigned char p_sel_type) in FPT_scarb() argument
5667 while (RD_HARPOON(p_port + hp_scsisig) & (SCSI_SEL | SCSI_BSY)) { in FPT_scarb()
5670 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_SEL) in FPT_scarb()
5673 if (RD_HARPOON(p_port + hp_scsidata_0) != 00) in FPT_scarb()
5676 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5677 (RD_HARPOON(p_port + hp_scsisig) | SCSI_BSY)); in FPT_scarb()
5679 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_SEL) { in FPT_scarb()
5681 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5682 (RD_HARPOON(p_port + hp_scsisig) & in FPT_scarb()
5687 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5688 (RD_HARPOON(p_port + hp_scsisig) | SCSI_SEL)); in FPT_scarb()
5690 if (RD_HARPOON(p_port + hp_scsidata_0) != 00) { in FPT_scarb()
5692 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5693 (RD_HARPOON(p_port + hp_scsisig) & in FPT_scarb()
5699 WR_HARPOON(p_port + hp_clkctrl_0, (RD_HARPOON(p_port + hp_clkctrl_0) in FPT_scarb()
5701 WR_HARPOON(p_port + hp_scsireset, SCAM_EN); in FPT_scarb()
5702 WR_HARPOON(p_port + hp_scsidata_0, 0x00); in FPT_scarb()
5703 WR_HARPOON(p_port + hp_scsidata_1, 0x00); in FPT_scarb()
5704 WR_HARPOON(p_port + hp_portctrl_0, SCSI_BUS_EN); in FPT_scarb()
5706 WR_HARPOON(p_port + hp_scsisig, in FPT_scarb()
5707 (RD_HARPOON(p_port + hp_scsisig) | SCSI_MSG)); in FPT_scarb()
5709 WR_HARPOON(p_port + hp_scsisig, (RD_HARPOON(p_port + hp_scsisig) in FPT_scarb()
5712 FPT_Wait(p_port, TO_250ms); in FPT_scarb()
5725 static void FPT_scbusf(u32 p_port) in FPT_scbusf() argument
5727 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scbusf()
5728 (RD_HARPOON(p_port + hp_page_ctrl) | G_INT_DISABLE)); in FPT_scbusf()
5730 WR_HARPOON(p_port + hp_scsidata_0, 0x00); in FPT_scbusf()
5732 WR_HARPOON(p_port + hp_portctrl_0, (RD_HARPOON(p_port + hp_portctrl_0) in FPT_scbusf()
5735 WR_HARPOON(p_port + hp_scsisig, 0x00); in FPT_scbusf()
5737 WR_HARPOON(p_port + hp_scsireset, (RD_HARPOON(p_port + hp_scsireset) in FPT_scbusf()
5740 WR_HARPOON(p_port + hp_clkctrl_0, (RD_HARPOON(p_port + hp_clkctrl_0) in FPT_scbusf()
5743 WRW_HARPOON((p_port + hp_intstat), (BUS_FREE | AUTO_INT | SCAM_SEL)); in FPT_scbusf()
5745 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scbusf()
5746 (RD_HARPOON(p_port + hp_page_ctrl) & ~G_INT_DISABLE)); in FPT_scbusf()
5757 static void FPT_scasid(unsigned char p_card, u32 p_port) in FPT_scasid() argument
5776 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scasid()
5777 FPT_scxferc(p_port, ASSIGN_ID); in FPT_scasid()
5779 if (!(FPT_sciso(p_port, &temp_id_string[0]))) { in FPT_scasid()
5793 FPT_scxferc(p_port, MISC_CODE); in FPT_scasid()
5794 FPT_scxferc(p_port, CLR_P_FLAG); in FPT_scasid()
5800 FPT_scxferc(p_port, ID_0_7); in FPT_scasid()
5802 FPT_scxferc(p_port, ID_8_F); in FPT_scasid()
5810 FPT_scxferc(p_port, scam_id); in FPT_scasid()
5822 FPT_scxferc(p_port, SYNC_PTRN); in FPT_scasid()
5823 FPT_scxferc(p_port, CFG_CMPLT); in FPT_scasid()
5834 static void FPT_scsel(u32 p_port) in FPT_scsel() argument
5837 WR_HARPOON(p_port + hp_scsisig, SCSI_SEL); in FPT_scsel()
5838 FPT_scwiros(p_port, SCSI_MSG); in FPT_scsel()
5840 WR_HARPOON(p_port + hp_scsisig, (SCSI_SEL | SCSI_BSY)); in FPT_scsel()
5842 WR_HARPOON(p_port + hp_scsisig, in FPT_scsel()
5844 WR_HARPOON(p_port + hp_scsidata_0, in FPT_scsel()
5845 (unsigned char)(RD_HARPOON(p_port + hp_scsidata_0) | in FPT_scsel()
5848 WR_HARPOON(p_port + hp_scsisig, (SCSI_BSY | SCSI_IOBIT | SCSI_CD)); in FPT_scsel()
5849 FPT_scwiros(p_port, SCSI_SEL); in FPT_scsel()
5851 WR_HARPOON(p_port + hp_scsidata_0, in FPT_scsel()
5852 (unsigned char)(RD_HARPOON(p_port + hp_scsidata_0) & in FPT_scsel()
5854 FPT_scwirod(p_port, BIT(6)); in FPT_scsel()
5856 WR_HARPOON(p_port + hp_scsisig, in FPT_scsel()
5868 static unsigned char FPT_scxferc(u32 p_port, unsigned char p_data) in FPT_scxferc() argument
5874 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5878 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5880 FPT_scwirod(p_port, BIT(7)); /*Wait for DB7 to be released. */ in FPT_scxferc()
5881 while (!(RD_HARPOON(p_port + hp_scsidata_0) & BIT(5))) ; in FPT_scxferc()
5883 ret_data = (RD_HARPOON(p_port + hp_scsidata_0) & (unsigned char)0x1F); in FPT_scxferc()
5887 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5891 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5893 FPT_scwirod(p_port, BIT(5)); /*Wait for DB5 to be released. */ in FPT_scxferc()
5898 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5902 WR_HARPOON(p_port + hp_scsidata_0, curr_data); in FPT_scxferc()
5904 FPT_scwirod(p_port, BIT(6)); /*Wait for DB6 to be released. */ in FPT_scxferc()
5918 static unsigned char FPT_scsendi(u32 p_port, unsigned char p_id_string[]) in FPT_scsendi() argument
5929 ret_data = FPT_scxferc(p_port, 00); in FPT_scsendi()
5933 ret_data = FPT_scxferc(p_port, 02); in FPT_scsendi()
5937 ret_data = FPT_scxferc(p_port, 01); in FPT_scsendi()
5969 static unsigned char FPT_sciso(u32 p_port, unsigned char p_id_string[]) in FPT_sciso() argument
5979 ret_data = FPT_scxferc(p_port, 0); in FPT_sciso()
6027 static void FPT_scwirod(u32 p_port, unsigned char p_data_bit) in FPT_scwirod() argument
6034 if (RD_HARPOON(p_port + hp_scsidata_0) & p_data_bit) in FPT_scwirod()
6054 static void FPT_scwiros(u32 p_port, unsigned char p_data_bit) in FPT_scwiros() argument
6061 if (RD_HARPOON(p_port + hp_scsisig) & p_data_bit) in FPT_scwiros()
6106 static unsigned char FPT_scsell(u32 p_port, unsigned char targ_id) in FPT_scsell() argument
6110 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scsell()
6111 (RD_HARPOON(p_port + hp_page_ctrl) | G_INT_DISABLE)); in FPT_scsell()
6113 ARAM_ACCESS(p_port); in FPT_scsell()
6115 WR_HARPOON(p_port + hp_addstat, in FPT_scsell()
6116 (RD_HARPOON(p_port + hp_addstat) | SCAM_TIMER)); in FPT_scsell()
6117 WR_HARPOON(p_port + hp_seltimeout, TO_4ms); in FPT_scsell()
6119 for (i = p_port + CMD_STRT; i < p_port + CMD_STRT + 12; i += 2) { in FPT_scsell()
6124 WRW_HARPOON((p_port + hp_intstat), in FPT_scsell()
6127 WR_HARPOON(p_port + hp_select_id, targ_id); in FPT_scsell()
6129 WR_HARPOON(p_port + hp_portctrl_0, SCSI_PORT); in FPT_scsell()
6130 WR_HARPOON(p_port + hp_autostart_3, (SELECT | CMD_ONLY_STRT)); in FPT_scsell()
6131 WR_HARPOON(p_port + hp_scsictrl_0, (SEL_TAR | ENA_RESEL)); in FPT_scsell()
6133 while (!(RDW_HARPOON((p_port + hp_intstat)) & in FPT_scsell()
6137 if (RDW_HARPOON((p_port + hp_intstat)) & RESET) in FPT_scsell()
6138 FPT_Wait(p_port, TO_250ms); in FPT_scsell()
6140 DISABLE_AUTO(p_port); in FPT_scsell()
6142 WR_HARPOON(p_port + hp_addstat, in FPT_scsell()
6143 (RD_HARPOON(p_port + hp_addstat) & ~SCAM_TIMER)); in FPT_scsell()
6144 WR_HARPOON(p_port + hp_seltimeout, TO_290ms); in FPT_scsell()
6146 SGRAM_ACCESS(p_port); in FPT_scsell()
6148 if (RDW_HARPOON((p_port + hp_intstat)) & (RESET | TIMEOUT)) { in FPT_scsell()
6150 WRW_HARPOON((p_port + hp_intstat), in FPT_scsell()
6153 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scsell()
6154 (RD_HARPOON(p_port + hp_page_ctrl) & in FPT_scsell()
6162 while (!(RDW_HARPOON((p_port + hp_intstat)) & BUS_FREE)) { in FPT_scsell()
6163 if (RD_HARPOON(p_port + hp_scsisig) & SCSI_REQ) { in FPT_scsell()
6164 WR_HARPOON(p_port + hp_scsisig, in FPT_scsell()
6166 ACCEPT_MSG(p_port); in FPT_scsell()
6170 WRW_HARPOON((p_port + hp_intstat), CLR_ALL_INT_1); in FPT_scsell()
6172 WR_HARPOON(p_port + hp_page_ctrl, in FPT_scsell()
6173 (RD_HARPOON(p_port + hp_page_ctrl) & in FPT_scsell()
6188 static void FPT_scwtsel(u32 p_port) in FPT_scwtsel() argument
6190 while (!(RDW_HARPOON((p_port + hp_intstat)) & SCAM_SEL)) { in FPT_scwtsel()
6202 static void FPT_inisci(unsigned char p_card, u32 p_port, unsigned char p_our_id) in FPT_inisci() argument
6210 if (RD_HARPOON(p_port + hp_page_ctrl) & NARROW_SCSI_CARD) in FPT_inisci()
6236 FPT_utilEERead(p_port, in FPT_inisci()
6388 static void FPT_scsavdi(unsigned char p_card, u32 p_port) in FPT_scsavdi() argument
6396 sum_data += FPT_utilEERead(p_port, i); in FPT_scsavdi()
6399 FPT_utilEEWriteOnOff(p_port, 1); /* Enable write access to the EEPROM */ in FPT_scsavdi()
6401 if (RD_HARPOON(p_port + hp_page_ctrl) & NARROW_SCSI_CARD) in FPT_scsavdi()
6414 FPT_utilEEWrite(p_port, ee_data, in FPT_scsavdi()
6421 FPT_utilEEWrite(p_port, sum_data, EEPROM_CHECK_SUM / 2); in FPT_scsavdi()
6422 FPT_utilEEWriteOnOff(p_port, 0); /* Turn off write access */ in FPT_scsavdi()
6482 static void FPT_BusMasterInit(u32 p_port) in FPT_BusMasterInit() argument
6485 WR_HARPOON(p_port + hp_sys_ctrl, DRVR_RST); in FPT_BusMasterInit()
6486 WR_HARPOON(p_port + hp_sys_ctrl, 0x00); in FPT_BusMasterInit()
6488 WR_HARPOON(p_port + hp_host_blk_cnt, XFER_BLK64); in FPT_BusMasterInit()
6490 WR_HARPOON(p_port + hp_bm_ctrl, (BMCTRL_DEFAULT)); in FPT_BusMasterInit()
6492 WR_HARPOON(p_port + hp_ee_ctrl, (SCSI_TERM_ENA_H)); in FPT_BusMasterInit()
6494 RD_HARPOON(p_port + hp_int_status); /*Clear interrupts. */ in FPT_BusMasterInit()
6495 WR_HARPOON(p_port + hp_int_mask, (INT_CMD_COMPL | SCSI_INTERRUPT)); in FPT_BusMasterInit()
6496 WR_HARPOON(p_port + hp_page_ctrl, (RD_HARPOON(p_port + hp_page_ctrl) & in FPT_BusMasterInit()
6509 static void FPT_DiagEEPROM(u32 p_port) in FPT_DiagEEPROM() argument
6513 if (RD_HARPOON(p_port + hp_page_ctrl) & NARROW_SCSI_CARD) in FPT_DiagEEPROM()
6518 temp = FPT_utilEERead(p_port, FW_SIGNATURE / 2); in FPT_DiagEEPROM()
6524 temp += FPT_utilEERead(p_port, index); in FPT_DiagEEPROM()
6528 if (temp == FPT_utilEERead(p_port, EEPROM_CHECK_SUM / 2)) { in FPT_DiagEEPROM()
6534 FPT_utilEEWriteOnOff(p_port, (unsigned char)1); in FPT_DiagEEPROM()
6538 FPT_utilEEWrite(p_port, 0x0000, index); in FPT_DiagEEPROM()
6543 FPT_utilEEWrite(p_port, 0x4641, FW_SIGNATURE / 2); in FPT_DiagEEPROM()
6545 FPT_utilEEWrite(p_port, 0x3920, MODEL_NUMB_0 / 2); in FPT_DiagEEPROM()
6547 FPT_utilEEWrite(p_port, 0x3033, MODEL_NUMB_2 / 2); in FPT_DiagEEPROM()
6549 FPT_utilEEWrite(p_port, 0x2020, MODEL_NUMB_4 / 2); in FPT_DiagEEPROM()
6551 FPT_utilEEWrite(p_port, 0x70D3, SYSTEM_CONFIG / 2); in FPT_DiagEEPROM()
6553 FPT_utilEEWrite(p_port, 0x0010, BIOS_CONFIG / 2); in FPT_DiagEEPROM()
6555 FPT_utilEEWrite(p_port, 0x0003, SCAM_CONFIG / 2); in FPT_DiagEEPROM()
6557 FPT_utilEEWrite(p_port, 0x0007, ADAPTER_SCSI_ID / 2); in FPT_DiagEEPROM()
6560 FPT_utilEEWrite(p_port, 0x0000, IGNORE_B_SCAN / 2); in FPT_DiagEEPROM()
6562 FPT_utilEEWrite(p_port, 0x0000, SEND_START_ENA / 2); in FPT_DiagEEPROM()
6564 FPT_utilEEWrite(p_port, 0x0000, DEVICE_ENABLE / 2); in FPT_DiagEEPROM()
6567 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL01 / 2); in FPT_DiagEEPROM()
6569 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL23 / 2); in FPT_DiagEEPROM()
6571 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL45 / 2); in FPT_DiagEEPROM()
6573 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL67 / 2); in FPT_DiagEEPROM()
6575 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBL89 / 2); in FPT_DiagEEPROM()
6577 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLab / 2); in FPT_DiagEEPROM()
6579 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLcd / 2); in FPT_DiagEEPROM()
6581 FPT_utilEEWrite(p_port, 0x4242, SYNC_RATE_TBLef / 2); in FPT_DiagEEPROM()
6584 FPT_utilEEWrite(p_port, 0x6C46, 64 / 2); /*PRODUCT ID */ in FPT_DiagEEPROM()
6586 FPT_utilEEWrite(p_port, 0x7361, 66 / 2); /* FlashPoint LT */ in FPT_DiagEEPROM()
6588 FPT_utilEEWrite(p_port, 0x5068, 68 / 2); in FPT_DiagEEPROM()
6590 FPT_utilEEWrite(p_port, 0x696F, 70 / 2); in FPT_DiagEEPROM()
6592 FPT_utilEEWrite(p_port, 0x746E, 72 / 2); in FPT_DiagEEPROM()
6594 FPT_utilEEWrite(p_port, 0x4C20, 74 / 2); in FPT_DiagEEPROM()
6596 FPT_utilEEWrite(p_port, 0x2054, 76 / 2); in FPT_DiagEEPROM()
6598 FPT_utilEEWrite(p_port, 0x2020, 78 / 2); in FPT_DiagEEPROM()
6602 FPT_utilEEWrite(p_port, (0x0700 + TYPE_CODE0), index); in FPT_DiagEEPROM()
6605 FPT_utilEEWrite(p_port, 0x5542, index); /*Vendor ID code */ in FPT_DiagEEPROM()
6608 FPT_utilEEWrite(p_port, 0x4C53, index); in FPT_DiagEEPROM()
6611 FPT_utilEEWrite(p_port, 0x474F, index); in FPT_DiagEEPROM()
6614 FPT_utilEEWrite(p_port, 0x4349, index); in FPT_DiagEEPROM()
6617 FPT_utilEEWrite(p_port, 0x5442, index); /*Vendor unique code */ in FPT_DiagEEPROM()
6620 FPT_utilEEWrite(p_port, 0x202D, index); in FPT_DiagEEPROM()
6623 FPT_utilEEWrite(p_port, 0x3339, index); in FPT_DiagEEPROM()
6626 FPT_utilEEWrite(p_port, 0x2030, index); /* 01234567 */ in FPT_DiagEEPROM()
6629 FPT_utilEEWrite(p_port, 0x5453, index); in FPT_DiagEEPROM()
6632 FPT_utilEEWrite(p_port, 0x5645, index); in FPT_DiagEEPROM()
6635 FPT_utilEEWrite(p_port, 0x2045, index); in FPT_DiagEEPROM()
6638 FPT_utilEEWrite(p_port, 0x202F, index); in FPT_DiagEEPROM()
6641 FPT_utilEEWrite(p_port, 0x4F4A, index); in FPT_DiagEEPROM()
6644 FPT_utilEEWrite(p_port, 0x204E, index); in FPT_DiagEEPROM()
6647 FPT_utilEEWrite(p_port, 0x3539, index); in FPT_DiagEEPROM()
6650 FPT_utilEEWrite(p_port, temp, EEPROM_CHECK_SUM / 2); in FPT_DiagEEPROM()
6652 FPT_utilEEWriteOnOff(p_port, (unsigned char)0); in FPT_DiagEEPROM()
7202 static void FPT_Wait1Second(u32 p_port) in FPT_Wait1Second() argument
7208 FPT_Wait(p_port, TO_250ms); in FPT_Wait1Second()
7210 if ((RD_HARPOON(p_port + hp_scsictrl_0) & SCSI_RST)) in FPT_Wait1Second()
7213 if ((RDW_HARPOON((p_port + hp_intstat)) & SCAM_SEL)) in FPT_Wait1Second()
7226 static void FPT_Wait(u32 p_port, unsigned char p_delay) in FPT_Wait() argument
7231 old_timer = RD_HARPOON(p_port + hp_seltimeout); in FPT_Wait()
7233 green_flag = RD_HARPOON(p_port + hp_clkctrl_0); in FPT_Wait()
7234 WR_HARPOON(p_port + hp_clkctrl_0, CLKCTRL_DEFAULT); in FPT_Wait()
7236 WR_HARPOON(p_port + hp_seltimeout, p_delay); in FPT_Wait()
7237 WRW_HARPOON((p_port + hp_intstat), TIMEOUT); in FPT_Wait()
7238 WRW_HARPOON((p_port + hp_intena), (FPT_default_intena & ~TIMEOUT)); in FPT_Wait()
7240 WR_HARPOON(p_port + hp_portctrl_0, in FPT_Wait()
7241 (RD_HARPOON(p_port + hp_portctrl_0) | START_TO)); in FPT_Wait()
7243 while (!(RDW_HARPOON((p_port + hp_intstat)) & TIMEOUT)) { in FPT_Wait()
7245 if ((RD_HARPOON(p_port + hp_scsictrl_0) & SCSI_RST)) in FPT_Wait()
7248 if ((RDW_HARPOON((p_port + hp_intstat)) & SCAM_SEL)) in FPT_Wait()
7252 WR_HARPOON(p_port + hp_portctrl_0, in FPT_Wait()
7253 (RD_HARPOON(p_port + hp_portctrl_0) & ~START_TO)); in FPT_Wait()
7255 WRW_HARPOON((p_port + hp_intstat), TIMEOUT); in FPT_Wait()
7256 WRW_HARPOON((p_port + hp_intena), FPT_default_intena); in FPT_Wait()
7258 WR_HARPOON(p_port + hp_clkctrl_0, green_flag); in FPT_Wait()
7260 WR_HARPOON(p_port + hp_seltimeout, old_timer); in FPT_Wait()
7272 static void FPT_utilEEWriteOnOff(u32 p_port, unsigned char p_mode) in FPT_utilEEWriteOnOff() argument
7277 (unsigned char)(RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_utilEEWriteOnOff()
7282 FPT_utilEESendCmdAddr(p_port, EWEN, EWEN_ADDR); in FPT_utilEEWriteOnOff()
7286 FPT_utilEESendCmdAddr(p_port, EWDS, EWDS_ADDR); in FPT_utilEEWriteOnOff()
7288 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); /*Turn off CS */ in FPT_utilEEWriteOnOff()
7289 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); /*Turn off Master Select */ in FPT_utilEEWriteOnOff()
7301 static void FPT_utilEEWrite(u32 p_port, unsigned short ee_data, in FPT_utilEEWrite() argument
7310 char)((RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_utilEEWrite()
7313 FPT_utilEESendCmdAddr(p_port, EE_WRITE, ee_addr); in FPT_utilEEWrite()
7324 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7325 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7327 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7328 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7330 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7331 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEWrite()
7334 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); in FPT_utilEEWrite()
7336 FPT_Wait(p_port, TO_10ms); in FPT_utilEEWrite()
7338 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS | SEE_CS)); /* Set CS to EEPROM */ in FPT_utilEEWrite()
7339 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); /* Turn off CS */ in FPT_utilEEWrite()
7340 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); /* Turn off Master Select */ in FPT_utilEEWrite()
7352 static unsigned short FPT_utilEERead(u32 p_port, in FPT_utilEERead() argument
7358 ee_data1 = FPT_utilEEReadOrg(p_port, ee_addr); in FPT_utilEERead()
7360 ee_data2 = FPT_utilEEReadOrg(p_port, ee_addr); in FPT_utilEERead()
7382 static unsigned short FPT_utilEEReadOrg(u32 p_port, unsigned short ee_addr) in FPT_utilEEReadOrg() argument
7390 char)((RD_HARPOON(p_port + hp_ee_ctrl) & in FPT_utilEEReadOrg()
7393 FPT_utilEESendCmdAddr(p_port, EE_READ, ee_addr); in FPT_utilEEReadOrg()
7401 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7402 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7404 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7405 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEEReadOrg()
7409 if (RD_HARPOON(p_port + hp_ee_ctrl) & SEE_DI) in FPT_utilEEReadOrg()
7414 WR_HARPOON(p_port + hp_ee_ctrl, (ee_value | SEE_MS)); /*Turn off CS */ in FPT_utilEEReadOrg()
7415 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); /*Turn off Master Select */ in FPT_utilEEReadOrg()
7429 static void FPT_utilEESendCmdAddr(u32 p_port, unsigned char ee_cmd, in FPT_utilEESendCmdAddr() argument
7438 (unsigned char)(RD_HARPOON(p_port + hp_page_ctrl) & in FPT_utilEESendCmdAddr()
7442 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7445 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7454 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()
7457 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7458 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7460 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7461 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7477 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7478 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7480 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7481 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7483 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()
7484 WR_HARPOON(p_port + hp_ee_ctrl, ee_value); in FPT_utilEESendCmdAddr()