]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootstage: Plumb in bootstage calls for basic operations
authorSimon Glass <sjg@chromium.org>
Sat, 10 Dec 2011 11:08:06 +0000 (11:08 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 18 Mar 2012 20:42:56 +0000 (21:42 +0100)
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 <sjg@chromium.org>
common/cmd_bootm.c
common/cmd_net.c
common/cmd_usb.c
net/bootp.c
net/net.c

index fd9f3e917c1c2a4f39847a5f09ae5190ac7587a3..d88f6c0253a1f0c8d12caaab61b127dd49391de6 100644 (file)
@@ -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);
index 6139188bd43f34fb9d518cc16f565cd869aafd72..65f32bceef41de6e7b953752f2e92bf727e2d315 100644 (file)
@@ -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(
index 4a86590f172a41b9c5029d77e98e19aa4fadb1ac..9eba2713eaef7f9ab073b779a6b8d7dd438f58c5 100644 (file)
@@ -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();
index 34124b8fc2425d6fe70e3b5cd42ec159119670df..9e324769db12e07b49b4a6dda91c01487d1fa035 100644 (file)
@@ -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;
index 045405b7a89742c1d1933f73d5a977cb82d3b270..c5acf8ff6e1cbf2612378a1ccdad03a0d31907a3 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -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) {