Re: [edk2-devel] reg: RNG functions Usage in NetworkPkg

2021-02-11 Thread Sivaraman Nainar
Hello Maciej:

Do you have any comment on this.

-Siva
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Sivaraman 
Nainar
Sent: Thursday, February 4, 2021 10:05 AM
To: Rabeda, Maciej; devel@edk2.groups.io
Cc: Lavanya Paneerselvam
Subject: [edk2-devel] reg: RNG functions Usage in NetworkPkg

Hello Maciej:

Do we have any plan to use the RNG Library function in the Macro "NET_RANDOM" 
of NetworkPkg.

NET_RANDOM can use GetRandomNumber32() which is more reliable right?

Thanks
Siva

This e-mail is intended for the use of the addressee only and may contain 
privileged, confidential, or proprietary information that is exempt from 
disclosure under law. If you have received this message in error, please inform 
us promptly by reply e-mail, then delete the e-mail and destroy any printed 
copy. Thank you.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71627): https://edk2.groups.io/g/devel/message/71627
Mute This Topic: https://groups.io/mt/80373518/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v1 1/1] UefiCpuPkg/SmmCpuFeaturesLib: Add Standalone MM support

2021-02-11 Thread Michael Kubacki
From: Michael Kubacki 

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3218

Adds an INF for StandaloneMmCpuFeaturesLib, which supports building
the SmmCpuFeaturesLib code for Standalone MM. Minimal code changes
are made to allow reuse of existing code for Standalone MM.

The original INF file names are left intact (continue to use SMM
terminology) to retain backward compatibility with platforms that
use those INFs. Similarly, the C file names are unchanged to be
consistent with the INF file names.

Cc: Eric Dong 
Cc: Ray Ni 
Cc: Laszlo Ersek 
Cc: Rahul Kumar 
Signed-off-by: Michael Kubacki 
---
 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c   
| 18 +++
 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c  
|  2 +-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c  
| 10 ++--
 UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.c  
| 50 +++
 UefiCpuPkg/Library/SmmCpuFeaturesLib/TraditionalMmCpuFeaturesLib.c 
| 51 
 UefiCpuPkg/Library/SmmCpuFeaturesLib/CpuFeaturesLib.h  
| 39 +++
 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf 
|  4 +-
 UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf  
|  2 +
 UefiCpuPkg/Library/SmmCpuFeaturesLib/{SmmCpuFeaturesLib.inf => 
StandaloneMmCpuFeaturesLib.inf} | 16 +++---
 UefiCpuPkg/UefiCpuPkg.dsc  
|  1 +
 10 files changed, 169 insertions(+), 24 deletions(-)

diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
index 8fed18cf0e17..bb45188dbfe0 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c
@@ -6,7 +6,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include 
 #include 
 #include 
+#include "CpuFeaturesLib.h"
 
 //
 // Machine Specific Registers (MSRs)
@@ -72,19 +73,14 @@ BOOLEAN  mNeedConfigureMtrrs = TRUE;
 BOOLEAN  *mSmrrEnabled;
 
 /**
-  The constructor function
+  Performs library initialization.
 
-  @param[in]  ImageHandle  The firmware allocated handle for the EFI image.
-  @param[in]  SystemTable  A pointer to the EFI System Table.
-
-  @retval EFI_SUCCESS  The constructor always returns EFI_SUCCESS.
+  @retval EFI_SUCCESS  This function always returns success.
 
 **/
 EFI_STATUS
-EFIAPI
-SmmCpuFeaturesLibConstructor (
-  IN EFI_HANDLEImageHandle,
-  IN EFI_SYSTEM_TABLE  *SystemTable
+CpuFeaturesLibInitialization (
+  VOID
   )
 {
   UINT32  RegEax;
@@ -169,7 +165,7 @@ SmmCpuFeaturesLibConstructor (
   //
   // Allocate array for state of SMRR enable on all CPUs
   //
-  mSmrrEnabled = (BOOLEAN *)AllocatePool (sizeof (BOOLEAN) * PcdGet32 
(PcdCpuMaxLogicalProcessorNumber));
+  mSmrrEnabled = (BOOLEAN *)AllocatePool (sizeof (BOOLEAN) * 
GetCpuMaxLogicalProcessorNumber ());
   ASSERT (mSmrrEnabled != NULL);
 
   return EFI_SUCCESS;
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
index 3e63c5e27f98..0bd9483e97cf 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibNoStm.c
@@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
-#include 
+#include 
 #include 
 
 /**
diff --git a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c 
b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c
index f7f8afacffb5..be394528bcaa 100644
--- a/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c
+++ b/UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmStm.c
@@ -6,7 +6,7 @@
 
 **/
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -30,17 +30,17 @@
 #define FULL_ACCS 7
 
 /**
-  The constructor function
+  The Traditional MM library constructor.
 
   @param[in]  ImageHandle  The firmware allocated handle for the EFI image.
   @param[in]  SystemTable  A pointer to the EFI System Table.
 
-  @retval EFI_SUCCESS  The constructor always returns EFI_SUCCESS.
+  @retval EFI_SUCCESS  This constructor always returns success.
 
 **/
 EFI_STATUS
 EFIAPI
-SmmCpuFeaturesLibConstructor (
+TraditionalMmCpuFeaturesLibConstructor (
   IN EFI_HANDLEImageHandle,
   IN EFI_SYSTEM_TABLE  *SystemTable
   );
@@ -139,7 +139,7 @@ SmmCpuFeaturesLibStmConstructor (
   //
   // Call the common constructor function
   //
-  Status = SmmCpuFeaturesLibConstructor (ImageHandle, SystemTable);
+  Status = TraditionalMmCpuFeaturesLibConstructor (ImageHandle, SystemTable);
   AS

[edk2-devel] Cancelled Event: TianoCore Design Meeting - APAC/NAMO - Friday, 19 February 2021 #cal-cancelled

2021-02-11 Thread devel@edk2.groups.io Calendar
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Groups.io Inc//Groups.io Calendar//EN
METHOD:CANCELLED
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Asia/Shanghai
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/Asia/Shanghai
X-LIC-LOCATION:Asia/Shanghai
BEGIN:STANDARD
TZNAME:CST
TZOFFSETFROM:+0800
TZOFFSETTO:+0800
DTSTART:19700101T00
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
X-GIOIDS:Event:963103 
UID:g7lq.1578029159272351097.u...@groups.io
DTSTAMP:20210212T012048Z
ORGANIZER;CN=Ray Ni:mailto:ray...@intel.com
DTSTART:20210219T013000Z
DTEND:20210219T023000Z
SUMMARY:TianoCore Design Meeting - APAC/NAMO
DESCRIPTION:## TOPIC\n\n* TBD\n\nFor more info\, see here:\nhttps://www.t
 ianocore.org/design-meeting/\n\n## Join Webex Meeting\n\nMeeting number: 
 130 073 1007\n\nPassword: MguMnPN@422\n\nhttps://intel.webex.com/intel/j.
 php?MTID=m6bf2875d89c1ee88ca37eda8fd41a47b\n\nJoin by video system\n\nDia
 l 1300731...@intel.webex.com\n\nYou can also dial 173.243.2.68 and enter 
 your meeting number.\n\nJoin by phone\n\n+1-210-795-1110 US Toll\n\n+1-86
 6-662-9987 US Toll Free\n\nAccess code: 130 073 1007\n\n(Webex can be dow
 nloaded from https://www.webex.com/downloads.html/.)
LOCATION:https://intel.webex.com/intel/j.php?MTID=m6bf2875d89c1ee88ca37ed
 a8fd41a47b
SEQUENCE:999
STATUS:CANCELLED
END:VEVENT
END:VCALENDAR


invite.ics
Description: application/ics


[edk2-devel] [edk2-platforms][PATCH v2 3/3] MinPlatformPkg/SpiFvbService: Add Standalone MM support

2021-02-11 Thread Michael Kubacki
From: Michael Kubacki 

Adds support for MM_STANDALONE. Retains the directory path to the
SMM INF instance for backward compatibility with existing platforms.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => }/FvbInfo.c   
   |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.c  |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSmm.c => 
SpiFvbServiceMm.c}   | 35 ++---
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c  
   | 32 
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c 
   | 32 
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.h  |  4 --
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
   | 22 +++
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf 
   | 17 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf => 
SpiFvbServiceStandaloneMm.inf} | 40 ++--
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc   
   |  2 +
 10 files changed, 130 insertions(+), 54 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c 
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
similarity index 100%
rename from Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c
rename to Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServiceCommon.c
 b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
similarity index 100%
rename from 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServiceCommon.c
rename to 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.c
diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c 
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
similarity index 89%
rename from 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c
rename to Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
index 251fcae30b90..016f19587c91 100644
--- a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c
+++ b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
@@ -1,14 +1,16 @@
 /** @file
-  Common driver source for several Serial Flash devices
+  MM driver source for several Serial Flash devices
   which are compliant with the Intel(R) Serial Flash Interface Compatibility 
Specification.
 
-Copyright (c) 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
+  Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (c) Microsoft Corporation.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
 
 #include "SpiFvbServiceCommon.h"
-#include 
+#include 
+#include 
 #include 
 
 /**
@@ -74,7 +76,7 @@ InstallFvbProtocol (
   //
   FvbHandle = NULL;
 
-  Status = gSmst->SmmInstallProtocolInterface (
+  Status = gMmst->MmInstallProtocolInterface (
 &FvbHandle,
 &gEfiSmmFirmwareVolumeBlockProtocolGuid,
 EFI_NATIVE_INTERFACE,
@@ -82,7 +84,7 @@ InstallFvbProtocol (
 );
   ASSERT_EFI_ERROR (Status);
 
-  Status = gSmst->SmmInstallProtocolInterface (
+  Status = gMmst->MmInstallProtocolInterface (
 &FvbHandle,
 &gEfiDevicePathProtocolGuid,
 EFI_NATIVE_INTERFACE,
@@ -92,22 +94,13 @@ InstallFvbProtocol (
 }
 
 /**
-
   The function does the necessary initialization work for
   Firmware Volume Block Driver.
 
-  @param[in]  ImageHandle   The firmware allocated handle for the UEFI 
image.
-  @param[in]  SystemTable   A pointer to the EFI system table.
-
-  @retval EFI_SUCCESS   This funtion always return EFI_SUCCESS.
-It will ASSERT on errors.
-
 **/
-EFI_STATUS
-EFIAPI
+VOID
 FvbInitialize (
-  IN EFI_HANDLEImageHandle,
-  IN EFI_SYSTEM_TABLE  *SystemTable
+  VOID
   )
 {
   EFI_FVB_INSTANCE  *FvbInstance;
@@ -219,8 +212,7 @@ FvbInitialize (
 mFvbModuleGlobal.FvbInstance =  (EFI_FVB_INSTANCE *) 
AllocateRuntimeZeroPool (BufferSize);
 if (mFvbModuleGlobal.FvbInstance == NULL) {
   ASSERT (FALSE);
-  Status = EFI_OUT_OF_RESOURCES;
-  goto ERROR;
+  return;
 }
 
 MaxLbaSize  = 0;
@@ -276,9 +268,4 @@ FvbInitialize (
 
 }
   }
-
-  return EFI_SUCCESS;
-
-ERROR:
-  

[edk2-devel] [edk2-platforms][PATCH v2 2/3] MinPlatformPkg/MinPlatformPkg.dsc: Add basic MM_STANDALONE libraries

2021-02-11 Thread Michael Kubacki
From: Michael Kubacki 

Adds a fundamental set of library instances that are needed to build
MM_STANDALONE modules.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
Reviewed-by: Nate DeSimone 
---
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc 
b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index d0b559381720..5e88de43e08d 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -2,6 +2,7 @@
 #  Platform description.
 #
 # Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
+# Copyright (c) Microsoft Corporation.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -112,6 +113,12 @@ [LibraryClasses.common.DXE_SMM_DRIVER]
   
TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/SmmTestPointLib.inf
 
+[LibraryClasses.common.MM_STANDALONE]
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
+  
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
+  
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
+
 
###
 #
 # Components Section - list of the modules and components that will be 
processed by compilation
-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71623): https://edk2.groups.io/g/devel/message/71623
Mute This Topic: https://groups.io/mt/80567995/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms][PATCH v2 1/3] MinPlatformPkg/SpiFlashCommonLibNull: Make MODULE_TYPE BASE

2021-02-11 Thread Michael Kubacki
From: Michael Kubacki 

This NULL library can be used to link against a MODULE_TYPE other
than BASE and that would be useful as it is a NULL class instance.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
Reviewed-by: Nate DeSimone 
---
 
Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
 
b/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
index d4964681de3d..75ef1cb921df 100644
--- 
a/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
+++ 
b/Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
@@ -12,8 +12,8 @@ [Defines]
   BASE_NAME  = SpiFlashCommonLibNull
   FILE_GUID  = F35BBEE7-A681-443E-BB15-07AF9FABBDED
   VERSION_STRING = 1.0
-  MODULE_TYPE= DXE_SMM_DRIVER
-  LIBRARY_CLASS  = SpiFlashCommonLib|DXE_SMM_DRIVER
+  MODULE_TYPE= BASE
+  LIBRARY_CLASS  = SpiFlashCommonLib
 #
 # The following information is for reference only and not required by the 
build tools.
 #
-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71622): https://edk2.groups.io/g/devel/message/71622
Mute This Topic: https://groups.io/mt/80567992/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-platforms][PATCH v2 0/3] MinPlatformPkg: Add SpiFvbServiceStandaloneMm

2021-02-11 Thread Michael Kubacki
From: Michael Kubacki 

Adds a new component called SpiFvbServiceStandaloneMm that serves
as a Standalone MM compatible SPI FVB service driver.

Note that a MM_STANDALONE version of SpiFlashCommonLib is being
prepared to be sent but for the time being the module can be added
to the MinPlatformPkg build and rely upon a NULL instance in the
build.

V2 changes:
  1. Add Intel copyright to SpiFvbServiceMm.c

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 

Michael Kubacki (3):
  MinPlatformPkg/SpiFlashCommonLibNull: Make MODULE_TYPE BASE
  MinPlatformPkg/MinPlatformPkg.dsc: Add basic MM_STANDALONE libraries
  MinPlatformPkg/SpiFvbService: Add Standalone MM support

 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => }/FvbInfo.c   
   |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.c  |  0
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSmm.c => 
SpiFvbServiceMm.c}   | 35 ++---
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c  
   | 32 
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c 
   | 32 
 
