diff options
| author | Simon Glass <sjg@chromium.org> | 2023-11-18 14:05:06 -0700 |
|---|---|---|
| committer | Tom Rini <trini@konsulko.com> | 2023-12-13 11:51:24 -0500 |
| commit | 8eda15bc6a374a963ddf899d99088e40484d5276 (patch) | |
| tree | 5a3abcacd92abc4efdc14232b572276ac26df1ab /boot/bootm.c | |
| parent | 3e3bd5bda7e505dde45585e6c7c1e07cddcb641e (diff) | |
bootm: Reduce arguments to boot_get_ramdisk()
This function normally only uses one argument so pass it in directly.
Move comments to the header file so could one day include these
functions in API docs. Fix up the u8 argument while here, since it
avoids the compiler having to mask the value on some machines.
The Android case here is bit strange, since it can use argv[0], so deal
with that in the caller.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'boot/bootm.c')
| -rw-r--r-- | boot/bootm.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/boot/bootm.c b/boot/bootm.c index 922989b9cfc..d5893e82d12 100644 --- a/boot/bootm.c +++ b/boot/bootm.c @@ -489,10 +489,23 @@ static int bootm_find_os(const char *cmd_name, const char *addr_fit) int bootm_find_images(int flag, int argc, char *const argv[], ulong start, ulong size) { + const char *select = NULL; int ret; + if (IS_ENABLED(CONFIG_ANDROID_BOOT_IMAGE)) { + char *buf; + + /* Look for an Android boot image */ + buf = map_sysmem(images.os.start, 0); + if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) + select = argc ? argv[0] : env_get("loadaddr"); + } + + if (argc >= 2) + select = argv[1]; + /* find ramdisk */ - ret = boot_get_ramdisk(argc, argv, &images, IH_INITRD_ARCH, + ret = boot_get_ramdisk(select, &images, IH_INITRD_ARCH, &images.rd_start, &images.rd_end); if (ret) { puts("Ramdisk image is corrupt or invalid\n"); |
