2016-08-23 22:14:03 +00:00
|
|
|
/*
|
|
|
|
* Freescale Memory Controller kernel module
|
|
|
|
*
|
|
|
|
* Author: York Sun <york.sun@nxp.com>
|
|
|
|
*
|
|
|
|
* Copyright 2016 NXP Semiconductor
|
|
|
|
*
|
|
|
|
* Derived from mpc85xx_edac.c
|
|
|
|
* Author: Dave Jiang <djiang@mvista.com>
|
|
|
|
*
|
|
|
|
* 2006-2007 (c) MontaVista Software, Inc. This file is licensed under
|
|
|
|
* the terms of the GNU General Public License version 2. This program
|
|
|
|
* is licensed "as is" without any warranty of any kind, whether express
|
|
|
|
* or implied.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
|
|
|
2016-10-29 17:16:34 +00:00
|
|
|
#include "edac_module.h"
|
2016-08-23 22:14:03 +00:00
|
|
|
#include "fsl_ddr_edac.h"
|
|
|
|
|
|
|
|
static const struct of_device_id fsl_ddr_mc_err_of_match[] = {
|
|
|
|
{ .compatible = "fsl,qoriq-memory-controller", },
|
2024-10-16 20:31:13 +00:00
|
|
|
{ .compatible = "nxp,imx9-memory-controller", .data = (void *)TYPE_IMX9, },
|
2016-08-23 22:14:03 +00:00
|
|
|
{},
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, fsl_ddr_mc_err_of_match);
|
|
|
|
|
|
|
|
static struct platform_driver fsl_ddr_mc_err_driver = {
|
|
|
|
.probe = fsl_mc_err_probe,
|
2024-12-01 23:12:43 +00:00
|
|
|
.remove = fsl_mc_err_remove,
|
2016-08-23 22:14:03 +00:00
|
|
|
.driver = {
|
|
|
|
.name = "fsl_ddr_mc_err",
|
|
|
|
.of_match_table = fsl_ddr_mc_err_of_match,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init fsl_ddr_mc_init(void)
|
|
|
|
{
|
|
|
|
int res;
|
|
|
|
|
2022-10-10 02:35:57 +00:00
|
|
|
if (ghes_get_devices())
|
|
|
|
return -EBUSY;
|
|
|
|
|
2016-08-23 22:14:03 +00:00
|
|
|
/* make sure error reporting method is sane */
|
|
|
|
switch (edac_op_state) {
|
|
|
|
case EDAC_OPSTATE_POLL:
|
|
|
|
case EDAC_OPSTATE_INT:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
edac_op_state = EDAC_OPSTATE_INT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
res = platform_driver_register(&fsl_ddr_mc_err_driver);
|
|
|
|
if (res) {
|
|
|
|
pr_err("MC fails to register\n");
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(fsl_ddr_mc_init);
|
|
|
|
|
|
|
|
static void __exit fsl_ddr_mc_exit(void)
|
|
|
|
{
|
|
|
|
platform_driver_unregister(&fsl_ddr_mc_err_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_exit(fsl_ddr_mc_exit);
|
|
|
|
|
2024-06-17 19:53:52 +00:00
|
|
|
MODULE_DESCRIPTION("Freescale Layerscape EDAC driver");
|
2016-08-23 22:14:03 +00:00
|
|
|
MODULE_LICENSE("GPL");
|
|
|
|
MODULE_AUTHOR("NXP Semiconductor");
|
|
|
|
module_param(edac_op_state, int, 0444);
|
2023-03-28 13:39:43 +00:00
|
|
|
MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll, 2=Interrupt");
|