Platform/Intel/MinPlatformPkg/Flash/Library/SpiFlashCommonLibNull/SpiFlashCommonLibNull.inf
   |  4 +-
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.h  |  4 --
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
   | 22 +++
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf 
   | 17 +
 Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf => 
SpiFvbServiceStandaloneMm.inf} | 40 ++--
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc   
   |  9 +
 11 files changed, 139 insertions(+), 56 deletions(-)
 rename Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/FvbInfo.c (100%)
 rename Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.c (100%)
 rename 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSmm.c => 
SpiFvbServiceMm.c} (89%)
 create mode 100644 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.c
 create mode 100644 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditionalMm.c
 rename Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common => 
}/SpiFvbServiceCommon.h (94%)
 create mode 100644 
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
 copy Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf 
=> SpiFvbServiceStandaloneMm.inf} (64%)

-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71621): https://edk2.groups.io/g/devel/message/71621
Mute This Topic: https://groups.io/mt/80567987/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-platforms][PATCH v1 3/3] MinPlatformPkg/SpiFvbService: Add Standalone MM support

2021-02-11 Thread Michael Kubacki

Hi Nate,

Thanks for the review. I apologize, that was a mistake due to quickly 
changing file headers based on what VS Code showed as new files. I will 
update it in a v2.


Thanks,
Michael

On 2/10/2021 6:20 PM, Nate DeSimone wrote:

Hi Michael,

Given that MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c is almost 
identical to MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSmm.c, it 
seems a little inappropriate to remove Intel's copyright from that file. You 
are welcome to add a Microsoft copyright of course. Other than that, your patch 
series look's good!

Thanks,
Nate


-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael
Kubacki
Sent: Friday, February 5, 2021 4:15 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L
; Liming Gao
; Dong, Eric 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 3/3]
MinPlatformPkg/SpiFvbService: Add Standalone MM support

From: Michael Kubacki 

Adds support for MM_STANDALONE. Retains the directory path to the SMM
INF instance for backward compatibility with existing platforms.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common =>
}/FvbInfo.c  |  0
  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common =>
}/SpiFvbServiceCommon.c  |  0

Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Smm/SpiFvbServiceSm
m.c => SpiFvbServiceMm.c}   | 34 +

Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceStandalon
eMm.c | 32 

Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceTraditiona
lMm.c| 32 
  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{Common =>
}/SpiFvbServiceCommon.h  |  4 --
  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.h
| 22 +++
  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceSmm.inf
| 17 +
  Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/{SpiFvbServiceSmm.inf
=> SpiFvbServiceStandaloneMm.inf} | 40 ++--
  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
|  2 +
  10 files changed, 129 insertions(+), 54 deletions(-)

diff --git
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
similarity index 100%
rename from
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/FvbInfo.c
rename to Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/FvbInfo.c
diff --git
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServi
ceCommon.c
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceComm
on.c
similarity index 100%
rename from
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Common/SpiFvbServic
eCommon.c
rename to
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceCommon.
c
diff --git
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceS
mm.c
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
similarity index 89%
rename from
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceSm
m.c
rename to
Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.c
index 251fcae30b90..3175f5f32e31 100644
---
a/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/Smm/SpiFvbServiceS
mm.c
+++
b/Platform/Intel/MinPlatformPkg/Flash/SpiFvbService/SpiFvbServiceMm.
+++ c
@@ -1,14 +1,15 @@
  /** @file
-  Common driver source for several Serial Flash devices
+  MM driver source for several Serial Flash devices
which are compliant with the Intel(R) Serial Flash Interface Compatibility
Specification.

-Copyright (c) 2017, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent
+  Copyright (c) Microsoft Corporation.
+  SPDX-License-Identifier: BSD-2-Clause-Patent

  **/

  #include "SpiFvbServiceCommon.h"
