#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