soc/intel/common: Update CSE FW update flow for compressed ME_RW blobs
In the CSE FW update flow, update is triggered when there is a mismatch in CSE versions. CSE RW blob is directly mapped from SPI flash, hashed, compared and then the CSE RW region is updated. However, in the case of compressed blobs, we cannot directly map the blobs from SPI. It needs to be decompressed before the hash is calculated and compared. Add a check for compressed blobs and figure out whether it needs to be directly mapped from SPI or loaded into memory allocated for file in CBMEM, with the provided CBMEM ID. BRANCH=firmware-brya-14505.B Change-Id: I3bc7708c95272e98702bc25b2334e6e64a93da8a Signed-off-by: Krishna P Bhat D <krishna.p.bhat.d@intel.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63743 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
parent
ddd66ed204
commit
75a423ed7b
|
@ -721,14 +721,20 @@ static enum csme_failure_reason cse_trigger_fw_update(const struct cse_bp_info *
|
|||
{
|
||||
enum csme_failure_reason rv;
|
||||
uint8_t *cbfs_rw_hash;
|
||||
void *cse_cbfs_rw = NULL;
|
||||
size_t size;
|
||||
|
||||
const char *area_name = cse_get_source_rdev_fmap();
|
||||
if (!area_name)
|
||||
return CSE_LITE_SKU_RW_BLOB_NOT_FOUND;
|
||||
|
||||
void *cse_cbfs_rw = cbfs_unverified_area_map(area_name,
|
||||
CONFIG_SOC_INTEL_CSE_RW_CBFS_NAME, &size);
|
||||
if (CONFIG(SOC_INTEL_CSE_LITE_COMPRESS_ME_RW)) {
|
||||
cse_cbfs_rw = cbfs_unverified_area_cbmem_alloc(area_name,
|
||||
CONFIG_SOC_INTEL_CSE_RW_CBFS_NAME, CBMEM_ID_CSE_UPDATE, &size);
|
||||
} else {
|
||||
cse_cbfs_rw = cbfs_unverified_area_map(area_name,
|
||||
CONFIG_SOC_INTEL_CSE_RW_CBFS_NAME, &size);
|
||||
}
|
||||
if (!cse_cbfs_rw) {
|
||||
printk(BIOS_ERR, "cse_lite: CSE CBFS RW blob could not be mapped\n");
|
||||
return CSE_LITE_SKU_RW_BLOB_NOT_FOUND;
|
||||
|
|
Loading…
Reference in New Issue