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>
This commit is contained in:
Alexei Fedorov 2017-06-08 15:40:09 +01:00 committed by Leif Lindholm
parent 234dbceff1
commit a63be426f8
3 changed files with 13 additions and 3 deletions

View File

@ -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 @@
[Guids]
gArmMpCoreInfoGuid
gEfiFirmwarePerformanceGuid
[FeaturePcd]
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob

View File

@ -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 @@
[Guids]
gArmMpCoreInfoGuid
gEfiFirmwarePerformanceGuid
[FeaturePcd]
gEmbeddedTokenSpaceGuid.PcdPrePiProduceMemoryTypeInformationHob

View File

@ -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 ());