@@ -3210,7 +3210,7 @@ static void umc_determine_ecc_sym_sz(struct amd64_pvt *pvt)
/*
* Retrieve the hardware registers of the memory controller.
*/
-static void __read_mc_regs_df(struct amd64_pvt *pvt)
+static void umc_read_mc_regs(struct amd64_pvt *pvt)
{
u8 nid = pvt->mc_node_id;
struct amd64_umc *umc;
@@ -3234,7 +3234,7 @@ static void __read_mc_regs_df(struct amd64_pvt *pvt)
* Retrieve the hardware registers of the memory controller (this includes the
* 'Address Map' and 'Misc' device regs)
*/
-static void read_mc_regs(struct amd64_pvt *pvt)
+static void dct_read_mc_regs(struct amd64_pvt *pvt)
{
unsigned int range;
u64 msr_val;
@@ -3255,12 +3255,6 @@ static void read_mc_regs(struct amd64_pvt *pvt)
edac_dbg(0, " TOP_MEM2 disabled\n");
}
- if (pvt->umc) {
- __read_mc_regs_df(pvt);
-
- goto skip;
- }
-
amd64_read_pci_cfg(pvt->F3, NBCAP, &pvt->nbcap);
read_dram_ctl_register(pvt);
@@ -3300,15 +3294,6 @@ static void read_mc_regs(struct amd64_pvt *pvt)
amd64_read_dct_pci_cfg(pvt, 1, DCLR0, &pvt->dclr1);
amd64_read_dct_pci_cfg(pvt, 1, DCHR0, &pvt->dchr1);
}
-
-skip:
- pvt->ops->prep_chip_selects(pvt);
-
- pvt->ops->read_base_mask(pvt);
-
- pvt->ops->determine_memory_type(pvt);
-
- pvt->ops->determine_ecc_sym_sz(pvt);
}
/*
@@ -3766,6 +3751,7 @@ static struct low_ops umc_ops = {
.read_base_mask = umc_read_base_mask,
.determine_memory_type = umc_determine_memory_type,
.determine_ecc_sym_sz = umc_determine_ecc_sym_sz,
+ .read_mc_regs = umc_read_mc_regs,
};
/* Use Family 16h versions for defaults and adjust as needed below. */
@@ -3777,6 +3763,7 @@ static struct low_ops dct_ops = {
.read_base_mask = dct_read_base_mask,
.determine_memory_type = dct_determine_memory_type,
.determine_ecc_sym_sz = dct_determine_ecc_sym_sz,
+ .read_mc_regs = dct_read_mc_regs,
};
static int per_family_init(struct amd64_pvt *pvt)
@@ -3938,7 +3925,15 @@ static int hw_info_get(struct amd64_pvt *pvt)
if (ret)
return ret;
- read_mc_regs(pvt);
+ pvt->ops->read_mc_regs(pvt);
+
+ pvt->ops->prep_chip_selects(pvt);
+
+ pvt->ops->read_base_mask(pvt);
+
+ pvt->ops->determine_memory_type(pvt);
+
+ pvt->ops->determine_ecc_sym_sz(pvt);
return 0;
}
@@ -472,6 +472,7 @@ struct low_ops {
void (*read_base_mask)(struct amd64_pvt *pvt);
void (*determine_memory_type)(struct amd64_pvt *pvt);
void (*determine_ecc_sym_sz)(struct amd64_pvt *pvt);
+ void (*read_mc_regs)(struct amd64_pvt *pvt);
};
int __amd64_read_pci_cfg_dword(struct pci_dev *pdev, int offset,