diff options
author | Jonas <jonas.aberg@stericsson.com> | 2009-11-20 15:23:58 +0100 |
---|---|---|
committer | Michael Brandt <Michael.Brandt@stericsson.com> | 2010-01-13 12:00:28 +0100 |
commit | 074f516bda136e5464499fc63a854d8469f8e9fb (patch) | |
tree | a558c3f77be82412385b95a375889239f5933186 /lib_arm/bootm.c | |
parent | 2e0649a4f0a40848676fb183437915c1e8dcb866 (diff) |
Updated timing measurement structure, changed atags and added idle time measurement. Note: idle time measurement does not seem to work reliable at the moment. Verification needed.
Signed-off-by: Michael Brandt <Michael.Brandt@stericsson.com>
Diffstat (limited to 'lib_arm/bootm.c')
-rw-r--r-- | lib_arm/bootm.c | 69 |
1 files changed, 35 insertions, 34 deletions
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c index ebaf2b3f2..9dc790dee 100644 --- a/lib_arm/bootm.c +++ b/lib_arm/bootm.c @@ -54,16 +54,14 @@ static void setup_end_tag (bd_t *bd); static void setup_videolfb_tag (gd_t *gd); # endif -static struct tag *params; -#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ - #ifdef CONFIG_BOOTTIME -ulong boottime_ticks_uboot_init = 0; -ulong boottime_ticks_load_kernel = 0; -ulong boottime_ticks_uboot_done = 0; static void setup_boottime_tags(void); #endif +static struct tag *params; +#endif /* CONFIG_SETUP_MEMORY_TAGS || CONFIG_CMDLINE_TAG || CONFIG_INITRD_TAG */ + + int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) { bd_t *bd = gd->bd; @@ -91,7 +89,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images) debug ("## Transferring control to Linux (at address %08lx) ...\n", (ulong) theKernel); - boottime_tag_uboot_done() + boottime_tag("uncompress_ll_init"); #if defined (CONFIG_SETUP_MEMORY_TAGS) || \ defined (CONFIG_CMDLINE_TAG) || \ @@ -168,33 +166,6 @@ static void setup_start_tag (bd_t *bd) params = tag_next (params); } -#ifdef CONFIG_BOOTTIME -static void setup_boottime_tags(void) -{ - if(!boottime_ticks_uboot_init) - printf("Warning: uboot init time not tracked\n"); - if(!boottime_ticks_load_kernel) - printf("Warning: load kernel time not tracked\n"); - if(!boottime_ticks_uboot_done) - printf("Warning: uboot done time not tracked\n"); - - params->hdr.tag = ATAG_BOOTTIME_UBOOT_INIT; - params->hdr.size = tag_size (tag_boottime); - params->u.boottime.tick = boottime_ticks_uboot_init; - params = tag_next (params); - - params->hdr.tag = ATAG_BOOTTIME_LOAD_KERNEL; - params->hdr.size = tag_size (tag_boottime); - params->u.boottime.tick = boottime_ticks_load_kernel; - params = tag_next (params); - - params->hdr.tag = ATAG_BOOTTIME_UBOOT_DONE; - params->hdr.size = tag_size (tag_boottime); - params->u.boottime.tick = boottime_ticks_uboot_done; - params = tag_next (params); - -} -#endif #ifdef CONFIG_SETUP_MEMORY_TAGS static void setup_memory_tags (bd_t *bd) @@ -213,6 +184,36 @@ static void setup_memory_tags (bd_t *bd) } #endif /* CONFIG_SETUP_MEMORY_TAGS */ +#ifdef CONFIG_BOOTTIME +static void setup_boottime_tags(void) +{ + unsigned int i; + struct boottime_entry *b; + + params->hdr.tag = ATAG_BOOTTIME; + params->hdr.size = tag_size(tag_boottime); + + params->u.boottime.idle = boottime_idle_get(); + params->u.boottime.total = boottime_idle_done(); + + for (i = 0; i < BOOTTIME_MAX; i++) { + b = boottime_get_entry(i); + if (b == NULL) + break; + + params->u.boottime.entry[i].tick = b->tick; + strncpy((char *)params->u.boottime.entry[i].name, + (char *)b->name, BOOTTIME_MAX_NAME_LEN); + params->u.boottime.entry[i].name[BOOTTIME_MAX_NAME_LEN - 1] = '\0'; + + } + + params->u.boottime.num = i; + + params = tag_next(params); + +} +#endif static void setup_commandline_tag (bd_t *bd, char *commandline) { |