summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/st/u8500/emmc.c2
-rwxr-xr-xcommon/Makefile2
-rw-r--r--common/boottime.c (renamed from lib_arm/boottime.c)26
-rw-r--r--common/main.c5
-rw-r--r--include/asm-arm/setup.h13
-rw-r--r--include/boottime.h (renamed from include/asm-arm/boottime.h)18
-rw-r--r--include/common.h1
-rw-r--r--include/configs/u8500.h2
-rw-r--r--lib_arm/Makefile1
-rw-r--r--lib_arm/bootm.c5
10 files changed, 41 insertions, 34 deletions
diff --git a/board/st/u8500/emmc.c b/board/st/u8500/emmc.c
index ea432a178..7336b0334 100644
--- a/board/st/u8500/emmc.c
+++ b/board/st/u8500/emmc.c
@@ -25,7 +25,7 @@
#include "mmc.h"
#include "emmc.h"
#include "gpio.h"
-#include <asm/boottime.h>
+#include <boottime.h>
#define PIB_EMMC_ADDR 0x00
/* ========================================================================
diff --git a/common/Makefile b/common/Makefile
index 557d9a197..de594b4a1 100755
--- a/common/Makefile
+++ b/common/Makefile
@@ -165,7 +165,7 @@ COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
COBJS-$(CONFIG_UPDATE_TFTP) += update.o
COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-
+COBJS-$(CONFIG_BOOTTIME) += boottime.o
COBJS := $(sort $(COBJS-y))
SRCS := $(AOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/lib_arm/boottime.c b/common/boottime.c
index 3c84bb3e3..8aa29a643 100644
--- a/lib_arm/boottime.c
+++ b/common/boottime.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2009 ST-Ericsson AB
+ * Copyright (C) 2009-2010 ST-Ericsson AB
* Jonas Aaberg <jonas.aberg@stericsson.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -20,14 +20,14 @@
#include <common.h>
+#include <boottime.h>
#include <asm/byteorder.h>
-#include <asm/boottime.h>
#include <asm/setup.h>
-#ifdef CONFIG_BOOTTIME
-ulong get_raw_timer(void);
-
-static struct tag_boottime boottime;
+static struct tag_boottime boottime = {
+ .idle = 0,
+ .total = 0,
+};
int boottime_tag(char *name)
{
@@ -40,7 +40,7 @@ int boottime_tag(char *name)
name,
BOOTTIME_MAX_NAME_LEN);
boottime.entry[boottime.num].name[BOOTTIME_MAX_NAME_LEN - 1] = '\0';
- boottime.entry[boottime.num].tick = get_raw_timer();
+ boottime.entry[boottime.num].time = get_timer_us();
boottime.num++;
return 0;
@@ -56,17 +56,17 @@ struct boottime_entry *boottime_get_entry(unsigned int i)
}
-void boottime_idle_add(ulong i)
+void boottime_idle_add(unsigned long time)
{
- boottime.idle += i;
+ boottime.idle += time;
}
-ulong boottime_idle_done(void)
+unsigned long boottime_idle_done(void)
{
- return get_raw_timer();
+ return get_timer_us();
}
-ulong boottime_idle_get(void)
+unsigned long boottime_idle_get(void)
{
return boottime.idle;
}
@@ -76,7 +76,7 @@ void boottime_remove_last(void)
if (boottime.num > 0)
boottime.num--;
}
-#endif
+
diff --git a/common/main.c b/common/main.c
index 10d890417..88e7fd2e9 100644
--- a/common/main.c
+++ b/common/main.c
@@ -38,6 +38,7 @@
#include <hush.h>
#endif
+#include <boottime.h>
#include <post.h>
#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
@@ -215,6 +216,10 @@ static __inline__ int abortboot(int bootdelay)
{
int abort = 0;
+#ifdef CONFIG_BOOTTIME
+ boottime_tag("autoboot_delay");
+#endif
+
#ifdef CONFIG_MENUPROMPT
printf(CONFIG_MENUPROMPT);
#else
diff --git a/include/asm-arm/setup.h b/include/asm-arm/setup.h
index 467f6d9dd..36b11c459 100644
--- a/include/asm-arm/setup.h
+++ b/include/asm-arm/setup.h
@@ -21,6 +21,8 @@
#ifndef __ASMARM_SETUP_H
#define __ASMARM_SETUP_H
+#include <boottime.h>
+
/*
* Usage:
* - do not go blindly adding fields, add them at the end
@@ -206,22 +208,19 @@ struct tag_memclk {
};
/* for automatic boot timing testcases */
+
#define ATAG_BOOTTIME 0x41000403
-#define BOOTTIME_MAX_NAME_LEN 64
#define BOOTTIME_MAX 10
-struct boottime_entry {
- u32 tick;
- u8 name[BOOTTIME_MAX_NAME_LEN];
-};
struct tag_boottime {
struct boottime_entry entry[BOOTTIME_MAX];
- u32 idle;
- u32 total;
+ u32 idle; /* in us */
+ u32 total; /* in us */
u8 num;
};
+
struct tag {
struct tag_header hdr;
union {
diff --git a/include/asm-arm/boottime.h b/include/boottime.h
index c9a43e259..907033a6f 100644
--- a/include/asm-arm/boottime.h
+++ b/include/boottime.h
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2009 ST-Ericsson AB
+ * Copyright (C) 2009-2010 ST-Ericsson AB
* Jonas Aaberg <jonas.aberg@stericsson.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -18,20 +18,24 @@
*
*/
-
-
#ifndef BOOTTIME_H
#define BOOTTIME_H
-#include <asm/setup.h>
+
+#define BOOTTIME_MAX_NAME_LEN 64
+
+struct boottime_entry {
+ u32 time; /* in us */
+ u8 name[BOOTTIME_MAX_NAME_LEN];
+};
#ifdef CONFIG_BOOTTIME
int boottime_tag(char *name);
void boottime_remove_last(void);
struct boottime_entry *boottime_get_entry(unsigned int i);
-ulong boottime_idle_get(void);
-ulong boottime_idle_done(void);
-void boottime_idle_add(ulong i);
+unsigned long boottime_idle_get(void);
+unsigned long boottime_idle_done(void);
+void boottime_idle_add(unsigned long time);
#else
#define boottime_tag(x) 0
#define boottime_remove_last()
diff --git a/include/common.h b/include/common.h
index 07897f682..eae93b16c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -569,6 +569,7 @@ void irq_free_handler (int);
void reset_timer (void);
ulong get_timer (ulong base);
void set_timer (ulong t);
+u64 get_timer_us (void);
void enable_interrupts (void);
int disable_interrupts (void);
diff --git a/include/configs/u8500.h b/include/configs/u8500.h
index 2eff34aee..21c48fe66 100644
--- a/include/configs/u8500.h
+++ b/include/configs/u8500.h
@@ -31,8 +31,6 @@
#define CONFIG_U8500_ED 1
#define CONFIG_L2_OFF 1
-#undef CONFIG_BOOTTIME /* enable boot time stamps */
-
#define CONFIG_SYS_MEMTEST_START 0x00000000
#define CONFIG_SYS_MEMTEST_END 0x1FFFFFFF
#define CONFIG_SYS_HZ 1000 /* must be 1000 */
diff --git a/lib_arm/Makefile b/lib_arm/Makefile
index 5cfeba985..02933485c 100644
--- a/lib_arm/Makefile
+++ b/lib_arm/Makefile
@@ -44,7 +44,6 @@ COBJS-y += cache-cp15.o
endif
COBJS-y += interrupts.o
COBJS-y += reset.o
-COBJS-y += boottime.o
SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
$(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c
index 9dc790dee..174ea9cc4 100644
--- a/lib_arm/bootm.c
+++ b/lib_arm/bootm.c
@@ -24,9 +24,10 @@
#include <common.h>
#include <command.h>
#include <image.h>
+#include <boottime.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
-#include <asm/boottime.h>
+
DECLARE_GLOBAL_DATA_PTR;
@@ -201,7 +202,7 @@ static void setup_boottime_tags(void)
if (b == NULL)
break;
- params->u.boottime.entry[i].tick = b->tick;
+ params->u.boottime.entry[i].time = b->time;
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';