The patch been modified as per the new changes in 
ArmPlatformPkg/Bds/BootOption.c

Signed-off-by: Shivamurthy Shastri <[email protected]>
Signed-off-by: Rony Nandy <[email protected]>
---
 ...-created-to-incorporate-auto-boot-feature.patch | 197 +++++++++++----------
 1 file changed, 105 insertions(+), 92 deletions(-)

diff --git 
a/SamsungPlatformPkg/patches/0001-The-patch-created-to-incorporate-auto-boot-feature.patch
 
b/SamsungPlatformPkg/patches/0001-The-patch-created-to-incorporate-auto-boot-feature.patch
index 91aea96..136e7b0 100644
--- 
a/SamsungPlatformPkg/patches/0001-The-patch-created-to-incorporate-auto-boot-feature.patch
+++ 
b/SamsungPlatformPkg/patches/0001-The-patch-created-to-incorporate-auto-boot-feature.patch
@@ -1,63 +1,62 @@
-From 011bc2be4b3f2a5a5413511d7380b6fe3632d0f5 Mon Sep 17 00:00:00 2001
+From 3c9dabb0f20f41c37e1e18c7fcc9a39ce8bfc51d Mon Sep 17 00:00:00 2001
 From: Shivamurthy Shastri <[email protected]>
-Date: Wed, 5 Dec 2012 14:44:57 +0530
+Date: Fri, 22 Feb 2013 14:33:57 +0530
 Subject: [PATCH] The patch created to incorporate auto boot feature for
  arndale board.
 
 Signed-off-by: Shivamurthy Shastri <[email protected]>
 ---
- ArmPlatformPkg/Bds/BootOption.c | 71 ++++++++++++++++++++++++++++++++++++++---
- 1 file changed, 67 insertions(+), 4 deletions(-)
+ ArmPlatformPkg/Bds/BootOption.c | 85 ++++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 75 insertions(+), 10 deletions(-)
 
 diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c
-index 289d36a..468050d 100644
+index 78a4230..f35d039 100644
 --- a/ArmPlatformPkg/Bds/BootOption.c
 +++ b/ArmPlatformPkg/Bds/BootOption.c
-@@ -14,6 +14,11 @@
- 
- #include "BdsInternal.h"
- 
+@@ -13,6 +13,10 @@
+ **/
+ 
+ #include "BdsInternal.h"
 +#include <Library/DxeServicesTableLib.h>
 +#include <Protocol/BlockIo.h>
 +#include <Guid/DebugImageInfoTable.h>
 +#include <Protocol/DevicePathToText.h>
