]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg: Store initial timer value
authorAlexei Fedorov <Alexei.Fedorov@arm.com>
Thu, 8 Jun 2017 14:40:09 +0000 (15:40 +0100)
committerLeif Lindholm <leif.lindholm@linaro.org>
Tue, 10 Oct 2017 16:30:39 +0000 (17:30 +0100)
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>
ArmPlatformPkg/PrePi/PeiMPCore.inf
ArmPlatformPkg/PrePi/PeiUniCore.inf
ArmPlatformPkg/PrePi/PrePi.c

index 4ce4a52784726a89fd09228fcd52aa1e6f87c85f..636049d4f44d29092bc9748caa99371d6538c554 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 #\r
 #  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-#  Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>\r
+#  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -68,6 +68,7 @@
 \r
 [Guids]\r
   gArmMpCoreInfoGuid\r
+  gEfiFirmwarePerformanceGuid\r
 \r
 [FeaturePcd]\r
   gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob\r
index 85114af7d1a8c37ea941a0714de697dc2bef754d..f37ddec9d13dad75882a186816b5ecb8856c7c86 100644 (file)
@@ -1,7 +1,7 @@
 #/** @file\r
 #\r
 #  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
-#  Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>\r
+#  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -67,6 +67,7 @@
 \r
 [Guids]\r
   gArmMpCoreInfoGuid\r
+  gEfiFirmwarePerformanceGuid\r
 \r
 [FeaturePcd]\r
   gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob\r
index e548ccace09730b78851b987d7b902a5bb7a84c5..e5016ea45359f74e7688adb2504784070dde0dce 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 *\r
-*  Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+*  Copyright (c) 2011-2017, ARM Limited. All rights reserved.\r
 *\r
 *  This program and the accompanying materials\r
 *  are licensed and made available under the terms and conditions of the BSD License\r
@@ -24,6 +24,7 @@
 \r
 #include <Ppi/GuidedSectionExtraction.h>\r
 #include <Ppi/ArmMpCoreInfo.h>\r
+#include <Ppi/SecPerformance.h>\r
 #include <Guid/LzmaDecompress.h>\r
 \r
 #include "PrePi.h"\r
@@ -86,6 +87,7 @@ PrePiMain (
   CHAR8                         Buffer[100];\r
   UINTN                         CharCount;\r
   UINTN                         StacksSize;\r
+  FIRMWARE_SEC_PERFORMANCE      Performance;\r
 \r
   // If ensure the FD is either part of the System Memory or totally outside of the System Memory (XIP)\r
   ASSERT (IS_XIP() ||\r
@@ -146,6 +148,12 @@ PrePiMain (
     }\r
   }\r
 \r
+  // Store timer value logged at the beginning of firmware image execution\r
+  Performance.ResetEnd = GetTimeInNanoSecond (StartTimeStamp);\r
+\r
+  // Build SEC Performance Data Hob\r
+  BuildGuidDataHob (&gEfiFirmwarePerformanceGuid, &Performance, sizeof (Performance));\r
+\r
   // Set the Boot Mode\r
   SetBootMode (ArmPlatformGetBootMode ());\r
 \r