* 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.
if (!abort)
debug_bootkeys("key timeout\n");
-#ifdef CONFIG_SILENT_CONSOLE
- if (abort)
- gd->flags &= ~GD_FLG_SILENT;
-#endif
-
return abort;
}
static int menukey;
#endif
-static int abortboot_normal(int bootdelay)
+static int __abortboot(int bootdelay)
{
int abort = 0;
unsigned long ts;
#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;
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)
{
-#if defined(CONFIG_OF_CONTROL)
+#if defined(CONFIG_OF_CONTROL) && defined(CONFIG_SYS_TEXT_BASE)
ulong addr;
/* Add an env variable to point to a kernel payload, if available */
addr = fdtdec_get_config_int(gd->fdt_blob, "rootdisk-offset", 0);
if (addr)
setenv_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
-#endif /* CONFIG_OF_CONTROL */
+#endif /* CONFIG_OF_CONTROL && CONFIG_SYS_TEXT_BASE */
}
const char *bootdelay_process(void)