From 0d3915714c85d7ac22542848c19c53bec1ca2b42 Mon Sep 17 00:00:00 2001 From: Rizwan Qureshi Date: Mon, 2 Jul 2018 21:12:40 +0530 Subject: cpu/intel/microcode: Add helper functions to get microcode info Add 4 helper functions to get microcode info. * get_current_microcode_rev return the the version of the currently running microcode. * get_microcode_rev extract microcode revision from the given patch. * get_microcode_size extract microcode size from the given patch. * get_microcode_checksum extract checksum from the given patch. The simpler thing would be to just move the struct microcode to microcode.h so that the structure members can be dereferenced. To encapsulate the structure details added the helper functions. This information will be used in future to compare microcodes for update. Change-Id: I67a08ba40b393874d8cc17363fefe21e2ea904f3 Signed-off-by: Rizwan Qureshi Reviewed-on: https://review.coreboot.org/27365 Reviewed-by: Furquan Shaikh Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/include/cpu/intel/microcode.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/include/cpu') diff --git a/src/include/cpu/intel/microcode.h b/src/include/cpu/intel/microcode.h index 0783ace244..9170c02dd8 100644 --- a/src/include/cpu/intel/microcode.h +++ b/src/include/cpu/intel/microcode.h @@ -31,4 +31,13 @@ void intel_microcode_load_unlocked(const void *microcode_patch); * required, will skip microcode update if true. */ int soc_skip_ucode_update(u32 currrent_patch_id, u32 new_patch_id); +/* return the the version of the currently running microcode */ +uint32_t get_current_microcode_rev(void); + +/* extract microcode revision from the given patch */ +uint32_t get_microcode_rev(const void *microcode); +/* extract microcode size from the given patch */ +uint32_t get_microcode_size(const void *microcode); +/* extract checksum from the given patch */ +uint32_t get_microcode_checksum(const void *microcode); #endif -- cgit v1.2.3