Nico Huber (nico.h@gmx.de) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17612
-gerrit
commit 650fe5db27a6bb32c03a42f9c19fb381a184d671 Author: Nico Huber nico.h@gmx.de Date: Sat Nov 26 02:03:25 2016 +0100
nb/intel/x4x/raminit: Fix DIMM_IN_CHANNEL calculation
Fix-up for 696abfc nb/intel/x4x: Fix and deflate `dimm_config` in raminit
It didn't fix the channel-number shifting issue as intended.
Change-Id: I2784b0cb655bfe823bf5fa48b722623dfca1ddc3 Signed-off-by: Nico Huber nico.h@gmx.de --- src/northbridge/intel/x4x/raminit.c | 3 ++- src/northbridge/intel/x4x/x4x.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/northbridge/intel/x4x/raminit.c b/src/northbridge/intel/x4x/raminit.c index 0867c31..122cab5 100644 --- a/src/northbridge/intel/x4x/raminit.c +++ b/src/northbridge/intel/x4x/raminit.c @@ -153,7 +153,8 @@ static void sdram_read_spds(struct sysinfo *s) else die("Dual-rank x16 not supported\n"); } - s->dimm_config[chan] |= dimm_config << (i - chan) * 2; + s->dimm_config[chan] |= + dimm_config << (i % DIMMS_PER_CHANNEL) * 2; } printk(BIOS_DEBUG, " Config[CH%d] : %d\n", chan, s->dimm_config[chan]); } diff --git a/src/northbridge/intel/x4x/x4x.h b/src/northbridge/intel/x4x/x4x.h index b349369..e4eb8dd 100644 --- a/src/northbridge/intel/x4x/x4x.h +++ b/src/northbridge/intel/x4x/x4x.h @@ -144,6 +144,7 @@
#define TOTAL_CHANNELS 2 #define TOTAL_DIMMS 4 +#define DIMMS_PER_CHANNEL (TOTAL_DIMMS / TOTAL_CHANNELS) #define RAW_CARD_UNPOPULATED 0xff
#define DIMM_IS_POPULATED(dimms, idx) (dimms[idx].card_type != RAW_CARD_UNPOPULATED) @@ -162,7 +163,7 @@ #define FOR_EACH_POPULATED_DIMM(dimms, idx) \ FOR_EACH_DIMM(idx) IF_DIMM_POPULATED(dimms, idx) #define FOR_EACH_DIMM_IN_CHANNEL(ch, idx) \ - for (idx = (ch); idx < (ch) + 2; ++idx) + for (idx = (ch) << 1; idx < ((ch) << 1) + DIMMS_PER_CHANNEL; ++idx) #define FOR_EACH_POPULATED_DIMM_IN_CHANNEL(dimms, ch, idx) \ FOR_EACH_DIMM_IN_CHANNEL(ch, idx) IF_DIMM_POPULATED(dimms, idx) #define CHANNEL_IS_POPULATED(dimms, idx) ((dimms[idx<<1].card_type != RAW_CARD_UNPOPULATED) || (dimms[(idx<<1) + 1].card_type != RAW_CARD_UNPOPULATED))