nb/intel/i945: Check if interleaved even if rank #4 size is zero

Tested config:
Interleaved (config; status before, after):
 DIMM{0 + 2}: ok, ok
 DIMM{0 + 3}: Nok, ok
 DIMM{1 + 2}: ok, ok
 DIMM{1 + 3}: Nok, ok
 DIMM{1 + 2 + 3}: ok, ok
 DIMM{0 + 2 + 3}: ok, ok
 DIMM{0 + 1 + 2}: ok, ok
 DIMM{0 + 1 + 3}: Nok, ok

Not Interleaved:
 DIMM{0 + 1 + 3}: Nok, Nok
 DIMM{0 + 1 + 2}: ok, ok (with single ranked)
 DIMM{0 + 1 + 2}: Nok, Nok (with only dual ranked)
 DIMM{0 + 2 + 3}: Nok, ok
 DIMM{1 + 2 + 3}: ok, ok

Change-Id: Ibf130a3d4b6f8fa816f7a5f06822a9b8807be3d4
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/31007
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Elyes HAOUAS 2019-01-19 16:36:38 +01:00 committed by Patrick Georgi
parent d6d6771b97
commit 01912201a4
1 changed files with 5 additions and 15 deletions

View File

@ -2546,29 +2546,19 @@ static void sdram_jedec_enable(struct sys_info *sysinfo)
u32 bankaddr = 0, tmpaddr, mrsaddr = 0; u32 bankaddr = 0, tmpaddr, mrsaddr = 0;
for (i = 0, nonzero = -1; i < 8; i++) { for (i = 0, nonzero = -1; i < 8; i++) {
if (sysinfo->banksize[i] == 0) if (sysinfo->banksize[i] == 0)
continue; continue;
printk(BIOS_DEBUG, "jedec enable sequence: bank %d\n", i); printk(BIOS_DEBUG, "jedec enable sequence: bank %d\n", i);
switch (i) {
case 0: if (nonzero != -1) {
/* Start at address 0 */ if (sysinfo->interleaved && nonzero < 4 && i >= 4) {
bankaddr = 0;
break;
case 4:
if (sysinfo->interleaved) {
bankaddr = 0x40; bankaddr = 0x40;
break; } else {
}
default:
if (nonzero != -1) {
printk(BIOS_DEBUG, "bankaddr from bank size of rank %d\n", nonzero); printk(BIOS_DEBUG, "bankaddr from bank size of rank %d\n", nonzero);
bankaddr += sysinfo->banksize[nonzero] << bankaddr += sysinfo->banksize[nonzero] <<
(sysinfo->interleaved ? 26 : 25); (sysinfo->interleaved ? 26 : 25);
break;
} }
/* No populated bank hit before. Start at address 0 */
bankaddr = 0;
} }
/* We have a bank with a non-zero size.. Remember it /* We have a bank with a non-zero size.. Remember it