diff options
author | Olivier Martin <olivier.martin@arm.com> | 2015-01-06 15:54:12 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2015-01-06 15:54:12 +0000 |
commit | 5c2d456b9670cd8eeed1b06d3e50011598ade3b0 (patch) | |
tree | 1a9afdf1d9868b93006cc4036160b15e48a73499 /ArmPlatformPkg/ArmJunoPkg/Drivers | |
parent | f2c730d3123c8952e2715b120e79c4ea20c73451 (diff) | |
download | edk2-platforms-5c2d456b9670cd8eeed1b06d3e50011598ade3b0.tar.xz |
ArmPlatformPkg/Bds: Signal when the variable 'Fdt' has been updated
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16589 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/ArmJunoPkg/Drivers')
-rw-r--r-- | ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf | 1 | ||||
-rw-r--r-- | ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/InstallFdt.c | 42 |
2 files changed, 31 insertions, 12 deletions
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf index bf930d23d9..3392a9538c 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf @@ -53,6 +53,7 @@ gEfiEndOfDxeEventGroupGuid
gEfiFileInfoGuid
gFdtTableGuid
+ gArmPlatformUpdateFdtEventGuid
[Protocols]
gEfiBlockIoProtocolGuid
diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/InstallFdt.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/InstallFdt.c index d8df991e0a..337a4f079b 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/InstallFdt.c +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/InstallFdt.c @@ -1,6 +1,6 @@ /** @file
*
-* Copyright (c) 2014, ARM Limited. All rights reserved.
+* Copyright (c) 2014-2015, 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
@@ -28,6 +28,7 @@ #include <Library/UefiRuntimeServicesTableLib.h>
#include <Guid/ArmGlobalVariableHob.h>
+#include <Guid/ArmPlatformEvents.h>
#include <Guid/EventGroup.h>
#include <Guid/Fdt.h>
#include <Guid/FileInfo.h>
@@ -293,7 +294,7 @@ EFI_DRIVER_BINDING_PROTOCOL mJunoFdtBinding = { STATIC
VOID
EFIAPI
-OnEndOfDxe (
+LoadFdtOnEvent (
EFI_EVENT Event,
VOID *Context
)
@@ -304,6 +305,7 @@ OnEndOfDxe ( UINTN VariableSize;
CHAR16* FdtDevicePathStr;
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;
+ EFI_EVENT ArmPlatformUpdateFdtEvent;
//
// Read the 'FDT' UEFI Variable to know where we should we read the blob from.
@@ -384,15 +386,29 @@ OnEndOfDxe ( }
}
- // Install the Binding protocol to verify when the FileSystem that contains the FDT has been installed
- Status = gBS->InstallMultipleProtocolInterfaces (
- &gImageHandle,
- &gEfiDriverBindingProtocolGuid, &mJunoFdtBinding,
- NULL
- );
- if (EFI_ERROR (Status)) {
+ // Context is not NULL when this function is called for a gEfiEndOfDxeEventGroupGuid event
+ if (Context) {
+ // Install the Binding protocol to verify when the FileSystem that contains the FDT has been installed
+ Status = gBS->InstallMultipleProtocolInterfaces (
+ &gImageHandle,
+ &gEfiDriverBindingProtocolGuid, &mJunoFdtBinding,
+ NULL
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT_EFI_ERROR (Status);
+ return;
+ }
+
+ // Register the event triggered when the 'Fdt' variable is updated.
+ Status = gBS->CreateEventEx (
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
+ LoadFdtOnEvent,
+ NULL,
+ &gArmPlatformUpdateFdtEventGuid,
+ &ArmPlatformUpdateFdtEvent
+ );
ASSERT_EFI_ERROR (Status);
- return;
}
//
@@ -401,6 +417,8 @@ OnEndOfDxe ( BdsConnectDevicePath (mFdtFileSystemDevicePath, &Handle, NULL);
}
+STATIC CONST BOOLEAN mIsEndOfDxeEvent = TRUE;
+
EFI_STATUS
JunoFdtInstall (
IN EFI_HANDLE ImageHandle
@@ -415,8 +433,8 @@ JunoFdtInstall ( Status = gBS->CreateEventEx (
EVT_NOTIFY_SIGNAL,
TPL_CALLBACK,
- OnEndOfDxe,
- NULL,
+ LoadFdtOnEvent,
+ &mIsEndOfDxeEvent,
&gEfiEndOfDxeEventGroupGuid,
&EndOfDxeEvent
);
|