Lines Matching defs:rdev
213 idtg2_em_init(struct rio_dev *rdev)
223 pr_debug("RIO: %s [%d:%d]\n", __func__, rdev->destid, rdev->hopcount);
226 rio_write_config_32(rdev, IDT_PW_INFO_CSR, 0x0000e000);
233 rio_write_config_32(rdev, IDT_LT_ERR_REPORT_EN,
240 rio_read_config_32(rdev, IDT_DEV_CTRL_1, ®val);
241 rio_write_config_32(rdev, IDT_DEV_CTRL_1,
249 rio_write_config_32(rdev, IDT_PORT_ERR_REPORT_EN_BC, 0x807e8037);
252 rio_write_config_32(rdev, IDT_PORT_ISERR_REPORT_EN_BC,
256 tmp = RIO_GET_TOTAL_PORTS(rdev->swpinfo);
258 rio_read_config_32(rdev, IDT_PORT_OPS(i), ®val);
259 rio_write_config_32(rdev,
266 rio_write_config_32(rdev, IDT_ERR_CAP, IDT_ERR_CAP_LOG_OVERWR);
273 rio_write_config_32(rdev, IDT_LANE_ERR_REPORT_EN_BC, 0);
278 tmp = (rdev->did == RIO_DID_IDTCPS1848) ? 48 : 16;
280 rio_read_config_32(rdev, IDT_LANE_CTRL(i), ®val);
281 rio_write_config_32(rdev, IDT_LANE_CTRL(i),
290 rio_write_config_32(rdev, IDT_AUX_PORT_ERR_CAP_EN, 0);
293 rio_write_config_32(rdev, IDT_AUX_ERR_REPORT_EN, 0);
296 rio_write_config_32(rdev, IDT_JTAG_CTRL, 0);
299 rio_read_config_32(rdev, IDT_I2C_MCTRL, ®val);
300 rio_write_config_32(rdev, IDT_I2C_MCTRL, regval & ~IDT_I2C_MCTRL_GENPW);
307 rio_write_config_32(rdev, IDT_CFGBLK_ERR_CAPTURE_EN, 0);
310 rio_read_config_32(rdev, IDT_CFGBLK_ERR_REPORT, ®val);
311 rio_write_config_32(rdev, IDT_CFGBLK_ERR_REPORT,
315 rio_write_config_32(rdev,
316 rdev->phys_efptr + RIO_PORT_LINKTO_CTL_CSR, 0x8e << 8);
322 idtg2_em_handler(struct rio_dev *rdev, u8 portnum)
326 rio_read_config_32(rdev,
327 rdev->em_efptr + RIO_EM_LTL_ERR_DETECT, &em_ltlerrdet);
332 rio_read_config_32(rdev,
337 rio_name(rdev), em_ltlerrdet, regval);
340 rio_write_config_32(rdev, IDT_ISLTL_ADDRESS_CAP, 0);
345 rio_read_config_32(rdev,
346 rdev->em_efptr + RIO_EM_PN_ERR_DETECT(portnum), &em_perrdet);
353 rio_read_config_32(rdev,
357 " errors 0x%x\n", rio_name(rdev), regval);
360 rio_write_config_32(rdev,
371 struct rio_dev *rdev = to_rio_dev(dev);
375 while (!rio_read_config_32(rdev, IDT_ERR_RD, ®val)) {
389 static int idtg2_sysfs(struct rio_dev *rdev, bool create)
391 struct device *dev = &rdev->dev;
416 static int idtg2_probe(struct rio_dev *rdev, const struct rio_device_id *id)
418 pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev));
420 spin_lock(&rdev->rswitch->lock);
422 if (rdev->rswitch->ops) {
423 spin_unlock(&rdev->rswitch->lock);
427 rdev->rswitch->ops = &idtg2_switch_ops;
429 if (rdev->do_enum) {
431 rio_write_config_32(rdev,
435 spin_unlock(&rdev->rswitch->lock);
438 idtg2_sysfs(rdev, true);
443 static void idtg2_remove(struct rio_dev *rdev)
445 pr_debug("RIO: %s for %s\n", __func__, rio_name(rdev));
446 spin_lock(&rdev->rswitch->lock);
447 if (rdev->rswitch->ops != &idtg2_switch_ops) {
448 spin_unlock(&rdev->rswitch->lock);
451 rdev->rswitch->ops = NULL;
452 spin_unlock(&rdev->rswitch->lock);
454 idtg2_sysfs(rdev, false);