From patchwork Tue Oct 9 14:38:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rony Nandy X-Patchwork-Id: 12064 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 19AF923F58 for ; Tue, 9 Oct 2012 14:35:45 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7AD0DA199FA for ; Tue, 9 Oct 2012 14:35:44 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so11369725iej.11 for ; Tue, 09 Oct 2012 07:35:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=bTw2JQFyoQpKm79wOPOp+ZiKSEmdHUTk6Zl6E88jglQ=; b=Z/5QrBQhZZKhaShdijO0Z/OpsMEON333wcA/OUUqOR7a2pjo2nhPUIKr/tbyLl8fu6 QHSkzfqP74wvNQOwhmMdukAqYWVDgZRq9skDflfiZh7zv4Z9uAk1rfvoxpVnJjFsX1rM JKuaLDB+X1ZnlazR4Y+6GSxjtHQxt0uS9mqCcxi0a7YPOYtN/IQdx3PVk4ExRHFHNJ+9 sfUL9YZwrhjA5KPUD9COGaZwM4k2E/07D6R3yNyyXQX9Y5nRCDeIejcs4mqipzuM4L91 8DVv1Z7jGsvnhaL6rolrm8e7hmeufRZNYFHVbDH2eHXiLlG761tuAFfFowVu+ykudAaa Kf4w== Received: by 10.50.46.226 with SMTP id y2mr1822175igm.62.1349793343831; Tue, 09 Oct 2012 07:35:43 -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.50.67.148 with SMTP id n20csp65406igt; Tue, 9 Oct 2012 07:35:43 -0700 (PDT) Received: by 10.66.76.231 with SMTP id n7mr53025797paw.68.1349793343142; Tue, 09 Oct 2012 07:35:43 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id t9si15289963paz.55.2012.10.09.07.35.42 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 07:35:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of rony.nandy@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of rony.nandy@linaro.org) smtp.mail=rony.nandy@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md4so5936973pbc.37 for ; Tue, 09 Oct 2012 07:35:42 -0700 (PDT) Received: by 10.66.88.4 with SMTP id bc4mr52799222pab.42.1349793342667; Tue, 09 Oct 2012 07:35:42 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id tt6sm12485337pbc.51.2012.10.09.07.35.40 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 07:35:41 -0700 (PDT) From: Rony Nandy To: patches@linaro.org Cc: shiva.murthy@samsung.com, Rony Nandy Subject: [PATCH 1/2] Auto boot feature for Origen. Date: Tue, 9 Oct 2012 20:08:30 +0530 Message-Id: <1349793510-17771-1-git-send-email-rony.nandy@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQnKE2yyjq5KYeTcqNPy47ELxkmQdj2vNB/DVJ0UuIe28iX5K2cIKglO0o5iw5fHEf3OFyuq Signed-off-by: Shivamurthy Shastri Signed-off-by: Rony Nandy --- .../0001-Auto-boot-feature-for-the-Origen.patch | 124 ++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-) create mode 100644 SamsungPlatformPkg/patches/0001-Auto-boot-feature-for-the-Origen.patch diff --git a/SamsungPlatformPkg/patches/0001-Auto-boot-feature-for-the-Origen.patch b/SamsungPlatformPkg/patches/0001-Auto-boot-feature-for-the-Origen.patch new file mode 100644 index 0000000..83e8b77 --- /dev/null +++ b/SamsungPlatformPkg/patches/0001-Auto-boot-feature-for-the-Origen.patch @@ -0,0 +1,124 @@ +From 3d8ea36efcbc4dd772047b087caf4f6e0736f6de Mon Sep 17 00:00:00 2001 +From: Shivamurthy Shastri +Date: Tue, 9 Oct 2012 13:34:25 +0530 +Subject: [PATCH] Auto boot feature for the SMDK5250. The code will search for + "uImage" in the available partitions. The code will boot + the board with the first image it gets. + +Signed-off-by: Shivamurthy Shastri +Signed-off-by: Rony Nandy +--- + ArmPlatformPkg/Bds/BootOption.c | 81 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 81 insertions(+) + +diff --git a/ArmPlatformPkg/Bds/BootOption.c b/ArmPlatformPkg/Bds/BootOption.c +index 289d36a..a457b09 100644 +--- a/ArmPlatformPkg/Bds/BootOption.c ++++ b/ArmPlatformPkg/Bds/BootOption.c +@@ -14,6 +14,13 @@ + + #include "BdsInternal.h" + ++//CHANGE -- START ++#include ++#include ++#include ++#include ++//CHANGE -- END ++ + extern EFI_HANDLE mImageHandle; + + EFI_STATUS +@@ -34,6 +41,17 @@ BootOptionStart ( + EFI_DEVICE_PATH* Initrd; + UINT16 LoadOptionIndexSize; + ++//CHANGE -- START ++ 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; ++//CHANGE -- END ++ + if (IS_ARM_BDS_BOOTENTRY (BootOption)) { + Status = EFI_UNSUPPORTED; + OptionalData = BootOption->OptionalData; +@@ -55,9 +73,72 @@ BootOptionStart ( + Initrd = NULL; + } + ++//CHANGE CODE -- START ++ do { ++ // Locate all the driver handles ++ Status = gBS->LocateHandleBuffer ( ++ AllHandles, ++ NULL, ++ NULL, ++ &HandleCount, ++ &HandleBuffer ++ ); ++ if (EFI_ERROR (Status)) { ++ break; ++ } ++ ++ // Connect every handles ++ for (Index = 0; Index < HandleCount; Index++) { ++ gBS->ConnectController (HandleBuffer[Index], NULL, NULL, TRUE); ++ } ++ ++ if (HandleBuffer != NULL) { ++ FreePool (HandleBuffer); ++ } ++ ++ // Check if new handles have been created after the start of the previous handles ++ Status = gDS->Dispatch (); ++ } while (!EFI_ERROR(Status)); ++ ++ ++ Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol); ++ if (EFI_ERROR (Status)) { ++ AsciiPrint ("Did not find the DevicePathToTextProtocol.\n"); ++ return Status; ++ } ++ ++ Status = gBS->LocateHandleBuffer (ByProtocol, &gEfiBlockIoProtocolGuid, NULL, &HandleCount, &HandleBuffer); ++ if (EFI_ERROR (Status)) { ++ AsciiPrint ("No device path found\n"); ++ 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]); ++ if (FileSystemDevicePath == NULL) { ++ continue; ++ } ++ ++ //Check if zImage file on SD-MMC. ++ LoadImageDevicePath = FileDevicePath(HandleBuffer[Index], L"zImage"); ++ Status = BdsBootLinuxAtag (LoadImageDevicePath, Initrd, (CHAR8*)(LinuxArguments + 1)); ++ if (EFI_ERROR(Status)) { ++ continue; ++ } ++ } ++//CHANGE CODE -- END ++#if 0 //remove while removing CHANGE CODE + 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); +-- +1.7.9.5