1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
11 #include <bootstage.h>
18 #include <version_string.h>
19 #include <efi_loader.h>
21 static void run_preboot_environment_command(void)
25 p = env_get("preboot");
29 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
30 prev = disable_ctrlc(1); /* disable Ctrl-C checking */
32 run_command_list(p, -1, 0);
34 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
35 disable_ctrlc(prev); /* restore Ctrl-C checking */
39 /* We come here after U-Boot is initialised and ready to process commands */
44 bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
46 if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
47 env_set("ver", version_string); /* set version variable */
51 if (IS_ENABLED(CONFIG_USE_PREBOOT))
52 run_preboot_environment_command();
54 if (IS_ENABLED(CONFIG_UPDATE_TFTP))
55 update_tftp(0UL, NULL, NULL);
57 if (IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK_EARLY)) {
58 /* efi_init_early() already called */
59 if (efi_init_obj_list() == EFI_SUCCESS)
60 efi_launch_capsules();
63 s = bootdelay_process();
64 if (cli_process_fdt(&s))
65 cli_secure_boot_cmd(s);
70 panic("No CLI available");