From 8a9d17c768a8cd9d15e5005cff043caa2265410e Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Wed, 16 Sep 2020 11:03:10 +0200 Subject: [PATCH] software/liblitedram/sdram.c: move sdrwl_delays definition to write_leveling section and add #ifdef on reinitialization. --- litex/soc/software/liblitedram/sdram.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index aa45e5e21..81711d557 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -201,6 +201,9 @@ void sdrwr(unsigned int addr) /*-----------------------------------------------------------------------*/ #ifdef SDRAM_PHY_WRITE_LEVELING_CAPABLE + +int sdrwl_delays[16]; + void sdrwlon(void) { sdram_dfii_pi0_address_write(DDRX_MR1 | (1 << 7)); @@ -866,13 +869,13 @@ void sdrcal(void) /*-----------------------------------------------------------------------*/ /* Initialization */ /*-----------------------------------------------------------------------*/ -int sdrwl_delays[16]; int sdrinit(void) { +#ifdef SDRAM_PHY_WRITE_LEVELING_CAPABLE int i; - for (i=0; i<16; i++) sdrwl_delays[i] = -1; /* disabled forced delays */ - + for (i=0; i<16; i++) sdrwl_delays[i] = -1; /* disable forced delays */ +#endif printf("Initializing SDRAM @0x%08x...\n", MAIN_RAM_BASE); #if CSR_DDRPHY_RST_ADDR