HAOUAS Elyes (ehaouas@noos.fr) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18548
-gerrit
commit 52af24b6a368685f791da497d8f7de8d94a52756 Author: Elyes HAOUAS ehaouas@noos.fr Date: Thu Mar 2 19:55:44 2017 +0100
[not for Merge]nb/intel/i945: Fix sdram_on_die_termination
Fix one DIMM per channel detection. "if ( !(sysinfo->dimm[0] != SYSINFO_DIMM_NOT_POPULATED && sysinfo->dimm[1] != SYSINFO_DIMM_NOT_POPULATED) ) {" is true when both of dimm[0] and dimm[1] are not populated.
Change-Id: I7aec35f45250da554ddc5a68f5add157c313399c Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- src/northbridge/intel/i945/raminit.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)
diff --git a/src/northbridge/intel/i945/raminit.c b/src/northbridge/intel/i945/raminit.c index a7ccefb..54870d3 100644 --- a/src/northbridge/intel/i945/raminit.c +++ b/src/northbridge/intel/i945/raminit.c @@ -2793,14 +2793,37 @@ static void sdram_on_die_termination(struct sys_info *sysinfo)
u32 reg32; int cas; + int chan0has1dimm, chan0has2dimm, chan1has1dimm, has1dimmPerchannel; + + has1dimmPerchannel = 0; + chan0has1dimm = (sysinfo->dimm[0] != SYSINFO_DIMM_NOT_POPULATED && + sysinfo->dimm[1] == SYSINFO_DIMM_NOT_POPULATED) || + (sysinfo->dimm[0] == SYSINFO_DIMM_NOT_POPULATED && + sysinfo->dimm[1] != SYSINFO_DIMM_NOT_POPULATED); + + chan0has2dimm = (sysinfo->dimm[0] != SYSINFO_DIMM_NOT_POPULATED && + sysinfo->dimm[1] == SYSINFO_DIMM_NOT_POPULATED); + + chan1has1dimm = (sysinfo->dimm[2] != SYSINFO_DIMM_NOT_POPULATED && + sysinfo->dimm[3] == SYSINFO_DIMM_NOT_POPULATED) || + (sysinfo->dimm[2] == SYSINFO_DIMM_NOT_POPULATED && + sysinfo->dimm[3] != SYSINFO_DIMM_NOT_POPULATED);
reg32 = MCHBAR32(ODTC); reg32 &= ~(3 << 16); reg32 |= (1 << 14) | (1 << 6) | (2 << 16); MCHBAR32(ODTC) = reg32;
- if ( !(sysinfo->dimm[0] != SYSINFO_DIMM_NOT_POPULATED && - sysinfo->dimm[1] != SYSINFO_DIMM_NOT_POPULATED) ) { + if (IS_ENABLED(CONFIG_NORTHBRIDGE_INTEL_SUBTYPE_I945GM)) { + has1dimmPerchannel = ((sysinfo->dual_channel) && chan0has2dimm); + } + + if (IS_ENABLED(CONFIG_NORTHBRIDGE_INTEL_SUBTYPE_I945GC)) { + has1dimmPerchannel = (sysinfo->dual_channel) && + chan0has1dimm && chan1has1dimm; + } + + if ( has1dimmPerchannel ) { printk(BIOS_DEBUG, "one dimm per channel config..\n");
reg32 = MCHBAR32(C0ODT);