From 80f5d5b3e4aedf456b60b976fe3419471dcad609 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 27 Aug 2015 22:49:03 -0500 Subject: 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 Original-Commit-Id: 2138b6ff1517c440d24f72a5f399bd6cb6097274 Original-Change-Id: I06609c1435b06b1365b1762f83cfcba532eb8c7a Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/295236 Original-Reviewed-by: Duncan Laurie Reviewed-on: http://review.coreboot.org/11454 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/drivers/intel/fsp1_1/hob.c | 95 ------------------------------------------ 1 file changed, 95 deletions(-) (limited to 'src/drivers/intel/fsp1_1/hob.c') diff --git a/src/drivers/intel/fsp1_1/hob.c b/src/drivers/intel/fsp1_1/hob.c index 6cc09fbcc4..34b23575e3 100644 --- a/src/drivers/intel/fsp1_1/hob.c +++ b/src/drivers/intel/fsp1_1/hob.c @@ -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 */ -- cgit v1.2.3