From 5c2d456b9670cd8eeed1b06d3e50011598ade3b0 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Tue, 6 Jan 2015 15:54:12 +0000 Subject: ArmPlatformPkg/Bds: Signal when the variable 'Fdt' has been updated Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16589 6f19259b-4bc3-4df7-8a09-765794883524 --- .../ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.inf | 1 + .../ArmJunoPkg/Drivers/ArmJunoDxe/InstallFdt.c | 42 +++++++++++++++------- 2 files changed, 31 insertions(+), 12 deletions(-) (limited to 'ArmPlatformPkg/ArmJunoPkg/Drivers') 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 #include +#include #include #include #include @@ -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 ); -- cgit v1.2.3