From e03441753ca775df4aacd0a15046d15001fed66e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 26 May 2015 06:23:02 +0300 Subject: [PATCH] timestamp: Fix collection without EARLY_CBMEM_INIT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://review.coreboot.org/10300 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- src/lib/timestamp.c | 10 +++++----- 1 file 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;