Skip to contentSkip to conversation

driver/ddr/fsl: Fix tMOD calculation for DDR3

PATCH Superseded York Sun 1 participant 1 message Nov 18, 2014

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 driver/ddr/fsl: Fix tMOD calculation for DDR3

JEDEC specifies tMOD = max(12nCK, 15ns) for DDR3. This value is used in mode register set cycle time.

---
 drivers/ddr/fsl/ctrl_regs.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/ddr/fsl/ctrl_regs.c +6 -1
index 9a156bf..6fa7165 100644
@@ -327,7 +327,12 @@ static void set_timing_cfg_0(fsl_ddr_cfg_regs_t *ddr,
 	 */
 	txp = max(mclk_ps * 3, (mclk_ps > 1540 ? 7500 : 6000));
 
-	tmrd_mclk = 4;
+	/*
+	 * MRS_CYC = max(tMRD, tMOD)
+	 * tMRD = 4nCK, tMOD = max(12nCK, 15ns)
+	 */
+	tmrd_mclk = max(12, picos_to_mclk(15000));
+
 	/* set the turnaround time */
 
 	/*
Signature · 1 line
1.7.9.5