Patrick Georgi (pgeorgi@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13139
-gerrit
commit cf4c7b9672444af44aa91b5ac1a540eafba73cdc Author: Julius Werner jwerner@chromium.org Date: Wed Jan 20 18:01:15 2016 -0800
chromeos: Add timestamps to measure VPD read times
This patch adds three timestamps to coreboot and the cbmem utility that track the time required to read in the Chrome OS Vital Product Data (VPD) blocks (RO and RW). It's useful to account for these like all other large flash accesses, since their size is variable.
BRANCH=None BUG=None TEST=Booted Oak, found my weird 100ms gap at the start of ramstage properly accounted for.
Change-Id: I2024ed4f7d5e5ae81df9ab5293547cb5a10ff5e0 Signed-off-by: Patrick Georgi pgeorgi@chromium.org Original-Commit-Id: b97288b5ac67ada56e2ee7b181b28341d54b7234 Original-Change-Id: Ie69c1a4ddb6bd3f1094b3880201d53f1b5373aef Original-Signed-off-by: Julius Werner jwerner@chromium.org Original-Reviewed-on: https://chromium-review.googlesource.com/322831 Original-Reviewed-by: David Hendricks dhendrix@chromium.org --- src/commonlib/include/commonlib/timestamp_serialized.h | 3 +++ src/vendorcode/google/chromeos/cros_vpd.c | 5 +++++ util/cbmem/cbmem.c | 4 ++++ 3 files changed, 12 insertions(+)
diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h index f7c91c7..6ce0879 100644 --- a/src/commonlib/include/commonlib/timestamp_serialized.h +++ b/src/commonlib/include/commonlib/timestamp_serialized.h @@ -69,6 +69,9 @@ enum timestamp_id { TS_DONE_LOADING = 508, TS_DONE_HASHING = 509, TS_END_HASH_BODY = 510, + TS_START_COPYVPD = 550, + TS_END_COPYVPD_RO = 551, + TS_END_COPYVPD_RW = 552,
/* 950+ reserved for vendorcode extensions (950-999: intel/fsp) */ TS_FSP_MEMORY_INIT_START = 950, diff --git a/src/vendorcode/google/chromeos/cros_vpd.c b/src/vendorcode/google/chromeos/cros_vpd.c index 8215454..e826d36 100644 --- a/src/vendorcode/google/chromeos/cros_vpd.c +++ b/src/vendorcode/google/chromeos/cros_vpd.c @@ -10,6 +10,7 @@ #include <fmap.h> #include <stdlib.h> #include <string.h> +#include <timestamp.h>
#include "cros_vpd.h" #include "lib_vpd.h" @@ -83,6 +84,8 @@ static void cbmem_add_cros_vpd(int is_recovery) int32_t ro_vpd_base = 0, rw_vpd_base = 0; int32_t ro_vpd_size, rw_vpd_size;
+ timestamp_add_now(TS_START_COPYVPD); + ro_vpd_size = get_vpd_size("RO_VPD", &ro_vpd_base); rw_vpd_size = get_vpd_size("RW_VPD", &rw_vpd_base);
@@ -123,6 +126,7 @@ static void cbmem_add_cros_vpd(int is_recovery) __func__); ro_vpd_size = 0; } + timestamp_add_now(TS_END_COPYVPD_RO); }
if (rw_vpd_size) { @@ -143,6 +147,7 @@ static void cbmem_add_cros_vpd(int is_recovery) "%s: Reading RW_VPD FMAP section failed.\n", __func__); } + timestamp_add_now(TS_END_COPYVPD_RW); } }
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index f63c9d4..f58fcf7 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -520,6 +520,10 @@ static const struct timestamp_id_to_name { { TS_DONE_HASHING, "finished calculating body hash (SHA2)" }, { TS_END_HASH_BODY, "finished verifying body signature (RSA)" },
+ { TS_START_COPYVPD, "starting to load Chrome OS VPD" }, + { TS_END_COPYVPD_RO, "finished loading Chrome OS VPD (RO)" }, + { TS_END_COPYVPD_RW, "finished loading Chrome OS VPD (RW)" }, + { TS_DC_START, "depthcharge start" }, { TS_RO_PARAMS_INIT, "RO parameter init" }, { TS_RO_VB_INIT, "RO vboot init" },