702 lines
22 KiB
Diff
702 lines
22 KiB
Diff
From e1b8435ed33b43cb6e9ae23adc24e1ce57dd57af Mon Sep 17 00:00:00 2001
|
|
From: mattp <svidasultaresurge@gmail.com>
|
|
Date: Tue, 8 Jul 2025 14:24:04 -0400
|
|
Subject: [PATCH 22/29] Aug 28 edk2 needed
|
|
|
|
---
|
|
.../VarBlockServiceDxe/VarBlockServiceDxe.c | 65 +++++---
|
|
.../VarBlockServiceDxe/VarBlockServiceDxe.inf | 6 +-
|
|
.../MemoryInitPeiLib/MemoryInitPeiLib.c | 2 +
|
|
.../PlatformBootManagerLib/PlatformBm.c | 78 +++++++++
|
|
.../PlatformBootManagerLib.inf | 6 +
|
|
.../RaspberryPi/Library/ResetLib/ResetLib.c | 151 ------------------
|
|
.../RaspberryPi/Library/ResetLib/ResetLib.inf | 45 ------
|
|
.../PlatformLib/AArch64/RaspberryPiHelper.S | 27 ----
|
|
Platform/RaspberryPi/RPi5/RPi5.dsc | 23 +--
|
|
Platform/RaspberryPi/RPi5/RPi5.fdf | 4 +-
|
|
Platform/RaspberryPi/RaspberryPi.dec | 1 -
|
|
11 files changed, 152 insertions(+), 256 deletions(-)
|
|
delete mode 100644 Platform/RaspberryPi/Library/ResetLib/ResetLib.c
|
|
delete mode 100644 Platform/RaspberryPi/Library/ResetLib/ResetLib.inf
|
|
|
|
diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c
|
|
index 4071a3fc..bc8ab227 100644
|
|
--- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c
|
|
+++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c
|
|
@@ -10,6 +10,8 @@
|
|
|
|
#include "VarBlockService.h"
|
|
|
|
+#include <Protocol/ResetNotification.h>
|
|
+
|
|
//
|
|
// Minimum delay to enact before reset, when variables are dirty (in μs).
|
|
// Needed to ensure that SSD-based USB 3.0 devices have time to flush their
|
|
@@ -51,6 +53,8 @@ InstallProtocolInterfaces (
|
|
&FvbDevice->FwVolBlockInstance,
|
|
&gEfiDevicePathProtocolGuid,
|
|
FvbDevice->DevicePath,
|
|
+ &gEdkiiNvVarStoreFormattedGuid,
|
|
+ NULL,
|
|
NULL
|
|
);
|
|
ASSERT_EFI_ERROR (Status);
|
|
@@ -159,10 +163,8 @@ DoDump (
|
|
|
|
STATIC
|
|
VOID
|
|
-EFIAPI
|
|
DumpVars (
|
|
- IN EFI_EVENT Event,
|
|
- IN VOID *Context
|
|
+ VOID
|
|
)
|
|
{
|
|
EFI_STATUS Status;
|
|
@@ -200,6 +202,29 @@ DumpVars (
|
|
mFvInstance->Dirty = FALSE;
|
|
}
|
|
|
|
+STATIC
|
|
+VOID
|
|
+EFIAPI
|
|
+DumpVarsOnEvent (
|
|
+ IN EFI_EVENT Event,
|
|
+ IN VOID *Context
|
|
+ )
|
|
+{
|
|
+ DumpVars ();
|
|
+}
|
|
+
|
|
+STATIC
|
|
+VOID
|
|
+EFIAPI
|
|
+DumpVarsOnReset (
|
|
+ IN EFI_RESET_TYPE ResetType,
|
|
+ IN EFI_STATUS ResetStatus,
|
|
+ IN UINTN DataSize,
|
|
+ IN VOID *ResetData OPTIONAL
|
|
+ )
|
|
+{
|
|
+ DumpVars ();
|
|
+}
|
|
|
|
VOID
|
|
ReadyToBootHandler (
|
|
@@ -214,7 +239,7 @@ ReadyToBootHandler (
|
|
Status = gBS->CreateEvent (
|
|
EVT_NOTIFY_SIGNAL,
|
|
TPL_CALLBACK,
|
|
- DumpVars,
|
|
+ DumpVarsOnEvent,
|
|
NULL,
|
|
&ImageInstallEvent
|
|
);
|
|
@@ -227,7 +252,7 @@ ReadyToBootHandler (
|
|
);
|
|
ASSERT_EFI_ERROR (Status);
|
|
|
|
- DumpVars (NULL, NULL);
|
|
+ DumpVars ();
|
|
Status = gBS->CloseEvent (Event);
|
|
ASSERT_EFI_ERROR (Status);
|
|
}
|
|
@@ -238,19 +263,9 @@ InstallDumpVarEventHandlers (
|
|
VOID
|
|
)
|
|
{
|
|
- EFI_STATUS Status;
|
|
- EFI_EVENT ResetEvent;
|
|
- EFI_EVENT ReadyToBootEvent;
|
|
-
|
|
- Status = gBS->CreateEventEx (
|
|
- EVT_NOTIFY_SIGNAL,
|
|
- TPL_CALLBACK,
|
|
- DumpVars,
|
|
- NULL,
|
|
- &gRaspberryPiEventResetGuid,
|
|
- &ResetEvent
|
|
- );
|
|
- ASSERT_EFI_ERROR (Status);
|
|
+ EFI_STATUS Status;
|
|
+ EFI_EVENT ReadyToBootEvent;
|
|
+ EFI_RESET_NOTIFICATION_PROTOCOL *ResetNotify;
|
|
|
|
Status = gBS->CreateEventEx (
|
|
EVT_NOTIFY_SIGNAL,
|
|
@@ -261,6 +276,20 @@ InstallDumpVarEventHandlers (
|
|
&ReadyToBootEvent
|
|
);
|
|
ASSERT_EFI_ERROR (Status);
|
|
+
|
|
+ Status = gBS->LocateProtocol (
|
|
+ &gEfiResetNotificationProtocolGuid,
|
|
+ NULL,
|
|
+ (VOID **)&ResetNotify
|
|
+ );
|
|
+ ASSERT_EFI_ERROR (Status);
|
|
+ if (!EFI_ERROR (Status)) {
|
|
+ Status = ResetNotify->RegisterResetNotify (
|
|
+ ResetNotify,
|
|
+ DumpVarsOnReset
|
|
+ );
|
|
+ ASSERT_EFI_ERROR (Status);
|
|
+ }
|
|
}
|
|
|
|
|
|
diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf
|
|
index c2edb25b..d15671af 100644
|
|
--- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf
|
|
+++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf
|
|
@@ -34,6 +34,7 @@
|
|
|
|
[Packages]
|
|
ArmPkg/ArmPkg.dec
|
|
+ EmbeddedPkg/EmbeddedPkg.dec
|
|
MdePkg/MdePkg.dec
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
Platform/RaspberryPi/RaspberryPi.dec
|
|
@@ -51,8 +52,8 @@
|
|
UefiRuntimeLib
|
|
|
|
[Guids]
|
|
+ gEdkiiNvVarStoreFormattedGuid ## PRODUCES ## PROTOCOL
|
|
gEfiEventVirtualAddressChangeGuid
|
|
- gRaspberryPiEventResetGuid
|
|
gEfiEventReadyToBootGuid
|
|
|
|
[Protocols]
|
|
@@ -61,6 +62,7 @@
|
|
gEfiBlockIoProtocolGuid
|
|
gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
|
gEfiDevicePathProtocolGuid # PROTOCOL SOMETIMES_PRODUCED
|
|
+ gEfiResetNotificationProtocolGuid
|
|
|
|
[FixedPcd]
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|
|
@@ -85,4 +87,4 @@
|
|
[FeaturePcd]
|
|
|
|
[Depex]
|
|
- TRUE
|
|
+ gEfiResetNotificationProtocolGuid
|
|
diff --git a/Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.c b/Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
|
|
index 7ba1cc56..cf9eca2f 100644
|
|
--- a/Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
|
|
+++ b/Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.c
|
|
@@ -51,6 +51,8 @@ AddBasicMemoryRegion (
|
|
EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE |
|
|
EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE |
|
|
EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |
|
|
+ EFI_RESOURCE_ATTRIBUTE_WRITE_PROTECTABLE |
|
|
+ EFI_RESOURCE_ATTRIBUTE_EXECUTION_PROTECTABLE |
|
|
EFI_RESOURCE_ATTRIBUTE_TESTED,
|
|
Desc->PhysicalBase,
|
|
Desc->Length
|
|
diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
|
|
index 1a0fcbf8..daa4e6ae 100644
|
|
--- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
|
|
+++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c
|
|
@@ -17,6 +17,7 @@
|
|
#include <Library/DevicePathLib.h>
|
|
#include <Library/HobLib.h>
|
|
#include <Library/PcdLib.h>
|
|
+#include <Library/TimerLib.h>
|
|
#include <Library/UefiBootManagerLib.h>
|
|
#include <Library/UefiLib.h>
|
|
#include <Library/PrintLib.h>
|
|
@@ -25,6 +26,7 @@
|
|
#include <Protocol/EsrtManagement.h>
|
|
#include <Protocol/GraphicsOutput.h>
|
|
#include <Protocol/LoadedImage.h>
|
|
+#include <Protocol/PlatformSpecificResetHandler.h>
|
|
#include <Guid/BootDiscoveryPolicy.h>
|
|
#include <Guid/EventGroup.h>
|
|
#include <Guid/TtyTerm.h>
|
|
@@ -527,6 +529,66 @@ SerialConPrint (
|
|
}
|
|
}
|
|
|
|
+/**
|
|
+ Disconnect everything.
|
|
+ Modified from the UEFI 2.3 spec (May 2009 version)
|
|
+
|
|
+**/
|
|
+STATIC
|
|
+VOID
|
|
+DisconnectAll (
|
|
+ VOID
|
|
+ )
|
|
+{
|
|
+ EFI_STATUS Status;
|
|
+ UINTN HandleCount;
|
|
+ EFI_HANDLE *HandleBuffer;
|
|
+ UINTN HandleIndex;
|
|
+
|
|
+ /*
|
|
+ * Retrieve the list of all handles from the handle database
|
|
+ */
|
|
+ Status = gBS->LocateHandleBuffer (
|
|
+ AllHandles,
|
|
+ NULL,
|
|
+ NULL,
|
|
+ &HandleCount,
|
|
+ &HandleBuffer
|
|
+ );
|
|
+ if (EFI_ERROR (Status)) {
|
|
+ return;
|
|
+ }
|
|
+
|
|
+ for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
|
|
+ gBS->DisconnectController (HandleBuffer[HandleIndex], NULL, NULL);
|
|
+ }
|
|
+
|
|
+ gBS->FreePool(HandleBuffer);
|
|
+}
|
|
+
|
|
+
|
|
+STATIC
|
|
+VOID
|
|
+EFIAPI
|
|
+OnResetNotify (
|
|
+ IN EFI_RESET_TYPE ResetType,
|
|
+ IN EFI_STATUS ResetStatus,
|
|
+ IN UINTN DataSize,
|
|
+ IN VOID *ResetData OPTIONAL
|
|
+ )
|
|
+{
|
|
+ UINT32 Delay;
|
|
+
|
|
+ DisconnectAll ();
|
|
+
|
|
+ Delay = PcdGet32 (PcdPlatformResetDelay);
|
|
+ if (Delay != 0) {
|
|
+ DEBUG ((DEBUG_INFO, "Platform will be reset in %d.%d seconds...\n",
|
|
+ Delay / 1000000, (Delay % 1000000) / 100000));
|
|
+ MicroSecondDelay (Delay);
|
|
+ }
|
|
+}
|
|
+
|
|
//
|
|
// BDS Platform Functions
|
|
//
|
|
@@ -549,6 +611,7 @@ PlatformBootManagerBeforeConsole (
|
|
{
|
|
EFI_STATUS Status;
|
|
ESRT_MANAGEMENT_PROTOCOL *EsrtManagement;
|
|
+ EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL *ResetNotify;
|
|
|
|
if (GetBootModeHob () == BOOT_ON_FLASH_UPDATE) {
|
|
DEBUG ((DEBUG_INFO, "ProcessCapsules Before EndOfDxe ......\n"));
|
|
@@ -582,6 +645,21 @@ PlatformBootManagerBeforeConsole (
|
|
EfiBootManagerUpdateConsoleVariable (ConOut, (EFI_DEVICE_PATH_PROTOCOL*)&mSerialConsole, NULL);
|
|
EfiBootManagerUpdateConsoleVariable (ErrOut, (EFI_DEVICE_PATH_PROTOCOL*)&mSerialConsole, NULL);
|
|
|
|
+ Status = gBS->LocateProtocol (
|
|
+ &gEdkiiPlatformSpecificResetHandlerProtocolGuid,
|
|
+ NULL,
|
|
+ (VOID **)&ResetNotify
|
|
+ );
|
|
+ ASSERT_EFI_ERROR (Status);
|
|
+ if (!EFI_ERROR (Status)) {
|
|
+ Status = ResetNotify->RegisterResetNotify (
|
|
+ ResetNotify,
|
|
+ OnResetNotify
|
|
+ );
|
|
+ ASSERT_EFI_ERROR (Status);
|
|
+ }
|
|
+
|
|
+
|
|
//
|
|
// Signal EndOfDxe PI Event
|
|
//
|
|
diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
|
|
index 5e55eff7..9e26828b 100644
|
|
--- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
|
|
+++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf
|
|
@@ -46,6 +46,7 @@
|
|
MemoryAllocationLib
|
|
PcdLib
|
|
PrintLib
|
|
+ TimerLib
|
|
UefiBootManagerLib
|
|
UefiBootServicesTableLib
|
|
UefiLib
|
|
@@ -63,6 +64,7 @@
|
|
[Pcd]
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdBootDiscoveryPolicy
|
|
gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut
|
|
+ gRaspberryPiTokenSpaceGuid.PcdPlatformResetDelay
|
|
gRaspberryPiTokenSpaceGuid.PcdSdIsArasan
|
|
|
|
[Guids]
|
|
@@ -78,6 +80,7 @@
|
|
gEfiBootManagerPolicyConnectAllGuid
|
|
|
|
[Protocols]
|
|
+ gEdkiiPlatformSpecificResetHandlerProtocolGuid
|
|
gEfiBootManagerPolicyProtocolGuid
|
|
gEfiDevicePathProtocolGuid
|
|
gEfiGraphicsOutputProtocolGuid
|
|
@@ -86,3 +89,6 @@
|
|
gEfiSimpleFileSystemProtocolGuid
|
|
gEsrtManagementProtocolGuid
|
|
gEfiUsb2HcProtocolGuid
|
|
+
|
|
+[Depex]
|
|
+ gEdkiiPlatformSpecificResetHandlerProtocolGuid
|
|
diff --git a/Platform/RaspberryPi/Library/ResetLib/ResetLib.c b/Platform/RaspberryPi/Library/ResetLib/ResetLib.c
|
|
deleted file mode 100644
|
|
index 2bcef8d4..00000000
|
|
--- a/Platform/RaspberryPi/Library/ResetLib/ResetLib.c
|
|
+++ /dev/null
|
|
@@ -1,151 +0,0 @@
|
|
-/** @file
|
|
- *
|
|
- * Support ResetSystem Runtime call using PSCI 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) 2013-2015, ARM Ltd. All rights reserved.
|
|
- * Copyright (c) 2008-2009, Apple Inc. All rights reserved.
|
|
- *
|
|
- * SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
- *
|
|
- **/
|
|
-
|
|
-#include <PiDxe.h>
|
|
-
|
|
-#include <Library/BaseLib.h>
|
|
-#include <Library/DebugLib.h>
|
|
-#include <Library/TimerLib.h>
|
|
-#include <Library/EfiResetSystemLib.h>
|
|
-#include <Library/ArmSmcLib.h>
|
|
-#include <Library/UefiBootServicesTableLib.h>
|
|
-#include <Library/UefiLib.h>
|
|
-#include <Library/UefiRuntimeLib.h>
|
|
-
|
|
-#include <IndustryStandard/ArmStdSmc.h>
|
|
-
|
|
-
|
|
-/**
|
|
- Disconnect everything.
|
|
- Modified from the UEFI 2.3 spec (May 2009 version)
|
|
-
|
|
-**/
|
|
-STATIC
|
|
-VOID
|
|
-DisconnectAll (
|
|
- VOID
|
|
- )
|
|
-{
|
|
- EFI_STATUS Status;
|
|
- UINTN HandleCount;
|
|
- EFI_HANDLE *HandleBuffer;
|
|
- UINTN HandleIndex;
|
|
-
|
|
- /*
|
|
- * Retrieve the list of all handles from the handle database
|
|
- */
|
|
- Status = gBS->LocateHandleBuffer (
|
|
- AllHandles,
|
|
- NULL,
|
|
- NULL,
|
|
- &HandleCount,
|
|
- &HandleBuffer
|
|
- );
|
|
- if (EFI_ERROR (Status)) {
|
|
- return;
|
|
- }
|
|
-
|
|
- for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++) {
|
|
- gBS->DisconnectController (HandleBuffer[HandleIndex], NULL, NULL);
|
|
- }
|
|
-
|
|
- gBS->FreePool(HandleBuffer);
|
|
-}
|
|
-
|
|
-
|
|
-/**
|
|
- Resets the entire platform.
|
|
-
|
|
- @param ResetType The type of reset to perform.
|
|
- @param ResetStatus The status code for the reset.
|
|
- @param DataSize The size, in bytes, of WatchdogData.
|
|
- @param ResetData For a ResetType of EfiResetCold, EfiResetWarm, or
|
|
- EfiResetShutdown the data buffer starts with a Null-terminated
|
|
- Unicode string, optionally followed by additional binary data.
|
|
-
|
|
-**/
|
|
-EFI_STATUS
|
|
-EFIAPI
|
|
-LibResetSystem (
|
|
- IN EFI_RESET_TYPE ResetType,
|
|
- IN EFI_STATUS ResetStatus,
|
|
- IN UINTN DataSize,
|
|
- IN CHAR16 *ResetData OPTIONAL
|
|
- )
|
|
-{
|
|
- ARM_SMC_ARGS ArmSmcArgs;
|
|
- UINT32 Delay;
|
|
-
|
|
- if (!EfiAtRuntime ()) {
|
|
- /*
|
|
- * Only if still in UEFI.
|
|
- */
|
|
- EfiEventGroupSignal (&gRaspberryPiEventResetGuid);
|
|
-
|
|
- DisconnectAll ();
|
|
-
|
|
- Delay = PcdGet32 (PcdPlatformResetDelay);
|
|
- if (Delay != 0) {
|
|
- DEBUG ((DEBUG_INFO, "Platform will be reset in %d.%d seconds...\n",
|
|
- Delay / 1000000, (Delay % 1000000) / 100000));
|
|
- MicroSecondDelay (Delay);
|
|
- }
|
|
- }
|
|
- DEBUG ((DEBUG_INFO, "Platform %a.\n",
|
|
- (ResetType == EfiResetShutdown) ? "shutdown" : "reset"));
|
|
-
|
|
- switch (ResetType) {
|
|
- case EfiResetPlatformSpecific:
|
|
- // Map the platform specific reset as reboot
|
|
- case EfiResetWarm:
|
|
- // Map a warm reset into a cold reset
|
|
- case EfiResetCold:
|
|
- // Send a PSCI 0.2 SYSTEM_RESET command
|
|
- ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_RESET;
|
|
- break;
|
|
- case EfiResetShutdown:
|
|
- // Send a PSCI 0.2 SYSTEM_OFF command
|
|
- ArmSmcArgs.Arg0 = ARM_SMC_ID_PSCI_SYSTEM_OFF;
|
|
- break;
|
|
- default:
|
|
- ASSERT (FALSE);
|
|
- return EFI_UNSUPPORTED;
|
|
- }
|
|
-
|
|
- ArmCallSmc (&ArmSmcArgs);
|
|
-
|
|
- // We should never be here
|
|
- DEBUG ((DEBUG_ERROR, "%a: PSCI Reset failed\n", __FUNCTION__));
|
|
- CpuDeadLoop ();
|
|
- return EFI_UNSUPPORTED;
|
|
-}
|
|
-
|
|
-/**
|
|
- Initialize any infrastructure required for LibResetSystem () to function.
|
|
-
|
|
- @param ImageHandle The firmware allocated handle for the EFI image.
|
|
- @param SystemTable A pointer to the EFI System Table.
|
|
-
|
|
- @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS.
|
|
-
|
|
-**/
|
|
-EFI_STATUS
|
|
-EFIAPI
|
|
-LibInitializeResetSystem (
|
|
- IN EFI_HANDLE ImageHandle,
|
|
- IN EFI_SYSTEM_TABLE *SystemTable
|
|
- )
|
|
-{
|
|
- return EFI_SUCCESS;
|
|
-}
|
|
diff --git a/Platform/RaspberryPi/Library/ResetLib/ResetLib.inf b/Platform/RaspberryPi/Library/ResetLib/ResetLib.inf
|
|
deleted file mode 100644
|
|
index 9bdb94a5..00000000
|
|
--- a/Platform/RaspberryPi/Library/ResetLib/ResetLib.inf
|
|
+++ /dev/null
|
|
@@ -1,45 +0,0 @@
|
|
-#/** @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.
|
|
-#
|
|
-# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
-#
|
|
-#**/
|
|
-
|
|
-[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
|
|
- Platform/RaspberryPi/RaspberryPi.dec
|
|
-
|
|
-[LibraryClasses]
|
|
- DebugLib
|
|
- BaseLib
|
|
- ArmSmcLib
|
|
- PcdLib
|
|
- TimerLib
|
|
- UefiLib
|
|
- UefiRuntimeLib
|
|
-
|
|
-[Guids]
|
|
- gRaspberryPiEventResetGuid
|
|
-
|
|
-[Pcd]
|
|
- gRaspberryPiTokenSpaceGuid.PcdPlatformResetDelay ## CONSUMES
|
|
diff --git a/Platform/RaspberryPi/RPi5/Library/PlatformLib/AArch64/RaspberryPiHelper.S b/Platform/RaspberryPi/RPi5/Library/PlatformLib/AArch64/RaspberryPiHelper.S
|
|
index 5972fcdf..21457c89 100644
|
|
--- a/Platform/RaspberryPi/RPi5/Library/PlatformLib/AArch64/RaspberryPiHelper.S
|
|
+++ b/Platform/RaspberryPi/RPi5/Library/PlatformLib/AArch64/RaspberryPiHelper.S
|
|
@@ -86,31 +86,4 @@ ASM_FUNC (ArmPlatformPeiBootAction)
|
|
.long 0 // end tag
|
|
.set .Lmeminfo_size, . - .Lmeminfo_buffer
|
|
|
|
-//UINTN
|
|
-//ArmPlatformGetPrimaryCoreMpId (
|
|
-// VOID
|
|
-// );
|
|
-ASM_FUNC (ArmPlatformGetPrimaryCoreMpId)
|
|
- MOV32 (w0, FixedPcdGet32 (PcdArmPrimaryCore))
|
|
- ret
|
|
-
|
|
-//UINTN
|
|
-//ArmPlatformIsPrimaryCore (
|
|
-// IN UINTN MpId
|
|
-// );
|
|
-ASM_FUNC (ArmPlatformIsPrimaryCore)
|
|
- mov x0, #1
|
|
- ret
|
|
-
|
|
-//UINTN
|
|
-//ArmPlatformGetCorePosition (
|
|
-// IN UINTN MpId
|
|
-// );
|
|
-// With this function: CorePos = (ClusterId * 4) + CoreId
|
|
-ASM_FUNC (ArmPlatformGetCorePosition)
|
|
- and x1, x0, #ARM_CORE_MASK
|
|
- and x0, x0, #ARM_CLUSTER_MASK
|
|
- add x0, x1, x0, LSR #6
|
|
- ret
|
|
-
|
|
ASM_FUNCTION_REMOVE_IF_UNREFERENCED
|
|
diff --git a/Platform/RaspberryPi/RPi5/RPi5.dsc b/Platform/RaspberryPi/RPi5/RPi5.dsc
|
|
index 3aab6ea8..0f3b669c 100644
|
|
--- a/Platform/RaspberryPi/RPi5/RPi5.dsc
|
|
+++ b/Platform/RaspberryPi/RPi5/RPi5.dsc
|
|
@@ -138,9 +138,7 @@
|
|
ArmGicArchLib|ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf
|
|
DmaLib|EmbeddedPkg/Library/NonCoherentDmaLib/NonCoherentDmaLib.inf
|
|
TimeBaseLib|EmbeddedPkg/Library/TimeBaseLib/TimeBaseLib.inf
|
|
- ArmPlatformStackLib|ArmPlatformPkg/Library/ArmPlatformStackLib/ArmPlatformStackLib.inf
|
|
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
|
- ArmHvcLib|ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
|
|
ArmGenericTimerCounterLib|ArmPkg/Library/ArmGenericTimerPhyCounterLib/ArmGenericTimerPhyCounterLib.inf
|
|
|
|
# Dual serial port library
|
|
@@ -212,7 +210,6 @@
|
|
MemoryInitPeiLib|Platform/RaspberryPi/Library/MemoryInitPeiLib/MemoryInitPeiLib.inf
|
|
PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
|
|
ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
|
|
- LzmaDecompressLib|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
|
|
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
|
|
HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
|
|
PrePiHobListPointerLib|ArmPlatformPkg/Library/PrePiHobListPointerLib/PrePiHobListPointerLib.inf
|
|
@@ -251,8 +248,8 @@
|
|
DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
|
|
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
|
CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
|
|
- EfiResetSystemLib|Platform/RaspberryPi/Library/ResetLib/ResetLib.inf
|
|
- ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
|
|
+ ArmMonitorLib|ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf
|
|
+ ResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
|
|
VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyLibRuntimeDxe.inf
|
|
|
|
!if $(SECURE_BOOT_ENABLE) == TRUE
|
|
@@ -523,9 +520,11 @@
|
|
#
|
|
# PEI Phase modules
|
|
#
|
|
- ArmPlatformPkg/PrePi/PeiUniCore.inf
|
|
-
|
|
- #
|
|
+ ArmPlatformPkg/PeilessSec/PeilessSec.inf {
|
|
+ <LibraryClasses>
|
|
+ NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
|
|
+ }
|
|
+#
|
|
# DXE
|
|
#
|
|
MdeModulePkg/Core/Dxe/DxeMain.inf {
|
|
@@ -543,9 +542,13 @@
|
|
ArmPkg/Drivers/CpuDxe/CpuDxe.inf
|
|
MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
|
|
Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf
|
|
- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
|
|
+ MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf {
|
|
+ <LibraryClasses>
|
|
+ NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf
|
|
+ }
|
|
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
|
|
<LibraryClasses>
|
|
+ NULL|EmbeddedPkg/Library/NvVarStoreFormattedLib/NvVarStoreFormattedLib.inf
|
|
NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
|
|
DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
|
|
}
|
|
@@ -562,7 +565,7 @@
|
|
!endif
|
|
MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
|
|
MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
|
|
- EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
|
|
+ MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
|
|
EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf {
|
|
<LibraryClasses>
|
|
RealTimeClockLib|Platform/RaspberryPi/Library/RpiRtcLib/RpiRtcLib.inf
|
|
diff --git a/Platform/RaspberryPi/RPi5/RPi5.fdf b/Platform/RaspberryPi/RPi5/RPi5.fdf
|
|
index 8d79e453..125d5fee 100644
|
|
--- a/Platform/RaspberryPi/RPi5/RPi5.fdf
|
|
+++ b/Platform/RaspberryPi/RPi5/RPi5.fdf
|
|
@@ -195,7 +195,7 @@ READ_LOCK_STATUS = TRUE
|
|
INF SecurityPkg/VariableAuthenticated/SecureBootDefaultKeysDxe/SecureBootDefaultKeysDxe.inf
|
|
!endif
|
|
INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
|
|
- INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
|
|
+ INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
|
|
INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
|
|
INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
|
|
INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
|
|
@@ -351,7 +351,7 @@ READ_STATUS = TRUE
|
|
READ_LOCK_CAP = TRUE
|
|
READ_LOCK_STATUS = TRUE
|
|
|
|
- INF ArmPlatformPkg/PrePi/PeiUniCore.inf
|
|
+ INF ArmPlatformPkg/PeilessSec/PeilessSec.inf
|
|
FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
|
|
SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
|
|
SECTION FV_IMAGE = FVMAIN
|
|
diff --git a/Platform/RaspberryPi/RaspberryPi.dec b/Platform/RaspberryPi/RaspberryPi.dec
|
|
index 0c636cbf..5c050f89 100644
|
|
--- a/Platform/RaspberryPi/RaspberryPi.dec
|
|
+++ b/Platform/RaspberryPi/RaspberryPi.dec
|
|
@@ -24,7 +24,6 @@
|
|
|
|
[Guids]
|
|
gRaspberryPiTokenSpaceGuid = {0xCD7CC258, 0x31DB, 0x11E6, {0x9F, 0xD3, 0x63, 0xB0, 0xB8, 0xEE, 0xD6, 0xB5}}
|
|
- gRaspberryPiEventResetGuid = {0xCD7CC258, 0x31DB, 0x11E6, {0x9F, 0xD3, 0x63, 0xB4, 0xB4, 0xE4, 0xD4, 0xB4}}
|
|
gConfigDxeFormSetGuid = {0xCD7CC258, 0x31DB, 0x22E6, {0x9F, 0x22, 0x63, 0xB0, 0xB8, 0xEE, 0xD6, 0xB5}}
|
|
gMemoryAttributeManagerFormSetGuid = { 0xefab3427, 0x4793, 0x4e9e, { 0xaa, 0x29, 0x88, 0x0c, 0x9a, 0x77, 0x5b, 0x5f } }
|
|
|
|
--
|
|
2.51.2
|
|
|