All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] Add bootstage calls in places appropriate for network booting
Date: Fri, 13 May 2011 13:52:02 -0700	[thread overview]
Message-ID: <1305319923-9477-4-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1305319923-9477-1-git-send-email-sjg@chromium.org>

This adds calls to to the bootstage_mark() function at various places
through the boot process.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
 arch/arm/lib/board.c |    2 ++
 arch/arm/lib/bootm.c |    1 +
 common/cmd_bootm.c   |    2 ++
 common/cmd_net.c     |    7 ++++++-
 common/cmd_usb.c     |    1 +
 net/bootp.c          |    3 +++
 net/net.c            |    1 +
 7 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 1a784a1..13a86c3 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -275,6 +275,8 @@ void board_init_f (ulong bootflag)
 	gd_t *id;
 	ulong addr, addr_sp;
 
+	bootstage_mark(BOOTSTAGE_START_UBOOT, "start_armboot");
+
 	/* 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 */
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 802e833..b763403 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -83,6 +83,7 @@ void arch_lmb_reserve(struct lmb *lmb)
 static void announce_and_cleanup(void)
 {
 	printf("\nStarting kernel ...\n\n");
+	bootstage_mark(BOOTSTAGE_BOOTM_HANDOFF, "start_kernel");
 
 #ifdef CONFIG_USB_DEVICE
 	{
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 1966da4..212e510 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -221,6 +221,8 @@ static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
 
 	bootm_start_lmb();
 
+	bootstage_mark(BOOTSTAGE_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);
diff --git a/common/cmd_net.c b/common/cmd_net.c
index 8c6f5c8..49f8ffd 100644
--- a/common/cmd_net.c
+++ b/common/cmd_net.c
@@ -43,7 +43,12 @@ U_BOOT_CMD(
 
 int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	return netboot_common (TFTP, cmdtp, argc, argv);
+	int ret;
+
+	bootstage_mark(BOOTSTAGE_KERNELREAD_START, "tftp start");
+	ret = netboot_common(TFTP, cmdtp, argc, argv);
+	bootstage_mark(BOOTSTAGE_KERNELREAD_STOP, "tftp done");
+	return ret;
 }
 
 U_BOOT_CMD(
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 3ba6fff..c7b30a0 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -522,6 +522,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(BOOTSTAGE_USB_START, "usb_start");
 		usb_stop();
 		printf("(Re)start USB...\n");
 		i = usb_init();
diff --git a/net/bootp.c b/net/bootp.c
index 4db63cb..043f9e0 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -311,6 +311,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(BOOTSTAGE_BOOTP_STOP, "bootp_stop");
 
 	debug("Got good BOOTP\n");
 
@@ -552,6 +553,7 @@ BootpRequest (void)
 	Bootp_t *bp;
 	int ext_len, pktlen, iplen;
 
+	bootstage_mark(BOOTSTAGE_BOOTP_START, "bootp_start");
 #if defined(CONFIG_CMD_DHCP)
 	dhcp_state = INIT;
 #endif
@@ -914,6 +916,7 @@ 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(BOOTSTAGE_BOOTP_STOP, "bootp_stop");
 
 			/* Obey the 'autoload' setting */
 			if ((s = getenv("autoload")) != NULL) {
diff --git a/net/net.c b/net/net.c
index 2abf879..5ff99b6 100644
--- a/net/net.c
+++ b/net/net.c
@@ -377,6 +377,7 @@ NetLoop(proto_t protocol)
 		NetArpWaitTxPacketSize = 0;
 	}
 
+	bootstage_mark(BOOTSTAGE_ETH_START, "eth_start");
 	eth_halt();
 #ifdef CONFIG_NET_MULTI
 	eth_set_current();
-- 
1.7.3.1

  parent reply	other threads:[~2011-05-13 20:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-13 20:51 [U-Boot] [PATCH 0/4] Accurate boot time measurement Simon Glass
2011-05-13 20:52 ` [U-Boot] [PATCH 1/4] Add microsecond " Simon Glass
2011-05-14 11:19   ` Mike Frysinger
2011-05-14 11:31   ` Mike Frysinger
2011-05-13 20:52 ` [U-Boot] [PATCH 2/4] Add bootstage progress report Simon Glass
2011-05-14 11:42   ` Mike Frysinger
2011-05-13 20:52 ` Simon Glass [this message]
2011-05-14 11:44   ` [U-Boot] [PATCH 3/4] Add bootstage calls in places appropriate for network booting Mike Frysinger
2011-05-13 20:52 ` [U-Boot] [PATCH 4/4] Add option to print boot stage report before starting kernel Simon Glass
2011-05-14 11:46   ` Mike Frysinger
2011-05-14 11:34 ` [U-Boot] [PATCH 0/4] Accurate boot time measurement Mike Frysinger
2011-05-14 17:32   ` Simon Glass
2011-05-15 10:03     ` Graeme Russ
2011-05-15 21:34       ` Simon Glass
2011-05-15 22:56         ` Graeme Russ
2011-05-16  5:56           ` Wolfgang Denk
2011-05-16  6:10             ` Graeme Russ
2011-05-15 11:53 ` Wolfgang Denk
2011-05-15 21:58   ` Simon Glass
2011-05-15 22:36     ` Graeme Russ
2011-05-16  5:55       ` Wolfgang Denk
2011-05-16  6:11         ` Graeme Russ
2011-05-16 11:18           ` Wolfgang Denk
2011-05-16  2:59     ` Mike Frysinger
2011-05-16  5:48     ` Wolfgang Denk
2011-05-16  6:23       ` Graeme Russ
2011-05-16 11:40         ` Wolfgang Denk
2011-05-16 18:25           ` Scott Wood
2011-05-16 23:09           ` Graeme Russ
2011-05-16 14:23         ` Premi, Sanjeev
2011-05-16 16:00       ` Simon Glass
2011-05-16 18:32         ` Wolfgang Denk
2011-05-16 21:35           ` Simon Glass
2011-05-17  8:20         ` Detlev Zundel
2011-05-17 17:00           ` Simon Glass
2011-05-17 22:57             ` Graeme Russ
2011-05-19  8:36             ` Detlev Zundel
2011-05-20  1:48               ` Simon Glass
2011-05-20  2:28                 ` Graeme Russ
2011-05-20  2:29                   ` Graeme Russ
2011-05-23 15:22                 ` Detlev Zundel
2011-05-24  2:55                   ` Mike Frysinger
2011-05-24  7:18                     ` Wolfgang Denk
2011-05-24 18:22                       ` Mike Frysinger
2011-05-24 19:24                         ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1305319923-9477-4-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.