From a63be426f8e327181dda369348eae2768439536b Mon Sep 17 00:00:00 2001 From: Alexei Fedorov Date: Thu, 8 Jun 2017 15:40:09 +0100 Subject: [PATCH] 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 Signed-off-by: Evan Lloyd Reviewed-by: Graeme Gregory Reviewed-by: Leif Lindholm --- ArmPlatformPkg/PrePi/PeiMPCore.inf | 3 ++- ArmPlatformPkg/PrePi/PeiUniCore.inf | 3 ++- ArmPlatformPkg/PrePi/PrePi.c | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ArmPlatformPkg/PrePi/PeiMPCore.inf b/ArmPlatformPkg/PrePi/PeiMPCore.inf index 4ce4a52784..636049d4f4 100644 --- a/ArmPlatformPkg/PrePi/PeiMPCore.inf +++ b/ArmPlatformPkg/PrePi/PeiMPCore.inf @@ -1,7 +1,7 @@ #/** @file # # (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
-# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.
+# Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -68,6 +68,7 @@ [Guids] gArmMpCoreInfoGuid + gEfiFirmwarePerformanceGuid [FeaturePcd] gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob diff --git a/ArmPlatformPkg/PrePi/PeiUniCore.inf b/ArmPlatformPkg/PrePi/PeiUniCore.inf index 85114af7d1..f37ddec9d1 100644 --- a/ArmPlatformPkg/PrePi/PeiUniCore.inf +++ b/ArmPlatformPkg/PrePi/PeiUniCore.inf @@ -1,7 +1,7 @@ #/** @file # # (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
-# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.
+# Copyright (c) 2011-2017, ARM Ltd. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -67,6 +67,7 @@ [Guids] gArmMpCoreInfoGuid + gEfiFirmwarePerformanceGuid [FeaturePcd] gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob 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 #include +#include #include #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 ());