Lines Matching +full:controller +full:- +full:data
2 * Freescale MPC85xx Memory Controller kernel module
8 * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
52 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pci_check()
55 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); in mpc85xx_pci_check()
59 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); in mpc85xx_pci_check()
67 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ATTRIB)); in mpc85xx_pci_check()
69 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR)); in mpc85xx_pci_check()
71 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EXT_ADDR)); in mpc85xx_pci_check()
73 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DL)); in mpc85xx_pci_check()
75 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DH)); in mpc85xx_pci_check()
78 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); in mpc85xx_pci_check()
81 edac_pci_handle_pe(pci, pci->ctl_name); in mpc85xx_pci_check()
84 edac_pci_handle_npe(pci, pci->ctl_name); in mpc85xx_pci_check()
89 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pcie_check()
92 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); in mpc85xx_pcie_check()
93 err_cap_stat = in_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR); in mpc85xx_pcie_check()
99 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R0)); in mpc85xx_pcie_check()
101 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R1)); in mpc85xx_pcie_check()
103 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R2)); in mpc85xx_pcie_check()
105 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R3)); in mpc85xx_pcie_check()
108 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); in mpc85xx_pcie_check()
111 out_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR, err_cap_stat | 0x1); in mpc85xx_pcie_check()
119 return -EINVAL; in mpc85xx_pcie_find_capability()
129 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pci_isr()
132 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); in mpc85xx_pci_isr()
137 if (pdata->is_pcie) in mpc85xx_pci_isr()
154 if (!devres_open_group(&op->dev, mpc85xx_pci_err_probe, GFP_KERNEL)) in mpc85xx_pci_err_probe()
155 return -ENOMEM; in mpc85xx_pci_err_probe()
159 return -ENOMEM; in mpc85xx_pci_err_probe()
171 pdata = pci->pvt_info; in mpc85xx_pci_err_probe()
172 pdata->name = "mpc85xx_pci_err"; in mpc85xx_pci_err_probe()
174 plat_data = op->dev.platform_data; in mpc85xx_pci_err_probe()
176 dev_err(&op->dev, "no platform data"); in mpc85xx_pci_err_probe()
177 res = -ENXIO; in mpc85xx_pci_err_probe()
180 of_node = plat_data->of_node; in mpc85xx_pci_err_probe()
183 pdata->is_pcie = true; in mpc85xx_pci_err_probe()
185 dev_set_drvdata(&op->dev, pci); in mpc85xx_pci_err_probe()
186 pci->dev = &op->dev; in mpc85xx_pci_err_probe()
187 pci->mod_name = EDAC_MOD_STR; in mpc85xx_pci_err_probe()
188 pci->ctl_name = pdata->name; in mpc85xx_pci_err_probe()
189 pci->dev_name = dev_name(&op->dev); in mpc85xx_pci_err_probe()
192 if (pdata->is_pcie) in mpc85xx_pci_err_probe()
193 pci->edac_check = mpc85xx_pcie_check; in mpc85xx_pci_err_probe()
195 pci->edac_check = mpc85xx_pci_check; in mpc85xx_pci_err_probe()
198 pdata->edac_idx = edac_pci_idx++; in mpc85xx_pci_err_probe()
209 if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), in mpc85xx_pci_err_probe()
210 pdata->name)) { in mpc85xx_pci_err_probe()
212 res = -EBUSY; in mpc85xx_pci_err_probe()
216 pdata->pci_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); in mpc85xx_pci_err_probe()
217 if (!pdata->pci_vbase) { in mpc85xx_pci_err_probe()
219 res = -ENOMEM; in mpc85xx_pci_err_probe()
223 if (pdata->is_pcie) { in mpc85xx_pci_err_probe()
225 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR); in mpc85xx_pci_err_probe()
226 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, ~0); in mpc85xx_pci_err_probe()
228 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN); in mpc85xx_pci_err_probe()
229 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, 0); in mpc85xx_pci_err_probe()
232 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR); in mpc85xx_pci_err_probe()
235 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR, 0x40); in mpc85xx_pci_err_probe()
238 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN); in mpc85xx_pci_err_probe()
241 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, ~0x40); in mpc85xx_pci_err_probe()
245 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, ~0); in mpc85xx_pci_err_probe()
248 out_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR, 0x1); in mpc85xx_pci_err_probe()
250 if (edac_pci_add_device(pci, pdata->edac_idx) > 0) { in mpc85xx_pci_err_probe()
256 pdata->irq = irq_of_parse_and_map(of_node, 0); in mpc85xx_pci_err_probe()
257 res = devm_request_irq(&op->dev, pdata->irq, in mpc85xx_pci_err_probe()
263 __func__, pdata->irq); in mpc85xx_pci_err_probe()
264 irq_dispose_mapping(pdata->irq); in mpc85xx_pci_err_probe()
265 res = -ENODEV; in mpc85xx_pci_err_probe()
270 pdata->irq); in mpc85xx_pci_err_probe()
273 if (pdata->is_pcie) { in mpc85xx_pci_err_probe()
283 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, ~0 in mpc85xx_pci_err_probe()
285 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, 0 in mpc85xx_pci_err_probe()
289 devres_remove_group(&op->dev, mpc85xx_pci_err_probe); in mpc85xx_pci_err_probe()
296 edac_pci_del_device(&op->dev); in mpc85xx_pci_err_probe()
299 devres_release_group(&op->dev, mpc85xx_pci_err_probe); in mpc85xx_pci_err_probe()
305 struct edac_pci_ctl_info *pci = dev_get_drvdata(&op->dev); in mpc85xx_pci_err_remove()
306 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pci_err_remove()
310 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, orig_pci_err_cap_dr); in mpc85xx_pci_err_remove()
311 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, orig_pci_err_en); in mpc85xx_pci_err_remove()
313 edac_pci_del_device(&op->dev); in mpc85xx_pci_err_remove()
319 .name = "mpc85xx-pci-edac"
340 *edac_dev, char *data) in mpc85xx_l2_inject_data_hi_show() argument
342 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_hi_show()
343 return sprintf(data, "0x%08x", in mpc85xx_l2_inject_data_hi_show()
344 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJHI)); in mpc85xx_l2_inject_data_hi_show()
348 *edac_dev, char *data) in mpc85xx_l2_inject_data_lo_show() argument
350 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_lo_show()
351 return sprintf(data, "0x%08x", in mpc85xx_l2_inject_data_lo_show()
352 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJLO)); in mpc85xx_l2_inject_data_lo_show()
356 *edac_dev, char *data) in mpc85xx_l2_inject_ctrl_show() argument
358 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_ctrl_show()
359 return sprintf(data, "0x%08x", in mpc85xx_l2_inject_ctrl_show()
360 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJCTL)); in mpc85xx_l2_inject_ctrl_show()
364 *edac_dev, const char *data, in mpc85xx_l2_inject_data_hi_store() argument
367 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_hi_store()
368 if (isdigit(*data)) { in mpc85xx_l2_inject_data_hi_store()
369 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJHI, in mpc85xx_l2_inject_data_hi_store()
370 simple_strtoul(data, NULL, 0)); in mpc85xx_l2_inject_data_hi_store()
377 *edac_dev, const char *data, in mpc85xx_l2_inject_data_lo_store() argument
380 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_lo_store()
381 if (isdigit(*data)) { in mpc85xx_l2_inject_data_lo_store()
382 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJLO, in mpc85xx_l2_inject_data_lo_store()
383 simple_strtoul(data, NULL, 0)); in mpc85xx_l2_inject_data_lo_store()
390 *edac_dev, const char *data, in mpc85xx_l2_inject_ctrl_store() argument
393 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_ctrl_store()
394 if (isdigit(*data)) { in mpc85xx_l2_inject_ctrl_store()
395 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJCTL, in mpc85xx_l2_inject_ctrl_store()
396 simple_strtoul(data, NULL, 0)); in mpc85xx_l2_inject_ctrl_store()
434 edac_dev->sysfs_attributes = mpc85xx_l2_sysfs_attributes; in mpc85xx_set_l2_sysfs_attributes()
441 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_check()
444 err_detect = in_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET); in mpc85xx_l2_check()
451 pr_err("L2 Error Capture Data High Register: 0x%08x\n", in mpc85xx_l2_check()
452 in_be32(pdata->l2_vbase + MPC85XX_L2_CAPTDATAHI)); in mpc85xx_l2_check()
453 pr_err("L2 Error Capture Data Lo Register: 0x%08x\n", in mpc85xx_l2_check()
454 in_be32(pdata->l2_vbase + MPC85XX_L2_CAPTDATALO)); in mpc85xx_l2_check()
456 in_be32(pdata->l2_vbase + MPC85XX_L2_CAPTECC)); in mpc85xx_l2_check()
458 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRATTR)); in mpc85xx_l2_check()
460 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRADDR)); in mpc85xx_l2_check()
463 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET, err_detect); in mpc85xx_l2_check()
466 edac_device_handle_ce(edac_dev, 0, 0, edac_dev->ctl_name); in mpc85xx_l2_check()
469 edac_device_handle_ue(edac_dev, 0, 0, edac_dev->ctl_name); in mpc85xx_l2_check()
475 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_isr()
478 err_detect = in_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET); in mpc85xx_l2_isr()
495 if (!devres_open_group(&op->dev, mpc85xx_l2_err_probe, GFP_KERNEL)) in mpc85xx_l2_err_probe()
496 return -ENOMEM; in mpc85xx_l2_err_probe()
502 devres_release_group(&op->dev, mpc85xx_l2_err_probe); in mpc85xx_l2_err_probe()
503 return -ENOMEM; in mpc85xx_l2_err_probe()
506 pdata = edac_dev->pvt_info; in mpc85xx_l2_err_probe()
507 pdata->name = "mpc85xx_l2_err"; in mpc85xx_l2_err_probe()
508 edac_dev->dev = &op->dev; in mpc85xx_l2_err_probe()
509 dev_set_drvdata(edac_dev->dev, edac_dev); in mpc85xx_l2_err_probe()
510 edac_dev->ctl_name = pdata->name; in mpc85xx_l2_err_probe()
511 edac_dev->dev_name = pdata->name; in mpc85xx_l2_err_probe()
513 res = of_address_to_resource(op->dev.of_node, 0, &r); in mpc85xx_l2_err_probe()
522 if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), in mpc85xx_l2_err_probe()
523 pdata->name)) { in mpc85xx_l2_err_probe()
525 res = -EBUSY; in mpc85xx_l2_err_probe()
529 pdata->l2_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); in mpc85xx_l2_err_probe()
530 if (!pdata->l2_vbase) { in mpc85xx_l2_err_probe()
532 res = -ENOMEM; in mpc85xx_l2_err_probe()
536 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET, ~0); in mpc85xx_l2_err_probe()
538 orig_l2_err_disable = in_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS); in mpc85xx_l2_err_probe()
541 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, 0); in mpc85xx_l2_err_probe()
543 edac_dev->mod_name = EDAC_MOD_STR; in mpc85xx_l2_err_probe()
546 edac_dev->edac_check = mpc85xx_l2_check; in mpc85xx_l2_err_probe()
550 pdata->edac_idx = edac_dev_idx++; in mpc85xx_l2_err_probe()
558 pdata->irq = irq_of_parse_and_map(op->dev.of_node, 0); in mpc85xx_l2_err_probe()
559 res = devm_request_irq(&op->dev, pdata->irq, in mpc85xx_l2_err_probe()
564 __func__, pdata->irq); in mpc85xx_l2_err_probe()
565 irq_dispose_mapping(pdata->irq); in mpc85xx_l2_err_probe()
566 res = -ENODEV; in mpc85xx_l2_err_probe()
570 pr_info(EDAC_MOD_STR " acquired irq %d for L2 Err\n", pdata->irq); in mpc85xx_l2_err_probe()
572 edac_dev->op_state = OP_RUNNING_INTERRUPT; in mpc85xx_l2_err_probe()
574 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINTEN, L2_EIE_MASK); in mpc85xx_l2_err_probe()
577 devres_remove_group(&op->dev, mpc85xx_l2_err_probe); in mpc85xx_l2_err_probe()
585 edac_device_del_device(&op->dev); in mpc85xx_l2_err_probe()
587 devres_release_group(&op->dev, mpc85xx_l2_err_probe); in mpc85xx_l2_err_probe()
594 struct edac_device_ctl_info *edac_dev = dev_get_drvdata(&op->dev); in mpc85xx_l2_err_remove()
595 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_err_remove()
600 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINTEN, 0); in mpc85xx_l2_err_remove()
601 irq_dispose_mapping(pdata->irq); in mpc85xx_l2_err_remove()
604 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, orig_l2_err_disable); in mpc85xx_l2_err_remove()
605 edac_device_del_device(&op->dev); in mpc85xx_l2_err_remove()
610 { .compatible = "fsl,mpc8536-l2-cache-controller", },
611 { .compatible = "fsl,mpc8540-l2-cache-controller", },
612 { .compatible = "fsl,mpc8541-l2-cache-controller", },
613 { .compatible = "fsl,mpc8544-l2-cache-controller", },
614 { .compatible = "fsl,mpc8548-l2-cache-controller", },
615 { .compatible = "fsl,mpc8555-l2-cache-controller", },
616 { .compatible = "fsl,mpc8560-l2-cache-controller", },
617 { .compatible = "fsl,mpc8568-l2-cache-controller", },
618 { .compatible = "fsl,mpc8569-l2-cache-controller", },
619 { .compatible = "fsl,mpc8572-l2-cache-controller", },
620 { .compatible = "fsl,p1020-l2-cache-controller", },
621 { .compatible = "fsl,p1021-l2-cache-controller", },
622 { .compatible = "fsl,p2020-l2-cache-controller", },
623 { .compatible = "fsl,t2080-l2-cache-controller", },
638 { .compatible = "fsl,mpc8536-memory-controller", },
639 { .compatible = "fsl,mpc8540-memory-controller", },
640 { .compatible = "fsl,mpc8541-memory-controller", },
641 { .compatible = "fsl,mpc8544-memory-controller", },
642 { .compatible = "fsl,mpc8548-memory-controller", },
643 { .compatible = "fsl,mpc8555-memory-controller", },
644 { .compatible = "fsl,mpc8560-memory-controller", },
645 { .compatible = "fsl,mpc8568-memory-controller", },
646 { .compatible = "fsl,mpc8569-memory-controller", },
647 { .compatible = "fsl,mpc8572-memory-controller", },
648 { .compatible = "fsl,mpc8349-memory-controller", },
649 { .compatible = "fsl,p1020-memory-controller", },
650 { .compatible = "fsl,p1021-memory-controller", },
651 { .compatible = "fsl,p2020-memory-controller", },
652 { .compatible = "fsl,qoriq-memory-controller", },
707 MODULE_DESCRIPTION("Freescale MPC85xx Memory Controller EDAC driver");