blob: 088cf4564718949733cd8c70609b35c328481837 [file] [log] [blame]
Kumar Galad5a1fb92008-08-26 21:34:55 -05001/*
York Sunb513d9d2012-08-17 08:22:36 +00002 * Copyright 2008-2012 Freescale Semiconductor, Inc.
Kumar Galad5a1fb92008-08-26 21:34:55 -05003 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * Version 2 as published by the Free Software Foundation.
7 */
8
9#include <common.h>
10#include <asm/io.h>
11#include <asm/fsl_ddr_sdram.h>
York Sun7dda8472011-01-10 12:02:59 +000012#include <asm/processor.h>
Kumar Galad5a1fb92008-08-26 21:34:55 -050013
14#if (CONFIG_CHIP_SELECTS_PER_CTRL > 4)
15#error Invalid setting for CONFIG_CHIP_SELECTS_PER_CTRL
16#endif
17
18void fsl_ddr_set_memctl_regs(const fsl_ddr_cfg_regs_t *regs,
19 unsigned int ctrl_num)
20{
21 unsigned int i;
22 volatile ccsr_ddr_t *ddr;
Poonam_Aggrwal-b1081230cb1452009-01-04 08:46:38 +053023 u32 temp_sdram_cfg;
York Sunc8fc9592011-01-25 22:05:49 -080024#ifdef CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134
25 volatile ccsr_local_ecm_t *ecm = (void *)CONFIG_SYS_MPC85xx_ECM_ADDR;
26 u32 total_gb_size_per_controller;
York Sun7d9781b2011-03-17 11:18:13 -070027 unsigned int csn_bnds_backup = 0, cs_sa, cs_ea, *csn_bnds_t;
28 int csn = -1;
York Sunc8fc9592011-01-25 22:05:49 -080029#endif
Kumar Galad5a1fb92008-08-26 21:34:55 -050030
31 switch (ctrl_num) {
32 case 0:
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020033 ddr = (void *)CONFIG_SYS_MPC85xx_DDR_ADDR;
Kumar Galad5a1fb92008-08-26 21:34:55 -050034 break;
York Sune8dc17b2012-08-17 08:22:39 +000035#if defined(CONFIG_SYS_MPC85xx_DDR2_ADDR) && (CONFIG_NUM_DDR_CONTROLLERS > 1)
Kumar Galad5a1fb92008-08-26 21:34:55 -050036 case 1:
Jean-Christophe PLAGNIOL-VILLARD03836942008-10-16 15:01:15 +020037 ddr = (void *)CONFIG_SYS_MPC85xx_DDR2_ADDR;
Kumar Galad5a1fb92008-08-26 21:34:55 -050038 break;
York Sune8dc17b2012-08-17 08:22:39 +000039#endif
40#if defined(CONFIG_SYS_MPC85xx_DDR3_ADDR) && (CONFIG_NUM_DDR_CONTROLLERS > 2)
41 case 2:
42 ddr = (void *)CONFIG_SYS_MPC85xx_DDR3_ADDR;
43 break;
44#endif
45#if defined(CONFIG_SYS_MPC85xx_DDR4_ADDR) && (CONFIG_NUM_DDR_CONTROLLERS > 3)
46 case 3:
47 ddr = (void *)CONFIG_SYS_MPC85xx_DDR4_ADDR;
48 break;
49#endif
Kumar Galad5a1fb92008-08-26 21:34:55 -050050 default:
51 printf("%s unexpected ctrl_num = %u\n", __FUNCTION__, ctrl_num);
52 return;
53 }
54
york42603722010-07-02 22:25:54 +000055 out_be32(&ddr->eor, regs->ddr_eor);
56
York Sun7d9781b2011-03-17 11:18:13 -070057#ifdef CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134
York Sunb513d9d2012-08-17 08:22:36 +000058 debug("Workaround for ERRATUM_DDR111_DDR134\n");
York Sun7d9781b2011-03-17 11:18:13 -070059 for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
60 cs_sa = (regs->cs[i].bnds >> 16) & 0xfff;
61 cs_ea = regs->cs[i].bnds & 0xfff;
62 if ((cs_sa <= 0xff) && (cs_ea >= 0xff)) {
63 csn = i;
64 csn_bnds_backup = regs->cs[i].bnds;
65 csn_bnds_t = (unsigned int *) &regs->cs[i].bnds;
York Sun4b736b82012-05-21 08:43:11 +000066 if (cs_ea > 0xeff)
67 *csn_bnds_t = regs->cs[i].bnds + 0x01000000;
68 else
69 *csn_bnds_t = regs->cs[i].bnds + 0x01000100;
York Sun7d9781b2011-03-17 11:18:13 -070070 debug("Found cs%d_bns (0x%08x) covering 0xff000000, "
71 "change it to 0x%x\n",
72 csn, csn_bnds_backup, regs->cs[i].bnds);
73 break;
74 }
75 }
76#endif
Kumar Galad5a1fb92008-08-26 21:34:55 -050077 for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
78 if (i == 0) {
79 out_be32(&ddr->cs0_bnds, regs->cs[i].bnds);
80 out_be32(&ddr->cs0_config, regs->cs[i].config);
81 out_be32(&ddr->cs0_config_2, regs->cs[i].config_2);
82
83 } else if (i == 1) {
84 out_be32(&ddr->cs1_bnds, regs->cs[i].bnds);
85 out_be32(&ddr->cs1_config, regs->cs[i].config);
86 out_be32(&ddr->cs1_config_2, regs->cs[i].config_2);
87
88 } else if (i == 2) {
89 out_be32(&ddr->cs2_bnds, regs->cs[i].bnds);
90 out_be32(&ddr->cs2_config, regs->cs[i].config);
91 out_be32(&ddr->cs2_config_2, regs->cs[i].config_2);
92
93 } else if (i == 3) {
94 out_be32(&ddr->cs3_bnds, regs->cs[i].bnds);
95 out_be32(&ddr->cs3_config, regs->cs[i].config);
96 out_be32(&ddr->cs3_config_2, regs->cs[i].config_2);
97 }
98 }
99
100 out_be32(&ddr->timing_cfg_3, regs->timing_cfg_3);
101 out_be32(&ddr->timing_cfg_0, regs->timing_cfg_0);
102 out_be32(&ddr->timing_cfg_1, regs->timing_cfg_1);
103 out_be32(&ddr->timing_cfg_2, regs->timing_cfg_2);
104 out_be32(&ddr->sdram_cfg_2, regs->ddr_sdram_cfg_2);
105 out_be32(&ddr->sdram_mode, regs->ddr_sdram_mode);
106 out_be32(&ddr->sdram_mode_2, regs->ddr_sdram_mode_2);
York Sunba0c2eb2011-01-10 12:03:00 +0000107 out_be32(&ddr->sdram_mode_3, regs->ddr_sdram_mode_3);
108 out_be32(&ddr->sdram_mode_4, regs->ddr_sdram_mode_4);
109 out_be32(&ddr->sdram_mode_5, regs->ddr_sdram_mode_5);
110 out_be32(&ddr->sdram_mode_6, regs->ddr_sdram_mode_6);
111 out_be32(&ddr->sdram_mode_7, regs->ddr_sdram_mode_7);
112 out_be32(&ddr->sdram_mode_8, regs->ddr_sdram_mode_8);
Kumar Galad5a1fb92008-08-26 21:34:55 -0500113 out_be32(&ddr->sdram_md_cntl, regs->ddr_sdram_md_cntl);
114 out_be32(&ddr->sdram_interval, regs->ddr_sdram_interval);
115 out_be32(&ddr->sdram_data_init, regs->ddr_data_init);
116 out_be32(&ddr->sdram_clk_cntl, regs->ddr_sdram_clk_cntl);
117 out_be32(&ddr->init_addr, regs->ddr_init_addr);
118 out_be32(&ddr->init_ext_addr, regs->ddr_init_ext_addr);
119
120 out_be32(&ddr->timing_cfg_4, regs->timing_cfg_4);
121 out_be32(&ddr->timing_cfg_5, regs->timing_cfg_5);
122 out_be32(&ddr->ddr_zq_cntl, regs->ddr_zq_cntl);
123 out_be32(&ddr->ddr_wrlvl_cntl, regs->ddr_wrlvl_cntl);
York Sun7d69ea32012-10-08 07:44:22 +0000124 if (regs->ddr_wrlvl_cntl_2)
125 out_be32(&ddr->ddr_wrlvl_cntl_2, regs->ddr_wrlvl_cntl_2);
126 if (regs->ddr_wrlvl_cntl_3)
127 out_be32(&ddr->ddr_wrlvl_cntl_3, regs->ddr_wrlvl_cntl_3);
128
Kumar Galad5a1fb92008-08-26 21:34:55 -0500129 out_be32(&ddr->ddr_sr_cntr, regs->ddr_sr_cntr);
130 out_be32(&ddr->ddr_sdram_rcw_1, regs->ddr_sdram_rcw_1);
131 out_be32(&ddr->ddr_sdram_rcw_2, regs->ddr_sdram_rcw_2);
York Sun7dda8472011-01-10 12:02:59 +0000132 out_be32(&ddr->ddr_cdr1, regs->ddr_cdr1);
133 out_be32(&ddr->ddr_cdr2, regs->ddr_cdr2);
134 out_be32(&ddr->err_disable, regs->err_disable);
135 out_be32(&ddr->err_int_en, regs->err_int_en);
York Sunb513d9d2012-08-17 08:22:36 +0000136 for (i = 0; i < 32; i++) {
137 if (regs->debug[i]) {
138 debug("Write to debug_%d as %08x\n", i+1, regs->debug[i]);
139 out_be32(&ddr->debug[i], regs->debug[i]);
140 }
141 }
Kumar Galad5a1fb92008-08-26 21:34:55 -0500142
York Sundf2be192011-11-20 10:01:35 -0800143#ifdef CONFIG_SYS_FSL_ERRATUM_DDR_A003474
144 out_be32(&ddr->debug[12], 0x00000015);
145 out_be32(&ddr->debug[21], 0x24000000);
146#endif /* CONFIG_SYS_FSL_ERRATUM_DDR_A003474 */
147
Ed Swarthoute674b832009-02-24 02:37:59 -0600148 /* Set, but do not enable the memory */
149 temp_sdram_cfg = regs->ddr_sdram_cfg;
Poonam_Aggrwal-b1081230cb1452009-01-04 08:46:38 +0530150 temp_sdram_cfg &= ~(SDRAM_CFG_MEM_EN);
151 out_be32(&ddr->sdram_cfg, temp_sdram_cfg);
York Sun922f40f2011-01-10 12:03:01 +0000152#ifdef CONFIG_SYS_FSL_ERRATUM_DDR_A003
York Sunb513d9d2012-08-17 08:22:36 +0000153 debug("Workaround for ERRATUM_DDR_A003\n");
York Sun922f40f2011-01-10 12:03:01 +0000154 if (regs->ddr_sdram_rcw_2 & 0x00f00000) {
155 out_be32(&ddr->timing_cfg_2, regs->timing_cfg_2 & 0xf07fffff);
156 out_be32(&ddr->debug[2], 0x00000400);
157 out_be32(&ddr->ddr_zq_cntl, regs->ddr_zq_cntl & 0x7fffffff);
158 out_be32(&ddr->ddr_wrlvl_cntl, regs->ddr_wrlvl_cntl & 0x7fffffff);
159 out_be32(&ddr->sdram_cfg_2, regs->ddr_sdram_cfg_2 & 0xffffffeb);
160 out_be32(&ddr->mtcr, 0);
161 out_be32(&ddr->debug[12], 0x00000015);
162 out_be32(&ddr->debug[21], 0x24000000);
163 out_be32(&ddr->sdram_interval, regs->ddr_sdram_interval & 0xffff);
164 out_be32(&ddr->sdram_cfg, temp_sdram_cfg | SDRAM_CFG_BI | SDRAM_CFG_MEM_EN);
165
166 asm volatile("sync;isync");
167 while (!(in_be32(&ddr->debug[1]) & 0x2))
168 ;
169
170 switch (regs->ddr_sdram_rcw_2 & 0x00f00000) {
171 case 0x00000000:
172 out_be32(&ddr->sdram_md_cntl,
173 MD_CNTL_MD_EN |
174 MD_CNTL_CS_SEL_CS0_CS1 |
175 0x04000000 |
176 MD_CNTL_WRCW |
177 MD_CNTL_MD_VALUE(0x02));
178 break;
179 case 0x00100000:
180 out_be32(&ddr->sdram_md_cntl,
181 MD_CNTL_MD_EN |
182 MD_CNTL_CS_SEL_CS0_CS1 |
183 0x04000000 |
184 MD_CNTL_WRCW |
185 MD_CNTL_MD_VALUE(0x0a));
186 break;
187 case 0x00200000:
188 out_be32(&ddr->sdram_md_cntl,
189 MD_CNTL_MD_EN |
190 MD_CNTL_CS_SEL_CS0_CS1 |
191 0x04000000 |
192 MD_CNTL_WRCW |
193 MD_CNTL_MD_VALUE(0x12));
194 break;
195 case 0x00300000:
196 out_be32(&ddr->sdram_md_cntl,
197 MD_CNTL_MD_EN |
198 MD_CNTL_CS_SEL_CS0_CS1 |
199 0x04000000 |
200 MD_CNTL_WRCW |
201 MD_CNTL_MD_VALUE(0x1a));
202 break;
203 default:
204 out_be32(&ddr->sdram_md_cntl,
205 MD_CNTL_MD_EN |
206 MD_CNTL_CS_SEL_CS0_CS1 |
207 0x04000000 |
208 MD_CNTL_WRCW |
209 MD_CNTL_MD_VALUE(0x02));
210 printf("Unsupported RC10\n");
211 break;
212 }
213
214 while (in_be32(&ddr->sdram_md_cntl) & 0x80000000)
215 ;
216 udelay(6);
217 out_be32(&ddr->sdram_cfg, temp_sdram_cfg);
218 out_be32(&ddr->timing_cfg_2, regs->timing_cfg_2);
219 out_be32(&ddr->debug[2], 0x0);
220 out_be32(&ddr->ddr_zq_cntl, regs->ddr_zq_cntl);
221 out_be32(&ddr->ddr_wrlvl_cntl, regs->ddr_wrlvl_cntl);
222 out_be32(&ddr->sdram_cfg_2, regs->ddr_sdram_cfg_2);
223 out_be32(&ddr->debug[12], 0x0);
224 out_be32(&ddr->debug[21], 0x0);
225 out_be32(&ddr->sdram_interval, regs->ddr_sdram_interval);
226
227 }
228#endif
Kumar Galad5a1fb92008-08-26 21:34:55 -0500229 /*
Dave Liu7dc79f72008-10-23 21:18:53 +0800230 * For 8572 DDR1 erratum - DDR controller may enter illegal state
231 * when operatiing in 32-bit bus mode with 4-beat bursts,
232 * This erratum does not affect DDR3 mode, only for DDR2 mode.
Kumar Galad5a1fb92008-08-26 21:34:55 -0500233 */
York Sun9aa857b2011-01-25 21:51:27 -0800234#ifdef CONFIG_SYS_FSL_ERRATUM_DDR_115
York Sunb513d9d2012-08-17 08:22:36 +0000235 debug("Workaround for ERRATUM_DDR_115\n");
Kumar Galad5a1fb92008-08-26 21:34:55 -0500236 if ((((in_be32(&ddr->sdram_cfg) >> 24) & 0x7) == SDRAM_TYPE_DDR2)
Dave Liu7dc79f72008-10-23 21:18:53 +0800237 && in_be32(&ddr->sdram_cfg) & 0x80000) {
Kumar Galad5a1fb92008-08-26 21:34:55 -0500238 /* set DEBUG_1[31] */
York Sun7dda8472011-01-10 12:02:59 +0000239 setbits_be32(&ddr->debug[0], 1);
Kumar Galad5a1fb92008-08-26 21:34:55 -0500240 }
Dave Liu7dc79f72008-10-23 21:18:53 +0800241#endif
York Sunc8fc9592011-01-25 22:05:49 -0800242#ifdef CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134
York Sunb513d9d2012-08-17 08:22:36 +0000243 debug("Workaround for ERRATUM_DDR111_DDR134\n");
York Sunc8fc9592011-01-25 22:05:49 -0800244 /*
245 * This is the combined workaround for DDR111 and DDR134
246 * following the published errata for MPC8572
247 */
248
249 /* 1. Set EEBACR[3] */
250 setbits_be32(&ecm->eebacr, 0x10000000);
251 debug("Setting EEBACR[3] to 0x%08x\n", in_be32(&ecm->eebacr));
252
253 /* 2. Set DINIT in SDRAM_CFG_2*/
254 setbits_be32(&ddr->sdram_cfg_2, SDRAM_CFG2_D_INIT);
255 debug("Setting sdram_cfg_2[D_INIT] to 0x%08x\n",
256 in_be32(&ddr->sdram_cfg_2));
257
258 /* 3. Set DEBUG_3[21] */
259 setbits_be32(&ddr->debug[2], 0x400);
260 debug("Setting DEBUG_3[21] to 0x%08x\n", in_be32(&ddr->debug[2]));
261
262#endif /* part 1 of the workaound */
Kumar Galad5a1fb92008-08-26 21:34:55 -0500263
264 /*
Dave Liu4be87b22009-03-14 12:48:30 +0800265 * 500 painful micro-seconds must elapse between
Kumar Galad5a1fb92008-08-26 21:34:55 -0500266 * the DDR clock setup and the DDR config enable.
Dave Liu4be87b22009-03-14 12:48:30 +0800267 * DDR2 need 200 us, and DDR3 need 500 us from spec,
268 * we choose the max, that is 500 us for all of case.
Kumar Galad5a1fb92008-08-26 21:34:55 -0500269 */
Dave Liu4be87b22009-03-14 12:48:30 +0800270 udelay(500);
Kumar Galad5a1fb92008-08-26 21:34:55 -0500271 asm volatile("sync;isync");
272
Poonam_Aggrwal-b1081230cb1452009-01-04 08:46:38 +0530273 /* Let the controller go */
York Sun922f40f2011-01-10 12:03:01 +0000274 temp_sdram_cfg = in_be32(&ddr->sdram_cfg) & ~SDRAM_CFG_BI;
Poonam_Aggrwal-b1081230cb1452009-01-04 08:46:38 +0530275 out_be32(&ddr->sdram_cfg, temp_sdram_cfg | SDRAM_CFG_MEM_EN);
York Sun922f40f2011-01-10 12:03:01 +0000276 asm volatile("sync;isync");
Kumar Galad5a1fb92008-08-26 21:34:55 -0500277
278 /* Poll DDR_SDRAM_CFG_2[D_INIT] bit until auto-data init is done. */
York Sunc8fc9592011-01-25 22:05:49 -0800279 while (in_be32(&ddr->sdram_cfg_2) & SDRAM_CFG2_D_INIT)
Kumar Galad5a1fb92008-08-26 21:34:55 -0500280 udelay(10000); /* throttle polling rate */
York Sunc8fc9592011-01-25 22:05:49 -0800281
282#ifdef CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134
283 /* continue this workaround */
284
285 /* 4. Clear DEBUG3[21] */
286 clrbits_be32(&ddr->debug[2], 0x400);
287 debug("Clearing D3[21] to 0x%08x\n", in_be32(&ddr->debug[2]));
288
289 /* DDR134 workaround starts */
290 /* A: Clear sdram_cfg_2[odt_cfg] */
291 clrbits_be32(&ddr->sdram_cfg_2, SDRAM_CFG2_ODT_CFG_MASK);
292 debug("Clearing SDRAM_CFG2[ODT_CFG] to 0x%08x\n",
293 in_be32(&ddr->sdram_cfg_2));
294
295 /* B: Set DEBUG1[15] */
296 setbits_be32(&ddr->debug[0], 0x10000);
297 debug("Setting D1[15] to 0x%08x\n", in_be32(&ddr->debug[0]));
298
299 /* C: Set timing_cfg_2[cpo] to 0b11111 */
300 setbits_be32(&ddr->timing_cfg_2, TIMING_CFG_2_CPO_MASK);
301 debug("Setting TMING_CFG_2[CPO] to 0x%08x\n",
302 in_be32(&ddr->timing_cfg_2));
303
304 /* D: Set D6 to 0x9f9f9f9f */
305 out_be32(&ddr->debug[5], 0x9f9f9f9f);
306 debug("Setting D6 to 0x%08x\n", in_be32(&ddr->debug[5]));
307
308 /* E: Set D7 to 0x9f9f9f9f */
309 out_be32(&ddr->debug[6], 0x9f9f9f9f);
310 debug("Setting D7 to 0x%08x\n", in_be32(&ddr->debug[6]));
311
312 /* F: Set D2[20] */
313 setbits_be32(&ddr->debug[1], 0x800);
314 debug("Setting D2[20] to 0x%08x\n", in_be32(&ddr->debug[1]));
315
316 /* G: Poll on D2[20] until cleared */
317 while (in_be32(&ddr->debug[1]) & 0x800)
318 udelay(10000); /* throttle polling rate */
319
320 /* H: Clear D1[15] */
321 clrbits_be32(&ddr->debug[0], 0x10000);
322 debug("Setting D1[15] to 0x%08x\n", in_be32(&ddr->debug[0]));
323
324 /* I: Set sdram_cfg_2[odt_cfg] */
325 setbits_be32(&ddr->sdram_cfg_2,
326 regs->ddr_sdram_cfg_2 & SDRAM_CFG2_ODT_CFG_MASK);
327 debug("Setting sdram_cfg_2 to 0x%08x\n", in_be32(&ddr->sdram_cfg_2));
328
329 /* Continuing with the DDR111 workaround */
330 /* 5. Set D2[21] */
331 setbits_be32(&ddr->debug[1], 0x400);
332 debug("Setting D2[21] to 0x%08x\n", in_be32(&ddr->debug[1]));
333
334 /* 6. Poll D2[21] until its cleared */
335 while (in_be32(&ddr->debug[1]) & 0x400)
336 udelay(10000); /* throttle polling rate */
337
338 /* 7. Wait for 400ms/GB */
339 total_gb_size_per_controller = 0;
340 for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) {
York Sun4b736b82012-05-21 08:43:11 +0000341 if (i == csn) {
342 total_gb_size_per_controller +=
343 ((csn_bnds_backup & 0xFFFF) >> 6)
344 - (csn_bnds_backup >> 22) + 1;
345 } else {
346 total_gb_size_per_controller +=
York Sunc8fc9592011-01-25 22:05:49 -0800347 ((regs->cs[i].bnds & 0xFFFF) >> 6)
348 - (regs->cs[i].bnds >> 22) + 1;
York Sun4b736b82012-05-21 08:43:11 +0000349 }
Kumar Galad5a1fb92008-08-26 21:34:55 -0500350 }
York Sunc8fc9592011-01-25 22:05:49 -0800351 if (in_be32(&ddr->sdram_cfg) & 0x80000)
352 total_gb_size_per_controller <<= 1;
353 debug("Wait for %d ms\n", total_gb_size_per_controller * 400);
354 udelay(total_gb_size_per_controller * 400000);
355
356 /* 8. Set sdram_cfg_2[dinit] if options requires */
357 setbits_be32(&ddr->sdram_cfg_2,
358 regs->ddr_sdram_cfg_2 & SDRAM_CFG2_D_INIT);
359 debug("Setting sdram_cfg_2 to 0x%08x\n", in_be32(&ddr->sdram_cfg_2));
360
361 /* 9. Poll until dinit is cleared */
362 while (in_be32(&ddr->sdram_cfg_2) & SDRAM_CFG2_D_INIT)
363 udelay(10000);
364
365 /* 10. Clear EEBACR[3] */
366 clrbits_be32(&ecm->eebacr, 10000000);
367 debug("Clearing EEBACR[3] to 0x%08x\n", in_be32(&ecm->eebacr));
York Sun7d9781b2011-03-17 11:18:13 -0700368
369 if (csn != -1) {
370 csn_bnds_t = (unsigned int *) &regs->cs[csn].bnds;
371 *csn_bnds_t = csn_bnds_backup;
372 debug("Change cs%d_bnds back to 0x%08x\n",
373 csn, regs->cs[csn].bnds);
374 setbits_be32(&ddr->sdram_cfg, 0x2); /* MEM_HALT */
375 switch (csn) {
376 case 0:
377 out_be32(&ddr->cs0_bnds, regs->cs[csn].bnds);
378 break;
379 case 1:
380 out_be32(&ddr->cs1_bnds, regs->cs[csn].bnds);
381 break;
382 case 2:
383 out_be32(&ddr->cs2_bnds, regs->cs[csn].bnds);
384 break;
385 case 3:
386 out_be32(&ddr->cs3_bnds, regs->cs[csn].bnds);
387 break;
388 }
389 clrbits_be32(&ddr->sdram_cfg, 0x2);
390 }
York Sunc8fc9592011-01-25 22:05:49 -0800391#endif /* CONFIG_SYS_FSL_ERRATUM_DDR111_DDR134 */
Kumar Galad5a1fb92008-08-26 21:34:55 -0500392}