gEfiEndOfDxeEventGroupGuid\r
gEfiFileInfoGuid\r
gFdtTableGuid\r
+ gArmPlatformUpdateFdtEventGuid\r
\r
[Protocols]\r
gEfiBlockIoProtocolGuid\r
/** @file\r
*\r
-* Copyright (c) 2014, ARM Limited. All rights reserved.\r
+* Copyright (c) 2014-2015, ARM Limited. All rights reserved.\r
*\r
* This program and the accompanying materials\r
* are licensed and made available under the terms and conditions of the BSD License\r
#include <Library/UefiRuntimeServicesTableLib.h>\r
\r
#include <Guid/ArmGlobalVariableHob.h>\r
+#include <Guid/ArmPlatformEvents.h>\r
#include <Guid/EventGroup.h>\r
#include <Guid/Fdt.h>\r
#include <Guid/FileInfo.h>\r
STATIC\r
VOID\r
EFIAPI\r
-OnEndOfDxe (\r
+LoadFdtOnEvent (\r
EFI_EVENT Event,\r
VOID *Context\r
)\r
UINTN VariableSize;\r
CHAR16* FdtDevicePathStr;\r
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;\r
+ EFI_EVENT ArmPlatformUpdateFdtEvent;\r
\r
//\r
// Read the 'FDT' UEFI Variable to know where we should we read the blob from.\r
}\r
}\r
\r
- // Install the Binding protocol to verify when the FileSystem that contains the FDT has been installed\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &gImageHandle,\r
- &gEfiDriverBindingProtocolGuid, &mJunoFdtBinding,\r
- NULL\r
- );\r
- if (EFI_ERROR (Status)) {\r
+ // Context is not NULL when this function is called for a gEfiEndOfDxeEventGroupGuid event\r
+ if (Context) {\r
+ // Install the Binding protocol to verify when the FileSystem that contains the FDT has been installed\r
+ Status = gBS->InstallMultipleProtocolInterfaces (\r
+ &gImageHandle,\r
+ &gEfiDriverBindingProtocolGuid, &mJunoFdtBinding,\r
+ NULL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ ASSERT_EFI_ERROR (Status);\r
+ return;\r
+ }\r
+\r
+ // Register the event triggered when the 'Fdt' variable is updated.\r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ LoadFdtOnEvent,\r
+ NULL,\r
+ &gArmPlatformUpdateFdtEventGuid,\r
+ &ArmPlatformUpdateFdtEvent\r
+ );\r
ASSERT_EFI_ERROR (Status);\r
- return;\r
}\r
\r
//\r
BdsConnectDevicePath (mFdtFileSystemDevicePath, &Handle, NULL);\r
}\r
\r
+STATIC CONST BOOLEAN mIsEndOfDxeEvent = TRUE;\r
+\r
EFI_STATUS\r
JunoFdtInstall (\r
IN EFI_HANDLE ImageHandle\r
Status = gBS->CreateEventEx (\r
EVT_NOTIFY_SIGNAL,\r
TPL_CALLBACK,\r
- OnEndOfDxe,\r
- NULL,\r
+ LoadFdtOnEvent,\r
+ &mIsEndOfDxeEvent,\r
&gEfiEndOfDxeEventGroupGuid,\r
&EndOfDxeEvent\r
);\r
#/** @file\r
#\r
-# Copyright (c) 2011-2014, ARM Limited. All rights reserved.\r
+# Copyright (c) 2011-2015, ARM Limited. All rights reserved.\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
\r
gArmBootMonFsFileInfoGuid = { 0x41e26b9c, 0xada6, 0x45b3, { 0x80, 0x8e, 0x23, 0x57, 0xa3, 0x5b, 0x60, 0xd6 } }\r
\r
+ ## Include/Guid/ArmPlatformEvents.h\r
+ gArmPlatformUpdateFdtEventGuid = { 0xaffe115b, 0x8589, 0x456d, { 0xba, 0xb5, 0x8f, 0x2e, 0xda, 0x53, 0xae, 0xb7 } }\r
+\r
[Ppis]\r
## Include/Ppi/ArmGlobalVariable.h\r
gArmGlobalVariablePpiGuid = { 0xab1c1816, 0xd542, 0x4e6f, {0x9b, 0x1e, 0x8e, 0xcd, 0x92, 0x53, 0xe2, 0xe7} }\r
which is implementation-dependent.\r
\r
**/\r
-STATIC\r
VOID\r
EFIAPI\r
EmptyCallbackFunction (\r
#\r
# Component description file for Bds module\r
#\r
-# Copyright (c) 2011-2014, ARM Ltd. All rights reserved.<BR>\r
+# Copyright (c) 2011-2015, ARM Ltd. All rights reserved.<BR>\r
#\r
# This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
gEfiEndOfDxeEventGroupGuid\r
gEfiFileSystemInfoGuid\r
gArmGlobalVariableGuid\r
+ gArmPlatformUpdateFdtEventGuid\r
\r
[Protocols]\r
gEfiBdsArchProtocolGuid\r
OUT BOOLEAN *IsUnicode\r
);\r
\r
+/**\r
+ An empty function to pass error checking of CreateEventEx ().\r
+\r
+ @param Event Event whose notification function is being invoked.\r
+ @param Context Pointer to the notification function's context,\r
+ which is implementation-dependent.\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+EmptyCallbackFunction (\r
+ IN EFI_EVENT Event,\r
+ IN VOID *Context\r
+ );\r
+\r
#endif /* _BDSINTERNAL_H_ */\r
#include "BdsInternal.h"\r
\r
#include <Guid/ArmGlobalVariableHob.h>\r
+#include <Guid/ArmPlatformEvents.h>\r
\r
extern BDS_LOAD_OPTION_SUPPORT *BdsLoadOptionSupportList;\r
\r
BDS_SUPPORTED_DEVICE *SupportedBootDevice;\r
EFI_DEVICE_PATH_PROTOCOL *FdtDevicePathNodes;\r
EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;\r
+ EFI_EVENT UpdateFdtEvent;\r
\r
Status = SelectBootDevice (&SupportedBootDevice);\r
if (EFI_ERROR(Status)) {\r
ASSERT_EFI_ERROR(Status);\r
}\r
\r
+ if (!EFI_ERROR (Status)) {\r
+ //\r
+ // Signal FDT has been updated\r
+ //\r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_NOTIFY,\r
+ EmptyCallbackFunction,\r
+ NULL,\r
+ &gArmPlatformUpdateFdtEventGuid,\r
+ &UpdateFdtEvent\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ gBS->SignalEvent (UpdateFdtEvent);\r
+ }\r
+ }\r
+\r
EXIT:\r
if (Status == EFI_ABORTED) {\r
Print(L"\n");\r
--- /dev/null
+/** @file\r
+*\r
+* Copyright (c) 2015, ARM Limited. All rights reserved.\r
+*\r
+* This program and the accompanying materials\r
+* are licensed and made available under the terms and conditions of the BSD License\r
+* which accompanies this distribution. The full text of the license may be found at\r
+* http://opensource.org/licenses/bsd-license.php\r
+*\r
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+*\r
+**/\r
+\r
+#ifndef __ARM_PLATFORM_EVENTS_H__\r
+#define __ARM_PLATFORM_EVENTS_H__\r
+\r
+#define ARM_PLATFORM_UPDATE_FDT_EVENT_GUID \\r
+ { 0xaffe115b, 0x8589, 0x456d, { 0xba, 0xb5, 0x8f, 0x2e, 0xda, 0x53, 0xae, 0xb7 } }\r
+\r
+extern EFI_GUID gArmPlatformUpdateFdtEventGuid;\r
+\r
+#endif\r