nb/intel/sandybridge/raminit: Reset internal state on fallback attempts

Some methods like discover_402x assume an clear state.
Should fix fallback attempt raminit failures.

Change-Id: I7a6fe044c17f5e0dbfa0e9b9d2aed0c3b6ae3972
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-on: https://review.coreboot.org/17471
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Patrick Rudolph 2016-11-16 18:06:50 +01:00 committed by Martin Roth
parent f100700a14
commit e74ad21a91
1 changed files with 7 additions and 2 deletions

View File

@ -4225,8 +4225,6 @@ static void init_dram_ddr3(int mobile, int min_tck, int s3resume)
halt();
}
memset(&ctrl, 0, sizeof(ctrl));
early_pch_init_native();
early_thermal_init();
@ -4275,6 +4273,8 @@ static void init_dram_ddr3(int mobile, int min_tck, int s3resume)
}
}
if (!fast_boot) {
/* Reset internal state */
memset(&ctrl, 0, sizeof(ctrl));
ctrl.mobile = mobile;
ctrl.tCK = min_tck;
@ -4291,6 +4291,11 @@ static void init_dram_ddr3(int mobile, int min_tck, int s3resume)
printk(BIOS_ERR, "RAM training failed, trying fallback.\n");
printram("Disable failing channel.\n");
/* Reset internal state */
memset(&ctrl, 0, sizeof(ctrl));
ctrl.mobile = mobile;
ctrl.tCK = min_tck;
/* Reset DDR3 frequency */
dram_find_spds_ddr3(spds, &ctrl);