diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2016-06-19 20:38:41 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2016-06-22 11:03:42 +0200 |
commit | 65cc526f6f47755b4492cd9fc2134fb2dd067e90 (patch) | |
tree | 9b7357287b96f73a762592ccc8b7d2153eff1d46 /src/cpu/amd/model_fxx | |
parent | c5400efc11e181caf0babaa6001de18e3f23c6af (diff) |
Ignore RAMTOP for MTRRs
Without RELOCATABLE_RAMSTAGE have WB cache large enough
to cover the greatest ramstage needs, as there is no benefit
of trying to accurately match the actual need. Choose
this to be bottom 16MiB.
With RELOCATABLE_RAMSTAGE write-back cache of low ram is
only useful for bottom 1MiB of RAM as a small part of this gets used
during SMP initialisation before proper MTRR setup.
Change-Id: Icd5f8461f81ed0e671130f1142641a48d1304f30
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/15249
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/cpu/amd/model_fxx')
-rw-r--r-- | src/cpu/amd/model_fxx/init_cpus.c | 2 | ||||
-rw-r--r-- | src/cpu/amd/model_fxx/model_fxx_init.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/cpu/amd/model_fxx/init_cpus.c b/src/cpu/amd/model_fxx/init_cpus.c index 8968e7e0be..51e1b7c849 100644 --- a/src/cpu/amd/model_fxx/init_cpus.c +++ b/src/cpu/amd/model_fxx/init_cpus.c @@ -326,7 +326,7 @@ static u32 init_cpus(u32 cpu_init_detectedx) apicid); } lapic_write(LAPIC_MSG_REG, (apicid << 24) | 0x44); // bsp can not check it before stop_this_cpu - set_var_mtrr(0, 0x00000000, CONFIG_RAMTOP, MTRR_TYPE_WRBACK); + set_var_mtrr(0, 0x00000000, CACHE_TMP_RAMTOP, MTRR_TYPE_WRBACK); #if CONFIG_K8_REV_F_SUPPORT #if CONFIG_MEM_TRAIN_SEQ == 1 train_ram_on_node(id.nodeid, id.coreid, sysinfo, diff --git a/src/cpu/amd/model_fxx/model_fxx_init.c b/src/cpu/amd/model_fxx/model_fxx_init.c index b1e599acb1..cf0b08a04c 100644 --- a/src/cpu/amd/model_fxx/model_fxx_init.c +++ b/src/cpu/amd/model_fxx/model_fxx_init.c @@ -173,12 +173,12 @@ static void set_init_ecc_mtrrs(void) wrmsr(MTRR_PHYS_MASK(i), zero); } - /* Write back cache the first 1MB */ + /* Write back cache from 0x0 to CACHE_TMP_RAMTOP. */ msr.hi = 0x00000000; msr.lo = 0x00000000 | MTRR_TYPE_WRBACK; wrmsr(MTRR_PHYS_BASE(0), msr); msr.hi = 0x000000ff; - msr.lo = ~((CONFIG_RAMTOP) - 1) | 0x800; + msr.lo = ~((CACHE_TMP_RAMTOP) - 1) | 0x800; wrmsr(MTRR_PHYS_MASK(0), msr); /* Set the default type to write combining */ |