public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: edk2-devel@lists.01.org, lersek@redhat.com, leif.lindholm@linaro.org
Cc: jiewen.yao@intel.com, Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [PATCH 1/4] ArmVirtPkg/ArmVirtPlatformLib: base boot mode on capsule presence
Date: Thu,  2 Mar 2017 16:15:02 +0000	[thread overview]
Message-ID: <1488471305-23752-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1488471305-23752-1-git-send-email-ard.biesheuvel@linaro.org>

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 <ard.biesheuvel@linaro.org>
---
 ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf | 5 +++--
 ArmVirtPkg/Library/ArmVirtPlatformLib/Virt.c                 | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)

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 <Library/IoLib.h>
 #include <Library/ArmPlatformLib.h>
 #include <Library/DebugLib.h>
+#include <Library/HobLib.h>
 #include <Library/PcdLib.h>
 #include <ArmPlatform.h>
 #include <libfdt.h>
@@ -38,6 +39,9 @@ ArmPlatformGetBootMode (
   VOID
   )
 {
+  if (GetFirstHob (EFI_HOB_TYPE_UEFI_CAPSULE) != NULL) {
+    return BOOT_ON_FLASH_UPDATE;
+  }
   return BOOT_WITH_FULL_CONFIGURATION;
 }
 
-- 
2.7.4



  reply	other threads:[~2017-03-02 16:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-02 16:15 [PATCH 0/4] ArmVirtPkg: implement basic capsule support Ard Biesheuvel
2017-03-02 16:15 ` Ard Biesheuvel [this message]
2017-03-02 16:15 ` [PATCH 2/4] ArmVirtPkg/ArmVirtMemoryInitPeiLib: check for capsules before memory init Ard Biesheuvel
2017-03-02 16:15 ` [PATCH 3/4] ArmVirtPkg/PlatformBootManagerLib: process pending capsules Ard Biesheuvel
2017-03-02 16:15 ` [PATCH 4/4] ArmVirtPkg/ArmVirtQemu: enable basic capsule support Ard Biesheuvel
2017-03-02 17:09 ` [PATCH 0/4] ArmVirtPkg: implement " Laszlo Ersek
2017-03-02 17:22   ` Ard Biesheuvel
2017-03-02 18:56     ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1488471305-23752-2-git-send-email-ard.biesheuvel@linaro.org \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox