Hung-Te Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/61294 )
Change subject: soc/mediatek: Save dramc_param header to mrc_cache ......................................................................
soc/mediatek: Save dramc_param header to mrc_cache
Fast-k flow may need to re-init header because mrc_cache doesn't store header. Storing header together with dparam data is better for data consistancy.
TEST=fast calibration pass on Corsola BUG=b:204226005
Signed-off-by: Xi Chen xixi.chen@mediatek.corp-partner.google.com Change-Id: I22982923dce06c9e770aa4f20f3dcd2f33685d84 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61294 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Yu-Ping Wu yupingso@google.com --- M src/soc/mediatek/common/memory.c 1 file changed, 5 insertions(+), 8 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved
diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c index 93856d5..1b18dc7 100644 --- a/src/soc/mediatek/common/memory.c +++ b/src/soc/mediatek/common/memory.c @@ -172,17 +172,15 @@ static void mt_mem_init_run(struct dramc_param *dparam, const struct sdram_info *dram_info) { - const ssize_t mrc_cache_size = sizeof(dparam->dramc_datas); + const ssize_t mrc_cache_size = sizeof(*dparam); ssize_t data_size; struct stopwatch sw; int ret;
/* Load calibration params from flash and run fast calibration */ - mem_init_set_default_config(dparam, dram_info); data_size = mrc_cache_load_current(MRC_TRAINING_DATA, DRAMC_PARAM_HEADER_VERSION, - &dparam->dramc_datas, - mrc_cache_size); + dparam, mrc_cache_size); if (data_size == mrc_cache_size) { printk(BIOS_INFO, "DRAM-K: Running fast calibration\n"); stopwatch_init(&sw); @@ -194,11 +192,10 @@ stopwatch_duration_msecs(&sw), ret);
/* Erase flash data after fast calibration failed */ - memset(&dparam->dramc_datas, 0xa5, mrc_cache_size); + memset(dparam, 0xa5, mrc_cache_size); mrc_cache_stash_data(MRC_TRAINING_DATA, DRAMC_PARAM_HEADER_VERSION, - &dparam->dramc_datas, - mrc_cache_size); + dparam, mrc_cache_size); } else { printk(BIOS_INFO, "DRAM-K: Fast calibration passed in %ld msecs\n", stopwatch_duration_msecs(&sw)); @@ -220,7 +217,7 @@ stopwatch_duration_msecs(&sw)); mrc_cache_stash_data(MRC_TRAINING_DATA, DRAMC_PARAM_HEADER_VERSION, - &dparam->dramc_datas, mrc_cache_size); + dparam, mrc_cache_size); } else { printk(BIOS_ERR, "DRAM-K: Full calibration failed in %ld msecs\n", stopwatch_duration_msecs(&sw));
7 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.