From 4731aa65220d361ed85fa691f53b46839a8b65ed Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Thu, 20 Apr 2023 18:46:50 +0800 Subject: [PATCH] Add missing ifdef check --- litex/soc/software/liblitedram/sdram.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/litex/soc/software/liblitedram/sdram.c b/litex/soc/software/liblitedram/sdram.c index f4ea33fe3..ad583bb4e 100644 --- a/litex/soc/software/liblitedram/sdram.c +++ b/litex/soc/software/liblitedram/sdram.c @@ -596,6 +596,11 @@ static void sdram_write_leveling_on(void) { } static void sdram_write_leveling_off(void) { +#ifndef SDRAM_PHY_CLAM_SHELL + sdram_dfii_pi0_address_write(DDRX_MR_WRLVL_RESET); + sdram_dfii_pi0_baddress_write(DDRX_MR_WRLVL_ADDRESS); + command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS); +#else sdram_dfii_pi0_address_write(DDRX_MR_WRLVL_RESET); sdram_dfii_pi0_baddress_write(DDRX_MR_WRLVL_ADDRESS); command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS_TOP); @@ -610,6 +615,7 @@ static void sdram_write_leveling_off(void) { sdram_dfii_pi0_address_write(addr); sdram_dfii_pi0_baddress_write(baddr); command_p0(DFII_COMMAND_RAS|DFII_COMMAND_CAS|DFII_COMMAND_WE|DFII_COMMAND_CS_BOTTOM); +#endif #ifdef SDRAM_PHY_DDR4_RDIMM sdram_dfii_pi0_address_write(DDRX_MR_WRLVL_RESET ^ 0x2BF8);