Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47699 )
Change subject: lib/bootblock.c: Work around invalid timestamp argument ......................................................................
lib/bootblock.c: Work around invalid timestamp argument
FSP-T does not respect its own spec and uses registers where coreboot has its initial timestamp stored.
Change-Id: I8515195f50fef5f5e26a542bbef7501ba4c9f768 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/lib/bootblock.c 1 file changed, 9 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/99/47699/1
diff --git a/src/lib/bootblock.c b/src/lib/bootblock.c index 1509c8c..e894e23 100644 --- a/src/lib/bootblock.c +++ b/src/lib/bootblock.c @@ -26,11 +26,16 @@ void bootblock_main_with_timestamp(uint64_t base_timestamp, struct timestamp_entry *timestamps, size_t num_timestamps) { + const uint64_t bootblock_main_timestamp = timestamp_get(); /* Initialize timestamps if we have TIMESTAMP region in memlayout.ld. */ if (CONFIG(COLLECT_TIMESTAMPS) && REGION_SIZE(timestamp) > 0) { int i; - timestamp_init(base_timestamp); + uint64_t initial_timestamp = base_timestamp; + /* Check function argument sanity */ + if (bootblock_main_timestamp < base_timestamp) + initial_timestamp = bootblock_main_timestamp; + timestamp_init(initial_timestamp); for (i = 0; i < num_timestamps; i++) timestamp_add(timestamps[i].entry_id, timestamps[i].entry_stamp); @@ -52,6 +57,9 @@ exception_init(); }
+ if (bootblock_main_timestamp < base_timestamp) + printk(BIOS_NOTICE, "%s: invalid base_timestamp argument\n", __func__); + bootblock_soc_init(); bootblock_mainboard_init();