timestamps: Improve collection for ENV_ROMSTAGE_OR_BEFORE

Keep track of the active timestamp table location using
a CAR_GLOBAL variable. Done this way, the entire table
can be located outside _car_relocatable_data and we only
switch the pointer to CBMEM and copy the data before
CAR gets torn down.

Fix comments about requirements of timestamp_init() usage.

Remove timestamp_cache from postcar and ramstage, as CBMEM
is available early on.

Change-Id: I87370f62db23318069b6fd56ba0d1171d619cb8a
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35032
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Kyösti Mälkki
2019-08-22 15:06:50 +03:00
parent 98e338ee86
commit 3dd23a5e72
4 changed files with 47 additions and 72 deletions

View File

@@ -21,12 +21,10 @@
#if CONFIG(COLLECT_TIMESTAMPS)
/*
* timestamp_init() needs to be called once for each of these cases:
* 1. __PRE_RAM__ (bootblock, romstage, verstage, etc) and
* 2. !__PRE_RAM__ (ramstage)
* The latter is taken care of by the generic coreboot infrastructure so
* it's up to the chipset/arch to call timestamp_init() in *one* of
* the __PRE_RAM__ stages. If multiple calls are made timestamps will be lost.
* timestamp_init() needs to be called once in *one* of the ENV_ROMSTAGE_OR_BEFORE
* stages (bootblock, romstage, verstage, etc). It's up to the chipset/arch
* to make the call in the earliest stage, otherwise some timestamps will be lost.
* For x86 ENV_ROMSTAGE call must be made before CAR is torn down.
*/
void timestamp_init(uint64_t base);
/*