aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/cavium-octeon/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/cavium-octeon/setup.c')
-rw-r--r--arch/mips/cavium-octeon/setup.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/arch/mips/cavium-octeon/setup.c b/arch/mips/cavium-octeon/setup.c
index 7c2b7aab77ba..d7e0a09f77c2 100644
--- a/arch/mips/cavium-octeon/setup.c
+++ b/arch/mips/cavium-octeon/setup.c
@@ -1112,18 +1112,30 @@ void __init device_tree_init(void)
1112 unflatten_device_tree(); 1112 unflatten_device_tree();
1113} 1113}
1114 1114
1115static int __initdata disable_octeon_edac_p;
1116
1117static int __init disable_octeon_edac(char *str)
1118{
1119 disable_octeon_edac_p = 1;
1120 return 0;
1121}
1122early_param("disable_octeon_edac", disable_octeon_edac);
1123
1115static char *edac_device_names[] = { 1124static char *edac_device_names[] = {
1116 "co_l2c_edac", 1125 "octeon_l2c_edac",
1117 "co_lmc_edac", 1126 "octeon_pc_edac",
1118 "co_pc_edac",
1119}; 1127};
1120 1128
1121static int __init edac_devinit(void) 1129static int __init edac_devinit(void)
1122{ 1130{
1123 struct platform_device *dev; 1131 struct platform_device *dev;
1124 int i, err = 0; 1132 int i, err = 0;
1133 int num_lmc;
1125 char *name; 1134 char *name;
1126 1135
1136 if (disable_octeon_edac_p)
1137 return 0;
1138
1127 for (i = 0; i < ARRAY_SIZE(edac_device_names); i++) { 1139 for (i = 0; i < ARRAY_SIZE(edac_device_names); i++) {
1128 name = edac_device_names[i]; 1140 name = edac_device_names[i];
1129 dev = platform_device_register_simple(name, -1, NULL, 0); 1141 dev = platform_device_register_simple(name, -1, NULL, 0);
@@ -1133,7 +1145,17 @@ static int __init edac_devinit(void)
1133 } 1145 }
1134 } 1146 }
1135 1147
1148 num_lmc = OCTEON_IS_MODEL(OCTEON_CN68XX) ? 4 :
1149 (OCTEON_IS_MODEL(OCTEON_CN56XX) ? 2 : 1);
1150 for (i = 0; i < num_lmc; i++) {
1151 dev = platform_device_register_simple("octeon_lmc_edac",
1152 i, NULL, 0);
1153 if (IS_ERR(dev)) {
1154 pr_err("Registation of octeon_lmc_edac %d failed!\n", i);
1155 err = PTR_ERR(dev);
1156 }
1157 }
1158
1136 return err; 1159 return err;
1137} 1160}
1138
1139device_initcall(edac_devinit); 1161device_initcall(edac_devinit);