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 <s...@chromium.org>
---

 boot/bootm.c    | 13 +++++++++++++
 include/bootm.h | 13 +++++++++++++
 2 files changed, 26 insertions(+)

diff --git a/boot/bootm.c b/boot/bootm.c
index 22c6d1604176..f630b8c1a9c3 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1155,6 +1155,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];
diff --git a/include/bootm.h b/include/bootm.h
index d7c9486553e4..ce5298e4ed97 100644
--- a/include/bootm.h
+++ b/include/bootm.h
@@ -163,6 +163,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);
 
 /*
-- 
2.43.0.rc2.451.g8631bc7472-goog

Reply via email to