- if (!FeaturePcdGet (PcdPureAcpiBoot)) {\r
- //\r
- // Only install the FDT as a configuration table if we want to leave it up\r
- // to the OS to decide whether it prefers ACPI over DT.\r
- //\r
- Status = gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBase);\r
- ASSERT_EFI_ERROR (Status);\r
+ //\r
+ // Register a protocol notify for the EDKII Platform Has Device Tree\r
+ // Protocol.\r
+ //\r
+ Status = gBS->CreateEvent (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ OnPlatformHasDeviceTree,\r
+ DeviceTreeBase, // Context\r
+ &PlatformHasDeviceTreeEvent\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __FUNCTION__, Status));\r
+ return Status;\r
+ }\r
+\r
+ Status = gBS->RegisterProtocolNotify (\r
+ &gEdkiiPlatformHasDeviceTreeGuid,\r
+ PlatformHasDeviceTreeEvent,\r
+ &Registration\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((\r
+ DEBUG_ERROR,\r
+ "%a: RegisterProtocolNotify(): %r\n",\r
+ __FUNCTION__,\r
+ Status\r
+ ));\r
+ goto CloseEvent;\r
+ }\r
+\r
+ //\r
+ // Kick the event; the protocol could be available already.\r
+ //\r
+ Status = gBS->SignalEvent (PlatformHasDeviceTreeEvent);\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __FUNCTION__, Status));\r
+ goto CloseEvent;\r