aboutsummaryrefslogtreecommitdiff
path: root/src/lib/hardwaremain.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-07 17:26:08 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2013-09-21 06:20:21 +0200
commitb766b1c76aa2258bf66569f429fb092c23813bbc (patch)
treecd99bf9bfd750768cc6c447ca8e96ede84da7430 /src/lib/hardwaremain.c
parente28bd4ade6f716024afdff0bac48028a42a62e71 (diff)
timestamps: Use stash before CBMEM is usable
Change-Id: I9e927abdb1d7d9c233de5620a9a65b419e803ebf Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3909 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/lib/hardwaremain.c')
-rw-r--r--src/lib/hardwaremain.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index 898e91048b..dd9719642e 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -126,7 +126,7 @@ static boot_state_t bs_pre_device(void *arg)
static boot_state_t bs_dev_init_chips(void *arg)
{
- timestamp_stash(TS_DEVICE_ENUMERATE);
+ timestamp_add_now(TS_DEVICE_ENUMERATE);
/* Initialize chips early, they might disable unused devices. */
dev_initialize_chips();
@@ -145,7 +145,7 @@ static boot_state_t bs_dev_enumerate(void *arg)
static boot_state_t bs_dev_resources(void *arg)
{
- timestamp_stash(TS_DEVICE_CONFIGURE);
+ timestamp_add_now(TS_DEVICE_CONFIGURE);
/* Now compute and assign the bus resources. */
dev_configure();
post_code(POST_DEVICE_CONFIGURATION_COMPLETE);
@@ -155,7 +155,7 @@ static boot_state_t bs_dev_resources(void *arg)
static boot_state_t bs_dev_enable(void *arg)
{
- timestamp_stash(TS_DEVICE_ENABLE);
+ timestamp_add_now(TS_DEVICE_ENABLE);
/* Now actually enable devices on the bus */
dev_enable();
post_code(POST_DEVICES_ENABLED);
@@ -165,7 +165,7 @@ static boot_state_t bs_dev_enable(void *arg)
static boot_state_t bs_dev_init(void *arg)
{
- timestamp_stash(TS_DEVICE_INITIALIZE);
+ timestamp_add_now(TS_DEVICE_INITIALIZE);
/* And of course initialize devices on the bus */
dev_initialize();
post_code(POST_DEVICES_INITIALIZED);
@@ -175,7 +175,7 @@ static boot_state_t bs_dev_init(void *arg)
static boot_state_t bs_post_device(void *arg)
{
- timestamp_stash(TS_DEVICE_DONE);
+ timestamp_add_now(TS_DEVICE_DONE);
timestamp_sync();
@@ -446,7 +446,10 @@ static void boot_state_schedule_static_entries(void)
void main(void)
{
- timestamp_stash(TS_START_RAMSTAGE);
+ /* Record current time, try to locate timestamps in CBMEM. */
+ timestamp_init(rdtsc());
+
+ timestamp_add_now(TS_START_RAMSTAGE);
post_code(POST_ENTRY_RAMSTAGE);
/* console_init() MUST PRECEDE ALL printk()! */