From patchwork Fri Jun 21 08:05:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Harkin X-Patchwork-Id: 18044 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 38F5425E4A for ; Fri, 21 Jun 2013 08:05:51 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bv4sf942266qab.2 for ; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=5lpbkgmHq5Io8ugg/MWKsB/QXhCRgBiaYcOAdWhxmOk=; b=LRoOrpL4fAurILkOx05DWwbwgxfJ1Ob732RUDVrAEAS9oWZVrNXdPm41gT2jX6v9GP tUMxwnCjRZuuAGLy6Fgjm3jqMDhkma13V559qg5ieJjBV7VzWM7jRVUjdV58iVhn/uz/ XD2qSxcs7Tkgq+ijaXSkL8RwGOy0GDkUfk9zMr0LduhdnRnUTZzoRG55AaaavrRLXRLv ImDg/zaCNbUOElWd3FATGoJCQYwdFCwFbxFUN0x3gHZ+a9rJPP+KOPvlGWZTrYMSFSqy 1UUSjza5FYUWcKdDHwEcZIOBY7APE3+ixHtnRXe5I9YxJcEdYJGDB9dTLZa8u3QFh4wh nwmQ== X-Received: by 10.224.129.196 with SMTP id p4mr12139369qas.6.1371801950921; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.108.74 with SMTP id hi10ls1047056qeb.50.gmail; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) X-Received: by 10.220.66.203 with SMTP id o11mr4825072vci.67.1371801950783; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) Received: from mail-vb0-x236.google.com (mail-vb0-x236.google.com [2607:f8b0:400c:c02::236]) by mx.google.com with ESMTPS id vl1si1217739veb.132.2013.06.21.01.05.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Jun 2013 01:05:50 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::236; Received: by mail-vb0-f54.google.com with SMTP id q12so5484728vbe.41 for ; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) X-Received: by 10.58.168.208 with SMTP id zy16mr5144600veb.3.1371801950692; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp51561veb; Fri, 21 Jun 2013 01:05:50 -0700 (PDT) X-Received: by 10.180.20.228 with SMTP id q4mr2060082wie.1.1371801948978; Fri, 21 Jun 2013 01:05:48 -0700 (PDT) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [2a00:1450:400c:c03::231]) by mx.google.com with ESMTPS id j2si1518383wiv.83.2013.06.21.01.05.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Jun 2013 01:05:48 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c03::231 is neither permitted nor denied by best guess record for domain of ryan.harkin@linaro.org) client-ip=2a00:1450:400c:c03::231; Received: by mail-we0-f177.google.com with SMTP id m19so5936805wev.8 for ; Fri, 21 Jun 2013 01:05:48 -0700 (PDT) X-Received: by 10.194.2.13 with SMTP id 13mr8342618wjq.74.1371801948528; Fri, 21 Jun 2013 01:05:48 -0700 (PDT) Received: from qpc.lan (82-69-54-187.dsl.in-addr.zen.co.uk. [82.69.54.187]) by mx.google.com with ESMTPSA id ay7sm21069904wib.9.2013.06.21.01.05.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 21 Jun 2013 01:05:48 -0700 (PDT) From: Ryan Harkin To: ryan.harkin@linaro.org, edk2-devel@lists.sourceforge.net, patches@linaro.org, boot-architecture@lists.linaro.org, olivier.martin@arm.com Subject: [PATCH 8/9] ArmPlatformPkg/Bds: show global FDT config in main menu Date: Fri, 21 Jun 2013 09:05:21 +0100 Message-Id: <1371801922-15142-9-git-send-email-ryan.harkin@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371801922-15142-1-git-send-email-ryan.harkin@linaro.org> References: <1371801922-15142-1-git-send-email-ryan.harkin@linaro.org> X-Gm-Message-State: ALoCoQmCs+cjc6DKrexgn21vfVyE34pQg0b7wAda/s9XXrWjX6umw49JAeOpWkfjH1V0OeY6i0Zl X-Original-Sender: ryan.harkin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::236 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Previously, there was no way to read the global FDT config. This patch displays the global FDT config after the boot devices in the main menu. Signed-off-by: Ryan Harkin --- ArmPlatformPkg/Bds/BootMenu.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c index 09e1075..2b32e83 100644 --- a/ArmPlatformPkg/Bds/BootMenu.c +++ b/ArmPlatformPkg/Bds/BootMenu.c @@ -659,6 +659,9 @@ BootMenuMain ( UINTN Index; UINTN BootMainEntryCount; CHAR8 BootOptionSelectedStr[32]; + EFI_DEVICE_PATH_PROTOCOL* DefaultFdtDevicePath; + UINTN FdtDevicePathSize; + BootOption = NULL; BootMainEntryCount = sizeof(BootMainEntries) / sizeof(struct BOOT_MAIN_ENTRY); @@ -734,6 +737,33 @@ BootMenuMain ( } BootOptionCount = OptionCount-1; + // Display the global FDT config + Print(L"-----------------------\n"); + { + EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL* EfiDevicePathFromTextProtocol; + EFI_DEVICE_PATH_PROTOCOL* FdtDevicePath; + EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol; + CHAR16* DevicePathTxt; + + // Get the default FDT device path + Status = gBS->LocateProtocol (&gEfiDevicePathFromTextProtocolGuid, NULL, (VOID **)&EfiDevicePathFromTextProtocol); + ASSERT_EFI_ERROR(Status); + DefaultFdtDevicePath = EfiDevicePathFromTextProtocol->ConvertTextToDevicePath ((CHAR16*)PcdGetPtr(PcdFdtDevicePath)); + + // Get the FDT device path + FdtDevicePathSize = GetDevicePathSize (DefaultFdtDevicePath); + Status = GetEnvironmentVariable ((CHAR16 *)L"Fdt", &gArmGlobalVariableGuid, DefaultFdtDevicePath, &FdtDevicePathSize, (VOID **)&FdtDevicePath); + + // Convert FdtDevicePath to text + if (EFI_ERROR(Status)) { + DevicePathTxt = L"not configured"; + } else { + Status = gBS->LocateProtocol (&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol); + DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText ( FdtDevicePath, TRUE, TRUE ); + } + Print(L"Global FDT Config\n\t- %s\n", DevicePathTxt); + } + // Display the hardcoded Boot entries Print(L"-----------------------\n"); for (Index = 0; Index < BootMainEntryCount; Index++) {