bootstage: record and publish boot progress timing
Subsystems (9)
v3 cover bootstage: record and publish boot progress timing
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
Changes in v3:
- Adjust show_boot_progress() comment
- Fix 'progres' typo
- Fix code style in bootstage_mark_name()
- Make main bootstage commit title more explicit
- Move file comment above copyright message
- Rename timer patch to remove bootstage: tag
- Set BOOTSTAGE_ID_START to 0 explicitly
- Update commit message to clarify the purpose of CONFIG_BOOTSTAGE_REPORT
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
timer: add microsecond boot func
bootstage: Replace show_boot_progress/error() with bootstage_...()
bootstage: Implement core 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 | 259 ++++++++++++++++++++++++++++++++ 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, 697 insertions(+), 212 deletions(-) create mode 100644 common/bootstage.c create mode 100644 include/bootstage.h
Signature · 1 line
1.7.7.3
PATCH v3 1/15 bootstage: Create an initial header for boot progress integers
At present boot_stage_progress() is called with various magic numbers. The new bootstage.h header will be used to turn these into symbolic names throughout the code.
The intent is not that these numbers are passed to Linux. In fact by using an enum to track them we should eventually be able to remove the explict numbers and just have the stages count up from 0.
---
Changes in v3:
- Adjust show_boot_progress() comment
- Fix 'progres' typo
- Move file comment above copyright message
include/bootstage.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/common.h | 6 +--- 2 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 include/bootstage.h
include/bootstage.h new file +58 -0
@@ -0,0 +1,58 @@ +/* +* This file implements recording of each stage of the boot process. It is +* intended to implement timing of each stage, reporting this information +* to the user and passing it to the OS for logging / further analysis. +* +* Copyright (c) 2011 The Chromium OS Authors. +* See file CREDITS for list of people who contributed to this +* project. +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#ifndef _BOOTSTAGE_H +#define _BOOTSTAGE_H + +/* +* A list of boot stages that we know about. Each of these indicates the +* state that we are at, and the action that we are about to perform. For +* errors, we issue an error for an item when it fails. Therefore the +* normal sequence is: +* +* progress action1 +* progress action2 +* progress action3 +* +* and an error condition where action 3 failed would be: +* +* progress action1 +* progress action2 +* progress action3 +* error on action3 +*/ +enum bootstage_id { +BOOTSTAGE_ID_RUN_OS =15 ,/* Exiting U-Boot, entering OS */ +}; + +/* +* Board code can implement show_boot_progress() if needed. +* +* @param val Progress state (enum bootstage_id), or -id if an error +* has occurred. +*/ +void show_boot_progress (int val); + +#endif
include/common.h +2 -4
@@ -799,10 +799,8 @@ int pcmcia_init (void);#ifdef CONFIG_STATUS_LED # include <status_led.h> #endif -/* -* Board-specific Platform code can reimplement show_boot_progress () if needed -*/ -void show_boot_progress (int val); + +#include <bootstage.h> /* Multicore arch functions */ #ifdef CONFIG_MP
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 1/15 bootstage: Create an initial header for boot progress integers
Dear Simon Glass,
Quoted 15 lines · In message <[email protected]> you wrote:
At present
boot_stage_progress()is called with various magic numbers. The newbootstage.hheader will be used to turn these into symbolic names throughout the code.The intent is not that these numbers are passed to Linux. In fact by using an enum to track them we should eventually be able to remove the explict numbers and just have the stages count up from 0.
Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- Adjustshow_boot_progress()comment
- Fix 'progres' typo
- Move file comment above copyright message
Quoted 4 lines
include/bootstage.h | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/common.h | 6 +--- 2 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 include/bootstage.h
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
He'd heard her use that sweet, innocent tone of voice before. It
meant that, pretty soon, there was going to be trouble.
- Terry Pratchett, _Truckers_PATCH v3 2/15 bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()
In reply to Simon GlassThis changes the number 15 as used in boot_stage_progress() to use the new name provided for it. This is a separate patch because it touches so many files.
---
arch/arm/lib/bootm.c | 2 +- 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/bootm.c | 2 +- board/Seagate/dockstar/dockstar.c | 2 +- board/a4m072/a4m072.c | 2 +- board/bf533-stamp/bf533-stamp.c | 2 +- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- board/pcs440ep/pcs440ep.c | 3 +-- board/sixnet/sixnet.c | 2 +- board/ti/beagle/beagle.c | 2 +- common/cmd_bootm.c | 8 ++++---- 16 files changed, 19 insertions(+), 20 deletions(-)
arch/arm/lib/bootm.c +1 -1
@@ -113,7 +113,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)printf ("Using machid 0x%x from environment\n" , machid); } -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );#ifdef CONFIG_OF_LIBFDT if (images->ft_len)
arch/avr32/lib/bootm.c +1 -1
@@ -192,7 +192,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima theKernel = (void *)images->ep; -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS ); params = params_start = (struct tag *)gd->bd->bi_boot_params; params =setup_start_tag (params);
arch/m68k/lib/bootm.c +1 -1
@@ -104,7 +104,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *imadebug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong ) kernel); -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );/* * Linux Kernel Parameters (passing board info data):
arch/microblaze/lib/bootm.c +1 -1
@@ -59,7 +59,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *imaif (ret)return 1 ; -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );if (!of_flat_tree && argc >3 ) of_flat_tree = (char *)simple_strtoul (argv[3 ],NULL ,16 );
arch/mips/lib/bootm.c +1 -1
@@ -56,7 +56,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima/* find kernel entry point */ theKernel = (void (*)(int ,char **,char **,int *))images->ep; -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );#ifdef DEBUG printf ("## Transferring control to Linux (at address %08lx) ...\n",
arch/mips/lib/bootm_qemu_mips.c +1 -1
@@ -39,7 +39,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima/* find kernel entry point */ theKernel = (void (*)(int ,char **,char **,int *))images->ep; -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );debug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong ) theKernel);
arch/nds32/lib/bootm.c +1 -1
@@ -69,7 +69,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)printf ("Using machid 0x%x from environment\n" , machid); } -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );debug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong )theKernel);
arch/powerpc/lib/bootm.c +1 -1
@@ -69,7 +69,7 @@ static void boot_jump_linux(bootm_headers_t *images)debug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong )kernel); -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );#if defined(CONFIG_SYS_INIT_RAM_LOCK ) && !defined(CONFIG_E500 )unlock_ram_in_cache ();
board/Seagate/dockstar/dockstar.c +1 -1
@@ -169,7 +169,7 @@ static void set_leds(u32 leds, u32 blinking)void show_boot_progress (int val) {switch (val) { -case 15 :/* booting Linux */ +case BOOTSTAGE_ID_RUN_OS :/* booting Linux */ set_leds (BOTH_LEDS ,NEITHER_LED );break ;case 64 :/* Ethernet initialization */
board/a4m072/a4m072.c +1 -1
@@ -484,7 +484,7 @@ void show_boot_progress(int status) display_out_pos =0 ;/* reset output position */ /* we want to flush status 15 now */ -if (status ==15 ) +if (status ==BOOTSTAGE_ID_RUN_OS ) display_flush(); }#endif
board/bf533-stamp/bf533-stamp.c +1 -1
@@ -117,7 +117,7 @@ void show_boot_progress(int status)case 12 :case 13 :case 14 : -case 15 : +case BOOTSTAGE_ID_RUN_OS :stamp_led_set (STATUS_LED_OFF ,STATUS_LED_OFF ,STATUS_LED_OFF );break ;default :
board/matrix_vision/mvbc_p/mvbc_p.c +1 -1
@@ -250,7 +250,7 @@ void show_boot_progress(int val)case 12 :setbits_be32 (&gpio->simple_dvo,LED_Y );break ; -case 15 : +case BOOTSTAGE_ID_RUN_OS :setbits_be32 (&gpio->simple_dvo,LED_R );break ;default :
board/pcs440ep/pcs440ep.c +1 -2
@@ -110,8 +110,7 @@ void show_boot_progress (int val)status_led_set (1 ,STATUS_LED_ON );status_led_set (2 ,STATUS_LED_ON );break ; -case 15 : -/* booting */ +case BOOTSTAGE_ID_RUN_OS :status_led_set (0 ,STATUS_LED_ON );status_led_set (1 ,STATUS_LED_ON );status_led_set (2 ,STATUS_LED_ON );
board/sixnet/sixnet.c +1 -1
@@ -46,7 +46,7 @@ void show_boot_progress (int status) {#if defined(CONFIG_STATUS_LED )# if defined(STATUS_LED_BOOT ) -if (status ==15 ) { +if (status ==BOOTSTAGE_ID_RUN_OS ) {/* ready to transfer to kernel, make sure LED is proper state */ status_led_set (STATUS_LED_BOOT ,CONFIG_BOOT_LED_STATE ); }
board/ti/beagle/beagle.c +1 -1
@@ -462,7 +462,7 @@ int ehci_hcd_stop(void)/* Call usb_stop() before starting the kernel */ void show_boot_progress (int val) { -if (val ==15 ) +if (val ==BOOTSTAGE_ID_RUN_OS )usb_stop (); }
common/cmd_bootm.c +4 -4
@@ -1340,7 +1340,7 @@ static int do_bootm_netbsd(int flag, int argc, char * const argv[],"(at address %08lx) ...\n" , (ulong)loader); -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );/* * NetBSD Stage-2 Loader Parameters:
@@ -1398,7 +1398,7 @@ static int do_bootm_rtems(int flag, int argc, char * const argv[],printf ("## Transferring control to RTEMS (at address %08lx) ...\n" , (ulong )entry_point); -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );/* * RTEMS Parameters:
@@ -1431,7 +1431,7 @@ static int do_bootm_ose(int flag, int argc, char * const argv[],printf ("## Transferring control to OSE (at address %08lx) ...\n" , (ulong )entry_point); -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );/* * OSE Parameters:
@@ -1512,7 +1512,7 @@ static int do_bootm_integrity(int flag, int argc, char * const argv[],printf ("## Transferring control to INTEGRITY (at address %08lx) ...\n" , (ulong )entry_point); -show_boot_progress (15 ); +show_boot_progress (BOOTSTAGE_ID_RUN_OS );/* * INTEGRITY Parameters:
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 2/15 bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress()
Dear Simon Glass,
Quoted 17 lines · In message <[email protected]> you wrote:
This changes the number 15 as used in
boot_stage_progress()to use the new name provided for it. This is a separate patch because it touches so many files.Signed-off-by Simon Glass <[email protected]>Acked-by Mike Frysinger <[email protected]>---
arch/arm/lib/bootm.c | 2 +- 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/bootm.c | 2 +- board/Seagate/dockstar/dockstar.c | 2 +-
Quoted 8 lines
board/a4m072/a4m072.c | 2 +- board/bf533-stamp/bf533-stamp.c | 2 +- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- board/pcs440ep/pcs440ep.c | 3 +-- board/sixnet/sixnet.c | 2 +- board/ti/beagle/beagle.c | 2 +- common/cmd_bootm.c | 8 ++++---- 16 files changed, 19 insertions(+), 20 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de I don't want to be young again, I just don't want to get any older.
PATCH v3 3/15 bootstage: Use show_boot_error() for -ve progress numbers
In reply to Simon GlassRather than the caller negating our progress numbers to indicate an error has occurred, which seems hacky, add a function to indicate this.
---
arch/powerpc/lib/board.c | 2 +- arch/sparc/lib/board.c | 2 +- common/cmd_bootm.c | 50 +++++++++++++++++++++++----------------------- common/cmd_ide.c | 22 ++++++++++---------- common/cmd_nand.c | 16 +++++++------- common/cmd_net.c | 8 +++--- common/env_common.c | 2 +- common/image.c | 22 ++++++++++---------- include/bootstage.h | 4 +++ net/eth.c | 2 +- post/post.c | 4 +- 11 files changed, 69 insertions(+), 65 deletions(-)
arch/powerpc/lib/board.c +1 -1
@@ -1065,7 +1065,7 @@ void board_init_r(gd_t *id, ulong dest_addr)void hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" ); -show_boot_progress (-30 ); +show_boot_error (30 );for (;;) ; }
arch/sparc/lib/board.c +1 -1
@@ -426,7 +426,7 @@ void hang(void) {puts ("### ERROR ### Please RESET the board ###\n" );#ifdef CONFIG_SHOW_BOOT_PROGRESS -show_boot_progress (-30 ); +show_boot_error (30 );#endif for (;;) ; }
common/cmd_bootm.c +25 -25
200 lines not on this page · raw message
common/cmd_ide.c +11 -11
@@ -360,14 +360,14 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) boot_device = argv[2 ];break ;default : -show_boot_progress (-42 ); +show_boot_error (42 );return cmd_usage (cmdtp); }show_boot_progress (42 );if (!boot_device) {puts ("\n** No boot device **\n" ); -show_boot_progress (-43 ); +show_boot_error (43 );return 1 ; }show_boot_progress (43 );
@@ -376,7 +376,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (ide_dev_desc[dev].type ==DEV_TYPE_UNKNOWN ) {printf ("\n** Device %d not available\n" , dev); -show_boot_progress (-44 ); +show_boot_error (44 );return 1 ; }show_boot_progress (44 );
@@ -384,14 +384,14 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (*ep) {if (*ep !=':' ) {puts ("\n** Invalid boot device, use `dev[:part]' **\n" ); -show_boot_progress (-45 ); +show_boot_error (45 );return 1 ; } part =simple_strtoul (++ep,NULL ,16 ); }show_boot_progress (45 );if (get_partition_info (&ide_dev_desc[dev], part, &info)) { -show_boot_progress (-46 ); +show_boot_error (46 );return 1 ; }show_boot_progress (46 );
@@ -402,7 +402,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])printf ("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n" , info.type); -show_boot_progress (-47 ); +show_boot_error (47 );return 1 ; }show_boot_progress (47 );
@@ -416,7 +416,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (ide_dev_desc[dev].block_read (dev, info.start,1 , (ulong *) addr) !=1 ) {printf ("** Read error on %d:%d\n" , dev, part); -show_boot_progress (-48 ); +show_boot_error (48 );return 1 ; }show_boot_progress (48 );
@@ -429,7 +429,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (!image_check_hcrc (hdr)) {puts ("\n** Bad Header Checksum **\n" ); -show_boot_progress (-50 ); +show_boot_error (50 );return 1 ; }show_boot_progress (50 );
@@ -447,7 +447,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])break ;#endif default : -show_boot_progress (-49 ); +show_boot_error (49 );puts ("** Unknown image type\n" );return 1 ; }
@@ -459,7 +459,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (ide_dev_desc[dev].block_read (dev, info.start +1 , cnt, (ulong *)(addr + info.blksz)) != cnt) {printf ("** Read error on %d:%d\n" , dev, part); -show_boot_progress (-51 ); +show_boot_error (51 );return 1 ; }show_boot_progress (51 );
@@ -468,7 +468,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])/* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *) addr) ==IMAGE_FORMAT_FIT ) {if (!fit_check_format (fit_hdr)) { -show_boot_progress (-140 ); +show_boot_error (140 );puts ("** Bad FIT image format\n" );return 1 ; }
common/cmd_nand.c +8 -8
@@ -787,7 +787,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,if (s !=NULL && (strcmp (s,".jffs2" ) &&strcmp (s,".e" ) &&strcmp (s,".i" ))) {printf ("Unknown nand load suffix '%s'\n" , s); -show_boot_progress (-53 ); +show_boot_error (53 );return 1 ; }
@@ -797,7 +797,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, r =nand_read_skip_bad (nand, offset, &cnt, (u_char *) addr);if (r) {puts ("** Read error\n" ); -show_boot_progress (-56 ); +show_boot_error (56 );return 1 ; }show_boot_progress (56 );
@@ -820,7 +820,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,break ;#endif default : -show_boot_progress (-57 ); +show_boot_error (57 );puts ("** Unknown image type\n" );return 1 ; }
@@ -829,7 +829,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, r =nand_read_skip_bad (nand, offset, &cnt, (u_char *) addr);if (r) {puts ("** Read error\n" ); -show_boot_progress (-58 ); +show_boot_error (58 );return 1 ; }show_boot_progress (58 );
@@ -838,7 +838,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,/* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *)addr) ==IMAGE_FORMAT_FIT ) {if (!fit_check_format (fit_hdr)) { -show_boot_progress (-150 ); +show_boot_error (150 );puts ("** Bad FIT image format\n" );return 1 ; }
@@ -907,14 +907,14 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])#if defined(CONFIG_CMD_MTDPARTS ) usage:#endif -show_boot_progress (-53 ); +show_boot_error (53 );return cmd_usage (cmdtp); }show_boot_progress (53 );if (!boot_device) {puts ("\n** No boot device **\n" ); -show_boot_progress (-54 ); +show_boot_error (54 );return 1 ; }show_boot_progress (54 );
@@ -923,7 +923,7 @@ usage:if (idx <0 || idx >=CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) {printf ("\n** Device %d not available\n" , idx); -show_boot_progress (-55 ); +show_boot_error (55 );return 1 ; }show_boot_progress (55 );
common/cmd_net.c +4 -4
@@ -230,13 +230,13 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,break ;#endif default : -show_boot_progress (-80 ); +show_boot_error (80 );return cmd_usage (cmdtp); }show_boot_progress (80 );if ((size =NetLoop (proto)) <0 ) { -show_boot_progress (-81 ); +show_boot_error (81 );return 1 ; }
@@ -246,7 +246,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,/* done if no file was loaded (no errors though) */ if (size ==0 ) { -show_boot_progress (-82 ); +show_boot_error (82 );return 0 ; }
@@ -257,7 +257,7 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, rcode =bootm_maybe_autostart (cmdtp, argv[0 ]);if (rcode <0 ) -show_boot_progress (-83 ); +show_boot_error (83 );else show_boot_progress (84 );return rcode;
common/env_common.c +1 -1
@@ -228,7 +228,7 @@ void env_relocate(void)#if defined(CONFIG_ENV_IS_NOWHERE )/* Environment not changable */ set_default_env (NULL );#else -show_boot_progress (-60 ); +show_boot_error (60 );set_default_env ("!bad CRC" );#endif }else {
common/image.c +11 -11
@@ -373,13 +373,13 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch,if (!image_check_magic (rd_hdr)) {puts ("Bad Magic Number\n" ); -show_boot_progress (-10 ); +show_boot_error (10 );return NULL ; }if (!image_check_hcrc (rd_hdr)) {puts ("Bad Header Checksum\n" ); -show_boot_progress (-11 ); +show_boot_error (11 );return NULL ; }
@@ -390,7 +390,7 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch,puts (" Verifying Checksum ... " );if (!image_check_dcrc (rd_hdr)) {puts ("Bad Data CRC\n" ); -show_boot_progress (-12 ); +show_boot_error (12 );return NULL ; }puts ("OK\n" );
@@ -403,7 +403,7 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch, !image_check_type(rd_hdr, IH_TYPE_RAMDISK)) {printf ("No Linux %s Ramdisk Image\n" ,genimg_get_arch_name (arch)); -show_boot_progress (-13 ); +show_boot_error (13 );return NULL ; }
@@ -915,7 +915,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,show_boot_progress (120 );if (!fit_check_format (fit_hdr)) {puts ("Bad FIT ramdisk image format!\n" ); -show_boot_progress (-120 ); +show_boot_error (120 );return 1 ; }show_boot_progress (121 );
@@ -932,7 +932,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,if (cfg_noffset <0 ) {puts ("Could not find configuration " "node\n" ); -show_boot_progress (-122 ); +show_boot_error (122 );return 1 ; } fit_uname_config = fdt_get_name(fit_hdr,
@@ -952,7 +952,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, }if (rd_noffset <0 ) {puts ("Could not find subimage node\n" ); -show_boot_progress (-124 ); +show_boot_error (124 );return 1 ; }
@@ -968,7 +968,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,if (fit_image_get_data (fit_hdr, rd_noffset, &data, &size)) {puts ("Could not find ramdisk subimage data!\n" ); -show_boot_progress (-127 ); +show_boot_error (127 );return 1 ; }show_boot_progress (128 );
@@ -979,7 +979,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,if (fit_image_get_load (fit_hdr, rd_noffset, &rd_load)) {puts ("Can't get ramdisk subimage load " "address!\n" ); -show_boot_progress (-129 ); +show_boot_error (129 );return 1 ; }show_boot_progress (129 );
@@ -3171,7 +3171,7 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,puts (" Verifying Hash Integrity ... " );if (!fit_image_check_hashes (fit, rd_noffset)) {puts ("Bad Data Hash\n" ); -show_boot_progress (-125 ); +show_boot_error (125 );return 0 ; }puts ("OK\n" );
@@ -3183,7 +3183,7 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch, !fit_image_check_type(fit, rd_noffset, IH_TYPE_RAMDISK)) {printf ("No Linux %s Ramdisk Image\n" ,genimg_get_arch_name (arch)); -show_boot_progress (-126 ); +show_boot_error (126 );return 0 ; }
include/bootstage.h +4 -0
@@ -54,5 +54,9 @@ enum bootstage_id {* has occurred. */ void show_boot_progress (int val); +static inline void show_boot_error (int val) +{ +show_boot_progress (-val); +}#endif
net/eth.c +1 -1
@@ -260,7 +260,7 @@ int eth_initialize(bd_t *bis)#endif if (!eth_devices) {puts ("No ethernet found.\n" ); -show_boot_progress (-64 ); +show_boot_error (64 ); }else {struct eth_device *dev = eth_devices;char *ethprime =getenv ("ethprime" );
post/post.c +2 -2
@@ -158,7 +158,7 @@ void post_output_backlog(void)post_log ("PASSED\n" ); else {post_log ("FAILED\n" ); -show_boot_progress (-31 ); +show_boot_error (31 ); } } }
@@ -295,7 +295,7 @@ static int post_run_single(struct post_test *test, }else {if ((*test->test)(flags) !=0 ) {post_log ("FAILED\n" ); -show_boot_progress (-32 ); +show_boot_error (32 );show_post_progress (i,POST_AFTER ,POST_FAILED );if (test_flags &POST_CRITICAL ) gd->flags |=GD_FLG_POSTFAIL ;
Signature · 1 line
1.7.7.3
PATCH v3 3/15 bootstage: Use show_boot_error() for -ve progress numbers
Dear Simon Glass,
Quoted 7 lines · In message <[email protected]> you wrote:
Rather than the caller negating our progress numbers to indicate an error has occurred, which seems hacky, add a function to indicate this.
Signed-off-by Simon Glass <[email protected]>Acked-by Mike Frysinger <[email protected]>---
Quoted 12 lines
arch/powerpc/lib/board.c | 2 +- arch/sparc/lib/board.c | 2 +- common/cmd_bootm.c | 50 +++++++++++++++++++++++----------------------- common/cmd_ide.c | 22 ++++++++++---------- common/cmd_nand.c | 16 +++++++------- common/cmd_net.c | 8 +++--- common/env_common.c | 2 +- common/image.c | 22 ++++++++++---------- include/bootstage.h | 4 +++ net/eth.c | 2 +- post/post.c | 4 +- 11 files changed, 69 insertions(+), 65 deletions(-)
Applied (fixing a few merge conflicts), thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The night sky over the planet Krikkit is the least interesting sight
in the entire Universe.
- Douglas Adams _Life, the Universe, and Everything_PATCH v3 4/15 bootstage: Convert progress numbers 1-9 into enums
In reply to Simon Glass---
Changes in v3:
- Set BOOTSTAGE_ID_START to 0 explicitly
board/bf533-stamp/bf533-stamp.c | 18 +++++++------- board/hermes/hermes.c | 2 +- board/ivm/ivm.c | 2 +- board/matrix_vision/common/mv_common.c | 2 +- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- board/pcs440ep/pcs440ep.c | 22 ++++++++-------- common/cmd_bootm.c | 41 +++++++++++++++---------------- common/image.c | 2 +- include/bootstage.h | 14 +++++++++++ 9 files changed, 59 insertions(+), 46 deletions(-)
board/bf533-stamp/bf533-stamp.c +9 -9
@@ -91,27 +91,27 @@ static void stamp_led_set(int LED1, int LED2, int LED3)void show_boot_progress (int status) {switch (status) { -case 1 : +case BOOTSTAGE_ID_CHECK_MAGIC :stamp_led_set (STATUS_LED_OFF ,STATUS_LED_OFF ,STATUS_LED_ON );break ; -case 2 : +case BOOTSTAGE_ID_CHECK_HEADER :stamp_led_set (STATUS_LED_OFF ,STATUS_LED_ON ,STATUS_LED_OFF );break ; -case 3 : +case BOOTSTAGE_ID_CHECK_CHECKSUM :stamp_led_set (STATUS_LED_OFF ,STATUS_LED_ON ,STATUS_LED_ON );break ; -case 4 : +case BOOTSTAGE_ID_CHECK_ARCH :stamp_led_set (STATUS_LED_ON ,STATUS_LED_OFF ,STATUS_LED_OFF );break ; -case 5 : -case 6 : +case BOOTSTAGE_ID_CHECK_IMAGETYPE : +case BOOTSTAGE_ID_DECOMP_IMAGE :stamp_led_set (STATUS_LED_ON ,STATUS_LED_OFF ,STATUS_LED_ON );break ; -case 7 : -case 8 : +case BOOTSTAGE_ID_KERNEL_LOADED : +case BOOTSTAGE_ID_CHECK_BOOT_OS :stamp_led_set (STATUS_LED_ON ,STATUS_LED_ON ,STATUS_LED_OFF );break ; -case 9 : +case BOOTSTAGE_ID_BOOT_OS_RETURNED :case 10 :case 11 :case 12 :
board/hermes/hermes.c +1 -1
@@ -370,7 +370,7 @@ static ulong board_init (void) immr->im_ioport.iop_pcdat |=PC_REP_RES ; } } -SHOW_BOOT_PROGRESS (0x00 ); +SHOW_BOOT_PROGRESS (BOOTSTAGE_ID_CHECK_MAGIC );return ((revision <<16 ) | (speed &0xFFFF )); }
board/ivm/ivm.c +1 -1
@@ -322,7 +322,7 @@ void show_boot_progress (int status) (status < 0) ? STATUS_LED_ON : STATUS_LED_OFF);# endif /* STATUS_LED_YELLOW */ # if defined(STATUS_LED_BOOT ) -if (status ==6 ) +if (status ==BOOTSTAGE_ID_DECOMP_IMAGE )status_led_set (STATUS_LED_BOOT ,STATUS_LED_OFF );# endif /* STATUS_LED_BOOT */ #endif /* CONFIG_STATUS_LED */
board/matrix_vision/common/mv_common.c +1 -1
@@ -95,7 +95,7 @@ int mv_load_fpga(void) result =fpga_load (0 , fpga_data, data_size);if (!result) -show_boot_progress (0 ); +show_boot_progress (BOOTSTAGE_ID_START );return result; }
board/matrix_vision/mvbc_p/mvbc_p.c +1 -1
@@ -241,7 +241,7 @@ void show_boot_progress(int val)struct mpc5xxx_gpio *gpio = (struct mpc5xxx_gpio *)MPC5XXX_GPIO ;switch (val) { -case 0 :/* FPGA ok */ +case BOOTSTAGE_ID_START :/* FPGA ok */ setbits_be32 (&gpio->simple_dvo,LED_G0 );break ;case 65 :
board/pcs440ep/pcs440ep.c +11 -11
@@ -104,17 +104,17 @@ void show_boot_progress (int val)return ; }switch (val) { -case 1 : -/* validating Image */ -status_led_set (0 ,STATUS_LED_OFF ); -status_led_set (1 ,STATUS_LED_ON ); -status_led_set (2 ,STATUS_LED_ON ); -break ; -case BOOTSTAGE_ID_RUN_OS : -status_led_set (0 ,STATUS_LED_ON ); -status_led_set (1 ,STATUS_LED_ON ); -status_led_set (2 ,STATUS_LED_ON ); -break ; +case BOOTSTAGE_ID_CHECK_MAGIC : +/* validating Image */ +status_led_set (0 ,STATUS_LED_OFF ); +status_led_set (1 ,STATUS_LED_ON ); +status_led_set (2 ,STATUS_LED_ON ); +break ; +case BOOTSTAGE_ID_RUN_OS : +status_led_set (0 ,STATUS_LED_ON ); +status_led_set (1 ,STATUS_LED_ON ); +status_led_set (2 ,STATUS_LED_ON ); +break ;#if 0 case 64 :/* starting Ethernet configuration */
common/cmd_bootm.c +20 -21
146 lines not on this page · raw message
common/image.c +1 -1
@@ -895,7 +895,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,printf ("## Loading init Ramdisk from Legacy " "Image at %08lx ...\n" , rd_addr); -show_boot_progress (9 ); +show_boot_progress (BOOTSTAGE_ID_LOAD_RAMDISK ); rd_hdr =image_get_ramdisk (rd_addr, arch, images->verify);
include/bootstage.h +14 -0
@@ -44,6 +44,20 @@* error on action3 */ enum bootstage_id { +BOOTSTAGE_ID_START =0 , +BOOTSTAGE_ID_CHECK_MAGIC ,/* Checking image magic */ +BOOTSTAGE_ID_CHECK_HEADER ,/* Checking image header */ +BOOTSTAGE_ID_CHECK_CHECKSUM ,/* Checking image checksum */ +BOOTSTAGE_ID_CHECK_ARCH ,/* Checking architecture */ + +BOOTSTAGE_ID_CHECK_IMAGETYPE =5 ,/* Checking image type */ +BOOTSTAGE_ID_DECOMP_IMAGE ,/* Decompressing image */ +BOOTSTAGE_ID_KERNEL_LOADED ,/* Kernel has been loaded */ +BOOTSTAGE_ID_DECOMP_UNIMPL =7 ,/* Odd decompression algorithm */ +BOOTSTAGE_ID_CHECK_BOOT_OS ,/* Calling OS-specific boot function */ +BOOTSTAGE_ID_BOOT_OS_RETURNED ,/* Tried to boot OS, but it returned */ +BOOTSTAGE_ID_CHECK_RAMDISK =9 ,/* Checking ram disk */ +BOOTSTAGE_ID_RUN_OS =15 ,/* Exiting U-Boot, entering OS */ };
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 4/15 bootstage: Convert progress numbers 1-9 into enums
Dear Simon Glass,
Quoted 5 lines · In message <[email protected]> you wrote:
Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- SetBOOTSTAGE_ID_STARTto 0 explicitly
Quoted 10 lines
board/bf533-stamp/bf533-stamp.c | 18 +++++++------- board/hermes/hermes.c | 2 +- board/ivm/ivm.c | 2 +- board/matrix_vision/common/mv_common.c | 2 +- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- board/pcs440ep/pcs440ep.c | 22 ++++++++-------- common/cmd_bootm.c | 41 +++++++++++++++---------------- common/image.c | 2 +- include/bootstage.h | 14 +++++++++++ 9 files changed, 59 insertions(+), 46 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The amount of time between slipping on the peel and landing on the pavement is precisely 1 bananosecond.
PATCH v3 5/15 bootstage: Convert progress numbers 10-19 to enums
In reply to Simon Glass---
board/bf533-stamp/bf533-stamp.c | 10 +++++----- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- common/image.c | 20 ++++++++++---------- include/bootstage.h | 7 +++++++ 4 files changed, 23 insertions(+), 16 deletions(-)
board/bf533-stamp/bf533-stamp.c +5 -5
@@ -112,11 +112,11 @@ void show_boot_progress(int status)stamp_led_set (STATUS_LED_ON ,STATUS_LED_ON ,STATUS_LED_OFF );break ;case BOOTSTAGE_ID_BOOT_OS_RETURNED : -case 10 : -case 11 : -case 12 : -case 13 : -case 14 : +case BOOTSTAGE_ID_RD_MAGIC : +case BOOTSTAGE_ID_RD_HDR_CHECKSUM : +case BOOTSTAGE_ID_RD_CHECKSUM : +case BOOTSTAGE_ID_RAMDISK : +case BOOTSTAGE_ID_NO_RAMDISK :case BOOTSTAGE_ID_RUN_OS :stamp_led_set (STATUS_LED_OFF ,STATUS_LED_OFF ,STATUS_LED_OFF );break ;
board/matrix_vision/mvbc_p/mvbc_p.c +1 -1
@@ -247,7 +247,7 @@ void show_boot_progress(int val)case 65 :setbits_be32 (&gpio->simple_dvo,LED_G1 );break ; -case 12 : +case BOOTSTAGE_ID_COPY_RAMDISK :setbits_be32 (&gpio->simple_dvo,LED_Y );break ;case BOOTSTAGE_ID_RUN_OS :
common/image.c +10 -10
@@ -373,37 +373,37 @@ static const image_header_t *image_get_ramdisk(ulong rd_addr, uint8_t arch,if (!image_check_magic (rd_hdr)) {puts ("Bad Magic Number\n" ); -show_boot_error (10 ); +show_boot_error (BOOTSTAGE_ID_RD_MAGIC );return NULL ; }if (!image_check_hcrc (rd_hdr)) {puts ("Bad Header Checksum\n" ); -show_boot_error (11 ); +show_boot_error (BOOTSTAGE_ID_RD_HDR_CHECKSUM );return NULL ; } -show_boot_progress (10 ); +show_boot_progress (BOOTSTAGE_ID_RD_MAGIC );image_print_contents (rd_hdr);if (verify) {puts (" Verifying Checksum ... " );if (!image_check_dcrc (rd_hdr)) {puts ("Bad Data CRC\n" ); -show_boot_error (12 ); +show_boot_error (BOOTSTAGE_ID_RD_CHECKSUM );return NULL ; }puts ("OK\n" ); } -show_boot_progress (11 ); +show_boot_progress (BOOTSTAGE_ID_RD_HDR_CHECKSUM );if (!image_check_os (rd_hdr,IH_OS_LINUX ) || !image_check_arch (rd_hdr, arch) || !image_check_type (rd_hdr,IH_TYPE_RAMDISK )) {printf ("No Linux %s Ramdisk Image\n" ,genimg_get_arch_name (arch)); -show_boot_error (13 ); +show_boot_error (BOOTSTAGE_ID_RAMDISK );return NULL ; }
@@ -895,7 +895,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,printf ("## Loading init Ramdisk from Legacy " "Image at %08lx ...\n" , rd_addr); -show_boot_progress (BOOTSTAGE_ID_LOAD_RAMDISK ); +show_boot_progress (BOOTSTAGE_ID_CHECK_RAMDISK ); rd_hdr =image_get_ramdisk (rd_addr, arch, images->verify);
@@ -1002,7 +1002,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,* Now check if we have a legacy mult-component image, * get second entry data start address and len. */ -show_boot_progress (13 ); +show_boot_progress (BOOTSTAGE_ID_RAMDISK );printf ("## Loading init Ramdisk from multi component " "Legacy Image at %08lx ...\n" , (ulong )images->legacy_hdr_os);
@@ -1012,7 +1012,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,/* * no initrd image */ -show_boot_progress (14 ); +show_boot_progress (BOOTSTAGE_ID_NO_RAMDISK ); rd_len = rd_data =0 ; }
@@ -1096,7 +1096,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,puts ("ramdisk - allocation error\n" ); goto error; } -show_boot_progress (12 ); +show_boot_progress (BOOTSTAGE_ID_COPY_RAMDISK ); *initrd_end = *initrd_start + rd_len; printf(" Loading Ramdisk to %08lx, end %08lx ... ",
include/bootstage.h +7 -0
@@ -58,6 +58,13 @@ enum bootstage_id {BOOTSTAGE_ID_BOOT_OS_RETURNED ,/* Tried to boot OS, but it returned */ BOOTSTAGE_ID_CHECK_RAMDISK =9 ,/* Checking ram disk */ +BOOTSTAGE_ID_RD_MAGIC ,/* Checking ram disk magic */ +BOOTSTAGE_ID_RD_HDR_CHECKSUM ,/* Checking ram disk heder checksum */ +BOOTSTAGE_ID_RD_CHECKSUM ,/* Checking ram disk checksum */ +BOOTSTAGE_ID_COPY_RAMDISK =12 ,/* Copying ram disk into place */ +BOOTSTAGE_ID_RAMDISK ,/* Checking for valid ramdisk */ +BOOTSTAGE_ID_NO_RAMDISK ,/* No ram disk found (not an error) */ + BOOTSTAGE_ID_RUN_OS = 15, /* Exiting U-Boot, entering OS */ };
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 5/15 bootstage: Convert progress numbers 10-19 to enums
Dear Simon Glass,
Quoted 9 lines · In message <[email protected]> you wrote:
Signed-off-by Simon Glass <[email protected]>Acked-by Mike Frysinger <[email protected]>---
board/bf533-stamp/bf533-stamp.c | 10 +++++----- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- common/image.c | 20 ++++++++++---------- include/bootstage.h | 7 +++++++ 4 files changed, 23 insertions(+), 16 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The goal of science is to build better mousetraps. The goal of nature is to build better mice.
PATCH v3 6/15 bootstage: Convert progress numbers 20-41 to enums
In reply to Simon Glass---
arch/powerpc/lib/board.c | 2 +- arch/sparc/lib/board.c | 2 +- arch/x86/lib/board.c | 18 +++++++++--------- board/hermes/hermes.c | 4 +++- board/pcs440ep/pcs440ep.c | 3 ++- include/bootstage.h | 25 +++++++++++++++++++++++++ post/post.c | 4 ++-- 7 files changed, 43 insertions(+), 15 deletions(-)
arch/powerpc/lib/board.c +1 -1
@@ -1065,7 +1065,7 @@ void board_init_r(gd_t *id, ulong dest_addr)void hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" ); -show_boot_error (30 ); +show_boot_error (BOOTSTAGE_ID_NEED_RESET );for (;;) ; }
arch/sparc/lib/board.c +1 -1
@@ -426,7 +426,7 @@ void hang(void) {puts ("### ERROR ### Please RESET the board ###\n" );#ifdef CONFIG_SHOW_BOOT_PROGRESS -show_boot_error (30 ); +show_boot_error (BOOTSTAGE_ID_NEED_RESET );#endif for (;;) ; }
arch/x86/lib/board.c +9 -9
@@ -280,7 +280,7 @@ void board_init_r(gd_t *id, ulong dest_addr)static gd_t gd_data;init_fnc_t **init_fnc_ptr; -show_boot_progress (0x21 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_INIT_R );/* Global data pointer is now writable */ gd = &gd_data;
@@ -291,7 +291,7 @@ void board_init_r(gd_t *id, ulong dest_addr) gd->bd = &bd_data;memset (gd->bd,0 ,sizeof (bd_t)); -show_boot_progress (0x22 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_GLOBAL_DATA ); gd->baudrate =CONFIG_BAUDRATE ;
@@ -302,7 +302,7 @@ void board_init_r(gd_t *id, ulong dest_addr)if ((*init_fnc_ptr)() !=0 )hang (); } -show_boot_progress (0x23 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_INIT_SEQ );#ifdef CONFIG_SERIAL_MULTI serial_initialize ();
@@ -312,14 +312,14 @@ void board_init_r(gd_t *id, ulong dest_addr)/* configure available FLASH banks */ size =flash_init ();display_flash_config (size); -show_boot_progress (0x24 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_FLASH );#endif -show_boot_progress (0x25 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_FLASH_37 );/* initialize environment */ env_relocate (); -show_boot_progress (0x26 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_ENV );#ifdef CONFIG_CMD_NET
@@ -334,7 +334,7 @@ void board_init_r(gd_t *id, ulong dest_addr)pci_init ();#endif -show_boot_progress (0x27 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_PCI );stdio_init ();
@@ -363,7 +363,7 @@ void board_init_r(gd_t *id, ulong dest_addr)/* enable exceptions */ enable_interrupts (); -show_boot_progress (0x28 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_INTERRUPTS );#ifdef CONFIG_STATUS_LED status_led_set (STATUS_LED_BOOT ,STATUS_LED_BLINKING );
@@ -432,7 +432,7 @@ void board_init_r(gd_t *id, ulong dest_addr)post_run (NULL ,POST_RAM |post_bootmode_get (0 ));#endif -show_boot_progress (0x29 ); +show_boot_progress (BOOTSTAGE_ID_BOARD_DONE );/* main_loop() can return to retry autoboot, if so just run it again. */ for (;;)
board/hermes/hermes.c +3 -1
@@ -595,7 +595,9 @@ void show_boot_progress (int status) {volatile immap_t *immr = (immap_t *)CONFIG_SYS_IMMR ; -if (status <-32 ) status =-1 ;/* let things compatible */ +/* let things compatible */ +if (status < -BOOTSTAGE_ID_POST_FAIL_R ) + status =-1 ; status ^=0x0F ; status = (status &0x0F ) <<14 ; immr->im_cpm.cp_pbdat = (immr->im_cpm.cp_pbdat & ~PB_LED_ALL ) | status;
board/pcs440ep/pcs440ep.c +2 -1
@@ -97,7 +97,8 @@ static void status_led_blink (void)void show_boot_progress (int val) {/* find all valid Codes for val in README */ -if (val ==-30 )return ; +if (val == -BOOTSTAGE_ID_NEED_RESET ) +return ;if (val <0 ) {/* smthing goes wrong */ status_led_blink ();
include/bootstage.h +25 -0
@@ -66,6 +66,31 @@ enum bootstage_id {BOOTSTAGE_ID_NO_RAMDISK ,/* No ram disk found (not an error) */ BOOTSTAGE_ID_RUN_OS =15 ,/* Exiting U-Boot, entering OS */ + +BOOTSTAGE_ID_NEED_RESET =30 , +BOOTSTAGE_ID_POST_FAIL ,/* Post failure */ +BOOTSTAGE_ID_POST_FAIL_R ,/* Post failure reported after reloc */ + +/* +* This set is reported ony by x86, and the meaning is different. In +* this case we are reporting completion of a particular stage. +* This should probably change in he x86 code (which doesn't report +* errors in any case), but discussion this can perhaps wait until we +* have a generic board implementation. +*/ +BOOTSTAGE_ID_BOARD_INIT_R ,/* We have relocated */ +BOOTSTAGE_ID_BOARD_GLOBAL_DATA ,/* Global data is set up */ + +BOOTSTAGE_ID_BOARD_INIT_SEQ ,/* We completed the init sequence */ +BOOTSTAGE_ID_BOARD_FLASH ,/* We have configured flash banks */ +BOOTSTAGE_ID_BOARD_FLASH_37 ,/* In case you didn't hear... */ +BOOTSTAGE_ID_BOARD_ENV ,/* Environment is relocated & ready */ +BOOTSTAGE_ID_BOARD_PCI ,/* PCI is up */ + +BOOTSTAGE_ID_BOARD_INTERRUPTS ,/* Exceptions / interrupts ready */ + BOOTSTAGE_ID_BOARD_DONE, /* Board init done, off to main loop */ + /* ^^^ here ends the x86 sequence */ + };/*
post/post.c +2 -2
@@ -158,7 +158,7 @@ void post_output_backlog(void)post_log ("PASSED\n" ); else {post_log ("FAILED\n" ); -show_boot_error (31 ); +show_boot_error (BOOTSTAGE_ID_POST_FAIL_R ); } } }
@@ -295,7 +295,7 @@ static int post_run_single(struct post_test *test, }else {if ((*test->test)(flags) !=0 ) {post_log ("FAILED\n" ); -show_boot_error (32 ); +show_boot_error (BOOTSTAGE_ID_POST_FAIL_R );show_post_progress (i,POST_AFTER ,POST_FAILED );if (test_flags &POST_CRITICAL ) gd->flags |=GD_FLG_POSTFAIL ;
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 6/15 bootstage: Convert progress numbers 20-41 to enums
Dear Simon Glass,
Quoted 11 lines · In message <[email protected]> you wrote:
Signed-off-by Simon Glass <[email protected]>---
arch/powerpc/lib/board.c | 2 +- arch/sparc/lib/board.c | 2 +- arch/x86/lib/board.c | 18 +++++++++--------- board/hermes/hermes.c | 4 +++- board/pcs440ep/pcs440ep.c | 3 ++- include/bootstage.h | 25 +++++++++++++++++++++++++ post/post.c | 4 ++-- 7 files changed, 43 insertions(+), 15 deletions(-)
Applied, thanks.
Note: this patch did not apply at all to arch/x86/lib/board.c ; this is due to commit d47ab0e "x86: Split init functions out of board.c".
Graeme: it seems that with this patch you removed all boot progress support from the x86 code; that's a pity, and it will make unifying the code woth other architectures even more painful.
At the moment there was nothing I could do, so I simply ignored this file.
Best regards,
Wolfgang Denk
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Every revolutionary idea - in science, politics, art, or whatever - evokes three stages of reaction in a hearer: 1. It is completely impossible - don't waste my time. 2. It is possible, but it is not worth doing. 3. I said it was a good idea all along.
PATCH v3 7/15 bootstage: Convert IDE progress numbers to enums
In reply to Simon GlassThis changes over the IDE progress numbers to use enums from bootstage.h.
---
common/cmd_ide.c | 46 +++++++++++++++++++++++----------------------- include/bootstage.h | 14 ++++++++++++++ 2 files changed, 37 insertions(+), 23 deletions(-)
common/cmd_ide.c +23 -23
@@ -345,7 +345,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])const void *fit_hdr =NULL ;#endif -show_boot_progress (41 ); +show_boot_progress (BOOTSTAGE_ID_IDE_START );switch (argc) {case 1 : addr =CONFIG_SYS_LOAD_ADDR ;
@@ -360,41 +360,41 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[]) boot_device = argv[2 ];break ;default : -show_boot_error (42 ); +show_boot_error (BOOTSTAGE_ID_IDE_ADDR );return cmd_usage (cmdtp); } -show_boot_progress (42 ); +show_boot_progress (BOOTSTAGE_ID_IDE_ADDR );if (!boot_device) {puts ("\n** No boot device **\n" ); -show_boot_error (43 ); +show_boot_error (BOOTSTAGE_ID_IDE_BOOT_DEVICE );return 1 ; } -show_boot_progress (43 ); +show_boot_progress (BOOTSTAGE_ID_IDE_BOOT_DEVICE ); dev =simple_strtoul (boot_device, &ep,16 );if (ide_dev_desc[dev].type ==DEV_TYPE_UNKNOWN ) {printf ("\n** Device %d not available\n" , dev); -show_boot_error (44 ); +show_boot_error (BOOTSTAGE_ID_IDE_TYPE );return 1 ; } -show_boot_progress (44 ); +show_boot_progress (BOOTSTAGE_ID_IDE_TYPE );if (*ep) {if (*ep !=':' ) {puts ("\n** Invalid boot device, use `dev[:part]' **\n" ); -show_boot_error (45 ); +show_boot_error (BOOTSTAGE_ID_IDE_PART );return 1 ; } part =simple_strtoul (++ep,NULL ,16 ); } -show_boot_progress (45 ); +show_boot_progress (BOOTSTAGE_ID_IDE_PART );if (get_partition_info (&ide_dev_desc[dev], part, &info)) { -show_boot_error (46 ); +show_boot_error (BOOTSTAGE_ID_IDE_PART_INFO );return 1 ; } -show_boot_progress (46 ); +show_boot_progress (BOOTSTAGE_ID_IDE_PART_INFO );if ((strncmp ((char *)info.type,BOOT_PART_TYPE ,sizeof (info.type)) !=0 ) && (strncmp((char *)info.type, BOOT_PART_COMP, sizeof(info.type)) != 0)
@@ -402,10 +402,10 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])printf ("\n** Invalid partition type \"%.32s\"" " (expect \"" BOOT_PART_TYPE "\")\n" , info.type); -show_boot_error (47 ); +show_boot_error (BOOTSTAGE_ID_IDE_PART_TYPE );return 1 ; } -show_boot_progress (47 ); +show_boot_progress (BOOTSTAGE_ID_IDE_PART_TYPE );printf ("\nLoading from IDE device %d, partition %d: " "Name: %.32s Type: %.32s\n" , dev, part, info.name, info.type);
@@ -416,23 +416,23 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (ide_dev_desc[dev].block_read (dev, info.start,1 , (ulong *) addr) !=1 ) {printf ("** Read error on %d:%d\n" , dev, part); -show_boot_error (48 ); +show_boot_error (BOOTSTAGE_ID_IDE_PART_READ );return 1 ; } -show_boot_progress (48 ); +show_boot_progress (BOOTSTAGE_ID_IDE_PART_READ );switch (genimg_get_format ((void *) addr)) {case IMAGE_FORMAT_LEGACY : hdr = (image_header_t *) addr; -show_boot_progress (49 ); +show_boot_progress (BOOTSTAGE_ID_IDE_FORMAT );if (!image_check_hcrc (hdr)) {puts ("\n** Bad Header Checksum **\n" ); -show_boot_error (50 ); +show_boot_error (BOOTSTAGE_ID_IDE_CHECKSUM );return 1 ; } -show_boot_progress (50 ); +show_boot_progress (BOOTSTAGE_ID_IDE_CHECKSUM );image_print_contents (hdr);
@@ -447,7 +447,7 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])break ;#endif default : -show_boot_error (49 ); +show_boot_error (BOOTSTAGE_ID_IDE_FORMAT );puts ("** Unknown image type\n" );return 1 ; }
@@ -459,20 +459,20 @@ int do_diskboot(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])if (ide_dev_desc[dev].block_read (dev, info.start +1 , cnt, (ulong *)(addr + info.blksz)) != cnt) {printf ("** Read error on %d:%d\n" , dev, part); -show_boot_error (51 ); +show_boot_error (BOOTSTAGE_ID_IDE_READ );return 1 ; } -show_boot_progress (51 ); +show_boot_progress (BOOTSTAGE_ID_IDE_READ );#if defined(CONFIG_FIT )/* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *) addr) ==IMAGE_FORMAT_FIT ) {if (!fit_check_format (fit_hdr)) { -show_boot_error (140 ); +show_boot_error (BOOTSTAGE_ID_IDE_FIT_READ );puts ("** Bad FIT image format\n" );return 1 ; } -show_boot_progress (141 ); +show_boot_progress (BOOTSTAGE_ID_IDE_FIT_READ_OK );fit_print_contents (fit_hdr); }#endif
include/bootstage.h +14 -0
@@ -91,6 +91,20 @@ enum bootstage_id {BOOTSTAGE_ID_BOARD_DONE ,/* Board init done, off to main loop */ /* ^^^ here ends the x86 sequence */ +/* Boot stages related to loading a kernel from an IDE device */ +BOOTSTAGE_ID_IDE_START =41 , +BOOTSTAGE_ID_IDE_ADDR , +BOOTSTAGE_ID_IDE_BOOT_DEVICE , +BOOTSTAGE_ID_IDE_TYPE , + +BOOTSTAGE_ID_IDE_PART , +BOOTSTAGE_ID_IDE_PART_INFO , +BOOTSTAGE_ID_IDE_PART_TYPE , +BOOTSTAGE_ID_IDE_PART_READ , +BOOTSTAGE_ID_IDE_FORMAT , + +BOOTSTAGE_ID_IDE_CHECKSUM ,/* 50 */ + BOOTSTAGE_ID_IDE_READ, };/*
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 7/15 bootstage: Convert IDE progress numbers to enums
Dear Simon Glass,
Quoted 8 lines · In message <[email protected]> you wrote:
This changes over the IDE progress numbers to use enums from
bootstage.h.Signed-off-by Simon Glass <[email protected]>---
common/cmd_ide.c | 46 +++++++++++++++++++++++----------------------- include/bootstage.h | 14 ++++++++++++++ 2 files changed, 37 insertions(+), 23 deletions(-)
Applied, after fixing some more merge conflicts. thanks.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de To know how another being, another creature feels - that is impos- sible. - Terry Pratchett, _The Dark Side of the Sun_
PATCH v3 8/15 bootstage: Convert NAND progress numbers to enums
In reply to Simon GlassThis changes over the NAND progress numbers to use enums from bootstage.h.
---
common/cmd_nand.c | 34 +++++++++++++++++----------------- include/bootstage.h | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 17 deletions(-)
common/cmd_nand.c +17 -17
@@ -787,7 +787,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,if (s !=NULL && (strcmp (s,".jffs2" ) &&strcmp (s,".e" ) &&strcmp (s,".i" ))) {printf ("Unknown nand load suffix '%s'\n" , s); -show_boot_error (53 ); +show_boot_error (BOOTSTAGE_ID_NAND_SUFFIX );return 1 ; }
@@ -797,16 +797,16 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, r =nand_read_skip_bad (nand, offset, &cnt, (u_char *) addr);if (r) {puts ("** Read error\n" ); -show_boot_error (56 ); +show_boot_error (BOOTSTAGE_ID_NAND_HDR_READ );return 1 ; } -show_boot_progress (56 ); +show_boot_progress (BOOTSTAGE_ID_NAND_HDR_READ );switch (genimg_get_format ((void *)addr)) {case IMAGE_FORMAT_LEGACY : hdr = (image_header_t *)addr; -show_boot_progress (57 ); +show_boot_progress (BOOTSTAGE_ID_NAND_TYPE );image_print_contents (hdr); cnt =image_get_image_size (hdr);
@@ -820,29 +820,29 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,break ;#endif default : -show_boot_error (57 ); +show_boot_error (BOOTSTAGE_ID_NAND_TYPE );puts ("** Unknown image type\n" );return 1 ; } -show_boot_progress (57 ); +show_boot_progress (BOOTSTAGE_ID_NAND_TYPE ); r =nand_read_skip_bad (nand, offset, &cnt, (u_char *) addr);if (r) {puts ("** Read error\n" ); -show_boot_error (58 ); +show_boot_error (BOOTSTAGE_ID_NAND_READ );return 1 ; } -show_boot_progress (58 ); +show_boot_progress (BOOTSTAGE_ID_NAND_READ );#if defined(CONFIG_FIT )/* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *)addr) ==IMAGE_FORMAT_FIT ) {if (!fit_check_format (fit_hdr)) { -show_boot_error (150 ); +show_boot_error (BOOTSTAGE_ID_NAND_FIT_READ );puts ("** Bad FIT image format\n" );return 1 ; } -show_boot_progress (151 ); +show_boot_progress (BOOTSTAGE_ID_NAND_FIT_READ_OK );fit_print_contents (fit_hdr); }#endif
@@ -884,7 +884,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) }#endif -show_boot_progress (52 ); +show_boot_progress (BOOTSTAGE_ID_NAND_PART );switch (argc) {case 1 : addr =CONFIG_SYS_LOAD_ADDR ;
@@ -907,26 +907,26 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])#if defined(CONFIG_CMD_MTDPARTS ) usage:#endif -show_boot_error (53 ); +show_boot_error (BOOTSTAGE_ID_NAND_SUFFIX );return cmd_usage (cmdtp); } -show_boot_progress (53 ); +show_boot_progress (BOOTSTAGE_ID_NAND_SUFFIX );if (!boot_device) {puts ("\n** No boot device **\n" ); -show_boot_error (54 ); +show_boot_error (BOOTSTAGE_ID_NAND_BOOT_DEVICE );return 1 ; } -show_boot_progress (54 ); +show_boot_progress (BOOTSTAGE_ID_NAND_BOOT_DEVICE ); idx =simple_strtoul (boot_device,NULL ,16 );if (idx <0 || idx >=CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) {printf ("\n** Device %d not available\n" , idx); -show_boot_error (55 ); +show_boot_error (BOOTSTAGE_ID_NAND_AVAILABLE );return 1 ; } -show_boot_progress (55 ); +show_boot_progress (BOOTSTAGE_ID_NAND_AVAILABLE );return nand_load_image (cmdtp, &nand_info[idx], offset, addr, argv[0 ]); }
include/bootstage.h +15 -0
@@ -105,6 +105,21 @@ enum bootstage_id {BOOTSTAGE_ID_IDE_CHECKSUM ,/* 50 */ BOOTSTAGE_ID_IDE_READ , + +/* Boot stages related to loading a kernel from an NAND device */ +BOOTSTAGE_ID_NAND_PART , +BOOTSTAGE_ID_NAND_SUFFIX , +BOOTSTAGE_ID_NAND_BOOT_DEVICE , +BOOTSTAGE_ID_NAND_HDR_READ =55 , +BOOTSTAGE_ID_NAND_AVAILABLE =55 , +BOOTSTAGE_ID_NAND_TYPE =57 , +BOOTSTAGE_ID_NAND_READ , + +BOOTSTAGE_ID_IDE_FIT_READ =140 , +BOOTSTAGE_ID_IDE_FIT_READ_OK , + +BOOTSTAGE_ID_NAND_FIT_READ =150 , + BOOTSTAGE_ID_NAND_FIT_READ_OK, };/*
Signature · 1 line
1.7.7.3
PATCH v3 8/15 bootstage: Convert NAND progress numbers to enums
Dear Simon Glass,
Quoted 9 lines · In message <[email protected]> you wrote:
This changes over the NAND progress numbers to use enums from
bootstage.h.Signed-off-by Simon Glass <[email protected]>---
common/cmd_nand.c | 34 +++++++++++++++++----------------- include/bootstage.h | 15 +++++++++++++++ 2 files changed, 32 insertions(+), 17 deletions(-)
Applied (with merge conflicts fixed), thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "We don't care. We don't have to. We're the Phone Company."
PATCH v3 9/15 bootstage: Convert net progress numbers to enums
In reply to Simon GlassThis changes over the network-related progress numbers to use enums from bootstage.h.
---
board/Seagate/dockstar/dockstar.c | 2 +- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- board/pcs440ep/pcs440ep.c | 24 ++++++++++++------------ common/cmd_net.c | 16 ++++++++-------- common/env_common.c | 2 +- include/bootstage.h | 11 +++++++++++ net/eth.c | 6 +++--- 7 files changed, 37 insertions(+), 26 deletions(-)
board/Seagate/dockstar/dockstar.c +1 -1
@@ -172,7 +172,7 @@ void show_boot_progress(int val)case BOOTSTAGE_ID_RUN_OS :/* booting Linux */ set_leds (BOTH_LEDS ,NEITHER_LED );break ; -case 64 :/* Ethernet initialization */ +case BOOTSTAGE_ID_NET_ETH_START :/* Ethernet initialization */ set_leds (GREEN_LED ,GREEN_LED );break ;default :
board/matrix_vision/mvbc_p/mvbc_p.c +1 -1
@@ -244,7 +244,7 @@ void show_boot_progress(int val)case BOOTSTAGE_ID_START :/* FPGA ok */ setbits_be32 (&gpio->simple_dvo,LED_G0 );break ; -case 65 : +case BOOTSTAGE_ID_NET_ETH_INIT :setbits_be32 (&gpio->simple_dvo,LED_G1 );break ;case BOOTSTAGE_ID_COPY_RAMDISK :
board/pcs440ep/pcs440ep.c +12 -12
@@ -117,19 +117,19 @@ void show_boot_progress (int val)status_led_set (2 ,STATUS_LED_ON );break ;#if 0 -case 64 : -/* starting Ethernet configuration */ -status_led_set (0 ,STATUS_LED_OFF ); -status_led_set (1 ,STATUS_LED_OFF ); -status_led_set (2 ,STATUS_LED_ON ); -break ; +case BOOTSTAGE_ID_NET_ETH_START : +/* starting Ethernet configuration */ +status_led_set (0 ,STATUS_LED_OFF ); +status_led_set (1 ,STATUS_LED_OFF ); +status_led_set (2 ,STATUS_LED_ON ); +break ;#endif -case 80 : -/* loading Image */ -status_led_set (0 ,STATUS_LED_ON ); -status_led_set (1 ,STATUS_LED_OFF ); -status_led_set (2 ,STATUS_LED_ON ); - break; +case BOOTSTAGE_ID_NET_START : +/* loading Image */ +status_led_set (0 ,STATUS_LED_ON ); +status_led_set (1 ,STATUS_LED_OFF ); +status_led_set (2 ,STATUS_LED_ON ); + break; } }#endif
common/cmd_net.c +8 -8
@@ -230,36 +230,36 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,break ;#endif default : -show_boot_error (80 ); +show_boot_error (BOOTSTAGE_ID_NET_START );return cmd_usage (cmdtp); } -show_boot_progress (80 ); +show_boot_progress (BOOTSTAGE_ID_NET_START );if ((size =NetLoop (proto)) <0 ) { -show_boot_error (81 ); +show_boot_error (BOOTSTAGE_ID_NET_NETLOOP_OK );return 1 ; } -show_boot_progress (81 ); +show_boot_progress (BOOTSTAGE_ID_NET_NETLOOP_OK );/* NetLoop ok, update environment */ netboot_update_env ();/* done if no file was loaded (no errors though) */ if (size ==0 ) { -show_boot_error (82 ); +show_boot_error (BOOTSTAGE_ID_NET_LOADED );return 0 ; }/* flush cache */ flush_cache (load_addr, size); -show_boot_progress (82 ); +show_boot_progress (BOOTSTAGE_ID_NET_LOADED ); rcode =bootm_maybe_autostart (cmdtp, argv[0 ]);if (rcode <0 ) -show_boot_error (83 ); +show_boot_error (BOOTSTAGE_ID_NET_DONE_ERR );else -show_boot_progress (84 ); +show_boot_progress (BOOTSTAGE_ID_NET_DONE );return rcode; }
common/env_common.c +1 -1
@@ -228,7 +228,7 @@ void env_relocate(void)#if defined(CONFIG_ENV_IS_NOWHERE )/* Environment not changable */ set_default_env (NULL );#else -show_boot_error (60 ); +show_boot_error (BOOTSTAGE_ID_NET_CHECKSUM );set_default_env ("!bad CRC" );#endif }else {
include/bootstage.h +11 -0
@@ -115,6 +115,17 @@ enum bootstage_id {BOOTSTAGE_ID_NAND_TYPE =57 ,BOOTSTAGE_ID_NAND_READ , +/* Boot stages related to loading a kernel from an network device */ +BOOTSTAGE_ID_NET_CHECKSUM =60 , +BOOTSTAGE_ID_NET_ETH_START =64 , +BOOTSTAGE_ID_NET_ETH_INIT , + +BOOTSTAGE_ID_NET_START =80 , +BOOTSTAGE_ID_NET_NETLOOP_OK , +BOOTSTAGE_ID_NET_LOADED , +BOOTSTAGE_ID_NET_DONE_ERR , +BOOTSTAGE_ID_NET_DONE , +BOOTSTAGE_ID_IDE_FIT_READ =140 , BOOTSTAGE_ID_IDE_FIT_READ_OK,
net/eth.c +3 -3
@@ -230,7 +230,7 @@ int eth_initialize(bd_t *bis) eth_devices =NULL ; eth_current =NULL ; -show_boot_progress (64 ); +show_boot_progress (BOOTSTAGE_ID_NET_ETH_START );#if defined(CONFIG_MII ) || defined(CONFIG_CMD_MII )miiphy_init ();#endif
@@ -260,12 +260,12 @@ int eth_initialize(bd_t *bis)#endif if (!eth_devices) {puts ("No ethernet found.\n" ); -show_boot_error (64 ); +show_boot_error (BOOTSTAGE_ID_NET_ETH_START ); }else {struct eth_device *dev = eth_devices;char *ethprime =getenv ("ethprime" ); -show_boot_progress (65 ); +show_boot_progress (BOOTSTAGE_ID_NET_ETH_INIT ); do { if (dev->index) puts (", ");
Signature · 1 line
1.7.7.3
PATCH v3 9/15 bootstage: Convert net progress numbers to enums
Dear Simon Glass,
Quoted 6 lines · In message <[email protected]> you wrote:
This changes over the network-related progress numbers to use enums from
bootstage.h.Signed-off-by Simon Glass <[email protected]>---
Quoted 8 lines
board/Seagate/dockstar/dockstar.c | 2 +- board/matrix_vision/mvbc_p/mvbc_p.c | 2 +- board/pcs440ep/pcs440ep.c | 24 ++++++++++++------------ common/cmd_net.c | 16 ++++++++-------- common/env_common.c | 2 +- include/bootstage.h | 11 +++++++++++ net/eth.c | 6 +++--- 7 files changed, 37 insertions(+), 26 deletions(-)
Applied (with fixes), thanks.
Best regards,
Wolfgang Denk
Signature · 9 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I've been programming for (35-9=) 24 years myself, and I find the
best way to learn a new language is to *read* every example snippet I
can find, with a reference book close by. Eventually, the *rhythm* of
the language starts pounding in my head... and my fluency is close at
hand. That's how I learned Perl, and now I'm one of the drummers. :-)
-- Randal L. Schwartz in <[email protected]>PATCH v3 10/15 bootstage: Convert FIT progress numbers to enums
In reply to Simon GlassThis changes over all the FIT image progress numbers to use enums from bootstage.h.
---
common/cmd_bootm.c | 44 ++++++++++++++++++++++---------------------- common/image.c | 36 ++++++++++++++++++++---------------- include/bootstage.h | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 38 deletions(-)
common/cmd_bootm.c +22 -22
@@ -222,21 +222,21 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]if (fit_image_get_type (images.fit_hdr_os, images.fit_noffset_os, &images.os.type)) {puts ("Can't get image type!\n" ); -show_boot_error (109 ); +show_boot_error (BOOTSTAGE_ID_FIT_TYPE );return 1 ; }if (fit_image_get_comp (images.fit_hdr_os, images.fit_noffset_os, &images.os.comp)) {puts ("Can't get image compression!\n" ); -show_boot_error (110 ); +show_boot_error (BOOTSTAGE_ID_FIT_COMPRESSION );return 1 ; }if (fit_image_get_os (images.fit_hdr_os, images.fit_noffset_os, &images.os.os)) {puts ("Can't get image OS!\n" ); -show_boot_error (111 ); +show_boot_error (BOOTSTAGE_ID_FIT_OS );return 1 ; }
@@ -245,7 +245,7 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]if (fit_image_get_load (images.fit_hdr_os, images.fit_noffset_os, &images.os.load)) {puts ("Can't get image load address!\n" ); -show_boot_error (112 ); +show_boot_error (BOOTSTAGE_ID_FIT_LOADADDR );return 1 ; }break ;
@@ -648,7 +648,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) }else {puts ("ERROR: new format image overwritten - " "must RESET the board to recover\n" ); -show_boot_error (113 ); +show_boot_error (BOOTSTAGE_ID_OVERWRITTEN );do_reset (cmdtp, flag, argc, argv); } }
@@ -789,28 +789,28 @@ static int fit_check_kernel(const void *fit, int os_noffset, int verify)puts (" Verifying Hash Integrity ... " );if (!fit_image_check_hashes (fit, os_noffset)) {puts ("Bad Data Hash\n" ); -show_boot_error (104 ); +show_boot_error (BOOTSTAGE_ID_FIT_CHECK_HASH );return 0 ; } puts("OK\n"); } -show_boot_progress (105 ); +show_boot_progress (BOOTSTAGE_ID_FIT_CHECK_ARCH );if (!fit_image_check_target_arch (fit, os_noffset)) {puts ("Unsupported Architecture\n" ); -show_boot_error (105 ); +show_boot_error (BOOTSTAGE_ID_FIT_CHECK_ARCH );return 0 ; } -show_boot_progress (106 ); +show_boot_progress (BOOTSTAGE_ID_FIT_CHECK_KERNEL );if (!fit_image_check_type (fit, os_noffset,IH_TYPE_KERNEL ) && !fit_image_check_type (fit, os_noffset,IH_TYPE_KERNEL_NOLOAD )) {puts ("Not a kernel image\n" ); -show_boot_error (106 ); +show_boot_error (BOOTSTAGE_ID_FIT_CHECK_KERNEL );return 0 ; } -show_boot_progress (107 ); +show_boot_progress (BOOTSTAGE_ID_FIT_CHECKED );return 1 ; }#endif /* CONFIG_FIT */
@@ -921,10 +921,10 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,if (!fit_check_format (fit_hdr)) {puts ("Bad FIT kernel image format!\n" ); -show_boot_error (100 ); +show_boot_error (BOOTSTAGE_ID_FIT_FORMAT );return NULL ; } -show_boot_progress (100 ); +show_boot_progress (BOOTSTAGE_ID_FIT_FORMAT );if (!fit_uname_kernel) {/*
@@ -933,11 +933,11 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,* fit_conf_get_node() will try to find default config * node */ -show_boot_progress (101 ); +show_boot_progress (BOOTSTAGE_ID_FIT_NO_UNIT_NAME ); cfg_noffset =fit_conf_get_node (fit_hdr, fit_uname_config);if (cfg_noffset <0 ) { -show_boot_error (101 ); +show_boot_error (BOOTSTAGE_ID_FIT_NO_UNIT_NAME );return NULL ; }/* save configuration uname provided in the first
@@ -948,7 +948,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, NULL);printf (" Using '%s' configuration\n" , images->fit_uname_cfg); -show_boot_progress (103 ); +show_boot_progress (BOOTSTAGE_ID_FIT_CONFIG ); os_noffset =fit_conf_get_kernel_node (fit_hdr, cfg_noffset);
@@ -956,28 +956,28 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc, NULL); }else {/* get kernel component image node offset */ -show_boot_progress (102 ); +show_boot_progress (BOOTSTAGE_ID_FIT_UNIT_NAME ); os_noffset =fit_image_get_node (fit_hdr, fit_uname_kernel); }if (os_noffset <0 ) { -show_boot_error (103 ); +show_boot_error (BOOTSTAGE_ID_FIT_CONFIG );return NULL ; }printf (" Trying '%s' kernel subimage\n" , fit_uname_kernel); -show_boot_progress (104 ); +show_boot_progress (BOOTSTAGE_ID_FIT_CHECK_SUBIMAGE );if (!fit_check_kernel (fit_hdr, os_noffset, images->verify))return NULL ;/* get kernel image data address and length */ if (fit_image_get_data (fit_hdr, os_noffset, &data, &len)) {puts ("Could not find kernel subimage data!\n" ); -show_boot_error (107 ); +show_boot_error (BOOTSTAGE_ID_FIT_KERNEL_INFO_ERR );return NULL ; } -show_boot_progress (108 ); +show_boot_progress (BOOTSTAGE_ID_FIT_KERNEL_INFO ); *os_len = len; *os_data = (ulong )data;
@@ -988,7 +988,7 @@ static void *boot_get_kernel(cmd_tbl_t *cmdtp, int flag, int argc,#endif default :printf ("Wrong Image Format for %s command\n" , cmdtp->name); -show_boot_error (108 ); +show_boot_error (BOOTSTAGE_ID_FIT_KERNEL_INFO );return NULL ; }
common/image.c +20 -16
@@ -912,13 +912,14 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,printf ("## Loading init Ramdisk from FIT " "Image at %08lx ...\n" , rd_addr); -show_boot_progress (120 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_FORMAT );if (!fit_check_format (fit_hdr)) {puts ("Bad FIT ramdisk image format!\n" ); -show_boot_error (120 ); +show_boot_error ( +BOOTSTAGE_ID_FIT_RD_FORMAT );return 1 ; } -show_boot_progress (121 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_FORMAT_OK );if (!fit_uname_ramdisk) {/*
@@ -926,13 +927,15 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,* node first. If config unit node name is NULL * fit_conf_get_node() will try to find default config node */ -show_boot_progress (122 ); +show_boot_progress ( +BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME ); cfg_noffset =fit_conf_get_node (fit_hdr, fit_uname_config);if (cfg_noffset <0 ) {puts ("Could not find configuration " "node\n" ); -show_boot_error (122 ); +show_boot_error ( +BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME );return 1 ; } fit_uname_config = fdt_get_name(fit_hdr,
@@ -946,20 +949,21 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, rd_noffset, NULL); }else {/* get ramdisk component image node offset */ -show_boot_progress (123 ); +show_boot_progress ( +BOOTSTAGE_ID_FIT_RD_UNIT_NAME ); rd_noffset =fit_image_get_node (fit_hdr, fit_uname_ramdisk); }if (rd_noffset <0 ) {puts ("Could not find subimage node\n" ); -show_boot_error (124 ); +show_boot_error (BOOTSTAGE_ID_FIT_RD_SUBNODE );return 1 ; }printf (" Trying '%s' ramdisk subimage\n" , fit_uname_ramdisk); -show_boot_progress (125 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_CHECK );if (!fit_check_ramdisk (fit_hdr, rd_noffset, arch, images->verify))return 1 ;
@@ -968,10 +972,10 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,if (fit_image_get_data (fit_hdr, rd_noffset, &data, &size)) {puts ("Could not find ramdisk subimage data!\n" ); -show_boot_error (127 ); +show_boot_error (BOOTSTAGE_ID_FIT_RD_GET_DATA );return 1 ; } -show_boot_progress (128 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_GET_DATA_OK ); rd_data = (ulong )data; rd_len = size;
@@ -979,10 +983,10 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images,if (fit_image_get_load (fit_hdr, rd_noffset, &rd_load)) {puts ("Can't get ramdisk subimage load " "address!\n" ); -show_boot_error (129 ); +show_boot_error (BOOTSTAGE_ID_FIT_RD_LOAD );return 1 ; } -show_boot_progress (129 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_LOAD ); images->fit_hdr_rd = fit_hdr; images->fit_uname_rd = fit_uname_ramdisk;
@@ -3171,23 +3175,23 @@ static int fit_check_ramdisk(const void *fit, int rd_noffset, uint8_t arch,puts (" Verifying Hash Integrity ... " );if (!fit_image_check_hashes (fit, rd_noffset)) {puts ("Bad Data Hash\n" ); -show_boot_error (125 ); +show_boot_error (BOOTSTAGE_ID_FIT_RD_HASH );return 0 ; } puts("OK\n"); } -show_boot_progress (126 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_CHECK_ALL );if (!fit_image_check_os (fit, rd_noffset,IH_OS_LINUX ) || !fit_image_check_arch (fit, rd_noffset, arch) || !fit_image_check_type (fit, rd_noffset,IH_TYPE_RAMDISK )) {printf ("No Linux %s Ramdisk Image\n" ,genimg_get_arch_name (arch)); -show_boot_error (126 ); +show_boot_error (BOOTSTAGE_ID_FIT_RD_CHECK_ALL );return 0 ; } -show_boot_progress (127 ); +show_boot_progress (BOOTSTAGE_ID_FIT_RD_CHECK_ALL_OK );return 1 ; }#endif /* USE_HOSTCC */
include/bootstage.h +38 -0
@@ -126,6 +126,44 @@ enum bootstage_id {BOOTSTAGE_ID_NET_DONE_ERR ,BOOTSTAGE_ID_NET_DONE , +/* +* Boot stages related to loading a FIT image. Some of these are a +* bit wonky. +*/ +BOOTSTAGE_ID_FIT_FORMAT =100 , +BOOTSTAGE_ID_FIT_NO_UNIT_NAME , +BOOTSTAGE_ID_FIT_UNIT_NAME , +BOOTSTAGE_ID_FIT_CONFIG , +BOOTSTAGE_ID_FIT_CHECK_SUBIMAGE , +BOOTSTAGE_ID_FIT_CHECK_HASH =104 , + +BOOTSTAGE_ID_FIT_CHECK_ARCH , +BOOTSTAGE_ID_FIT_CHECK_KERNEL , +BOOTSTAGE_ID_FIT_CHECKED , + +BOOTSTAGE_ID_FIT_KERNEL_INFO_ERR =107 , +BOOTSTAGE_ID_FIT_KERNEL_INFO , +BOOTSTAGE_ID_FIT_TYPE , + +BOOTSTAGE_ID_FIT_COMPRESSION , +BOOTSTAGE_ID_FIT_OS , +BOOTSTAGE_ID_FIT_LOADADDR , +BOOTSTAGE_ID_OVERWRITTEN , + +BOOTSTAGE_ID_FIT_RD_FORMAT =120 , +BOOTSTAGE_ID_FIT_RD_FORMAT_OK , +BOOTSTAGE_ID_FIT_RD_NO_UNIT_NAME , +BOOTSTAGE_ID_FIT_RD_UNIT_NAME , +BOOTSTAGE_ID_FIT_RD_SUBNODE , + +BOOTSTAGE_ID_FIT_RD_CHECK , +BOOTSTAGE_ID_FIT_RD_HASH =125 , +BOOTSTAGE_ID_FIT_RD_CHECK_ALL , +BOOTSTAGE_ID_FIT_RD_GET_DATA , +BOOTSTAGE_ID_FIT_RD_CHECK_ALL_OK =127 , +BOOTSTAGE_ID_FIT_RD_GET_DATA_OK , +BOOTSTAGE_ID_FIT_RD_LOAD , +BOOTSTAGE_ID_IDE_FIT_READ =140 , BOOTSTAGE_ID_IDE_FIT_READ_OK,
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 10/15 bootstage: Convert FIT progress numbers to enums
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This changes over all the FIT image progress numbers to use enums from
bootstage.h.Signed-off-by Simon Glass <[email protected]>---
common/cmd_bootm.c | 44 ++++++++++++++++++++++---------------------- common/image.c | 36 ++++++++++++++++++++---------------- include/bootstage.h | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 38 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.
PATCH v3 11/15 timer: add microsecond boot func
In reply to Simon GlassDefine timer_get_boot_us() which returns the number of microseconds since boot. If undefined then we use get_timer() * 1000.
We can fit this in a 32-bit register which keeps everyone happy on the efficiency side. It will wrap around after about an hour. If we are still looking at it after an hour then we had better not be timing the boot.
There is some scope to join bootstage and post, but for now they are separate things with separate CONFIGs, and you don't have to enable one to get the other.
---
Changes in v3:
- Rename timer patch to remove bootstage: tag
include/common.h | 7 +++++++ lib/time.c | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-)
include/common.h +7 -0
@@ -207,6 +207,13 @@ typedef void (interrupt_handler_t)(void *);#endif /* CONFIG_SERIAL_MULTI */ /* +* Return the time since boot in microseconds, This is needed for bootstage +* and should be defined in CPU- or board-specific code. If undefined then +* millisecond resolution will be used (the standard get_timer()). +*/ +ulong timer_get_boot_us (void ); + +/* * General Purpose Utilities */ #define min (X ,Y ) \
lib/time.c +17 -0
@@ -47,3 +47,20 @@ void mdelay(unsigned long msec)while (msec--)udelay (1000 ); } + +ulong __timer_get_boot_us (void ) +{ +static ulong base_time; + +/* +* We can't implement this properly. Return 0 on the first call and +* larger values after that. +*/ +if (base_time) +return get_timer (base_time) *1000 ; + base_time =get_timer (0 ); +return 0 ; +} + +ulong timer_get_boot_us (void ) + __attribute__((weak,alias ("__timer_get_boot_us" )));
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 11/15 timer: add microsecond boot func
Dear Simon Glass,
Quoted 12 lines · In message <[email protected]> you wrote:
Define
timer_get_boot_us()which returns the number of microseconds since boot. If undefined then we useget_timer()* 1000.We can fit this in a 32-bit register which keeps everyone happy on the efficiency side. It will wrap around after about an hour. If we are still looking at it after an hour then we had better not be timing the boot.
There is some scope to join bootstage and post, but for now they are separate things with separate CONFIGs, and you don't have to enable one to get the other.
Quoted 8 lines
Signed-off-by Simon Glass <[email protected]>---
Changes in v3:
- Rename timer patch to remove bootstage: taginclude/common.h | 7 +++++++ lib/time.c | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 0 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de On my planet, to rest is to rest -- to cease using energy. To me, it is quite illogical to run up and down on green grass, using energy, instead of saving it. -- Spock, "Shore Leave", stardate 3025.2
PATCH v3 12/15 bootstage: Replace show_boot_progress/error() with bootstage_...()
In reply to Simon GlassThese calls should not be made directly any more, since bootstage will call the show_boot_...() functions as needed.
---
arch/arm/lib/bootm.c | 2 +- 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/hermes/hermes.c | 2 +- board/matrix_vision/common/mv_common.c | 2 +- board/scb9328/scb9328.c | 6 -- common/cmd_bootm.c | 92 ++++++++++++++++---------------- common/cmd_ide.c | 46 ++++++++-------- common/cmd_nand.c | 34 ++++++------ common/cmd_net.c | 16 +++--- common/env_common.c | 2 +- common/image.c | 52 +++++++++--------- net/eth.c | 6 +- post/post.c | 4 +- 22 files changed, 147 insertions(+), 154 deletions(-)
arch/arm/lib/bootm.c +1 -1
@@ -113,7 +113,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)printf ("Using machid 0x%x from environment\n" , machid); } -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );#ifdef CONFIG_OF_LIBFDT if (images->ft_len)
arch/avr32/lib/bootm.c +1 -1
@@ -192,7 +192,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima theKernel = (void *)images->ep; -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS ); params = params_start = (struct tag *)gd->bd->bi_boot_params; params =setup_start_tag (params);
arch/m68k/lib/bootm.c +1 -1
@@ -104,7 +104,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *imadebug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong ) kernel); -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );/* * Linux Kernel Parameters (passing board info data):
arch/microblaze/lib/bootm.c +1 -1
@@ -59,7 +59,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *imaif (ret)return 1 ; -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );if (!of_flat_tree && argc >3 ) of_flat_tree = (char *)simple_strtoul (argv[3 ],NULL ,16 );
arch/mips/lib/bootm.c +1 -1
@@ -56,7 +56,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima/* find kernel entry point */ theKernel = (void (*)(int ,char **,char **,int *))images->ep; -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );#ifdef DEBUG printf ("## Transferring control to Linux (at address %08lx) ...\n",
arch/mips/lib/bootm_qemu_mips.c +1 -1
@@ -39,7 +39,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima/* find kernel entry point */ theKernel = (void (*)(int ,char **,char **,int *))images->ep; -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );debug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong ) theKernel);
arch/nds32/lib/bootm.c +1 -1
@@ -69,7 +69,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)printf ("Using machid 0x%x from environment\n" , machid); } -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );debug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong )theKernel);
arch/powerpc/lib/board.c +1 -1
@@ -1065,7 +1065,7 @@ void board_init_r(gd_t *id, ulong dest_addr)void hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" ); -show_boot_error (BOOTSTAGE_ID_NEED_RESET ); +bootstage_error (BOOTSTAGE_ID_NEED_RESET );for (;;) ; }
arch/powerpc/lib/bootm.c +1 -1
@@ -69,7 +69,7 @@ static void boot_jump_linux(bootm_headers_t *images)debug ("## Transferring control to Linux (at address %08lx) ...\n" , (ulong )kernel); -show_boot_progress (BOOTSTAGE_ID_RUN_OS ); +bootstage_mark (BOOTSTAGE_ID_RUN_OS );#if defined(CONFIG_SYS_INIT_RAM_LOCK ) && !defined(CONFIG_E500 )unlock_ram_in_cache ();
arch/sparc/lib/board.c +1 -1
@@ -426,7 +426,7 @@ void hang(void) {puts ("### ERROR ### Please RESET the board ###\n" );#ifdef CONFIG_SHOW_BOOT_PROGRESS -show_boot_error (BOOTSTAGE_ID_NEED_RESET ); +bootstage_error (BOOTSTAGE_ID_NEED_RESET );#endif for (;;) ; }
arch/x86/lib/board.c +9 -10
@@ -280,7 +280,7 @@ void board_init_r(gd_t *id, ulong dest_addr)static gd_t gd_data;init_fnc_t **init_fnc_ptr; -show_boot_progress (BOOTSTAGE_ID_BOARD_INIT_R ); +bootstage_mark (BOOTSTAGE_ID_BOARD_INIT_R );/* Global data pointer is now writable */ gd = &gd_data;
@@ -291,7 +291,7 @@ void board_init_r(gd_t *id, ulong dest_addr) gd->bd = &bd_data;memset (gd->bd,0 ,sizeof (bd_t)); -show_boot_progress (BOOTSTAGE_ID_BOARD_GLOBAL_DATA ); +bootstage_mark (BOOTSTAGE_ID_BOARD_GLOBAL_DATA ); gd->baudrate =CONFIG_BAUDRATE ;
@@ -302,7 +302,7 @@ void board_init_r(gd_t *id, ulong dest_addr)if ((*init_fnc_ptr)() !=0 )hang (); } -show_boot_progress (BOOTSTAGE_ID_BOARD_INIT_SEQ ); +bootstage_mark (BOOTSTAGE_ID_BOARD_INIT_SEQ );#ifdef CONFIG_SERIAL_MULTI serial_initialize ();
@@ -312,15 +312,14 @@ void board_init_r(gd_t *id, ulong dest_addr)/* configure available FLASH banks */ size =flash_init ();display_flash_config (size); -show_boot_progress (BOOTSTAGE_ID_BOARD_FLASH ); +bootstage_mark (BOOTSTAGE_ID_BOARD_FLASH );#endif -show_boot_progress (BOOTSTAGE_ID_BOARD_FLASH_37 ); +bootstage_mark (BOOTSTAGE_ID_BOARD_FLASH_37 );/* initialize environment */ env_relocate (); -show_boot_progress (BOOTSTAGE_ID_BOARD_ENV ); - +bootstage_mark (BOOTSTAGE_ID_BOARD_ENV );#ifdef CONFIG_CMD_NET /* IP Address */
@@ -334,7 +333,7 @@ void board_init_r(gd_t *id, ulong dest_addr)pci_init ();#endif -show_boot_progress (BOOTSTAGE_ID_BOARD_PCI ); +bootstage_mark (BOOTSTAGE_ID_BOARD_PCI );stdio_init ();
@@ -363,7 +362,7 @@ void board_init_r(gd_t *id, ulong dest_addr)/* enable exceptions */ enable_interrupts (); -show_boot_progress (BOOTSTAGE_ID_BOARD_INTERRUPTS ); +bootstage_mark (BOOTSTAGE_ID_BOARD_INTERRUPTS );#ifdef CONFIG_STATUS_LED status_led_set (STATUS_LED_BOOT ,STATUS_LED_BLINKING );
@@ -432,7 +431,7 @@ void board_init_r(gd_t *id, ulong dest_addr)post_run (NULL ,POST_RAM |post_bootmode_get (0 ));#endif -show_boot_progress (BOOTSTAGE_ID_BOARD_DONE ); +bootstage_mark (BOOTSTAGE_ID_BOARD_DONE );/* main_loop() can return to retry autoboot, if so just run it again. */ for (;;)
board/hermes/hermes.c +1 -1
@@ -27,7 +27,7 @@#ifdef CONFIG_SHOW_BOOT_PROGRESS # include <status_led.h> -# define SHOW_BOOT_PROGRESS (arg) show_boot_progress(arg) +# define SHOW_BOOT_PROGRESS (arg) bootstage_mark(arg)#else # define SHOW_BOOT_PROGRESS (arg)#endif
board/matrix_vision/common/mv_common.c +1 -1
@@ -95,7 +95,7 @@ int mv_load_fpga(void) result =fpga_load (0 , fpga_data, data_size);if (!result) -show_boot_progress (BOOTSTAGE_ID_START ); +bootstage_mark (BOOTSTAGE_ID_START );return result; }
board/scb9328/scb9328.c +0 -6
@@ -23,12 +23,6 @@DECLARE_GLOBAL_DATA_PTR ; -#ifdef CONFIG_SHOW_BOOT_PROGRESS -# define SHOW_BOOT_PROGRESS (arg) show_boot_progress(arg) -#else -# define SHOW_BOOT_PROGRESS (arg) -#endif -int board_init (void ) { gd->bd->bi_arch_number =MACH_TYPE_SCB9328 ;
common/cmd_bootm.c +46 -46
325 lines not on this page · raw message
common/cmd_ide.c +23 -23
131 lines not on this page · raw message
common/cmd_nand.c +17 -17
@@ -787,7 +787,7 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,if (s !=NULL && (strcmp (s,".jffs2" ) &&strcmp (s,".e" ) &&strcmp (s,".i" ))) {printf ("Unknown nand load suffix '%s'\n" , s); -show_boot_error (BOOTSTAGE_ID_NAND_SUFFIX ); +bootstage_error (BOOTSTAGE_ID_NAND_SUFFIX );return 1 ; }
@@ -797,16 +797,16 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand, r =nand_read_skip_bad (nand, offset, &cnt, (u_char *) addr);if (r) {puts ("** Read error\n" ); -show_boot_error (BOOTSTAGE_ID_NAND_HDR_READ ); +bootstage_error (BOOTSTAGE_ID_NAND_HDR_READ );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NAND_HDR_READ ); +bootstage_mark (BOOTSTAGE_ID_NAND_HDR_READ );switch (genimg_get_format ((void *)addr)) {case IMAGE_FORMAT_LEGACY : hdr = (image_header_t *)addr; -show_boot_progress (BOOTSTAGE_ID_NAND_TYPE ); +bootstage_mark (BOOTSTAGE_ID_NAND_TYPE );image_print_contents (hdr); cnt =image_get_image_size (hdr);
@@ -820,29 +820,29 @@ static int nand_load_image(cmd_tbl_t *cmdtp, nand_info_t *nand,break ;#endif default : -show_boot_error (BOOTSTAGE_ID_NAND_TYPE ); +bootstage_error (BOOTSTAGE_ID_NAND_TYPE );puts ("** Unknown image type\n" );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NAND_TYPE ); +bootstage_mark (BOOTSTAGE_ID_NAND_TYPE ); r =nand_read_skip_bad (nand, offset, &cnt, (u_char *) addr);if (r) {puts ("** Read error\n" ); -show_boot_error (BOOTSTAGE_ID_NAND_READ ); +bootstage_error (BOOTSTAGE_ID_NAND_READ );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NAND_READ ); +bootstage_mark (BOOTSTAGE_ID_NAND_READ );#if defined(CONFIG_FIT )/* This cannot be done earlier, we need complete FIT image in RAM first */ if (genimg_get_format ((void *)addr) ==IMAGE_FORMAT_FIT ) {if (!fit_check_format (fit_hdr)) { -show_boot_error (BOOTSTAGE_ID_NAND_FIT_READ ); +bootstage_error (BOOTSTAGE_ID_NAND_FIT_READ );puts ("** Bad FIT image format\n" );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NAND_FIT_READ_OK ); +bootstage_mark (BOOTSTAGE_ID_NAND_FIT_READ_OK );fit_print_contents (fit_hdr); }#endif
@@ -884,7 +884,7 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) }#endif -show_boot_progress (BOOTSTAGE_ID_NAND_PART ); +bootstage_mark (BOOTSTAGE_ID_NAND_PART );switch (argc) {case 1 : addr =CONFIG_SYS_LOAD_ADDR ;
@@ -907,26 +907,26 @@ int do_nandboot(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])#if defined(CONFIG_CMD_MTDPARTS ) usage:#endif -show_boot_error (BOOTSTAGE_ID_NAND_SUFFIX ); +bootstage_error (BOOTSTAGE_ID_NAND_SUFFIX );return cmd_usage (cmdtp); } -show_boot_progress (BOOTSTAGE_ID_NAND_SUFFIX ); +bootstage_mark (BOOTSTAGE_ID_NAND_SUFFIX );if (!boot_device) {puts ("\n** No boot device **\n" ); -show_boot_error (BOOTSTAGE_ID_NAND_BOOT_DEVICE ); +bootstage_error (BOOTSTAGE_ID_NAND_BOOT_DEVICE );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NAND_BOOT_DEVICE ); +bootstage_mark (BOOTSTAGE_ID_NAND_BOOT_DEVICE ); idx =simple_strtoul (boot_device,NULL ,16 );if (idx <0 || idx >=CONFIG_SYS_MAX_NAND_DEVICE || !nand_info[idx].name) {printf ("\n** Device %d not available\n" , idx); -show_boot_error (BOOTSTAGE_ID_NAND_AVAILABLE ); +bootstage_error (BOOTSTAGE_ID_NAND_AVAILABLE );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NAND_AVAILABLE ); +bootstage_mark (BOOTSTAGE_ID_NAND_AVAILABLE );return nand_load_image (cmdtp, &nand_info[idx], offset, addr, argv[0 ]); }
common/cmd_net.c +8 -8
@@ -230,36 +230,36 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,break ;#endif default : -show_boot_error (BOOTSTAGE_ID_NET_START ); +bootstage_error (BOOTSTAGE_ID_NET_START );return cmd_usage (cmdtp); } -show_boot_progress (BOOTSTAGE_ID_NET_START ); +bootstage_mark (BOOTSTAGE_ID_NET_START );if ((size =NetLoop (proto)) <0 ) { -show_boot_error (BOOTSTAGE_ID_NET_NETLOOP_OK ); +bootstage_error (BOOTSTAGE_ID_NET_NETLOOP_OK );return 1 ; } -show_boot_progress (BOOTSTAGE_ID_NET_NETLOOP_OK ); +bootstage_mark (BOOTSTAGE_ID_NET_NETLOOP_OK );/* NetLoop ok, update environment */ netboot_update_env ();/* done if no file was loaded (no errors though) */ if (size ==0 ) { -show_boot_error (BOOTSTAGE_ID_NET_LOADED ); +bootstage_error (BOOTSTAGE_ID_NET_LOADED );return 0 ; }/* flush cache */ flush_cache (load_addr, size); -show_boot_progress (BOOTSTAGE_ID_NET_LOADED ); +bootstage_mark (BOOTSTAGE_ID_NET_LOADED ); rcode =bootm_maybe_autostart (cmdtp, argv[0 ]);if (rcode <0 ) -show_boot_error (BOOTSTAGE_ID_NET_DONE_ERR ); +bootstage_error (BOOTSTAGE_ID_NET_DONE_ERR );else -show_boot_progress (BOOTSTAGE_ID_NET_DONE ); +bootstage_mark (BOOTSTAGE_ID_NET_DONE );return rcode; }
common/env_common.c +1 -1
@@ -228,7 +228,7 @@ void env_relocate(void)#if defined(CONFIG_ENV_IS_NOWHERE )/* Environment not changable */ set_default_env (NULL );#else -show_boot_error (BOOTSTAGE_ID_NET_CHECKSUM ); +bootstage_error (BOOTSTAGE_ID_NET_CHECKSUM );set_default_env ("!bad CRC" );#endif }else {
common/image.c +26 -26
183 lines not on this page · raw message
net/eth.c +3 -3
@@ -230,7 +230,7 @@ int eth_initialize(bd_t *bis) eth_devices =NULL ; eth_current =NULL ; -show_boot_progress (BOOTSTAGE_ID_NET_ETH_START ); +bootstage_mark (BOOTSTAGE_ID_NET_ETH_START );#if defined(CONFIG_MII ) || defined(CONFIG_CMD_MII )miiphy_init ();#endif
@@ -260,12 +260,12 @@ int eth_initialize(bd_t *bis)#endif if (!eth_devices) {puts ("No ethernet found.\n" ); -show_boot_error (BOOTSTAGE_ID_NET_ETH_START ); +bootstage_error (BOOTSTAGE_ID_NET_ETH_START ); }else {struct eth_device *dev = eth_devices;char *ethprime =getenv ("ethprime" ); -show_boot_progress (BOOTSTAGE_ID_NET_ETH_INIT ); +bootstage_mark (BOOTSTAGE_ID_NET_ETH_INIT ); do { if (dev->index) puts (", ");
post/post.c +2 -2
@@ -158,7 +158,7 @@ void post_output_backlog(void)post_log ("PASSED\n" ); else {post_log ("FAILED\n" ); -show_boot_error (BOOTSTAGE_ID_POST_FAIL_R ); +bootstage_error (BOOTSTAGE_ID_POST_FAIL_R ); } } }
@@ -295,7 +295,7 @@ static int post_run_single(struct post_test *test, }else {if ((*test->test)(flags) !=0 ) {post_log ("FAILED\n" ); -show_boot_error (BOOTSTAGE_ID_POST_FAIL_R ); +bootstage_error (BOOTSTAGE_ID_POST_FAIL_R );show_post_progress (i,POST_AFTER ,POST_FAILED );if (test_flags &POST_CRITICAL ) gd->flags |=GD_FLG_POSTFAIL ;
Signature · 1 line
1.7.7.3
PATCH v3 13/15 bootstage: Implement core microsecond boot time measurement
In reply to Simon GlassThis defines the basics of a new boot time measurement feature. This allows logging of very accurate time measurements as the boot proceeds, by using an available microsecond counter.
To enable the feature, define CONFIG_BOOTSTAGE in your board config file. Also available is CONFIG_BOOTSTAGE_REPORT which will cause a report to be printed just before handing off to the OS.
Most IDs are not named at this stage. For that I would first like to renumber them all.
Timer summary in microseconds:
Mark Elapsed Stage
0 0 reset
205,000 205,000 board_init_f
6,053,000 5,848,000 bootm_start
6,053,000 0 id=1
6,058,000 5,000 id=101
6,058,000 0 id=100
6,061,000 3,000 id=103
6,064,000 3,000 id=104
6,093,000 29,000 id=107
6,093,000 0 id=106
6,093,000 0 id=105
6,093,000 0 id=108
7,089,000 996,000 id=7
7,089,000 0 id=15
7,089,000 0 id=8
7,097,000 8,000 start_kernel---
Changes in v3:
- Fix code style in bootstage_mark_name()
- Make main bootstage commit title more explicit
README | 25 ++++++++ common/Makefile | 1 + common/bootstage.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++ include/bootstage.h | 77 ++++++++++++++++++++++++- 4 files changed, 261 insertions(+), 2 deletions(-) create mode 100644 common/bootstage.c
README +25 -0
@@ -2235,6 +2235,31 @@ The following options need to be configured: example, some LED's) on your board. At the moment, the following checkpoints are implemented: +- Detailed boot stage timing + CONFIG_BOOTSTAGE + Define this option to get detailed timing of each stage + of the boot process. + + CONFIG_BOOTSTAGE_USER_COUNT + This is the number of available user bootstage records. + Each time you call bootstage_mark(BOOTSTAGE_ID_ALLOC, ...) + a new ID will be allocated from this stash. If you exceed + the limit, recording will stop. + + CONFIG_BOOTSTAGE_REPORT + Define this to print a report before boot, similar to this: + + Timer summary in microseconds: + Mark Elapsed Stage + 0 0 reset + 3,575,678 3,575,678 board_init_f start + 3,575,695 17 arch_cpu_init A9 + 3,575,777 82 arch_cpu_init done + 3,659,598 83,821 board_init_r start + 3,910,375 250,777 main_loop + 29,916,167 26,005,792 bootm_start + 30,361,327 445,160 start_kernel + Legacy uImage format: Arg Where When
common/Makefile +1 -0
@@ -172,6 +172,7 @@ SPD := y endif COBJS-$(SPD) += ddr_spd.o COBJS-$(CONFIG_HWCONFIG) += hwconfig.o +COBJS-$(CONFIG_BOOTSTAGE) += bootstage.o COBJS-$(CONFIG_CONSOLE_MUX) += iomux.o COBJS-y += flash.o COBJS-$(CONFIG_CMD_KGDB) += kgdb.o kgdb_stubs.o
common/bootstage.c new file +160 -0
160 lines not on this page · raw message
include/bootstage.h +75 -2
98 lines not on this page · raw message
Signature · 1 line
1.7.7.3
PATCH v3 13/15 bootstage: Implement core microsecond boot time measurement
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This defines the basics of a new boot time measurement feature. This allows logging of very accurate time measurements as the boot proceeds, by using an available microsecond counter.
To enable the feature, define
CONFIG_BOOTSTAGEin your board config file. Also available isCONFIG_BOOTSTAGE_REPORTwhich will cause a report to be printed just before handing off to the OS.Most IDs are not named at this stage. For that I would first like to renumber them all.
Hm.... I'm not sure what happened.
I am positively sure (and I just checked again in the bash history) that I did apply the correct version of "[PATCH v3 11/15] timer: add microsecond boot func".
However, the repository appears to have an old version instead:
f933e84 2012-03-18 21:43:17 +0100 bootstage: arm: Add bootstage calls in board and bootm 573f14f 2012-03-18 21:42:56 +0100 bootstage: Plumb in bootstage calls for basic operations 3a608ca 2012-03-18 21:42:14 +0100 bootstage: Implement core microsecond boot time measurement 770605e 2012-03-18 21:41:39 +0100 bootstage: Replace show_boot_progress/error() with bootstage_...() ==> 5ff5539 2012-03-18 21:33:53 +0100 bootstage: Define an optional microsecond timer aacc8c1 2012-03-18 21:33:32 +0100 bootstage: Convert FIT progress numbers to enums c8e66db 2012-03-18 21:33:05 +0100 bootstage: Convert net progress numbers to enums cd24a6b 2012-03-18 21:27:20 +0100 bootstage: Convert NAND progress numbers to enums 90e153d 2012-03-18 21:24:21 +0100 bootstage: Convert IDE progress numbers to enums 8ade950 2012-03-18 21:16:22 +0100 bootstage: Convert progress numbers 20-41 to enums 5e41088 2012-03-18 20:59:53 +0100 bootstage: Convert progress numbers 10-19 to enums 5dc8871 2012-03-18 20:57:37 +0100 bootstage: Convert progress numbers 1-9 into enums 5ddb118 2012-03-18 20:56:00 +0100 bootstage: Use show_boot_error() for -ve progress numbers 578ac1e 2012-03-18 20:45:57 +0100 bootstage: Make use of BOOTSTAGE_ID_RUN_OS in show_boot_progress() 097e178 2012-03-18 20:43:38 +0100 bootstage: Create an initial header for boot progress integers
I cannot reproduce it, but it seems patchworked palyed some trick on me (it has also beenx extremely slow last night - eventually some works was going on there?).
Anyway. Fact is, the current mainline code contains a broken patch, which breaks for example the PMC440 board:
Configuring for PMC440 board... /work/wd/tmp-ppc/examples/api/time.o: In function `__timer_get_boot_us':/home/wd/git/u-boot/work/lib/time.c:60: undefined reference to get_timer' /home/wd/git/u-boot/work/lib/time.c:61: undefined reference to get_timer' make[1]: *** [/work/wd/tmp-ppc/examples/api/demo] Error 1
Can you please have a look and provide an incremental patch to bring mainline back in sync with your current code base?
Thanks.
Best regards,
Wolfgang Denk
Signature · 11 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Each team building another component has been using the most recent
tested version of the integrated system as a test bed for debugging
its piece. Their work will be set back by having that test bed change
under them. Of course it must. But the changes need to be quantized.
Then each user has periods of productive stability, interrupted by
bursts of test-bed change. This seems to be much less disruptive than
a constant rippling and trembling.
- Frederick Brooks Jr., "The Mythical Man Month"PATCH v3 13/15 bootstage: Implement core microsecond boot time measurement
Hi Wolfgang,
Quoted 47 lines · Wolfgang Denk
Dear Simon Glass,
Quoted 10 lines · In message <[email protected]> you wrote:
This defines the basics of a new boot time measurement feature. This allows logging of very accurate time measurements as the boot proceeds, by using an available microsecond counter.
To enable the feature, define
CONFIG_BOOTSTAGEin your board config file. Also available isCONFIG_BOOTSTAGE_REPORTwhich will cause a report to be printed just before handing off to the OS.Most IDs are not named at this stage. For that I would first like to renumber them all.
Hm.... I'm not sure what happened.
I am positively sure (and I just checked again in the bash history) that I did apply the correct version of "[PATCH v3 11/15] timer: add microsecond boot func".
However, the repository appears to have an old version instead:
? ? ? ?f933e84 ? 2012-03-18 21:43:17 +0100 ? bootstage: arm: Add bootstage calls in board and bootm ? ? ? ?573f14f ? 2012-03-18 21:42:56 +0100 ? bootstage: Plumb in bootstage calls for basic operations ? ? ? ?3a608ca ? 2012-03-18 21:42:14 +0100 ? bootstage: Implement core microsecond boot time measurement ? ? ? ?770605e ? 2012-03-18 21:41:39 +0100 ? bootstage: Replace show_boot_progress/error() with bootstage_...() ==> ? ? 5ff5539 ? 2012-03-18 21:33:53 +0100 ? bootstage: Define an optional microsecond timer ? ? ? ?aacc8c1 ? 2012-03-18 21:33:32 +0100 ? bootstage: Convert FIT progress numbers to enums ? ? ? ?c8e66db ? 2012-03-18 21:33:05 +0100 ? bootstage: Convert net progress numbers to enums ? ? ? ?cd24a6b ? 2012-03-18 21:27:20 +0100 ? bootstage: Convert NAND progress numbers to enums ? ? ? ?90e153d ? 2012-03-18 21:24:21 +0100 ? bootstage: Convert IDE progress numbers to enums ? ? ? ?8ade950 ? 2012-03-18 21:16:22 +0100 ? bootstage: Convert progress numbers 20-41 to enums ? ? ? ?5e41088 ? 2012-03-18 20:59:53 +0100 ? bootstage: Convert progress numbers 10-19 to enums ? ? ? ?5dc8871 ? 2012-03-18 20:57:37 +0100 ? bootstage: Convert progress numbers 1-9 into enums ? ? ? ?5ddb118 ? 2012-03-18 20:56:00 +0100 ? bootstage: Use
show_boot_error()for -ve progress numbers ? ? ? ?578ac1e ? 2012-03-18 20:45:57 +0100 ? bootstage: Make use ofBOOTSTAGE_ID_RUN_OSinshow_boot_progress()? ? ? ?097e178 ? 2012-03-18 20:43:38 +0100 ? bootstage: Create an initial header for boot progress integersI cannot reproduce it, but it seems patchworked palyed some trick on me (it has also beenx extremely slow last night - eventually some works was going on there?).
Anyway. Fact is, the current mainline code contains a broken patch, which breaks for example the PMC440 board:
Quoted 8 lines
Configuring for PMC440 board... /work/wd/tmp-ppc/examples/api/time.o: In function `__timer_get_boot_us':
/home/wd/git/u-boot/work/lib/time.c:60: undefined reference toget_timer' /home/wd/git/u-boot/work/lib/time.c:61: undefined reference toget_timer' make[1]: *** [/work/wd/tmp-ppc/examples/api/demo] Error 1Can you please have a look and provide an incremental patch to bring mainline back in sync with your current code base?
Yes I will send one though. But this is my mistake, not yours. I did not get around to sending an updated patch - I was in fact going to ask about the best solution for it, as I was thinking of moving the timer function into bootstage.c.
Anyway I will send a patch as is, but if you would rather the function move so we can remove the #ifdef let me know.
Regards,
Simon
Quoted 19 lines
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Each team building another component has been using the ?most ?recent tested ?version ?of the integrated system as a test bed for debugging its piece. Their work will be set back by having that test bed change under them. Of course it must. But the changes need to be ?quantized. Then ?each ?user ?has periods of productive stability, interrupted by bursts of test-bed change. This seems to be much less disruptive than a constant rippling and trembling.
? ? ? ? ? ? ? ? ? ? - Frederick Brooks Jr., "The Mythical Man Month"
PATCH v3 14/15 bootstage: Plumb in bootstage calls for basic operations
In reply to Simon GlassThis inserts bootstage calls into tftp, usb start and bootm. We could go further, but this is a reasonable start to illustrate the concept.
---
common/cmd_bootm.c | 2 ++ common/cmd_net.c | 7 ++++++- common/cmd_usb.c | 1 + net/bootp.c | 4 ++++ net/net.c | 1 + 5 files changed, 14 insertions(+), 1 deletions(-)
common/cmd_bootm.c +2 -0
@@ -199,6 +199,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]bootm_start_lmb (); +bootstage_mark_name (BOOTSTAGE_ID_BOOTM_START ,"bootm_start" ); +/* get kernel image header, start address and length */ os_hdr =boot_get_kernel (cmdtp, flag, argc, argv, &images, &images.os.image_start, &images.os.image_len);
common/cmd_net.c +6 -1
@@ -43,7 +43,12 @@ U_BOOT_CMD(int do_tftpb (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) { -return netboot_common (TFTPGET , cmdtp, argc, argv); +int ret; + +bootstage_mark_name (BOOTSTAGE_KERNELREAD_START ,"tftp_start" ); + ret =netboot_common (TFTPGET , cmdtp, argc, argv); +bootstage_mark_name (BOOTSTAGE_KERNELREAD_STOP ,"tftp_done" ); +return ret; } U_BOOT_CMD(
common/cmd_usb.c +1 -0
@@ -513,6 +513,7 @@ int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])if ((strncmp (argv[1 ],"reset" ,5 ) ==0 ) || (strncmp (argv[1 ],"start" ,5 ) ==0 )) { +bootstage_mark_name (BOOTSTAGE_ID_USB_START ,"usb_start" );usb_stop ();printf ("(Re)start USB...\n" ); i =usb_init ();
net/bootp.c +4 -0
@@ -322,6 +322,7 @@ BootpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,BootpVendorProcess ((uchar *)&bp->bp_vend[4 ], len);NetSetTimeout (0 , (thand_f *)0 ); +bootstage_mark_name (BOOTSTAGE_ID_BOOTP_STOP ,"bootp_stop" );debug ("Got good BOOTP\n" );
@@ -589,6 +590,7 @@ BootpRequest (void)Bootp_t *bp;int ext_len, pktlen, iplen; +bootstage_mark_name (BOOTSTAGE_ID_BOOTP_START ,"bootp_start" );#if defined(CONFIG_CMD_DHCP ) dhcp_state =INIT ;#endif
@@ -949,6 +951,8 @@ DhcpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,BootpCopyNetParams (bp);/* Store net params from reply */ dhcp_state =BOUND ;printf ("DHCP client bound to address %pI4\n" , &NetOurIP); +bootstage_mark_name (BOOTSTAGE_ID_BOOTP_STOP , +"bootp_stop" );net_auto_load ();return ;
net/net.c +1 -0
@@ -402,6 +402,7 @@ int NetLoop(enum proto_t protocol) NetArpWaitTxPacketSize =0 ; } +bootstage_mark_name (BOOTSTAGE_ID_ETH_START ,"eth_start" );eth_halt ();eth_set_current ();if (eth_init (bd) <0 ) {
Signature · 1 line
1.7.7.3
Wolfgang Denk
AppliedPATCH v3 14/15 bootstage: Plumb in bootstage calls for basic operations
Dear Simon Glass,
Quoted 5 lines · In message <[email protected]> you wrote:
This inserts bootstage calls into tftp, usb start and bootm. We could go further, but this is a reasonable start to illustrate the concept.
Signed-off-by Simon Glass <[email protected]>
Quoted 8 lines
---
common/cmd_bootm.c | 2 ++ common/cmd_net.c | 7 ++++++- common/cmd_usb.c | 1 + net/bootp.c | 4 ++++ net/net.c | 1 + 5 files changed, 14 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Probably the best operating system in the world is the [operating
system] made for the PDP-11 by Bell Laboratories."
- Ted Nelson, October 1977PATCH v3 15/15 bootstage: arm: Add bootstage calls in board and bootm
In reply to Simon GlassAdd calls to bootstage before and after relocation, and just before jumping to the OS.
The idea here is you can call bootstage_report() to get a report. Additionally, if you define CONFIG_BOOTSTAGE_REPORT then a report is printed automatically by U-Boot just before jumping to the kernel.
---
Changes in v2:
- Unify show_boot_progress() into this series
Changes in v3:
- Update commit message to clarify the purpose of CONFIG_BOOTSTAGE_REPORT
arch/arm/lib/board.c | 3 +++ arch/arm/lib/bootm.c | 4 ++++ 2 files changed, 7 insertions(+), 0 deletions(-)
arch/arm/lib/board.c +3 -0
@@ -266,6 +266,8 @@ void board_init_f(ulong bootflag)ulong reg;#endif +bootstage_mark_name (BOOTSTAGE_ID_START_UBOOT_R ,"board_init_r" ); +/* Pointer is writable since we allocated a register for it */ gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR ) & ~0x07 );/* compiler optimization barrier needed for GCC >= 3.4 */
@@ -455,6 +457,7 @@ void board_init_r(gd_t *id, ulong dest_addr) gd = id; gd->flags |=GD_FLG_RELOC ;/* tell others: relocation done */ +bootstage_mark_name (BOOTSTAGE_ID_START_UBOOT_F ,"board_init_f" ); monitor_flash_len = _end_ofs;
arch/arm/lib/bootm.c +4 -0
@@ -83,6 +83,10 @@ void arch_lmb_reserve(struct lmb *lmb)static void announce_and_cleanup (void ) {printf ("\nStarting kernel ...\n\n" ); +bootstage_mark_name (BOOTSTAGE_ID_BOOTM_HANDOFF ,"start_kernel" ); +#ifdef CONFIG_BOOTSTAGE_REPORT +bootstage_report (); +#endif #ifdef CONFIG_USB_DEVICE {
Signature · 1 line
1.7.7.3