From patchwork Thu Mar 2 16:15:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 94792 Delivered-To: patch@linaro.org Received: by 10.140.82.71 with SMTP id g65csp235410qgd; Thu, 2 Mar 2017 08:15:20 -0800 (PST) X-Received: by 10.98.147.10 with SMTP id b10mr16407115pfe.177.1488471320532; Thu, 02 Mar 2017 08:15:20 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id f30si7836376plf.93.2017.03.02.08.15.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Mar 2017 08:15:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 149D8821F1; Thu, 2 Mar 2017 08:15:20 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7FA30821F1 for ; Thu, 2 Mar 2017 08:15:18 -0800 (PST) Received: by mail-wr0-x22b.google.com with SMTP id l37so55999416wrc.1 for ; Thu, 02 Mar 2017 08:15:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=brDjxG0onGeyR3YBFBy+aT6C0gGR5xpG9ywxd+bJn1I=; b=SsGdBS62nnSoUylTAuRdJXwytcYc/lgZQycuEgc4CZGG/HwxqxRMeyplkopUnLQaiR Sua0+aeabJ3yg5kM6XM5rTTYMhyFfauWvrrS41UBDfR+8P1ZDy0zVkHiNLXgM4yvel2/ EmXI7LRbp4Vza5MHWIAfeyJ0Iss7jfkCepWMY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=brDjxG0onGeyR3YBFBy+aT6C0gGR5xpG9ywxd+bJn1I=; b=H6/JKHSe4e17rVOEpO/3UR5ybad5IQgvXaWxmxOqHF3I99j9tDYm8WchVA2DvFgFGe d0lfgEJmh7vwpe1wF+Wl/oWAvL2gync9UcN9N28SvJH3mgSZ60EilyjJ9mIHryBXL7nC n/qLrGPSXLf37TtFPFExQRl30khxSR+etYpjAswNvWlYRbQ00c/pyYrRCFQXUkmfD2ga reVuUnSxGWTCW+w1RkST6Oaqd1BIPgTKRIaMuCPZwSJvStsm7g6IXWlGwLTWUcMcMJmp rfhsXJhryjwm0HwvpbtwGSXc99xyEups1w+t0OrT0pfEVF+8tGzDc6jccO3qgU+AQmrx ikmw== X-Gm-Message-State: AMke39m+39kP5r2l8tAr2LtwajxVinndDViGOggaskyfPs2IHGeB34LcMfyOfgvJms/a2/q9 X-Received: by 10.223.164.9 with SMTP id d9mr13269060wra.146.1488471316865; Thu, 02 Mar 2017 08:15:16 -0800 (PST) Received: from localhost.localdomain ([105.147.1.203]) by smtp.gmail.com with ESMTPSA id n13sm11412650wra.17.2017.03.02.08.15.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Mar 2017 08:15:16 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, lersek@redhat.com, leif.lindholm@linaro.org Date: Thu, 2 Mar 2017 16:15:02 +0000 Message-Id: <1488471305-23752-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488471305-23752-1-git-send-email-ard.biesheuvel@linaro.org> References: <1488471305-23752-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 1/4] ArmVirtPkg/ArmVirtPlatformLib: base boot mode on capsule presence X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: jiewen.yao@intel.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Instead of unconditionally returning BOOT_WITH_FULL_CONFIGURATION when enquiring the platform about the boot mode, let's return enable the use of capsules by returning BOOT_ON_FLASH_UPDATE when a capsule HOB is detected. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf | 5 +++-- ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf b/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf index 3cb3fb1f3aea..dbbe0fbee21a 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf @@ -29,11 +29,12 @@ [Packages] ArmVirtPkg/ArmVirtPkg.dec [LibraryClasses] + ArmLib + FdtLib + HobLib IoLib MemoryAllocationLib - ArmLib PrintLib - FdtLib [Sources.common] Virt.c diff --git a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c b/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c index fcaf3c681a97..58175110ab43 100644 --- a/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c +++ b/ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,9 @@ ArmPlatformGetBootMode ( VOID ) { + if (GetFirstHob (EFI_HOB_TYPE_UEFI_CAPSULE) != NULL) { + return BOOT_ON_FLASH_UPDATE; + } return BOOT_WITH_FULL_CONFIGURATION; }