summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/PrePi/PrePi.c
diff options
context:
space:
mode:
authorAlexei Fedorov <Alexei.Fedorov@arm.com>2017-06-08 15:40:09 +0100
committerLeif Lindholm <leif.lindholm@linaro.org>2017-10-10 17:30:39 +0100
commita63be426f8e327181dda369348eae2768439536b (patch)
tree808d125b9335e9699af30f80d46dd324f828126a /ArmPlatformPkg/PrePi/PrePi.c
parent234dbceff130e105aecd7e15227a8b03b0b96182 (diff)
downloadedk2-a63be426f8e327181dda369348eae2768439536b.tar.gz
edk2-a63be426f8e327181dda369348eae2768439536b.tar.bz2
edk2-a63be426f8e327181dda369348eae2768439536b.zip
ArmPlatformPkg: Store initial timer value
This commit adds support for storing initial timer value logged at the beginning of firmware image execution. This timer value is required for firmware basic boot performance data record referenced by Firmware Performance Data Table (FPDT). Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'ArmPlatformPkg/PrePi/PrePi.c')
-rw-r--r--ArmPlatformPkg/PrePi/PrePi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index e548ccace0..e5016ea453 100644
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2017, ARM Limited. All rights reserved.
*
* This program and the accompanying materials
* are licensed and made available under the terms and conditions of the BSD License
@@ -24,6 +24,7 @@
#include <Ppi/GuidedSectionExtraction.h>
#include <Ppi/ArmMpCoreInfo.h>
+#include <Ppi/SecPerformance.h>
#include <Guid/LzmaDecompress.h>
#include "PrePi.h"
@@ -86,6 +87,7 @@ PrePiMain (
CHAR8 Buffer[100];
UINTN CharCount;
UINTN StacksSize;
+ FIRMWARE_SEC_PERFORMANCE Performance;
// If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)
ASSERT (IS_XIP() ||
@@ -146,6 +148,12 @@ PrePiMain (
}
}
+ // Store timer value logged at the beginning of firmware image execution
+ Performance.ResetEnd = GetTimeInNanoSecond (StartTimeStamp);
+
+ // Build SEC Performance Data Hob
+ BuildGuidDataHob (&gEfiFirmwarePerformanceGuid, &Performance, sizeof (Performance));
+
// Set the Boot Mode
SetBootMode (ArmPlatformGetBootMode ());