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