EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;\r
LINUX_LOADER_OPTIONAL_DATA* LinuxOptionalData;\r
EFI_DEVICE_PATH* DevicePathKernel;\r
- EFI_DEVICE_PATH* DevicePathFdt;\r
EFI_DEVICE_PATH* InitrdDevicePath;\r
CHAR16* OptionalDataInitrd;\r
CHAR8* OptionalDataArguments;\r
return EFI_UNSUPPORTED;\r
}\r
\r
- // Generate the File Path Node for the Linux Kernel & Device Tree blob\r
+ // Generate the File Path Node for the Linux Kernel\r
DevicePathKernel = FileDevicePath (LoadedImage->DeviceHandle, LINUX_KERNEL_NAME);\r
- DevicePathFdt = FileDevicePath (LoadedImage->DeviceHandle, FDT_NAME);\r
\r
if (LinuxOptionalData->CmdLineLength > 0) {\r
OptionalDataArguments = (CHAR8*)LinuxOptionalData + sizeof(LINUX_LOADER_OPTIONAL_DATA);\r
}\r
\r
// Load and Start the Linux Kernel (we should never return)\r
- Status = BdsBootLinuxFdt (DevicePathKernel, InitrdDevicePath, OptionalDataArguments, DevicePathFdt);\r
+ Status = BdsBootLinuxFdt (DevicePathKernel, InitrdDevicePath, OptionalDataArguments);\r
\r
if ((UINTN)OptionalDataInitrd & 0x1) {\r
FreePool (Initrd);\r
/**\r
Start a Linux kernel from a Device Path\r
\r
- @param LinuxKernel Device Path to the Linux Kernel\r
- @param Parameters Linux kernel arguments\r
- @param Fdt Device Path to the Flat Device Tree\r
+ @param[in] LinuxKernelDevicePath Device Path to the Linux Kernel\r
+ @param[in] InitrdDevicePath Device Path to the Initrd\r
+ @param[in] Arguments Linux kernel arguments\r
\r
@retval EFI_SUCCESS All drivers have been connected\r
@retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
BdsBootLinuxFdt (\r
IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,\r
IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,\r
- IN CONST CHAR8* Arguments,\r
- IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath\r
+ IN CONST CHAR8* Arguments\r
);\r
\r
/**\r
#include <Library/ArmGicLib.h>\r
#include <Ppi/ArmMpCoreInfo.h>\r
#include <Library/IoLib.h>\r
+#include <Guid/Fdt.h>\r
+#include <libfdt.h>\r
\r
#include "BdsInternal.h"\r
#include "BdsLinuxLoader.h"\r
/**\r
Start a Linux kernel from a Device Path\r
\r
- @param LinuxKernel Device Path to the Linux Kernel\r
- @param Parameters Linux kernel agruments\r
- @param Fdt Device Path to the Flat Device Tree\r
+ @param[in] LinuxKernelDevicePath Device Path to the Linux Kernel\r
+ @param[in] InitrdDevicePath Device Path to the Initrd\r
+ @param[in] Arguments Linux kernel arguments\r
\r
@retval EFI_SUCCESS All drivers have been connected\r
@retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
BdsBootLinuxFdt (\r
IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,\r
IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,\r
- IN CONST CHAR8* Arguments,\r
- IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath\r
+ IN CONST CHAR8* Arguments\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_STATUS PenBaseStatus;\r
- UINTN LinuxImageSize;\r
- UINTN InitrdImageSize;\r
- UINTN InitrdImageBaseSize;\r
- UINTN FdtBlobSize;\r
- EFI_PHYSICAL_ADDRESS FdtBlobBase;\r
- EFI_PHYSICAL_ADDRESS LinuxImage;\r
- EFI_PHYSICAL_ADDRESS InitrdImage;\r
- EFI_PHYSICAL_ADDRESS InitrdImageBase;\r
- ARM_PROCESSOR_TABLE *ArmProcessorTable;\r
- ARM_CORE_INFO *ArmCoreInfoTable;\r
- UINTN Index;\r
- EFI_PHYSICAL_ADDRESS PenBase;\r
- UINTN PenSize;\r
- UINTN MailBoxBase;\r
+ EFI_STATUS Status;\r
+ EFI_STATUS PenBaseStatus;\r
+ UINTN LinuxImageSize;\r
+ UINTN InitrdImageSize;\r
+ UINTN InitrdImageBaseSize;\r
+ VOID *InstalledFdtBase;\r
+ UINTN FdtBlobSize;\r
+ EFI_PHYSICAL_ADDRESS FdtBlobBase;\r
+ EFI_PHYSICAL_ADDRESS LinuxImage;\r
+ EFI_PHYSICAL_ADDRESS InitrdImage;\r
+ EFI_PHYSICAL_ADDRESS InitrdImageBase;\r
+ ARM_PROCESSOR_TABLE *ArmProcessorTable;\r
+ ARM_CORE_INFO *ArmCoreInfoTable;\r
+ UINTN Index;\r
+ EFI_PHYSICAL_ADDRESS PenBase;\r
+ UINTN PenSize;\r
+ UINTN MailBoxBase;\r
\r
PenBaseStatus = EFI_UNSUPPORTED;\r
PenSize = 0;\r
}\r
}\r
\r
- // Load the FDT binary from a device path.\r
- // The FDT will be reloaded later to a more appropriate location for the Linux kernel.\r
- FdtBlobBase = LINUX_KERNEL_MAX_OFFSET;\r
- Status = BdsLoadImage (FdtDevicePath, AllocateMaxAddress, &FdtBlobBase, &FdtBlobSize);\r
- if (EFI_ERROR(Status)) {\r
- Print (L"ERROR: Did not find Device Tree blob (%r).\n", Status);\r
+ //\r
+ // Get the FDT from the Configuration Table.\r
+ // The FDT will be reloaded in PrepareFdt() to a more appropriate\r
+ // location for the Linux Kernel.\r
+ //\r
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &InstalledFdtBase);\r
+ if (EFI_ERROR (Status)) {\r
+ Print (L"ERROR: Did not get the Device Tree blob (%r).\n", Status);\r
goto EXIT_FREE_INITRD;\r
}\r
+ FdtBlobBase = (EFI_PHYSICAL_ADDRESS)InstalledFdtBase;\r
+ FdtBlobSize = fdt_totalsize (InstalledFdtBase);\r
\r
//\r
// Install secondary core pens if the Power State Coordination Interface is not supported\r
*\r
**/\r
\r
+#include <Guid/Fdt.h>\r
+#include <libfdt.h>\r
+\r
#include "BdsInternal.h"\r
#include "BdsLinuxLoader.h"\r
\r
/**\r
Start a Linux kernel from a Device Path\r
\r
- @param LinuxKernel Device Path to the Linux Kernel\r
- @param Parameters Linux kernel arguments\r
- @param Fdt Device Path to the Flat Device Tree\r
+ @param LinuxKernelDevicePath Device Path to the Linux Kernel\r
+ @param InitrdDevicePath Device Path to the Initrd\r
+ @param CommandLineArguments Linux command line\r
\r
@retval EFI_SUCCESS All drivers have been connected\r
@retval EFI_NOT_FOUND The Linux kernel Device Path has not been found\r
BdsBootLinuxFdt (\r
IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,\r
IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,\r
- IN CONST CHAR8* CommandLineArguments,\r
- IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath\r
+ IN CONST CHAR8* CommandLineArguments\r
)\r
{\r
- EFI_STATUS Status;\r
- UINT32 LinuxImageSize;\r
- UINT32 InitrdImageBaseSize = 0;\r
- UINT32 InitrdImageSize = 0;\r
- UINT32 FdtBlobSize;\r
- EFI_PHYSICAL_ADDRESS FdtBlobBase;\r
- EFI_PHYSICAL_ADDRESS LinuxImage;\r
- EFI_PHYSICAL_ADDRESS InitrdImageBase = 0;\r
- EFI_PHYSICAL_ADDRESS InitrdImage = 0;\r
+ EFI_STATUS Status;\r
+ UINT32 LinuxImageSize;\r
+ UINT32 InitrdImageBaseSize = 0;\r
+ UINT32 InitrdImageSize = 0;\r
+ VOID *InstalledFdtBase;\r
+ UINT32 FdtBlobSize;\r
+ EFI_PHYSICAL_ADDRESS FdtBlobBase;\r
+ EFI_PHYSICAL_ADDRESS LinuxImage;\r
+ EFI_PHYSICAL_ADDRESS InitrdImageBase = 0;\r
+ EFI_PHYSICAL_ADDRESS InitrdImage = 0;\r
\r
PERF_START (NULL, "BDS", NULL, 0);\r
\r
}\r
}\r
\r
- // Load the FDT binary from a device path. The FDT will be reloaded later to a more appropriate location for the Linux kernel.\r
- FdtBlobBase = 0;\r
- Status = BdsLoadImage (FdtDevicePath, AllocateAnyPages, &FdtBlobBase, &FdtBlobSize);\r
- if (EFI_ERROR(Status)) {\r
- Print (L"ERROR: Did not find Device Tree blob.\n");\r
+ //\r
+ // Get the FDT from the Configuration Table.\r
+ // The FDT will be reloaded in PrepareFdt() to a more appropriate\r
+ // location for the Linux Kernel.\r
+ //\r
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &InstalledFdtBase);\r
+ if (EFI_ERROR (Status)) {\r
+ Print (L"ERROR: Did not get the Device Tree blob (%r).\n", Status);\r
goto EXIT_FREE_INITRD;\r
}\r
+ FdtBlobBase = (EFI_PHYSICAL_ADDRESS)(UINTN)InstalledFdtBase;\r
+ FdtBlobSize = fdt_totalsize (InstalledFdtBase);\r
\r
// Update the Fdt with the Initrd information. The FDT will increase in size.\r
// By setting address=0 we leave the memory allocation to the function\r
AArch64/BdsLinuxLoaderHelper.S\r
\r
[Packages]\r
- MdePkg/MdePkg.dec\r
- MdeModulePkg/MdeModulePkg.dec\r
EmbeddedPkg/EmbeddedPkg.dec\r
ArmPkg/ArmPkg.dec\r
+ MdePkg/MdePkg.dec\r
+ MdeModulePkg/MdeModulePkg.dec\r
ArmPlatformPkg/ArmPlatformPkg.dec\r
\r
[LibraryClasses]\r
gEfiFileInfoGuid\r
gArmMpCoreInfoGuid\r
gArmGlobalVariableGuid\r
+ gFdtTableGuid\r
\r
[Protocols]\r
gEfiBdsArchProtocolGuid\r
#\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"Linux from NOR Flash"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/Image"\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/juno.dtb"\r
\r
# Support the Linux EFI stub by default\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|L"console=ttyAMA0,115200 earlycon=pl011,0x7ff80000 root=/dev/sda1 rootwait verbose debug"\r
# - 1 = a Linux kernel with ATAG support\r
# - 2 = a Linux kernel with FDT support\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|0|UINT32|0x00000010\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L""|VOID*|0x00000011\r
\r
## Timeout value for displaying progressing bar in before boot OS.\r
# According to UEFI 2.0 spec, the default TimeOut should be 0xffff.\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0xE000000,0xE800000)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"console=ttyAMA0,38400 earlyprintk debug verbose"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x0E800000,0x0E803000)"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
# PL111 - CLCD\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|L"console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 loglevel=9"\r
# Use EFI Stub\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|0\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/fdt.dtb"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-cortex_a15x1.dtb"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-cortex_a15x4.dtb"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-cortex_a9x4.dtb"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/Image"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"root=/dev/vda2 rw console=ttyAMA0 earlyprintk=pl011,0x1c090000 maxcpus=4 debug user_debug=31 loglevel=9"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/foundation-v8.dtb"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();"\r
#\r
# ARM Architectural Timer Frequency\r
#\r
- # Set model tick to 100Mhz. This depends a lot on workstation performance.\r
+ # Set model tick to 100MHz. This depends a lot on workstation performance.\r
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
\r
[PcdsDynamicDefault.common]\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/Image"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"root=/dev/mmcblk0p2 console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug user_debug=31 loglevel=9"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-aemv8a.dtb"\r
\r
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"\r
#\r
# ARM Architectural Timer Frequency\r
#\r
- # Set model tick to 100Mhz. This depends a lot on workstation performance.\r
+ # Set model tick to 100MHz. This depends a lot on workstation performance.\r
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000\r
\r
[PcdsDynamicDefault.common]\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootInitrdPath\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath\r
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut\r
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths\r
return Status ;\r
}\r
\r
-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
/**\r
Set boot timeout\r
\r
{ L"Update Boot Device Entry", BootMenuUpdateBootOption },\r
{ L"Remove Boot Device Entry", BootMenuRemoveBootOption },\r
{ L"Reorder Boot Device Entries", BootMenuReorderBootOptions },\r
- { L"Update FDT path", UpdateFdtPath },\r
{ L"Set Boot Timeout", BootMenuSetBootTimeout },\r
};\r
\r
)\r
{\r
EFI_STATUS Status;\r
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol;\r
UINT32 LoaderType;\r
ARM_BDS_LOADER_OPTIONAL_DATA* OptionalData;\r
ARM_BDS_LINUX_ARGUMENTS* LinuxArguments;\r
- EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath;\r
- EFI_DEVICE_PATH_PROTOCOL* DefaultFdtDevicePath;\r
- UINTN FdtDevicePathSize;\r
UINTN CmdLineSize;\r
UINTN InitrdSize;\r
EFI_DEVICE_PATH* Initrd;\r
} else {\r
Initrd = NULL;\r
}\r
-\r
- // Get the default FDT device path\r
- Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);\r
- ASSERT_EFI_ERROR(Status);\r
- DefaultFdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));\r
-\r
- // Get the FDT device path\r
- FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath);\r
- Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid,\r
- DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);\r
- ASSERT_EFI_ERROR(Status);\r
-\r
- Status = BdsBootLinuxFdt (BootOption->FilePathList,\r
- Initrd, // Initrd\r
- (CHAR8*)(LinuxArguments + 1),\r
- FdtDevicePath);\r
-\r
- FreePool (DefaultFdtDevicePath);\r
- FreePool (FdtDevicePath);\r
+ Status = BdsBootLinuxFdt (\r
+ BootOption->FilePathList,\r
+ Initrd,\r
+ (CHAR8*)(LinuxArguments + 1)\r
+ );\r
}\r
} else {\r
// Connect all the drivers if the EFI Application is not a EFI OS Loader\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath : DevicePath of the Default Boot Entry\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument : Argument for the Default Boot Entry\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType : Define the binary type of the Default Boot Entry (0=EFI application, 1=Linux kernel with ATAG support, 2=Linux Kernel with FDT support) \r
-gArmPlatformTokenSpaceGuid.PcdFdtDevicePath : DevicePath of the Platform Device Tree\r
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut : Timeout before booting on the Device Boot entry (by default the auto boot is skipped)\r
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths : List of Device Path use for the Console Input\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths : List of Device Path use for the Console Output\r
#include <Protocol/DevicePathFromText.h>\r
\r
#include <Guid/ArmGlobalVariableHob.h>\r
+#include <Guid/Fdt.h>\r
\r
#include <libfdt.h>\r
\r
IN CHAR8 **Argv\r
)\r
{\r
- EFI_STATUS Status;\r
- EFI_DEVICE_PATH* FdtDevicePath;\r
- EFI_PHYSICAL_ADDRESS FdtBlob;\r
- UINTN FdtBlobSize;\r
- UINTN Ret;\r
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;\r
+ EFI_STATUS Status;\r
+ VOID *FdtBlob;\r
+ UINTN Ret;\r
\r
// If no FDT file is passed to the argument then get the one from the platform\r
if (Argc < 2) {\r
- Status = GetEnvironmentVariable (L"Fdt", &gArmGlobalVariableGuid, NULL, NULL, (VOID**)&FdtDevicePath);\r
- if (Status == EFI_NOT_FOUND) {\r
- // No set yet, get the Default Device Path\r
- Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);\r
- ASSERT_EFI_ERROR(Status);\r
- FdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));\r
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &FdtBlob);\r
+ if (EFI_ERROR (Status)) {\r
+ Print (L"ERROR: Did not find the Fdt Blob.\n");\r
+ return Status;\r
}\r
} else {\r
return EFI_NOT_FOUND;\r
}\r
\r
- Status = BdsLoadImage (FdtDevicePath, AllocateAnyPages, &FdtBlob, &FdtBlobSize);\r
- if (EFI_ERROR(Status)) {\r
- Print (L"ERROR: Did not find the Fdt Blob.\n");\r
- return Status;\r
- }\r
-\r
- Ret = fdt_check_header((CONST VOID*)(UINTN)FdtBlob);\r
+ Ret = fdt_check_header (FdtBlob);\r
if (Ret != 0) {\r
- Print (L"ERROR: Device Tree header not valid (err:%d)\n",Ret);\r
- return Status;\r
+ Print (L"ERROR: Device Tree header not valid (err:%d)\n", Ret);\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
- DumpFdt ((VOID*)(UINTN)FdtBlob);\r
-\r
- FreePool (FdtDevicePath);\r
+ DumpFdt (FdtBlob);\r
\r
return EFI_SUCCESS;\r
}\r
\r
[Guids]\r
gEfiDebugImageInfoTableGuid\r
-\r
-[Pcd]\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath\r
+ gFdtTableGuid\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"console=tty0 console=ttyS2,115200n8 root=UUID=a4af765b-c2b5-48f4-9564-7a4e9104c4f6 rootwait ro earlyprintk"\r
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|1\r
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut|10\r
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/omap3-beagle.dtb"\r
\r
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();VenHw(E68088EF-D1A4-4336-C1DB-4D3A204730A6)"\r
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"\r
IN VOID *Buffer\r
)\r
{\r
- EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;\r
EFI_STATUS Status;\r
CHAR8 KernelArgs[BOOTIMG_KERNEL_ARGS_SIZE];\r
VOID *Kernel;\r
RamdiskDevicePath->Node1.EndingAddress = ((EFI_PHYSICAL_ADDRESS)(UINTN) Ramdisk) + RamdiskSize;\r
}\r
\r
- // Get the default FDT device path\r
- Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid,\r
- NULL, 0, (VOID **)&FdtDevicePath);\r
- if (Status == EFI_NOT_FOUND) {\r
- DEBUG ((EFI_D_ERROR, "Error: Please update FDT path in boot manager\n"));\r
- return EFI_DEVICE_ERROR;\r
- }\r
- ASSERT_EFI_ERROR (Status);\r
-\r
Status = BdsBootLinuxFdt (\r
(EFI_DEVICE_PATH_PROTOCOL *) &KernelDevicePath,\r
(EFI_DEVICE_PATH_PROTOCOL *) RamdiskDevicePath,\r
- KernelArgs,\r
- FdtDevicePath\r
+ KernelArgs\r
);\r
if (EFI_ERROR (Status)) {\r
DEBUG ((EFI_D_ERROR, "Couldn't Boot Linux: %d\n", Status));\r
FreePool (RamdiskDevicePath);\r
}\r
\r
- FreePool (FdtDevicePath);\r
-\r
// If we got here we do a confused face because BootLinuxFdt returned,\r
// reporting success.\r
DEBUG ((EFI_D_ERROR, "WARNING: BdsBootLinuxFdt returned EFI_SUCCESS.\n"));\r