Skip to content
Snippets Groups Projects
Commit bf6af154 authored by Graeme Russ's avatar Graeme Russ
Browse files

x86: Move test for cold boot into init functions

parent c869e2ac
No related branches found
No related tags found
No related merge requests found
...@@ -45,15 +45,16 @@ int cpu_init_f(void) ...@@ -45,15 +45,16 @@ int cpu_init_f(void)
gd->cpu_clk = 100000000; gd->cpu_clk = 100000000;
} }
/* wait at least one millisecond */ /* wait at least one millisecond */
asm("movl $0x2000, %%ecx\n" asm("movl $0x2000, %%ecx\n"
"0: pushl %%ecx\n" "0: pushl %%ecx\n"
"popl %%ecx\n" "popl %%ecx\n"
"loop 0b\n": : : "ecx"); "loop 0b\n": : : "ecx");
/* turn on the SDRAM write buffer */ if (gd->flags & GD_FLG_COLD_BOOT) {
writeb(0x11, &sc520_mmcr->dbctl); /* turn on the SDRAM write buffer */
writeb(0x11, &sc520_mmcr->dbctl);
}
return x86_cpu_init_f(); return x86_cpu_init_f();
} }
......
...@@ -207,16 +207,13 @@ void board_init_f(ulong boot_flags) ...@@ -207,16 +207,13 @@ void board_init_f(ulong boot_flags)
dest_addr -= (bss_end - text_start); dest_addr -= (bss_end - text_start);
rel_offset = text_start - dest_addr; rel_offset = text_start - dest_addr;
/* Perform low-level initialization only when cold booted */ /* First stage CPU initialization */
if (gd->flags & GD_FLG_COLD_BOOT) { if (cpu_init_f() != 0)
/* First stage CPU initialization */ hang();
if (cpu_init_f() != 0)
hang(); /* First stage Board initialization */
if (board_early_init_f() != 0)
/* First stage Board initialization */ hang();
if (board_early_init_f() != 0)
hang();
}
/* Copy U-Boot into RAM */ /* Copy U-Boot into RAM */
dst_addr = (ulong *)dest_addr; dst_addr = (ulong *)dest_addr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment