timestamp: refine boot CPU test
The timestamp code's restriction to run only on the BSP is for AMD systems. No need to run it everywhere, so tighten the test (and only run boot_cpu() when required). Change-Id: I800e817cc89e8688a671672961cab15c7f788ba8 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: http://review.coreboot.org/10102 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
parent
d914412bec
commit
2daadf8f57
|
@ -21,8 +21,10 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <console/console.h>
|
#include <console/console.h>
|
||||||
#include <cbmem.h>
|
#include <cbmem.h>
|
||||||
|
#include <timer.h>
|
||||||
#include <timestamp.h>
|
#include <timestamp.h>
|
||||||
#include <arch/early_variables.h>
|
#include <arch/early_variables.h>
|
||||||
|
#include <rules.h>
|
||||||
#include <smp/node.h>
|
#include <smp/node.h>
|
||||||
|
|
||||||
#define MAX_TIMESTAMPS 60
|
#define MAX_TIMESTAMPS 60
|
||||||
|
@ -52,12 +54,24 @@ static void timestamp_real_init(uint64_t base)
|
||||||
car_set_var(ts_table_p, tst);
|
car_set_var(ts_table_p, tst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Determine if one should proceed into timestamp code. This is for protecting
|
||||||
|
* systems that have multiple processors running in romstage -- namely AMD
|
||||||
|
* based x86 platforms. */
|
||||||
|
static int timestamp_should_run(void)
|
||||||
|
{
|
||||||
|
/* Only check boot_cpu() in other stages than ramstage on x86. */
|
||||||
|
if ((!ENV_RAMSTAGE && IS_ENABLED(CONFIG_ARCH_X86)) && !boot_cpu())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
void timestamp_add(enum timestamp_id id, uint64_t ts_time)
|
void timestamp_add(enum timestamp_id id, uint64_t ts_time)
|
||||||
{
|
{
|
||||||
struct timestamp_entry *tse;
|
struct timestamp_entry *tse;
|
||||||
struct timestamp_table *ts_table = NULL;
|
struct timestamp_table *ts_table = NULL;
|
||||||
|
|
||||||
if (!boot_cpu())
|
if (!timestamp_should_run())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ts_table = car_get_var(ts_table_p);
|
ts_table = car_get_var(ts_table_p);
|
||||||
|
@ -121,7 +135,7 @@ static void timestamp_do_sync(void)
|
||||||
|
|
||||||
void timestamp_init(uint64_t base)
|
void timestamp_init(uint64_t base)
|
||||||
{
|
{
|
||||||
if (!boot_cpu())
|
if (!timestamp_should_run())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef __PRE_RAM__
|
#ifdef __PRE_RAM__
|
||||||
|
@ -145,7 +159,7 @@ void timestamp_init(uint64_t base)
|
||||||
|
|
||||||
void timestamp_reinit(void)
|
void timestamp_reinit(void)
|
||||||
{
|
{
|
||||||
if (!boot_cpu())
|
if (!timestamp_should_run())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef __PRE_RAM__
|
#ifdef __PRE_RAM__
|
||||||
|
|
Loading…
Reference in New Issue