Arrange these so that they look a little nicer.
Series-to: concept
Series-version: 2
Cover-letter:
boot: Make fit_image_load() easier to maintain
Before fit_image_load() was created, The code to load kernels, ramdisks
and devicetrees from a FIT was spread around many functions. By
combining most of the code in one place, it became possible to add more
features in a consistent way. The 'loadables' feature much easier to
plumb in, for example.
While fit_image_load() was a substantial advance, it has never been a
svelte function and the passing years have not been entirely kind. With
a few new features on the horizon, this is a good time to improve the
implementation.
This series splits much of the code from fit_image_load() into a number
of smaller functions. Most of the changes are fairly mechanical, with
just a few renames and tweaks here and there.
This should make the function much easier to maintain. It may also
encourage someone to take a look at its callers, which could also use
some attention.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Decompress is really part of loading, so simplify the code slightly by
moving decompression out of the top-level fit_image_load() function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Move handling of decompression (or perhaps relocation) of the image into
a separate function, to slim down fit_image_load() a little more.
Move the bootstage_mark() call in there too.
Signed-off-by: Simon Glass <sjg@chromium.org>
We may as well have all the checks together, so move the call to
fit_image_check_target_arch() into check_allowed().
Signed-off-by: Simon Glass <sjg@chromium.org>
There is no point in setting the architecture if the image cannot be
used. Move the check a little higher within fit_image_load().
Signed-off-by: Simon Glass <sjg@chromium.org>
Move this code into a separate function, to help further slim down
fit_image_load().
Move the bootstage_mark() call in there too.
Signed-off-by: Simon Glass <sjg@chromium.org>
This field is not present in host builds. Create an inline function to
handle this complexity, so we can drop the #ifdef in the C file.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is named a bit vaguely, since it prints some info and then
does verification of the image.
Rename it to print_and_verify() and move the call to select_image().
Signed-off-by: Simon Glass <sjg@chromium.org>
This function is over 250 lines long. Split out the image-selection part
into its own function.
Series-changes: 2
- Drop separate fit_uname variable in select_image()
Signed-off-by: Simon Glass <sjg@chromium.org>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.