Dinesh Gehlot has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/74209 )
Change subject: soc/intel/cmn: Implement an API to get ISHC version ......................................................................
soc/intel/cmn: Implement an API to get ISHC version
This patch adds an API that will fetch the current ISHC version from cbmem. It alerts the user if the current ISHC version is outdated.
BUG=b:273661726 Test=ISHC version is verified on the Nissa board using a debug patch.
Signed-off-by: Dinesh Gehlot digehlot@google.com Change-Id: Ib3f983d5de5b169474bcdb1e9e2934174a9dadf8 --- M src/soc/intel/common/block/cse/cse.c M src/soc/intel/common/block/include/intelblocks/cse.h 2 files changed, 39 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/74209/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index f6742a0..8c557ab 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -1213,6 +1213,19 @@ } }
+bool get_ishc_version(struct fw_version* resp_version) +{ + struct cse_fw_partition_info *version = cbmem_find(CBMEM_ID_CSE_PARTITION_VERSION); + size_t size = sizeof(struct fw_version); + + /*compare if stored cse version is same as current cse*/ + if (memcmp(&version->ish_info.pre_cse, &version->curr_cse, size)) { + memcpy(resp_version, &version->ish_info.curr_ish, size); + return true; + } + return false; +} + bool cse_get_partition_info(enum fpt_partition_id id, struct fw_version_resp *resp) { enum cse_tx_rx_status ret; diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h index 57573c7..0e48f42 100644 --- a/src/soc/intel/common/block/include/intelblocks/cse.h +++ b/src/soc/intel/common/block/include/intelblocks/cse.h @@ -643,6 +643,16 @@ enum cb_err cse_get_fw_feature_state(uint32_t *feature_state);
/* + * This function updates the user-provided memory pointer 'resp_version' with the + * current ISHC version. It should not be called from ROMSTAGE and the user must + * allocate memory for resp_version. + * + * It returns false if the latest ISHC version is not updated in the CBMEM table, + * and true otherwise. The response data will be invalid if the API returns false. + */ +bool get_ishc_version(struct fw_version* resp_version); + +/* * The function sends a HECI command to get the partition information of the shared ID. * The retrieved partition is stored in the memory pointed to by the resp pointer. * The function returns false if there is an error, and true if the operation is successful.