summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2019-09-12 12:58:50 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2019-09-13 19:47:58 +0000
commitb6b13c9f2943a0f61a92d87127551ea8dc39a829 (patch)
treea7f4c242ec7acfbe40f36e08daee35c8a61a34ee /src
parentb2536f418fafc0839e4666e72d70f386db9f58a7 (diff)
timestamps: Further simplify timestamp_reinit()
Allocation of new table always happens in romstage. Change-Id: I089a84b372893fb3018a796fb1e16cd58753bdf4 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35374 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r--src/lib/timestamp.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index db73f15a34..b647ca276c 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -265,21 +265,14 @@ static void timestamp_reinit(int is_recovery)
if (!timestamp_should_run())
return;
- /* cbmem is being recovered. */
- if (is_recovery) {
- /* x86 resume path expects timestamps to be reset. */
- if (CONFIG(ARCH_ROMSTAGE_X86_32) && ENV_ROMSTAGE)
- ts_cbmem_table = timestamp_alloc_cbmem_table();
- else {
- /* Find existing table in cbmem. */
- ts_cbmem_table = cbmem_find(CBMEM_ID_TIMESTAMP);
- /* No existing timestamp table. */
- if (ts_cbmem_table == NULL)
- ts_cbmem_table = timestamp_alloc_cbmem_table();
- }
- } else
- /* First time sync. Add new table. */
+ /* First time into romstage we make a clean new table. For platforms that travel
+ through this path on resume, ARCH_X86 S3, timestamps are also reset. */
+ if (ENV_ROMSTAGE) {
ts_cbmem_table = timestamp_alloc_cbmem_table();
+ } else {
+ /* Find existing table in cbmem. */
+ ts_cbmem_table = cbmem_find(CBMEM_ID_TIMESTAMP);
+ }
if (ts_cbmem_table == NULL) {
printk(BIOS_ERR, "ERROR: No timestamp table allocated\n");