blob: 8a92a03e561df51bf63e45aaa6d9feae5ec86995 [file] [log] [blame]
Bora Guvendik94050492023-03-12 12:24:58 -07001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <console/console.h>
4#include <intelblocks/cse.h>
5#include <timestamp.h>
6
7void soc_cbmem_inject_telemetry_data(s64 *ts, s64 current_time)
8{
9 s64 start_stamp;
10
11 if (!ts) {
12 printk(BIOS_ERR, "%s: Failed to insert CSME timestamps\n", __func__);
13 return;
14 }
15
16 start_stamp = current_time - ts[PERF_DATA_CSME_GET_PERF_RESPONSE];
17
18 timestamp_add(TS_ME_ROM_START, start_stamp);
19 timestamp_add(TS_ME_BOOT_STALL_END,
20 start_stamp + ts[PERF_DATA_CSME_RBE_BOOT_STALL_DONE_TO_PMC]);
21 timestamp_add(TS_ME_ICC_CONFIG_START,
22 start_stamp + ts[PERF_DATA_CSME_POLL_FOR_PMC_PPS_START]);
23 timestamp_add(TS_ME_HOST_BOOT_PREP_END,
24 start_stamp + ts[PERF_DATA_CSME_HOST_BOOT_PREP_DONE]);
25 timestamp_add(TS_ME_RECEIVED_CRDA_FROM_PMC,
26 start_stamp + ts[PERF_DATA_PMC_SENT_CRDA]);
27}