From: Andrew Murray <amur...@mpcdata.com>

This patch adds bootgraph instrumentation for ARM boards.

Signed-off-by: Andrew Murray <amur...@theiet.org>
---
 arch/arm/lib/board.c |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 169dfeb..e6bb8e2 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -271,6 +271,7 @@ void board_init_f (ulong bootflag)
        init_fnc_t **init_fnc_ptr;
        gd_t *id;
        ulong addr, addr_sp;
+       int ret;
 
        /* Pointer is writable since we allocated a register for it */
        gd = (gd_t *) ((CONFIG_SYS_INIT_SP_ADDR) & ~0x07);
@@ -282,7 +283,8 @@ void board_init_f (ulong bootflag)
        gd->mon_len = _bss_end_ofs;
 
        for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
-               if ((*init_fnc_ptr)() != 0) {
+               DO_INITCALL_RET(*init_fnc_ptr, ret);
+               if (ret != 0) {
                        hang ();
                }
        }
@@ -416,6 +418,9 @@ void board_init_f (ulong bootflag)
        debug ("relocation Offset is: %08lx\n", gd->reloc_off);
        memcpy (id, (void *)gd, sizeof (gd_t));
 
+#if defined(CONFIG_BOOT_TRACE)
+       printf("performing relocate to ram to 0x%pF\n", addr);
+#endif
        relocate_code (addr_sp, id, addr);
 
        /* NOTREACHED - relocate_code() does not return */
@@ -444,6 +449,10 @@ void board_init_r (gd_t *id, ulong dest_addr)
        ulong flash_size;
 #endif
 
+#if defined(CONFIG_BOOT_TRACE)
+       printf("completed relocate to ram\n");
+#endif
+
        gd = id;
        bd = gd->bd;
 
@@ -451,7 +460,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
        monitor_flash_len = _end_ofs;
        debug ("monitor flash len: %08lX\n", monitor_flash_len);
-       board_init();   /* Setup chipselects */
+
+       DO_INITCALL(board_init);        /* Setup chipselects */
 
 #ifdef CONFIG_SERIAL_MULTI
        serial_initialize();
@@ -499,7 +509,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 #if defined(CONFIG_CMD_NAND)
        puts ("NAND:  ");
-       nand_init();            /* go init the NAND */
+       DO_INITCALL(nand_init);         /* go init the NAND */
 #endif
 
 #if defined(CONFIG_CMD_ONENAND)
@@ -508,7 +518,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 #ifdef CONFIG_GENERIC_MMC
        puts("MMC:   ");
-       mmc_initialize(bd);
+       DO_INITCALL(mmc_initialize, bd);
 #endif
 
 #ifdef CONFIG_HAS_DATAFLASH
@@ -517,7 +527,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 
        /* initialize environment */
-       env_relocate ();
+       DO_INITCALL(env_relocate);
 
 #if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
        arm_pci_init();
@@ -526,16 +536,16 @@ void board_init_r (gd_t *id, ulong dest_addr)
        /* IP Address */
        gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
 
-       stdio_init ();  /* get the devices list going. */
+       DO_INITCALL(stdio_init);        /* get the devices list going. */
 
-       jumptable_init ();
+       DO_INITCALL(jumptable_init);
 
 #if defined(CONFIG_API)
        /* Initialize API */
        api_init ();
 #endif
 
-       console_init_r ();      /* fully init console as a device */
+       DO_INITCALL(console_init_r);    /* fully init console as a device */
 
 #if defined(CONFIG_ARCH_MISC_INIT)
        /* miscellaneous arch dependent initialisations */
@@ -543,7 +553,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 #if defined(CONFIG_MISC_INIT_R)
        /* miscellaneous platform dependent initialisations */
-       misc_init_r ();
+       DO_INITCALL(misc_init_r);
 #endif
 
         /* set up exceptions */
-- 
1.7.4.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to