arch/risc-v/src/mpfs/mpfs_ddr.c: Don't auto-determine the write latency

It doesn't make sense to try to auto-determine write latency, it may pass with too low value.

Keep the existing implementation if the write latency has been set to minimum
value, otherwise just set it.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen 2023-08-24 11:02:30 +03:00 committed by Petro Karashchenko
parent 8fb2e41994
commit d38eebc0e9

View file

@ -3725,14 +3725,22 @@ static int mpfs_training_write_calibration(struct mpfs_ddr_priv_s *priv)
#endif
/* Find the proper write latency by using mtc test */
if (LIBERO_SETTING_CFG_WRITE_LATENCY_SET == 0)
{
/* Find the proper write latency by using mtc test */
do
do
{
putreg32(write_latency, MPFS_DDR_CSR_APB_CFG_DFI_T_PHY_WRLAT);
error = mpfs_write_calibration_using_mtc(priv);
}
while (error && ++write_latency <= WR_LATENCY_MAX);
}
else
{
putreg32(write_latency, MPFS_DDR_CSR_APB_CFG_DFI_T_PHY_WRLAT);
error = mpfs_write_calibration_using_mtc(priv);
}
while (error && ++write_latency <= WR_LATENCY_MAX);
/* Return error if mtc test failed on all allowed latency values */