diff options
author | Elyes HAOUAS <ehaouas@noos.fr> | 2018-10-12 10:54:30 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-10-18 12:51:26 +0000 |
commit | 400ce55566caa541304b2483e61bcc2df941998c (patch) | |
tree | 4e0cbf4aef7fb00a9c40327075ffa9737e56b104 /src/cpu/amd/car/cache_as_ram.inc | |
parent | e64a585374de88ea896ed517445a34986aa321b9 (diff) |
cpu/amd: Use common AMD's MSR
Phase 1. Due to the size of the effort, this CL is broken into several
phases.
Change-Id: I0236e0960cd1e79558ea50c814e1de2830aa0550
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/29065
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Richard Spiegel <richard.spiegel@silverbackltd.com>
Diffstat (limited to 'src/cpu/amd/car/cache_as_ram.inc')
-rw-r--r-- | src/cpu/amd/car/cache_as_ram.inc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/cpu/amd/car/cache_as_ram.inc b/src/cpu/amd/car/cache_as_ram.inc index c773bd65bc..7cbf1dbcbb 100644 --- a/src/cpu/amd/car/cache_as_ram.inc +++ b/src/cpu/amd/car/cache_as_ram.inc @@ -17,6 +17,7 @@ #include <cpu/x86/mtrr.h> #include <cpu/x86/cache.h> +#include <cpu/amd/msr.h> #include <cpu/amd/mtrr.h> #define CacheSize CONFIG_DCACHE_RAM_SIZE @@ -27,9 +28,6 @@ /* For CAR with Fam10h. */ #define CacheSizeAPStack CONFIG_DCACHE_AP_STACK_SIZE -#define MSR_MCFG_BASE 0xC0010058 -#define MSR_BU_CFG2 0xC001102A - #define jmp_if_not_k8(x) comisd %xmm2, %xmm1; jae x #define jmp_if_k8(x) comisd %xmm2, %xmm1; jb x #define jmp_if_not_fam15h(x) comisd %xmm3, %xmm1; jb x @@ -130,13 +128,13 @@ CAR_FAM10_out: * Errata 193: Disable clean copybacks to L3 cache to allow cached ROM. * Re-enable it in after RAM is initialized and before CAR is disabled. */ - movl $MSR_BU_CFG2, %ecx + movl $BU_CFG2_MSR, %ecx rdmsr bts $15, %eax /* Set bit 15 in EDX:EAX (bit 15 in EAX). */ wrmsr /* Erratum 343, RevGuide for Fam10h, Pub#41322 Rev. 3.33 */ - movl $MSR_BU_CFG2, %ecx + movl $BU_CFG2_MSR, %ecx rdmsr bts $35-32, %edx /* Set bit 35 in EDX:EAX (bit 3 in EDX). */ wrmsr @@ -171,7 +169,7 @@ CAR_FAM10_errata_applied: #else #error "bad MMCONF_BUS_NUMBER value" #endif - movl $MSR_MCFG_BASE, %ecx + movl $MMIO_CONF_BASE, %ecx wrmsr #endif @@ -179,7 +177,7 @@ CAR_FAM10_out_post_errata: /* Fam15h APIC IDs do not depend on NB config bit 54 */ jmp_if_not_fam15h(skip_nb54_set) - movl $0xc001001f, %ecx /* NB_CFG_MSR */ + movl $NB_CFG_MSR, %ecx rdmsr bts $(54 - 32), %edx /* Set NB config bit 54 */ wrmsr @@ -227,7 +225,7 @@ skip_cu_check: jmp_if_not_fam15h(CAR_FAM15_errata_applied) /* Erratum 714, RevGuide for Fam15h, Pub#48063 Rev. 3.24 */ - movl $MSR_BU_CFG2, %ecx + movl $BU_CFG2_MSR, %ecx rdmsr bts $8, %eax /* Set bit 8 in EDX:EAX (bit 8 in EAX). */ wrmsr @@ -410,7 +408,7 @@ fam10_mtrr_setup_complete: post_code(0xa1) /* Disable conversion of INVD to WBINVD (INVDWBINVD = 0) */ - mov $0xc0010015, %ecx + mov $HWCR_MSR, %ecx rdmsr btr $4, %eax wrmsr @@ -522,7 +520,7 @@ CAR_FAM10_ap: * system with no obvious clues of what went wrong. * * So, need to get the NodeID and CoreID at first. - * If NB_CFG bit 54 is set just use initial APIC ID, otherwise need + * If NB_CFG_MSR bit 54 is set just use initial APIC ID, otherwise need * to reverse it. */ @@ -539,7 +537,7 @@ CAR_FAM10_ap: shrl $24, %ebx /* Get the nb cfg bit 54. */ - movl $0xc001001f, %ecx /* NB_CFG_MSR */ + movl $NB_CFG_MSR, %ecx rdmsr movl %edi, %ecx /* CoreID bits */ bt $(54 - 32), %edx |