From patchwork Tue Oct 9 14:31:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rony Nandy X-Patchwork-Id: 12061 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 5B3A423F58 for ; Tue, 9 Oct 2012 14:28:25 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0B892A18CC4 for ; Tue, 9 Oct 2012 14:28:23 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so850034iag.11 for ; Tue, 09 Oct 2012 07:28:23 -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=VLxBV57IAG5pbA+RjKKAxZf0T+fNbqaZtcge8JACR08=; b=hc1o6QvJ971gDR22nVEHFaR1LIJ7DPHEWZAW/Bxq+E5LnXdPS0R9TypNTRibb8ppqA qxKMbvBgJ8hf6LkMCtIffcef5l8js+0pS3C8Z81xWRjg4yvgnSjsaioc89BpGXZzq625 aWWhCU1P7DyQmoTXYVAsNHHF5BDdBTtQJVcH98SOtWY1jqcUK4tvrjS3KFtbuKQz2adv Pa5uixUXKcXg/LOb1sCgH62M0AieXg5LAaP7oaUqzX+vYXgUlvGHbjTHc7gMHWE1b5au SO27VFxR8kYf9gvnz7EGOIpIzkZMkN1Wk9keojehHtRcRaAQjSuPvEHwlzH9QeVOZffU lw1A== Received: by 10.50.46.226 with SMTP id y2mr1793566igm.62.1349792903470; Tue, 09 Oct 2012 07:28:23 -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 n20csp64309igt; Tue, 9 Oct 2012 07:28:22 -0700 (PDT) Received: by 10.66.88.133 with SMTP id bg5mr52880306pab.80.1349792901973; Tue, 09 Oct 2012 07:28:21 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id iv8si21042461pbc.157.2012.10.09.07.28.21 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 07:28:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of rony.nandy@linaro.org) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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-pa0-f50.google.com with SMTP id hz11so5864572pad.37 for ; Tue, 09 Oct 2012 07:28:21 -0700 (PDT) Received: by 10.66.85.8 with SMTP id d8mr53409818paz.30.1349792901625; Tue, 09 Oct 2012 07:28:21 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id i4sm12660514pav.20.2012.10.09.07.28.18 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 07:28:20 -0700 (PDT) From: Rony Nandy To: patches@linaro.org Cc: shiva.murthy@samsung.com, Shivamurthy Shastri , Rony Nandy Subject: [PATCH] Auto boot feature for the Origen Board. The code will search for "uImage" in the available partitions. The code will boot the board with the first image it gets. Date: Tue, 9 Oct 2012 20:01:08 +0530 Message-Id: <1349793069-17649-1-git-send-email-rony.nandy@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQkBxRgcDSbMbLeCPUqDmAXbmBbOndEfqf9rY7H8qSaGVbiixDj15FC1JA01Kj59lstDQj3B From: Shivamurthy Shastri Signed-off-by: Shivamurthy Shastri Signed-off-by: Rony Nandy --- .../0001-Auto-boot-feature-for-the-Origen.patch | 124 ++++++++++++++++++++ 1 file changed, 124 insertions(+) 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..98d2183 --- /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