public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [RFC PATCH 0/22] RFC: image: Reduce code duplication and refactor
@ 2013-01-10 14:58 Simon Glass
  2013-01-10 14:58 ` [U-Boot] [RFC PATCH 01/22] sandbox: Allow -c argument to provide a command list Simon Glass
                   ` (22 more replies)
  0 siblings, 23 replies; 35+ messages in thread
From: Simon Glass @ 2013-01-10 14:58 UTC (permalink / raw)
  To: u-boot

In creating a new feature[*] I found that the image code includes quite
a bit of duplication in places. In particular the code to load a kernel,
FDT and ramdisk is all fairly similar, but subtly different.

This series introduces a new function fit_image_load() which loads an image
from a FIT and supports the various features. For the bootstage updates,
these are standardised so that each file has its own range and the events
within that range have corresponding numbers. This means that the boot
progress numbers will change slightly with this series.

The image.c file is still very long. Rather than perpetuate the #ifdefs
in the code I have split out the image.c code that is dependent on
CONFIG_OF_LIBFDT into image-fdt.c.

Several architectures have their own way of setting up a ramdisk and FDT
for booting. An attempt is made here to unify these by providing a function
image_setup_linux() to handle the overall task, and image_setup_fdt() to set
up the FDT.

For ARM, the bootm code is a maze of #ifdefs, which means that many boards
compile the code differently and it takes longer to detect breakages. To get
around this, some defines are added to ARM's bootm.h to permit the use of
if() instead of #ifdef, making use of the compiler's dead code elimination.

Also this series introduces a very basic test of image loading using sandbox.
Some patches add bootm support for sandbox, and also a 'sb save' command to
save memory to a host file (used to check that the bootm actually worked).

A test program for sandbox is added as a basic sanity check of image loading
as performed by bootm.

This series depends on the verified boot series since it builds on the
clean-up in that. You can get this series from:

   http://git.denx.de/u-boot-x86.git

branch name 'image'.

* The new feature is support for FIT booting on x86, will get back to this
later.


Simon Glass (22):
  sandbox: Allow -c argument to provide a command list
  sandbox: Support 'source' command
  fs: Add support for saving data to filesystems
  sandbox: fs: Add support for saving files to host filesystem
  image: Split libfdt code into image-fdt.c
  image: Add device tree setup to image library
  arm: Refactor bootm to reduce #ifdefs
  arm: Use image_setup_linux() instead of local code
  powerpc: Use image_setup_linux() instead of local code
  m68k: Use image_setup_linux() instead of local code
  sparc: Use image_setup_linux() instead of local code
  bootstage: Introduce sub-IDs for use with image loading
  mkimage: Add map_sysmem() and IH_ARCH_DEFAULT to simplfy building
  image: Introduce fit_image_load() to load images from FITs
  image: Use fit_image_load() to load ramdisk
  image: Use fit_image_load() to load FDT
  sandbox: Adjust bootm command to work with sandbox
  image: Use fit_image_load() to load kernel
  sandbox: image: Adjust FIT image printing to work with sandbox
  bootstage: Remove unused entries related to kernel/ramdisk/fdt load
  sandbox: image: Create a test for loading FIT images
  WIP: sandbox: config: Remove boot command

 arch/arm/include/asm/bootm.h      |   54 +++-
 arch/arm/include/asm/u-boot-arm.h |    2 -
 arch/arm/lib/Makefile             |    1 +
 arch/arm/lib/bootm-fdt.c          |   52 +++
 arch/arm/lib/bootm.c              |  145 +-------
 arch/m68k/lib/bootm.c             |   15 +-
 arch/powerpc/lib/bootm.c          |   84 +-----
 arch/sandbox/cpu/start.c          |    2 +-
 arch/sparc/lib/bootm.c            |   13 +-
 common/Makefile                   |    1 +
 common/cmd_bootm.c                |  182 ++--------
 common/cmd_sandbox.c              |   18 +-
 common/cmd_source.c               |   11 +-
 common/image-fdt.c                |  512 +++++++++++++++++++++++++
 common/image-fit.c                |  293 +++++++++++-----
 common/image.c                    |  738 ++++---------------------------------
 fs/fs.c                           |   75 ++++
 fs/sandbox/sandboxfs.c            |   33 ++
 include/bootstage.h               |   51 ++--
 include/common.h                  |    9 +
 include/configs/sandbox.h         |    1 -
 include/fdt_support.h             |    2 -
 include/fs.h                      |    2 +
 include/image.h                   |  145 +++++++-
 include/lmb.h                     |    2 -
 include/sandboxfs.h               |    1 +
 test/image/test-fit.py            |  422 +++++++++++++++++++++
 tools/mkimage.h                   |   12 +
 28 files changed, 1674 insertions(+), 1204 deletions(-)
 create mode 100644 arch/arm/lib/bootm-fdt.c
 create mode 100644 common/image-fdt.c
 create mode 100755 test/image/test-fit.py

-- 
1.7.7.3

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

end of thread, other threads:[~2013-03-09 21:43 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-10 14:58 [U-Boot] [RFC PATCH 0/22] RFC: image: Reduce code duplication and refactor Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 01/22] sandbox: Allow -c argument to provide a command list Simon Glass
2013-01-11 11:06   ` Marek Vasut
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 02/22] sandbox: Support 'source' command Simon Glass
2013-01-11 11:07   ` Marek Vasut
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 03/22] fs: Add support for saving data to filesystems Simon Glass
2013-01-11 11:08   ` Marek Vasut
2013-01-11 14:26     ` Simon Glass
2013-01-11 15:20       ` Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 04/22] sandbox: fs: Add support for saving files to host filesystem Simon Glass
2013-01-11 11:09   ` Marek Vasut
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 05/22] image: Split libfdt code into image-fdt.c Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 06/22] image: Add device tree setup to image library Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 07/22] arm: Refactor bootm to reduce #ifdefs Simon Glass
2013-01-11 11:10   ` Marek Vasut
2013-01-11 15:42     ` Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 08/22] arm: Use image_setup_linux() instead of local code Simon Glass
2013-01-11 11:11   ` Marek Vasut
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 09/22] powerpc: " Simon Glass
2013-01-11 11:11   ` Marek Vasut
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 10/22] m68k: " Simon Glass
2013-01-11 11:11   ` Marek Vasut
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 11/22] sparc: " Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 12/22] bootstage: Introduce sub-IDs for use with image loading Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 13/22] mkimage: Add map_sysmem() and IH_ARCH_DEFAULT to simplfy building Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 14/22] image: Introduce fit_image_load() to load images from FITs Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 15/22] image: Use fit_image_load() to load ramdisk Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 16/22] image: Use fit_image_load() to load FDT Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 17/22] sandbox: Adjust bootm command to work with sandbox Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 18/22] image: Use fit_image_load() to load kernel Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 19/22] sandbox: image: Adjust FIT image printing to work with sandbox Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 20/22] bootstage: Remove unused entries related to kernel/ramdisk/fdt load Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 21/22] sandbox: image: Create a test for loading FIT images Simon Glass
2013-01-10 14:58 ` [U-Boot] [RFC PATCH 22/22] WIP: sandbox: config: Remove boot command Simon Glass
2013-03-09 21:43 ` [U-Boot] [RFC PATCH 0/22] RFC: image: Reduce code duplication and refactor Simon Glass

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