···3333 u32 reg;3434 struct mvs_phy *phy = &mvi->phy[i];35353636- /* TODO check & save device type */3736 reg = mr32(MVS_GBL_PORT_TYPE);3837 phy->phy_type &= ~(PORT_TYPE_SAS | PORT_TYPE_SATA);3938 if (reg & MODE_SAS_SATA & (1 << i))···6263 mvs_phy_hacks(mvi);63646465 if (!(mvi->flags & MVF_FLAG_SOC)) {6565- /* TEST - for phy decoding error, adjust voltage levels */6666 for (i = 0; i < MVS_SOC_PORTS; i++) {6767 mvs_write_port_vsr_addr(mvi, i, VSR_PHY_MODE8);6868 mvs_write_port_vsr_data(mvi, i, 0x2F0);···373375 mvs_update_phyinfo(mvi, i, 1);374376 }375377376376- /* FIXME: update wide port bitmaps */377377-378378 /* little endian for open address and command table, etc. */379379- /*380380- * it seems that ( from the spec ) turning on big-endian won't381381- * do us any good on big-endian machines, need further confirmation382382- */383379 cctl = mr32(MVS_CTL);384380 cctl |= CCTL_ENDIAN_CMD;385381 cctl |= CCTL_ENDIAN_DATA;···386394 tmp |= PCS_CMD_RST;387395 tmp &= ~PCS_SELF_CLEAR;388396 mw32(MVS_PCS, tmp);389389- /* interrupt coalescing may cause missing HW interrput in some case,390390- * and the max count is 0x1ff, while our max slot is 0x200,397397+ /*398398+ * the max count is 0x1ff, while our max slot is 0x200,391399 * it will make count 0.392400 */393401 tmp = 0;···624632{625633 u32 tmp;626634 struct mvs_phy *phy = &mvi->phy[i];627627- /* workaround for HW phy decoding error on 1.5g disk drive */628635 mvs_write_port_vsr_addr(mvi, i, VSR_PHY_MODE6);629636 tmp = mvs_read_port_vsr_data(mvi, i);630637 if (((phy->phy_status & PHY_NEG_SPP_PHYS_LINK_RATE_MASK) >>···756765{757766 void __iomem *regs = mvi->regs;758767 u32 tmp = 0;759759- /* interrupt coalescing may cause missing HW interrput in some case,760760- * and the max count is 0x1ff, while our max slot is 0x200,768768+ /*769769+ * the max count is 0x1ff, while our max slot is 0x200,761770 * it will make count 0.762771 */763772 if (time == 0) {
+6-13
drivers/scsi/mvsas/mv_94xx.c
···460460 mvs_update_phyinfo(mvi, i, 1);461461 }462462463463- /* FIXME: update wide port bitmaps */464464-465463 /* little endian for open address and command table, etc. */466466- /*467467- * it seems that ( from the spec ) turning on big-endian won't468468- * do us any good on big-endian machines, need further confirmation469469- */470464 cctl = mr32(MVS_CTL);471465 cctl |= CCTL_ENDIAN_CMD;472466 cctl &= ~CCTL_ENDIAN_OPEN;···472478 tmp |= PCS_CMD_RST;473479 tmp &= ~PCS_SELF_CLEAR;474480 mw32(MVS_PCS, tmp);475475- /* interrupt coalescing may cause missing HW interrput in some case,476476- * and the max count is 0x1ff, while our max slot is 0x200,481481+ /*482482+ * the max count is 0x1ff, while our max slot is 0x200,477483 * it will make count 0.478484 */479485 tmp = 0;···482488 else483489 mw32(MVS_INT_COAL, MVS_CHIP_SLOT_SZ | COAL_EN);484490491491+ /* default interrupt coalescing time is 128us */485492 tmp = 0x10000 | interrupt_coalescing;486493 mw32(MVS_INT_COAL_TMOUT, tmp);487494···740745{741746 u32 phy_st;742747 phy_st = mvs_read_phy_ctl(mvi, i);743743- if (phy_st & PHY_READY_MASK) /* phy ready */748748+ if (phy_st & PHY_READY_MASK)744749 return 1;745750 return 0;746751}···765770 int i;766771 u32 id_frame[7];767772768768- /* mvs_hexdump(28, (u8 *)id_frame, 0); */769773 for (i = 0; i < 7; i++) {770774 mvs_write_port_cfg_addr(mvi, port_id,771775 CONFIG_ATT_ID_FRAME0 + i * 4);···772778 mv_dprintk("94xx phy %d atta frame %d %x.\n",773779 port_id + mvi->id * mvi->chip->n_phy, i, id_frame[i]);774780 }775775- /* mvs_hexdump(28, (u8 *)id_frame, 0); */776781 memcpy(id, id_frame, 28);777782}778783···955962{956963 void __iomem *regs = mvi->regs;957964 u32 tmp = 0;958958- /* interrupt coalescing may cause missing HW interrput in some case,959959- * and the max count is 0x1ff, while our max slot is 0x200,965965+ /*966966+ * the max count is 0x1ff, while our max slot is 0x200,960967 * it will make count 0.961968 */962969 if (time == 0) {
···164164{165165 u32 tmp;166166167167- /* workaround for SATA R-ERR, to ignore phy glitch */168167 tmp = mvs_cr32(mvi, CMD_PHY_TIMER);169168 tmp &= ~(1 << 9);170169 tmp |= (1 << 10);···178179 tmp |= 0x3fff;179180 mvs_cw32(mvi, CMD_SAS_CTL0, tmp);180181181181- /* workaround for WDTIMEOUT , set to 550 ms */182182 mvs_cw32(mvi, CMD_WD_TIMER, 0x7a0000);183183184184 /* not to halt for different port op during wideport link change */
···102102103103}104104105105-/* FIXME */106105int mvs_find_dev_phyno(struct domain_device *dev, int *phyno)107106{108107 unsigned long i = 0, j = 0, n = 0, num = 0;···176177 }177178}178179179179-/* FIXME: locking? */180180int mvs_phy_control(struct asd_sas_phy *sas_phy, enum phy_func func,181181 void *funcdata)182182{···502504 flags |= MCH_ATAPI;503505 }504506505505- /* FIXME: fill in port multiplier number */506506-507507 hdr->flags = cpu_to_le32(flags);508508509509- /* FIXME: the low order order 5 bits for the TAG if enable NCQ */510509 if (task->ata_task.use_ncq && mvs_get_ncq_tag(task, &hdr_tag))511510 task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3);512511 else···547552 buf_tmp_dma += i;548553549554 /* region 4: status buffer (larger the PRD, smaller this buf) ****** */550550- /* FIXME: probably unused, for SATA. kept here just in case551551- * we get a STP/SATA error information record552552- */553555 slot->response = buf_tmp;554556 hdr->status_buf = cpu_to_le64(buf_tmp_dma);555557 if (mvi->flags & MVF_FLAG_SOC)···11181126 MVS_CHIP_DISP->write_port_cfg_addr(mvi, i, PHYR_SATA_SIG0);11191127 s[0] = cpu_to_le32(MVS_CHIP_DISP->read_port_cfg_data(mvi, i));1120112811211121- /* Workaround: take some ATAPI devices for ATA */11221129 if (((s[1] & 0x00FFFFFF) == 0x00EB1401) && (*(u8 *)&s[3] == 0x01))11231130 s[1] = 0x00EB1401 | (*((u8 *)&s[1] + 3) & 0x10);11241131···14241433 complete(&task->completion);14251434}1426143514271427-/* XXX */14281436#define MVS_TASK_TIMEOUT 2014291437static int mvs_exec_internal_tmf_task(struct domain_device *dev,14301438 void *parameter, u32 para_len, struct mvs_tmf_task *tmf)···15671577 mv_printk("%s for device[%x]:rc= %d\n",15681578 __func__, mvi_dev->device_id, rc);1569157915701570- /* housekeeper */15711580 spin_lock_irqsave(&mvi->lock, flags);15721581 mvs_release_task(mvi, dev);15731582 spin_unlock_irqrestore(&mvi->lock, flags);···1670168116711682 } else if (task->task_proto & SAS_PROTOCOL_SATA ||16721683 task->task_proto & SAS_PROTOCOL_STP) {16731673- /* to do free register_set */16741684 if (SATA_DEV == dev->dev_type) {16751685 struct mvs_slot_info *slot = task->lldd_task;16761686 u32 slot_idx = (u32)(slot - mvi->slot_info);···18891901 return -1;18901902 }1891190319041904+ /* when no device attaching, go ahead and complete by error handling*/18921905 if (unlikely(!mvi_dev || flags)) {18931906 if (!mvi_dev)18941907 mv_dprintk("port has not device.\n");···20062017 struct domain_device *dev)20072018{20082019 int i, phyno[WIDE_PORT_MAX_PHY], num;20092009- /* housekeeper */20102020 num = mvs_find_dev_phyno(dev, phyno);20112021 for (i = 0; i < num; i++)20122022 mvs_do_release_task(mvi, phyno[i], dev);