diff options
Diffstat (limited to 'drivers/edac/ppc4xx_edac.c')
-rw-r--r-- | drivers/edac/ppc4xx_edac.c | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/drivers/edac/ppc4xx_edac.c b/drivers/edac/ppc4xx_edac.c index d427c69bb8b1..f3f9fed06ad7 100644 --- a/drivers/edac/ppc4xx_edac.c +++ b/drivers/edac/ppc4xx_edac.c | |||
@@ -727,7 +727,10 @@ ppc4xx_edac_handle_ce(struct mem_ctl_info *mci, | |||
727 | 727 | ||
728 | for (row = 0; row < mci->nr_csrows; row++) | 728 | for (row = 0; row < mci->nr_csrows; row++) |
729 | if (ppc4xx_edac_check_bank_error(status, row)) | 729 | if (ppc4xx_edac_check_bank_error(status, row)) |
730 | edac_mc_handle_ce_no_info(mci, message); | 730 | edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, |
731 | 0, 0, 0, | ||
732 | row, 0, -1, | ||
733 | message, "", NULL); | ||
731 | } | 734 | } |
732 | 735 | ||
733 | /** | 736 | /** |
@@ -755,7 +758,10 @@ ppc4xx_edac_handle_ue(struct mem_ctl_info *mci, | |||
755 | 758 | ||
756 | for (row = 0; row < mci->nr_csrows; row++) | 759 | for (row = 0; row < mci->nr_csrows; row++) |
757 | if (ppc4xx_edac_check_bank_error(status, row)) | 760 | if (ppc4xx_edac_check_bank_error(status, row)) |
758 | edac_mc_handle_ue(mci, page, offset, row, message); | 761 | edac_mc_handle_error(HW_EVENT_ERR_UNCORRECTED, mci, |
762 | page, offset, 0, | ||
763 | row, 0, -1, | ||
764 | message, "", NULL); | ||
759 | } | 765 | } |
760 | 766 | ||
761 | /** | 767 | /** |
@@ -895,9 +901,8 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1) | |||
895 | enum mem_type mtype; | 901 | enum mem_type mtype; |
896 | enum dev_type dtype; | 902 | enum dev_type dtype; |
897 | enum edac_type edac_mode; | 903 | enum edac_type edac_mode; |
898 | int row; | 904 | int row, j; |
899 | u32 mbxcf, size; | 905 | u32 mbxcf, size, nr_pages; |
900 | static u32 ppc4xx_last_page; | ||
901 | 906 | ||
902 | /* Establish the memory type and width */ | 907 | /* Establish the memory type and width */ |
903 | 908 | ||
@@ -948,7 +953,7 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1) | |||
948 | case SDRAM_MBCF_SZ_2GB: | 953 | case SDRAM_MBCF_SZ_2GB: |
949 | case SDRAM_MBCF_SZ_4GB: | 954 | case SDRAM_MBCF_SZ_4GB: |
950 | case SDRAM_MBCF_SZ_8GB: | 955 | case SDRAM_MBCF_SZ_8GB: |
951 | csi->nr_pages = SDRAM_MBCF_SZ_TO_PAGES(size); | 956 | nr_pages = SDRAM_MBCF_SZ_TO_PAGES(size); |
952 | break; | 957 | break; |
953 | default: | 958 | default: |
954 | ppc4xx_edac_mc_printk(KERN_ERR, mci, | 959 | ppc4xx_edac_mc_printk(KERN_ERR, mci, |
@@ -959,10 +964,6 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1) | |||
959 | goto done; | 964 | goto done; |
960 | } | 965 | } |
961 | 966 | ||
962 | csi->first_page = ppc4xx_last_page; | ||
963 | csi->last_page = csi->first_page + csi->nr_pages - 1; | ||
964 | csi->page_mask = 0; | ||
965 | |||
966 | /* | 967 | /* |
967 | * It's unclear exactly what grain should be set to | 968 | * It's unclear exactly what grain should be set to |
968 | * here. The SDRAM_ECCES register allows resolution of | 969 | * here. The SDRAM_ECCES register allows resolution of |
@@ -975,15 +976,17 @@ ppc4xx_edac_init_csrows(struct mem_ctl_info *mci, u32 mcopt1) | |||
975 | * possible values would be the PLB width (16), the | 976 | * possible values would be the PLB width (16), the |
976 | * page size (PAGE_SIZE) or the memory width (2 or 4). | 977 | * page size (PAGE_SIZE) or the memory width (2 or 4). |
977 | */ | 978 | */ |
979 | for (j = 0; j < csi->nr_channels; j++) { | ||
980 | struct dimm_info *dimm = csi->channels[j].dimm; | ||
978 | 981 | ||
979 | csi->grain = 1; | 982 | dimm->nr_pages = nr_pages / csi->nr_channels; |
980 | 983 | dimm->grain = 1; | |
981 | csi->mtype = mtype; | ||
982 | csi->dtype = dtype; | ||
983 | 984 | ||
984 | csi->edac_mode = edac_mode; | 985 | dimm->mtype = mtype; |
986 | dimm->dtype = dtype; | ||
985 | 987 | ||
986 | ppc4xx_last_page += csi->nr_pages; | 988 | dimm->edac_mode = edac_mode; |
989 | } | ||
987 | } | 990 | } |
988 | 991 | ||
989 | done: | 992 | done: |
@@ -1236,6 +1239,7 @@ static int __devinit ppc4xx_edac_probe(struct platform_device *op) | |||
1236 | dcr_host_t dcr_host; | 1239 | dcr_host_t dcr_host; |
1237 | const struct device_node *np = op->dev.of_node; | 1240 | const struct device_node *np = op->dev.of_node; |
1238 | struct mem_ctl_info *mci = NULL; | 1241 | struct mem_ctl_info *mci = NULL; |
1242 | struct edac_mc_layer layers[2]; | ||
1239 | static int ppc4xx_edac_instance; | 1243 | static int ppc4xx_edac_instance; |
1240 | 1244 | ||
1241 | /* | 1245 | /* |
@@ -1281,12 +1285,14 @@ static int __devinit ppc4xx_edac_probe(struct platform_device *op) | |||
1281 | * controller instance and perform the appropriate | 1285 | * controller instance and perform the appropriate |
1282 | * initialization. | 1286 | * initialization. |
1283 | */ | 1287 | */ |
1284 | 1288 | layers[0].type = EDAC_MC_LAYER_CHIP_SELECT; | |
1285 | mci = edac_mc_alloc(sizeof(struct ppc4xx_edac_pdata), | 1289 | layers[0].size = ppc4xx_edac_nr_csrows; |
1286 | ppc4xx_edac_nr_csrows, | 1290 | layers[0].is_virt_csrow = true; |
1287 | ppc4xx_edac_nr_chans, | 1291 | layers[1].type = EDAC_MC_LAYER_CHANNEL; |
1288 | ppc4xx_edac_instance); | 1292 | layers[1].size = ppc4xx_edac_nr_chans; |
1289 | 1293 | layers[1].is_virt_csrow = false; | |
1294 | mci = edac_mc_alloc(ppc4xx_edac_instance, ARRAY_SIZE(layers), layers, | ||
1295 | sizeof(struct ppc4xx_edac_pdata)); | ||
1290 | if (mci == NULL) { | 1296 | if (mci == NULL) { |
1291 | ppc4xx_edac_printk(KERN_ERR, "%s: " | 1297 | ppc4xx_edac_printk(KERN_ERR, "%s: " |
1292 | "Failed to allocate EDAC MC instance!\n", | 1298 | "Failed to allocate EDAC MC instance!\n", |