[edk2-devel] [edk2-platforms PATCH v2] SimicsOpenBoardPkg: Always set the boot priority by default

David Wei posted 1 patch 4 years, 7 months ago
Failed in applying to current master (apply log)
.../Library/PlatformBootManagerLib/BdsPlatform.c           | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
[edk2-devel] [edk2-platforms PATCH v2] SimicsOpenBoardPkg: Always set the boot priority by default
Posted by David Wei 4 years, 7 months ago
When running networks of multiple machines, Simics assigns different
disk IDs to each disk created.this change the boot priority and can't
boot from SATA HDD directly.
Clear boot priority in NVRAM can fix this issue.

Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Agyeman Prince <prince.agyeman@intel.com>
Cc: Kubacki Michael A <michael.a.kubacki@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>

Signed-off-by: David Wei <david.y.wei@intel.com>
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c           | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 953a4a6c15..6644ce124e 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -338,10 +338,18 @@ PlatformBootManagerBeforeConsole (
   VOID
   )
 {
-//  EFI_HANDLE    Handle;
-//  EFI_STATUS    Status;
+  EFI_BOOT_MANAGER_LOAD_OPTION  *NvBootOptions;
+  UINTN                         NvBootOptionCount;
+  UINTN                         Index;
+  EFI_STATUS    Status;
+
+  DEBUG((DEBUG_INFO, "PlatformBootManagerBeforeConsole\n"));
+
+  NvBootOptions = EfiBootManagerGetLoadOptions(&NvBootOptionCount, LoadOptionTypeBoot);
+  for (Index = 0; Index < NvBootOptionCount; Index++) {
+    Status = EfiBootManagerDeleteLoadOptionVariable(NvBootOptions[Index].OptionNumber, LoadOptionTypeBoot);
+  }
 
-  DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));
   InstallDevicePathCallback ();
 
   VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid,
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47304): https://edk2.groups.io/g/devel/message/47304
Mute This Topic: https://groups.io/mt/34170508/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms PATCH v2] SimicsOpenBoardPkg: Always set the boot priority by default
Posted by Nate DeSimone 4 years, 6 months ago
With the minor style changes noted by Michael fixed...

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Wei, David Y <david.y.wei@intel.com> 
Sent: Monday, September 16, 2019 3:39 PM
To: devel@edk2.groups.io
Cc: Wu, Hao A <hao.a.wu@intel.com>; Gao, Liming <liming.gao@intel.com>; Sinha, Ankit <ankit.sinha@intel.com>; Agyeman, Prince <prince.agyeman@intel.com>; Kubacki, Michael A <michael.a.kubacki@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: [edk2-platforms PATCH v2] SimicsOpenBoardPkg: Always set the boot priority by default

When running networks of multiple machines, Simics assigns different disk IDs to each disk created.this change the boot priority and can't boot from SATA HDD directly.
Clear boot priority in NVRAM can fix this issue.

Cc: Hao Wu <hao.a.wu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Agyeman Prince <prince.agyeman@intel.com>
Cc: Kubacki Michael A <michael.a.kubacki@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>

Signed-off-by: David Wei <david.y.wei@intel.com>
---
 .../Library/PlatformBootManagerLib/BdsPlatform.c           | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index 953a4a6c15..6644ce124e 100644
--- a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/B
+++ dsPlatform.c
@@ -338,10 +338,18 @@ PlatformBootManagerBeforeConsole (
   VOID
   )
 {
-//  EFI_HANDLE    Handle;
-//  EFI_STATUS    Status;
+  EFI_BOOT_MANAGER_LOAD_OPTION  *NvBootOptions;
+  UINTN                         NvBootOptionCount;
+  UINTN                         Index;
+  EFI_STATUS    Status;
+
+  DEBUG((DEBUG_INFO, "PlatformBootManagerBeforeConsole\n"));
+
+  NvBootOptions = EfiBootManagerGetLoadOptions(&NvBootOptionCount, 
+ LoadOptionTypeBoot);  for (Index = 0; Index < NvBootOptionCount; Index++) {
+    Status = 
+ EfiBootManagerDeleteLoadOptionVariable(NvBootOptions[Index].OptionNumb
+ er, LoadOptionTypeBoot);  }
 
-  DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));
   InstallDevicePathCallback ();
 
   VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid,
