[coreboot-gerrit] Change in coreboot[master]: soc/intel/fsp_broadwell_de: Fix IA32_MC0_* names

Elyes HAOUAS (Code Review) gerrit at coreboot.org
Wed Sep 26 18:30:46 CEST 2018


Elyes HAOUAS has uploaded this change for review. ( https://review.coreboot.org/28751


Change subject: soc/intel/fsp_broadwell_de: Fix IA32_MC0_* names
......................................................................

soc/intel/fsp_broadwell_de: Fix IA32_MC0_* names

Regarding the SDMs, IA32_MC0_STATUS register is at 0x401, and
IA32_MC0_CTL is at 0x400.
So replace MSR at (0x400+1) by IA32_MC0_STATUS and the one at
0x400 by IA32_MC0_CTL.

Change-Id: I3f53c80f39078bd0c47c25013657e1169fc6c4a6
Signed-off-by: Elyes HAOUAS <ehaouas at noos.fr>
---
M src/soc/intel/fsp_broadwell_de/cpu.c
M src/soc/intel/fsp_broadwell_de/include/soc/msr.h
2 files changed, 12 insertions(+), 8 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/28751/1

diff --git a/src/soc/intel/fsp_broadwell_de/cpu.c b/src/soc/intel/fsp_broadwell_de/cpu.c
index a50c839..a10e504 100644
--- a/src/soc/intel/fsp_broadwell_de/cpu.c
+++ b/src/soc/intel/fsp_broadwell_de/cpu.c
@@ -128,11 +128,10 @@
 static void configure_mca(void)
 {
 	msr_t msr;
-	const unsigned int mcg_cap_msr = 0x179;
 	int i;
 	int num_banks;
 
-	msr = rdmsr(mcg_cap_msr);
+	msr = rdmsr(IA32_MCG_CAP);
 	num_banks = msr.lo & 0xff;
 
 	/* TODO(adurbin): This should only be done on a cold boot. Also, some
@@ -140,14 +139,17 @@
 	   every bank. */
 	msr.lo = msr.hi = 0;
 	for (i = 0; i < num_banks; i++) {
-		wrmsr(MSR_IA32_MC0_STATUS + (i * 4) + 1, msr);
-		wrmsr(MSR_IA32_MC0_STATUS + (i * 4) + 2, msr);
-		wrmsr(MSR_IA32_MC0_STATUS + (i * 4) + 3, msr);
+		/* Clear the machine check status */
+		wrmsr(IA32_MC0_STATUS + (i * 4), msr);
+		wrmsr(IA32_MC0_STATUS + (i * 4) + 1, msr);
+		wrmsr(IA32_MC0_STATUS + (i * 4) + 2, msr);
 	}
 
 	msr.lo = msr.hi = 0xffffffff;
-	for (i = 0; i < num_banks; i++)
-		wrmsr(MSR_IA32_MC0_STATUS + (i * 4), msr);
+	for (i = 0; i < num_banks; i++) {
+		/* Initialize machine checks */
+		wrmsr(IA32_MC0_CTL + (i * 4), msr);
+	}
 }
 
 static void broadwell_de_core_init(struct device *cpu)
diff --git a/src/soc/intel/fsp_broadwell_de/include/soc/msr.h b/src/soc/intel/fsp_broadwell_de/include/soc/msr.h
index 6b87061..ffa33da 100644
--- a/src/soc/intel/fsp_broadwell_de/include/soc/msr.h
+++ b/src/soc/intel/fsp_broadwell_de/include/soc/msr.h
@@ -21,9 +21,11 @@
 #define MSR_IA32_PLATFORM_ID	0x17
 #define MSR_CORE_THREAD_COUNT	0x35
 #define MSR_PLATFORM_INFO	0xce
+#define IA32_MCG_CAP		0x179
 #define IA32_PERF_CTL		0x199
 #define MSR_TURBO_RATIO_LIMIT	0x1ad
-#define MSR_IA32_MC0_STATUS	0x400
+#define IA32_MC0_CTL		0x400
+#define IA32_MC0_STATUS		0x401
 #define MSR_PKG_POWER_SKU_UNIT	0x606
 #define MSR_PKG_POWER_LIMIT	0x610
 #define MSR_CONFIG_TDP_NOMINAL	0x648

-- 
To view, visit https://review.coreboot.org/28751
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f53c80f39078bd0c47c25013657e1169fc6c4a6
Gerrit-Change-Number: 28751
Gerrit-PatchSet: 1
Gerrit-Owner: Elyes HAOUAS <ehaouas at noos.fr>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180926/51ac7fba/attachment-0001.html>


More information about the coreboot-gerrit mailing list