fix(st-ddr): move skipddc_dat definition

The skipddc_dat variable is only use at one place in dfixlat_program()
function. Move its definition and update there to avoid compilation
issues about variables being set but not used.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I6b5273365f1da26773fc46f898362cb9af170506
This commit is contained in:
Yann Gautier 2024-11-04 18:32:21 +01:00
parent e01bcfb02c
commit 13cc1a5064

View file

@ -761,17 +761,9 @@ static void dfixlat_program(struct stm32mp_ddr_config *config)
{
uint16_t loopvector;
uint16_t pllbypass_dat = 0U;
uint16_t skipddc_dat = 0U; /*
* Set to vector offset based on frequency to disable dram
* drift compensation.
*/
pllbypass_dat |= (uint16_t)config->uib.pllbypass;
if (config->uib.frequency < 333U) {
skipddc_dat |= 0x5U;
}
for (loopvector = 0U; loopvector < 8U; loopvector++) {
uint16_t dfifreqxlat_dat;
uintptr_t reg = (uintptr_t)(DDRPHYC_BASE + (4U * (C0 | TMASTER |
@ -799,6 +791,15 @@ static void dfixlat_program(struct stm32mp_ddr_config *config)
}
#else /* STM32MP_LPDDR4_TYPE */
if (loopvector == 0U) {
uint16_t skipddc_dat = 0U; /*
* Set to vector offset based on frequency
* to disable dram drift compensation.
*/
if (config->uib.frequency < 333U) {
skipddc_dat |= 0x5U;
}
/*
* Retrain & Relock DfiFreq = 00,01,02,03) Use StartVec 0 (pll_enabled) or
* StartVec 1 (pll_bypassed).