public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: evan.lloyd@arm.com
To: edk2-devel@lists.01.org
Cc: "ard.biesheuvel@linaro.org"@arm.com,
	"leif.lindholm@linaro.org"@arm.com,
	"Arvind.Chauhan@arm.com"@arm.com,
	"Daniil.Egranov@arm.com"@arm.com,
	"thomas.abraham@arm.com"@arm.com, "nd@arm.com"@arm.com
Subject: [PATCH 1/2] ArmPlatformPkg: Store initial timer value
Date: Fri, 22 Sep 2017 17:18:06 +0100	[thread overview]
Message-ID: <20170922161807.11756-2-evan.lloyd@arm.com> (raw)
In-Reply-To: <20170922161807.11756-1-evan.lloyd@arm.com>

From: Alexei Fedorov <Alexei.Fedorov@arm.com>

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).

Change-Id: Ic93bd3e509053e818187bcc153de493050e794aa
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Alexei Fedorov <Alxei.Fedorov@arm.com>
---
 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 4ce4a52784726a89fd09228fcd52aa1e6f87c85f..636049d4f44d29092bc9748caa99371d6538c554 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.<BR>
-#  Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -68,6 +68,7 @@ [Ppis]
 
 [Guids]
   gArmMpCoreInfoGuid
+  gEfiFirmwarePerformanceGuid
 
 [FeaturePcd]
   gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
diff --git a/ArmPlatformPkg/PrePi/PeiUniCore.inf b/ArmPlatformPkg/PrePi/PeiUniCore.inf
index 85114af7d1a8c37ea941a0714de697dc2bef754d..f37ddec9d13dad75882a186816b5ecb8856c7c86 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.<BR>
-#  Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>
+#  Copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>
 #
 #  This program and the accompanying materials
 #  are licensed and made available under the terms and conditions of the BSD License
@@ -67,6 +67,7 @@ [Ppis]
 
 [Guids]
   gArmMpCoreInfoGuid
+  gEfiFirmwarePerformanceGuid
 
 [FeaturePcd]
   gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index e548ccace09730b78851b987d7b902a5bb7a84c5..e5016ea45359f74e7688adb2504784070dde0dce 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 ());
 
-- 
Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")



  reply	other threads:[~2017-09-22 16:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22 16:18 [PATCH 0/2] Add FPDT Acpi table evan.lloyd
2017-09-22 16:18 ` evan.lloyd [this message]
2017-09-22 16:18 ` [PATCH 2/2] [edk2-platforms] ARM/JunoPkg: Add support for FPDT table evan.lloyd
2017-10-09 10:27 ` [PATCH 0/2] Add FPDT Acpi table Graeme Gregory
2017-10-09 11:22 ` Leif Lindholm
2017-10-10 16:11   ` Evan Lloyd
2017-10-10 16:33     ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170922161807.11756-2-evan.lloyd@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox