From e67d2404444c473f1fbec849f5175c13a4e3743f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 29 Oct 2015 01:09:55 -0500 Subject: cpu/amd/car: Honor BKDG recommendations for DisFillP in CAR The recommendation to set DisFillP during CAR initialization on K8 NPT CPUs was ignored. The consequences of this are largely unknown; fix up coreboot to follow the recommendations. Change-Id: Ide512bbc1d9aa284179628e2aa598ef5475e8eeb Signed-off-by: Timothy Pearson Reviewed-on: http://review.coreboot.org/12249 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Ronald G. Minnich --- src/cpu/amd/car/cache_as_ram.inc | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/cpu/amd') diff --git a/src/cpu/amd/car/cache_as_ram.inc b/src/cpu/amd/car/cache_as_ram.inc index 0b2bc60bea..2a33dc1171 100644 --- a/src/cpu/amd/car/cache_as_ram.inc +++ b/src/cpu/amd/car/cache_as_ram.inc @@ -34,6 +34,7 @@ #define MSR_MCFG_BASE 0xC0010058 #define MSR_FAM10 0xC001102A +#define jmp_if_not_k8(x) comisd %xmm2, %xmm1; jae x #define jmp_if_k8(x) comisd %xmm2, %xmm1; jb x #define CPUID_MASK 0x0ff00f00 @@ -344,6 +345,19 @@ wbcache_post_fam10_setup: andl $(~(CR0_CacheDisable | CR0_NoWriteThrough)), %eax movl %eax, %cr0 + jmp_if_not_k8(CAR_skip_k8_errata_part1) + + /* Set DisFillP on BSP. */ + movl $0x8000c068, %eax + movw $0xcf8, %dx + outl %eax, %dx + addw $4, %dx + inl %dx, %eax + bts $10, %eax + outl %eax, %dx + +CAR_skip_k8_errata_part1: + jmp_if_k8(fam10_end_part1) /* So we need to check if it is BSP. */ @@ -367,6 +381,19 @@ fam10_end_part1: xorl %eax, %eax rep stosl + jmp_if_not_k8(CAR_skip_k8_errata_part2) + + /* Clear DisFillP on BSP. */ + movl $0x8000c068, %eax + movw $0xcf8, %dx + outl %eax, %dx + addw $4, %dx + inl %dx, %eax + btr $10, %eax + outl %eax, %dx + +CAR_skip_k8_errata_part2: + /* Set up the stack pointer. */ movl $(CacheBase + CacheSize), %eax movl %eax, %esp -- cgit v1.2.3