software/liblitedram/sdram.c: move sdrwl_delays definition to write_leveling section and add #ifdef on reinitialization.

This commit is contained in:
Florent Kermarrec 2020-09-16 11:03:10 +02:00
parent f208a5db2c
commit 8a9d17c768
1 changed files with 6 additions and 3 deletions

View File

@ -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