[coreboot-gerrit] Change in coreboot[master]: cpu/intel/microcode:[WIP] Add helper functions

Rizwan Qureshi (Code Review) gerrit at coreboot.org
Fri Jul 6 14:45:32 CEST 2018


Rizwan Qureshi has uploaded this change for review. ( https://review.coreboot.org/27365


Change subject: cpu/intel/microcode:[WIP] Add helper functions
......................................................................

cpu/intel/microcode:[WIP] Add helper functions

Add 4 helper functions:
* 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.

Change-Id: I67a08ba40b393874d8cc17363fefe21e2ea904f3
Signed-off-by: Rizwan Qureshi <rizwan.qureshi at intel.com>
---
M src/cpu/intel/microcode/microcode.c
M src/include/cpu/intel/microcode.h
2 files changed, 29 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/27365/1

diff --git a/src/cpu/intel/microcode/microcode.c b/src/cpu/intel/microcode/microcode.c
index 272edb5..8cfcb95 100644
--- a/src/cpu/intel/microcode/microcode.c
+++ b/src/cpu/intel/microcode/microcode.c
@@ -113,6 +113,26 @@
 #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 0783ace..9170c02 100644
--- a/src/include/cpu/intel/microcode.h
+++ b/src/include/cpu/intel/microcode.h
@@ -31,4 +31,13 @@
  * 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

-- 
To view, visit https://review.coreboot.org/27365
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I67a08ba40b393874d8cc17363fefe21e2ea904f3
Gerrit-Change-Number: 27365
Gerrit-PatchSet: 1
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180706/21a1b6ee/attachment-0001.html>


More information about the coreboot-gerrit mailing list