Lines Matching +full:no +full:- +full:cs +full:- +full:readback
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
16 * - Redistributions of source code must retain the above
20 * - Redistributions in binary form must reproduce the above
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
117 * Below keeps track of whether the "once per power-on" initialization has
120 * state of the reset "pin", is no longer valid. Instead, we check for the
126 struct qib_devdata *dd = ppd->dd; in qib_ibsd_ucode_loaded()
128 if (!dd->cspec->serdes_first_init_done && in qib_ibsd_ucode_loaded()
130 dd->cspec->serdes_first_init_done = 1; in qib_ibsd_ucode_loaded()
131 return dd->cspec->serdes_first_init_done; in qib_ibsd_ucode_loaded()
147 /* clear, then re-enable parity errs */ in qib_sd7220_clr_ibpar()
168 * to be re-synchronized, between the host and the uC.
180 ret = -1; in qib_resync_ibepb()
199 qib_dev_err(dd, "Failed re-read in resync\n"); in qib_resync_ibepb()
239 spin_lock_irqsave(&dd->cspec->sdepb_lock, flags); in qib_ibsd_reset()
244 dd->cspec->hwerrmask & in qib_ibsd_reset()
251 epb_access(dd, IB_7220_SERDES, -1); in qib_ibsd_reset()
252 spin_unlock_irqrestore(&dd->cspec->sdepb_lock, flags); in qib_ibsd_reset()
255 * Before we de-assert reset, we need to deal with in qib_ibsd_reset()
256 * possible glitch on the Parity-error line. in qib_ibsd_reset()
257 * Suppress it around the reset, both in chip-level in qib_ibsd_reset()
265 dd->cspec->hwerrmask & in qib_ibsd_reset()
270 qib_dev_err(dd, "unable to re-sync IB EPB\n"); in qib_ibsd_reset()
287 /* clear, then re-enable parity errs */ in qib_ibsd_reset()
292 dd->cspec->hwerrmask &= in qib_ibsd_reset()
296 dd->cspec->hwerrmask); in qib_ibsd_reset()
317 qib_dev_err(dd, "not able to re-sync IB EPB (%s)\n", where); in qib_sd_trimdone_monitor()
324 /* Check/show "summary" Trim-done bit in IBCStatus */ in qib_sd_trimdone_monitor()
341 for (chn = 3; chn >= 0; --chn) { in qib_sd_trimdone_monitor()
363 qib_dev_err(dd, "re-read: %d (%02X)\n", in qib_sd_trimdone_monitor()
372 for (chn = 3; chn >= 0; --chn) { in qib_sd_trimdone_monitor()
382 "Failed re-setting TRIMDONE, chn %d (%s)\n", in qib_sd_trimdone_monitor()
389 * Below is portion of IBA7220-specific bringup_serdes() that actually
392 * informative, so we double-check.
405 qib_sd_trimdone_monitor(dd, "Driver-reload"); in qib_sd7220_init()
408 ret = request_firmware(&fw, SD7220_FW_NAME, &dd->pcidev->dev); in qib_sd7220_init()
415 ret = qib_ibsd_ucode_loaded(dd->pport, fw); in qib_sd7220_init()
421 * Alter some regs per vendor latest doc, reset-defaults in qib_sd7220_init()
445 * and "trimdone monitor" that might be counter-productive. in qib_sd7220_init()
484 * De-assert RESET to uC, only in first reset, to allow in qib_sd7220_init()
505 * IBC state-machine. in qib_sd7220_init()
510 qib_dev_err(dd, "No TRIMDONE seen\n"); in qib_sd7220_init()
515 * gotten cleared, and re-set them. in qib_sd7220_init()
517 qib_sd_trimdone_monitor(dd, "First-reset"); in qib_sd7220_init()
518 /* Remember so we do not re-do the load, dactrim, etc. */ in qib_sd7220_init()
519 dd->cspec->serdes_first_init_done = 1; in qib_sd7220_init()
532 set_7220_relock_poll(dd, -1); in qib_sd7220_init()
572 oct_sel = (2 << (sdnum - PCIE_SERDES0)); in epb_access()
590 * The only writable bits are the request and CS. in epb_access()
601 owned = -1; in epb_access()
613 owned = -1; in epb_access()
630 for (tries = EPB_TRANS_TRIES; tries; --tries) { in epb_trans()
637 return -1; in epb_trans()
644 * qib_sd7220_reg_mod - modify SERDES register
647 * @loc: location - channel, element, register, as packed by EPB_LOC() macro.
648 * @wd: Write Data - value to set in register
651 * Basic register read/modify/write, with un-needed acesses elided. That is,
676 return -1; in qib_sd7220_reg_mod()
683 spin_lock_irqsave(&dd->cspec->sdepb_lock, flags); in qib_sd7220_reg_mod()
687 spin_unlock_irqrestore(&dd->cspec->sdepb_lock, flags); in qib_sd7220_reg_mod()
688 return -1; in qib_sd7220_reg_mod()
690 for (tries = EPB_TRANS_TRIES; tries; --tries) { in qib_sd7220_reg_mod()
698 tries = 1; /* to make read-skip work */ in qib_sd7220_reg_mod()
702 * loc encodes chip-select as well as address in qib_sd7220_reg_mod()
716 /* else, failed to see ready, what error-handling? */ in qib_sd7220_reg_mod()
721 if (epb_access(dd, sdnum, -1) < 0) in qib_sd7220_reg_mod()
722 ret = -1; in qib_sd7220_reg_mod()
726 spin_unlock_irqrestore(&dd->cspec->sdepb_lock, flags); in qib_sd7220_reg_mod()
728 ret = -1; in qib_sd7220_reg_mod()
735 * Below, all uC-related, use appropriate UC_CS, depending
773 return -1; in qib_sd7220_ram_xfer()
776 spin_lock_irqsave(&dd->cspec->sdepb_lock, flags); in qib_sd7220_ram_xfer()
780 spin_unlock_irqrestore(&dd->cspec->sdepb_lock, flags); in qib_sd7220_ram_xfer()
781 return -1; in qib_sd7220_ram_xfer()
792 for (tries = EPB_TRANS_TRIES; tries; --tries) { in qib_sd7220_ram_xfer()
802 * Every "memory" access is doubly-indirect. in qib_sd7220_ram_xfer()
840 /* Finally, clear control-bit for Read or Write */ in qib_sd7220_ram_xfer()
847 if (epb_access(dd, sdnum, -1) < 0) in qib_sd7220_ram_xfer()
848 ret = -1; in qib_sd7220_ram_xfer()
850 spin_unlock_irqrestore(&dd->cspec->sdepb_lock, flags); in qib_sd7220_ram_xfer()
852 ret = -1; in qib_sd7220_ram_xfer()
865 req = len - sofar; in qib_sd7220_prog_ld()
871 sofar = -1; in qib_sd7220_prog_ld()
886 unsigned char readback[VFY_CHUNK]; in qib_sd7220_prog_vfy() local
891 req = len - sofar; in qib_sd7220_prog_vfy()
895 readback, req, 1); in qib_sd7220_prog_vfy()
898 sofar = -1; in qib_sd7220_prog_vfy()
902 if (readback[idx] != img[idx+sofar]) in qib_sd7220_prog_vfy()
907 return errors ? -errors : sofar; in qib_sd7220_prog_vfy()
913 return qib_sd7220_prog_ld(dd, IB_7220_SERDES, fw->data, fw->size, 0); in qib_sd7220_ib_load()
919 return qib_sd7220_prog_vfy(dd, IB_7220_SERDES, fw->data, fw->size, 0); in qib_sd7220_ib_vfy()
947 qib_dev_err(dd, "No TRIMDONE in %d tries\n", trim_tmo); in qib_sd_trimdone_poll()
958 * little more human-editable.
959 * First, values related to Drive De-emphasis Settings.
963 #define DDS_REG_MAP 0x76A910 /* LSB-first list of regs (in elt 9) to mod */
1050 taddr = dd->kregbase + kr_serdes_maptable; in qib_sd_setvals()
1051 iaddr = dd->kregbase + kr_serdes_ddsrxeq0; in qib_sd_setvals()
1105 } /* end outer for (Reg-writes for RXEQ) */ in qib_sd_setvals()
1129 int ret = -1; in ibsd_mod_allchnls()
1148 "pre-read failed: elt %d, addr 0x%X, chnl %d\n", in ibsd_mod_allchnls()
1166 /* Clear "channel" and set CS so we can simply iterate */ in ibsd_mod_allchnls()
1200 data = ddi->reg_vals[idx]; in set_dds_vals()
1226 /* mask of 0xFF, because hardware does full-byte store. */ in set_rxeq_vals()
1236 * we do this initially and whenever we turn off IB-1.2
1240 * For experimenting with cables and link-partners, we allow changing
1267 if (!dd->cspec->presets_needed) in qib_sd7220_presets()
1269 dd->cspec->presets_needed = 0; in qib_sd7220_presets()
1273 qib_sd_trimdone_monitor(dd, "link-down"); in qib_sd7220_presets()
1313 /* more fine-tuning of what will be default */ in qib_sd_dactrim()
1366 dd->f_xgxs_reset(dd->pport); in toggle_7220_rclkrls()
1377 if (dd->cspec->relock_timer_active) in shutdown_7220_relock_poll()
1378 del_timer_sync(&dd->cspec->relock_timer); in shutdown_7220_relock_poll()
1388 struct qib_chip_specific *cs = from_timer(cs, t, relock_timer); in qib_run_relock() local
1389 struct qib_devdata *dd = cs->dd; in qib_run_relock()
1390 struct qib_pportdata *ppd = dd->pport; in qib_run_relock()
1394 * Check link-training state for "stuck" state, when down. in qib_run_relock()
1399 if ((dd->flags & QIB_INITTED) && !(ppd->lflags & in qib_run_relock()
1403 if (!(ppd->lflags & QIBL_IB_LINK_DISABLED)) in qib_run_relock()
1406 /* re-set timer for next check */ in qib_run_relock()
1407 timeoff = cs->relock_interval << 1; in qib_run_relock()
1410 cs->relock_interval = timeoff; in qib_run_relock()
1413 mod_timer(&cs->relock_timer, jiffies + timeoff); in qib_run_relock()
1418 struct qib_chip_specific *cs = dd->cspec; in set_7220_relock_poll() local
1422 if (cs->relock_timer_active) { in set_7220_relock_poll()
1423 cs->relock_interval = HZ; in set_7220_relock_poll()
1424 mod_timer(&cs->relock_timer, jiffies + HZ); in set_7220_relock_poll()
1427 /* Transition to down, (re-)set timer to short interval. */ in set_7220_relock_poll()
1434 if (!cs->relock_timer_active) { in set_7220_relock_poll()
1435 cs->relock_timer_active = 1; in set_7220_relock_poll()
1436 timer_setup(&cs->relock_timer, qib_run_relock, 0); in set_7220_relock_poll()
1437 cs->relock_interval = timeout; in set_7220_relock_poll()
1438 cs->relock_timer.expires = jiffies + timeout; in set_7220_relock_poll()
1439 add_timer(&cs->relock_timer); in set_7220_relock_poll()
1441 cs->relock_interval = timeout; in set_7220_relock_poll()
1442 mod_timer(&cs->relock_timer, jiffies + timeout); in set_7220_relock_poll()