diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2015-05-26 06:23:02 +0300 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2015-05-26 19:10:31 +0200 |
commit | e03441753ca775df4aacd0a15046d15001fed66e (patch) | |
tree | a1c7881b3eff79d6cc4c689eed44919394667cb3 /src | |
parent | e1fb052ed70b0471ece637f37db01bde6d4b9076 (diff) | |
download | coreboot-e03441753ca775df4aacd0a15046d15001fed66e.tar.xz |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/timestamp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c index 98ab243216..8c82649863 100644 --- a/src/lib/timestamp.c +++ b/src/lib/timestamp.c @@ -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. */ - tst = cbmem_find(CBMEM_ID_TIMESTAMP); + if (!IS_ENABLED(CONFIG_LATE_CBMEM_INIT)) + tst = cbmem_find(CBMEM_ID_TIMESTAMP); + if (tst) { car_set_var(ts_table_p, tst); return; |