Skip to contentSkip to conversation

ddr: altera: n5x: Copies calibration data to DDR when DDR retention is set

PATCH New Jit Loon Lim 1 participant 1 message Nov 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ddr: altera: n5x: Copies calibration data to DDR when DDR retention is set

From: Tien Fong Chee <[email protected]>

Ensure the PHY calibration data is copied to DDR only when DDR retention is set.

---
 drivers/ddr/altera/sdram_n5x.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/ddr/altera/sdram_n5x.c +7 -4
index 8d28cdbc03..72c231b3f1 100644
@@ -3045,10 +3045,13 @@ int sdram_mmr_init_full(struct udevice *dev)
 
 	sdram_set_firewall(&bd);
 
-	ddr_offset = simple_strtoul(offset, &endptr, 16);
-	if (!(offset == endptr || *endptr != '\0'))
-		memcpy((void *)ddr_offset,
-		       (const void *)SOC64_OCRAM_PHY_BACKUP_BASE, SZ_4K);
+	if (is_ddr_retention_enabled(reg)) {
+		ddr_offset = simple_strtoul(offset, &endptr, 16);
+		if (!(offset == endptr || *endptr != '\0'))
+			memcpy((void *)ddr_offset,
+			       (const void *)SOC64_OCRAM_PHY_BACKUP_BASE,
+			       SZ_4K);
+	}
 
 	return 0;
 }
Signature · 1 line
2.26.2