diff options
author | Simon Glass <sjg@chromium.org> | 2023-11-08 19:23:25 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-12-09 11:04:56 -0500 |
commit | 686e00afa1417f84f9df51706ffa28c7682be73a (patch) | |
tree | 8258f5b2253a04b3e8e79fd8088fc6686b8ec27e | |
parent | 3531adfdbb82a2af3890888b0aae1aa64c4f66c2 (diff) | |
download | u-boot-TEST/cmdd-working-rebase.zip u-boot-TEST/cmdd-working-rebase.tar.gz u-boot-TEST/cmdd-working-rebase.tar.bz2 |
bootm: Create a function to run through the booti statesTEST/cmdd-working-rebase
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.
Series-to: u-boot
Series-cc: trini
Cover-letter:
Complete decoupling of bootm logic from commands
This series continues refactoring the bootm code to allow it to be used
with CONFIG_COMMAND disabled. The OS-handling code is refactored and
a new bootm_run() function is created to run through the bootm stages.
This completes the work.
A booti_go() function is created also, in case it proves useful, but at
last for now standard boot does not use this.
This is cmdd (part d of CMDLINE refactoring)
It depends on dm/bootstda-working
which depends on dm/cmdc-working
END
Change-Id: I95fe77f4a7f3d6c3dba3ecb3aec30a48739198f9
Signed-off-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | boot/bootm.c | 13 | ||||
-rw-r--r-- | include/bootm.h | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/boot/bootm.c b/boot/bootm.c index 22c6d16..f630b8c 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 d7c9486..ce5298e 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); /* |