baytrail: Use _timestamp region
Use timestamp region instead of storing timestamps in local data structures before cbmem is up. BUG=None BRANCH=None TEST=cbmem -t reports correct timestamps on rambi(for both normal boot and suspend/resume). Change-Id: I4cce22514041edc7808278d45eac4370a2bf0810 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/226421 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:
parent
e2ac6132aa
commit
58e212498f
3 changed files with 5 additions and 28 deletions
|
|
@ -21,6 +21,7 @@ config CPU_SPECIFIC_OPTIONS
|
|||
select CPU_MICROCODE_IN_CBFS
|
||||
select CPU_INTEL_TURBO_NOT_PACKAGE_SCOPED
|
||||
select DYNAMIC_CBMEM
|
||||
select HAS_PRECBMEM_TIMESTAMP_REGION
|
||||
select HAVE_MONOTONIC_TIMER
|
||||
select HAVE_SMI_HANDLER
|
||||
select HAVE_HARD_RESET
|
||||
|
|
|
|||
|
|
@ -28,14 +28,7 @@
|
|||
#include <arch/cpu.h>
|
||||
#include <soc/mrc_wrapper.h>
|
||||
|
||||
#define NUM_ROMSTAGE_TS 4
|
||||
struct romstage_timestamps {
|
||||
uint64_t times[NUM_ROMSTAGE_TS];
|
||||
int count;
|
||||
};
|
||||
|
||||
struct romstage_params {
|
||||
struct romstage_timestamps ts;
|
||||
unsigned long bist;
|
||||
struct mrc_params *mrc_params;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -99,14 +99,6 @@ static void spi_init(void)
|
|||
write32(bcr, reg);
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
@ -116,10 +108,8 @@ void * asmlinkage romstage_main(unsigned long bist,
|
|||
.mrc_params = NULL,
|
||||
};
|
||||
|
||||
/* 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);
|
||||
|
||||
program_base_addresses();
|
||||
|
||||
|
|
@ -233,7 +223,7 @@ void romstage_common(struct romstage_params *params)
|
|||
struct chipset_power_state *ps;
|
||||
int prev_sleep_state;
|
||||
|
||||
mark_ts(params, timestamp_get());
|
||||
timestamp_add_now(TS_BEFORE_INITRAM);
|
||||
|
||||
ps = fill_power_state();
|
||||
prev_sleep_state = chipset_prev_sleep_state(ps);
|
||||
|
|
@ -245,11 +235,10 @@ void romstage_common(struct romstage_params *params)
|
|||
boot_count_increment();
|
||||
#endif
|
||||
|
||||
|
||||
/* Initialize RAM */
|
||||
raminit(params->mrc_params, prev_sleep_state);
|
||||
|
||||
mark_ts(params, timestamp_get());
|
||||
timestamp_add_now(TS_AFTER_INITRAM);
|
||||
|
||||
handoff = romstage_handoff_find_or_add();
|
||||
if (handoff != NULL)
|
||||
|
|
@ -258,12 +247,6 @@ void romstage_common(struct romstage_params *params)
|
|||
printk(BIOS_DEBUG, "Romstage handoff structure not added!\n");
|
||||
|
||||
chromeos_init(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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue