summaryrefslogtreecommitdiff
path: root/src/northbridge/intel/e7520
diff options
context:
space:
mode:
authorNoe Rubinstein <nrubinstein@proformatique.com>2011-05-05 15:44:40 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2011-09-09 11:40:48 +0200
commit03169d3e1c03e76670ff7a07de7ee4fc6f601d3a (patch)
treeaa448fc0896cfe37ede9f9eaf128e4acc2480570 /src/northbridge/intel/e7520
parentac624a638d25645f9a9a25ee2e16224aaf921b98 (diff)
Replace while with do; while to avoid repetition
Cosmetic only; replaces some 'while' loops with 'do; while' loops to avoid repetition. Replacement performed by the Ruby expression: t.gsub!(/^(\s*)([^\n\{]+)\n\1(while[^\n\{;]+)\n\s*\2/, "\\1do \\2\n\\1\\3;") Change-Id: Ie0a4fa622df881edeaab08f59bb888a903b864fd Signed-off-by: Noe Rubinstein <nrubinstein@proformatique.com> Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/183 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/northbridge/intel/e7520')
-rw-r--r--src/northbridge/intel/e7520/raminit.c55
1 files changed, 22 insertions, 33 deletions
diff --git a/src/northbridge/intel/e7520/raminit.c b/src/northbridge/intel/e7520/raminit.c
index 7a0661cbe3..e9a60f1e20 100644
--- a/src/northbridge/intel/e7520/raminit.c
+++ b/src/northbridge/intel/e7520/raminit.c
@@ -1128,9 +1128,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
write32(BAR+0x100, (0x83000000 | (i<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
@@ -1139,9 +1138,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
for(cs=0;cs<8;cs++) {
write32(BAR + DCALCSR, (0x83000000 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* Precharg all banks */
@@ -1152,9 +1150,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
else /* DDR1 */
write32(BAR+DCALADDR, 0x00000000);
write32(BAR+DCALCSR, (0x83000002 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* EMRS dll's enabled */
@@ -1166,9 +1163,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
else /* DDR1 */
write32(BAR+DCALADDR, 0x00000001);
write32(BAR+DCALCSR, (0x83000003 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* MRS reset dll's */
do_delay();
@@ -1187,9 +1183,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
for(cs=0;cs<8;cs++) {
write32(BAR+DCALADDR, mode_reg);
write32(BAR+DCALCSR, (0x83000003 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* Precharg all banks */
@@ -1202,25 +1197,22 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
else /* DDR1 */
write32(BAR+DCALADDR, 0x00000000);
write32(BAR+DCALCSR, (0x83000002 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* Do 2 refreshes */
do_delay();
for(cs=0;cs<8;cs++) {
write32(BAR+DCALCSR, (0x83000001 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
do_delay();
for(cs=0;cs<8;cs++) {
write32(BAR+DCALCSR, (0x83000001 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
do_delay();
/* for good luck do 6 more */
@@ -1253,9 +1245,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
for(cs=0;cs<8;cs++) {
write32(BAR+DCALADDR, (mode_reg & ~(1<<24)));
write32(BAR+DCALCSR, (0x83000003 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* Do only if DDR2 EMRS dll's enabled */
@@ -1264,9 +1255,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
for(cs=0;cs<8;cs++) {
write32(BAR+DCALADDR, (0x0b940001));
write32(BAR+DCALCSR, (0x83000003 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
}
@@ -1310,9 +1300,8 @@ static void sdram_enable(int controllers, const struct mem_controller *ctrl)
for(cs=0;cs<8;cs++) {
write32(BAR+DCALCSR, (0x830831d8 | (cs<<20)));
- data32 = read32(BAR+DCALCSR);
- while(data32 & 0x80000000)
- data32 = read32(BAR+DCALCSR);
+ do data32 = read32(BAR+DCALCSR);
+ while(data32 & 0x80000000);
}
/* Bring memory subsystem on line */