diff options
-rw-r--r-- | drivers/edac/amd64_edac.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index c65ad2d57e06..c6d1aed2943f 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -822,8 +822,7 @@ static enum edac_type amd64_determine_edac_cap(struct amd64_pvt *pvt) | |||
822 | } | 822 | } |
823 | 823 | ||
824 | 824 | ||
825 | static void f10_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt, | 825 | static void amd64_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt); |
826 | int ganged); | ||
827 | 826 | ||
828 | static void amd64_dump_dramcfg_low(u32 dclr, int chan) | 827 | static void amd64_dump_dramcfg_low(u32 dclr, int chan) |
829 | { | 828 | { |
@@ -875,8 +874,10 @@ static void amd64_dump_misc_regs(struct amd64_pvt *pvt) | |||
875 | (pvt->dhar & DHAR_VALID) ? "yes" : "no"); | 874 | (pvt->dhar & DHAR_VALID) ? "yes" : "no"); |
876 | 875 | ||
877 | /* everything below this point is Fam10h and above */ | 876 | /* everything below this point is Fam10h and above */ |
878 | if (boot_cpu_data.x86 == 0xf) | 877 | if (boot_cpu_data.x86 == 0xf) { |
878 | amd64_debug_display_dimm_sizes(0, pvt); | ||
879 | return; | 879 | return; |
880 | } | ||
880 | 881 | ||
881 | /* Only if NOT ganged does dclr1 have valid info */ | 882 | /* Only if NOT ganged does dclr1 have valid info */ |
882 | if (!dct_ganging_enabled(pvt)) | 883 | if (!dct_ganging_enabled(pvt)) |
@@ -888,10 +889,10 @@ static void amd64_dump_misc_regs(struct amd64_pvt *pvt) | |||
888 | */ | 889 | */ |
889 | ganged = dct_ganging_enabled(pvt); | 890 | ganged = dct_ganging_enabled(pvt); |
890 | 891 | ||
891 | f10_debug_display_dimm_sizes(0, pvt, ganged); | 892 | amd64_debug_display_dimm_sizes(0, pvt); |
892 | 893 | ||
893 | if (!ganged) | 894 | if (!ganged) |
894 | f10_debug_display_dimm_sizes(1, pvt, ganged); | 895 | amd64_debug_display_dimm_sizes(1, pvt); |
895 | } | 896 | } |
896 | 897 | ||
897 | /* Read in both of DBAM registers */ | 898 | /* Read in both of DBAM registers */ |
@@ -1726,23 +1727,31 @@ static int map_dbam_to_csrow_size(int index) | |||
1726 | } | 1727 | } |
1727 | 1728 | ||
1728 | /* | 1729 | /* |
1729 | * debug routine to display the memory sizes of a DIMM (ganged or not) and it | 1730 | * debug routine to display the memory sizes of all logical DIMMs and its |
1730 | * CSROWs as well | 1731 | * CSROWs as well |
1731 | */ | 1732 | */ |
1732 | static void f10_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt, | 1733 | static void amd64_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt) |
1733 | int ganged) | ||
1734 | { | 1734 | { |
1735 | int dimm, size0, size1; | 1735 | int dimm, size0, size1; |
1736 | u32 dbam; | 1736 | u32 dbam; |
1737 | u32 *dcsb; | 1737 | u32 *dcsb; |
1738 | 1738 | ||
1739 | debugf1(" dbam%d: 0x%8.08x CSROW is %s\n", ctrl, | 1739 | if (boot_cpu_data.x86 == 0xf) { |
1740 | ctrl ? pvt->dbam1 : pvt->dbam0, | 1740 | /* K8 families < revF not supported yet */ |
1741 | ganged ? "GANGED - dbam1 not used" : "NON-GANGED"); | 1741 | if (pvt->ext_model < OPTERON_CPU_REV_F) |
1742 | return; | ||
1743 | else | ||
1744 | WARN_ON(ctrl != 0); | ||
1745 | } | ||
1746 | |||
1747 | debugf1("F2x%d80 (DRAM Bank Address Mapping): 0x%08x\n", | ||
1748 | ctrl, ctrl ? pvt->dbam1 : pvt->dbam0); | ||
1742 | 1749 | ||
1743 | dbam = ctrl ? pvt->dbam1 : pvt->dbam0; | 1750 | dbam = ctrl ? pvt->dbam1 : pvt->dbam0; |
1744 | dcsb = ctrl ? pvt->dcsb1 : pvt->dcsb0; | 1751 | dcsb = ctrl ? pvt->dcsb1 : pvt->dcsb0; |
1745 | 1752 | ||
1753 | edac_printk(KERN_DEBUG, EDAC_MC, "DCT%d chip selects:\n", ctrl); | ||
1754 | |||
1746 | /* Dump memory sizes for DIMM and its CSROWs */ | 1755 | /* Dump memory sizes for DIMM and its CSROWs */ |
1747 | for (dimm = 0; dimm < 4; dimm++) { | 1756 | for (dimm = 0; dimm < 4; dimm++) { |
1748 | 1757 | ||
@@ -1754,15 +1763,8 @@ static void f10_debug_display_dimm_sizes(int ctrl, struct amd64_pvt *pvt, | |||
1754 | if (dcsb[dimm*2 + 1] & K8_DCSB_CS_ENABLE) | 1763 | if (dcsb[dimm*2 + 1] & K8_DCSB_CS_ENABLE) |
1755 | size1 = map_dbam_to_csrow_size(DBAM_DIMM(dimm, dbam)); | 1764 | size1 = map_dbam_to_csrow_size(DBAM_DIMM(dimm, dbam)); |
1756 | 1765 | ||
1757 | debugf1(" CTRL-%d DIMM-%d=%5dMB CSROW-%d=%5dMB " | 1766 | edac_printk(KERN_DEBUG, EDAC_MC, " %d: %5dMB %d: %5dMB\n", |
1758 | "CSROW-%d=%5dMB\n", | 1767 | dimm * 2, size0, dimm * 2 + 1, size1); |
1759 | ctrl, | ||
1760 | dimm, | ||
1761 | size0 + size1, | ||
1762 | dimm * 2, | ||
1763 | size0, | ||
1764 | dimm * 2 + 1, | ||
1765 | size1); | ||
1766 | } | 1768 | } |
1767 | } | 1769 | } |
1768 | 1770 | ||