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 98313d8f615421f02c0a63129a7442733c27b328 Author: Elyes HAOUAS ehaouas@noos.fr Date: Thu Mar 2 19:55:44 2017 +0100
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 | 43 +++++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 10 deletions(-)
diff --git a/src/northbridge/intel/i945/raminit.c b/src/northbridge/intel/i945/raminit.c index a7ccefb..32e4337 100644 --- a/src/northbridge/intel/i945/raminit.c +++ b/src/northbridge/intel/i945/raminit.c @@ -2793,22 +2793,45 @@ static void sdram_on_die_termination(struct sys_info *sysinfo)
u32 reg32; int cas; + int chan0has1dimms, chan1has1dimms; + + 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); + + 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) ) { - printk(BIOS_DEBUG, "one dimm per channel config..\n"); - - reg32 = MCHBAR32(C0ODT); - reg32 &= ~(7 << 28); - MCHBAR32(C0ODT) = reg32; - reg32 = MCHBAR32(C1ODT); - reg32 &= ~(7 << 28); - MCHBAR32(C1ODT) = reg32; + if (sysinfo->dual_channel) { + if (chan0has1dimm && chan1has1dimm) { + printk(BIOS_DEBUG, "one dimm per channel config..\n"); + + reg32 = MCHBAR32(C0ODT); + reg32 &= ~(7 << 28); + MCHBAR32(C0ODT) = reg32; + reg32 = MCHBAR32(C1ODT); + reg32 &= ~(7 << 28); + MCHBAR32(C1ODT) = reg32; + } + } else { + if (chan0has1dimm) { + printk(BIOS_DEBUG, "one dimm per channel config..\n"); + + reg32 = MCHBAR32(C0ODT); + reg32 &= ~(7 << 28); + MCHBAR32(C0ODT) = reg32; + reg32 = MCHBAR32(C1ODT); + reg32 &= ~(7 << 28); + MCHBAR32(C1ODT) = reg32; + } }
cas = sysinfo->cas;