From a6d9955c9d3065d5c04cd4cba392b2fcb831380f Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Mon, 30 Jan 2023 09:04:45 +0100 Subject: [PATCH] software/liblitedram/accessors: Fix conditions for write_dq_bitslip functions compilations. Fixes #1583. --- litex/soc/software/liblitedram/accessors.c | 8 ++++++-- litex/soc/software/liblitedram/accessors.h | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/litex/soc/software/liblitedram/accessors.c b/litex/soc/software/liblitedram/accessors.c index 75f03cdde..fe9c88e1e 100644 --- a/litex/soc/software/liblitedram/accessors.c +++ b/litex/soc/software/liblitedram/accessors.c @@ -106,7 +106,7 @@ void write_rst_delay(int module) { /* Bitslip Delays Reset/Increment Functions */ /*----------------------------------------------------------------------------*/ -#if defined(SDRAM_PHY_BITSLIPS) +#if defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_READ_LEVELING_CAPABLE) int read_dq_bitslip[SDRAM_PHY_MODULES]; void read_inc_dq_bitslip(int module) { @@ -121,6 +121,10 @@ void read_rst_dq_bitslip(int module) { ddrphy_rdly_dq_bitslip_rst_write(1); } +#endif // defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_READ_LEVELING_CAPABLE) + +#if defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_WRITE_LEVELING_CAPABLE) + int write_dq_bitslip[SDRAM_PHY_MODULES]; void write_inc_dq_bitslip(int module) { /* Increment bitslip */ @@ -134,7 +138,7 @@ void write_rst_dq_bitslip(int module) { ddrphy_wdly_dq_bitslip_rst_write(1); } -#endif // defined(SDRAM_PHY_BITSLIPS) +#endif // defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_WRITE_LEVELING_CAPABLE) /*----------------------------------------------------------------------------*/ /* SDRAM Module Selection Functions */ diff --git a/litex/soc/software/liblitedram/accessors.h b/litex/soc/software/liblitedram/accessors.h index c3525195c..18591d479 100644 --- a/litex/soc/software/liblitedram/accessors.h +++ b/litex/soc/software/liblitedram/accessors.h @@ -50,17 +50,22 @@ void write_rst_delay(int module); /* Bitslip Delays Reset/Increment Functions */ /*----------------------------------------------------------------------------*/ -#if defined(SDRAM_PHY_BITSLIPS) +#if defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_READ_LEVELING_CAPABLE) extern int read_dq_bitslip[SDRAM_PHY_MODULES]; void read_inc_dq_bitslip(int module); void read_rst_dq_bitslip(int module); +#endif // defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_READ_LEVELING_CAPABLE) + + +#if defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_WRITE_LEVELING_CAPABLE) + extern int write_dq_bitslip[SDRAM_PHY_MODULES]; void write_inc_dq_bitslip(int module); void write_rst_dq_bitslip(int module); -#endif // defined(SDRAM_PHY_BITSLIPS) +#endif // defined(SDRAM_PHY_BITSLIPS) && defined(SDRAM_PHY_WRITE_LEVELING_CAPABLE) /*----------------------------------------------------------------------------*/ /* SDRAM Module Selection Functions */