From d4d4ca53b0d1fa0c0a42c8bbe5713dcd266d068f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 12 Oct 2020 13:00:44 +0200 Subject: [PATCH] software/liblitedram/sdram.c: move activate/precharge to sdram_write_read_check_test_pattern, change second seed. --- litex/soc/software/liblitedram/sdram.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index 282f9ab86..3273cad3b 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -668,6 +668,9 @@ static int sdram_write_read_check_test_pattern(int module, unsigned int seed) { } } + /* Activate */ + sdram_activate_test_row(); + /* Write pseudo-random sequence */ for(p=0;p 32 _show = (i%16 == 0) & show; #endif - working = sdram_write_read_check_test_pattern(module, 42); - working &= sdram_write_read_check_test_pattern(module, 43); + working = sdram_write_read_check_test_pattern(module, 42); + working &= sdram_write_read_check_test_pattern(module, 84); if (_show) printf("%d", working); score += working; @@ -732,9 +735,6 @@ static int sdram_read_leveling_scan_module(int module, int bitslip, int show) if (show) printf("| "); - /* Precharge */ - sdram_precharge_test_row(); - return score; } @@ -746,15 +746,12 @@ static void sdram_read_leveling_module(int module) printf("delays: "); - /* Activate */ - sdram_activate_test_row(); - /* Find smallest working delay */ delay = 0; sdram_read_leveling_rst_delay(module); while(1) { working = sdram_write_read_check_test_pattern(module, 42); - working &= sdram_write_read_check_test_pattern(module, 43); + working &= sdram_write_read_check_test_pattern(module, 84); if(working) break; delay++; @@ -778,7 +775,7 @@ static void sdram_read_leveling_module(int module) /* Find largest working delay */ while(1) { working = sdram_write_read_check_test_pattern(module, 42); - working &= sdram_write_read_check_test_pattern(module, 43); + working &= sdram_write_read_check_test_pattern(module, 84); if(!working) break; delay++; @@ -797,9 +794,6 @@ static void sdram_read_leveling_module(int module) sdram_read_leveling_rst_delay(module); for(i=0;i<(delay_min+delay_max)/2;i++) sdram_read_leveling_inc_delay(module); - - /* Precharge */ - sdram_precharge_test_row(); } #endif /* CSR_DDRPHY_BASE */