mirror of https://github.com/acidanthera/audk.git
ArmPlatformPkg/Bds: Remove any use of the "Fdt" UEFI variable
Remove the option to update the "Fdt" UEFI variable in the ARM BDS as the "setfdt" EFI Shell command provides this service from now. Remove the use of this variable in the legacy kernel boot loader and use the FDT installed in the configuration table instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <Ronald.Cron@arm.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16940 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7aec2926b9
commit
6332ffb0af
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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)"
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -73,7 +73,6 @@
|
|||
gArmPlatformTokenSpaceGuid.PcdDefaultBootInitrdPath
|
||||
gArmPlatformTokenSpaceGuid.PcdDefaultBootArgument
|
||||
gArmPlatformTokenSpaceGuid.PcdDefaultBootType
|
||||
gArmPlatformTokenSpaceGuid.PcdFdtDevicePath
|
||||
gArmPlatformTokenSpaceGuid.PcdPlatformBootTimeOut
|
||||
gArmPlatformTokenSpaceGuid.PcdDefaultConInPaths
|
||||
gArmPlatformTokenSpaceGuid.PcdDefaultConOutPaths
|
||||
|
|
|
@ -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 },
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -61,6 +61,4 @@
|
|||
|
||||
[Guids]
|
||||
gEfiDebugImageInfoTableGuid
|
||||
|
||||
[Pcd]
|
||||
gArmPlatformTokenSpaceGuid.PcdFdtDevicePath
|
||||
gFdtTableGuid
|
||||
|
|
|
@ -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()"
|
||||
|
|
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue