Skip to content

Commit

Permalink
arch/risc-v/src/mpfs/mpfs_ddr.c: Don't auto-determine the write latency
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jlaitine committed Aug 25, 2023
1 parent cf54bcf commit b479327
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions arch/risc-v/src/mpfs/mpfs_ddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit b479327

Please sign in to comment.