Skip to content

Commit

Permalink
x86: Move test for cold boot into init functions
Browse files Browse the repository at this point in the history
  • Loading branch information
calris committed Feb 12, 2011
1 parent c869e2a commit bf6af15
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
7 changes: 4 additions & 3 deletions arch/i386/cpu/sc520/sc520.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,16 @@ int cpu_init_f(void)
gd->cpu_clk = 100000000;
}


/* wait at least one millisecond */
asm("movl $0x2000, %%ecx\n"
"0: pushl %%ecx\n"
"popl %%ecx\n"
"loop 0b\n": : : "ecx");

/* turn on the SDRAM write buffer */
writeb(0x11, &sc520_mmcr->dbctl);
if (gd->flags & GD_FLG_COLD_BOOT) {
/* turn on the SDRAM write buffer */
writeb(0x11, &sc520_mmcr->dbctl);
}

return x86_cpu_init_f();
}
Expand Down
17 changes: 7 additions & 10 deletions arch/i386/lib/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,13 @@ void board_init_f(ulong boot_flags)
dest_addr -= (bss_end - text_start);
rel_offset = text_start - dest_addr;

/* Perform low-level initialization only when cold booted */
if (gd->flags & GD_FLG_COLD_BOOT) {
/* First stage CPU initialization */
if (cpu_init_f() != 0)
hang();

/* First stage Board initialization */
if (board_early_init_f() != 0)
hang();
}
/* First stage CPU initialization */
if (cpu_init_f() != 0)
hang();

/* First stage Board initialization */
if (board_early_init_f() != 0)
hang();

/* Copy U-Boot into RAM */
dst_addr = (ulong *)dest_addr;
Expand Down

0 comments on commit bf6af15

Please sign in to comment.