From patchwork Tue Mar 19 11:27:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shivamurthy Shastri X-Patchwork-Id: 15431 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 95D7623DEE for ; Tue, 19 Mar 2013 11:27:09 +0000 (UTC) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by fiordland.canonical.com (Postfix) with ESMTP id 41248A18C75 for ; Tue, 19 Mar 2013 11:27:09 +0000 (UTC) Received: by mail-vc0-f175.google.com with SMTP id hf12so253809vcb.20 for ; Tue, 19 Mar 2013 04:27:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:dkim-signature:x-received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references:x-gm-message-state; bh=bWQZlyqRsyayIMjULHP92eezO8YQ8PAAHQyMBgD5qjA=; b=X4+fhBHKt6RDMDOYMGG/Y2hDyk0jIZOKVrjkT/23ScFoGg72nx/lweznEunEQAQWiN k38V6jmC+ofZD4NJAtqESCSzd1WPpOd1S2BxEO+pKuW/eOH2OXNkL+hBiKH3QmnJiqX3 vALILu5bexRm2Z9bOyfIGDthDUDeLszK3e7G0fM31HPzhk89Altq3GKNFPId7o0swXr/ ie/oe33GcXK1J7H7mODpBJGy2B+ZAhicAvWdINuAJLhS2VAEkv1RbaVHEHqcNIhn9/ZE M31y4NMxwFWh80INLXGlQbc9D5HR4zBTwoISXzfV8BHKDdYtH4LZSAIiZtc2PU60f1R2 dxVg== X-Received: by 10.220.214.6 with SMTP id gy6mr2016692vcb.8.1363692428752; Tue, 19 Mar 2013 04:27:08 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp92776veb; Tue, 19 Mar 2013 04:27:07 -0700 (PDT) X-Received: by 10.68.26.234 with SMTP id o10mr2394488pbg.211.1363692427428; Tue, 19 Mar 2013 04:27:07 -0700 (PDT) Received: from mail-da0-x22a.google.com (mail-da0-x22a.google.com [2607:f8b0:400e:c00::22a]) by mx.google.com with ESMTPS id zz9si25414131pbc.269.2013.03.19.04.27.06 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Mar 2013 04:27:07 -0700 (PDT) Received-SPF: pass (google.com: domain of shiva.linuxworks@gmail.com designates 2607:f8b0:400e:c00::22a as permitted sender) client-ip=2607:f8b0:400e:c00::22a; Authentication-Results: mx.google.com; spf=pass (google.com: domain of shiva.linuxworks@gmail.com designates 2607:f8b0:400e:c00::22a as permitted sender) smtp.mail=shiva.linuxworks@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-da0-f42.google.com with SMTP id n15so258172dad.29 for ; Tue, 19 Mar 2013 04:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=bWQZlyqRsyayIMjULHP92eezO8YQ8PAAHQyMBgD5qjA=; b=Z4qtFnlaymbQpVzfBe8Ka0J8rSBC+pm+374h+OELd6ECgXxZDBYqGvdNCOOm3Oz39p pa3nAzr34ABM5ZIoHC7DMSqzzHlrW6baET6iTCA6WJ0z9xOakk26VD2ieMuuT3chG2Jh Sr9J248v5qj3WOI5A4Xk+aJNQmNqfjJY0wxQB71ZveAfq+rieTRdmClcc6TUsejOR/pm Gg8GyWtE8bGqvHZ8BptOhnu4pifXTGD+hsxVeGEiX798YR4Qqb5hBLeK/aP6xm+UuGX1 VtvgLwvzAITiy+eBq5ZkVeWBvK6ddNRfE/oEXKfirtRZtyPokJ3pR/waX1Ng9VArO/Oq F+Hg== X-Received: by 10.68.225.138 with SMTP id rk10mr2432306pbc.146.1363692425975; Tue, 19 Mar 2013 04:27:05 -0700 (PDT) Received: from shiva.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id xs10sm12287817pac.8.2013.03.19.04.27.03 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Mar 2013 04:27:05 -0700 (PDT) Sender: Shivamurthy Shastri From: Shivamurthy Shastri To: ryan.harkin@linaro.org Cc: boot-architecture@lists.linaro.org, patches@linaro.org, Rony Nandy Subject: [PATCH 2/2] Samsung/Arndale: Auto boot feature Date: Tue, 19 Mar 2013 16:57:06 +0530 Message-Id: <1363692426-16714-2-git-send-email-shiva.murthy@samsung.com> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1363692426-16714-1-git-send-email-shiva.murthy@samsung.com> References: <1363692426-16714-1-git-send-email-shiva.murthy@samsung.com> X-Gm-Message-State: ALoCoQkSNCegwz2pQQPXnV6x3qGvPjBTJ4LU6rj874M515jLvPT/EP6CcBChMA/BB08jrpreZ8/M The patch been modified as per the new changes in ArmPlatformPkg/Bds/BootOption.c Signed-off-by: Shivamurthy Shastri Signed-off-by: Rony Nandy --- ...-created-to-incorporate-auto-boot-feature.patch | 101 ++++++++++++--------- 1 file changed, 57 insertions(+), 44 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..550f15c 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,31 +1,30 @@ -From 011bc2be4b3f2a5a5413511d7380b6fe3632d0f5 Mon Sep 17 00:00:00 2001 +From 3c9dabb0f20f41c37e1e18c7fcc9a39ce8bfc51d Mon Sep 17 00:00:00 2001 From: Shivamurthy Shastri -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 --- - 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 @@ +@@ -13,6 +13,10 @@ + **/ #include "BdsInternal.h" - +#include +#include +#include +#include -+ + extern EFI_HANDLE mImageHandle; - EFI_STATUS -@@ -22,26 +27,61 @@ BootOptionStart ( +@@ -22,48 +26,91 @@ BootOptionStart ( ) { EFI_STATUS Status; @@ -37,22 +36,22 @@ index 289d36a..468050d 100644 EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath; - EFI_DEVICE_PATH_PROTOCOL* DefaultFdtDevicePath; - UINTN FdtDevicePathSize; +- UINTN CmdLineSize; + //EFI_DEVICE_PATH_PROTOCOL* DefaultFdtDevicePath; + //UINTN FdtDevicePathSize; - UINTN CmdLineSize; ++ //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; -+ 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; @@ -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]); @@ -91,15 +84,30 @@ index 289d36a..468050d 100644 Status = BdsStartEfiApplication (mImageHandle, BootOption->FilePathList, 0, NULL); } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_ATAG) { -@@ -55,9 +95,18 @@ BootOptionStart ( + 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 @@ -107,33 +115,38 @@ index 289d36a..468050d 100644 Initrd, // Initrd (CHAR8*)(LinuxArguments + 1)); // CmdLine +#endif - } else if (LoaderType == BDS_LOADER_KERNEL_LINUX_FDT) { + } 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); -@@ -69,6 +118,7 @@ BootOptionStart ( - Initrd = NULL; - } +- 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 @@ -146,5 +159,5 @@ index 289d36a..468050d 100644 } else { // Set BootCurrent variable -- -1.8.0 +1.8.1.1