]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
x86: Move test for cold boot into init functions
authorGraeme Russ <graeme.russ@gmail.com>
Sat, 12 Feb 2011 04:12:01 +0000 (15:12 +1100)
committerGraeme Russ <graeme.russ@gmail.com>
Sat, 12 Feb 2011 04:12:01 +0000 (15:12 +1100)
arch/i386/cpu/sc520/sc520.c
arch/i386/lib/board.c

index d5597ca453df42ee0ab9834fb7b0c8e0e739d0bd..e5dcac675beb1c68eacd628c8d5fbef1d2b953a2 100644 (file)
@@ -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();
 }
index 0b26c831338e80083d7bbbcfbbb9a7af5622405a..1fd422f2ff8d5076142918f81388760b94c858b8 100644 (file)
@@ -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;