Enable timestamps ARM boards' romstage

This is needed for timestamps to actually show up in
CBMEM.

Signed-off-by: Stefan Reinauer <reinauer@google.com>
BRANCH=none
TEST=cbmem -t shows timestamps
BUG=chrome-os-partner:18637

Change-Id: Ia6499cbb7c07d15b5c5210eb3911e494efbd5127
Reviewed-on: https://gerrit.chromium.org/gerrit/63992
Reviewed-by: David Hendricks <dhendrix@chromium.org>
Commit-Queue: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
This commit is contained in:
Stefan Reinauer 2013-07-31 15:47:36 -07:00 committed by ChromeBot
commit 644c3265c7
3 changed files with 83 additions and 0 deletions

View file

@ -23,6 +23,7 @@
#include <armv7.h>
#include <cbfs.h>
#include <cbmem.h>
#include <timestamp.h>
#include <arch/cache.h>
#include <cpu/samsung/exynos5420/i2c.h>
@ -244,6 +245,14 @@ void main(void)
extern struct mem_timings mem_timings;
void *entry;
int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);
#if CONFIG_COLLECT_TIMESTAMPS
uint64_t start_romstage_time;
uint64_t before_dram_time;
uint64_t after_dram_time;
uint64_t base_time = timestamp_get();
start_romstage_time = timestamp_get();
#endif
/* Clock must be initialized before console_init, otherwise you may need
* to re-initialize serial console drivers again. */
@ -252,8 +261,15 @@ void main(void)
console_init();
setup_power(is_resume);
#if CONFIG_COLLECT_TIMESTAMPS
before_dram_time = timestamp_get();
#endif
setup_memory(&mem_timings, is_resume);
#if CONFIG_COLLECT_TIMESTAMPS
after_dram_time = timestamp_get();
#endif
primitive_mem_test();
if (is_resume) {
@ -272,7 +288,19 @@ void main(void)
cbmem_initialize_empty();
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_init(base_time);
timestamp_add(TS_START_ROMSTAGE, start_romstage_time );
timestamp_add(TS_BEFORE_INITRAM, before_dram_time );
timestamp_add(TS_AFTER_INITRAM, after_dram_time );
#endif
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");
simple_spi_test();
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_add_now(TS_END_ROMSTAGE);
#endif
stage_exit(entry);
}

View file

@ -23,6 +23,7 @@
#include <armv7.h>
#include <cbfs.h>
#include <cbmem.h>
#include <timestamp.h>
#include <arch/cache.h>
#include <cpu/samsung/exynos5420/i2c.h>
@ -245,6 +246,14 @@ void main(void)
extern struct mem_timings mem_timings;
void *entry;
int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);
#if CONFIG_COLLECT_TIMESTAMPS
uint64_t start_romstage_time;
uint64_t before_dram_time;
uint64_t after_dram_time;
uint64_t base_time = timestamp_get();
start_romstage_time = timestamp_get();
#endif
/* Clock must be initialized before console_init, otherwise you may need
* to re-initialize serial console drivers again. */
@ -253,8 +262,15 @@ void main(void)
console_init();
setup_power(is_resume);
#if CONFIG_COLLECT_TIMESTAMPS
before_dram_time = timestamp_get();
#endif
setup_memory(&mem_timings, is_resume);
#if CONFIG_COLLECT_TIMESTAMPS
after_dram_time = timestamp_get();
#endif
primitive_mem_test();
if (is_resume) {
@ -273,7 +289,19 @@ void main(void)
cbmem_initialize_empty();
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_init(base_time);
timestamp_add(TS_START_ROMSTAGE, start_romstage_time );
timestamp_add(TS_BEFORE_INITRAM, before_dram_time );
timestamp_add(TS_AFTER_INITRAM, after_dram_time );
#endif
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");
simple_spi_test();
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_add_now(TS_END_ROMSTAGE);
#endif
stage_exit(entry);
}

View file

@ -22,6 +22,7 @@
#include <armv7.h>
#include <cbfs.h>
#include <cbmem.h>
#include <timestamp.h>
#include <arch/cache.h>
#include <cpu/samsung/exynos5250/i2c.h>
@ -169,6 +170,14 @@ void main(void)
struct mem_timings *mem;
void *entry;
int is_resume = (get_wakeup_state() != IS_NOT_WAKEUP);
#if CONFIG_COLLECT_TIMESTAMPS
uint64_t start_romstage_time;
uint64_t before_dram_time;
uint64_t after_dram_time;
uint64_t base_time = timestamp_get();
start_romstage_time = timestamp_get();
#endif
/* Clock must be initialized before console_init, otherwise you may need
* to re-initialize serial console drivers again. */
@ -177,8 +186,14 @@ void main(void)
console_init();
setup_power(is_resume);
#if CONFIG_COLLECT_TIMESTAMPS
before_dram_time = timestamp_get();
#endif
setup_memory(mem, is_resume);
#if CONFIG_COLLECT_TIMESTAMPS
after_dram_time = timestamp_get();
#endif
if (is_resume) {
wakeup();
}
@ -192,6 +207,18 @@ void main(void)
cbmem_initialize_empty();
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_init(base_time);
timestamp_add(TS_START_ROMSTAGE, start_romstage_time );
timestamp_add(TS_BEFORE_INITRAM, before_dram_time );
timestamp_add(TS_AFTER_INITRAM, after_dram_time );
#endif
entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, "fallback/coreboot_ram");
#if CONFIG_COLLECT_TIMESTAMPS
timestamp_add_now(TS_END_ROMSTAGE);
#endif
stage_exit(entry);
}