[coreboot-gerrit] Change in coreboot[master]: util/intelmetool: Add Skylake support
Patrick Rudolph (Code Review)
gerrit at coreboot.org
Sat Nov 25 16:08:00 CET 2017
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/22599
Change subject: util/intelmetool: Add Skylake support
......................................................................
util/intelmetool: Add Skylake support
Skylake doesn't have RCBA anymore.
Don't try to access RCBA on Skylake platforms.
FIXME: Add support for P2SB.
Change-Id: I920b1dac124bf0fc6d13fd9ceab12ecd575c1252
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M util/intelmetool/intelmetool.c
1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/22599/1
diff --git a/util/intelmetool/intelmetool.c b/util/intelmetool/intelmetool.c
index 0b0e509..65249bd 100644
--- a/util/intelmetool/intelmetool.c
+++ b/util/intelmetool/intelmetool.c
@@ -75,6 +75,22 @@
return !strncmp((char *)®s, "GenuineIntel", CPU_ID_SIZE-1);
}
+static int isSkylakeCompatibel(void)
+{
+ regs_t regs;
+ unsigned int level = 0;
+ unsigned int family, model, ext_model;
+ unsigned int eax = 1;
+
+ __get_cpuid(level, &eax, ®s.ebx, ®s.ecx, ®s.edx);
+
+ family = ((eax & 0xf00) >> 8);
+ ext_model = ((eax & 0xf0000) >> 12);
+ model = ((eax & 0xf0) >> 4);
+ return (family == 6 && model == 0xe && ext_model == 4) &&
+ (family == 6 && model == 0xe && ext_model == 5);
+}
+
/* You need >4GB total ram, in kernel cmdline, use 'mem=1000m'
* then this code will clone to absolute memory address 0xe0000000
* which can be read using a mmap tool at that offset.
@@ -178,6 +194,11 @@
static int activate_me(void)
{
+ /* RCBA is supported up to Intel's 5th Gen. CPUs */
+ if (isSkylakeCompatibel())
+ /* FIXME: Add Skylake support */
+ return 0;
+
if (read_rcba32(FD2, &fd2)) {
printf("Error reading RCBA\n");
return 1;
@@ -197,6 +218,11 @@
static void rehide_me(void)
{
+ /* RCBA is supported up to Intel's 5th Gen. CPUs */
+ if (isSkylakeCompatibel())
+ /* FIXME: Add Skylake support */
+ return;
+
if (fd2 & 0x2) {
if (debug)
printf("Re-hiding MEI device...");
--
To view, visit https://review.coreboot.org/22599
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I920b1dac124bf0fc6d13fd9ceab12ecd575c1252
Gerrit-Change-Number: 22599
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20171125/218622fb/attachment.html>
More information about the coreboot-gerrit
mailing list