From bb9c90a2074ac0138a4d1083bf0d9f52a39b47d5 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Sun, 29 May 2016 17:05:06 +0200 Subject: nb/intel: Factor out common MRC code Remove code duplication and use the common function store_current_mrc_cache instead. No functionality is changed. Tested on Sandybridge Lenovo T520. Change-Id: I4aa5463f1b1d5e1afbe44b4bfc659524d86204db Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/15074 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/northbridge/intel/nehalem/raminit.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'src/northbridge/intel/nehalem') diff --git a/src/northbridge/intel/nehalem/raminit.c b/src/northbridge/intel/nehalem/raminit.c index a5a627672a..0549de766a 100644 --- a/src/northbridge/intel/nehalem/raminit.c +++ b/src/northbridge/intel/nehalem/raminit.c @@ -1688,8 +1688,6 @@ static void dump_timings(struct raminfo *info) static void save_timings(struct raminfo *info) { struct ram_training train; - struct mrc_data_container *mrcdata; - int output_len = ALIGN(sizeof(train), 16); int channel, slot, rank, lane, i; train = info->training; @@ -1717,26 +1715,7 @@ static void save_timings(struct raminfo *info) printk (BIOS_SPEW, "[6e8] = %x\n", train.reg_6e8); /* Save the MRC S3 restore data to cbmem */ - mrcdata = cbmem_add - (CBMEM_ID_MRCDATA, output_len + sizeof(struct mrc_data_container)); - - if (mrcdata != NULL) { - printk(BIOS_DEBUG, "Relocate MRC DATA from %p to %p (%u bytes)\n", - &train, mrcdata, output_len); - - mrcdata->mrc_signature = MRC_DATA_SIGNATURE; - mrcdata->mrc_data_size = output_len; - mrcdata->reserved = 0; - memcpy(mrcdata->mrc_data, &train, sizeof(train)); - - /* Zero the unused space in aligned buffer. */ - if (output_len > sizeof(train)) - memset(mrcdata->mrc_data + sizeof(train), 0, - output_len - sizeof(train)); - - mrcdata->mrc_checksum = compute_ip_checksum(mrcdata->mrc_data, - mrcdata->mrc_data_size); - } + store_current_mrc_cache(&train, sizeof(train)); } #if REAL -- cgit v1.2.3