Lines Matching refs:ocx

1078 	struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1082 unsigned long head = ring_pos(ocx->com_ring_head,
1083 ARRAY_SIZE(ocx->com_err_ctx));
1084 struct ocx_com_err_ctx *ctx = &ocx->com_err_ctx[head];
1086 ctx->reg_com_int = readq(ocx->regs + OCX_COM_INT);
1090 readq(ocx->regs + OCX_LNE_INT(lane));
1092 readq(ocx->regs + OCX_LNE_STAT(lane, 11));
1094 writeq(ctx->reg_lane_int[lane], ocx->regs + OCX_LNE_INT(lane));
1097 writeq(ctx->reg_com_int, ocx->regs + OCX_COM_INT);
1099 ocx->com_ring_head++;
1107 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1124 while (CIRC_CNT(ocx->com_ring_head, ocx->com_ring_tail,
1125 ARRAY_SIZE(ocx->com_err_ctx))) {
1126 tail = ring_pos(ocx->com_ring_tail,
1127 ARRAY_SIZE(ocx->com_err_ctx));
1128 ctx = &ocx->com_err_ctx[tail];
1131 ocx->edac_dev->ctl_name, ctx->reg_com_int);
1154 edac_device_handle_ce(ocx->edac_dev, 0, 0, msg);
1156 ocx->com_ring_tail++;
1171 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1173 unsigned long head = ring_pos(ocx->link_ring_head,
1174 ARRAY_SIZE(ocx->link_err_ctx));
1175 struct ocx_link_err_ctx *ctx = &ocx->link_err_ctx[head];
1178 ctx->reg_com_link_int = readq(ocx->regs + OCX_COM_LINKX_INT(ctx->link));
1180 writeq(ctx->reg_com_link_int, ocx->regs + OCX_COM_LINKX_INT(ctx->link));
1182 ocx->link_ring_head++;
1190 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
1205 while (CIRC_CNT(ocx->link_ring_head, ocx->link_ring_tail,
1206 ARRAY_SIZE(ocx->link_err_ctx))) {
1207 tail = ring_pos(ocx->link_ring_head,
1208 ARRAY_SIZE(ocx->link_err_ctx));
1210 ctx = &ocx->link_err_ctx[tail];
1214 ocx->edac_dev->ctl_name,
1223 edac_device_handle_ue(ocx->edac_dev, 0, 0, msg);
1225 edac_device_handle_ce(ocx->edac_dev, 0, 0, msg);
1227 ocx->link_ring_tail++;
1238 #define OCX_DEBUGFS_ATTR(_name, _reg) DEBUGFS_REG_ATTR(ocx, _name, _reg)
1327 static void thunderx_ocx_clearstats(struct thunderx_ocx *ocx)
1332 cfg = readq(ocx->regs + OCX_LNE_CFG(lane));
1335 writeq(cfg, ocx->regs + OCX_LNE_CFG(lane));
1338 readq(ocx->regs + OCX_LNE_STAT(lane, stat));
1345 struct thunderx_ocx *ocx;
1373 ocx = edac_dev->pvt_info;
1374 ocx->edac_dev = edac_dev;
1375 ocx->com_ring_head = 0;
1376 ocx->com_ring_tail = 0;
1377 ocx->link_ring_head = 0;
1378 ocx->link_ring_tail = 0;
1380 ocx->regs = pcim_iomap_table(pdev)[0];
1381 if (!ocx->regs) {
1387 ocx->pdev = pdev;
1390 ocx->msix_ent[i].entry = i;
1391 ocx->msix_ent[i].vector = 0;
1394 ret = pci_enable_msix_exact(pdev, ocx->msix_ent, OCX_INTS);
1402 ocx->msix_ent[i].vector,
1410 &ocx->msix_ent[i]);
1417 edac_dev->mod_name = "thunderx-ocx";
1418 edac_dev->ctl_name = "thunderx-ocx";
1427 ocx->debugfs = edac_debugfs_create_dir(pdev->dev.kobj.name);
1429 ret = thunderx_create_debugfs_nodes(ocx->debugfs,
1431 ocx,
1441 thunderx_ocx_clearstats(ocx);
1445 ocx->regs + OCX_LNE_INT_EN(i));
1447 reg = readq(ocx->regs + OCX_LNE_INT(i));
1448 writeq(reg, ocx->regs + OCX_LNE_INT(i));
1453 reg = readq(ocx->regs + OCX_COM_LINKX_INT(i));
1454 writeq(reg, ocx->regs + OCX_COM_LINKX_INT(i));
1457 ocx->regs + OCX_COM_LINKX_INT_ENA_W1S(i));
1460 reg = readq(ocx->regs + OCX_COM_INT);
1461 writeq(reg, ocx->regs + OCX_COM_INT);
1463 writeq(OCX_COM_INT_ENA_ALL, ocx->regs + OCX_COM_INT_ENA_W1S);
1475 struct thunderx_ocx *ocx = edac_dev->pvt_info;
1478 writeq(OCX_COM_INT_ENA_ALL, ocx->regs + OCX_COM_INT_ENA_W1C);
1482 ocx->regs + OCX_COM_LINKX_INT_ENA_W1C(i));
1485 edac_debugfs_remove_recursive(ocx->debugfs);