summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPhilippe Reynes <[email protected]>2022-03-28 22:57:00 +0200
committerTom Rini <[email protected]>2022-03-31 14:12:01 -0400
commit9d46e63d9771c789c2c934bb6f5f6af042f1bba0 (patch)
tree203636401a0370414a4ec1074ae69cde649b6d63 /cmd
parent982207435a7b96d594336a88c08cb5b09e5f2963 (diff)
cmd: bootm: add a stage pre-load
Add a stage pre-load to the command bootm. Right now, this stage may be used to read a header and check the signature of the full image. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Philippe Reynes <[email protected]>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/Kconfig10
-rw-r--r--cmd/bootm.c5
2 files changed, 13 insertions, 2 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig
index 1d8401236fb..7bd95466131 100644
--- a/cmd/Kconfig
+++ b/cmd/Kconfig
@@ -194,6 +194,16 @@ config CMD_BOOTM
help
Boot an application image from the memory.
+config CMD_BOOTM_PRE_LOAD
+ bool "enable pre-load on bootm"
+ depends on CMD_BOOTM
+ depends on IMAGE_PRE_LOAD
+ default n
+ help
+ Enable support of stage pre-load for the bootm command.
+ This stage allow to check or modify the image provided
+ to the bootm command.
+
config BOOTM_EFI
bool "Support booting UEFI FIT images"
depends on CMD_BOOTEFI && CMD_BOOTM && FIT
diff --git a/cmd/bootm.c b/cmd/bootm.c
index e8b70668882..87d40d494c5 100644
--- a/cmd/bootm.c
+++ b/cmd/bootm.c
@@ -70,7 +70,8 @@ static int do_bootm_subcommand(struct cmd_tbl *cmdtp, int flag, int argc,
if (c) {
state = (long)c->cmd;
if (state == BOOTM_STATE_START)
- state |= BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER;
+ state |= BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOS |
+ BOOTM_STATE_FINDOTHER;
} else {
/* Unrecognized command */
return CMD_RET_USAGE;
@@ -126,7 +127,7 @@ int do_bootm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
}
return do_bootm_states(cmdtp, flag, argc, argv, BOOTM_STATE_START |
- BOOTM_STATE_FINDOS | BOOTM_STATE_FINDOTHER |
+ BOOTM_STATE_FINDOS | BOOTM_STATE_PRE_LOAD | BOOTM_STATE_FINDOTHER |
BOOTM_STATE_LOADOS |
#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
BOOTM_STATE_RAMDISK |