summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cpu/intel/microcode/microcode.c20
-rw-r--r--src/include/cpu/intel/microcode.h9
2 files changed, 29 insertions, 0 deletions
diff --git a/src/cpu/intel/microcode/microcode.c b/src/cpu/intel/microcode/microcode.c
index 272edb56b2..8cfcb95182 100644
--- a/src/cpu/intel/microcode/microcode.c
+++ b/src/cpu/intel/microcode/microcode.c
@@ -113,6 +113,26 @@ void intel_microcode_load_unlocked(const void *microcode_patch)
#endif
}
+uint32_t get_current_microcode_rev(void)
+{
+ return read_microcode_rev();
+}
+
+uint32_t get_microcode_rev(const void *microcode)
+{
+ return ((struct microcode *)microcode)->rev;
+}
+
+uint32_t get_microcode_size(const void *microcode)
+{
+ return ((struct microcode *)microcode)->total_size;
+}
+
+uint32_t get_microcode_checksum(const void *microcode)
+{
+ return ((struct microcode *)microcode)->cksum;
+}
+
const void *intel_microcode_find(void)
{
const struct microcode *ucode_updates;
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