broadwell: Use _timestamp region

Use timestamp region instead of storing timestamps in local data structures
before cbmem is up

BUG=None
BRANCH=None
TEST=Compiles successfully for Auron and Samus. cbmem -t reports correct
timestamps on auron(for both normal boot and suspend/resume)

Change-Id: Ib70a3632c2034963c819c1bb90a3cdb2d7d9c355
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/226420
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
Furquan Shaikh 2014-10-29 16:50:35 -07:00 committed by chrome-internal-fetch
commit e2ac6132aa
3 changed files with 5 additions and 28 deletions

View file

@ -22,6 +22,7 @@ config CPU_SPECIFIC_OPTIONS
select CPU_INTEL_FIRMWARE_INTERFACE_TABLE
select CPU_MICROCODE_IN_CBFS
select DYNAMIC_CBMEM
select HAS_PRECBMEM_TIMESTAMP_REGION
select HAVE_MONOTONIC_TIMER
select HAVE_SMI_HANDLER
select HAVE_HARD_RESET

View file

@ -23,16 +23,9 @@
#include <stdint.h>
#include <arch/cpu.h>
#define NUM_ROMSTAGE_TS 4
struct romstage_timestamps {
uint64_t times[NUM_ROMSTAGE_TS];
int count;
};
struct chipset_power_state;
struct pei_data;
struct romstage_params {
struct romstage_timestamps ts;
unsigned long bist;
struct chipset_power_state *power_state;
struct pei_data *pei_data;

View file

@ -39,14 +39,6 @@
#include <soc/romstage.h>
#include <soc/spi.h>
static inline void mark_ts(struct romstage_params *rp, uint64_t ts)
{
struct romstage_timestamps *rt = &rp->ts;
rt->times[rt->count] = ts;
rt->count++;
}
/* Entry from cache-as-ram.inc. */
void * asmlinkage romstage_main(unsigned long bist,
uint32_t tsc_low, uint32_t tsc_hi)
@ -58,11 +50,8 @@ void * asmlinkage romstage_main(unsigned long bist,
post_code(0x30);
/* Save initial timestamp from bootblock. */
mark_ts(&rp, (((uint64_t)tsc_hi) << 32) | (uint64_t)tsc_low);
/* Save romstage begin */
mark_ts(&rp, timestamp_get());
timestamp_early_init((((uint64_t)tsc_hi) << 32) | (uint64_t)tsc_low);
timestamp_add_now(TS_START_ROMSTAGE);
/* System Agent Early Initialization */
systemagent_early_init();
@ -103,7 +92,7 @@ void romstage_common(struct romstage_params *params)
post_code(0x32);
mark_ts(params, timestamp_get());
timestamp_add_now(TS_BEFORE_INITRAM);
params->pei_data->boot_mode = params->power_state->prev_sleep_state;
@ -121,7 +110,7 @@ void romstage_common(struct romstage_params *params)
/* Initialize RAM */
raminit(params->pei_data);
mark_ts(params, timestamp_get());
timestamp_add_now(TS_AFTER_INITRAM);
handoff = romstage_handoff_find_or_add();
if (handoff != NULL)
@ -131,12 +120,6 @@ void romstage_common(struct romstage_params *params)
printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
chromeos_init(params->power_state->prev_sleep_state);
/* Save timestamp information. */
timestamp_init(params->ts.times[0]);
timestamp_add(TS_START_ROMSTAGE, params->ts.times[1]);
timestamp_add(TS_BEFORE_INITRAM, params->ts.times[2]);
timestamp_add(TS_AFTER_INITRAM, params->ts.times[3]);
}
void asmlinkage romstage_after_car(void)