]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootm: Create a function to run through the booti states
authorSimon Glass <sjg@chromium.org>
Sat, 16 Dec 2023 03:14:25 +0000 (20:14 -0700)
committerTom Rini <trini@konsulko.com>
Thu, 21 Dec 2023 21:07:52 +0000 (16:07 -0500)
In a few places, the booti command is used to handle a boot. We want
these to be done without needing CONFIG_CMDLINE, so add a new
booti_run() function to handle this.

So far this is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
boot/bootm.c
include/bootm.h

index 40751a4c6e6f389012e25afc84d22fa0bb50ab12..53236136f48965de284ebc8581e26883a86151ce 100644 (file)
@@ -1153,6 +1153,19 @@ int bootz_run(struct bootm_info *bmi)
        return bootm_run_states(bmi, states);
 }
 
+int booti_run(struct bootm_info *bmi)
+{
+       int states;
+
+       bmi->cmd_name = "booti";
+       states = BOOTM_STATE_MEASURE | BOOTM_STATE_OS_PREP |
+               BOOTM_STATE_OS_FAKE_GO | BOOTM_STATE_OS_GO;
+       if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH))
+               states |= BOOTM_STATE_RAMDISK;
+
+       return bootm_run_states(bmi, states);
+}
+
 int bootm_boot_start(ulong addr, const char *cmdline)
 {
        char addr_str[30];
index f7d6d27ecb0a2ad075ba02019053c303b26fda54..eba35b33b4e5999e9a543b393e7b32617a326e6c 100644 (file)
@@ -176,6 +176,19 @@ int bootm_run(struct bootm_info *bmi);
  */
 int bootz_run(struct bootm_info *bmi);
 
+/**
+ * booti_run() - Run the entire booti process
+ *
+ * This runs through the booti process from start to finish, using the default
+ * set of states.
+ *
+ * This uses bootm_run_states().
+ *
+ * @bmi: bootm information
+ * Return: 0 if ok, something else on error
+ */
+int booti_run(struct bootm_info *bmi);
+
 void arch_preboot_os(void);
 
 /*