From patchwork Fri Feb 22 10:45:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "shiva.linuxworks at gmail.com" X-Patchwork-Id: 15026 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 285E023F7C for ; Fri, 22 Feb 2013 10:46:05 +0000 (UTC) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by fiordland.canonical.com (Postfix) with ESMTP id BAB51A1898B for ; Fri, 22 Feb 2013 10:46:04 +0000 (UTC) Received: by mail-ve0-f181.google.com with SMTP id d10so391510vea.26 for ; Fri, 22 Feb 2013 02:46:04 -0800 (PST) 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:from:to:subject:date :message-id:x-mailer:x-gm-message-state; bh=K3qWzqmtn+l8AK7gaG3OOwlZueN1c/05IEjHkuty1Ts=; b=JV5nYIrLLskhoM+zWdQKp4IyRhDbaNLnIkau2jhImzeThz6frTtxaO37ZF/eBrfp4i q948SJu9vxWob61obOB0U2tagGH0dUfvwAJJPyYq98fTLau3DsP/TAMnULy58bG+kUGR ngnRO2NQbgXqZzrhW3MNUyFKTtcAyCMTvtrea0p37GI0f9UwHK2eTldEaUgmInK703+S m/qrE1ZMT89iLecOK0GbUCYZYmzT6kYStMeixyx6X3cc6wG/cr9/uFt17H3lwE0KWQK5 1kNAipXzNjfRolrXCPXEC3YLR148RPEAOIMTb6f8ARhxNooMWoJrdbreRZ2948mcNkfk hPVg== X-Received: by 10.52.88.237 with SMTP id bj13mr1588615vdb.75.1361529964169; Fri, 22 Feb 2013 02:46:04 -0800 (PST) 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.145.101 with SMTP id st5csp81986veb; Fri, 22 Feb 2013 02:46:03 -0800 (PST) X-Received: by 10.66.220.227 with SMTP id pz3mr3192963pac.190.1361529962909; Fri, 22 Feb 2013 02:46:02 -0800 (PST) Received: from mail-da0-f45.google.com (mail-da0-f45.google.com [209.85.210.45]) by mx.google.com with ESMTPS id u2si2330584paw.212.2013.02.22.02.46.01 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Feb 2013 02:46:02 -0800 (PST) Received-SPF: pass (google.com: domain of shiva.linuxworks@gmail.com designates 209.85.210.45 as permitted sender) client-ip=209.85.210.45; Authentication-Results: mx.google.com; spf=pass (google.com: domain of shiva.linuxworks@gmail.com designates 209.85.210.45 as permitted sender) smtp.mail=shiva.linuxworks@gmail.com; dkim=pass header.i=@gmail.com Received: by mail-da0-f45.google.com with SMTP id v40so305484dad.4 for ; Fri, 22 Feb 2013 02:46:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:x-mailer; bh=K3qWzqmtn+l8AK7gaG3OOwlZueN1c/05IEjHkuty1Ts=; b=qHb1Pt30Q15T4TA2SdTeGZSMkFp0WY6loJTVdOV11l37zp7q+2cc6Rjbx9HyFypD/t qC90ScdSjpZi5NAdaOfccOy8sSZCteAcro/8Nsv3fgLQ9oP1arC1s0AeKPBX2zkzxepZ 9DGUTf+kFmYb/Tc43QlTL+vhtNZEgVYWoF3Zg9p2Fo4UOtEVrtAkS/4AdgUkaN5aI3Ci Z5/e1DXX5ub9CY7ngBQ+41cnnaCmS10RVXSKUBfyEkMhPWhrL08QIpQhm92/kFNR1dWb 5HNvUJPoScONXKJc79lgNokPSksRNNhjb1f2qKOtgNMopP5Ygy+uZSYGuD/bKYJGDUmh FYTQ== X-Received: by 10.68.143.133 with SMTP id se5mr2258429pbb.189.1361529961358; Fri, 22 Feb 2013 02:46:01 -0800 (PST) Received: from shiva.sisodomain.com ([115.113.119.130]) by mx.google.com with ESMTPS id tp2sm2143626pbc.12.2013.02.22.02.45.59 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 22 Feb 2013 02:46:00 -0800 (PST) From: Shivamurthy Shastri To: patches@linaro.org Subject: [PATCH] Samsung/Arndale: Auto boot feature Date: Fri, 22 Feb 2013 16:15:54 +0530 Message-Id: <1361529954-14369-1-git-send-email-shiva.murthy@samsung.com> X-Mailer: git-send-email 1.8.1.1 X-Gm-Message-State: ALoCoQmbyuobNPNBZgCWoNgDRqOQdz12GdB/so6ccLtCOll95tVmG6tBa0aKfWq2VOdoEfIRySnw 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