2019-02-05 16:25:19 +00:00
|
|
|
#/** @file
|
|
|
|
|
#
|
|
|
|
|
# Reset System lib using PSCI hypervisor or secure monitor calls.
|
|
|
|
|
# Signals the gRaspberryPiEventResetGuid event group on reset.
|
|
|
|
|
#
|
|
|
|
|
# Copyright (c) 2018, Andrei Warkentin <andrey.warkentin@gmail.com>
|
|
|
|
|
# Copyright (c) 2014, Linaro Ltd. All rights reserved.
|
|
|
|
|
# Copyright (c) 2014, ARM Ltd. All rights reserved.
|
|
|
|
|
# Copyright (c) 2008, Apple Inc. All rights reserved.
|
|
|
|
|
#
|
2019-05-15 15:48:37 -07:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2019-02-05 16:25:19 +00:00
|
|
|
#
|
|
|
|
|
#**/
|
|
|
|
|
|
|
|
|
|
[Defines]
|
|
|
|
|
INF_VERSION = 0x0001001A
|
|
|
|
|
BASE_NAME = ResetLib
|
|
|
|
|
FILE_GUID = B9F59B69-A105-41C7-8F5A-2C60DD7FD7AB
|
|
|
|
|
MODULE_TYPE = BASE
|
|
|
|
|
VERSION_STRING = 1.0
|
|
|
|
|
LIBRARY_CLASS = EfiResetSystemLib
|
|
|
|
|
|
|
|
|
|
[Sources]
|
|
|
|
|
ResetLib.c
|
|
|
|
|
|
|
|
|
|
[Packages]
|
|
|
|
|
ArmPkg/ArmPkg.dec
|
|
|
|
|
MdePkg/MdePkg.dec
|
|
|
|
|
EmbeddedPkg/EmbeddedPkg.dec
|
2019-10-21 12:25:06 +01:00
|
|
|
Platform/RaspberryPi/RaspberryPi.dec
|
2019-02-05 16:25:19 +00:00
|
|
|
|
|
|
|
|
[LibraryClasses]
|
|
|
|
|
DebugLib
|
|
|
|
|
BaseLib
|
|
|
|
|
ArmSmcLib
|
Platform/RaspberryPi: Add system/user defined reset delay
Due to the method in which NV variables are stored on removable media
for the Raspberry Pi platform, and the manner in which we dump updated
variables right before reset, it is possible, and has been repeatedly
demonstrated with SSD-based USB 3.0 devices, that the updated file does
not actually end up being written to permanent storage, due to the
device write-cache not having enough time to be flushed before reset.
To compensate for this, since we don't know of a generic method that
would allow turning off USB mass storage devices write cache (and also
because we are seeing an issue that seems related for SD-based media),
we add a new reset delay PCD, which can be set by the user, and which
we also set as required when NV variables are being dumped.
Our testing show that, with more than 3 seconds of extra delay, the
storage media has enough time to finalize its internal write, thus
solving the issue of configuration changes not being persisted.
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
Tested-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
2020-12-22 13:45:28 +00:00
|
|
|
PcdLib
|
|
|
|
|
TimerLib
|
2019-02-05 16:25:19 +00:00
|
|
|
UefiLib
|
|
|
|
|
UefiRuntimeLib
|
|
|
|
|
|
|
|
|
|
[Guids]
|
|
|
|
|
gRaspberryPiEventResetGuid
|
Platform/RaspberryPi: Add system/user defined reset delay
Due to the method in which NV variables are stored on removable media
for the Raspberry Pi platform, and the manner in which we dump updated
variables right before reset, it is possible, and has been repeatedly
demonstrated with SSD-based USB 3.0 devices, that the updated file does
not actually end up being written to permanent storage, due to the
device write-cache not having enough time to be flushed before reset.
To compensate for this, since we don't know of a generic method that
would allow turning off USB mass storage devices write cache (and also
because we are seeing an issue that seems related for SD-based media),
we add a new reset delay PCD, which can be set by the user, and which
we also set as required when NV variables are being dumped.
Our testing show that, with more than 3 seconds of extra delay, the
storage media has enough time to finalize its internal write, thus
solving the issue of configuration changes not being persisted.
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
Tested-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
2020-12-22 13:45:28 +00:00
|
|
|
|
|
|
|
|
[Pcd]
|
|
|
|
|
gRaspberryPiTokenSpaceGuid.PcdPlatformResetDelay ## CONSUMES
|