feat(plat/fvp): pass Event Log addr and size from BL1 to BL2

Introduced functions to set and get Event log information
(tpm_event_log address and its size).

In FVP platform case, measured boot with Event Log backend flow
work as below
1. event_log_init function called by BL1 to initialize Event Log
   module
2. arm_set_tb_fw_info function called by BL1 to set the
   'tpm_event_log_addr' and 'tpm_event_log_size' properties
   in tb_fw_config
3. arm_get_tb_fw_info function called by BL2 to get tpm Event Log
   parameters set by BL1. These parameters used by the BL2 to
   extend the tpm Event Log records, and use these parameters
   to initialize Event Log using event_log_init function
4. arm_set_nt_fw_info and arm_set_tos_fw_info function called by
   BL2 to set 'tpm_event_log' address and its size properties in
   nt_fw_config and tos_fw_config respectively

Alongside, this patch created a separate instances of plat_mboot_init
and plat_mboot_finish APIs for BL1 and BL2.

This patch is tested using the existing measured boot test configuration
in jenkins CI.

Change-Id: Ib9eca092afe580df014541c937868f921dff9c37
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
diff --git a/plat/arm/board/fvp/fvp_bl1_measured_boot.c b/plat/arm/board/fvp/fvp_bl1_measured_boot.c
index 15ea059..8815b74 100644
--- a/plat/arm/board/fvp/fvp_bl1_measured_boot.c
+++ b/plat/arm/board/fvp/fvp_bl1_measured_boot.c
@@ -7,6 +7,7 @@
 #include <stdint.h>
 
 #include <drivers/measured_boot/event_log/event_log.h>
+#include <plat/arm/common/plat_arm.h>
 
 /* Event Log data */
 static uint8_t event_log[PLAT_ARM_EVENT_LOG_MAX_SIZE];
@@ -21,13 +22,23 @@
 
 void bl1_plat_mboot_init(void)
 {
-	event_log_init(event_log, PLAT_ARM_EVENT_LOG_MAX_SIZE, 0U);
+	event_log_init(event_log, event_log + sizeof(event_log));
+	event_log_write_header();
 }
 
 void bl1_plat_mboot_finish(void)
 {
-	/*
-	 * ToDo: populate tb_fw_config with Event Log address, its maximum size
-	 * and filled size
-	 */
+	size_t event_log_cur_size;
+
+	event_log_cur_size = event_log_get_cur_size(event_log);
+	int rc = arm_set_tb_fw_info((uintptr_t)event_log,
+				    event_log_cur_size);
+	if (rc != 0) {
+		/*
+		 * It is a fatal error because on FVP platform, BL2 software
+		 * assumes that a valid Event Log buffer exist and it will use
+		 * same Event Log buffer to append image measurements.
+		 */
+		panic();
+	}
 }