diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2011-01-17 11:52:57 -0500 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2011-03-17 09:46:23 -0400 |
commit | 5a5d237169152d4d7e4b6105eab15831829fb8e7 (patch) | |
tree | 2cfd8c926c05a70d302d792d9687ab55788c05e7 /drivers/edac | |
parent | b15f0fcab1ab85c773c9fa235c76e6ce90b7462e (diff) |
amd64_edac: Sanitize ->read_dram_ctl_register
This function is relevant for F10h and higher, and it has only one
callsite so drop its function pointer from the low_ops struct.
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/amd64_edac.c | 14 | ||||
-rw-r--r-- | drivers/edac/amd64_edac.h | 2 |
2 files changed, 7 insertions, 9 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 1cd82f9efb77..b85487d4de8d 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
@@ -1138,16 +1138,18 @@ static int f10_dbam_to_chip_select(struct amd64_pvt *pvt, int cs_mode) | |||
1138 | return dbam_map[cs_mode]; | 1138 | return dbam_map[cs_mode]; |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | static void f10_read_dram_ctl_register(struct amd64_pvt *pvt) | 1141 | static void read_dram_ctl_register(struct amd64_pvt *pvt) |
1142 | { | 1142 | { |
1143 | 1143 | ||
1144 | if (boot_cpu_data.x86 == 0xf) | ||
1145 | return; | ||
1146 | |||
1144 | if (!amd64_read_dct_pci_cfg(pvt, DCT_SEL_LO, &pvt->dct_sel_lo)) { | 1147 | if (!amd64_read_dct_pci_cfg(pvt, DCT_SEL_LO, &pvt->dct_sel_lo)) { |
1145 | debugf0("F2x110 (DCTSelLow): 0x%08x, High range addrs at: 0x%x\n", | 1148 | debugf0("F2x110 (DCTSelLow): 0x%08x, High range addrs at: 0x%x\n", |
1146 | pvt->dct_sel_lo, dct_sel_baseaddr(pvt)); | 1149 | pvt->dct_sel_lo, dct_sel_baseaddr(pvt)); |
1147 | 1150 | ||
1148 | debugf0(" mode: %s, All DCTs on: %s\n", | 1151 | debugf0(" DCTs operate in %s mode.\n", |
1149 | (dct_ganging_enabled(pvt) ? "ganged" : "unganged"), | 1152 | (dct_ganging_enabled(pvt) ? "ganged" : "unganged")); |
1150 | (dct_dram_enabled(pvt) ? "yes" : "no")); | ||
1151 | 1153 | ||
1152 | if (!dct_ganging_enabled(pvt)) | 1154 | if (!dct_ganging_enabled(pvt)) |
1153 | debugf0(" Address range split per DCT: %s\n", | 1155 | debugf0(" Address range split per DCT: %s\n", |
@@ -1579,7 +1581,6 @@ static struct amd64_family_type amd64_family_types[] = { | |||
1579 | .f3_id = PCI_DEVICE_ID_AMD_10H_NB_MISC, | 1581 | .f3_id = PCI_DEVICE_ID_AMD_10H_NB_MISC, |
1580 | .ops = { | 1582 | .ops = { |
1581 | .early_channel_count = f1x_early_channel_count, | 1583 | .early_channel_count = f1x_early_channel_count, |
1582 | .read_dram_ctl_register = f10_read_dram_ctl_register, | ||
1583 | .map_sysaddr_to_csrow = f1x_map_sysaddr_to_csrow, | 1584 | .map_sysaddr_to_csrow = f1x_map_sysaddr_to_csrow, |
1584 | .dbam_to_cs = f10_dbam_to_chip_select, | 1585 | .dbam_to_cs = f10_dbam_to_chip_select, |
1585 | .read_dct_pci_cfg = f10_read_dct_pci_cfg, | 1586 | .read_dct_pci_cfg = f10_read_dct_pci_cfg, |
@@ -1939,8 +1940,7 @@ static void read_mc_regs(struct amd64_pvt *pvt) | |||
1939 | 1940 | ||
1940 | amd64_read_pci_cfg(pvt->F3, NBCAP, &pvt->nbcap); | 1941 | amd64_read_pci_cfg(pvt->F3, NBCAP, &pvt->nbcap); |
1941 | 1942 | ||
1942 | if (pvt->ops->read_dram_ctl_register) | 1943 | read_dram_ctl_register(pvt); |
1943 | pvt->ops->read_dram_ctl_register(pvt); | ||
1944 | 1944 | ||
1945 | for (range = 0; range < DRAM_RANGES; range++) { | 1945 | for (range = 0; range < DRAM_RANGES; range++) { |
1946 | u8 rw; | 1946 | u8 rw; |
diff --git a/drivers/edac/amd64_edac.h b/drivers/edac/amd64_edac.h index 3c60b2f2aeb6..e14a8d0ad19f 100644 --- a/drivers/edac/amd64_edac.h +++ b/drivers/edac/amd64_edac.h | |||
@@ -236,7 +236,6 @@ | |||
236 | #define dct_ganging_enabled(pvt) ((boot_cpu_data.x86 == 0x10) && ((pvt)->dct_sel_lo & BIT(4))) | 236 | #define dct_ganging_enabled(pvt) ((boot_cpu_data.x86 == 0x10) && ((pvt)->dct_sel_lo & BIT(4))) |
237 | 237 | ||
238 | #define dct_data_intlv_enabled(pvt) ((pvt)->dct_sel_lo & BIT(5)) | 238 | #define dct_data_intlv_enabled(pvt) ((pvt)->dct_sel_lo & BIT(5)) |
239 | #define dct_dram_enabled(pvt) ((pvt)->dct_sel_lo & BIT(8)) | ||
240 | #define dct_memory_cleared(pvt) ((pvt)->dct_sel_lo & BIT(10)) | 239 | #define dct_memory_cleared(pvt) ((pvt)->dct_sel_lo & BIT(10)) |
241 | 240 | ||
242 | #define SWAP_INTLV_REG 0x10c | 241 | #define SWAP_INTLV_REG 0x10c |
@@ -444,7 +443,6 @@ extern struct mcidev_sysfs_attribute amd64_dbg_attrs[NUM_DBG_ATTRS], | |||
444 | */ | 443 | */ |
445 | struct low_ops { | 444 | struct low_ops { |
446 | int (*early_channel_count) (struct amd64_pvt *pvt); | 445 | int (*early_channel_count) (struct amd64_pvt *pvt); |
447 | void (*read_dram_ctl_register) (struct amd64_pvt *pvt); | ||
448 | void (*map_sysaddr_to_csrow) (struct mem_ctl_info *mci, u64 sys_addr, | 446 | void (*map_sysaddr_to_csrow) (struct mem_ctl_info *mci, u64 sys_addr, |
449 | u16 syndrome); | 447 | u16 syndrome); |
450 | int (*dbam_to_cs) (struct amd64_pvt *pvt, int cs_mode); | 448 | int (*dbam_to_cs) (struct amd64_pvt *pvt, int cs_mode); |