-+
- extern EFI_HANDLE mImageHandle;
- 
- EFI_STATUS
-@@ -22,26 +27,61 @@ BootOptionStart (
-   )
- {
-   EFI_STATUS                            Status;
--  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL*   EfiDevicePathFromTextProtocol;
-+  //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;
-+  //EFI_DEVICE_PATH_PROTOCOL*             DefaultFdtDevicePath;
-+  //UINTN                                 FdtDevicePathSize;
-   UINTN                                 CmdLineSize;
-   UINTN                                 InitrdSize;
-   EFI_DEVICE_PATH*                      Initrd;
-   UINT16                                LoadOptionIndexSize;
- 
-+  UINTN                     HandleCount;
-+  EFI_HANDLE                *HandleBuffer;
-+  UINTN                     Index;
-+  //CHAR16*                   String;
-+  //EFI_DEVICE_PATH_PROTOCOL* DevicePathProtocol;
-+  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL*  DevicePathToTextProtocol;
-+  EFI_DEVICE_PATH_PROTOCOL  *LoadImageDevicePath;
-+  EFI_DEVICE_PATH_PROTOCOL  *FileSystemDevicePath;
-+
-   if (IS_ARM_BDS_BOOTENTRY (BootOption)) {
-     Status = EFI_UNSUPPORTED;
-     OptionalData = BootOption->OptionalData;
-     LoaderType = ReadUnaligned32 ((CONST 
UINT32*)&OptionalData->Header.LoaderType);
- 
+ 
+ extern EFI_HANDLE mImageHandle;
+ 
+@@ -22,48 +26,91 @@ BootOptionStart (
+   )
+ {
+   EFI_STATUS                            Status;
+-  EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL*   EfiDevicePathFromTextProtocol;
++  //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;
++  //EFI_DEVICE_PATH_PROTOCOL*             DefaultFdtDevicePath;
++  //UINTN                                 FdtDevicePathSize;
++  //UINTN                                 CmdLineSize;
+   UINTN                                 InitrdSize;
+   EFI_DEVICE_PATH*                      Initrd;
+-  UINTN                                 FdtLocalSize;
++  //UINTN                                 FdtLocalSize;
+   UINT16                                LoadOptionIndexSize;
++  UINTN                               HandleCount;
++  EFI_HANDLE*                         HandleBuffer;
++  UINTN                               Index;
++  EFI_DEVICE_PATH_TO_TEXT_PROTOCOL*   DevicePathToTextProtocol;
++  EFI_DEVICE_PATH_PROTOCOL*           LoadImageDevicePath;
++  EFI_DEVICE_PATH_PROTOCOL*           FileSystemDevicePath;
+ 
+   if (IS_ARM_BDS_BOOTENTRY (BootOption)) {
+     Status = EFI_UNSUPPORTED;
+     OptionalData = BootOption->OptionalData;
+     LoaderType = ReadUnaligned32 ((CONST 
UINT32*)&OptionalData->Header.LoaderType);
+ 
 +    BdsConnectAllDrivers();
 +
 +    Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, 
(VOID **)&DevicePathToTextProtocol);
@@ -72,12 +71,6 @@ index 289d36a..468050d 100644
 +        return Status;
 +      }
 +
-+      /*for (Index = 0; Index < HandleCount; Index++) {
-+          Status = gBS->HandleProtocol (HandleBuffer[Index], 
&gEfiDevicePathProtocolGuid, (VOID **)&DevicePathProtocol);
-+          String = 
DevicePathToTextProtocol->ConvertDevicePathToText(DevicePathProtocol,TRUE,TRUE);
-+          Print (L"[0x%X] %s\n",(UINT32)HandleBuffer[Index], String);
-+      }*/
-+
 +     for (Index = 0; Index < HandleCount; Index++) {
 +         //Get the device path
 +         FileSystemDevicePath = DevicePathFromHandle(HandleBuffer[Index]);
@@ -85,66 +78,86 @@ index 289d36a..468050d 100644
 +                continue;
 +         }
 +
-     if (LoaderType == BDS_LOADER_EFI_APPLICATION) {
-       // Need to connect every drivers to ensure no dependencies are missing 
for the application
--      BdsConnectAllDrivers();
- 
-       Status = BdsStartEfiApplication (mImageHandle, 
BootOption->FilePathList, 0, NULL);
-     } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {
-@@ -55,9 +95,18 @@ BootOptionStart (
-         Initrd = NULL;
-       }
- 
+     if (LoaderType == BDS_LOADER_EFI_APPLICATION) {
+       // Need to connect every drivers to ensure no dependencies are missing 
for the application
+-      BdsConnectAllDrivers();
+ 
+       Status = BdsStartEfiApplication (mImageHandle, 
BootOption->FilePathList, 0, NULL);
+     } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) {
+       LinuxArguments = &(OptionalData->Arguments.LinuxArguments);
+-      CmdLineSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->CmdLineSize);
++      //CmdLineSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->CmdLineSize);
+       InitrdSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->InitrdSize);
+ 
++#if 0
+       if (InitrdSize > 0) {
+         Initrd = GetAlignedDevicePath 
((EFI_DEVICE_PATH*)((UINTN)(LinuxArguments + 1) + CmdLineSize));
+       } else {
+         Initrd = NULL;
+       }
+-
++#endif
++
 +      //Check if zImage file on SD-MMC.
 +      LoadImageDevicePath = FileDevicePath(HandleBuffer[Index], L"uImage");
++      if (InitrdSize > 0) {
++         Initrd = FileDevicePath(HandleBuffer[Index], L"uInitrd");
++      } else {
++        Initrd = NULL;
++      }
 +      Status = BdsBootLinuxAtag (LoadImageDevicePath, Initrd, 
(CHAR8*)(LinuxArguments + 1));
 +      if (EFI_ERROR(Status)) {
-+              continue;
++       continue;
 +      }
 +
 +#if 0
-       Status = BdsBootLinuxAtag (BootOption->FilePathList,
-                                  Initrd, // Initrd
-                                  (CHAR8*)(LinuxArguments + 1)); // CmdLine
+       Status = BdsBootLinuxAtag (BootOption->FilePathList,
+                                  Initrd, // Initrd
+                                  (CHAR8*)(LinuxArguments + 1)); // CmdLine
 +#endif
-     } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_FDT) {
-       LinuxArguments = &(OptionalData->Arguments.LinuxArguments);
-       CmdLineSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->CmdLineSize);
-@@ -69,6 +118,7 @@ BootOptionStart (
-         Initrd = NULL;
-       }
- 
+     } else if ((LoaderType == BDS_LOADER_KERNEL_LINUX_GLOBAL_FDT) || 
(LoaderType == BDS_LOADER_KERNEL_LINUX_LOCAL_FDT)) {
+       LinuxArguments = &(OptionalData->Arguments.LinuxArguments);
+-      CmdLineSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->CmdLineSize);
++      //CmdLineSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->CmdLineSize);
+       InitrdSize = ReadUnaligned16 ((CONST 
UINT16*)&LinuxArguments->InitrdSize);
+ 
 +#if 0
