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>
diff --git a/src/northbridge/intel/x4x/raminit_ddr23.c b/src/northbridge/intel/x4x/raminit_ddr23.c
index 1e40b9c..efdcbb6 100644
--- a/src/northbridge/intel/x4x/raminit_ddr23.c
+++ b/src/northbridge/intel/x4x/raminit_ddr23.c
@@ -2156,6 +2156,15 @@
 		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 @@
 	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) {