From d50cf23e43bb2e54210b2e719bbf53002814926b Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Wed, 17 Oct 2018 20:18:17 +0200 Subject: {cpu,drivers}/amd: Replace MTRR addresses with macros Change-Id: I315c0b70c552c5dd7f640b18b913350bb88be81b Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/29173 Reviewed-by: Richard Spiegel Tested-by: build bot (Jenkins) --- src/cpu/amd/agesa/family14/fixme.c | 4 ++-- src/cpu/amd/agesa/family14/model_14_init.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cpu/amd/agesa/family14') diff --git a/src/cpu/amd/agesa/family14/fixme.c b/src/cpu/amd/agesa/family14/fixme.c index 33e164354e..978c25ff6f 100644 --- a/src/cpu/amd/agesa/family14/fixme.c +++ b/src/cpu/amd/agesa/family14/fixme.c @@ -90,9 +90,9 @@ void amd_initmmio(void) /* Set ROM cache onto WP to decrease post time */ MsrReg = (0x0100000000ull - CACHE_ROM_SIZE) | MTRR_TYPE_WRPROT; - LibAmdMsrWrite (0x20C, &MsrReg, &StdHeader); + LibAmdMsrWrite(MTRR_PHYS_BASE(6), &MsrReg, &StdHeader); MsrReg = ((1ULL << CONFIG_CPU_ADDR_BITS) - CACHE_ROM_SIZE) | MTRR_PHYS_MASK_VALID; - LibAmdMsrWrite (0x20D, &MsrReg, &StdHeader); + LibAmdMsrWrite(MTRR_PHYS_MASK(6), &MsrReg, &StdHeader); /* Set P-state 0 (1600 MHz) early to save a few ms of boot time */ MsrReg = 0; diff --git a/src/cpu/amd/agesa/family14/model_14_init.c b/src/cpu/amd/agesa/family14/model_14_init.c index 3f0501e5cb..12f3ef1633 100644 --- a/src/cpu/amd/agesa/family14/model_14_init.c +++ b/src/cpu/amd/agesa/family14/model_14_init.c @@ -55,11 +55,11 @@ static void model_14_init(struct device *dev) /* Set shadow WB, RdMEM, WrMEM */ msr.lo = msr.hi = 0; - wrmsr (0x259, msr); + wrmsr(MTRR_FIX_16K_A0000, msr); msr.lo = msr.hi = 0x1e1e1e1e; - wrmsr(0x250, msr); - wrmsr(0x258, msr); - for (msrno = 0x268; msrno <= 0x26f; msrno++) + wrmsr(MTRR_FIX_64K_00000, msr); + wrmsr(MTRR_FIX_16K_80000, msr); + for (msrno = MTRR_FIX_4K_C0000; msrno <= MTRR_FIX_4K_F8000; msrno++) wrmsr(msrno, msr); msr = rdmsr(SYSCFG_MSR); -- cgit v1.2.3