1 // SPDX-License-Identifier: GPL-2.0+
11 #include <bootstage.h>
20 #include <version_string.h>
21 #include <efi_loader.h>
23 static void run_preboot_environment_command(void)
27 p = env_get("preboot");
31 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
32 prev = disable_ctrlc(1); /* disable Ctrl-C checking */
34 run_command_list(p, -1, 0);
36 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
37 disable_ctrlc(prev); /* restore Ctrl-C checking */
41 /* We come here after U-Boot is initialised and ready to process commands */
46 bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
48 if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
49 env_set("ver", version_string); /* set version variable */
53 if (IS_ENABLED(CONFIG_USE_PREBOOT))
54 run_preboot_environment_command();
56 if (IS_ENABLED(CONFIG_UPDATE_TFTP))
57 update_tftp(0UL, NULL, NULL);
59 if (IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK_EARLY)) {
60 /* efi_init_early() already called */
61 if (efi_init_obj_list() == EFI_SUCCESS)
62 efi_launch_capsules();
65 process_button_cmds();
67 s = bootdelay_process();
68 if (cli_process_fdt(&s))
69 cli_secure_boot_cmd(s);
73 /* if standard boot if enabled, assume that it will be able to boot */
74 if (IS_ENABLED(CONFIG_BOOTSTD_PROG)) {
77 ret = bootstd_prog_boot();
78 printf("Standard boot failed (err=%dE)\n", ret);
79 panic("Failed to boot");
84 panic("No CLI available");