summaryrefslogtreecommitdiffstats
path: root/util/intelmetool/me.c
diff options
context:
space:
mode:
authorPhilipp Deppenwiese <zaolin@das-labor.org>2016-08-26 02:10:51 +0200
committerPatrick Rudolph <siro@das-labor.org>2017-11-25 12:59:54 +0000
commit73add175cd866a5acd2bddb662080d6b03179d8b (patch)
tree55dbfd0fb2986ea4874d13c7459a4ff04e5aad3c /util/intelmetool/me.c
parent5e9dc37818a017fd5cccba65b9268d715e414380 (diff)
downloadcoreboot-73add175cd866a5acd2bddb662080d6b03179d8b.tar.gz
coreboot-73add175cd866a5acd2bddb662080d6b03179d8b.tar.bz2
coreboot-73add175cd866a5acd2bddb662080d6b03179d8b.zip
util/intelmetool: Add bootguard information dump support
With this implementation it's possible to detect the state of bootguard in intel based systems. Currently it's WIP and in a testphase. Handle it with care! Changes done: * Add support for reading msr * Read ME firmware version * Print bootguard state for ME > 9.1 * Make argument -s legacy * Add argument -b for bootguard (and ME) dumping * Add argument -m for ME dumping * Opt out early if CPU is non Intel Change-Id: Ifeec8e20fa8efc35d7db4c6a84be1f118dccfc4a Signed-off-by: Philipp Deppenwiese <zaolin@das-labor.org> Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/16328 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'util/intelmetool/me.c')
-rw-r--r--util/intelmetool/me.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/util/intelmetool/me.c b/util/intelmetool/me.c
index ff73aee2d638..6517022c64b5 100644
--- a/util/intelmetool/me.c
+++ b/util/intelmetool/me.c
@@ -22,9 +22,9 @@
#include <assert.h>
#include <unistd.h>
+#include "intelmetool.h"
#include "me.h"
#include "mmap.h"
-#include "intelmetool.h"
#define read32(addr, off) ( *((uint32_t *) (addr + off)) )
#define write32(addr, off, val) ( *((uint32_t *) (addr + off)) = val)
@@ -378,7 +378,7 @@ static int mkhi_end_of_post(void)
*/
/* Get ME firmware version */
-int mkhi_get_fw_version(void)
+int mkhi_get_fw_version(int *major, int *minor)
{
uint32_t data = 0;
struct me_fw_version version = {0};
@@ -420,15 +420,13 @@ int mkhi_get_fw_version(void)
printf("ME: Firmware Version %u.%u (code)\n\n"
version.code_major, version.code_minor);
#endif
+ if (major)
+ *major = version.code_major;
+ if (minor)
+ *minor = version.code_minor;
return 0;
}
-static inline void print_cap(const char *name, int state)
-{
- printf("ME Capability: %-30s : %s\n",
- name, state ? CRED "ON" RESET : CGRN "OFF" RESET);
-}
-
/* Get ME Firmware Capabilities */
int mkhi_get_fwcaps(void)
{