xref: /rk3399_ARM-atf/drivers/st/ddr/phy/phyinit/src/ddrphy_phyinit_initstruct.c (revision eaaf26e3e6ac347cbfda00b6ba7d327e715d68f0)
1*79629b1aSNicolas Le Bayon /*
2*79629b1aSNicolas Le Bayon  * Copyright (C) 2021-2024, STMicroelectronics - All Rights Reserved
3*79629b1aSNicolas Le Bayon  *
4*79629b1aSNicolas Le Bayon  * SPDX-License-Identifier: BSD-3-Clause
5*79629b1aSNicolas Le Bayon  */
6*79629b1aSNicolas Le Bayon 
7*79629b1aSNicolas Le Bayon #include <string.h>
8*79629b1aSNicolas Le Bayon 
9*79629b1aSNicolas Le Bayon #include <common/debug.h>
10*79629b1aSNicolas Le Bayon 
11*79629b1aSNicolas Le Bayon #include <ddrphy_phyinit.h>
12*79629b1aSNicolas Le Bayon 
13*79629b1aSNicolas Le Bayon /*
14*79629b1aSNicolas Le Bayon  * This is used to initialize the PhyInit structures before user defaults and overrides are applied.
15*79629b1aSNicolas Le Bayon  *
16*79629b1aSNicolas Le Bayon  * @return Void
17*79629b1aSNicolas Le Bayon  */
ddrphy_phyinit_initstruct(struct stm32mp_ddr_config * config,struct pmu_smb_ddr_1d * mb_ddr_1d)18*79629b1aSNicolas Le Bayon void ddrphy_phyinit_initstruct(struct stm32mp_ddr_config *config, struct pmu_smb_ddr_1d *mb_ddr_1d)
19*79629b1aSNicolas Le Bayon {
20*79629b1aSNicolas Le Bayon 	/*
21*79629b1aSNicolas Le Bayon 	 * ##############################################################
22*79629b1aSNicolas Le Bayon 	 * Basic Message Block Variables
23*79629b1aSNicolas Le Bayon 	 * ##############################################################
24*79629b1aSNicolas Le Bayon 	 */
25*79629b1aSNicolas Le Bayon 
26*79629b1aSNicolas Le Bayon 	uint8_t msgmisc = 0x00U;	/* For fast simulation */
27*79629b1aSNicolas Le Bayon 	uint8_t reserved00 = 0x0U;	/*
28*79629b1aSNicolas Le Bayon 					 * Set reserved00[7] = 1 (If using T28 attenuated receivers)
29*79629b1aSNicolas Le Bayon 					 * Set reserved00[6:0] = 0 (Reserved; must be set to 0)
30*79629b1aSNicolas Le Bayon 					 */
31*79629b1aSNicolas Le Bayon 
32*79629b1aSNicolas Le Bayon 	uint8_t hdtctrl = 0xFFU;
33*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE || STM32MP_DDR4_TYPE
34*79629b1aSNicolas Le Bayon 	uint8_t cspresent = 0x01U;	/*
35*79629b1aSNicolas Le Bayon 					 * Indicates presence of DRAM at each chip select for PHY.
36*79629b1aSNicolas Le Bayon 					 *
37*79629b1aSNicolas Le Bayon 					 * If the bit is set to 1, the CS is connected to DRAM.
38*79629b1aSNicolas Le Bayon 					 * If the bit is set to 0, the CS is not connected to DRAM.
39*79629b1aSNicolas Le Bayon 					 *
40*79629b1aSNicolas Le Bayon 					 * Set cspresent[0]   = 1 (if CS0 is populated with DRAM)
41*79629b1aSNicolas Le Bayon 					 * Set cspresent[1]   = 1 (if CS1 is populated with DRAM)
42*79629b1aSNicolas Le Bayon 					 * Set cspresent[2]   = 1 (if CS2 is populated with DRAM)
43*79629b1aSNicolas Le Bayon 					 * Set cspresent[3]   = 1 (if CS3 is populated with DRAM)
44*79629b1aSNicolas Le Bayon 					 * Set cspresent[7:4] = 0 (Reserved; must be set to 0)
45*79629b1aSNicolas Le Bayon 					 */
46*79629b1aSNicolas Le Bayon 	uint8_t dfimrlmargin = 0x01U;	/* 1 is typically good in DDR3 */
47*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE
48*79629b1aSNicolas Le Bayon 	uint8_t addrmirror = 0x00U;	/*
49*79629b1aSNicolas Le Bayon 					 * Set addrmirror if CS is mirrored.
50*79629b1aSNicolas Le Bayon 					 * (typically odd CS are mirroed in DIMMs)
51*79629b1aSNicolas Le Bayon 					 */
52*79629b1aSNicolas Le Bayon #else /* STM32MP_DDR4_TYPE */
53*79629b1aSNicolas Le Bayon 	uint8_t addrmirror = 0xAAU;
54*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE */
55*79629b1aSNicolas Le Bayon 	uint8_t wrodtpat_rank0 = 0x01U;	/*
56*79629b1aSNicolas Le Bayon 					 * When Writing Rank0 : Bits[3:0] should be set to the
57*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
58*79629b1aSNicolas Le Bayon 					 */
59*79629b1aSNicolas Le Bayon 	uint8_t wrodtpat_rank1 = 0x02U;	/*
60*79629b1aSNicolas Le Bayon 					 * When Writing Rank1 : Bits[3:0] should be set to the
61*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
62*79629b1aSNicolas Le Bayon 					 */
63*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE
64*79629b1aSNicolas Le Bayon 	uint8_t wrodtpat_rank2 = 0x04U;	/*
65*79629b1aSNicolas Le Bayon 					 * When Writing Rank2 : Bits[3:0] should be set to the
66*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
67*79629b1aSNicolas Le Bayon 					 */
68*79629b1aSNicolas Le Bayon 	uint8_t wrodtpat_rank3 = 0x08U;	/*
69*79629b1aSNicolas Le Bayon 					 * When Writing Rank3 : Bits[3:0] should be set to the
70*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
71*79629b1aSNicolas Le Bayon 					 */
72*79629b1aSNicolas Le Bayon #else /* STM32MP_DDR4_TYPE */
73*79629b1aSNicolas Le Bayon 	uint8_t wrodtpat_rank2 = 0x00U;
74*79629b1aSNicolas Le Bayon 	uint8_t wrodtpat_rank3 = 0x00U;
75*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE */
76*79629b1aSNicolas Le Bayon 	uint8_t rdodtpat_rank0 = 0x20U;	/*
77*79629b1aSNicolas Le Bayon 					 * When Reading Rank0 : Bits[7:4] should be set to the
78*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
79*79629b1aSNicolas Le Bayon 					 */
80*79629b1aSNicolas Le Bayon 	uint8_t rdodtpat_rank1 = 0x10U;	/*
81*79629b1aSNicolas Le Bayon 					 * When Reading Rank1 : Bits[7:4] should be set to the
82*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
83*79629b1aSNicolas Le Bayon 					 */
84*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE
85*79629b1aSNicolas Le Bayon 	uint8_t rdodtpat_rank2 = 0x80U;	/*
86*79629b1aSNicolas Le Bayon 					 * When Reading Rank2 : Bits[7:4] should be set to the
87*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
88*79629b1aSNicolas Le Bayon 					 */
89*79629b1aSNicolas Le Bayon 	uint8_t rdodtpat_rank3 = 0x40U;	/*
90*79629b1aSNicolas Le Bayon 					 * When Reading Rank3 : Bits[7:4] should be set to the
91*79629b1aSNicolas Le Bayon 					 * desired setting of ODT[3:0] to the DRAM
92*79629b1aSNicolas Le Bayon 					 */
93*79629b1aSNicolas Le Bayon #else /* STM32MP_DDR4_TYPE */
94*79629b1aSNicolas Le Bayon 	uint8_t rdodtpat_rank2 = 0x00U;
95*79629b1aSNicolas Le Bayon 	uint8_t rdodtpat_rank3 = 0x00U;
96*79629b1aSNicolas Le Bayon 
97*79629b1aSNicolas Le Bayon 	uint8_t d4misc = 0x1U;		/*
98*79629b1aSNicolas Le Bayon 					 * Protect memory reset:
99*79629b1aSNicolas Le Bayon 					 * 0x1 = dfi_reset_n cannot control BP_MEMRESERT_L to
100*79629b1aSNicolas Le Bayon 					 *       devices after training.
101*79629b1aSNicolas Le Bayon 					 * 0x0 = dfi_resert_n can control BP_MEMRESERT_L to
102*79629b1aSNicolas Le Bayon 					 *       devices after training.
103*79629b1aSNicolas Le Bayon 					 */
104*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE */
105*79629b1aSNicolas Le Bayon #else /* STM32MP_LPDDR4_TYPE */
106*79629b1aSNicolas Le Bayon 	uint8_t caterminatingrankcha = 0x00U; /* Usually Rank0 is terminating rank */
107*79629b1aSNicolas Le Bayon 	uint8_t caterminatingrankchb = 0x00U; /* Usually Rank0 is terminating rank */
108*79629b1aSNicolas Le Bayon 	uint8_t dfimrlmargin = 0x02U; /* This needs to be large enough for max tDQSCK variation */
109*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE || STM32MP_DDR4_TYPE */
110*79629b1aSNicolas Le Bayon 
111*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE
112*79629b1aSNicolas Le Bayon 	uint8_t share2dvrefresult = 0x0U;	/*
113*79629b1aSNicolas Le Bayon 						 * Bitmap that controls which vref generator the
114*79629b1aSNicolas Le Bayon 						 * phy will use per pstate
115*79629b1aSNicolas Le Bayon 						 *     If share2dvrefresult[x] = 1, pstate x will
116*79629b1aSNicolas Le Bayon 						 *     use the per-lane VrefDAC0/1 CSRs which can be
117*79629b1aSNicolas Le Bayon 						 *     trained by 2d training. If 2D has not run
118*79629b1aSNicolas Le Bayon 						 *     yet, VrefDAC0/1 will default to pstate 0's
119*79629b1aSNicolas Le Bayon 						 *     1D phyVref messageBlock setting.
120*79629b1aSNicolas Le Bayon 						 *     If share2dvrefresult[x] = 0, pstate x will
121*79629b1aSNicolas Le Bayon 						 *     use the per-phy VrefInGlobal CSR, which are
122*79629b1aSNicolas Le Bayon 						 *     set to pstate x's 1D phyVref messageBlock
123*79629b1aSNicolas Le Bayon 						 *     setting.
124*79629b1aSNicolas Le Bayon 						 */
125*79629b1aSNicolas Le Bayon #elif STM32MP_DDR4_TYPE
126*79629b1aSNicolas Le Bayon 	uint8_t share2dvrefresult = 0x1U;
127*79629b1aSNicolas Le Bayon #else /* STM32MP_LPDDR4_TYPE */
128*79629b1aSNicolas Le Bayon 	uint8_t share2dvrefresult = 0x1U;
129*79629b1aSNicolas Le Bayon 	uint8_t usebroadcastmr = 0x00U;
130*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE */
131*79629b1aSNicolas Le Bayon 
132*79629b1aSNicolas Le Bayon 	/* 1D message block defaults */
133*79629b1aSNicolas Le Bayon 	memset((void *)mb_ddr_1d, 0, sizeof(struct pmu_smb_ddr_1d));
134*79629b1aSNicolas Le Bayon 
135*79629b1aSNicolas Le Bayon 	mb_ddr_1d->pstate = 0U;
136*79629b1aSNicolas Le Bayon 	mb_ddr_1d->sequencectrl = (uint16_t)config->uia.sequencectrl;
137*79629b1aSNicolas Le Bayon 	mb_ddr_1d->phyconfigoverride = 0x0U;
138*79629b1aSNicolas Le Bayon 	mb_ddr_1d->hdtctrl = hdtctrl;
139*79629b1aSNicolas Le Bayon 	mb_ddr_1d->msgmisc = msgmisc;
140*79629b1aSNicolas Le Bayon 	mb_ddr_1d->reserved00 = reserved00;
141*79629b1aSNicolas Le Bayon 	mb_ddr_1d->dfimrlmargin = dfimrlmargin;
142*79629b1aSNicolas Le Bayon 	mb_ddr_1d->phyvref = (uint8_t)config->uia.phyvref;
143*79629b1aSNicolas Le Bayon 
144*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE || STM32MP_DDR4_TYPE
145*79629b1aSNicolas Le Bayon 	mb_ddr_1d->cspresent = cspresent;
146*79629b1aSNicolas Le Bayon 	mb_ddr_1d->cspresentd0 = cspresent;
147*79629b1aSNicolas Le Bayon 	/* mb_ddr_1d->cspresentd1 = 0x0U; Unused */
148*79629b1aSNicolas Le Bayon 	mb_ddr_1d->addrmirror = addrmirror;
149*79629b1aSNicolas Le Bayon 
150*79629b1aSNicolas Le Bayon 	mb_ddr_1d->acsmodtctrl0 = wrodtpat_rank0 | rdodtpat_rank0;
151*79629b1aSNicolas Le Bayon 	mb_ddr_1d->acsmodtctrl1 = wrodtpat_rank1 | rdodtpat_rank1;
152*79629b1aSNicolas Le Bayon 	mb_ddr_1d->acsmodtctrl2 = wrodtpat_rank2 | rdodtpat_rank2;
153*79629b1aSNicolas Le Bayon 	mb_ddr_1d->acsmodtctrl3 = wrodtpat_rank3 | rdodtpat_rank3;
154*79629b1aSNicolas Le Bayon 
155*79629b1aSNicolas Le Bayon 	/* mb_ddr_1d->acsmodtctrl4 = 0x0U; Unused */
156*79629b1aSNicolas Le Bayon 	/* mb_ddr_1d->acsmodtctrl5 = 0x0U; Unused */
157*79629b1aSNicolas Le Bayon 	/* mb_ddr_1d->acsmodtctrl6 = 0x0U; Unused */
158*79629b1aSNicolas Le Bayon 	/* mb_ddr_1d->acsmodtctrl7 = 0x0U; Unused */
159*79629b1aSNicolas Le Bayon 	mb_ddr_1d->enableddqs = (uint8_t)((config->uib.numactivedbytedfi0 +
160*79629b1aSNicolas Le Bayon 					   config->uib.numactivedbytedfi1) * 8U);
161*79629b1aSNicolas Le Bayon #if STM32MP_DDR3_TYPE
162*79629b1aSNicolas Le Bayon 	mb_ddr_1d->phycfg = (uint8_t)config->uia.is2ttiming;
163*79629b1aSNicolas Le Bayon #else /* STM32MP_DDR4_TYPE */
164*79629b1aSNicolas Le Bayon 	mb_ddr_1d->phycfg = ((config->uim.mr3 & 0x8U) == 0x8U) ?
165*79629b1aSNicolas Le Bayon 			      0U : (uint8_t)config->uia.is2ttiming;
166*79629b1aSNicolas Le Bayon 	mb_ddr_1d->x16present = (config->uib.dramdatawidth == 0x10) ?
167*79629b1aSNicolas Le Bayon 				mb_ddr_1d->cspresent : 0x0U;
168*79629b1aSNicolas Le Bayon 	mb_ddr_1d->d4misc = d4misc;
169*79629b1aSNicolas Le Bayon 	mb_ddr_1d->cssetupgddec = 0x1U;	/* If Geardown is chosen, dynamically modify CS timing */
170*79629b1aSNicolas Le Bayon 
171*79629b1aSNicolas Le Bayon 	/*
172*79629b1aSNicolas Le Bayon 	 * Outputs - just initialize these to zero
173*79629b1aSNicolas Le Bayon 	 * mb_ddr_1d->rtt_nom_wr_park<0..7>
174*79629b1aSNicolas Le Bayon 	 */
175*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE */
176*79629b1aSNicolas Le Bayon 
177*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr0 = (uint16_t)config->uim.mr0;
178*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr1 = (uint16_t)config->uim.mr1;
179*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr2 = (uint16_t)config->uim.mr2;
180*79629b1aSNicolas Le Bayon #if STM32MP_DDR4_TYPE
181*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr3 = (uint16_t)config->uim.mr3;
182*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr4 = (uint16_t)config->uim.mr4;
183*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr5 = (uint16_t)config->uim.mr5;
184*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr6 = (uint16_t)config->uim.mr6;
185*79629b1aSNicolas Le Bayon 
186*79629b1aSNicolas Le Bayon 	mb_ddr_1d->alt_cas_l = 0x0U;
187*79629b1aSNicolas Le Bayon 	mb_ddr_1d->alt_wcas_l = 0x0U;
188*79629b1aSNicolas Le Bayon 
189*79629b1aSNicolas Le Bayon 	/*
190*79629b1aSNicolas Le Bayon 	 * Outputs - just initialize these to zero
191*79629b1aSNicolas Le Bayon 	 * mb_ddr_1d->vrefdqr<0..3>nib<0..19>
192*79629b1aSNicolas Le Bayon 	 */
193*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR4_TYPE */
194*79629b1aSNicolas Le Bayon #else /* STM32MP_LPDDR4_TYPE */
195*79629b1aSNicolas Le Bayon 	mb_ddr_1d->enableddqscha = (uint8_t)(config->uib.numactivedbytedfi0 * 8U);
196*79629b1aSNicolas Le Bayon 	mb_ddr_1d->cspresentcha = (config->uib.numrank_dfi0 == 2U) ?
197*79629b1aSNicolas Le Bayon 				  0x3U : (uint8_t)config->uib.numrank_dfi0;
198*79629b1aSNicolas Le Bayon 	mb_ddr_1d->enableddqschb = (uint8_t)(config->uib.numactivedbytedfi1 * 8U);
199*79629b1aSNicolas Le Bayon 	mb_ddr_1d->cspresentchb = (config->uib.numrank_dfi1 == 2U) ?
200*79629b1aSNicolas Le Bayon 				  0x3U : (uint8_t)config->uib.numrank_dfi1;
201*79629b1aSNicolas Le Bayon 	mb_ddr_1d->usebroadcastmr = usebroadcastmr;
202*79629b1aSNicolas Le Bayon 
203*79629b1aSNicolas Le Bayon 	mb_ddr_1d->lp4misc = 0x00U;
204*79629b1aSNicolas Le Bayon 	mb_ddr_1d->caterminatingrankcha = caterminatingrankcha;
205*79629b1aSNicolas Le Bayon 	mb_ddr_1d->caterminatingrankchb = caterminatingrankchb;
206*79629b1aSNicolas Le Bayon 	mb_ddr_1d->lp4quickboot = 0x00U;
207*79629b1aSNicolas Le Bayon 	mb_ddr_1d->catrainopt = 0x00U;
208*79629b1aSNicolas Le Bayon 	mb_ddr_1d->x8mode = 0x00U;
209*79629b1aSNicolas Le Bayon 
210*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr1_a0 = (uint8_t)config->uim.mr1;
211*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr2_a0 = (uint8_t)config->uim.mr2;
212*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr3_a0 = (uint8_t)config->uim.mr3;
213*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr4_a0 = (uint8_t)config->uim.mr4;
214*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr11_a0 = (uint8_t)config->uim.mr11;
215*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr12_a0 = (uint8_t)config->uim.mr12;
216*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr13_a0 = (uint8_t)config->uim.mr13;
217*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr14_a0 = (uint8_t)config->uim.mr14;
218*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr16_a0 = 0x00U;
219*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr17_a0 = 0x00U;
220*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr22_a0 = (uint8_t)config->uim.mr22;
221*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr24_a0 = 0x00U;
222*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr1_a1 = (uint8_t)config->uim.mr1;
223*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr2_a1 = (uint8_t)config->uim.mr2;
224*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr3_a1 = (uint8_t)config->uim.mr3;
225*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr4_a1 = (uint8_t)config->uim.mr4;
226*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr11_a1 = (uint8_t)config->uim.mr11;
227*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr12_a1 = (uint8_t)config->uim.mr12;
228*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr13_a1 = (uint8_t)config->uim.mr13;
229*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr14_a1 = (uint8_t)config->uim.mr14;
230*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr16_a1 = 0x00U;
231*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr17_a1 = 0x00U;
232*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr22_a1 = (uint8_t)config->uim.mr22;
233*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr24_a1 = 0x00U;
234*79629b1aSNicolas Le Bayon 
235*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr1_b0 = (uint8_t)config->uim.mr1;
236*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr2_b0 = (uint8_t)config->uim.mr2;
237*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr3_b0 = (uint8_t)config->uim.mr3;
238*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr4_b0 = (uint8_t)config->uim.mr4;
239*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr11_b0 = (uint8_t)config->uim.mr11;
240*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr12_b0 = (uint8_t)config->uim.mr12;
241*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr13_b0 = (uint8_t)config->uim.mr13;
242*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr14_b0 = (uint8_t)config->uim.mr14;
243*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr16_b0 = 0x00U;
244*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr17_b0 = 0x00U;
245*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr22_b0 = (uint8_t)config->uim.mr22;
246*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr24_b0 = 0x00U;
247*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr1_b1 = (uint8_t)config->uim.mr1;
248*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr2_b1 = (uint8_t)config->uim.mr2;
249*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr3_b1 = (uint8_t)config->uim.mr3;
250*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr4_b1 = (uint8_t)config->uim.mr4;
251*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr11_b1 = (uint8_t)config->uim.mr11;
252*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr12_b1 = (uint8_t)config->uim.mr12;
253*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr13_b1 = (uint8_t)config->uim.mr13;
254*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr14_b1 = (uint8_t)config->uim.mr14;
255*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr16_b1 = 0x00U;
256*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr17_b1 = 0x00U;
257*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr22_b1 = (uint8_t)config->uim.mr22;
258*79629b1aSNicolas Le Bayon 	mb_ddr_1d->mr24_b1 = 0x00U;
259*79629b1aSNicolas Le Bayon #endif /* STM32MP_DDR3_TYPE || STM32MP_DDR4_TYPE */
260*79629b1aSNicolas Le Bayon 
261*79629b1aSNicolas Le Bayon 	mb_ddr_1d->share2dvrefresult = share2dvrefresult;
262*79629b1aSNicolas Le Bayon }
263