From 8bb2bace8689089af5659ad3108877e397885ff2 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Sat, 10 Aug 2019 20:34:17 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/20979 Tested-by: build bot (Jenkins) Reviewed-by: Felix Held --- src/northbridge/intel/x4x/raminit_ddr23.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/northbridge/intel/x4x/raminit_ddr23.c b/src/northbridge/intel/x4x/raminit_ddr23.c index 1e40b9c511..efdcbb637a 100644 --- a/src/northbridge/intel/x4x/raminit_ddr23.c +++ b/src/northbridge/intel/x4x/raminit_ddr23.c @@ -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) { -- cgit v1.2.3