fsp1_1: remove duplicate mrc caching mechanism
For some reason fsp 1.1 has a duplicate mechanism for saving mrc data as soc/intel/common. Defer to the common code as all the existing users were already using the common code. BUG=chrome-os-partner:44620 BRANCH=None TEST=Built and booted glados. Suspended and resumed. Change-Id: I951d47deb85445a5f010d23dfd11abb0b6f65e5e Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Original-Commit-Id: 2138b6ff1517c440d24f72a5f399bd6cb6097274 Original-Change-Id: I06609c1435b06b1365b1762f83cfcba532eb8c7a Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/295236 Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: http://review.coreboot.org/11454 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Alexandru Gagniuc
parent
bc140cf111
commit
80f5d5b3e4
@@ -401,98 +401,3 @@ void print_hob_type_structure(u16 hob_type, void *hob_list_ptr)
|
||||
} while (!last_hob);
|
||||
printk(BIOS_DEBUG, "=== End of FSP HOB Data Structure ===\n\n");
|
||||
}
|
||||
|
||||
#if IS_ENABLED(CONFIG_ENABLE_MRC_CACHE)
|
||||
/*
|
||||
* Save the FSP memory HOB (mrc data) to the MRC area in CBMEM
|
||||
*/
|
||||
int save_mrc_data(void *hob_start)
|
||||
{
|
||||
u32 *mrc_hob;
|
||||
u32 *mrc_hob_data;
|
||||
u32 mrc_hob_size;
|
||||
struct mrc_data_container *mrc_data;
|
||||
int output_len;
|
||||
const EFI_GUID mrc_guid = FSP_NON_VOLATILE_STORAGE_HOB_GUID;
|
||||
|
||||
mrc_hob = get_next_guid_hob(&mrc_guid, hob_start);
|
||||
if (mrc_hob == NULL) {
|
||||
printk(BIOS_DEBUG,
|
||||
"Memory Configure Data Hob is not present\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
mrc_hob_data = GET_GUID_HOB_DATA(mrc_hob);
|
||||
mrc_hob_size = (u32) GET_HOB_LENGTH(mrc_hob);
|
||||
|
||||
printk(BIOS_DEBUG, "Memory Configure Data Hob at %p (size = 0x%x).\n",
|
||||
(void *)mrc_hob_data, mrc_hob_size);
|
||||
|
||||
output_len = ALIGN(mrc_hob_size, 16);
|
||||
|
||||
/* Save the MRC S3/fast boot/ADR restore data to cbmem */
|
||||
mrc_data = cbmem_add(CBMEM_ID_MRCDATA,
|
||||
output_len + sizeof(struct mrc_data_container));
|
||||
|
||||
/* Just return if there was a problem with getting CBMEM */
|
||||
if (mrc_data == NULL) {
|
||||
printk(BIOS_WARNING,
|
||||
"CBMEM was not available to save the fast boot cache data.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
printk(BIOS_DEBUG,
|
||||
"Copy FSP MRC DATA to HOB (source addr %p, dest addr %p, %u bytes)\n",
|
||||
(void *)mrc_hob_data, mrc_data, output_len);
|
||||
|
||||
mrc_data->mrc_signature = MRC_DATA_SIGNATURE;
|
||||
mrc_data->mrc_data_size = output_len;
|
||||
mrc_data->reserved = 0;
|
||||
memcpy(mrc_data->mrc_data, (const void *)mrc_hob_data, mrc_hob_size);
|
||||
|
||||
/* Zero the unused space in aligned buffer. */
|
||||
if (output_len > mrc_hob_size)
|
||||
memset((mrc_data->mrc_data + mrc_hob_size), 0,
|
||||
output_len - mrc_hob_size);
|
||||
|
||||
mrc_data->mrc_checksum = compute_ip_checksum(mrc_data->mrc_data,
|
||||
mrc_data->mrc_data_size);
|
||||
|
||||
#if IS_ENABLED(CONFIG_DISPLAY_FAST_BOOT_DATA)
|
||||
printk(BIOS_SPEW, "Fast boot data (includes align and checksum):\n");
|
||||
hexdump32(BIOS_SPEW, (void *)mrc_data->mrc_data, output_len);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
void __attribute__ ((weak)) update_mrc_cache(void *unused)
|
||||
{
|
||||
printk(BIOS_ERR, "Add routine %s to save the MRC data.\n", __func__);
|
||||
}
|
||||
#endif /* CONFIG_ENABLE_MRC_CACHE */
|
||||
|
||||
#if ENV_RAMSTAGE
|
||||
|
||||
static void find_fsp_hob_update_mrc(void *unused)
|
||||
{
|
||||
void *hob_list_ptr;
|
||||
|
||||
/* 0x0000: Print all types */
|
||||
hob_list_ptr = get_hob_list();
|
||||
#if IS_ENABLED(CONFIG_DISPLAY_HOBS)
|
||||
print_hob_type_structure(0x000, hob_list_ptr);
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_ENABLE_MRC_CACHE)
|
||||
if (save_mrc_data(hob_list_ptr))
|
||||
update_mrc_cache(NULL);
|
||||
else
|
||||
printk(BIOS_DEBUG, "Not updating MRC data in flash.\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Update the MRC/fast boot cache as part of the late table writing stage */
|
||||
BOOT_STATE_INIT_ENTRY(BS_WRITE_TABLES, BS_ON_ENTRY,
|
||||
find_fsp_hob_update_mrc, NULL);
|
||||
|
||||
#endif /* ENV_RAMSTAGE */
|
||||
|
Reference in New Issue
Block a user