timestamp: Fix collection without EARLY_CBMEM_INIT

With LATE_CBMEM_INIT, do not search for the initial collection from
CBMEM in ramstage. On S3 resume this would find the non-empty
collection from previous run of ramstage. Start with an empty table
instead.

Remove a spurious error message as the stamps get stashed and
will be copied to CBMEM later.

Change-Id: Ib94049531c0ac23af25407bd2ca7644ee0163d69
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/10300
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Kyösti Mälkki 2015-05-26 06:23:02 +03:00 committed by Aaron Durbin
parent e1fb052ed7
commit e03441753c
1 changed files with 5 additions and 5 deletions

View File

@ -42,10 +42,8 @@ static void timestamp_real_init(uint64_t base)
sizeof(struct timestamp_table) +
MAX_TIMESTAMPS * sizeof(struct timestamp_entry));
if (!tst) {
printk(BIOS_ERR, "ERROR: failed to allocate timestamp table\n");
if (!tst)
return;
}
tst->base_time = base;
tst->max_entries = MAX_TIMESTAMPS;
@ -142,10 +140,12 @@ void timestamp_init(uint64_t base)
/* Copy of basetime, it is too early for CBMEM. */
car_set_var(ts_basetime, base);
#else
struct timestamp_table* tst;
struct timestamp_table *tst = NULL;
/* Locate and use an already existing table. */
if (!IS_ENABLED(CONFIG_LATE_CBMEM_INIT))
tst = cbmem_find(CBMEM_ID_TIMESTAMP);
if (tst) {
car_set_var(ts_table_p, tst);
return;