blob: 47af1f554b2e79276c6d670c0a7a1beead1d203b [file] [log] [blame]
Manish V Badarkhea74d9632021-09-14 23:12:42 +01001/*
2 * Copyright (c) 2021, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <stdint.h>
8
9#include <drivers/measured_boot/event_log/event_log.h>
Manish V Badarkhe4edf4bd2021-08-11 10:45:03 +010010#include <plat/arm/common/plat_arm.h>
Manish V Badarkhea74d9632021-09-14 23:12:42 +010011
12/* Event Log data */
13static uint8_t event_log[PLAT_ARM_EVENT_LOG_MAX_SIZE];
14
15/* FVP table with platform specific image IDs, names and PCRs */
16const event_log_metadata_t fvp_event_log_metadata[] = {
Manish V Badarkhe72e03692021-09-08 20:04:24 +010017 { FW_CONFIG_ID, EVLOG_FW_CONFIG_STRING, PCR_0 },
18 { TB_FW_CONFIG_ID, EVLOG_TB_FW_CONFIG_STRING, PCR_0 },
19 { BL2_IMAGE_ID, EVLOG_BL2_STRING, PCR_0 },
Manish V Badarkhea74d9632021-09-14 23:12:42 +010020 { INVALID_ID, NULL, (unsigned int)(-1) } /* Terminator */
21};
22
23void bl1_plat_mboot_init(void)
24{
Manish V Badarkhe4edf4bd2021-08-11 10:45:03 +010025 event_log_init(event_log, event_log + sizeof(event_log));
26 event_log_write_header();
Manish V Badarkhea74d9632021-09-14 23:12:42 +010027}
28
29void bl1_plat_mboot_finish(void)
30{
Manish V Badarkhe4edf4bd2021-08-11 10:45:03 +010031 size_t event_log_cur_size;
32
33 event_log_cur_size = event_log_get_cur_size(event_log);
34 int rc = arm_set_tb_fw_info((uintptr_t)event_log,
35 event_log_cur_size);
36 if (rc != 0) {
37 /*
38 * It is a fatal error because on FVP platform, BL2 software
39 * assumes that a valid Event Log buffer exist and it will use
40 * same Event Log buffer to append image measurements.
41 */
42 panic();
43 }
Manish V Badarkhea74d9632021-09-14 23:12:42 +010044}