public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 00/13] boot: Make fit_image_load() easier to maintain
@ 2026-03-25 16:54 Simon Glass
  2026-03-25 16:54 ` [PATCH 01/13] boot: Split out the first part of fit_image_load() Simon Glass
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Simon Glass @ 2026-03-25 16:54 UTC (permalink / raw)
  To: u-boot
  Cc: Simon Glass, James Hilliard, Jonas Karlman, Marek Vasut,
	Mayuresh Chitale, Neil Armstrong, Quentin Schulz, Shiji Yang,
	Tom Rini, Wolfgang Wallner

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 was 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.

Code-size impact: about +8 bytes on aarch64 and +24-40 bytes on arm, due
to the compiler's register allocation across the new helper functions.


Simon Glass (13):
  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()

 boot/image-fit.c | 354 +++++++++++++++++++++++++++++++++++------------
 include/image.h  |  11 +-
 2 files changed, 273 insertions(+), 92 deletions(-)

-- 
2.43.0

base-commit: 1ffc541eafc96d5eebcf837ab892dccec3b93568
branch: loadb-us

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2026-04-16 17:44 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-25 16:54 [PATCH 00/13] boot: Make fit_image_load() easier to maintain Simon Glass
2026-03-25 16:54 ` [PATCH 01/13] boot: Split out the first part of fit_image_load() Simon Glass
2026-04-08 16:25   ` Tom Rini
2026-04-11 13:03     ` Simon Glass
2026-04-13 20:18       ` Tom Rini
2026-04-16 17:43         ` Simon Glass
2026-03-25 16:54 ` [PATCH 02/13] boot: Move call to fit_image_select() and rename it Simon Glass
2026-04-08 16:25   ` Tom Rini
2026-03-25 16:54 ` [PATCH 03/13] boot: Tidy up setting of the OS arch on host builds Simon Glass
2026-04-08 16:25   ` Tom Rini
2026-03-25 16:54 ` [PATCH 04/13] boot: Move type and OS checking into a new function Simon Glass
2026-04-08 16:26   ` Tom Rini
2026-03-25 16:54 ` [PATCH 05/13] boot: Move handling of the load_op into a separate function Simon Glass
2026-04-08 16:26   ` Tom Rini
2026-03-25 16:54 ` [PATCH 06/13] boot: Move obtaining data from a FIT image into a function Simon Glass
2026-03-25 16:54 ` [PATCH 07/13] boot: Check the image is allowed before setting os.arch Simon Glass
2026-03-25 16:54 ` [PATCH 08/13] boot: Move the architecture check into check_allowed() Simon Glass
2026-03-25 16:54 ` [PATCH 09/13] boot: Move image-decompression into a separate function Simon Glass
2026-03-25 16:54 ` [PATCH 10/13] boot: Move decomp_image() into handle_load_op() Simon Glass
2026-03-25 16:54 ` [PATCH 11/13] boot: Move setting the OS arch into check_allowed() Simon Glass
2026-03-25 16:54 ` [PATCH 12/13] boot: Drop unnecessary data variable Simon Glass
2026-03-25 16:54 ` [PATCH 13/13] boot: Tidy local variables in fit_image_load() Simon Glass
2026-04-08 16:26 ` [PATCH 00/13] boot: Make fit_image_load() easier to maintain Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox