mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
liblitedram/sdram_leveling_center_module: Do a check after final delay configuration.
On ECP5/DDR3, final configuration does not seem to be done correctly each time. Add a retry/check mechanism to workaround the issue for now.
This commit is contained in:
parent
153f9f3660
commit
dd7a04a5c0
1 changed files with 20 additions and 7 deletions
|
@ -447,13 +447,26 @@ static void sdram_leveling_center_module(
|
||||||
if (show_long)
|
if (show_long)
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
/* Set delay to the middle */
|
/* Set delay to the middle and check */
|
||||||
|
if (delay_min >= 0) {
|
||||||
|
int retries = 8; /* Do N configs/checks and give up if failing */
|
||||||
|
while (retries > 0) {
|
||||||
|
/* Set delay. */
|
||||||
rst_delay(module);
|
rst_delay(module);
|
||||||
cdelay(100);
|
cdelay(100);
|
||||||
for(i = 0; i < delay_mid; i++) {
|
for(i = 0; i < delay_mid; i++) {
|
||||||
inc_delay(module);
|
inc_delay(module);
|
||||||
cdelay(100);
|
cdelay(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check */
|
||||||
|
errors = sdram_write_read_check_test_pattern(module, 42);
|
||||||
|
errors += sdram_write_read_check_test_pattern(module, 84);
|
||||||
|
if (errors == 0)
|
||||||
|
break;
|
||||||
|
retries--;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------*/
|
/*-----------------------------------------------------------------------*/
|
||||||
|
|
Loading…
Reference in a new issue