Lines Matching +full:cache +full:- +full:controller
2 * Freescale MPC85xx Memory Controller kernel module
8 * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
53 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pci_check()
56 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); in mpc85xx_pci_check()
60 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); in mpc85xx_pci_check()
68 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ATTRIB)); in mpc85xx_pci_check()
70 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR)); in mpc85xx_pci_check()
72 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EXT_ADDR)); in mpc85xx_pci_check()
74 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DL)); in mpc85xx_pci_check()
76 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DH)); in mpc85xx_pci_check()
79 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); in mpc85xx_pci_check()
82 edac_pci_handle_pe(pci, pci->ctl_name); in mpc85xx_pci_check()
85 edac_pci_handle_npe(pci, pci->ctl_name); in mpc85xx_pci_check()
90 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pcie_check()
93 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); in mpc85xx_pcie_check()
94 err_cap_stat = in_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR); in mpc85xx_pcie_check()
100 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R0)); in mpc85xx_pcie_check()
102 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R1)); in mpc85xx_pcie_check()
104 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R2)); in mpc85xx_pcie_check()
106 in_be32(pdata->pci_vbase + MPC85XX_PCIE_ERR_CAP_R3)); in mpc85xx_pcie_check()
109 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, err_detect); in mpc85xx_pcie_check()
112 out_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR, err_cap_stat | 0x1); in mpc85xx_pcie_check()
120 return -EINVAL; in mpc85xx_pcie_find_capability()
130 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pci_isr()
133 err_detect = in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR); in mpc85xx_pci_isr()
138 if (pdata->is_pcie) in mpc85xx_pci_isr()
155 if (!devres_open_group(&op->dev, mpc85xx_pci_err_probe, GFP_KERNEL)) in mpc85xx_pci_err_probe()
156 return -ENOMEM; in mpc85xx_pci_err_probe()
160 return -ENOMEM; in mpc85xx_pci_err_probe()
172 pdata = pci->pvt_info; in mpc85xx_pci_err_probe()
173 pdata->name = "mpc85xx_pci_err"; in mpc85xx_pci_err_probe()
175 plat_data = op->dev.platform_data; in mpc85xx_pci_err_probe()
177 dev_err(&op->dev, "no platform data"); in mpc85xx_pci_err_probe()
178 res = -ENXIO; in mpc85xx_pci_err_probe()
181 of_node = plat_data->of_node; in mpc85xx_pci_err_probe()
184 pdata->is_pcie = true; in mpc85xx_pci_err_probe()
186 dev_set_drvdata(&op->dev, pci); in mpc85xx_pci_err_probe()
187 pci->dev = &op->dev; in mpc85xx_pci_err_probe()
188 pci->mod_name = EDAC_MOD_STR; in mpc85xx_pci_err_probe()
189 pci->ctl_name = pdata->name; in mpc85xx_pci_err_probe()
190 pci->dev_name = dev_name(&op->dev); in mpc85xx_pci_err_probe()
193 if (pdata->is_pcie) in mpc85xx_pci_err_probe()
194 pci->edac_check = mpc85xx_pcie_check; in mpc85xx_pci_err_probe()
196 pci->edac_check = mpc85xx_pci_check; in mpc85xx_pci_err_probe()
199 pdata->edac_idx = edac_pci_idx++; in mpc85xx_pci_err_probe()
210 if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), in mpc85xx_pci_err_probe()
211 pdata->name)) { in mpc85xx_pci_err_probe()
213 res = -EBUSY; in mpc85xx_pci_err_probe()
217 pdata->pci_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); in mpc85xx_pci_err_probe()
218 if (!pdata->pci_vbase) { in mpc85xx_pci_err_probe()
220 res = -ENOMEM; in mpc85xx_pci_err_probe()
224 if (pdata->is_pcie) { in mpc85xx_pci_err_probe()
226 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR); in mpc85xx_pci_err_probe()
227 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, ~0); in mpc85xx_pci_err_probe()
229 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN); in mpc85xx_pci_err_probe()
230 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, 0); in mpc85xx_pci_err_probe()
233 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR); in mpc85xx_pci_err_probe()
236 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_CAP_DR, 0x40); in mpc85xx_pci_err_probe()
239 in_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN); in mpc85xx_pci_err_probe()
242 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, ~0x40); in mpc85xx_pci_err_probe()
246 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_DR, ~0); in mpc85xx_pci_err_probe()
249 out_be32(pdata->pci_vbase + MPC85XX_PCI_GAS_TIMR, 0x1); in mpc85xx_pci_err_probe()
251 if (edac_pci_add_device(pci, pdata->edac_idx) > 0) { in mpc85xx_pci_err_probe()
257 pdata->irq = irq_of_parse_and_map(of_node, 0); in mpc85xx_pci_err_probe()
258 res = devm_request_irq(&op->dev, pdata->irq, in mpc85xx_pci_err_probe()
264 __func__, pdata->irq); in mpc85xx_pci_err_probe()
265 irq_dispose_mapping(pdata->irq); in mpc85xx_pci_err_probe()
266 res = -ENODEV; in mpc85xx_pci_err_probe()
271 pdata->irq); in mpc85xx_pci_err_probe()
274 if (pdata->is_pcie) { in mpc85xx_pci_err_probe()
284 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, ~0 in mpc85xx_pci_err_probe()
286 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, 0 in mpc85xx_pci_err_probe()
290 devres_remove_group(&op->dev, mpc85xx_pci_err_probe); in mpc85xx_pci_err_probe()
297 edac_pci_del_device(&op->dev); in mpc85xx_pci_err_probe()
300 devres_release_group(&op->dev, mpc85xx_pci_err_probe); in mpc85xx_pci_err_probe()
306 struct edac_pci_ctl_info *pci = dev_get_drvdata(&op->dev); in mpc85xx_pci_err_remove()
307 struct mpc85xx_pci_pdata *pdata = pci->pvt_info; in mpc85xx_pci_err_remove()
311 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_ADDR, orig_pci_err_cap_dr); in mpc85xx_pci_err_remove()
312 out_be32(pdata->pci_vbase + MPC85XX_PCI_ERR_EN, orig_pci_err_en); in mpc85xx_pci_err_remove()
314 edac_pci_del_device(&op->dev); in mpc85xx_pci_err_remove()
322 .name = "mpc85xx-pci-edac"
345 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_hi_show()
347 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJHI)); in mpc85xx_l2_inject_data_hi_show()
353 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_lo_show()
355 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJLO)); in mpc85xx_l2_inject_data_lo_show()
361 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_ctrl_show()
363 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJCTL)); in mpc85xx_l2_inject_ctrl_show()
370 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_hi_store()
372 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJHI, in mpc85xx_l2_inject_data_hi_store()
383 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_data_lo_store()
385 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJLO, in mpc85xx_l2_inject_data_lo_store()
396 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_inject_ctrl_store()
398 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINJCTL, in mpc85xx_l2_inject_ctrl_store()
437 edac_dev->sysfs_attributes = mpc85xx_l2_sysfs_attributes; in mpc85xx_set_l2_sysfs_attributes()
444 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_check()
447 err_detect = in_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET); in mpc85xx_l2_check()
452 pr_err("ECC Error in CPU L2 cache\n"); in mpc85xx_l2_check()
455 in_be32(pdata->l2_vbase + MPC85XX_L2_CAPTDATAHI)); in mpc85xx_l2_check()
457 in_be32(pdata->l2_vbase + MPC85XX_L2_CAPTDATALO)); in mpc85xx_l2_check()
459 in_be32(pdata->l2_vbase + MPC85XX_L2_CAPTECC)); in mpc85xx_l2_check()
461 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRATTR)); in mpc85xx_l2_check()
463 in_be32(pdata->l2_vbase + MPC85XX_L2_ERRADDR)); in mpc85xx_l2_check()
466 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET, err_detect); in mpc85xx_l2_check()
469 edac_device_handle_ce(edac_dev, 0, 0, edac_dev->ctl_name); in mpc85xx_l2_check()
472 edac_device_handle_ue(edac_dev, 0, 0, edac_dev->ctl_name); in mpc85xx_l2_check()
478 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_isr()
481 err_detect = in_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET); in mpc85xx_l2_isr()
498 if (!devres_open_group(&op->dev, mpc85xx_l2_err_probe, GFP_KERNEL)) in mpc85xx_l2_err_probe()
499 return -ENOMEM; in mpc85xx_l2_err_probe()
505 devres_release_group(&op->dev, mpc85xx_l2_err_probe); in mpc85xx_l2_err_probe()
506 return -ENOMEM; in mpc85xx_l2_err_probe()
509 pdata = edac_dev->pvt_info; in mpc85xx_l2_err_probe()
510 pdata->name = "mpc85xx_l2_err"; in mpc85xx_l2_err_probe()
511 edac_dev->dev = &op->dev; in mpc85xx_l2_err_probe()
512 dev_set_drvdata(edac_dev->dev, edac_dev); in mpc85xx_l2_err_probe()
513 edac_dev->ctl_name = pdata->name; in mpc85xx_l2_err_probe()
514 edac_dev->dev_name = pdata->name; in mpc85xx_l2_err_probe()
516 res = of_address_to_resource(op->dev.of_node, 0, &r); in mpc85xx_l2_err_probe()
525 if (!devm_request_mem_region(&op->dev, r.start, resource_size(&r), in mpc85xx_l2_err_probe()
526 pdata->name)) { in mpc85xx_l2_err_probe()
528 res = -EBUSY; in mpc85xx_l2_err_probe()
532 pdata->l2_vbase = devm_ioremap(&op->dev, r.start, resource_size(&r)); in mpc85xx_l2_err_probe()
533 if (!pdata->l2_vbase) { in mpc85xx_l2_err_probe()
535 res = -ENOMEM; in mpc85xx_l2_err_probe()
539 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDET, ~0); in mpc85xx_l2_err_probe()
541 orig_l2_err_disable = in_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS); in mpc85xx_l2_err_probe()
544 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, 0); in mpc85xx_l2_err_probe()
546 edac_dev->mod_name = EDAC_MOD_STR; in mpc85xx_l2_err_probe()
549 edac_dev->edac_check = mpc85xx_l2_check; in mpc85xx_l2_err_probe()
553 pdata->edac_idx = edac_dev_idx++; in mpc85xx_l2_err_probe()
561 pdata->irq = irq_of_parse_and_map(op->dev.of_node, 0); in mpc85xx_l2_err_probe()
562 res = devm_request_irq(&op->dev, pdata->irq, in mpc85xx_l2_err_probe()
567 __func__, pdata->irq); in mpc85xx_l2_err_probe()
568 irq_dispose_mapping(pdata->irq); in mpc85xx_l2_err_probe()
569 res = -ENODEV; in mpc85xx_l2_err_probe()
573 pr_info(EDAC_MOD_STR " acquired irq %d for L2 Err\n", pdata->irq); in mpc85xx_l2_err_probe()
575 edac_dev->op_state = OP_RUNNING_INTERRUPT; in mpc85xx_l2_err_probe()
577 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINTEN, L2_EIE_MASK); in mpc85xx_l2_err_probe()
580 devres_remove_group(&op->dev, mpc85xx_l2_err_probe); in mpc85xx_l2_err_probe()
588 edac_device_del_device(&op->dev); in mpc85xx_l2_err_probe()
590 devres_release_group(&op->dev, mpc85xx_l2_err_probe); in mpc85xx_l2_err_probe()
597 struct edac_device_ctl_info *edac_dev = dev_get_drvdata(&op->dev); in mpc85xx_l2_err_remove()
598 struct mpc85xx_l2_pdata *pdata = edac_dev->pvt_info; in mpc85xx_l2_err_remove()
603 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRINTEN, 0); in mpc85xx_l2_err_remove()
604 irq_dispose_mapping(pdata->irq); in mpc85xx_l2_err_remove()
607 out_be32(pdata->l2_vbase + MPC85XX_L2_ERRDIS, orig_l2_err_disable); in mpc85xx_l2_err_remove()
608 edac_device_del_device(&op->dev); in mpc85xx_l2_err_remove()
614 { .compatible = "fsl,mpc8536-l2-cache-controller", },
615 { .compatible = "fsl,mpc8540-l2-cache-controller", },
616 { .compatible = "fsl,mpc8541-l2-cache-controller", },
617 { .compatible = "fsl,mpc8544-l2-cache-controller", },
618 { .compatible = "fsl,mpc8548-l2-cache-controller", },
619 { .compatible = "fsl,mpc8555-l2-cache-controller", },
620 { .compatible = "fsl,mpc8560-l2-cache-controller", },
621 { .compatible = "fsl,mpc8568-l2-cache-controller", },
622 { .compatible = "fsl,mpc8569-l2-cache-controller", },
623 { .compatible = "fsl,mpc8572-l2-cache-controller", },
624 { .compatible = "fsl,p1020-l2-cache-controller", },
625 { .compatible = "fsl,p1021-l2-cache-controller", },
626 { .compatible = "fsl,p2020-l2-cache-controller", },
627 { .compatible = "fsl,t2080-l2-cache-controller", },
642 { .compatible = "fsl,mpc8536-memory-controller", },
643 { .compatible = "fsl,mpc8540-memory-controller", },
644 { .compatible = "fsl,mpc8541-memory-controller", },
645 { .compatible = "fsl,mpc8544-memory-controller", },
646 { .compatible = "fsl,mpc8548-memory-controller", },
647 { .compatible = "fsl,mpc8555-memory-controller", },
648 { .compatible = "fsl,mpc8560-memory-controller", },
649 { .compatible = "fsl,mpc8568-memory-controller", },
650 { .compatible = "fsl,mpc8569-memory-controller", },
651 { .compatible = "fsl,mpc8572-memory-controller", },
652 { .compatible = "fsl,mpc8349-memory-controller", },
653 { .compatible = "fsl,p1020-memory-controller", },
654 { .compatible = "fsl,p1021-memory-controller", },
655 { .compatible = "fsl,p2020-memory-controller", },
656 { .compatible = "fsl,qoriq-memory-controller", },