diff options
author | Julius Werner <jwerner@chromium.org> | 2014-12-02 20:51:19 -0800 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-04-14 09:03:40 +0200 |
commit | a7d924412a4300e91b3bd6eb3581b954b02f8d37 (patch) | |
tree | 0d9ee617776b8b24a47a980562aecaf0f5159a0a /src/vendorcode/google/chromeos/vboot2/verstub.c | |
parent | b5995b5872803838e7f3e03d3fb4f64a290d978f (diff) |
timestamps: You can never have enough of them!
Now that we have timestamps in pre-RAM stages, let's actually make use
of them. This patch adds several timestamps to both the bootblock and
especially the verstage to allow more fine-grained boot time tracking.
Some of the introduced timestamps can appear more than once per boot.
This doesn't seem to be a problem for both coreboot and the cbmem
utility, and the context makes it clear which operation was timestamped
at what point.
Also simplifies cbmem's timestamp printing routine a bit, fixing a
display bug when a timestamp had a section of exactly ",000," in it
(e.g. 1,000,185).
BRANCH=None
BUG=None
TEST=Booted Pinky, Blaze and Falco, confirmed that all timestamps show
up and contained sane values. Booted Storm (no timestamps here since it
doesn't support pre-RAM timestamps yet).
Change-Id: I7f4d6aba3ebe3db0d003c7bcb2954431b74961b3
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 7a2ce81722aba85beefcc6c81f9908422b8da8fa
Original-Change-Id: I5979bfa9445a9e0aba98ffdf8006c21096743456
Original-Signed-off-by: Julius Werner <jwerner@chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/234063
Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: http://review.coreboot.org/9608
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/vendorcode/google/chromeos/vboot2/verstub.c')
-rw-r--r-- | src/vendorcode/google/chromeos/vboot2/verstub.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/vendorcode/google/chromeos/vboot2/verstub.c b/src/vendorcode/google/chromeos/vboot2/verstub.c index 8f2e9b2d49..323468333c 100644 --- a/src/vendorcode/google/chromeos/vboot2/verstub.c +++ b/src/vendorcode/google/chromeos/vboot2/verstub.c @@ -21,6 +21,7 @@ #include <cbfs.h> #include <console/console.h> #include <string.h> +#include <timestamp.h> #include "../chromeos.h" #include "misc.h" #include "symbols.h" @@ -58,20 +59,22 @@ void vboot2_verify_firmware(void) wd = init_vb2_working_data(); -#if CONFIG_RETURN_FROM_VERSTAGE - /* load verstage from RO */ - entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, - CONFIG_CBFS_PREFIX "/verstage"); - if (entry == (void *)-1) - die("failed to load verstage"); + if (IS_ENABLED(CONFIG_RETURN_FROM_VERSTAGE)) { + /* load verstage from RO */ + entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, + CONFIG_CBFS_PREFIX "/verstage"); + if (entry == (void *)-1) + die("failed to load verstage"); - /* verify and select a slot */ - stage_exit(entry); -#else - verstage_main(); -#endif /* CONFIG_RETURN_FROM_VERSTAGE */ + timestamp_add_now(TS_END_COPYVER); + /* verify and select a slot */ + stage_exit(entry); + } else { + verstage_main(); + } /* jump to the selected slot */ + timestamp_add_now(TS_START_COPYROM); entry = NULL; if (vboot_is_slot_selected(wd)) { /* RW A or B */ @@ -88,6 +91,7 @@ void vboot2_verify_firmware(void) entry = cbfs_load_stage(CBFS_DEFAULT_MEDIA, CONFIG_CBFS_PREFIX "/romstage"); } + timestamp_add_now(TS_END_COPYROM); if (entry != NULL && entry != (void *)-1) stage_exit(entry); |