software/liblitedram: use single iteration of dq-dqs training

This commit is contained in:
Jędrzej Boczar 2021-04-27 10:54:32 +02:00
parent 4c26dbe98f
commit ad23130a9a
1 changed files with 7 additions and 13 deletions

View File

@ -1075,23 +1075,17 @@ static void sdram_read_leveling_best_bitslip(int module)
static void sdram_write_dq_dqs_training(void) static void sdram_write_dq_dqs_training(void)
{ {
/* In the first iteration read leveling and DQ-DQS training may not be done optimally */
const int n_iter = 2;
int i; int i;
int show;
int module; int module;
for (i = 0; i < n_iter; ++i) {
show = i == n_iter - 1;
for(module=0; module<SDRAM_PHY_MODULES; module++) { for(module=0; module<SDRAM_PHY_MODULES; module++) {
/* Find best bitslip */ /* Find best bitslip */
sdram_read_leveling_best_bitslip(module); sdram_read_leveling_best_bitslip(module);
/* Center DQ-DQS window */ /* Center DQ-DQS window */
sdram_leveling_center_module(module, show, show, sdram_leveling_center_module(module, 1, 1,
sdram_write_dq_dqs_training_rst_delay, sdram_write_dq_dqs_training_inc_delay); sdram_write_dq_dqs_training_rst_delay, sdram_write_dq_dqs_training_inc_delay);
} }
} }
}
#endif /* SDRAM_PHY_WRITE_DQ_DQS_TRAINING_CAPABLE */ #endif /* SDRAM_PHY_WRITE_DQ_DQS_TRAINING_CAPABLE */