Add timestamps for selfboot and acpi wake
authorDuncan Laurie <dlaurie@chromium.org>
Wed, 19 Oct 2011 22:32:39 +0000 (15:32 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Fri, 30 Mar 2012 03:30:08 +0000 (05:30 +0200)
Change-Id: I28224867610b947739d940d25c98399d219f10f4
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: http://review.coreboot.org/733
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
src/arch/x86/boot/acpi.c
src/boot/selfboot.c
src/include/timestamp.h

index 33d730bc8c2f0eb90d5ade3c9781f9993b29a287..ab67d38b85cf640c6f614627c8c6720891e03b38 100644 (file)
@@ -32,6 +32,9 @@
 #include <device/pci.h>
 #include <cbmem.h>
 #include <cpu/x86/lapic_def.h>
+#if CONFIG_COLLECT_TIMESTAMPS
+#include <timestamp.h>
+#endif
 #if CONFIG_CHROMEOS
 #include <vendorcode/google/chromeos/chromeos.h>
 #endif
@@ -610,6 +613,10 @@ void acpi_jump_to_wakeup(void *vector)
        /* Copy wakeup trampoline in place. */
        memcpy((void *)WAKEUP_BASE, &__wakeup, (size_t)&__wakeup_size);
 
+#if CONFIG_COLLECT_TIMESTAMPS
+       timestamp_add_now(TS_ACPI_WAKE_JUMP);
+#endif
+
        acpi_do_wakeup((u32)vector, acpi_backup_memory, CONFIG_RAMBASE,
                       HIGH_MEMORY_SAVE);
 }
index 67603f07db8878268ba55580e9f494ad4562bc2a..3c310234cb48ff312dab512892b49630d6acfff7 100644 (file)
@@ -29,6 +29,9 @@
 #include <string.h>
 #include <cbfs.h>
 #include <lib.h>
+#if CONFIG_COLLECT_TIMESTAMPS
+#include <timestamp.h>
+#endif
 
 /* Maximum physical address we can use for the coreboot bounce buffer. */
 #ifndef MAX_ADDR
@@ -512,6 +515,10 @@ static int selfboot(struct lb_memory *mem, struct cbfs_payload *payload)
        printk(BIOS_DEBUG, "Jumping to boot code at %x\n", entry);
        post_code(POST_ENTER_ELF_BOOT);
 
+#if CONFIG_COLLECT_TIMESTAMPS
+       timestamp_add_now(TS_SELFBOOT_JUMP);
+#endif
+
        /* Jump to kernel */
        jmp_to_elf_entry((void*)entry, bounce_buffer, bounce_size);
        return 1;
index cfa06e29fc96fb43cd686bea9d5e65506b305b86..8b9a89a2b8aca89d5187c246ba1cf29bb70a6f73 100644 (file)
@@ -37,6 +37,8 @@ struct timestamp_table {
 enum timestamp_id {
        TS_BEFORE_INITRAM = 1,
        TS_AFTER_INITRAM = 2,
+       TS_ACPI_WAKE_JUMP = 98,
+       TS_SELFBOOT_JUMP = 99,
 };
 
 void timestamp_init(tsc_t base);