-       // Get the default FDT device path
-       Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, 
NULL, (VOID **)&EfiDevicePathFromTextProtocol);
-       ASSERT_EFI_ERROR(Status);
-@@ -78,13 +128,26 @@ BootOptionStart (
-       FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath);
-       Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", 
DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);
-       ASSERT_EFI_ERROR(Status);
+       if (InitrdSize > 0) {
+         Initrd = GetAlignedDevicePath 
((EFI_DEVICE_PATH*)((UINTN)(LinuxArguments + 1) + CmdLineSize));
+       } else {
+@@ -89,13 +136,31 @@ BootOptionStart (
+         Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", 
DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath);
+         ASSERT_EFI_ERROR(Status);
+       }
+-
 +#endif
 +
 +      //Check if zImage file on SD-MMC.
 +      LoadImageDevicePath = FileDevicePath(HandleBuffer[Index], L"uImage");
-+      FdtDevicePath = FileDevicePath(HandleBuffer[Index], 
L"exynos5250-arndale.dtb");
++      FdtDevicePath = FileDevicePath(HandleBuffer[Index], L"board.dtb");
++      if (InitrdSize > 0) {
++         Initrd = FileDevicePath(HandleBuffer[Index], L"uInitrd");
++      } else {
++        Initrd = NULL;
++      }
 +      Status = BdsBootLinuxFdt (LoadImageDevicePath, Initrd, 
(CHAR8*)(LinuxArguments + 1), FdtDevicePath);
 +      FreePool (FdtDevicePath);
 +      if (EFI_ERROR(Status)) {
 +        continue;
 +      }
 +     }
- 
++
 +#if 0
-       Status = BdsBootLinuxFdt (BootOption->FilePathList,
-                                 Initrd, // Initrd
-                                 (CHAR8*)(LinuxArguments + 1),
-                                 FdtDevicePath);
- 
-       FreePool (FdtDevicePath);
+       Status = BdsBootLinuxFdt (BootOption->FilePathList,
+                                 Initrd, // Initrd
+                                 (CHAR8*)(LinuxArguments + 1),
+                                 FdtDevicePath);
+ 
+       FreePool (FdtDevicePath);
 +#endif
-     }
-   } else {
-     // Set BootCurrent variable
+     }
+   } else {
+     // Set BootCurrent variable
 -- 
-1.8.0
+1.8.1.1
 
-- 
1.8.1.1


_______________________________________________
boot-architecture mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/boot-architecture

Reply via email to