nb/intel/x4x/raminit: Move dummy reads after JEDEC init

Vendor only does dummy reads right after JEDEC init is finished
and dram init was marked as finished.

Dummy reads also make much more sense after JEDEC init as a way to
send a few JEDEC commands, presumably as a way to make sure it is
ready.

TESTED on ga-g41m-es2l (still boots fine)

Change-Id: I8069f9c08ad5e5268ddbe3711d58bc42522f938c
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/20979
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Arthur Heymans 2019-08-10 20:34:17 +02:00 committed by Felix Held
parent 66922d05d7
commit 8bb2bace86
1 changed files with 9 additions and 22 deletions

View File

@ -2156,6 +2156,15 @@ void do_raminit(struct sysinfo *s, int fast_boot)
MCHBAR32_OR(0x400*ch + 0x268, 0xc0000000);
}
// Dummy reads
if (s->boot_path == BOOT_PATH_NORMAL) {
FOR_EACH_POPULATED_RANK(s->dimms, ch, r) {
for (bank = 0; bank < 4; bank++)
read32((u32 *)(test_address(ch, r) | 0x800000 | (bank << 12)));
}
}
printk(BIOS_DEBUG, "Done dummy reads\n");
// Receive enable
sdram_program_receive_enable(s, fast_boot);
printk(BIOS_DEBUG, "Done rcven\n");
@ -2171,28 +2180,6 @@ void do_raminit(struct sysinfo *s, int fast_boot)
MCHBAR8_AND(0x5dc, ~0x80);
MCHBAR8_OR(0x5dc, 0x80);
// Dummy writes / reads
if (s->boot_path == BOOT_PATH_NORMAL) {
volatile u32 data;
FOR_EACH_POPULATED_RANK(s->dimms, ch, r) {
for (bank = 0; bank < 4; bank++) {
reg32 = test_address(ch, r) |
(bank << 12);
write32((u32 *)reg32, 0xffffffff);
data = read32((u32 *)reg32);
printk(BIOS_DEBUG, "Wrote ones,");
printk(BIOS_DEBUG, " Read: [0x%08x]=0x%08x\n",
reg32, data);
write32((u32 *)reg32, 0x00000000);
data = read32((u32 *)reg32);
printk(BIOS_DEBUG, "Wrote zeros,");
printk(BIOS_DEBUG, " Read: [0x%08x]=0x%08x\n",
reg32, data);
}
}
}
printk(BIOS_DEBUG, "Done dummy reads\n");
// XXX tRD
if (!fast_boot) {