1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
12 #include <bootstage.h>
21 #include <version_string.h>
22 #include <efi_loader.h>
24 static void run_preboot_environment_command(void)
28 p = env_get("preboot");
32 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
33 prev = disable_ctrlc(1); /* disable Ctrl-C checking */
35 run_command_list(p, -1, 0);
37 if (IS_ENABLED(CONFIG_AUTOBOOT_KEYED))
38 disable_ctrlc(prev); /* restore Ctrl-C checking */
42 /* We come here after U-Boot is initialised and ready to process commands */
47 bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");
49 if (IS_ENABLED(CONFIG_VERSION_VARIABLE))
50 env_set("ver", version_string); /* set version variable */
54 if (IS_ENABLED(CONFIG_USE_PREBOOT))
55 run_preboot_environment_command();
57 if (IS_ENABLED(CONFIG_UPDATE_TFTP))
58 update_tftp(0UL, NULL, NULL);
60 if (IS_ENABLED(CONFIG_EFI_CAPSULE_ON_DISK_EARLY)) {
61 /* efi_init_early() already called */
62 if (efi_init_obj_list() == EFI_SUCCESS)
63 efi_launch_capsules();
66 process_button_cmds();
68 s = bootdelay_process();
69 if (cli_process_fdt(&s))
70 cli_secure_boot_cmd(s);
74 /* if standard boot if enabled, assume that it will be able to boot */
75 if (IS_ENABLED(CONFIG_BOOTSTD_PROG)) {
78 ret = bootstd_prog_boot();
79 printf("Standard boot failed (err=%dE)\n", ret);
80 panic("Failed to boot");
85 panic("No CLI available");