diff options
author | Bora Guvendik <bora.guvendik@intel.com> | 2021-11-05 23:09:25 -0700 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-01-21 22:41:57 +0000 |
commit | f33c9bf79a8ee80067920d7dd0ec15360b42703b (patch) | |
tree | 1ef56ae74cfc7dba6e93eb92682a469b6ff3e232 /src/soc/intel/common/block/cse | |
parent | 03b1d3ef48f20cc80d2fab1f4da9f5b90e6a0ffe (diff) |
soc/intel/common/cse: Add support to get CSME timestamps
This command retrieves a set of boot performance timestamps
CSME collected during the platform's last boot flow.
BUG=b:182575295
TEST=Verify CSME timestamps after S3 and boot.
Signed-off-by: Bora Guvendik <bora.guvendik@intel.com>
Change-Id: Ic6f7962c49b38d458680d51ee1cd709805f73b66
Reviewed-on: https://review.coreboot.org/c/coreboot/+/58993
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/soc/intel/common/block/cse')
-rw-r--r-- | src/soc/intel/common/block/cse/Makefile.inc | 1 | ||||
-rw-r--r-- | src/soc/intel/common/block/cse/cse_lite.c | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/cse/Makefile.inc b/src/soc/intel/common/block/cse/Makefile.inc index a0dc780cc3..3f4c4d62ab 100644 --- a/src/soc/intel/common/block/cse/Makefile.inc +++ b/src/soc/intel/common/block/cse/Makefile.inc @@ -2,6 +2,7 @@ bootblock-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += cse.c romstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += cse.c ramstage-$(CONFIG_SOC_INTEL_COMMON_BLOCK_CSE) += cse.c romstage-$(CONFIG_SOC_INTEL_CSE_LITE_SKU) += cse_lite.c +ramstage-$(CONFIG_SOC_INTEL_CSE_LITE_SKU) += cse_lite.c smm-$(CONFIG_SOC_INTEL_COMMON_BLOCK_HECI_DISABLE_IN_SMM) += disable_heci.c ramstage-$(CONFIG_SOC_INTEL_CSE_SET_EOP) += cse_eop.c diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 6edbd843a4..67dae1ca2b 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -127,6 +127,38 @@ struct get_bp_info_rsp { struct cse_bp_info bp_info; } __packed; + +bool cse_get_boot_performance_data(struct cse_boot_perf_rsp *boot_perf_rsp) +{ + struct cse_boot_perf_req { + struct mkhi_hdr hdr; + uint32_t reserved; + } __packed; + + struct cse_boot_perf_req req = { + .hdr.group_id = MKHI_GROUP_ID_BUP_COMMON, + .hdr.command = MKHI_BUP_COMMON_GET_BOOT_PERF_DATA, + .reserved = 0, + }; + + size_t resp_size = sizeof(struct cse_boot_perf_rsp); + + if (!heci_send_receive(&req, sizeof(req), boot_perf_rsp, &resp_size, + HECI_MKHI_ADDR)) { + printk(BIOS_ERR, "cse_lite: Could not get boot performance data\n"); + return false; + } + + if (boot_perf_rsp->hdr.result) { + printk(BIOS_ERR, "cse_lite: Get boot performance data resp failed: %d\n", + boot_perf_rsp->hdr.result); + return false; + } + + return true; +} + + static uint8_t cse_get_current_bp(const struct cse_bp_info *cse_bp_info) { return cse_bp_info->current_bp; |