From 73add175cd866a5acd2bddb662080d6b03179d8b Mon Sep 17 00:00:00 2001 From: Philipp Deppenwiese Date: Fri, 26 Aug 2016 02:10:51 +0200 Subject: 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 Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/16328 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- util/intelmetool/me.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'util/intelmetool/me.c') diff --git a/util/intelmetool/me.c b/util/intelmetool/me.c index ff73aee2d6..6517022c64 100644 --- a/util/intelmetool/me.c +++ b/util/intelmetool/me.c @@ -22,9 +22,9 @@ #include #include +#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) { -- cgit v1.2.3