static int stored_bootdelay;
static int menukey;
-#if !defined(CONFIG_AUTOBOOT_STOP_STR_CRYPT)
-#define CONFIG_AUTOBOOT_STOP_STR_CRYPT ""
+#if defined(CONFIG_AUTOBOOT_STOP_STR_CRYPT)
+#define AUTOBOOT_STOP_STR_CRYPT CONFIG_AUTOBOOT_STOP_STR_CRYPT
+#else
+#define AUTOBOOT_STOP_STR_CRYPT ""
#endif
-#if !defined(CONFIG_AUTOBOOT_STOP_STR_SHA256)
-#define CONFIG_AUTOBOOT_STOP_STR_SHA256 ""
+#if defined(CONFIG_AUTOBOOT_STOP_STR_SHA256)
+#define AUTOBOOT_STOP_STR_SHA256 CONFIG_AUTOBOOT_STOP_STR_SHA256
+#else
+#define AUTOBOOT_STOP_STR_SHA256 ""
#endif
#ifdef CONFIG_AUTOBOOT_USE_MENUKEY
int err;
if (IS_ENABLED(CONFIG_AUTOBOOT_STOP_STR_ENABLE) && !crypt_env_str)
- crypt_env_str = CONFIG_AUTOBOOT_STOP_STR_CRYPT;
+ crypt_env_str = AUTOBOOT_STOP_STR_CRYPT;
if (!crypt_env_str)
return 0;
presskey_len++;
}
}
+ udelay(10000);
} while (never_timeout || get_ticks() <= etime);
return abort;
int ret;
if (sha_env_str == NULL)
- sha_env_str = CONFIG_AUTOBOOT_STOP_STR_SHA256;
+ sha_env_str = AUTOBOOT_STOP_STR_SHA256;
presskey = malloc_cache_aligned(DELAY_STOP_STR_MAX_LENGTH);
c = strstr(sha_env_str, ":");
if (slow_equals(sha, sha_env, SHA256_SUM_LEN))
abort = 1;
}
+ udelay(10000);
} while (!abort && get_ticks() <= etime);
free(presskey);
abort = 1;
}
}
+ udelay(10000);
} while (!abort && get_ticks() <= etime);
return abort;
return abort;
}
-static void process_fdt_options(const void *blob)
+static void process_fdt_options(void)
{
-#ifdef CONFIG_SYS_TEXT_BASE
+#ifdef CONFIG_TEXT_BASE
ulong addr;
/* Add an env variable to point to a kernel payload, if available */
addr = ofnode_conf_read_int("kernel-offset", 0);
if (addr)
- env_set_addr("kernaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
+ env_set_addr("kernaddr", (void *)(CONFIG_TEXT_BASE + addr));
/* Add an env variable to point to a root disk, if available */
addr = ofnode_conf_read_int("rootdisk-offset", 0);
if (addr)
- env_set_addr("rootaddr", (void *)(CONFIG_SYS_TEXT_BASE + addr));
-#endif /* CONFIG_SYS_TEXT_BASE */
+ env_set_addr("rootaddr", (void *)(CONFIG_TEXT_BASE + addr));
+#endif /* CONFIG_TEXT_BASE */
}
const char *bootdelay_process(void)
s = env_get("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
+ /*
+ * Does it really make sense that the devicetree overrides the user
+ * setting? It is possibly helpful for security since the device tree
+ * may be signed whereas the environment is often loaded from storage.
+ */
if (IS_ENABLED(CONFIG_OF_CONTROL))
bootdelay = ofnode_conf_read_int("bootdelay", bootdelay);
s = env_get("bootcmd");
if (IS_ENABLED(CONFIG_OF_CONTROL))
- process_fdt_options(gd->fdt_blob);
+ process_fdt_options();
stored_bootdelay = bootdelay;
return s;