X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fautoboot.c;h=94133eaeda782eeccbc0ac63a8581552dc7893c3;hb=b4c3fb087b06ec56cc325e2e73f8f497be89d129;hp=a0118650287e08e12e979dffc3367acdb8bfc01c;hpb=336aee50cf55d4d98ddf3a4412c18286e7f0a4c0;p=u-boot diff --git a/common/autoboot.c b/common/autoboot.c index a011865028..94133eaeda 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -1,8 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (C) Copyright 2000 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -14,6 +13,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -57,7 +57,7 @@ static int passwd_abort(uint64_t etime) const char *algo_name = "sha256"; u_int presskey_len = 0; int abort = 0; - int size; + int size = sizeof(sha); int ret; if (sha_env_str == NULL) @@ -291,18 +291,8 @@ const char *bootdelay_process(void) { char *s; int bootdelay; -#ifdef CONFIG_BOOTCOUNT_LIMIT - unsigned long bootcount = 0; - unsigned long bootlimit = 0; -#endif /* CONFIG_BOOTCOUNT_LIMIT */ - -#ifdef CONFIG_BOOTCOUNT_LIMIT - bootcount = bootcount_load(); - bootcount++; - bootcount_store(bootcount); - env_set_ulong("bootcount", bootcount); - bootlimit = env_get_ulong("bootlimit", 10, 0); -#endif /* CONFIG_BOOTCOUNT_LIMIT */ + + bootcount_inc(); s = env_get("bootdelay"); bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY; @@ -324,13 +314,9 @@ const char *bootdelay_process(void) s = env_get("failbootcmd"); } else #endif /* CONFIG_POST */ -#ifdef CONFIG_BOOTCOUNT_LIMIT - if (bootlimit && (bootcount > bootlimit)) { - printf("Warning: Bootlimit (%u) exceeded. Using altbootcmd.\n", - (unsigned)bootlimit); + if (bootcount_error()) s = env_get("altbootcmd"); - } else -#endif /* CONFIG_BOOTCOUNT_LIMIT */ + else s = env_get("bootcmd"); process_fdt_options(gd->fdt_blob);