--
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47826): https://edk2.groups.io/g/devel/message/47826
Mute This Topic: https://groups.io/mt/34170508/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms PATCH v2] SimicsOpenBoardPkg: Always set the boot priority by default
Posted by Kubacki, Michael A 4 years, 7 months ago
There's some style issues with spaces missing before opening parenthesis. Those can be fixed before submission this time.

Reviewed-by: Michael Kubacki <michael.a.kubacki@intel.com>

> -----Original Message-----
> From: Wei, David Y <david.y.wei@intel.com>
> Sent: Monday, September 16, 2019 3:39 PM
> To: devel@edk2.groups.io
> Cc: Wu, Hao A <hao.a.wu@intel.com>; Gao, Liming <liming.gao@intel.com>;
> Sinha, Ankit <ankit.sinha@intel.com>; Agyeman, Prince
> <prince.agyeman@intel.com>; Kubacki, Michael A
> <michael.a.kubacki@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>; Kinney, Michael D
> <michael.d.kinney@intel.com>
> Subject: [edk2-platforms PATCH v2] SimicsOpenBoardPkg: Always set the
> boot priority by default
> 
> When running networks of multiple machines, Simics assigns different disk
> IDs to each disk created.this change the boot priority and can't boot from
> SATA HDD directly.
> Clear boot priority in NVRAM can fix this issue.
> 
> Cc: Hao Wu <hao.a.wu@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Ankit Sinha <ankit.sinha@intel.com>
> Cc: Agyeman Prince <prince.agyeman@intel.com>
> Cc: Kubacki Michael A <michael.a.kubacki@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Signed-off-by: David Wei <david.y.wei@intel.com>
> ---
>  .../Library/PlatformBootManagerLib/BdsPlatform.c           | 14 +++++++++++-
> --
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/Bds
> Platform.c
> b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/Bd
> sPlatform.c
> index 953a4a6c15..6644ce124e 100644
> ---
> a/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/Bds
> Platform.c
> +++
> b/Platform/Intel/SimicsOpenBoardPkg/Library/PlatformBootManagerLib/B
> +++ dsPlatform.c
> @@ -338,10 +338,18 @@ PlatformBootManagerBeforeConsole (
>    VOID
>    )
>  {
> -//  EFI_HANDLE    Handle;
> -//  EFI_STATUS    Status;
> +  EFI_BOOT_MANAGER_LOAD_OPTION  *NvBootOptions;
> +  UINTN                         NvBootOptionCount;
> +  UINTN                         Index;
> +  EFI_STATUS    Status;
> +
> +  DEBUG((DEBUG_INFO, "PlatformBootManagerBeforeConsole\n"));
> +
> +  NvBootOptions = EfiBootManagerGetLoadOptions(&NvBootOptionCount,
> + LoadOptionTypeBoot);  for (Index = 0; Index < NvBootOptionCount;
> Index++) {
> +    Status =
> +
> EfiBootManagerDeleteLoadOptionVariable(NvBootOptions[Index].OptionNu
> mb
> + er, LoadOptionTypeBoot);  }
> 
> -  DEBUG ((EFI_D_INFO, "PlatformBootManagerBeforeConsole\n"));
>    InstallDevicePathCallback ();
> 
>    VisitAllInstancesOfProtocol (&gEfiPciRootBridgeIoProtocolGuid,
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47549): https://edk2.groups.io/g/devel/message/47549
Mute This Topic: https://groups.io/mt/34170508/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-