2 * Freescale MPC85xx Memory Controller kernel module
4 * Parts Copyrighted (c) 2013 by Freescale Semiconductor, Inc.
6 * Author: Dave Jiang <djiang@mvista.com>
8 * 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
9 * the terms of the GNU General Public License version 2. This program
10 * is licensed "as is" without any warranty of any kind, whether express
14 #include <linux/module.h>
15 #include <linux/init.h>
16 #include <linux/interrupt.h>
17 #include <linux/ctype.h>
19 #include <linux/mod_devicetable.h>
20 #include <linux/edac.h>
21 #include <linux/smp.h>
22 #include <linux/gfp.h>
23 #include <linux/fsl/edac.h>
25 #include <linux/of_platform.h>
26 #include <linux/of_device.h>
27 #include "edac_module.h"
28 #include "edac_core.h"
29 #include "mpc85xx_edac.h"
30 #include "fsl_ddr_edac.h"
32 static int edac_dev_idx
;
34 static int edac_pci_idx
;
41 static u32 orig_pci_err_cap_dr
;
42 static u32 orig_pci_err_en
;
45 static u32 orig_l2_err_disable
;
47 /**************************** PCI Err device ***************************/
50 static void mpc85xx_pci_check(struct edac_pci_ctl_info
*pci
)
52 struct mpc85xx_pci_pdata
*pdata
= pci
->pvt_info
;
55 err_detect
= in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
);
57 /* master aborts can happen during PCI config cycles */
58 if (!(err_detect
& ~(PCI_EDE_MULTI_ERR
| PCI_EDE_MST_ABRT
))) {
59 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
, err_detect
);
63 pr_err("PCI error(s) detected\n");
64 pr_err("PCI/X ERR_DR register: %#08x\n", err_detect
);
66 pr_err("PCI/X ERR_ATTRIB register: %#08x\n",
67 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_ATTRIB
));
68 pr_err("PCI/X ERR_ADDR register: %#08x\n",
69 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_ADDR
));
70 pr_err("PCI/X ERR_EXT_ADDR register: %#08x\n",
71 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_EXT_ADDR
));
72 pr_err("PCI/X ERR_DL register: %#08x\n",
73 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DL
));
74 pr_err("PCI/X ERR_DH register: %#08x\n",
75 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DH
));
77 /* clear error bits */
78 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
, err_detect
);
80 if (err_detect
& PCI_EDE_PERR_MASK
)
81 edac_pci_handle_pe(pci
, pci
->ctl_name
);
83 if ((err_detect
& ~PCI_EDE_MULTI_ERR
) & ~PCI_EDE_PERR_MASK
)
84 edac_pci_handle_npe(pci
, pci
->ctl_name
);
87 static void mpc85xx_pcie_check(struct edac_pci_ctl_info
*pci
)
89 struct mpc85xx_pci_pdata
*pdata
= pci
->pvt_info
;
90 u32 err_detect
, err_cap_stat
;
92 err_detect
= in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
);
93 err_cap_stat
= in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_GAS_TIMR
);
95 pr_err("PCIe error(s) detected\n");
96 pr_err("PCIe ERR_DR register: 0x%08x\n", err_detect
);
97 pr_err("PCIe ERR_CAP_STAT register: 0x%08x\n", err_cap_stat
);
98 pr_err("PCIe ERR_CAP_R0 register: 0x%08x\n",
99 in_be32(pdata
->pci_vbase
+ MPC85XX_PCIE_ERR_CAP_R0
));
100 pr_err("PCIe ERR_CAP_R1 register: 0x%08x\n",
101 in_be32(pdata
->pci_vbase
+ MPC85XX_PCIE_ERR_CAP_R1
));
102 pr_err("PCIe ERR_CAP_R2 register: 0x%08x\n",
103 in_be32(pdata
->pci_vbase
+ MPC85XX_PCIE_ERR_CAP_R2
));
104 pr_err("PCIe ERR_CAP_R3 register: 0x%08x\n",
105 in_be32(pdata
->pci_vbase
+ MPC85XX_PCIE_ERR_CAP_R3
));
107 /* clear error bits */
108 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
, err_detect
);
110 /* reset error capture */
111 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_GAS_TIMR
, err_cap_stat
| 0x1);
114 static int mpc85xx_pcie_find_capability(struct device_node
*np
)
116 struct pci_controller
*hose
;
121 hose
= pci_find_hose_for_OF_device(np
);
123 return early_find_capability(hose
, 0, 0, PCI_CAP_ID_EXP
);
126 static irqreturn_t
mpc85xx_pci_isr(int irq
, void *dev_id
)
128 struct edac_pci_ctl_info
*pci
= dev_id
;
129 struct mpc85xx_pci_pdata
*pdata
= pci
->pvt_info
;
132 err_detect
= in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
);
138 mpc85xx_pcie_check(pci
);
140 mpc85xx_pci_check(pci
);
145 static int mpc85xx_pci_err_probe(struct platform_device
*op
)
147 struct edac_pci_ctl_info
*pci
;
148 struct mpc85xx_pci_pdata
*pdata
;
149 struct mpc85xx_edac_pci_plat_data
*plat_data
;
150 struct device_node
*of_node
;
154 if (!devres_open_group(&op
->dev
, mpc85xx_pci_err_probe
, GFP_KERNEL
))
157 pci
= edac_pci_alloc_ctl_info(sizeof(*pdata
), "mpc85xx_pci_err");
161 /* make sure error reporting method is sane */
162 switch (edac_op_state
) {
163 case EDAC_OPSTATE_POLL
:
164 case EDAC_OPSTATE_INT
:
167 edac_op_state
= EDAC_OPSTATE_INT
;
171 pdata
= pci
->pvt_info
;
172 pdata
->name
= "mpc85xx_pci_err";
174 plat_data
= op
->dev
.platform_data
;
176 dev_err(&op
->dev
, "no platform data");
180 of_node
= plat_data
->of_node
;
182 if (mpc85xx_pcie_find_capability(of_node
) > 0)
183 pdata
->is_pcie
= true;
185 dev_set_drvdata(&op
->dev
, pci
);
187 pci
->mod_name
= EDAC_MOD_STR
;
188 pci
->ctl_name
= pdata
->name
;
189 pci
->dev_name
= dev_name(&op
->dev
);
191 if (edac_op_state
== EDAC_OPSTATE_POLL
) {
193 pci
->edac_check
= mpc85xx_pcie_check
;
195 pci
->edac_check
= mpc85xx_pci_check
;
198 pdata
->edac_idx
= edac_pci_idx
++;
200 res
= of_address_to_resource(of_node
, 0, &r
);
202 pr_err("%s: Unable to get resource for PCI err regs\n", __func__
);
206 /* we only need the error registers */
209 if (!devm_request_mem_region(&op
->dev
, r
.start
, resource_size(&r
),
211 pr_err("%s: Error while requesting mem region\n", __func__
);
216 pdata
->pci_vbase
= devm_ioremap(&op
->dev
, r
.start
, resource_size(&r
));
217 if (!pdata
->pci_vbase
) {
218 pr_err("%s: Unable to setup PCI err regs\n", __func__
);
223 if (pdata
->is_pcie
) {
224 orig_pci_err_cap_dr
=
225 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_ADDR
);
226 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_ADDR
, ~0);
228 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_EN
);
229 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_EN
, 0);
231 orig_pci_err_cap_dr
=
232 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_CAP_DR
);
234 /* PCI master abort is expected during config cycles */
235 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_CAP_DR
, 0x40);
238 in_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_EN
);
240 /* disable master abort reporting */
241 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_EN
, ~0x40);
244 /* clear error bits */
245 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_DR
, ~0);
247 /* reset error capture */
248 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_GAS_TIMR
, 0x1);
250 if (edac_pci_add_device(pci
, pdata
->edac_idx
) > 0) {
251 edac_dbg(3, "failed edac_pci_add_device()\n");
255 if (edac_op_state
== EDAC_OPSTATE_INT
) {
256 pdata
->irq
= irq_of_parse_and_map(of_node
, 0);
257 res
= devm_request_irq(&op
->dev
, pdata
->irq
,
260 "[EDAC] PCI err", pci
);
262 pr_err("%s: Unable to request irq %d for MPC85xx PCI err\n",
263 __func__
, pdata
->irq
);
264 irq_dispose_mapping(pdata
->irq
);
269 pr_info(EDAC_MOD_STR
" acquired irq %d for PCI Err\n",
273 if (pdata
->is_pcie
) {
275 * Enable all PCIe error interrupt & error detect except invalid
276 * PEX_CONFIG_ADDR/PEX_CONFIG_DATA access interrupt generation
277 * enable bit and invalid PEX_CONFIG_ADDR/PEX_CONFIG_DATA access
278 * detection enable bit. Because PCIe bus code to initialize and
279 * configure these PCIe devices on booting will use some invalid
280 * PEX_CONFIG_ADDR/PEX_CONFIG_DATA, edac driver prints the much
281 * notice information. So disable this detect to fix ugly print.
283 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_EN
, ~0
284 & ~PEX_ERR_ICCAIE_EN_BIT
);
285 out_be32(pdata
->pci_vbase
+ MPC85XX_PCI_ERR_ADDR
, 0
286 | PEX_ERR_ICCAD_DISR_BIT
);
289 devres_remove_group(&op
->dev
, mpc85xx_pci_err_probe
);
290 edac_dbg(3, "success\n");
291 pr_info(EDAC_MOD_STR
" PCI err registered\n");
296 edac_pci_del_device(&op
->dev
);
298 edac_pci_free_ctl_info(pci
);
299 devres_release_group(&op
->dev
, mpc85xx_pci_err_probe
);
303 static const struct platform_device_id mpc85xx_pci_err_match
[] = {
305 .name
= "mpc85xx-pci-edac"
310 static struct platform_driver mpc85xx_pci_err_driver
= {
311 .probe
= mpc85xx_pci_err_probe
,
312 .id_table
= mpc85xx_pci_err_match
,
314 .name
= "mpc85xx_pci_err",
315 .suppress_bind_attrs
= true,
318 #endif /* CONFIG_PCI */
320 /**************************** L2 Err device ***************************/
322 /************************ L2 SYSFS parts ***********************************/
324 static ssize_t
mpc85xx_l2_inject_data_hi_show(struct edac_device_ctl_info
325 *edac_dev
, char *data
)
327 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
328 return sprintf(data
, "0x%08x",
329 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINJHI
));
332 static ssize_t
mpc85xx_l2_inject_data_lo_show(struct edac_device_ctl_info
333 *edac_dev
, char *data
)
335 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
336 return sprintf(data
, "0x%08x",
337 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINJLO
));
340 static ssize_t
mpc85xx_l2_inject_ctrl_show(struct edac_device_ctl_info
341 *edac_dev
, char *data
)
343 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
344 return sprintf(data
, "0x%08x",
345 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINJCTL
));
348 static ssize_t
mpc85xx_l2_inject_data_hi_store(struct edac_device_ctl_info
349 *edac_dev
, const char *data
,
352 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
353 if (isdigit(*data
)) {
354 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINJHI
,
355 simple_strtoul(data
, NULL
, 0));
361 static ssize_t
mpc85xx_l2_inject_data_lo_store(struct edac_device_ctl_info
362 *edac_dev
, const char *data
,
365 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
366 if (isdigit(*data
)) {
367 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINJLO
,
368 simple_strtoul(data
, NULL
, 0));
374 static ssize_t
mpc85xx_l2_inject_ctrl_store(struct edac_device_ctl_info
375 *edac_dev
, const char *data
,
378 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
379 if (isdigit(*data
)) {
380 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINJCTL
,
381 simple_strtoul(data
, NULL
, 0));
387 static struct edac_dev_sysfs_attribute mpc85xx_l2_sysfs_attributes
[] = {
390 .name
= "inject_data_hi",
391 .mode
= (S_IRUGO
| S_IWUSR
)
393 .show
= mpc85xx_l2_inject_data_hi_show
,
394 .store
= mpc85xx_l2_inject_data_hi_store
},
397 .name
= "inject_data_lo",
398 .mode
= (S_IRUGO
| S_IWUSR
)
400 .show
= mpc85xx_l2_inject_data_lo_show
,
401 .store
= mpc85xx_l2_inject_data_lo_store
},
404 .name
= "inject_ctrl",
405 .mode
= (S_IRUGO
| S_IWUSR
)
407 .show
= mpc85xx_l2_inject_ctrl_show
,
408 .store
= mpc85xx_l2_inject_ctrl_store
},
412 .attr
= {.name
= NULL
}
416 static void mpc85xx_set_l2_sysfs_attributes(struct edac_device_ctl_info
419 edac_dev
->sysfs_attributes
= mpc85xx_l2_sysfs_attributes
;
422 /***************************** L2 ops ***********************************/
424 static void mpc85xx_l2_check(struct edac_device_ctl_info
*edac_dev
)
426 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
429 err_detect
= in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDET
);
431 if (!(err_detect
& L2_EDE_MASK
))
434 pr_err("ECC Error in CPU L2 cache\n");
435 pr_err("L2 Error Detect Register: 0x%08x\n", err_detect
);
436 pr_err("L2 Error Capture Data High Register: 0x%08x\n",
437 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_CAPTDATAHI
));
438 pr_err("L2 Error Capture Data Lo Register: 0x%08x\n",
439 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_CAPTDATALO
));
440 pr_err("L2 Error Syndrome Register: 0x%08x\n",
441 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_CAPTECC
));
442 pr_err("L2 Error Attributes Capture Register: 0x%08x\n",
443 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRATTR
));
444 pr_err("L2 Error Address Capture Register: 0x%08x\n",
445 in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRADDR
));
447 /* clear error detect register */
448 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDET
, err_detect
);
450 if (err_detect
& L2_EDE_CE_MASK
)
451 edac_device_handle_ce(edac_dev
, 0, 0, edac_dev
->ctl_name
);
453 if (err_detect
& L2_EDE_UE_MASK
)
454 edac_device_handle_ue(edac_dev
, 0, 0, edac_dev
->ctl_name
);
457 static irqreturn_t
mpc85xx_l2_isr(int irq
, void *dev_id
)
459 struct edac_device_ctl_info
*edac_dev
= dev_id
;
460 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
463 err_detect
= in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDET
);
465 if (!(err_detect
& L2_EDE_MASK
))
468 mpc85xx_l2_check(edac_dev
);
473 static int mpc85xx_l2_err_probe(struct platform_device
*op
)
475 struct edac_device_ctl_info
*edac_dev
;
476 struct mpc85xx_l2_pdata
*pdata
;
480 if (!devres_open_group(&op
->dev
, mpc85xx_l2_err_probe
, GFP_KERNEL
))
483 edac_dev
= edac_device_alloc_ctl_info(sizeof(*pdata
),
484 "cpu", 1, "L", 1, 2, NULL
, 0,
487 devres_release_group(&op
->dev
, mpc85xx_l2_err_probe
);
491 pdata
= edac_dev
->pvt_info
;
492 pdata
->name
= "mpc85xx_l2_err";
493 edac_dev
->dev
= &op
->dev
;
494 dev_set_drvdata(edac_dev
->dev
, edac_dev
);
495 edac_dev
->ctl_name
= pdata
->name
;
496 edac_dev
->dev_name
= pdata
->name
;
498 res
= of_address_to_resource(op
->dev
.of_node
, 0, &r
);
500 pr_err("%s: Unable to get resource for L2 err regs\n", __func__
);
504 /* we only need the error registers */
507 if (!devm_request_mem_region(&op
->dev
, r
.start
, resource_size(&r
),
509 pr_err("%s: Error while requesting mem region\n", __func__
);
514 pdata
->l2_vbase
= devm_ioremap(&op
->dev
, r
.start
, resource_size(&r
));
515 if (!pdata
->l2_vbase
) {
516 pr_err("%s: Unable to setup L2 err regs\n", __func__
);
521 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDET
, ~0);
523 orig_l2_err_disable
= in_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDIS
);
525 /* clear the err_dis */
526 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDIS
, 0);
528 edac_dev
->mod_name
= EDAC_MOD_STR
;
530 if (edac_op_state
== EDAC_OPSTATE_POLL
)
531 edac_dev
->edac_check
= mpc85xx_l2_check
;
533 mpc85xx_set_l2_sysfs_attributes(edac_dev
);
535 pdata
->edac_idx
= edac_dev_idx
++;
537 if (edac_device_add_device(edac_dev
) > 0) {
538 edac_dbg(3, "failed edac_device_add_device()\n");
542 if (edac_op_state
== EDAC_OPSTATE_INT
) {
543 pdata
->irq
= irq_of_parse_and_map(op
->dev
.of_node
, 0);
544 res
= devm_request_irq(&op
->dev
, pdata
->irq
,
545 mpc85xx_l2_isr
, IRQF_SHARED
,
546 "[EDAC] L2 err", edac_dev
);
548 pr_err("%s: Unable to request irq %d for MPC85xx L2 err\n",
549 __func__
, pdata
->irq
);
550 irq_dispose_mapping(pdata
->irq
);
555 pr_info(EDAC_MOD_STR
" acquired irq %d for L2 Err\n", pdata
->irq
);
557 edac_dev
->op_state
= OP_RUNNING_INTERRUPT
;
559 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINTEN
, L2_EIE_MASK
);
562 devres_remove_group(&op
->dev
, mpc85xx_l2_err_probe
);
564 edac_dbg(3, "success\n");
565 pr_info(EDAC_MOD_STR
" L2 err registered\n");
570 edac_device_del_device(&op
->dev
);
572 devres_release_group(&op
->dev
, mpc85xx_l2_err_probe
);
573 edac_device_free_ctl_info(edac_dev
);
577 static int mpc85xx_l2_err_remove(struct platform_device
*op
)
579 struct edac_device_ctl_info
*edac_dev
= dev_get_drvdata(&op
->dev
);
580 struct mpc85xx_l2_pdata
*pdata
= edac_dev
->pvt_info
;
584 if (edac_op_state
== EDAC_OPSTATE_INT
) {
585 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRINTEN
, 0);
586 irq_dispose_mapping(pdata
->irq
);
589 out_be32(pdata
->l2_vbase
+ MPC85XX_L2_ERRDIS
, orig_l2_err_disable
);
590 edac_device_del_device(&op
->dev
);
591 edac_device_free_ctl_info(edac_dev
);
595 static const struct of_device_id mpc85xx_l2_err_of_match
[] = {
596 /* deprecate the fsl,85.. forms in the future, 2.6.30? */
597 { .compatible
= "fsl,8540-l2-cache-controller", },
598 { .compatible
= "fsl,8541-l2-cache-controller", },
599 { .compatible
= "fsl,8544-l2-cache-controller", },
600 { .compatible
= "fsl,8548-l2-cache-controller", },
601 { .compatible
= "fsl,8555-l2-cache-controller", },
602 { .compatible
= "fsl,8568-l2-cache-controller", },
603 { .compatible
= "fsl,mpc8536-l2-cache-controller", },
604 { .compatible
= "fsl,mpc8540-l2-cache-controller", },
605 { .compatible
= "fsl,mpc8541-l2-cache-controller", },
606 { .compatible
= "fsl,mpc8544-l2-cache-controller", },
607 { .compatible
= "fsl,mpc8548-l2-cache-controller", },
608 { .compatible
= "fsl,mpc8555-l2-cache-controller", },
609 { .compatible
= "fsl,mpc8560-l2-cache-controller", },
610 { .compatible
= "fsl,mpc8568-l2-cache-controller", },
611 { .compatible
= "fsl,mpc8569-l2-cache-controller", },
612 { .compatible
= "fsl,mpc8572-l2-cache-controller", },
613 { .compatible
= "fsl,p1020-l2-cache-controller", },
614 { .compatible
= "fsl,p1021-l2-cache-controller", },
615 { .compatible
= "fsl,p2020-l2-cache-controller", },
618 MODULE_DEVICE_TABLE(of
, mpc85xx_l2_err_of_match
);
620 static struct platform_driver mpc85xx_l2_err_driver
= {
621 .probe
= mpc85xx_l2_err_probe
,
622 .remove
= mpc85xx_l2_err_remove
,
624 .name
= "mpc85xx_l2_err",
625 .of_match_table
= mpc85xx_l2_err_of_match
,
629 static const struct of_device_id mpc85xx_mc_err_of_match
[] = {
630 /* deprecate the fsl,85.. forms in the future, 2.6.30? */
631 { .compatible
= "fsl,8540-memory-controller", },
632 { .compatible
= "fsl,8541-memory-controller", },
633 { .compatible
= "fsl,8544-memory-controller", },
634 { .compatible
= "fsl,8548-memory-controller", },
635 { .compatible
= "fsl,8555-memory-controller", },
636 { .compatible
= "fsl,8568-memory-controller", },
637 { .compatible
= "fsl,mpc8536-memory-controller", },
638 { .compatible
= "fsl,mpc8540-memory-controller", },
639 { .compatible
= "fsl,mpc8541-memory-controller", },
640 { .compatible
= "fsl,mpc8544-memory-controller", },
641 { .compatible
= "fsl,mpc8548-memory-controller", },
642 { .compatible
= "fsl,mpc8555-memory-controller", },
643 { .compatible
= "fsl,mpc8560-memory-controller", },
644 { .compatible
= "fsl,mpc8568-memory-controller", },
645 { .compatible
= "fsl,mpc8569-memory-controller", },
646 { .compatible
= "fsl,mpc8572-memory-controller", },
647 { .compatible
= "fsl,mpc8349-memory-controller", },
648 { .compatible
= "fsl,p1020-memory-controller", },
649 { .compatible
= "fsl,p1021-memory-controller", },
650 { .compatible
= "fsl,p2020-memory-controller", },
651 { .compatible
= "fsl,qoriq-memory-controller", },
654 MODULE_DEVICE_TABLE(of
, mpc85xx_mc_err_of_match
);
656 static struct platform_driver mpc85xx_mc_err_driver
= {
657 .probe
= fsl_mc_err_probe
,
658 .remove
= fsl_mc_err_remove
,
660 .name
= "mpc85xx_mc_err",
661 .of_match_table
= mpc85xx_mc_err_of_match
,
665 static struct platform_driver
* const drivers
[] = {
666 &mpc85xx_mc_err_driver
,
667 &mpc85xx_l2_err_driver
,
669 &mpc85xx_pci_err_driver
,
673 static int __init
mpc85xx_mc_init(void)
676 u32 __maybe_unused pvr
= 0;
678 pr_info("Freescale(R) MPC85xx EDAC driver, (C) 2006 Montavista Software\n");
680 /* make sure error reporting method is sane */
681 switch (edac_op_state
) {
682 case EDAC_OPSTATE_POLL
:
683 case EDAC_OPSTATE_INT
:
686 edac_op_state
= EDAC_OPSTATE_INT
;
690 res
= platform_register_drivers(drivers
, ARRAY_SIZE(drivers
));
692 pr_warn(EDAC_MOD_STR
"drivers fail to register\n");
697 module_init(mpc85xx_mc_init
);
699 static void __exit
mpc85xx_mc_exit(void)
701 platform_unregister_drivers(drivers
, ARRAY_SIZE(drivers
));
704 module_exit(mpc85xx_mc_exit
);
706 MODULE_LICENSE("GPL");
707 MODULE_AUTHOR("Montavista Software, Inc.");
708 module_param(edac_op_state
, int, 0444);
709 MODULE_PARM_DESC(edac_op_state
,
710 "EDAC Error Reporting state: 0=Poll, 2=Interrupt");