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>
This commit is contained in:
Simon Glass
2023-11-18 14:05:06 -07:00
committed by Tom Rini
parent 3e3bd5bda7
commit 8eda15bc6a
3 changed files with 41 additions and 40 deletions

View File

@@ -644,8 +644,31 @@ int genimg_has_config(struct bootm_headers *images);
int boot_get_fpga(int argc, char *const argv[], struct bootm_headers *images,
uint8_t arch, const ulong *ld_start, ulong * const ld_len);
int boot_get_ramdisk(int argc, char *const argv[], struct bootm_headers *images,
uint8_t arch, ulong *rd_start, ulong *rd_end);
/**
* boot_get_ramdisk() - Locate the ramdisk
*
* @select: address or name of ramdisk to use, or NULL for default
* @images: pointer to the bootm images structure
* @arch: expected ramdisk architecture
* @rd_start: pointer to a ulong variable, will hold ramdisk start address
* @rd_end: pointer to a ulong variable, will hold ramdisk end
*
* boot_get_ramdisk() is responsible for finding a valid ramdisk image.
* Currently supported are the following ramdisk sources:
* - multicomponent kernel/ramdisk image,
* - commandline provided address of decicated ramdisk image.
*
* returns:
* 0, if ramdisk image was found and valid, or skiped
* rd_start and rd_end are set to ramdisk start/end addresses if
* ramdisk image is found and valid
*
* 1, if ramdisk image is found but corrupted, or invalid
* rd_start and rd_end are set to 0 if no ramdisk exists
*/
int boot_get_ramdisk(char const *select, struct bootm_headers *images,
uint arch, ulong *rd_start, ulong *rd_end);
/**
* boot_get_loadable - routine to load a list of binaries to memory