diff options
22 files changed, 90 insertions, 193 deletions
diff --git a/ArmPkg/Application/LinuxLoader/LinuxFdtLoader.c b/ArmPkg/Application/LinuxLoader/LinuxFdtLoader.c index 07d0ea7b41..8e5d1c6aa0 100644 --- a/ArmPkg/Application/LinuxLoader/LinuxFdtLoader.c +++ b/ArmPkg/Application/LinuxLoader/LinuxFdtLoader.c @@ -39,7 +39,6 @@ UefiMain ( EFI_LOADED_IMAGE_PROTOCOL *LoadedImage;
LINUX_LOADER_OPTIONAL_DATA* LinuxOptionalData;
EFI_DEVICE_PATH* DevicePathKernel;
- EFI_DEVICE_PATH* DevicePathFdt;
EFI_DEVICE_PATH* InitrdDevicePath;
CHAR16* OptionalDataInitrd;
CHAR8* OptionalDataArguments;
@@ -57,9 +56,8 @@ UefiMain ( return EFI_UNSUPPORTED;
}
- // Generate the File Path Node for the Linux Kernel & Device Tree blob
+ // Generate the File Path Node for the Linux Kernel
DevicePathKernel = FileDevicePath (LoadedImage->DeviceHandle, LINUX_KERNEL_NAME);
- DevicePathFdt = FileDevicePath (LoadedImage->DeviceHandle, FDT_NAME);
if (LinuxOptionalData->CmdLineLength > 0) {
OptionalDataArguments = (CHAR8*)LinuxOptionalData + sizeof(LINUX_LOADER_OPTIONAL_DATA);
@@ -89,7 +87,7 @@ UefiMain ( }
// Load and Start the Linux Kernel (we should never return)
- Status = BdsBootLinuxFdt (DevicePathKernel, InitrdDevicePath, OptionalDataArguments, DevicePathFdt);
+ Status = BdsBootLinuxFdt (DevicePathKernel, InitrdDevicePath, OptionalDataArguments);
if ((UINTN)OptionalDataInitrd & 0x1) {
FreePool (Initrd);
diff --git a/ArmPkg/Include/Library/BdsLib.h b/ArmPkg/Include/Library/BdsLib.h index 9fa6870418..68dbfd57f2 100644 --- a/ArmPkg/Include/Library/BdsLib.h +++ b/ArmPkg/Include/Library/BdsLib.h @@ -160,9 +160,9 @@ BdsBootLinuxAtag ( /**
Start a Linux kernel from a Device Path
- @param LinuxKernel Device Path to the Linux Kernel
- @param Parameters Linux kernel arguments
- @param Fdt Device Path to the Flat Device Tree
+ @param[in] LinuxKernelDevicePath Device Path to the Linux Kernel
+ @param[in] InitrdDevicePath Device Path to the Initrd
+ @param[in] Arguments Linux kernel arguments
@retval EFI_SUCCESS All drivers have been connected
@retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
@@ -173,8 +173,7 @@ EFI_STATUS BdsBootLinuxFdt (
IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,
IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,
- IN CONST CHAR8* Arguments,
- IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath
+ IN CONST CHAR8* Arguments
);
/**
diff --git a/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c index e094413a53..76515978fc 100644 --- a/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c +++ b/ArmPkg/Library/BdsLib/AArch64/BdsLinuxLoader.c @@ -14,6 +14,8 @@ #include <Library/ArmGicLib.h>
#include <Ppi/ArmMpCoreInfo.h>
#include <Library/IoLib.h>
+#include <Guid/Fdt.h>
+#include <libfdt.h>
#include "BdsInternal.h"
#include "BdsLinuxLoader.h"
@@ -171,9 +173,9 @@ BdsBootLinuxAtag ( /**
Start a Linux kernel from a Device Path
- @param LinuxKernel Device Path to the Linux Kernel
- @param Parameters Linux kernel agruments
- @param Fdt Device Path to the Flat Device Tree
+ @param[in] LinuxKernelDevicePath Device Path to the Linux Kernel
+ @param[in] InitrdDevicePath Device Path to the Initrd
+ @param[in] Arguments Linux kernel arguments
@retval EFI_SUCCESS All drivers have been connected
@retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
@@ -184,26 +186,26 @@ EFI_STATUS BdsBootLinuxFdt (
IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,
IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,
- IN CONST CHAR8* Arguments,
- IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath
+ IN CONST CHAR8* Arguments
)
{
- EFI_STATUS Status;
- EFI_STATUS PenBaseStatus;
- UINTN LinuxImageSize;
- UINTN InitrdImageSize;
- UINTN InitrdImageBaseSize;
- UINTN FdtBlobSize;
- EFI_PHYSICAL_ADDRESS FdtBlobBase;
- EFI_PHYSICAL_ADDRESS LinuxImage;
- EFI_PHYSICAL_ADDRESS InitrdImage;
- EFI_PHYSICAL_ADDRESS InitrdImageBase;
- ARM_PROCESSOR_TABLE *ArmProcessorTable;
- ARM_CORE_INFO *ArmCoreInfoTable;
- UINTN Index;
- EFI_PHYSICAL_ADDRESS PenBase;
- UINTN PenSize;
- UINTN MailBoxBase;
+ EFI_STATUS Status;
+ EFI_STATUS PenBaseStatus;
+ UINTN LinuxImageSize;
+ UINTN InitrdImageSize;
+ UINTN InitrdImageBaseSize;
+ VOID *InstalledFdtBase;
+ UINTN FdtBlobSize;
+ EFI_PHYSICAL_ADDRESS FdtBlobBase;
+ EFI_PHYSICAL_ADDRESS LinuxImage;
+ EFI_PHYSICAL_ADDRESS InitrdImage;
+ EFI_PHYSICAL_ADDRESS InitrdImageBase;
+ ARM_PROCESSOR_TABLE *ArmProcessorTable;
+ ARM_CORE_INFO *ArmCoreInfoTable;
+ UINTN Index;
+ EFI_PHYSICAL_ADDRESS PenBase;
+ UINTN PenSize;
+ UINTN MailBoxBase;
PenBaseStatus = EFI_UNSUPPORTED;
PenSize = 0;
@@ -259,14 +261,18 @@ BdsBootLinuxFdt ( }
}
- // Load the FDT binary from a device path.
- // The FDT will be reloaded later to a more appropriate location for the Linux kernel.
- FdtBlobBase = LINUX_KERNEL_MAX_OFFSET;
- Status = BdsLoadImage (FdtDevicePath, AllocateMaxAddress, &FdtBlobBase, &FdtBlobSize);
- if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find Device Tree blob (%r).\n", Status);
+ //
+ // Get the FDT from the Configuration Table.
+ // The FDT will be reloaded in PrepareFdt() to a more appropriate
+ // location for the Linux Kernel.
+ //
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &InstalledFdtBase);
+ if (EFI_ERROR (Status)) {
+ Print (L"ERROR: Did not get the Device Tree blob (%r).\n", Status);
goto EXIT_FREE_INITRD;
}
+ FdtBlobBase = (EFI_PHYSICAL_ADDRESS)InstalledFdtBase;
+ FdtBlobSize = fdt_totalsize (InstalledFdtBase);
//
// Install secondary core pens if the Power State Coordination Interface is not supported
diff --git a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c index 42f301d9b9..e5fda081f8 100644 --- a/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c +++ b/ArmPkg/Library/BdsLib/Arm/BdsLinuxLoader.c @@ -12,6 +12,9 @@ *
**/
+#include <Guid/Fdt.h>
+#include <libfdt.h>
+
#include "BdsInternal.h"
#include "BdsLinuxLoader.h"
@@ -222,9 +225,9 @@ EXIT_FREE_LINUX: /**
Start a Linux kernel from a Device Path
- @param LinuxKernel Device Path to the Linux Kernel
- @param Parameters Linux kernel arguments
- @param Fdt Device Path to the Flat Device Tree
+ @param LinuxKernelDevicePath Device Path to the Linux Kernel
+ @param InitrdDevicePath Device Path to the Initrd
+ @param CommandLineArguments Linux command line
@retval EFI_SUCCESS All drivers have been connected
@retval EFI_NOT_FOUND The Linux kernel Device Path has not been found
@@ -235,19 +238,19 @@ EFI_STATUS BdsBootLinuxFdt (
IN EFI_DEVICE_PATH_PROTOCOL* LinuxKernelDevicePath,
IN EFI_DEVICE_PATH_PROTOCOL* InitrdDevicePath,
- IN CONST CHAR8* CommandLineArguments,
- IN EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath
+ IN CONST CHAR8* CommandLineArguments
)
{
- EFI_STATUS Status;
- UINT32 LinuxImageSize;
- UINT32 InitrdImageBaseSize = 0;
- UINT32 InitrdImageSize = 0;
- UINT32 FdtBlobSize;
- EFI_PHYSICAL_ADDRESS FdtBlobBase;
- EFI_PHYSICAL_ADDRESS LinuxImage;
- EFI_PHYSICAL_ADDRESS InitrdImageBase = 0;
- EFI_PHYSICAL_ADDRESS InitrdImage = 0;
+ EFI_STATUS Status;
+ UINT32 LinuxImageSize;
+ UINT32 InitrdImageBaseSize = 0;
+ UINT32 InitrdImageSize = 0;
+ VOID *InstalledFdtBase;
+ UINT32 FdtBlobSize;
+ EFI_PHYSICAL_ADDRESS FdtBlobBase;
+ EFI_PHYSICAL_ADDRESS LinuxImage;
+ EFI_PHYSICAL_ADDRESS InitrdImageBase = 0;
+ EFI_PHYSICAL_ADDRESS InitrdImage = 0;
PERF_START (NULL, "BDS", NULL, 0);
@@ -281,13 +284,18 @@ BdsBootLinuxFdt ( }
}
- // Load the FDT binary from a device path. The FDT will be reloaded later to a more appropriate location for the Linux kernel.
- FdtBlobBase = 0;
- Status = BdsLoadImage (FdtDevicePath, AllocateAnyPages, &FdtBlobBase, &FdtBlobSize);
- if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find Device Tree blob.\n");
+ //
+ // Get the FDT from the Configuration Table.
+ // The FDT will be reloaded in PrepareFdt() to a more appropriate
+ // location for the Linux Kernel.
+ //
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &InstalledFdtBase);
+ if (EFI_ERROR (Status)) {
+ Print (L"ERROR: Did not get the Device Tree blob (%r).\n", Status);
goto EXIT_FREE_INITRD;
}
+ FdtBlobBase = (EFI_PHYSICAL_ADDRESS)(UINTN)InstalledFdtBase;
+ FdtBlobSize = fdt_totalsize (InstalledFdtBase);
// Update the Fdt with the Initrd information. The FDT will increase in size.
// By setting address=0 we leave the memory allocation to the function
diff --git a/ArmPkg/Library/BdsLib/BdsLib.inf b/ArmPkg/Library/BdsLib/BdsLib.inf index 6d6a2dfa8a..ecf6de52d0 100644 --- a/ArmPkg/Library/BdsLib/BdsLib.inf +++ b/ArmPkg/Library/BdsLib/BdsLib.inf @@ -36,10 +36,10 @@ AArch64/BdsLinuxLoaderHelper.S
[Packages]
- MdePkg/MdePkg.dec
- MdeModulePkg/MdeModulePkg.dec
EmbeddedPkg/EmbeddedPkg.dec
ArmPkg/ArmPkg.dec
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
ArmPlatformPkg/ArmPlatformPkg.dec
[LibraryClasses]
@@ -63,6 +63,7 @@ gEfiFileInfoGuid
gArmMpCoreInfoGuid
gArmGlobalVariableGuid
+ gFdtTableGuid
[Protocols]
gEfiBdsArchProtocolGuid
diff --git a/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dsc b/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dsc index 9b12528922..a260286eae 100644 --- a/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dsc +++ b/ArmPlatformPkg/ArmJunoPkg/ArmJuno.dsc @@ -140,7 +140,6 @@ #
gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"Linux from NOR Flash"
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/Image"
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(E7223039-5836-41E1-B542-D7EC736C5E59)/juno.dtb"
# Support the Linux EFI stub by default
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|L"console=ttyAMA0,115200 earlycon=pl011,0x7ff80000 root=/dev/sda1 rootwait verbose debug"
diff --git a/ArmPlatformPkg/ArmPlatformPkg.dec b/ArmPlatformPkg/ArmPlatformPkg.dec index 44597cefd8..9364bb92c5 100644 --- a/ArmPlatformPkg/ArmPlatformPkg.dec +++ b/ArmPlatformPkg/ArmPlatformPkg.dec @@ -135,7 +135,6 @@ # - 1 = a Linux kernel with ATAG support
# - 2 = a Linux kernel with FDT support
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|0|UINT32|0x00000010
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L""|VOID*|0x00000011
## Timeout value for displaying progressing bar in before boot OS.
# According to UEFI 2.0 spec, the default TimeOut should be 0xffff.
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc index e765617d69..c4bc514bee 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-CTA15-A7.dsc @@ -190,7 +190,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0xE000000,0xE800000)"
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"console=ttyAMA0,38400 earlyprintk debug verbose"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(1F15DA3C-37FF-4070-B471-BB4AF12A724A)/MemoryMapped(0x0,0x0E800000,0x0E803000)"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
# PL111 - CLCD
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc index f0c99dae94..d5d19461d4 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-FVP-AArch64.dsc @@ -183,7 +183,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|L"console=ttyAMA0 earlycon=pl011,0x1c090000 debug user_debug=31 loglevel=9"
# Use EFI Stub
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|0
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/fdt.dtb"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc index 6c84980777..1a7ff24990 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15.dsc @@ -167,7 +167,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-cortex_a15x1.dtb"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc index 0021a0a235..e91cbb2f87 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A15_MPCore.dsc @@ -169,7 +169,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-cortex_a15x4.dtb"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc index a13f443712..df82e597b5 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-A9x4.dsc @@ -170,7 +170,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription|L"SemiHosting"
gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/zImage"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-cortex_a9x4.dtb"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc index c05043533d..c1cd6791d0 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4-foundation.dsc @@ -132,7 +132,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/Image"
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"root=/dev/vda2 rw console=ttyAMA0 earlyprintk=pl011,0x1c090000 maxcpus=4 debug user_debug=31 loglevel=9"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/foundation-v8.dtb"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();"
@@ -141,7 +140,7 @@ #
# ARM Architectural Timer Frequency
#
- # Set model tick to 100Mhz. This depends a lot on workstation performance.
+ # Set model tick to 100MHz. This depends a lot on workstation performance.
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[PcdsDynamicDefault.common]
diff --git a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc index 4d4c62555c..eae58f610e 100644 --- a/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc +++ b/ArmPlatformPkg/ArmVExpressPkg/ArmVExpress-RTSM-AEMv8Ax4.dsc @@ -161,7 +161,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/Image"
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"root=/dev/mmcblk0p2 console=ttyAMA0 earlyprintk=pl011,0x1c090000 debug user_debug=31 loglevel=9"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|2
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(C5B9C74A-6D72-4719-99AB-C59F199091EB)/rtsm_ve-aemv8a.dtb"
# Use the serial console (ConIn & ConOut) and the Graphic driver (ConOut)
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(38400,8,N,1)/VenPcAnsi();VenHw(407B4008-BF5B-11DF-9547-CF16E0D72085)"
@@ -170,7 +169,7 @@ #
# ARM Architectural Timer Frequency
#
- # Set model tick to 100Mhz. This depends a lot on workstation performance.
+ # Set model tick to 100MHz. This depends a lot on workstation performance.
gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|100000000
[PcdsDynamicDefault.common]
diff --git a/ArmPlatformPkg/Bds/Bds.inf b/ArmPlatformPkg/Bds/Bds.inf index 190bbc9975..d49b0efdcb 100644 --- a/ArmPlatformPkg/Bds/Bds.inf +++ b/ArmPlatformPkg/Bds/Bds.inf @@ -73,7 +73,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootInitrdPath
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument
gArmPlatformTokenSpaceGuid.PcdDefaultBootType
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index 04a2eee6f5..76c66fd0bb 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -824,63 +824,6 @@ ErrorExit: return Status ;
}
-EFI_STATUS
-UpdateFdtPath (
- IN LIST_ENTRY *BootOptionsList
- )
-{
- EFI_STATUS Status;
- UINTN FdtDevicePathSize;
- BDS_SUPPORTED_DEVICE *SupportedBootDevice;
- EFI_DEVICE_PATH_PROTOCOL *FdtDevicePathNodes;
- EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;
-
- Status = SelectBootDevice (&SupportedBootDevice);
- if (EFI_ERROR(Status)) {
- Status = EFI_ABORTED;
- goto EXIT;
- }
-
- // Create the specific device path node
- Status = SupportedBootDevice->Support->CreateDevicePathNode (L"FDT blob", &FdtDevicePathNodes);
- if (EFI_ERROR(Status)) {
- Status = EFI_ABORTED;
- goto EXIT;
- }
-
- if (FdtDevicePathNodes != NULL) {
- // Append the Device Path node to the select device path
- FdtDevicePath = AppendDevicePath (SupportedBootDevice->DevicePathProtocol, FdtDevicePathNodes);
- // Free the FdtDevicePathNodes created by Support->CreateDevicePathNode()
- FreePool (FdtDevicePathNodes);
- FdtDevicePathSize = GetDevicePathSize (FdtDevicePath);
- Status = gRT->SetVariable (
- (CHAR16*)L"Fdt",
- &gArmGlobalVariableGuid,
- EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
- FdtDevicePathSize,
- FdtDevicePath
- );
- ASSERT_EFI_ERROR(Status);
- } else {
- Status = gRT->SetVariable (
- (CHAR16*)L"Fdt",
- &gArmGlobalVariableGuid,
- EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
- 0,
- NULL
- );
- ASSERT_EFI_ERROR(Status);
- }
-
-EXIT:
- if (Status == EFI_ABORTED) {
- Print(L"\n");
- }
- FreePool(SupportedBootDevice);
- return Status;
-}
-
/**
Set boot timeout
@@ -937,7 +880,6 @@ struct BOOT_MANAGER_ENTRY { { L"Update Boot Device Entry", BootMenuUpdateBootOption },
{ L"Remove Boot Device Entry", BootMenuRemoveBootOption },
{ L"Reorder Boot Device Entries", BootMenuReorderBootOptions },
- { L"Update FDT path", UpdateFdtPath },
{ L"Set Boot Timeout", BootMenuSetBootTimeout },
};
diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c index 80982222e1..889040e3b6 100644 --- a/ArmPlatformPkg/Bds/BootOption.c +++ b/ArmPlatformPkg/Bds/BootOption.c @@ -21,13 +21,9 @@ BootOptionStart ( )
{
EFI_STATUS Status;
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol;
UINT32 LoaderType;
ARM_BDS_LOADER_OPTIONAL_DATA* OptionalData;
ARM_BDS_LINUX_ARGUMENTS* LinuxArguments;
- EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath;
- EFI_DEVICE_PATH_PROTOCOL* DefaultFdtDevicePath;
- UINTN FdtDevicePathSize;
UINTN CmdLineSize;
UINTN InitrdSize;
EFI_DEVICE_PATH* Initrd;
@@ -69,25 +65,11 @@ BootOptionStart ( } else {
Initrd = NULL;
}
-
- // Get the default FDT device path
- Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);
- ASSERT_EFI_ERROR(Status);
- DefaultFdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));
-
- // Get the FDT device path
- FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath);
- Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid,
- DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);
- ASSERT_EFI_ERROR(Status);
-
- Status = BdsBootLinuxFdt (BootOption->FilePathList,
- Initrd, // Initrd
- (CHAR8*)(LinuxArguments + 1),
- FdtDevicePath);
-
- FreePool (DefaultFdtDevicePath);
- FreePool (FdtDevicePath);
+ Status = BdsBootLinuxFdt (
+ BootOption->FilePathList,
+ Initrd,
+ (CHAR8*)(LinuxArguments + 1)
+ );
}
} else {
// Connect all the drivers if the EFI Application is not a EFI OS Loader
diff --git a/ArmPlatformPkg/Documentation/ArmPlatformPkg.txt b/ArmPlatformPkg/Documentation/ArmPlatformPkg.txt index e591767a10..7a400cc2fb 100644 --- a/ArmPlatformPkg/Documentation/ArmPlatformPkg.txt +++ b/ArmPlatformPkg/Documentation/ArmPlatformPkg.txt @@ -46,7 +46,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootDescription : Description of the D gArmPlatformTokenSpaceGuid.PcdDefaultBootDevicePath : DevicePath of the Default Boot Entry
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument : Argument for the Default Boot Entry
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)
-gArmPlatformTokenSpaceGuid.PcdFdtDevicePath : DevicePath of the Platform Device Tree
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut : Timeout before booting on the Device Boot entry (by default the auto boot is skipped)
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths : List of Device Path use for the Console Input
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths : List of Device Path use for the Console Output
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c b/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c index dcd7c41001..8aae7b2c4e 100644 --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdFdt.c @@ -27,6 +27,7 @@ #include <Protocol/DevicePathFromText.h>
#include <Guid/ArmGlobalVariableHob.h>
+#include <Guid/Fdt.h>
#include <libfdt.h>
@@ -178,41 +179,28 @@ EblDumpFdt ( IN CHAR8 **Argv
)
{
- EFI_STATUS Status;
- EFI_DEVICE_PATH* FdtDevicePath;
- EFI_PHYSICAL_ADDRESS FdtBlob;
- UINTN FdtBlobSize;
- UINTN Ret;
- EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL *EfiDevicePathFromTextProtocol;
+ EFI_STATUS Status;
+ VOID *FdtBlob;
+ UINTN Ret;
// If no FDT file is passed to the argument then get the one from the platform
if (Argc < 2) {
- Status = GetEnvironmentVariable (L"Fdt", &gArmGlobalVariableGuid, NULL, NULL, (VOID**)&FdtDevicePath);
- if (Status == EFI_NOT_FOUND) {
- // No set yet, get the Default Device Path
- Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol);
- ASSERT_EFI_ERROR(Status);
- FdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath));
+ Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &FdtBlob);
+ if (EFI_ERROR (Status)) {
+ Print (L"ERROR: Did not find the Fdt Blob.\n");
+ return Status;
}
} else {
return EFI_NOT_FOUND;
}
- Status = BdsLoadImage (FdtDevicePath, AllocateAnyPages, &FdtBlob, &FdtBlobSize);
- if (EFI_ERROR(Status)) {
- Print (L"ERROR: Did not find the Fdt Blob.\n");
- return Status;
- }
-
- Ret = fdt_check_header((CONST VOID*)(UINTN)FdtBlob);
+ Ret = fdt_check_header (FdtBlob);
if (Ret != 0) {
- Print (L"ERROR: Device Tree header not valid (err:%d)\n",Ret);
- return Status;
+ Print (L"ERROR: Device Tree header not valid (err:%d)\n", Ret);
+ return EFI_INVALID_PARAMETER;
}
- DumpFdt ((VOID*)(UINTN)FdtBlob);
-
- FreePool (FdtDevicePath);
+ DumpFdt (FdtBlob);
return EFI_SUCCESS;
}
diff --git a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf index 5506c77ebe..c4b2ae1f64 100644 --- a/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf +++ b/ArmPlatformPkg/Library/EblCmdLib/EblCmdLib.inf @@ -61,6 +61,4 @@ [Guids]
gEfiDebugImageInfoTableGuid
-
-[Pcd]
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath
+ gFdtTableGuid
diff --git a/BeagleBoardPkg/BeagleBoardPkg.dsc b/BeagleBoardPkg/BeagleBoardPkg.dsc index 64d207e33f..3fbd79d07a 100644 --- a/BeagleBoardPkg/BeagleBoardPkg.dsc +++ b/BeagleBoardPkg/BeagleBoardPkg.dsc @@ -355,7 +355,6 @@ gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument|"console=tty0 console=ttyS2,115200n8 root=UUID=a4af765b-c2b5-48f4-9564-7a4e9104c4f6 rootwait ro earlyprintk"
gArmPlatformTokenSpaceGuid.PcdDefaultBootType|1
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut|10
- gArmPlatformTokenSpaceGuid.PcdFdtDevicePath|L"VenHw(B615F1F5-5088-43CD-809C-A16E52487D00)/HD(1,MBR,0x00000000,0x3F,0x19FC0)/omap3-beagle.dtb"
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi();VenHw(E68088EF-D1A4-4336-C1DB-4D3A204730A6)"
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths|L"VenHw(D3987D4B-971A-435F-8CAF-4967EB627241)/Uart(115200,8,N,1)/VenPcAnsi()"
diff --git a/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c b/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c index d4e1904d7d..7e9ad880ba 100644 --- a/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c +++ b/EmbeddedPkg/Application/AndroidFastboot/Arm/BootAndroidBootImg.c @@ -56,7 +56,6 @@ BootAndroidBootImg ( IN VOID *Buffer
)
{
- EFI_DEVICE_PATH_PROTOCOL *FdtDevicePath;
EFI_STATUS Status;
CHAR8 KernelArgs[BOOTIMG_KERNEL_ARGS_SIZE];
VOID *Kernel;
@@ -93,20 +92,10 @@ BootAndroidBootImg ( RamdiskDevicePath->Node1.EndingAddress = ((EFI_PHYSICAL_ADDRESS)(UINTN) Ramdisk) + RamdiskSize;
}
- // Get the default FDT device path
- Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid,
- NULL, 0, (VOID **)&FdtDevicePath);
- if (Status == EFI_NOT_FOUND) {
- DEBUG ((EFI_D_ERROR, "Error: Please update FDT path in boot manager\n"));
- return EFI_DEVICE_ERROR;
- }
- ASSERT_EFI_ERROR (Status);
-
Status = BdsBootLinuxFdt (
(EFI_DEVICE_PATH_PROTOCOL *) &KernelDevicePath,
(EFI_DEVICE_PATH_PROTOCOL *) RamdiskDevicePath,
- KernelArgs,
- FdtDevicePath
+ KernelArgs
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "Couldn't Boot Linux: %d\n", Status));
@@ -117,8 +106,6 @@ BootAndroidBootImg ( FreePool (RamdiskDevicePath);
}
- FreePool (FdtDevicePath);
-
// If we got here we do a confused face because BootLinuxFdt returned,
// reporting success.
DEBUG ((EFI_D_ERROR, "WARNING: BdsBootLinuxFdt returned EFI_SUCCESS.\n"));
|