-EFI_STATUS\r
-UpdateFdtPath (\r
- IN LIST_ENTRY *BootOptionsList\r
- )\r
-{\r
- EFI_STATUS Status;\r
- UINTN FdtDevicePathSize;\r
- BDS_SUPPORTED_DEVICE *SupportedBootDevice;\r
- EFI_DEVICE_PATH_PROTOCOL *FdtDevicePathNodes;\r
- EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;\r
-\r
- Status = SelectBootDevice (&SupportedBootDevice);\r
- if (EFI_ERROR(Status)) {\r
- Status = EFI_ABORTED;\r
- goto EXIT;\r
- }\r
-\r
- // Create the specific device path node\r
- Status = SupportedBootDevice->Support->CreateDevicePathNode (L"FDT blob", &FdtDevicePathNodes);\r
- if (EFI_ERROR(Status)) {\r
- Status = EFI_ABORTED;\r
- goto EXIT;\r
- }\r
-\r
- if (FdtDevicePathNodes != NULL) {\r
- // Append the Device Path node to the select device path\r
- FdtDevicePath = AppendDevicePath (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNodes);\r
- // Free the FdtDevicePathNodes created by Support->CreateDevicePathNode()\r
- FreePool (FdtDevicePathNodes);\r
- FdtDevicePathSize = GetDevicePathSize (FdtDevicePath);\r
- Status = gRT->SetVariable (\r
- (CHAR16*)L"Fdt",\r
- &gArmGlobalVariableGuid,\r
- EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
- FdtDevicePathSize,\r
- FdtDevicePath\r
- );\r
- ASSERT_EFI_ERROR(Status);\r
- } else {\r
- Status = gRT->SetVariable (\r
- (CHAR16*)L"Fdt",\r
- &gArmGlobalVariableGuid,\r
- EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,\r
- 0,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR(Status);\r
- }\r
-\r
-EXIT:\r
- if (Status == EFI_ABORTED) {\r
- Print(L"\n");\r
- }\r
- FreePool(SupportedBootDevice);\r
- return Status;\r
-}\r
-\r