summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Menzel <paulepanter@users.sourceforge.net>2013-07-02 09:54:17 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2013-08-29 01:56:48 +0200
commitab6d27e8f83db2791bc2b633a02f12a3076a4e5f (patch)
tree5f6c8445838171705a4416ce5daf8ebd5e5d89b4 /src
parent3c46ca33a1c878beee839beb658fd93e8d3312a7 (diff)
lenovo/x60/romstage.c: Collect timestamps in romstage
Collect early timestamps in Lenovo X60’s romstage. Selecting the option `COLLECT_TIMESTAMPS` in Kconfig and then doing `cbmem --timestamps` should output the timestamps. Change-Id: I7bd30f03a1b85c38e89c19cdf88b2d20b24abed8 Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-on: http://review.coreboot.org/3587 Reviewed-by: Ronald G. Minnich <rminnich@gmail.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src')
-rw-r--r--src/mainboard/lenovo/x60/romstage.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mainboard/lenovo/x60/romstage.c b/src/mainboard/lenovo/x60/romstage.c
index 222b999334..4d0eac73de 100644
--- a/src/mainboard/lenovo/x60/romstage.c
+++ b/src/mainboard/lenovo/x60/romstage.c
@@ -30,6 +30,7 @@
#include <cpu/x86/lapic.h>
#include <lib.h>
#include <cbmem.h>
+#include <timestamp.h>
#include <pc80/mc146818rtc.h>
#include <console/console.h>
#include <cpu/x86/bist.h>
@@ -218,6 +219,20 @@ void main(unsigned long bist)
int cbmem_was_initted;
const u8 spd_addrmap[2 * DIMM_SOCKETS] = { 0x50, 0x52, 0x51, 0x53 };
+#if CONFIG_COLLECT_TIMESTAMPS
+ tsc_t start_romstage_time;
+ tsc_t before_dram_time;
+ tsc_t after_dram_time;
+ tsc_t base_time = {
+ .lo = pci_read_config32(PCI_DEV(0, 0x00, 0), 0xdc),
+ .hi = pci_read_config32(PCI_DEV(0, 0x1f, 2), 0xd0)
+ };
+#endif
+
+#if CONFIG_COLLECT_TIMESTAMPS
+ start_romstage_time = rdtsc();
+#endif
+
if (bist == 0)
enable_lapic();
@@ -281,7 +296,13 @@ void main(unsigned long bist)
dump_spd_registers();
#endif
+#if CONFIG_COLLECT_TIMESTAMPS
+ before_dram_time = rdtsc();
+#endif
sdram_initialize(boot_mode, spd_addrmap);
+#if CONFIG_COLLECT_TIMESTAMPS
+ after_dram_time = rdtsc();
+#endif
/* Perform some initialization that must run before stage2 */
early_ich7_init();
@@ -340,6 +361,14 @@ void main(unsigned long bist)
}
#endif
+#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);
+ timestamp_add_now(TS_END_ROMSTAGE);
+#endif
+
#if CONFIG_CONSOLE_CBMEM
/* Keep this the last thing this function does. */
cbmemc_reinit();