From 61dbca0b181335d187d742c4a63472f2f2cc9a1b Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Wed, 29 Oct 2014 10:48:57 -0700 Subject: [PATCH] haswell: Use _timestamp region Use timestamp region instead of storing timestamps in local variables before cbmem is up. BUG=None BRANCH=None TEST=cbmem -t reports correct timestamps on falco and peppy (for both normal boot and suspend/resume). Change-Id: If5883721553090f51c0bfcb5677aad55c54f82b3 Signed-off-by: Furquan Shaikh Reviewed-on: https://chromium-review.googlesource.com/226362 Reviewed-by: Aaron Durbin Commit-Queue: Furquan Shaikh Tested-by: Furquan Shaikh --- src/cpu/intel/haswell/Kconfig | 1 + src/cpu/intel/haswell/romstage.c | 22 ++++------------------ 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/cpu/intel/haswell/Kconfig b/src/cpu/intel/haswell/Kconfig index d9d4a1144c..0df560f05b 100644 --- a/src/cpu/intel/haswell/Kconfig +++ b/src/cpu/intel/haswell/Kconfig @@ -23,6 +23,7 @@ config CPU_SPECIFIC_OPTIONS select CPU_INTEL_FIRMWARE_INTERFACE_TABLE select CAR_MIGRATION select PARALLEL_MP + select HAS_PRECBMEM_TIMESTAMP_REGION config BOOTBLOCK_CPU_INIT string diff --git a/src/cpu/intel/haswell/romstage.c b/src/cpu/intel/haswell/romstage.c index 3d5bb6fe09..ffb3ae47f0 100644 --- a/src/cpu/intel/haswell/romstage.c +++ b/src/cpu/intel/haswell/romstage.c @@ -200,17 +200,13 @@ void romstage_common(const struct romstage_params *params) struct romstage_handoff *handoff; #if CONFIG_COLLECT_TIMESTAMPS - uint64_t start_romstage_time; - uint64_t before_dram_time; - uint64_t after_dram_time; uint64_t base_time = (uint64_t)pci_read_config32(PCI_DEV(0, 0x1f, 2), 0xd0) << 32 || pci_read_config32(PCI_DEV(0, 0x00, 0), 0xdc); + timestamp_early_init(base_time); #endif -#if CONFIG_COLLECT_TIMESTAMPS - start_romstage_time = timestamp_get(); -#endif + timestamp_add_now(TS_START_ROMSTAGE); if (params->bist == 0) enable_lapic(); @@ -250,9 +246,7 @@ void romstage_common(const struct romstage_params *params) post_code(0x3a); params->pei_data->boot_mode = boot_mode; -#if CONFIG_COLLECT_TIMESTAMPS - before_dram_time = timestamp_get(); -#endif + timestamp_add_now(TS_BEFORE_INITRAM); report_platform_info(); @@ -261,9 +255,7 @@ void romstage_common(const struct romstage_params *params) sdram_initialize(params->pei_data); -#if CONFIG_COLLECT_TIMESTAMPS - after_dram_time = timestamp_get(); -#endif + timestamp_add_now(TS_AFTER_INITRAM); post_code(0x3b); intel_early_me_status(); @@ -292,13 +284,7 @@ void romstage_common(const struct romstage_params *params) #if CONFIG_CHROMEOS init_chromeos(boot_mode); #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 } static inline void prepare_for_resume(struct romstage_handoff *handoff)