[coreboot-gerrit] New patch to review for coreboot: c7e61a9 timestamps: Fix some lost timestamps for romstage

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sun Oct 13 14:48:59 CEST 2013


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3967

-gerrit

commit c7e61a999b81d8214a6ff2a04d568f420102d990
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sun Oct 13 13:27:56 2013 +0300

    timestamps: Fix some lost timestamps for romstage
    
    Timestamps from cbfs_and_run, TS_START_COPYRAM and TS_END_COPYRAM,
    were lost with commit b766b1c7.
    
    Reason is variable ts_table was referencing CAR storage after CAR
    is torn doesn. Add use of car_get_var() / car_set_var() so the
    references go to migrated storage in CBMEM.
    
    Change-Id: I5a942ad7fd59a04e3a5255f4a3636d37dcfc1591
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/lib/timestamp.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c
index 8942649..7af433b 100644
--- a/src/lib/timestamp.c
+++ b/src/lib/timestamp.c
@@ -27,7 +27,7 @@
 
 #define MAX_TIMESTAMPS 30
 
-static struct timestamp_table* ts_table CAR_GLOBAL = NULL;
+static struct timestamp_table* ts_table_p CAR_GLOBAL = NULL;
 static tsc_t ts_basetime CAR_GLOBAL = { .lo = 0, .hi =0 };
 
 static void timestamp_stash(enum timestamp_id id, tsc_t ts_time);
@@ -54,16 +54,18 @@ static void timestamp_real_init(tsc_t base)
 	tst->max_entries = MAX_TIMESTAMPS;
 	tst->num_entries = 0;
 
-	ts_table = tst;
+	car_set_var(ts_table_p, tst);
 }
 
 void timestamp_add(enum timestamp_id id, tsc_t ts_time)
 {
 	struct timestamp_entry *tse;
+	struct timestamp_table *ts_table = NULL;
 
 	if (!boot_cpu())
 		return;
 
+	ts_table = car_get_var(ts_table_p);
 	if (!ts_table) {
 		timestamp_stash(id, ts_time);
 		return;
@@ -123,14 +125,14 @@ void timestamp_init(tsc_t base)
 
 #ifdef __PRE_RAM__
 	/* Copy of basetime, it is too early for CBMEM. */
-	ts_basetime = base;
+	car_set_var(ts_basetime, base);
 #else
 	struct timestamp_table* tst;
 
 	/* Locate and use an already existing table. */
 	tst = cbmem_find(CBMEM_ID_TIMESTAMP);
 	if (tst) {
-		ts_table = tst;
+		ts_table_p = tst;
 		return;
 	}
 
@@ -146,12 +148,12 @@ void timestamp_reinit(void)
 		return;
 
 #ifdef __PRE_RAM__
-	timestamp_real_init(ts_basetime);
+	timestamp_real_init(car_get_var(ts_basetime));
 #else
-	if (!ts_table)
+	if (!ts_table_p)
 		timestamp_init(ts_basetime);
 #endif
-	if (ts_table)
+	if (car_get_var(ts_table_p))
 		timestamp_do_sync();
 }
 



More information about the coreboot-gerrit mailing list