[U-Boot] [PATCH 03/15] x86: Add a CBMEM timestamp generated right before the kernel startup.

Simon Glass sjg at chromium.org
Wed Oct 24 06:04:34 CEST 2012


From: Vadim Bendebury <vbendeb at chromium.org>

To maintain the initialization state of the timestamp facility, thesq
pointer to the CBMEM section containing the timestamp table should be
kept in the .data section (so that it is maintained across u-boot
relocation).

Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
Signed-off-by: Simon Glass <sjg at chromium.org>
---
 arch/x86/include/asm/arch-coreboot/timestamp.h |    1 +
 arch/x86/lib/zimage.c                          |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/x86/include/asm/arch-coreboot/timestamp.h b/arch/x86/include/asm/arch-coreboot/timestamp.h
index e48ad86..d104912 100644
--- a/arch/x86/include/asm/arch-coreboot/timestamp.h
+++ b/arch/x86/include/asm/arch-coreboot/timestamp.h
@@ -42,6 +42,7 @@ enum timestamp_id {
 
 	/* U-Boot entry IDs start at 1000 */
 	TS_U_BOOT_INITTED = 1000, /* This is where u-boot starts */
+	TS_U_BOOT_START_KERNEL = 1100, /* Right before jumping to kernel. */
 };
 
 void timestamp_init(void);
diff --git a/arch/x86/lib/zimage.c b/arch/x86/lib/zimage.c
index 2bbf5a8..1d6a0ed 100644
--- a/arch/x86/lib/zimage.c
+++ b/arch/x86/lib/zimage.c
@@ -36,6 +36,9 @@
 #include <asm/realmode.h>
 #include <asm/byteorder.h>
 #include <asm/bootparam.h>
+#ifdef CONFIG_SYS_COREBOOT_
+#include <asm/arch/timestamp.h>
+#endif
 
 /*
  * Memory lay-out:
@@ -282,7 +285,9 @@ int setup_zimage(struct boot_params *setup_base, char *cmd_line, int auto_boot,
 void boot_zimage(void *setup_base, void *load_address)
 {
 	printf("\nStarting kernel ...\n\n");
-
+#ifdef CONFIG_SYS_COREBOOT_
+	timestamp_add_now(TS_U_BOOT_START_KERNEL);
+#endif
 #if !defined CONFIG_SYS_X86_REALMODE || defined CONFIG_ZBOOT_32
 	/*
 	 * Set %ebx, %ebp, and %edi to 0, %esi to point to the boot_params
-- 
1.7.7.3



More information about the U-Boot mailing list