From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 6BDAA7803CE for ; Tue, 30 Jul 2024 15:08:26 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EcQLD8ORmvaUs65++clbCn5x7/JsLtelno4ZdII4DY0=; c=relaxed/simple; d=groups.io; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1722352106; v=1; b=EFPzBhgG2FNUYz+Yvqa1AVaqRIZvhsv8FT+VuX0OqZFrcBTgs55FrgpEvv8N2/f35RvbI1Z0 QKrXxVxX7a3i5qyhifh7nsSiJKPqHJiUoOX+crqMklWJWw0vvngXpQyd3TDjgO3ehXg7IPXVGM4 qxskuwTc9hjp0b48xQFdJWJdIAMiIsfutLlFwl95104OoT+iUwLw6groynAPalCWiaCGnGiagCc XxY+bMW4LPs1du1WFvZ2tq96SnjVTsHzqH3Ak3KtGlHqLWVqDXjDpbQvN5OMq7qXBh0Kuel9Jpq tbewAa5Yj3uI61Eop1tJqikNxPIgufMz3m3S7OE0vdC+w== X-Received: by 127.0.0.2 with SMTP id OhoNYY7687511xXrw2XB6Reo; Tue, 30 Jul 2024 08:08:25 -0700 X-Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) by mx.groups.io with SMTP id smtpd.web11.42532.1722199498793857171 for ; Sun, 28 Jul 2024 13:44:59 -0700 X-Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-3684638af70so237509f8f.1 for ; Sun, 28 Jul 2024 13:44:58 -0700 (PDT) X-Gm-Message-State: TDBIwg9g8iU2UN0RG0FmiYrVx7686176AA= X-Google-Smtp-Source: AGHT+IGZi9M4i6mULE/sgTU8Nufa1EmR8GgfXi4dx49AgpEVBJ1/kB+tLDwkRbFrmWqz5zY+UXDiJjz+ X-Received: from palermo.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:118a]) (user=ardb job=sendgmr) by 2002:a5d:6d8c:0:b0:369:e72c:8766 with SMTP id ffacd0b85a97d-36b5d0cd828mr8156f8f.9.1722199496679; Sun, 28 Jul 2024 13:44:56 -0700 (PDT) Date: Sun, 28 Jul 2024 22:44:34 +0200 In-Reply-To: <20240728204437.4064847-1-ardb+git@google.com> Mime-Version: 1.0 References: <20240728204437.4064847-1-ardb+git@google.com> Message-ID: <20240728204437.4064847-8-ardb+git@google.com> Subject: [edk2-devel] [PATCH edk2-platforms v2 7/8] Platform/RaspberryPi: Switch to generic reset runtime From: "Ard Biesheuvel via groups.io" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Jeremy Linton Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 30 Jul 2024 08:08:18 -0700 Resent-From: ardb+git@google.com Reply-To: devel@edk2.groups.io,ardb+git@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=EFPzBhgG; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io From: Ard Biesheuvel Drop the reference to the special reset runtime DXE driver in EmbeddedPkg, and move to the one in MdeModulePkg shared between all architectures. This version implements reset notifications, allowing us to retire the home grown version of that functionality in a subsequent patch. Add depexes to the components that rely on the reset notification protocols to ensure that they are not dispatched before those protocols are made available by the reset runtime DXE driver. Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- Platform/RaspberryPi/RPi3/RPi3.dsc | 6 +++--- Platform/RaspberryPi/RPi4/RPi4.dsc | 6 +++--- Platform/RaspberryPi/RPi3/RPi3.fdf | 2 +- Platform/RaspberryPi/RPi4/RPi4.fdf | 2 +- Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf | 2 +- Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 +++ Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c | 1 + Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c | 1 + 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Platform/RaspberryPi/RPi3/RPi3.dsc b/Platform/RaspberryPi/RPi3/RPi3.dsc index c399d65aa0b5..5b6b2782f297 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.dsc +++ b/Platform/RaspberryPi/RPi3/RPi3.dsc @@ -226,8 +226,8 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] 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 @@ -628,7 +628,7 @@ [Components.common] !endif MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf - EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf diff --git a/Platform/RaspberryPi/RPi4/RPi4.dsc b/Platform/RaspberryPi/RPi4/RPi4.dsc index f01875173601..58b3d6643382 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.dsc +++ b/Platform/RaspberryPi/RPi4/RPi4.dsc @@ -234,8 +234,8 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] 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 @@ -650,7 +650,7 @@ [Components.common] !endif MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf - EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf { RealTimeClockLib|EmbeddedPkg/Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf diff --git a/Platform/RaspberryPi/RPi3/RPi3.fdf b/Platform/RaspberryPi/RPi3/RPi3.fdf index 3c569f57740b..090c4a621e90 100644 --- a/Platform/RaspberryPi/RPi3/RPi3.fdf +++ b/Platform/RaspberryPi/RPi3/RPi3.fdf @@ -198,7 +198,7 @@ [FV.FvMain] INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.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 diff --git a/Platform/RaspberryPi/RPi4/RPi4.fdf b/Platform/RaspberryPi/RPi4/RPi4.fdf index 816927761513..080e1638c1c5 100644 --- a/Platform/RaspberryPi/RPi4/RPi4.fdf +++ b/Platform/RaspberryPi/RPi4/RPi4.fdf @@ -194,7 +194,7 @@ [FV.FvMain] 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 diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf index f1ecc47c7f5d..665cd7dd062d 100644 --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.inf @@ -88,4 +88,4 @@ [Pcd] [FeaturePcd] [Depex] - TRUE + gEfiResetNotificationProtocolGuid diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index 9c6bbb9dd102..9e26828ba84b 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -89,3 +89,6 @@ [Protocols] gEfiSimpleFileSystemProtocolGuid gEsrtManagementProtocolGuid gEfiUsb2HcProtocolGuid + +[Depex] + gEdkiiPlatformSpecificResetHandlerProtocolGuid diff --git a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c index b18121155c01..26d4b41f94b0 100644 --- a/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c +++ b/Platform/RaspberryPi/Drivers/VarBlockServiceDxe/VarBlockServiceDxe.c @@ -293,6 +293,7 @@ InstallDumpVarEventHandlers ( NULL, (VOID **)&ResetNotify ); + ASSERT_EFI_ERROR (Status); if (!EFI_ERROR (Status)) { Status = ResetNotify->RegisterResetNotify ( ResetNotify, diff --git a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c index 976e86043790..e5c348cc731b 100644 --- a/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c +++ b/Platform/RaspberryPi/Library/PlatformBootManagerLib/PlatformBm.c @@ -650,6 +650,7 @@ PlatformBootManagerBeforeConsole ( NULL, (VOID **)&ResetNotify ); + ASSERT_EFI_ERROR (Status); if (!EFI_ERROR (Status)) { Status = ResetNotify->RegisterResetNotify ( ResetNotify, -- 2.46.0.rc1.232.g9752f9e123-goog -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120107): https://edk2.groups.io/g/devel/message/120107 Mute This Topic: https://groups.io/mt/107628981/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-