]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - common/autoboot.c
Merge git://git.denx.de/u-boot-mpc86xx
[karo-tx-uboot.git] / common / autoboot.c
index 223e06274025bea71afd2b15052ca2337d07d7bb..c52bad84a4d0b8f89170ad0735379ea2c8034a23 100644 (file)
@@ -182,16 +182,11 @@ static int passwd_abort(uint64_t etime)
  * Watch for 'delay' seconds for autoboot stop or autoboot delay string.
  * returns: 0 -  no key string, allow autoboot 1 - got key string, abort
  */
-static int abortboot_keyed(int bootdelay)
+static int __abortboot(int bootdelay)
 {
        int abort;
        uint64_t etime = endtick(bootdelay);
 
-#ifndef CONFIG_ZERO_BOOTDELAY_CHECK
-       if (bootdelay == 0)
-               return 0;
-#endif
-
 #  ifdef CONFIG_AUTOBOOT_PROMPT
        /*
         * CONFIG_AUTOBOOT_PROMPT includes the %d for all boards.
@@ -204,11 +199,6 @@ static int abortboot_keyed(int bootdelay)
        if (!abort)
                debug_bootkeys("key timeout\n");
 
-#ifdef CONFIG_SILENT_CONSOLE
-       if (abort)
-               gd->flags &= ~GD_FLG_SILENT;
-#endif
-
        return abort;
 }
 
@@ -218,7 +208,7 @@ static int abortboot_keyed(int bootdelay)
 static int menukey;
 #endif
 
-static int abortboot_normal(int bootdelay)
+static int __abortboot(int bootdelay)
 {
        int abort = 0;
        unsigned long ts;
@@ -226,23 +216,17 @@ static int abortboot_normal(int bootdelay)
 #ifdef CONFIG_MENUPROMPT
        printf(CONFIG_MENUPROMPT);
 #else
-       if (bootdelay >= 0)
-               printf("Hit any key to stop autoboot: %2d ", bootdelay);
+       printf("Hit any key to stop autoboot: %2d ", bootdelay);
 #endif
 
-#if defined CONFIG_ZERO_BOOTDELAY_CHECK
        /*
         * Check if key already pressed
-        * Don't check if bootdelay < 0
         */
-       if (bootdelay >= 0) {
-               if (tstc()) {   /* we got a key press   */
-                       (void) getc();  /* consume input        */
-                       puts("\b\b\b 0");
-                       abort = 1;      /* don't auto boot      */
-               }
+       if (tstc()) {   /* we got a key press   */
+               (void) getc();  /* consume input        */
+               puts("\b\b\b 0");
+               abort = 1;      /* don't auto boot      */
        }
-#endif
 
        while ((bootdelay > 0) && (!abort)) {
                --bootdelay;
@@ -267,22 +251,23 @@ static int abortboot_normal(int bootdelay)
 
        putc('\n');
 
-#ifdef CONFIG_SILENT_CONSOLE
-       if (abort)
-               gd->flags &= ~GD_FLG_SILENT;
-#endif
-
        return abort;
 }
 # endif        /* CONFIG_AUTOBOOT_KEYED */
 
 static int abortboot(int bootdelay)
 {
-#ifdef CONFIG_AUTOBOOT_KEYED
-       return abortboot_keyed(bootdelay);
-#else
-       return abortboot_normal(bootdelay);
+       int abort = 0;
+
+       if (bootdelay >= 0)
+               abort = __abortboot(bootdelay);
+
+#ifdef CONFIG_SILENT_CONSOLE
+       if (abort)
+               gd->flags &= ~GD_FLG_SILENT;
 #endif
+
+       return abort;
 }
 
 static void process_fdt_options(const void *blob)