aboutsummaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-12-15 20:14:21 -0700
committerTom Rini <trini@konsulko.com>2023-12-21 16:07:52 -0500
commite1a24c025c3b065b417bd0dd491cb7000583b334 (patch)
tree19ce5052dff83bd388354b9848ec104cccbda5c2 /boot
parent725ddf1f24f7d08aa344f64d06c62cf5f50a6b6c (diff)
downloadu-boot-e1a24c025c3b065b417bd0dd491cb7000583b334.zip
u-boot-e1a24c025c3b065b417bd0dd491cb7000583b334.tar.gz
u-boot-e1a24c025c3b065b417bd0dd491cb7000583b334.tar.bz2
bootm: Create a function to run through the bootm states
In quite a few places, the bootm command is used to handle a boot. We want these to be done without needing CONFIG_CMDLINE, so add a new bootm_run() function to handle this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'boot')
-rw-r--r--boot/bootm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/boot/bootm.c b/boot/bootm.c
index 66b7e35..cce8485 100644
--- a/boot/bootm.c
+++ b/boot/bootm.c
@@ -1123,6 +1123,23 @@ err:
return ret;
}
+int bootm_run(struct bootm_info *bmi)
+{
+ int states;
+
+ bmi->cmd_name = "bootm";
+ states = BOOTM_STATE_START | BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD |
+ BOOTM_STATE_FINDOTHER | BOOTM_STATE_LOADOS |
+ BOOTM_STATE_OS_PREP | BOOTM_STATE_OS_FAKE_GO |
+ BOOTM_STATE_OS_GO | BOOTM_STATE_MEASURE;
+ if (IS_ENABLED(CONFIG_SYS_BOOT_RAMDISK_HIGH))
+ states |= BOOTM_STATE_RAMDISK;
+ if (IS_ENABLED(CONFIG_PPC) || IS_ENABLED(CONFIG_MIPS))
+ states |= BOOTM_STATE_OS_CMDLINE;
+
+ return bootm_run_states(bmi, states);
+}
+
int bootm_boot_start(ulong addr, const char *cmdline)
{
char addr_str[30];