-#include 
+#include  #include
+
  #include 

  /**
@@ -74,7 +75,7 @@ InstallFvbProtocol (
//
FvbHandle = NULL;

-  Status = gSmst->SmmInstallProtocolInterface (
+  Status = gMmst->MmInstallProtocolInterface (
  &FvbHandle,
  &gEfiSmmFirmwareVolumeBlockProtocolGuid,
  EFI_NATIVE_INTERFACE, @@ -82,7 +83,7 @@ 
InstallFvbProtocol (
  );
ASSERT_EFI_ERROR (Status);

-  Status = gSmst->SmmInstallProtocolInterface (
+  Status = gMmst->MmInstallProtocolInterface (
  &FvbHandle,
  &gEfiDevicePathProtocolGuid,
  EFI_NATIVE_INTERFACE, @@ -92,22 +93,13 @@ 
InstallFvbProtocol
(  }

  /**
-
The function does the necessary initialization work for
Firmware Volume Block Driver.

-  @param[in]  ImageHandle   The firmware allocated handle for the UEFI
image.
-  @param[in]  SystemTable   A pointer to the EF

Re: [edk2-devel] RFC: Adding support for ARM (RNDR etc.) to RngDxe

2021-02-11 Thread Ard Biesheuvel
On Wed, 10 Feb 2021 at 23:49, Rebecca Cran  wrote:
>
> On 1/15/21 7:51 PM, Sami Mujawar wrote:
>
> > I have shared some initial thoughts on the RNG implementation updates at 
> > https://edk2.groups.io/g/devel/files/Designs/2021/0116/EDKII%20-%20Proposed%20update%20to%20RNG%20implementation.pdf
> >
> > Kindly let me know your feedback or if you have any queries.
> The ARMv8.5 RNDRRS instruction appears to be missing from the diagram on
> page 11 - it has RngLib|RNDR, which is listed under PRNG, but RNDRRS
> returns a true random number. From the Arm ARM:
>
> "Returns a 64-bit random number which is reseeded from the True
> Random Number source immediately before the read of the random number."
>

This is an unfortunate oversight in the architecture, but RNDRRS most
certainly does not return a true random number.

RNDR and RNDRRS both return the output of a DRBG (pseudo RNG), and the
only difference is the reseed rate: RNDRRS triggers a reseed on every
invocation, whereas RNDR triggers a reseed at an IMPDEF rate.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71619): https://edk2.groups.io/g/devel/message/71619
Mute This Topic: https://groups.io/mt/78823009/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v1 1/1] Platform/Arm: Fix Ecc error 7008 for SCMI_CLOCK_RATE

2021-02-11 Thread PierreGondois
From: Pierre Gondois 

Following the Ecc reported error in the edk2 repository,
the SCMI_CLOCK_RATE structure has been modified in:
an enum and its elements have been renamed in:
ArmPkg/Include/Protocol/ArmScmiClockProtocol.h

This patch is a follow-up and fixes the following Ecc
reported error:
Complex types should be typedef-ed

The error is due to the a nested structure declaration.

The patch also re-formats the debug messages to fit in
a 80 chars line.

Signed-off-by: Pierre Gondois 
---
The changes can be seen at: 
https://github.com/PierreARM/edk2-platforms/tree/1552_Ecc_ArmPkg_BIS_v1

 .../Library/HdLcdArmJunoLib/HdLcdArmJuno.c| 33 +++
 1 file changed, 26 insertions(+), 7 deletions(-)

diff --git a/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJuno.c 
b/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJuno.c
index 30558878f068..67c9d43cf2b7 100644
--- a/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJuno.c
+++ b/Platform/ARM/JunoPkg/Library/HdLcdArmJunoLib/HdLcdArmJuno.c
@@ -1,6 +1,6 @@
 /** @file

-  Copyright (c) 2013 - 2020, Arm Limited. All rights reserved.
+  Copyright (c) 2013 - 2021, Arm Limited. All rights reserved.

   SPDX-License-Identifier: BSD-2-Clause-Patent

@@ -352,12 +352,31 @@ ProbeHdLcdClock (
 return Status;
   }

-  DEBUG ((DEBUG_ERROR, "Clock ID = %d Clock name = %a\n", *ClockId, 
ClockName));
-  DEBUG ((DEBUG_ERROR, "Minimum frequency = %uHz\n", ClockRate.Min));
-  DEBUG ((DEBUG_ERROR, "Maximum frequency = %uHz\n", ClockRate.Max));
-  DEBUG ((DEBUG_ERROR, "Clock rate step = %uHz\n", ClockRate.Step));
-
-  DEBUG ((DEBUG_ERROR, "HDLCD Current frequency = %uHz\n", CurrentHdLcdFreq));
+  DEBUG ((
+DEBUG_ERROR,
+"Clock ID = %d Clock name = %a\n",
+*ClockId, ClockName
+));
+  DEBUG ((
+DEBUG_ERROR,
+"Minimum frequency = %uHz\n",
+ClockRate.ContinuousRate.Min
+));
+  DEBUG ((
+DEBUG_ERROR,
+"Maximum frequency = %uHz\n",
+ClockRate.ContinuousRate.Max
+));
+  DEBUG ((
+DEBUG_ERROR,
+"Clock rate step = %uHz\n",
+ClockRate.ContinuousRate.Step
+));
+  DEBUG ((
+DEBUG_ERROR,
+"HDLCD Current frequency = %uHz\n",
+CurrentHdLcdFreq
+));

   return EFI_SUCCESS;
 }
--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71618): https://edk2.groups.io/g/devel/message/71618
Mute This Topic: https://groups.io/mt/80563972/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH edk2-platforms v1 0/1] Alignment with ArmPkg Ecc errors fixes

2021-02-11 Thread PierreGondois
From: Pierre Gondois 

A patch serie fixing Ecc errors in edk2/ArmPkg and modifying
C structures was submitted at:
https://edk2.groups.io/g/devel/message/71439

This patch serie requires some modifications to be done in the
edk2-platforms repository. If accepted, the patches for edk2 and
edk2-platforms must be merged synchronously.

Pierre Gondois (1):
  Platform/Arm: Fix Ecc error 7008 for SCMI_CLOCK_RATE

 .../Library/HdLcdArmJunoLib/HdLcdArmJuno.c| 33 +++
 1 file changed, 26 insertions(+), 7 deletions(-)

--
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71617): https://edk2.groups.io/g/devel/message/71617
Mute This Topic: https://groups.io/mt/80563971/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [edk2-announce] TianoCore Community Meeting Minutes - 2/11 & 2/4

2021-02-11 Thread Soumya Guptha
TianoCore Community Meeting Minutes (EMEA/NMO)
February 11, 2021

EVENTS:
No new updates.

STABLE TAG:
edk2-stable202102 - Feature Planning freeze on 2/15
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning

STEWARDS DOWNLOAD:
*   Design meeting - we discussed on Automation & CI system.
   Community Action: Need help from the community on ECC tool (EFI code 
checker), we have critical issues, need help quickly.
   We don't have a dedicated maintainer for ECC tool. Need volunteers to do 
development work on the ECC. Please let Soumya, Mike Kinney and other Stewards, 
and/or the mailing list.
   There are a few features that need a newer version of NASM. We will be 
updating the version of NASM.

*   Workflow for maintainers: Task is to Evaluate the automation feature 
and get feedback. Workflow of maintainers to submit multiple pull requests. 
Issue - causing extra work, process issue. We are investigating on 
automation.If there is any workflow that is inefficient or anything that we can 
do to increase the efficiency, please give us that feedback.

*   Google summer code (sponsored internship program run by google). Need 
some mentors to mentor the interns. Tianocore open source needs to apply. 
Application deadline Feb 19th. We need to develop interesting ideas for summer 
projects. Nate will start an offline thread to discuss ideas for projects. 
Couple of people have expressed some interest in becoming mentors.
   Community Action: If you are interested in either mentoring or have a 
project idea, please send an email to 
(nathaniel.l.desim...@intel.com).
   Deadline is Feb 19th to send the proposal to Google. Send your ideas soon to 
Nate.

ACKNOWLEDGMENTS:
Acknowledge Gary Lin from Suse (g...@suse.com) from Harry 
Hsiung (Intel)
https Boot Ovmfpkg and MdeModulePkg with TLS LSIScsi patches


Regards,
Soumya

-Original Message-
From: annou...@edk2.groups.io  On Behalf Of Soumya 
Guptha
Sent: Thursday, February 4, 2021 8:12 PM
To: annou...@edk2.groups.io; devel@edk2.groups.io
Subject: Re: [edk2-announce] TianoCore Community Meeting Minutes - 2/4

TianoCore Community Meeting Minutes (APAC/NMO)
February 4, 2021



EVENTS:
No new updates.

STABLE TAG:
edk2-stable202102 - Feature Planning freeze on 2/15

https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-Release-Planning

STEWARDS DOWNLOAD (Mike Kinney)
  *   Design meeting - we discussed on Automation & CI system.
  *   Community Action: Need help from the community on ECC tool (EFI code 
checker), we have critical issues, need help quickly.
 *   Kevin - will explore to see if someone has any expertise wrt ECC tool.

  *   Sean plans to send to the info to the community on the tool to help 
format the source code. Sean will send it to the mailing list.
Suggests making ECC smaller.

  *   Addressed all issues related to cmocka.

  *   Workflow for maintainers: some maintainers like to work on multiple pull 
requests, causing extra work, process issue. We are investigating on 
automation. Task is to Evaluate the automation feature and get feedback.

  *   Bugzilla Feature request - update on NASM compiler version will start 
now. This is not required by developers until after the Q1 stable tag.


Opens:

  1.  Nate - Google summer code (sponsored internship program run by google). 
Need some mentors to mentor the interns. Tianocore open source needs to apply. 
Application deadline Feb 19th. We need to develop interesting ideas for summer 
projects. Nate will start an offline thread to discuss ideas for projects. 
Couple of people have expressed some interest in becoming mentors.
Community Action: If you are interested in either mentoring or have a project 
idea, please send an email to 
(nathaniel.l.desim...@intel.com).
Deadline is Feb 19th to send the proposal to Google. Send your ideas soon to 
Nate.

  1.  Sean - code contribution, project management - are we doing anything to 
improve.

Acknowledgments:
Community Action: Please send Soumya if you like to acknowledge anyone from the 
community, if anyone helped you close bugs or reviewed code etc..We will post 
those acknowledgements on the community page.



Soumya Guptha
Firmware Ecosystem Enabling Manager, SFP/IAGS













-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71616): https://edk2.groups.io/g/devel/message/71616
Mute This Topic: https://groups.io/mt/80563734/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-sct PATCH 1/3] edk2-test: Add support for building extra packages

2021-02-11 Thread Grant Likely
The build.sh script is very useful for setting up the build environment
before calling the package build. Sometimes additional packages are
needed when building the SCT. (e.g., it is useful to build ShellPkg).
Refactor the build code to allow additional DSCs to be added to the
build.

This patch is useful when building a full SCT image that includes the
EDK2 shell.

Signed-off-by: Grant Likely 
Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Samer El-Haj-Mahmoud 
---
 uefi-sct/SctPkg/build.sh | 34 +-
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh
index 37667711..22cf9667 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -249,28 +249,20 @@ mkdir -p $DEST_DIR
 cp $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
 
 #
-# Build the SCT package
+# Build the packages needed for the SCT
+# Set $DSC_EXTRA to any extra packages needed for the build
 #
-build -p SctPkg/UEFI/UEFI_SCT.dsc -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b 
$SCT_BUILD $3 $4 $5 $6 $7 $8 $9
-
-# Check if there is any error
-status=$?
-if test $status -ne 0
-then
-  echo Could not build the UEFI SCT package
-  exit -1
-fi
-
-build -p SctPkg/UEFI/IHV_SCT.dsc -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b 
$SCT_BUILD $3 $4 $5 $6 $7 $8 $9
-
-# Check if there is any error
-status=$?
-if test $status -ne 0
-then
-  echo Could not build the IHV SCT package
-  exit -1
-fi
-
+for DSC in SctPkg/UEFI/UEFI_SCT.dsc SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA
+do
+   build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $3 $4 
$5 $6 $7 $8 $9
+   # Check if there is any error
+   status=$?
+   if test $status -ne 0
+   then
+   echo Could not build package $DSC
+   exit -1
+   fi
+done
 
 #
 # If the argument is clean, then don't have to generate Sct binary.
-- 
2.20.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71615): https://edk2.groups.io/g/devel/message/71615
Mute This Topic: https://groups.io/mt/80563679/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-sct PATCH 3/3] edk2-test: Helper script to build SCT+Shell in a bootable format

2021-02-11 Thread Grant Likely
The buildzip.sh script builds the SCT and the EFI Shell, and then zips
them up in a file structure that can be booted when unzipped to a USB
drive or other block storage.

Signed-off-by: Grant Likely 
---
 uefi-sct/SctPkg/buildzip.sh | 67 +
 1 file changed, 67 insertions(+)
 create mode 100755 uefi-sct/SctPkg/buildzip.sh

diff --git a/uefi-sct/SctPkg/buildzip.sh b/uefi-sct/SctPkg/buildzip.sh
new file mode 100755
index ..c5bf20df
--- /dev/null
+++ b/uefi-sct/SctPkg/buildzip.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+#
+#  EDK2 SCT build script for SCT+Shell in a zip file
+#
+#  Copyright (c) 2021, ARM Ltd. All rights reserved.
+#
+#  This program and the accompanying materials
+#  are licensed and made available under the terms and conditions of the BSD 
License
+#  which accompanies this distribution.  The full text of the license may be 
found at 
+#  http://opensource.org/licenses/bsd-license.php
+#
+#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
IMPLIED.
+
+set -e
+
+TARGET_ARCH=$1
+
+if [ X"${TARGET_ARCH}" == X"" ]
+then
+   echo  "Usage: $0 "
+   exit
+fi
+
+case $TARGET_ARCH in
+   AARCH64)
+   BOOT_IMAGE_NAME=BOOTAA64.efi;;
+   *)
+   BOOT_IMAGE_NAME=BOOT${TARGET_ARCH}.efi;;
+esac
+
+# clear all positional parameters
+set --
+
+source ./edk2/edksetup.sh
+
+getconf _NPROCESSORS_ONLN
+NUM_CPUS=$((`getconf _NPROCESSORS_ONLN` + 2))
+
+make -j"$NUM_CPUS" -C edk2/BaseTools/
+
+# Build the SCT and the shell
+DSC_EXTRA=ShellPkg/ShellPkg.dsc ./SctPkg/build.sh ${TARGET_ARCH} GCC RELEASE 
-j"$NUM_CPUS"
+
+# Assemble all the files that need to be in the zip file
+mkdir -p ${TARGET_ARCH}_SCT/EFI/BOOT
+cp 
Build/Shell/RELEASE_GCC5/${TARGET_ARCH}/Shell_EA4BB293-2D7F-4456-A681-1F22F42CD0BC.efi
 ${TARGET_ARCH}_SCT/EFI/BOOT/${BOOT_IMAGE_NAME}
+
+mkdir -p ${TARGET_ARCH}_SCT/SCT
+cp -r Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/${TARGET_ARCH}/* 
${TARGET_ARCH}_SCT/SCT/
+cp Build/UefiSct/RELEASE_GCC5/SctPackage${TARGET_ARCH}/SctStartup.nsh 
${TARGET_ARCH}_SCT/Startup.nsh
+
+# Copy the SCT Parser tool into the repo
+cp sct_parser/* ${TARGET_ARCH}_SCT/SCT/Sequence/
+
+# Put some version information into the ESP directory
+cat > ./${TARGET_ARCH}_SCT/versions.txt << EOF
+EDK2_VER=`git -C ./edk2 describe`
+EDK2_TEST_VER=`git -C ./edk2-test describe`
+BUILD_DATE="`date`"
+EOF
+
+# Zip up the test folder
+cd ${TARGET_ARCH}_SCT
+zip -r ../edk2-test-${TARGET_ARCH,,}.zip *
+cd ..
+
-- 
2.20.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71614): https://edk2.groups.io/g/devel/message/71614
Mute This Topic: https://groups.io/mt/80563677/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [edk2-sct PATCH 2/3] edk2-test: use bash 'shift' in build.sh to manage arguments

2021-02-11 Thread Grant Likely
The script was using a big list of numerical argument to pass on extra
parameters. Use the bash 'shift' command to carve of arguments for the
script so that $@ can be used for the remainder.

Signed-off-by: Grant Likely 
---
 uefi-sct/SctPkg/build.sh | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh
index 22cf9667..3b1414ca 100755
--- a/uefi-sct/SctPkg/build.sh
+++ b/uefi-sct/SctPkg/build.sh
@@ -189,13 +189,16 @@ case `uname` in
;;
 esac
 
+# Drop parsed command line arguments
+shift 2
+
 echo "TOOLCHAIN is ${TARGET_TOOLS}"
 export ${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE
 echo "Toolchain prefix: 
${TARGET_TOOLS}_${SCT_TARGET_ARCH}_PREFIX=$CROSS_COMPILE"
 
 SCT_BUILD=DEBUG
-if [ "$3" = "RELEASE" -o "$3" = "DEBUG" ]; then
-  SCT_BUILD=$3
+if [ "$1" = "RELEASE" -o "$1" = "DEBUG" ]; then
+  SCT_BUILD=$1
   shift
 fi
 
@@ -254,7 +257,7 @@ cp $EDK_TOOLS_PATH/Source/C/bin/GenBin $DEST_DIR/GenBin
 #
 for DSC in SctPkg/UEFI/UEFI_SCT.dsc SctPkg/UEFI/IHV_SCT.dsc $DSC_EXTRA
 do
-   build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $3 $4 
$5 $6 $7 $8 $9
+   build -p $DSC -a $SCT_TARGET_ARCH -t $TARGET_TOOLS -b $SCT_BUILD $@
# Check if there is any error
status=$?
if test $status -ne 0
-- 
2.20.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71613): https://edk2.groups.io/g/devel/message/71613
Mute This Topic: https://groups.io/mt/80563675/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] TianoCore Community Meeting Minutes - 2/4

2021-02-11 Thread Soumya Guptha
Great to hear Bret. Thanks.
Folks, this is a reminder. The deadline for submitting our project (Tianocore) 
proposal to Google summer code is approaching soon (Feb 19th), please do reach 
out to Nate Desimone if you have any project ideas.

Thanks,
Soumya

From: Bret Barkelew 
Sent: Friday, February 5, 2021 1:26 PM
To: Guptha, Soumya K ; annou...@edk2.groups.io; 
devel@edk2.groups.io; Desimone, Nathaniel L 
Subject: RE: TianoCore Community Meeting Minutes - 2/4

@Desimone, Nathaniel L, I'm interested 
in mentorship for the GSC project. Would like to talk offline about potential 
projects and past experience.

RE: ECC, we're internally evaluating 'uncrustify' as an option to 1) check for 
formatting violations and 2) provide a tool to automatically format code prior 
to submission. There are changes that we've made to the tool to support ECC, 
but there are some small places that we're coming up short. What would be the 
appetite to evaluate our progress and discuss possibly adjusting the ECC to be 
more flexible where we've come up short?

- Bret

From: Soumya Guptha via groups.io
Sent: Thursday, February 4, 2021 8:12 PM
To: annou...@edk2.groups.io; 
devel@edk2.groups.io
Subject: [EXTERNAL] Re: [edk2-announce] TianoCore Community Meeting Minutes - 
2/4

TianoCore Community Meeting Minutes (APAC/NMO)

February 4, 2021



EVENTS:

No new updates.



STABLE TAG:



edk2-stable202102 - Feature Planning freeze on 2/15

https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Ftianocore.github.io%2Fwiki%2FEDK-II-Release-Planning&data=04%7C01%7CBret.Barkelew%40microsoft.com%7Ca97d5c438d514d0859ea08d8c98c43a6%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637480951557144463%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=UA13OI0UuZ2QSboHsE4dZY5J0Az1uL8Boxldw0jdtmU%3D&reserved=0





STEWARDS DOWNLOAD (Mike Kinney)

  *   Design meeting - we discussed on Automation & CI system.



  *   Community Action: Need help from the community on ECC tool (EFI code 
checker), we have critical issues, need help quickly.
 *   Kevin - will explore to see if someone has any expertise wrt ECC tool.



  *   Sean plans to send to the info to the community on the tool to help 
format the source code. Sean will send it to the mailing list.
Suggests making ECC smaller.



  *   Addressed all issues related to cmocka.



  *   Workflow for maintainers: some maintainers like to work on multiple pull 
requests, causing extra work, process issue. We are investigating on 
automation. Task is to Evaluate the automation feature and get feedback.



  *   Bugzilla Feature request - update on NASM compiler version will start 
now. This is not required by developers until after the Q1 stable tag.





Opens:

  1.  Nate - Google summer code (sponsored internship program run by google). 
Need some mentors to mentor the interns. Tianocore open source needs to apply. 
Application deadline Feb 19th. We need to develop interesting ideas for summer 
projects. Nate will start an offline thread to discuss ideas for projects. 
Couple of people have expressed some interest in becoming mentors.
Community Action: If you are interested in either mentoring or have a project 
idea, please send an email to 
(nathaniel.l.desim...@intel.com).



  1.  Sean - code contribution, project management - are we doing anything to 
improve.



Acknowledgments:

Community Action: Please send Soumya if you like to acknowledge anyone from the 
community, if anyone helped you close bugs or reviewed code etc..We will post 
those acknowledgements on the community page.



Soumya Guptha
Firmware Ecosystem Enabling Manager, SFP/IAGS











-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71612): https://edk2.groups.io/g/devel/message/71612
Mute This Topic: https://groups.io/mt/80399013/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] TianoCore Community Meeting - EMEA / NAMO - Thu, 02/11/2021 9:00am-10:00am #cal-reminder

2021-02-11 Thread devel@edk2.groups.io Calendar
*Reminder:* TianoCore Community Meeting - EMEA / NAMO

*When:* Thursday, 11 February 2021, 9:00am to 10:00am, (GMT-08:00) America/Los 
Angeles

*Where:* 
https://intel.webex.com/intel/j.php?MTID=mb4b3b50bdc2ea9a5f19e32459e03054e

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1059154 )

*Organizer:* Soumya Guptha soumya.k.gup...@intel.com ( 
soumya.k.gup...@intel.com?subject=Re:%20Event:%20TianoCore%20Community%20Meeting%20-%20EMEA%20%2F%20NAMO
 )

*Description:*

*https://intel.webex.com/intel/j.php?MTID=mb4b3b50bdc2ea9a5f19e32459e03054e
*

Meeting number (access code): 130 005 8326

Meeting password: gJdEnJ4N38$

Join ( 
https://intel.webex.com/intel/j.php?MTID=mb4b3b50bdc2ea9a5f19e32459e03054e )

*Tap to join from a mobile device (attendees only)*
+1-210-795-1110,,1300058326## ( tel:%2B1-210-795-1110,,*01*1300058326%23%23*01* 
) US Toll
+1-866-662-9987,,1300058326## ( tel:%2B1-866-662-9987,,*01*1300058326%23%23*01* 
) US Toll Free

*Join by phone*
+1-210-795-1110 US Toll
+1-866-662-9987 US Toll Free
Global call-in numbers ( 
https://intel.webex.com/intel/globalcallin.php?MTID=m283a44a88d8e761cb35b34ed16c2a4b2
 ) | Toll-free calling restrictions ( 
https://e-meetings.verizonbusiness.com/global/pdf/Verizon_Audio_Conferencing_Global_Access_Information_August2017.pdf
 )

*Join from a video system or application*
Dial 1300058...@intel.webex.com ( sip:1300058...@intel.webex.com )
You can also dial 173.243.2.68 and enter your meeting number.

Need help? Go to http://help.webex.com ( http://help.webex.com )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71611): https://edk2.groups.io/g/devel/message/71611
Mute This Topic: https://groups.io/mt/80562202/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] TianoCore Community Meeting - EMEA / NAMO - Thu, 02/11/2021 9:00am-10:00am #cal-reminder

2021-02-11 Thread devel@edk2.groups.io Calendar
*Reminder:* TianoCore Community Meeting - EMEA / NAMO

*When:* Thursday, 11 February 2021, 9:00am to 10:00am, (GMT-08:00) America/Los 
Angeles

*Where:* 
https://intel.webex.com/intel/j.php?MTID=mb4b3b50bdc2ea9a5f19e32459e03054e

View Event ( https://edk2.groups.io/g/devel/viewevent?eventid=1059154 )

*Organizer:* Soumya Guptha soumya.k.gup...@intel.com ( 
soumya.k.gup...@intel.com?subject=Re:%20Event:%20TianoCore%20Community%20Meeting%20-%20EMEA%20%2F%20NAMO
 )

*Description:*

*https://intel.webex.com/intel/j.php?MTID=mb4b3b50bdc2ea9a5f19e32459e03054e
*

Meeting number (access code): 130 005 8326

Meeting password: gJdEnJ4N38$

Join ( 
https://intel.webex.com/intel/j.php?MTID=mb4b3b50bdc2ea9a5f19e32459e03054e )

*Tap to join from a mobile device (attendees only)*
+1-210-795-1110,,1300058326## ( tel:%2B1-210-795-1110,,*01*1300058326%23%23*01* 
) US Toll
+1-866-662-9987,,1300058326## ( tel:%2B1-866-662-9987,,*01*1300058326%23%23*01* 
) US Toll Free

*Join by phone*
+1-210-795-1110 US Toll
+1-866-662-9987 US Toll Free
Global call-in numbers ( 
https://intel.webex.com/intel/globalcallin.php?MTID=m283a44a88d8e761cb35b34ed16c2a4b2
 ) | Toll-free calling restrictions ( 
https://e-meetings.verizonbusiness.com/global/pdf/Verizon_Audio_Conferencing_Global_Access_Information_August2017.pdf
 )

*Join from a video system or application*
Dial 1300058...@intel.webex.com ( sip:1300058...@intel.webex.com )
You can also dial 173.243.2.68 and enter your meeting number.

Need help? Go to http://help.webex.com ( http://help.webex.com )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71610): https://edk2.groups.io/g/devel/message/71610
Mute This Topic: https://groups.io/mt/80561974/21656
Mute #cal-reminder:https://edk2.groups.io/g/devel/mutehashtag/cal-reminder
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] MdeModulePkg/UfsPassThruDxe: Improve Error handling of Ufs Pass Thru driver

2021-02-11 Thread Purna Chandra Rao Bandaru
From: Bandaru 

https://bugzilla.tianocore.org/show_bug.cgi?id=3217

Following is the brief description of the changes
 1) There are cards that can take upto 600ms for Init and hence increase
the time out for fDeviceInit polling loop.
 2) Add UFS host conctroller reset in the last retry of Link start up.
 3) Retry sending NOP OUT command upto 10 times

Signed-off-by: Bandaru 

Change-Id: I6c0dbc1c147487e51f0ed5f2425957ae089b0160
---
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c| 26 
+-
 MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c | 18 --
 2 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c 
b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
index 9768c2e6fb..89048745be 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.c
@@ -1,6 +1,6 @@
 /** @file
 
-  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   Copyright (c) Microsoft Corporation.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -749,7 +749,7 @@ UfsFinishDeviceInitialization (
 {
   EFI_STATUS  Status;
   UINT8  DeviceInitStatus;
-  UINT8  Timeout;
+  UINT16 Timeout;
 
   DeviceInitStatus = 0xFF;
 
@@ -761,17 +761,23 @@ UfsFinishDeviceInitialization (
 return Status;
   }
 
-  Timeout = 5;
+  Timeout = 6000; //There are cards that can take upto 600ms.
   do {
+MicroSecondDelay (100); //Give 100 us and then start polling.
 Status = UfsReadFlag (Private, UfsFlagDevInit, &DeviceInitStatus);
 if (EFI_ERROR (Status)) {
   return Status;
 }
-MicroSecondDelay (1);
 Timeout--;
   } while (DeviceInitStatus != 0 && Timeout != 0);
 
+  if (Timeout == 0) {
+DEBUG ((DEBUG_ERROR, "UfsFinishDeviceInitialization DeviceInitStatus=%x 
EFI_TIMEOUT \n", DeviceInitStatus));
+return EFI_TIMEOUT;
+  } else {
+DEBUG ((DEBUG_INFO, "UfsFinishDeviceInitialization Timeout left=%x 
EFI_SUCCESS \n", Timeout));
   return EFI_SUCCESS;
+  }
 }
 
 /**
@@ -905,9 +911,19 @@ UfsPassThruDriverBindingStart (
   // At the end of the UFS Interconnect Layer initialization on both host and 
device side,
   // the host shall send a NOP OUT UPIU to verify that the device UTP Layer is 
ready.
   //
+  for (Index = 10; Index > 0; Index--) {
   Status = UfsExecNopCmds (Private);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Status = %r\n", 
Status));
+  DEBUG ((DEBUG_ERROR, "Ufs Sending NOP IN command Error, Index = %x 
Status = %r\n", Index, Status));
+  MicroSecondDelay (100); //100 us
+  continue;
+} else {
+  DEBUG ((DEBUG_INFO, "Ufs Sent NOP OUT successfully and received NOP IN, 
Status = %r\n", Status));
+  break;
+}
+  }
+  if (!Index) {
+DEBUG ((DEBUG_INFO, "NOP OUT failed all the 10 times Status = %r\n", 
Status));
 goto Error;
   }
 
diff --git a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c 
b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
index 0b1030ab47..4fa5689196 100644
--- a/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
+++ b/MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThruHci.c
@@ -2,7 +2,7 @@
   UfsPassThruDxe driver is used to produce EFI_EXT_SCSI_PASS_THRU protocol 
interface
   for upper layer application to execute UFS-supported SCSI cmds.
 
-  Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+  Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
   Copyright (c) Microsoft Corporation.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -1929,17 +1929,15 @@ UfsDeviceDetection (
 
   //
   // Start UFS device detection.
-  // Try up to 3 times for establishing data link with device.
+  // Try up to 4 times for establishing data link with device.
   //
-  for (Retry = 0; Retry < 3; Retry++) {
+  for (Retry = 0; Retry < 4; Retry++) {
 LinkStartupCommand.Opcode = UfsUicDmeLinkStartup;
 LinkStartupCommand.Arg1 = 0;
 LinkStartupCommand.Arg2 = 0;
 LinkStartupCommand.Arg3 = 0;
 Status = UfsExecUicCommands (Private, &LinkStartupCommand);
-if (EFI_ERROR (Status)) {
-  return EFI_DEVICE_ERROR;
-}
+if (!EFI_ERROR (Status)) {
 
 Status = UfsMmioRead32 (Private, UFS_HC_STATUS_OFFSET, &Data);
 if (EFI_ERROR (Status)) {
@@ -1960,6 +1958,14 @@ UfsDeviceDetection (
 }
   }
   return EFI_SUCCESS;
+  }
+}
+if (Retry == 2) {
+  Status = UfsEnableHostController (Private);
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "UfsDeviceDetection: Enable Host Controller 
Fails, Status = %r\n", Status));
+return Status;
+  }
 }
   }
 
-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71609): https://edk2.groups.io/g/devel/message/71609
Mute This Topic: https://groups

Re: [edk2-devel] [edk2-platforms] [PATCH v2 0/3] Add HMAT tables for RD multi-chip platforms

2021-02-11 Thread Vijayenthiran Subramaniam
Hi,

On Wed, Feb 3, 2021 at 9:08 AM Vijayenthiran Subramaniam
 wrote:
>
> This patch series adds HMAT tables for Arm's Neoverse reference design
> multi-chip fixed virtual platforms. The first patch in the series adds helper
> macros to create HMAT table within SgiPkg and the rest two patches adds HMAT
> table for RD-N1-Edge-X2 and RD-V1-MC platforms respectively.
>
> Changes since v1:
> - Fix typo reported here: https://edk2.groups.io/g/devel/message/70855
> - Add comment in the HMAT table about the latency values:
>   https://edk2.groups.io/g/devel/message/71012
>
> Vijayenthiran Subramaniam (3):
>   Platform/ARM/SgiPkg: Add helper macros for HMAT table
>   Platform/ARM/SgiPkg: Add HMAT ACPI table for RdN1EdgeX2
>   Platform/ARM/SgiPkg: Add HMAT ACPI table for RD-V1-MC
>

Pinging to see if there is any feedback on this patch series.

Regards,
Vijayenthiran


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71608): https://edk2.groups.io/g/devel/message/71608
Mute This Topic: https://groups.io/mt/80349471/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH] MdeModulePkg/Universal/SmbiosDxe: Scan for existing tables

2021-02-11 Thread Patrick Rudolph
The default EfiSmbiosProtocol operates on an empty SMBIOS table.
The SMBIOS tables are provided by the bootloader on UefiPayloadPkg.
Scan for existing tables in SmbiosDxe and load them if they seem valid.

This fixes the settings menu not showing any hardware information, instead
only "0 MB RAM" was displayed.

Tests showed that the OS can still see the SMBIOS tables.

Signed-off-by: Patrick Rudolph 
---
 MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c | 223 +++-
 1 file changed, 221 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c 
b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
index 3cdb0b1ed7..958a249cf9 100644
--- a/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
+++ b/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c
@@ -1408,6 +1408,177 @@ SmbiosTableConstruction (
   }
 }
 
+/**
+  Validates a SMBIOS 2.0 table entry point.
+
+  @param  EntryPointStructure   The SMBIOS_TABLE_ENTRY_POINT to validate.
+
+  @retval TRUE   SMBIOS table entry point is valid.
+  @retval FALSE  SMBIOS table entry point is malformed.
+
+**/
+STATIC
+BOOLEAN
+ValidateSmbios20Table(
+  IN SMBIOS_TABLE_ENTRY_POINT  *EntryPointStructure
+) {
+  UINT8 Checksum;
+
+  if (CompareMem (EntryPointStructure->AnchorString, "_SM_", 4) != 0) {
+return FALSE;
+  }
+  if (EntryPointStructure->EntryPointLength < 0x1E) {
+return FALSE;
+  }
+  if (EntryPointStructure->MajorVersion < 2) {
+return FALSE;
+  }
+  if (EntryPointStructure->SmbiosBcdRevision > 0 &&
+(EntryPointStructure->SmbiosBcdRevision >> 4) < 2) {
+return FALSE;
+  }
+  if (EntryPointStructure->TableLength == 0) {
+return FALSE;
+  }
+  if (EntryPointStructure->TableAddress == 0 ||
+EntryPointStructure->TableAddress == ~0) {
+return FALSE;
+  }
+
+  Checksum = CalculateSum8((UINT8 *) EntryPointStructure,
+EntryPointStructure->EntryPointLength);
+  if (Checksum != 0) {
+return FALSE;
+  }
+
+  Checksum = CalculateSum8((UINT8 *) EntryPointStructure + 0x10,
+EntryPointStructure->EntryPointLength - 0x10);
+  if (Checksum != 0) {
+return FALSE;
+  }
+  return TRUE;
+}
+
+/**
+  Validates a SMBIOS 3.0 table entry point.
+
+  @param  Smbios30EntryPointStructure   The SMBIOS_TABLE_3_0_ENTRY_POINT to 
validate.
+
+  @retval TRUE   SMBIOS table entry point is valid.
+  @retval FALSE  SMBIOS table entry point is malformed.
+
+**/
+STATIC
+BOOLEAN
+ValidateSmbios30Table(
+  IN SMBIOS_TABLE_3_0_ENTRY_POINT  *Smbios30EntryPointStructure
+) {
+  UINT8 Checksum;
+
+  if (CompareMem (Smbios30EntryPointStructure->AnchorString, "_SM3_", 5) != 0) 
{
+return FALSE;
+  }
+  if (Smbios30EntryPointStructure->EntryPointLength < 0x18) {
+return FALSE;
+  }
+  if (Smbios30EntryPointStructure->MajorVersion < 3) {
+return FALSE;
+  }
+  if (Smbios30EntryPointStructure->TableMaximumSize == 0) {
+return FALSE;
+  }
+  if (Smbios30EntryPointStructure->TableAddress == 0 ||
+Smbios30EntryPointStructure->TableAddress == ~0) {
+return FALSE;
+  }
+
+  Checksum = CalculateSum8((UINT8 *) Smbios30EntryPointStructure,
+Smbios30EntryPointStructure->EntryPointLength);
+  if (Checksum != 0) {
+return FALSE;
+  }
+  return TRUE;
+}
+
+/**
+  Parse an existing SMBIOS table and insert it using SmbiosAdd.
+
+  @param  ImageHandle   The EFI_HANDLE to this driver.
+  @param  SmbiosThe SMBIOS table to parse.
+  @param  LengthThe length of the SMBIOS table.
+
+  @retval EFI_SUCCESS   SMBIOS table was parsed and installed.
+  @retval EFI_OUT_OF_RESOURCES  Record was not added due to lack of system 
resources.
+
+**/
+STATIC
+EFI_STATUS
+ParseAndAddExistingSmbiosTable(
+  IN EFI_HANDLEImageHandle,
+  IN SMBIOS_STRUCTURE_POINTER  Smbios,
+  IN UINTN Length
+) {
+  EFI_STATUSStatus;
+  CHAR8 *String;
+  EFI_SMBIOS_HANDLE SmbiosHandle;
+  SMBIOS_STRUCTURE_POINTER  SmbiosEnd;
+
+  SmbiosEnd.Raw = Smbios.Raw + Length;
+
+  do {
+// Check for end marker
+if (Smbios.Hdr->Type == 127) {
+  break;
+}
+
+// Install the table
+SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED;
+Status = SmbiosAdd (
+  &mPrivateData.Smbios,
+  ImageHandle,
+  &SmbiosHandle,
+  Smbios.Hdr
+  );
+
+ASSERT_EFI_ERROR (Status);
+if (EFI_ERROR (Status)) {
+  return Status;
+}
+//
+// Go to the next SMBIOS structure. Each SMBIOS structure may include 2 
parts:
+// 1. Formatted section; 2. Unformatted string section. So, 2 steps are 
needed
+// to skip one SMBIOS structure.
+//
+
+//
+// Step 1: Skip over formatted section.
+//
+String = (CHAR8 *) (Smbios.Raw + Smbios.Hdr->Length);
+
+//
+// Step 2: Skip over unformatted string section.
+//
+do {
+  //
+  // Each string is terminated with a NULL(00h) BYTE and the sets of 
strings
+  // is

Re: [edk2-devel] [edk2-platforms PATCH 1/1] Platform/Qemu/SbsaQemu: Add SMBIOS tables

2021-02-11 Thread Leif Lindholm
On Tue, Feb 09, 2021 at 20:24:42 -0700, Rebecca Cran wrote:
> o Add SMBIOS 3.4.0 tables using ArmPkg/Universal/Smbios.
> o Bump the PcdSmbiosVersion PCD from 0x300 to 0x304 to indicate support
>   for SMBIOS 3.4.0, as is required by SBBR.
> o Add an implementation of OemMiscLib that provides the system
>   information. The serial numbers, asset tags etc. are currently all
>   fixed strings, to allow fwts to pass without errors.
> o Add SMBIOS PCDs to identify the platform. The processor serial
>   number, asset tag and part number are populated because otherwise
>   fwts reports errors.
> 
> Signed-off-by: Rebecca Cran 
> ---
>  Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c   | 278 
>  Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.inf |  37 +++
>  Platform/Qemu/SbsaQemu/SbsaQemu.dsc  |  33 ++-
>  Platform/Qemu/SbsaQemu/SbsaQemu.fdf  |   7 +
>  4 files changed, 354 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c 
> b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
> new file mode 100644
> index ..e736096dc607
> --- /dev/null
> +++ b/Platform/Qemu/SbsaQemu/OemMiscLib/OemMiscLib.c
> @@ -0,0 +1,278 @@
> +/** @file
> +*  OemMiscLib.c
> +*
> +*  Copyright (c) 2021, NUVIA Inc. All rights reserved.
> +*  Copyright (c) 2020, Linaro Ltd. All rights reserved.
> +*
> +*  SPDX-License-Identifier: BSD-2-Clause-Patent
> +*
> +**/
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/** Returns whether the specified processor is present or not.
> +
> +  @param ProcessIndex The processor index to check.
> +
> +  @return TRUE if the processor is present, FALSE otherwise.
> +**/
> +BOOLEAN
> +OemIsSocketPresent (
> +  UINTN ProcessorIndex

This gets a bit confusing - mixing socket and processor terminology.

> +  )
> +{
> +  if (ProcessorIndex == 0) {

And this means that we only end up creating entries for cpu0, although
the sbsa-ref platform defaults to 4.

> +return TRUE;
> +  }
> +
> +  return FALSE;
> +}
> +
> +/** Gets the CPU frequency of the specified processor.
> +
> +  @param ProcessorIndex Index of the processor to get the frequency for.
> +
> +  @return   CPU frequency in Hz
> +**/
> +UINTN OemGetCpuFreq (
> +  UINT8 ProcessorIndex
> +  )
> +{
> +  return 20; // 2 GHz
> +}
> +
> +
> +/** Walks through the Device Tree created by Qemu and counts the number
> +of CPUs present in it.
> +
> +Copied from 
> Silicon/Qemu/SbsaQemu/Drivers/SbsaQemuAcpiDxe/SbsaQemuAcpiDxe.c

Instead of copying this, could we break it out into a new helper lib?
Say Silicon/Qemu/SbsaQemu/Library/FdtHelperLib ?
And invoke this in both SbsaQemuAcpiDxe and here?

> +
> +@return The number of CPUs present.
> +**/
> +UINT16
> +CountCpusFromFdt (
> +  VOID
> +)
> +{
> +  VOID   *DeviceTreeBase;
> +  INT32  Node;
> +  INT32  Prev;
> +  INT32  CpuNode;
> +  INT32  CpuCount;
> +
> +  DeviceTreeBase = (VOID *)(UINTN)PcdGet64 (PcdDeviceTreeBaseAddress);
> +  ASSERT (DeviceTreeBase != NULL);
> +
> +  // Make sure we have a valid device tree blob
> +  ASSERT (fdt_check_header (DeviceTreeBase) == 0);
> +
> +  CpuNode = fdt_path_offset (DeviceTreeBase, "/cpus");
> +  if (CpuNode <= 0) {
> +DEBUG ((DEBUG_ERROR, "Unable to locate /cpus in device tree\n"));
> +return 0;
> +  }
> +
> +  CpuCount = 0;
> +
> +  // Walk through /cpus node and count the number of subnodes.
> +  // The count of these subnodes corresponds to the number of
> +  // CPUs created by Qemu.
> +  Prev = fdt_first_subnode (DeviceTreeBase, CpuNode);
> +  while (1) {
> +CpuCount++;
> +Node = fdt_next_subnode (DeviceTreeBase, Prev);
> +if (Node < 0) {
> +  break;
> +}
> +Prev = Node;
> +  }
> +
> +  return CpuCount;
> +}
> +
> +/** Gets information about the specified processor and stores it in
> +the structures provided.
> +
> +  @param ProcessorIndex  Index of the processor to get the information for.
> +  @param ProcessorStatus Processor status.
> +  @param ProcessorCharacteristics Processor characteritics.
> +  @param MiscProcessorDataMiscellaneous processor information.
> +
> +  @return  TRUE on success, FALSE on failure.
> +**/
> +BOOLEAN
> +OemGetProcessorInformation (
> +  IN  UINTN ProcessorIndex,
> +  IN OUT PROCESSOR_STATUS_DATA  *ProcessorStatus,
> +  IN OUT PROCESSOR_CHARACTERISTIC_FLAGS *ProcessorCharacteristics,
> +  IN OUT OEM_MISC_PROCESSOR_DATA*MiscProcessorData
> +  )
> +{
> +  UINT16 CoreCount = CountCpusFromFdt ();
> +
> +  if (ProcessorIndex == 0) {
> +ProcessorStatus->Bits.CpuStatus   = 1; // CPU enabled
> +ProcessorStatus->Bits.Reserved1   = 0;
> +ProcessorStatus->Bits.SocketPopulated = 1;
> +ProcessorStatus->Bits.Reserved2   = 0;
> +  } else {
> +ProcessorStatus->Bits.CpuStatus   = 0; // CPU disabled
> +ProcessorStatus->Bi

Re: [edk2-devel] [PATCH v1 0/2] Enable EKDII core CI support for Kvmtool

2021-02-11 Thread Ard Biesheuvel
On Fri, 22 Jan 2021 at 18:19, Sami Mujawar  wrote:
>
> This patch series adds support to build the Kvmtool firmware using
> EDKII core CI.
>
> The changes can be seen at:
> https://github.com/samimujawar/edk2/tree/1596_kvmtool_ci_v1
>
> Sami Mujawar (2):
>   ArmVirtPkg/PlatformCI: Add EDKII CI support for Kvmtool
>   ArmVirtPkg/.azurepipelines: Add Kvmtool to platform CI matrix
>

Acked-by: Ard Biesheuvel 


>  ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml |  45 ++-
>  ArmVirtPkg/PlatformCI/PlatformBuild.py| 132 
> +++-
>  ArmVirtPkg/PlatformCI/ReadMe.md   |  21 ++--
>  3 files changed, 132 insertions(+), 66 deletions(-)
>
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71605): https://edk2.groups.io/g/devel/message/71605
Mute This Topic: https://groups.io/mt/80035811/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v1 0/2] Enable EKDII core CI support for Kvmtool

2021-02-11 Thread Sami Mujawar
Hi Bret, Sean,

Is it possible to provide feedback for this patch series, please? 

The patches in this series can be seen at:
  https://edk2.groups.io/g/devel/topic/patch_v1_1_2/80035810
  https://edk2.groups.io/g/devel/topic/patch_v1_2_2/80035812

Regards,

Sami Mujawar
-Original Message-
From: gaoliming  
Sent: 25 January 2021 01:30 AM
To: Sami Mujawar ; devel@edk2.groups.io
Cc: ardb+tianoc...@kernel.org; l...@nuviainc.com; sean.bro...@microsoft.com; 
bret.barke...@microsoft.com; michael.d.kin...@intel.com; ler...@redhat.com; 
Matteo Carlini ; Ben Adderson ; 
nd 
Subject: 回复: [PATCH v1 0/2] Enable EKDII core CI support for Kvmtool

Acked-by: Liming Gao 

> -邮件原件-
> 发件人: Sami Mujawar 
> 发送时间: 2021年1月23日 1:20
> 收件人: devel@edk2.groups.io
> 抄送: Sami Mujawar ; ardb+tianoc...@kernel.org;
> l...@nuviainc.com; sean.bro...@microsoft.com;
> bret.barke...@microsoft.com; michael.d.kin...@intel.com;
> gaolim...@byosoft.com.cn; ler...@redhat.com; matteo.carl...@arm.com;
> ben.adder...@arm.com; n...@arm.com
> 主题: [PATCH v1 0/2] Enable EKDII core CI support for Kvmtool
> 
> This patch series adds support to build the Kvmtool firmware using
> EDKII core CI.
> 
> The changes can be seen at:
> https://github.com/samimujawar/edk2/tree/1596_kvmtool_ci_v1
> 
> Sami Mujawar (2):
>   ArmVirtPkg/PlatformCI: Add EDKII CI support for Kvmtool
>   ArmVirtPkg/.azurepipelines: Add Kvmtool to platform CI matrix
> 
>  ArmVirtPkg/PlatformCI/.azurepipelines/Ubuntu-GCC5.yml |  45 ++-
>  ArmVirtPkg/PlatformCI/PlatformBuild.py| 132
> +++-
>  ArmVirtPkg/PlatformCI/ReadMe.md   |  21 ++--
>  3 files changed, 132 insertions(+), 66 deletions(-)
> 
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71604): https://edk2.groups.io/g/devel/message/71604
Mute This Topic: https://groups.io/mt/80554679/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/1] StandaloneMmPkg: Add X64 build support

2021-02-11 Thread Ard Biesheuvel
On Thu, 11 Feb 2021 at 02:02,  wrote:
>
> From: Michael Kubacki 
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3202
>
> Several libraries have been added to the package to support X64 but
> the package itself does not support X64. This modifies the DSC to
> enable X64 build.
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Michael Kubacki 
> Acked-by: Sami Mujawar 

Merged, thanks.

> ---
>
> Notes:
> V2 changes: Update Ard's email address
>
>  StandaloneMmPkg/StandaloneMmPkg.dsc | 13 ++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc 
> b/StandaloneMmPkg/StandaloneMmPkg.dsc
> index a566724c88ab..73f3f0f6b1cd 100644
> --- a/StandaloneMmPkg/StandaloneMmPkg.dsc
> +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc
> @@ -3,6 +3,7 @@
>  #
>  # Copyright (c) 2015, Intel Corporation. All rights reserved.
>  # Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
> +# Copyright (C) Microsoft Corporation
>  #
>  #SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -19,7 +20,7 @@ [Defines]
>PLATFORM_VERSION   = 1.0
>DSC_SPECIFICATION  = 0x00010011
>OUTPUT_DIRECTORY   = Build/StandaloneMm
> -  SUPPORTED_ARCHITECTURES= AARCH64
> +  SUPPORTED_ARCHITECTURES= AARCH64|X64
>BUILD_TARGETS  = DEBUG|RELEASE
>SKUID_IDENTIFIER   = DEFAULT
>
> @@ -37,6 +38,7 @@ [LibraryClasses]
>#
>BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
>BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
> +  
> CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
>DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
>
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
>
> ExtractGuidedSectionLib|EmbeddedPkg/Library/PrePiExtractGuidedSectionLib/PrePiExtractGuidedSectionLib.inf
> @@ -47,7 +49,7 @@ [LibraryClasses]
>
> MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
>
> MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
>PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
> -  
> PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
> +  
> PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
>PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
>PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
>
> ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
> @@ -60,6 +62,7 @@ [LibraryClasses.AARCH64]
>
> StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
>ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
>
> CacheMaintenanceLib|ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
> +  
> PeCoffExtraActionLib|StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
>
>NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
>NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
> @@ -110,11 +113,11 @@ [Components.common]
>StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
>StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf
>
> StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
> -  
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
>StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
>
>  [Components.AARCH64]
>StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
> +  
> StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
>
>  
> ###
>  #
> @@ -128,3 +131,7 @@ [Components.AARCH64]
>  [BuildOptions.AARCH64]
>  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp 
> -mstrict-align
>  GCC:*_*_*_CC_FLAGS = -mstrict-align
> +
> +[BuildOptions.X64]
> +  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
> +  GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
> --
> 2.28.0.windows.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71603): https://edk2.groups.io/g/devel/message/71603
Mute This Topic: https://groups.io/mt/80547929/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 1/1] StandaloneMmPkg/StandaloneMmCore: Fix compiler warning

2021-02-11 Thread Ard Biesheuvel
On Thu, 11 Feb 2021 at 02:04,  wrote:
>
> From: Michael Kubacki 
>
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3204
>
> Fixes the following compiler warning in VS2019 by changing defining
> the MmramRangeCount variable to be UINTN and type casting prior
> to value assignment.
>
> \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): error C2220:
>   the following warning is treated as an error
> \edk2\StandaloneMmPkg\Core\StandaloneMmCore.c(570): warning C4244:
>   '=': conversion from 'UINT64' to 'UINT32', possible loss of data
>
> Cc: Ard Biesheuvel 
> Cc: Sami Mujawar 
> Cc: Jiewen Yao 
> Cc: Supreeth Venkatesh 
> Signed-off-by: Michael Kubacki 
> Reviewed-by: Sami Mujawar 

Merged, thanks.

> ---
>
> Notes:
> V2 changes: Remove whitespace after typecast. Update Ard's email address
>
>  StandaloneMmPkg/Core/StandaloneMmCore.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c 
> b/StandaloneMmPkg/Core/StandaloneMmCore.c
> index 8388ec289ca8..fbb0ec75e557 100644
> --- a/StandaloneMmPkg/Core/StandaloneMmCore.c
> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
> @@ -511,7 +511,7 @@ StandaloneMmMain (
>EFI_HOB_GUID_TYPE   *MmramRangesHob;
>EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHobData;
>EFI_MMRAM_DESCRIPTOR*MmramRanges;
> -  UINT32  MmramRangeCount;
> +  UINTN   MmramRangeCount;
>EFI_HOB_FIRMWARE_VOLUME *BfvHob;
>
>ProcessLibraryConstructorList (HobStart, &gMmCoreMmst);
> @@ -546,7 +546,7 @@ StandaloneMmMain (
>  MmramRangesHobData = GET_GUID_HOB_DATA (MmramRangesHob);
>  ASSERT (MmramRangesHobData != NULL);
>  MmramRanges = MmramRangesHobData->Descriptor;
> -MmramRangeCount = MmramRangesHobData->NumberOfMmReservedRegions;
> +MmramRangeCount = (UINTN)MmramRangesHobData->NumberOfMmReservedRegions;
>  ASSERT (MmramRanges);
>  ASSERT (MmramRangeCount);
>
> @@ -554,7 +554,7 @@ StandaloneMmMain (
>  // Copy the MMRAM ranges into MM_CORE_PRIVATE_DATA table just in case any
>  // code relies on them being present there
>  //
> -gMmCorePrivate->MmramRangeCount = MmramRangeCount;
> +gMmCorePrivate->MmramRangeCount = (UINT64)MmramRangeCount;
>  gMmCorePrivate->MmramRanges =
>(EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePool (MmramRangeCount * sizeof 
> (EFI_MMRAM_DESCRIPTOR));
>  ASSERT (gMmCorePrivate->MmramRanges != 0);
> @@ -567,7 +567,7 @@ StandaloneMmMain (
>  DataInHob   = GET_GUID_HOB_DATA (GuidHob);
>  gMmCorePrivate = (MM_CORE_PRIVATE_DATA *)(UINTN)DataInHob->Address;
>  MmramRanges = (EFI_MMRAM_DESCRIPTOR 
> *)(UINTN)gMmCorePrivate->MmramRanges;
> -MmramRangeCount = gMmCorePrivate->MmramRangeCount;
> +MmramRangeCount = (UINTN)gMmCorePrivate->MmramRangeCount;
>}
>
>//
> --
> 2.28.0.windows.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71602): https://edk2.groups.io/g/devel/message/71602
Mute This Topic: https://groups.io/mt/80547951/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH v2 0/4] RPi: SD/Wifi Acpi updates

2021-02-11 Thread Ard Biesheuvel
On Mon, 1 Feb 2021 at 23:53, Jeremy Linton  wrote:
>
> The existing RPi3 acpi entries for the Arasan
> and sdhci controllers needs updating to work
> with the RPi4. This is done by adding a caps
> override for the legacy Arasan controller and
> then adding an entirely new entry for the newer
> eMMC2 controller.
>
> Then we flip the default routing to make the eMMC2
> the default for the SD card, so that the wifi can
> start working on the Arasan.
>
> Additional we add a menu item to enable the SDMA/ADMA2
> modes on the controller.
>
> v1->v2: Add option for user to enable/disable eMMC DMA
> Only enable the emmc2 table on rpi4 &
> !Arasan routing
> Move emmc2 into its own SSDT and drop
> second _DMA entry
>
> Jeremy Linton (4):
>   Platform/RaspberryPi: Add Negative table check
>   Platform/RaspberryPi/Acpitables: Add eMMC2 device and tweak Arasan
>   Platform/RaspberryPi: User control of eMMC2 DMA
>   Platform/RaspberryPi: Invert default Arasan, Emmc2 routing
>

Hi Jeremy,

I don't see v2 2/4 in my mailbox or in the ML archive. Can you resend please?

Also, what is the status of this work on the Linux side?


>  Platform/RaspberryPi/AcpiTables/AcpiTables.inf |   1 +
>  Platform/RaspberryPi/AcpiTables/Emmc.asl   | 130 
> +
>  Platform/RaspberryPi/AcpiTables/Sdhc.asl   |  18 ++-
>  Platform/RaspberryPi/Drivers/ConfigDxe/ConfigDxe.c |  26 +
>  .../RaspberryPi/Drivers/ConfigDxe/ConfigDxe.inf|   1 +
>  .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.uni |   5 +
>  .../RaspberryPi/Drivers/ConfigDxe/ConfigDxeHii.vfr |  17 +++
>  Platform/RaspberryPi/Include/ConfigVars.h  |   8 ++
>  Platform/RaspberryPi/RPi3/RPi3.dsc |   1 +
>  Platform/RaspberryPi/RPi4/RPi4.dsc |   3 +-
>  Platform/RaspberryPi/RPi4/Readme.md|   2 +-
>  Platform/RaspberryPi/RaspberryPi.dec   |   1 +
>  12 files changed, 208 insertions(+), 5 deletions(-)
>  create mode 100644 Platform/RaspberryPi/AcpiTables/Emmc.asl
>
> --
> 2.13.7
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71601): https://edk2.groups.io/g/devel/message/71601
Mute This Topic: https://groups.io/mt/80300530/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-