summaryrefslogtreecommitdiff
path: root/lib_arm
diff options
context:
space:
mode:
authorJonas <jonas.aberg@stericsson.com>2009-11-20 15:23:58 +0100
committerMichael Brandt <Michael.Brandt@stericsson.com>2009-11-30 10:58:05 +0100
commit2a1c5318956aa7b3ecb94557abe5728abd7c6402 (patch)
tree4d646a5869a66638a42455726532a1d2ec5e4f0d /lib_arm
parent4f47f2f1c8c46ac87c4e0a5708f950fdb59a2a17 (diff)
Corrected timer errors and changed MTU0 timer from 0 to 3 due to 0 is used by the linux kernel and we still want to be able to use that timer for boottime measurement. IE leave the 3rd timer run until we're executing init. Added atags for u-boot timing measurements as communication with the kernel.
Diffstat (limited to 'lib_arm')
-rw-r--r--lib_arm/bootm.c44
1 files changed, 43 insertions, 1 deletions
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c
index 128b7e313..ebaf2b3f2 100644
--- a/lib_arm/bootm.c
+++ b/lib_arm/bootm.c
@@ -26,6 +26,7 @@
#include <image.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
+#include <asm/boottime.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -56,6 +57,13 @@ static void setup_videolfb_tag (gd_t *gd);
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
+
int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
{
bd_t *bd = gd->bd;
@@ -83,14 +91,20 @@ 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()
+
#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
defined (CONFIG_CMDLINE_TAG) || \
defined (CONFIG_INITRD_TAG) || \
defined (CONFIG_SERIAL_TAG) || \
defined (CONFIG_REVISION_TAG) || \
defined (CONFIG_LCD) || \
- defined (CONFIG_VFD)
+ defined (CONFIG_VFD) || \
+ defined (CONFIG_BOOTTIME)
setup_start_tag (bd);
+#ifdef CONFIG_BOOTTIME
+ setup_boottime_tags();
+#endif
#ifdef CONFIG_SERIAL_TAG
setup_serial_tag (&params);
#endif
@@ -113,6 +127,7 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
setup_end_tag (bd);
#endif
+
/* we assume that the kernel is in place */
printf ("\nStarting kernel ...\n\n");
@@ -153,6 +168,33 @@ 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)