From d90d3e043bc81b434d6424c8585c757d77853d2c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Tue, 22 Dec 2020 10:50:03 +0100 Subject: [PATCH] software/liblitedram: add optional SDRAM_TEST_DISABLE that can be defined to full disable SDRAM test. This is useful in simulation where SDRAM contents is pre-initialized from files (ex Linux-on-LiteX-Vexriscv). --- litex/soc/software/liblitedram/sdram.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index f15579197..3d2b33816 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -24,6 +24,8 @@ #include "sdram.h" +//#define SDRAM_TEST_DISABLE + #ifdef CSR_SDRAM_BASE /*-----------------------------------------------------------------------*/ @@ -1014,6 +1016,7 @@ int sdram_init(void) sdram_leveling(); #endif sdram_software_control_off(); +#ifndef SDRAM_TEST_DISABLE if(!memtest((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE)) { #ifdef CSR_DDRCTRL_BASE ddrctrl_init_done_write(1); @@ -1022,6 +1025,7 @@ int sdram_init(void) return 0; } memspeed((unsigned int *) MAIN_RAM_BASE, MEMTEST_DATA_SIZE, false); +#endif #ifdef CSR_DDRCTRL_BASE ddrctrl_init_done_write(1); #endif