1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
11 #include <bootstage.h>
20 static void run_preboot_environment_command(void)
24 p = env_get("preboot");
28 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
29 prev = disable_ctrlc(1); /* disable Ctrl-C checking */
31 run_command_list(p, -1, 0);
33 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
34 disable_ctrlc(prev); /* restore Ctrl-C checking */
38 /* We come here after U-Boot is initialised and ready to process commands */
43 bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
45 if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
46 env_set("ver", version_string); /* set version variable */
50 if (IS_ENABLED(CONFIG_USE_PREBOOT))
51 run_preboot_environment_command();
53 if (IS_ENABLED(CONFIG_UPDATE_TFTP))
54 update_tftp(0UL, NULL, NULL);
56 s = bootdelay_process();
57 if (cli_process_fdt(&s))
58 cli_secure_boot_cmd(s);
63 panic("No CLI available");