[coreboot-gerrit] Change in coreboot[master]: intel/common/block: Add API to configure MCA
Pratikkumar V Prajapati (Code Review)
gerrit at coreboot.org
Mon Aug 28 23:22:06 CEST 2017
Pratikkumar V Prajapati has uploaded this change for review. ( https://review.coreboot.org/21239
Change subject: intel/common/block: Add API to configure MCA
......................................................................
intel/common/block: Add API to configure MCA
Add mca_configure() API to configure Intel Machine Check
Architecture (MCA).
Change-Id: I5e88c7527ce350824e48892caa978b2b78f1de20
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati at intel.com>
---
M src/soc/intel/common/block/cpu/cpulib.c
M src/soc/intel/common/block/include/intelblocks/cpulib.h
2 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/21239/1
diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c
index 2272e69..0d6dacc 100644
--- a/src/soc/intel/common/block/cpu/cpulib.c
+++ b/src/soc/intel/common/block/cpu/cpulib.c
@@ -296,3 +296,21 @@
msr = rdmsr(MSR_TURBO_RATIO_LIMIT);
return msr.lo & 0xff;
}
+
+void mca_configure(void)
+{
+ msr_t msr;
+ int i;
+ int num_banks;
+
+ msr = rdmsr(IA32_MCG_CAP);
+ num_banks = msr.lo & 0xff;
+ msr.lo = msr.hi = 0;
+ for (i = 0; i < num_banks; i++) {
+ /* Clear the machine check status */
+ wrmsr(IA32_MC0_STATUS + (i * 4), msr);
+ /* Initialize machine checks */
+ wrmsr(IA32_MC0_CTL + i * 4,
+ (msr_t) {.lo = 0xffffffff, .hi = 0xffffffff});
+ }
+}
diff --git a/src/soc/intel/common/block/include/intelblocks/cpulib.h b/src/soc/intel/common/block/include/intelblocks/cpulib.h
index 3d40a92..551d89f 100644
--- a/src/soc/intel/common/block/include/intelblocks/cpulib.h
+++ b/src/soc/intel/common/block/include/intelblocks/cpulib.h
@@ -156,4 +156,7 @@
*/
uint32_t cpu_get_max_turbo_ratio(void);
+/* Configure Machine Check Architecture support */
+void mca_configure(void)
+
#endif /* SOC_INTEL_COMMON_BLOCK_CPULIB_H */
--
To view, visit https://review.coreboot.org/21239
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e88c7527ce350824e48892caa978b2b78f1de20
Gerrit-Change-Number: 21239
Gerrit-PatchSet: 1
Gerrit-Owner: Pratikkumar V Prajapati <pratikkumar.v.prajapati at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170828/99980c5d/attachment.html>
More information about the coreboot-gerrit
mailing list