
From: Simon Glass <sjg@chromium.org> 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. Changes in v2: - Drop separate fit_uname variable in select_image() Simon Glass (18): efi: Drop information about removing C flags test: fit: Avoid restarting U-Boot test: Rename test_fit() to test_fit_base() sandbox: Adjust how OS-interface files are built test: Add a check for a missing kernel boot: Split out the first part of fit_image_load() boot: Move call to fit_image_select() and rename it boot: Tidy up setting of the OS arch on host builds boot: Move type and OS checking into a new function boot: Move handling of the load_op into a separate function boot: Move obtaining data from a FIT image into a function boot: Check the image is allowed before setting os.arch boot: Move the architecture check into check_allowed() boot: Move image-decompression into a separate function boot: Move decomp_image() into handle_load_op() boot: Move setting the OS arch into check_allowed() boot: Drop unnecessary data variable boot: Tidy local variables in fit_image_load() arch/sandbox/Makefile | 2 +- arch/sandbox/cpu/Makefile | 23 +-- boot/image-fit.c | 336 ++++++++++++++++++++++++++++---------- include/image.h | 11 +- lib/efi_client/Makefile | 1 - scripts/Makefile.lib | 16 +- test/py/tests/test_fit.py | 48 +++--- 7 files changed, 297 insertions(+), 140 deletions(-) -- 2.43.0 base-commit: d3d71c2fc469909bfa7ad134c88235aa9ad590f3 branch: load2