diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-04 10:02:49 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-04 10:02:49 +0000 |
commit | 1c1e70fa6e1e986992afbb282d048483cbe0b319 (patch) | |
tree | 6cadc350b66d6a76d96e165c277fa64f98cf5cce /ArmPkg/Library/BdsLib | |
parent | f3de0a607dd36d045ef8d1782db5e9c296cf6b43 (diff) | |
download | edk2-1c1e70fa6e1e986992afbb282d048483cbe0b319.zip edk2-1c1e70fa6e1e986992afbb282d048483cbe0b319.tar.gz edk2-1c1e70fa6e1e986992afbb282d048483cbe0b319.tar.bz2 |
ArmPkg/BdsLib: Linux kernel supports either FDT or ATAG
If a FDT blob is passed to the kernel it is required we can load it.
If we fail to load the binary then we must abort the Linux booting
process.
ArmPkg/CpuDxe: Ensure the reset vector passed to the CP15 VBAR register is aligned on the right boundary
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11968 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library/BdsLib')
-rw-r--r-- | ArmPkg/Library/BdsLib/BdsLinuxLoader.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ArmPkg/Library/BdsLib/BdsLinuxLoader.c b/ArmPkg/Library/BdsLib/BdsLinuxLoader.c index ca5e547..f463fd9 100644 --- a/ArmPkg/Library/BdsLib/BdsLinuxLoader.c +++ b/ArmPkg/Library/BdsLib/BdsLinuxLoader.c @@ -201,7 +201,7 @@ BdsBootLinux ( EFI_STATUS Status; UINT32 LinuxImageSize; UINT32 KernelParamsSize; - VOID* KernelParamsAddress = NULL; + EFI_PHYSICAL_ADDRESS KernelParamsAddress; UINT32 MachineType; BOOLEAN FdtSupported = FALSE; LINUX_KERNEL LinuxKernel; @@ -214,15 +214,19 @@ BdsBootLinux ( LinuxImage = LINUX_KERNEL_MAX_OFFSET; Status = BdsLoadImage (LinuxKernelDevicePath, AllocateMaxAddress, &LinuxImage, &LinuxImageSize); if (EFI_ERROR(Status)) { - DEBUG ((EFI_D_ERROR, "ERROR: Do not find Linux kernel.\n")); + Print (L"ERROR: Did not find Linux kernel.\n"); return Status; } LinuxKernel = (LINUX_KERNEL)(UINTN)LinuxImage; - // Load the FDT binary from a device path - KernelParamsAddress = (VOID*)LINUX_ATAG_MAX_OFFSET; - Status = BdsLoadImage (FdtDevicePath, AllocateMaxAddress, (EFI_PHYSICAL_ADDRESS*)&KernelParamsAddress, &KernelParamsSize); - if (!EFI_ERROR(Status)) { + if (FdtDevicePath) { + // Load the FDT binary from a device path + KernelParamsAddress = LINUX_ATAG_MAX_OFFSET; + Status = BdsLoadImage (FdtDevicePath, AllocateMaxAddress, &KernelParamsAddress, &KernelParamsSize); + if (EFI_ERROR(Status)) { + Print (L"ERROR: Did not find Device Tree blob.\n"); + return Status; + } FdtSupported = TRUE; } @@ -259,7 +263,7 @@ BdsBootLinux ( // physical memory. if ((UINTN)KernelParamsAddress > LINUX_ATAG_MAX_OFFSET) { //Note: There is no requirement on the alignment - KernelParamsAddress = CopyMem (ALIGN32_BELOW(LINUX_ATAG_MAX_OFFSET - KernelParamsSize), KernelParamsAddress, KernelParamsSize); + KernelParamsAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)CopyMem (ALIGN32_BELOW(LINUX_ATAG_MAX_OFFSET - KernelParamsSize), (VOID*)(UINTN)KernelParamsAddress, KernelParamsSize); } if ((UINTN)LinuxImage > LINUX_KERNEL_MAX_OFFSET) { |