From patchwork Tue Oct 9 14:34:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rony Nandy X-Patchwork-Id: 12063 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 3204423F58 for ; Tue, 9 Oct 2012 14:31:43 +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 B946EA18CC5 for ; Tue, 9 Oct 2012 14:31:42 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so852802iag.11 for ; Tue, 09 Oct 2012 07:31:42 -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=BaURjlMAsLOBJ4NaddNdWuqFtUF0G42q+745OwLgFJWM+oeVdkYWPZ25ZzoevX/4Jl WFpw+TbSdy5PJnFz5V2v7SKNU5w+6jM8O7lwzKVLOtEaPuJ4s9EPIqQHpaOGQeURLOBT BmEgqRWg2il+T0+HDqWYvbhV4Ay0vNG1Co5BbbA1tecXMW7jeUKVRICGn0rSrHYRXCKP 8vng4wuaL9pGk7Ted9pKqQfI/1TuvEjvN7IbWl1qvx4YcplxX5ITfrxCVNwl6xQ5NMcF 4EA9IjP8zRFkpVIrc6/w44Y/G0XM5es1/0Vx4nFN6qBI+92Qj5lK6SfVT4Ddja1hMrkU Zqcg== Received: by 10.50.77.138 with SMTP id s10mr1835406igw.70.1349793098111; Tue, 09 Oct 2012 07:31:38 -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 n20csp64744igt; Tue, 9 Oct 2012 07:31:34 -0700 (PDT) Received: by 10.50.57.194 with SMTP id k2mr1906214igq.17.1349793094314; Tue, 09 Oct 2012 07:31:34 -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 f9si22407273paz.32.2012.10.09.07.31.33 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 07:31:33 -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 md4so5931819pbc.37 for ; Tue, 09 Oct 2012 07:31:32 -0700 (PDT) Received: by 10.68.203.228 with SMTP id kt4mr63686699pbc.87.1349793092639; Tue, 09 Oct 2012 07:31:32 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id ps2sm12492462pbb.0.2012.10.09.07.31.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 09 Oct 2012 07:31:32 -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:04:19 +0530 Message-Id: <1349793259-17699-1-git-send-email-rony.nandy@linaro.org> X-Mailer: git-send-email 1.7.5.4 X-Gm-Message-State: ALoCoQn9OzwDySuiShsVbfjMfrDo/bflkyJ9WO2ulwOHXXm7gXRuQFR6gL1jaRL+ApTTatG+w0Up 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