diff options
author | Patrick Rudolph <siro@das-labor.org> | 2016-11-16 18:06:50 +0100 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2016-11-28 01:04:39 +0100 |
commit | e74ad21a91e33f275a7bda999b058a8390c44ae6 (patch) | |
tree | ad6d98cf539039374da5d02c3e5226d510ddad8e /src | |
parent | f100700a149d1a1d4c87f63e50b8f4d89a8c2650 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/northbridge/intel/sandybridge/raminit.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c index e8ad4169cc..7087035d9b 100644 --- a/src/northbridge/intel/sandybridge/raminit.c +++ b/src/northbridge/intel/sandybridge/raminit.c @@ -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); |