src: Use CRx_TYPE type for CRx

Change-Id: If50d9218119d5446d0ce98b8a9297b23bae65c72
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/33816
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Elyes HAOUAS 2019-06-26 20:17:50 +02:00 committed by Martin Roth
parent 7803e487bd
commit 63f98f2304
9 changed files with 16 additions and 13 deletions

View File

@ -417,7 +417,7 @@ asmlinkage void secondary_cpu_init(unsigned int index)
* Seems that CR4 was cleared when AP start via lapic_start_cpu() * Seems that CR4 was cleared when AP start via lapic_start_cpu()
* Turn on CR4.OSFXSR and CR4.OSXMMEXCPT when SSE options enabled * Turn on CR4.OSFXSR and CR4.OSXMMEXCPT when SSE options enabled
*/ */
u32 cr4_val; CRx_TYPE cr4_val;
cr4_val = read_cr4(); cr4_val = read_cr4();
cr4_val |= (CR4_OSFXSR | CR4_OSXMMEXCPT); cr4_val |= (CR4_OSFXSR | CR4_OSXMMEXCPT);
write_cr4(cr4_val); write_cr4(cr4_val);

View File

@ -67,7 +67,7 @@ static inline void clflush(void *addr)
*/ */
static __always_inline void enable_cache(void) static __always_inline void enable_cache(void)
{ {
unsigned long cr0; CRx_TYPE cr0;
cr0 = read_cr0(); cr0 = read_cr0();
cr0 &= ~(CR0_CD | CR0_NW); cr0 &= ~(CR0_CD | CR0_NW);
write_cr0(cr0); write_cr0(cr0);
@ -76,7 +76,7 @@ static __always_inline void enable_cache(void)
static __always_inline void disable_cache(void) static __always_inline void disable_cache(void)
{ {
/* Disable and write back the cache */ /* Disable and write back the cache */
unsigned long cr0; CRx_TYPE cr0;
cr0 = read_cr0(); cr0 = read_cr0();
cr0 |= CR0_CD; cr0 |= CR0_CD;
wbinvd(); wbinvd();

View File

@ -278,7 +278,7 @@ static void TrainDQSRdWrPos_D(struct MCTStatStruc *pMCTstat,
u8 dqsWrDelay_end; u8 dqsWrDelay_end;
u32 addr; u32 addr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
print_debug_dqs("\nTrainDQSRdWrPos: Node_ID ", pDCTstat->Node_ID, 0); print_debug_dqs("\nTrainDQSRdWrPos: Node_ID ", pDCTstat->Node_ID, 0);

View File

@ -129,7 +129,7 @@ static void dqsTrainRcvrEn_SW(struct MCTStatStruc *pMCTstat,
u32 index_reg; u32 index_reg;
u32 ch_start, ch_end, ch; u32 ch_start, ch_end, ch;
u32 msr; u32 msr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
u8 valid; u8 valid;

View File

@ -122,7 +122,7 @@ static void maxRdLatencyTrain_D(struct MCTStatStruc *pMCTstat,
u32 PatternBuffer[60]; // FIXME: why not 48 + 4 u32 PatternBuffer[60]; // FIXME: why not 48 + 4
u32 Margin; u32 Margin;
u32 addr; u32 addr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
u8 valid; u8 valid;

View File

@ -16,6 +16,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <console/console.h> #include <console/console.h>
#include <cpu/x86/cr.h>
#include <string.h> #include <string.h>
#include <arch/cpu.h> #include <arch/cpu.h>
#include <cpu/amd/msr.h> #include <cpu/amd/msr.h>
@ -405,7 +406,7 @@ static void TrainDQSRdWrPos_D_Fam10(struct MCTStatStruc *pMCTstat,
u32 dev; u32 dev;
u32 addr; u32 addr;
u8 valid; u8 valid;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
u32 index_reg; u32 index_reg;
uint32_t TestAddr; uint32_t TestAddr;
@ -1617,7 +1618,7 @@ static void TrainDQSReceiverEnCyc_D_Fam15(struct MCTStatStruc *pMCTstat,
u8 _Wrap32Dis = 0, _SSE2 = 0; u8 _Wrap32Dis = 0, _SSE2 = 0;
u32 addr; u32 addr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
uint8_t dct; uint8_t dct;

View File

@ -22,6 +22,7 @@
#include <arch/cpu.h> #include <arch/cpu.h>
#include <inttypes.h> #include <inttypes.h>
#include <console/console.h> #include <console/console.h>
#include <cpu/x86/cr.h>
#include <string.h> #include <string.h>
#include <cpu/x86/msr.h> #include <cpu/x86/msr.h>
#include <cpu/amd/msr.h> #include <cpu/amd/msr.h>
@ -612,7 +613,7 @@ static void dqsTrainRcvrEn_SW_Fam10(struct MCTStatStruc *pMCTstat,
u32 index_reg; u32 index_reg;
u32 ch_start, ch_end, ch; u32 ch_start, ch_end, ch;
msr_t msr; msr_t msr;
u32 cr4; CRx_TYPE cr4;
uint32_t dword; uint32_t dword;
uint8_t dimm; uint8_t dimm;
@ -1186,7 +1187,7 @@ static void dqsTrainRcvrEn_SW_Fam15(struct MCTStatStruc *pMCTstat,
u32 index_reg; u32 index_reg;
u32 ch_start, ch_end, ch; u32 ch_start, ch_end, ch;
u32 msr; u32 msr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
uint32_t dword; uint32_t dword;
@ -1583,7 +1584,7 @@ void dqsTrainMaxRdLatency_SW_Fam15(struct MCTStatStruc *pMCTstat,
u32 index_reg; u32 index_reg;
u32 ch_start, ch_end; u32 ch_start, ch_end;
u32 msr; u32 msr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
uint32_t dword; uint32_t dword;

View File

@ -21,7 +21,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <console/console.h> #include <console/console.h>
#include <cpu/amd/msr.h> #include <cpu/amd/msr.h>
#include <cpu/x86/cr.h>
#include "mct_d.h" #include "mct_d.h"
#include "mct_d_gcc.h" #include "mct_d_gcc.h"
@ -119,7 +119,7 @@ static void maxRdLatencyTrain_D(struct MCTStatStruc *pMCTstat,
u32 PatternBuffer[60]; /* FIXME: why not 48 + 4 */ u32 PatternBuffer[60]; /* FIXME: why not 48 + 4 */
u32 Margin; u32 Margin;
u32 addr; u32 addr;
u32 cr4; CRx_TYPE cr4;
u32 lo, hi; u32 lo, hi;
u8 valid; u8 valid;

View File

@ -18,6 +18,7 @@
#include <arch/io.h> #include <arch/io.h>
#include <assert.h> #include <assert.h>
#include <cpu/x86/mtrr.h> #include <cpu/x86/mtrr.h>
#include <cpu/x86/cr.h>
#include <console/console.h> #include <console/console.h>
#include <delay.h> #include <delay.h>
#include <device/pci_ops.h> #include <device/pci_ops.h>