[U-Boot] [RFC PATCH v2 0/15] bootstage: record and publish boot progress timing

Simon Glass
2011-12-10T21:07:52Z

This series creates a simple boot progress timing feature in U-Boot.

Previous discussion on this is here:

http://lists.denx.de/pipermail/u-boot/2011-May/thread.html#92584

A request was made to unify this with show_boot_progress(). As discussed
in the v1 RFC patch, this series addresses this the following way:

1. Create bootstage.h with the intent of replacing integers with enums. This
will allow the values to be easily changed or rationalised later as required.
It also makes it more explicit that (for example) 15 means we are about to
run an OS.

2. Change show_boot_progress() to use these enums. This first patch just
shows doing this with one (commonly used) integer value.

3. Create bootstage.c file which permits recording of bootstage timestamps.

4. Change the existing show_boot_progress() handlers within board files to
use a provided bootstage progress handler instead. This is easy enough as
there are few users.

5. Change show_boot_progress() to call into bootstage, which in turns calls
the board-provided progress handler, if defined, after recording a timestamp.
The function signature will stay the same for now.

Ultimately I would like boot timing available from before U-Boot to user
space in Linux. See RFC patch for Linux here:

http://lwn.net/Articles/460432/

and discussion here:

http://comments.gmane.org/gmane.linux.kernel/1194861

Still to do: change the microsecond time printout to use the Linux
seconds.microseconds format.

Changes in v2:
- Unify show_boot_progress() into this series

Simon Glass (15):
bootstage: Create an initial header for boot progress integers
bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()
bootstage: Use show_boot_error() for -ve progress numbers
bootstage: Convert progress numbers 1-9 into enums
bootstage: Convert progress numbers 10-19 to enums
bootstage: Convert progress numbers 20-41 to enums
bootstage: Convert IDE progress numbers to enums
bootstage: Convert NAND progress numbers to enums
bootstage: Convert net progress numbers to enums
bootstage: Convert FIT progress numbers to enums
bootstage: Define an optional microsecond timer
bootstage: Replace show_boot_progress/error() with bootstage_...()
bootstage: Add microsecond boot time measurement
bootstage: Plumb in bootstage calls for basic operations
bootstage: arm: Add bootstage calls in board and bootm

README | 25 +++
arch/arm/lib/board.c | 3 +
arch/arm/lib/bootm.c | 6 +-
arch/avr32/lib/bootm.c | 2 +-
arch/m68k/lib/bootm.c | 2 +-
arch/microblaze/lib/bootm.c | 2 +-
arch/mips/lib/bootm.c | 2 +-
arch/mips/lib/bootm_qemu_mips.c | 2 +-
arch/nds32/lib/bootm.c | 2 +-
arch/powerpc/lib/board.c | 2 +-
arch/powerpc/lib/bootm.c | 2 +-
arch/sparc/lib/board.c | 2 +-
arch/x86/lib/board.c | 19 +--
board/Seagate/dockstar/dockstar.c | 4 +-
board/a4m072/a4m072.c | 2 +-
board/bf533-stamp/bf533-stamp.c | 30 ++--
board/hermes/hermes.c | 8 +-
board/ivm/ivm.c | 2 +-
board/matrix_vision/common/mv_common.c | 2 +-
board/matrix_vision/mvbc_p/mvbc_p.c | 8 +-
board/pcs440ep/pcs440ep.c | 50 +++---
board/scb9328/scb9328.c | 6 -
board/sixnet/sixnet.c | 2 +-
board/ti/beagle/beagle.c | 2 +-
common/Makefile | 1 +
common/bootstage.c | 160 ++++++++++++++++++++
common/cmd_bootm.c | 95 ++++++------
common/cmd_ide.c | 46 +++---
common/cmd_nand.c | 34 ++--
common/cmd_net.c | 23 ++-
common/cmd_usb.c | 1 +
common/env_common.c | 2 +-
common/image.c | 56 ++++---
include/bootstage.h | 260 ++++++++++++++++++++++++++++++++
include/common.h | 13 +-
lib/time.c | 17 ++
net/bootp.c | 4 +
net/eth.c | 6 +-
net/net.c | 1 +
post/post.c | 4 +-
40 files changed, 698 insertions(+), 212 deletions(-)
create mode 100644 common/bootstage.c
create mode 100644 include/bootstage.h

--
1.7.3.1