Re: [edk2-devel] [edk2-platforms][PATCH V5-2] IpmiFeaturePkg:Provided multiple IPMI interface support in DXE and SMM

2023-08-02 Thread Isaac Oram
Pushed as 3037c13015016f7c398da37eabe33fb0961dc490

Note I fixed PatchCheck.py issues and committed in an order that doesn't break 
git bisect.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107473): https://edk2.groups.io/g/devel/message/107473
Mute This Topic: https://groups.io/mt/100352689/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 V5-1] IpmiFeaturePkg:Provided multiple IPMI interface support in PEI

2023-08-02 Thread Isaac Oram
Pushed as 421e64019d4622b049f510ba8eef7c82fba7b32d

Note I fixed PatchCheck.py issues and committed in an order that doesn't break 
git bisect.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107472): https://edk2.groups.io/g/devel/message/107472
Mute This Topic: https://groups.io/mt/100352666/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 V5-3] IpmiFeaturePkg:Provided multiple IPMI interface support in Library

2023-08-02 Thread Isaac Oram
Pushed as e563c1c528f15d4224103f5c49559df620b5a655

Note I fixed PatchCheck.py issues and committed in an order that doesn't break 
git bisect.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107471): https://edk2.groups.io/g/devel/message/107471
Mute This Topic: https://groups.io/mt/100352699/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 V5-1] IpmiFeaturePkg:Provided multiple IPMI interface support in PEI

2023-08-02 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Arun K  
Sent: Tuesday, July 25, 2023 8:36 AM
To: devel@edk2.groups.io; Arun K 
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Ramkumar Krishnamoorthi ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V5-1] IpmiFeaturePkg:Provided 
multiple IPMI interface support in PEI

Created IpmiTransport2 PPI/Protocol to support multiple
IPMI BMC Interface support such as KCS/BT/SSIF/IPMB with 2 API's
IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
IpmiSubmitCommand2 - This API use the default interface
(PcdDefaultSystemInterface) to send IPMI command.
IpmiSubmitCommand2Ex - This API use the specific interface type
to send IPMI command which is passed as an argument.

Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Signed-off-by: Arun K 
---
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 550 +-
 .../GenericIpmi/Pei/PeiGenericIpmi.h  |  75 ++-
 .../GenericIpmi/Pei/PeiGenericIpmi.inf|  17 +
 .../GenericIpmi/Pei/PeiIpmiBmc.c  | 117 ++--
 .../GenericIpmi/Pei/PeiIpmiBmc.h  |  11 +-
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  86 +--
 .../GenericIpmi/Pei/PeiIpmiHooks.c| 346 +++
 .../GenericIpmi/Pei/PeiIpmiHooks.h| 218 +++
 8 files changed, 1159 insertions(+), 261 deletions(-)
 create mode 100644 
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiIpmiHooks.c
 create mode 100644 
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiIpmiHooks.h

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
index e8b99b6900..61e7ce4ecd 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
@@ -3,6 +3,7 @@


   @copyright

   Copyright 2017 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 

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

 **/



@@ -10,10 +11,208 @@
 #include "PeiGenericIpmi.h"

 #include 

 #include 

+#include 



 ///

-// Function Implementations

-//

+

+static EFI_PEI_NOTIFY_DESCRIPTOR  mNotifyList = {

+  EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH | 
EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,

+  ,

+  UpdateIpmiInstancePtr

+};

+

+/**

+Initialize the API and parameters for IPMI Transport2 Instance

+

+@param[in] IpmiInstance Pointer to IPMI Instance

+

+@return VOID

+

+**/

+VOID

+InitIpmiTransport2 (

+  IN  PEI_IPMI_BMC_INSTANCE_DATA  *IpmiInstance

+  )

+{

+  IpmiInstance->IpmiTransport2Ppi.InterfaceType   = FixedPcdGet8 
(PcdDefaultSystemInterface);

+  IpmiInstance->IpmiTransport2Ppi.IpmiTransport2BmcStatus = BmcStatusOk;

+  IpmiInstance->IpmiTransport2Ppi.IpmiSubmitCommand2  = 
PeiIpmiSendCommand2;

+  IpmiInstance->IpmiTransport2Ppi.IpmiSubmitCommand2Ex= 
PeiIpmiSendCommand2Ex;

+

+  if (FixedPcdGet8 (PcdBtInterfaceSupport) == 1) {

+if (!EFI_ERROR (PlatformIpmiIoRangeSet (FixedPcdGet16 
(PcdBtControlPort {

+  InitBtInterfaceData (>IpmiTransport2Ppi);

+}

+  }

+

+  if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) {

+InitSsifInterfaceData (>IpmiTransport2Ppi);

+  }

+

+  if (FixedPcdGet8 (PcdIpmbInterfaceSupport) == 1) {

+InitIpmbInterfaceData (>IpmiTransport2Ppi);

+  }

+}

+

+/*++

+

+Routine Description:

+  Notify callback function for interfaces.

+

+Arguments:

+  PeiServices  - Describes the list of possible PEI Services.

+  NotifyDescriptor - Pointer to notify descriptor.

+  Ppi  - Pointer to Ppi.

+

+Returns:

+  Status

+

+--*/

+EFI_STATUS

+EFIAPI

+NotifyCallback (

+  IN EFI_PEI_SERVICES   **PeiServices,

+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,

+  IN VOID   *Ppi

+  )

+{

+  EFI_STATUS  Status;

+  PEI_IPMI_BMC_INSTANCE_DATA  *IpmiInstance;

+  PEI_IPMI_DATA_HOB   *IpmiInstancePtrHob;

+  EFI_HOB_GUID_TYPE   *GuidHob;

+  IPMI_INTERFACE_STATEInterfaceState;

+

+  InterfaceState = IpmiInterfaceNotReady;

+

+  GuidHob = GetFirstGuidHob ();

+  ASSERT (GuidHob != NULL);

+  if (GuidHob == NULL) {

+return EFI_NOT_FOUND;

+  }

+

+  IpmiInstancePtrHob = (PEI_IPMI_DATA_HOB *)GET_GUID_HOB_DATA (GuidHob);

+  IpmiInstance   = (PEI_IPMI_BMC_INSTANCE_DATA 
*)IpmiInstancePtrHob->IpmiInstance;

+

+  if (FixedPcdGet8 (PcdSsifInterfaceSupport) == 1) {

+InitSsifInterfaceData (>IpmiTransport2Ppi);

+

+if (IpmiInstance->IpmiTransport2Ppi.Interface.Ssif.InterfaceState == 
IpmiInterfaceInitialized) {

+  InterfaceState = IpmiInterfaceInitialized;

+}

+  }

+

+  if 

Re: [edk2-devel][edk2-platforms][PATCH V5-2] IpmiFeaturePkg:Provided multiple IPMI interface support in DXE and SMM

2023-08-02 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Arun K via 
groups.io
Sent: Tuesday, July 25, 2023 8:37 AM
To: devel@edk2.groups.io; Arun K 
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Ramkumar Krishnamoorthi ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V5-2] IpmiFeaturePkg:Provided 
multiple IPMI interface support in DXE and SMM

Created IpmiTransport2 PPI/Protocol to support multiple
IPMI BMC Interface support such as KCS/BT/SSIF/IPMB with 2 API's
IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
IpmiSubmitCommand2 - This API use the default interface
(PcdDefaultSystemInterface) to send IPMI command.
IpmiSubmitCommand2Ex - This API use the specific interface type
to send IPMI command which is passed as an argument.

Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Signed-off-by: Arun K 
---
 .../GenericIpmi/Common/IpmiBmc.h  |  13 +-
 .../GenericIpmi/Common/IpmiBmcCommon.h|  82 +--
 .../GenericIpmi/Common/IpmiHooks.c| 298 ++-
 .../GenericIpmi/Common/IpmiHooks.h| 119 -
 .../GenericIpmi/Dxe/GenericIpmi.inf   |  14 +-
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 505 +-
 .../GenericIpmi/Smm/SmmGenericIpmi.c  | 351 +---
 .../GenericIpmi/Smm/SmmGenericIpmi.inf|  12 +
 8 files changed, 1117 insertions(+), 277 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
index d306a085e5..76ee988623 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
@@ -3,6 +3,7 @@


   @copyright

   Copyright 1999 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 

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

 **/



@@ -21,17 +22,17 @@
 #include 

 #include 

 #include 

+#include 



 #include "IpmiBmcCommon.h"

 #include "KcsBmc.h"



-

 #define BMC_KCS_TIMEOUT  5   // [s] Single KSC request timeout



 //

 // IPMI Instance signature

 //

-#define SM_IPMI_BMC_SIGNATURE SIGNATURE_32 ('i', 'p', 'm', 'i')

+#define SM_IPMI_BMC_SIGNATURESIGNATURE_32 ('i', 'p', 'm', 'i')

 #define IPMI_SEND_COMMAND_MAX_RETRY  3   // Number of retries

 #define INSTANCE_FROM_SM_IPMI_BMC_THIS(a) \

   CR ( \

@@ -41,4 +42,12 @@
   SM_IPMI_BMC_SIGNATURE \

   )



+#define INSTANCE_FROM_IPMI_TRANSPORT2_THIS(a) \

+  CR ( \

+  a, \

+  IPMI_BMC_INSTANCE_DATA, \

+  IpmiTransport2, \

+  SM_IPMI_BMC_SIGNATURE \

+  )

+

 #endif // _IPMI_BMC_H_

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
index 06eab62aae..faf6cc6685 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
+++ 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
@@ -3,16 +3,17 @@


   @copyright

   Copyright 1999 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 

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

 **/



 #ifndef _IPMI_COMMON_BMC_H_

 #define _IPMI_COMMON_BMC_H_



-#define MAX_TEMP_DATA 255 // 160 Modified to increase number of bytes 
transfered per command

-#define BMC_SLAVE_ADDRESS 0x20

-#define MAX_SOFT_COUNT10

-#define COMP_CODE_NORMAL  0x00

+#define MAX_TEMP_DATA  255// 160 Modified to increase number of bytes 
transfered per command

+#define BMC_SLAVE_ADDRESS  0x20

+#define MAX_SOFT_COUNT 10

+#define COMP_CODE_NORMAL   0x00



 //

 // IPMI command completion codes to check for in the UpdateErrorStatus routine.

@@ -33,8 +34,8 @@
 // D4h C Insufficient privilege, in KCS channel this indicates KCS Policy 
Control Mode is Deny All.

 // In authenticated channels this indicates invalid authentication/privilege.

 //

-#define COMP_INSUFFICIENT_PRIVILEGE   0xD4

-#define COMP_CODE_UNSPECIFIED 0xFF

+#define COMP_INSUFFICIENT_PRIVILEGE  0xD4

+#define COMP_CODE_UNSPECIFIED0xFF



 #define COMPLETION_CODES \

   { \

@@ -47,15 +48,16 @@
 // Dxe Ipmi instance data

 //

 typedef struct {

-  UINTN   Signature;

-  UINT64  KcsTimeoutPeriod;

-  UINT8   SlaveAddress;

-  BMC_STATUS  BmcStatus;

-  UINT64  ErrorStatus;

-  UINT8   SoftErrorCount;

-  UINT16  IpmiIoBase;

-  IPMI_TRANSPORT  IpmiTransport;

-  EFI_HANDLE  IpmiSmmHandle;

+  UINTN  Signature;

+  UINT64 KcsTimeoutPeriod;

+  UINT8  SlaveAddress;

+  BMC_STATUS BmcStatus;

+  UINT64 ErrorStatus;

+  UINT8  SoftErrorCount;

+  UINT1

Re: [edk2-devel] [PATCH] MinPlatformPkg: Remove IA32 in PeiFspWrapperPlatformLib

2023-07-26 Thread Isaac Oram
Pushed as 9131d63e08..41e8d638fa

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Wednesday, July 26, 2023 10:11 AM
To: Hsueh, DoraX ; devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Eric ; Chuang, Rosen ; Kuo, Ted 

Subject: Re: [edk2-devel] [PATCH] MinPlatformPkg: Remove IA32 in 
PeiFspWrapperPlatformLib

Reviewed-by: Isaac Oram 

-Original Message-
From: Hsueh, DoraX  
Sent: Monday, July 24, 2023 3:43 AM
To: devel@edk2.groups.io
Cc: Hsueh, DoraX ; Chiu, Chasel ; 
Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 
; Chuang, Rosen ; Kuo, Ted 

Subject: [PATCH] MinPlatformPkg: Remove IA32 in PeiFspWrapperPlatformLib

From: DoraX Hsueh 

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

Remove IA32 only dependency, Because we need to support both IA32 and X64.
Apply to a modern platform supporting x64.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Cc: Rosen Chuang 
Cc: Ted Kuo 
Signed-off-by: DoraX Hsueh 
---
 .../PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
index dafd17dc..489b34cf 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
+++ 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
@@ -51,7 +51,7 @@
   IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec

   MinPlatformPkg/MinPlatformPkg.dec

 

-[LibraryClasses.IA32]

+[LibraryClasses]

   SiliconPolicyInitLib

   SiliconPolicyUpdateLib

   PeiServicesTablePointerLib

-- 
2.26.2.windows.1








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




Re: [edk2-devel] [PATCH] MinPlatformPkg: Remove IA32 in PeiFspWrapperPlatformLib

2023-07-26 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Hsueh, DoraX  
Sent: Monday, July 24, 2023 3:43 AM
To: devel@edk2.groups.io
Cc: Hsueh, DoraX ; Chiu, Chasel ; 
Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 
; Chuang, Rosen ; Kuo, Ted 

Subject: [PATCH] MinPlatformPkg: Remove IA32 in PeiFspWrapperPlatformLib

From: DoraX Hsueh 

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

Remove IA32 only dependency, Because we need to support both IA32 and X64.
Apply to a modern platform supporting x64.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Cc: Rosen Chuang 
Cc: Ted Kuo 
Signed-off-by: DoraX Hsueh 
---
 .../PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
index dafd17dc..489b34cf 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
+++ 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
@@ -51,7 +51,7 @@
   IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec

   MinPlatformPkg/MinPlatformPkg.dec

 

-[LibraryClasses.IA32]

+[LibraryClasses]

   SiliconPolicyInitLib

   SiliconPolicyUpdateLib

   PeiServicesTablePointerLib

-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107274): https://edk2.groups.io/g/devel/message/107274
Mute This Topic: https://groups.io/mt/100333272/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 1/1] ManageabilityPkg: Ipmi Get/Set Boot Options

2023-07-11 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Chang, Abner  
Sent: Monday, July 10, 2023 6:36 PM
To: Chesley, Brit ; devel@edk2.groups.io
Cc: Oram, Isaac W ; Attar, AbdulLateef (Abdul Lateef) 
; Nickle Wang 
Subject: RE: [edk2-platforms][PATCH v1 1/1] ManageabilityPkg: Ipmi Get/Set Boot 
Options

[AMD Official Use Only - General]

Thank you Brit for the contribution! Let's wait for 1-2 days to see if there is 
any other comments for this change.

Reviewed-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Tuesday, July 11, 2023 3:23 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Isaac Oram 
> ; Attar, AbdulLateef (Abdul Lateef) 
> ; Nickle Wang 
> Subject: [edk2-platforms][PATCH v1 1/1] ManageabilityPkg: Ipmi Get/Set 
> Boot Options
>
> From: Brit Chesley 
>
> BZ #: 4455.
> Support parameter selectors for IPMI Get/Set boot options. The size of 
> the response data is now dependent on the parameter selector, rather 
> than being fixed.
>
> Cc: Abner Chang 
> Cc: Isaac Oram 
> Cc: Abdul Lateef Attar 
> Cc: Nickle Wang 
> Signed-off-by: Brit Chesley 
> ---
>  .../IpmiCommandLibNetFnChassis.c  | 124 ++
>  1 file changed, 102 insertions(+), 22 deletions(-)
>
> diff --git
> a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNe
> tFnChassis.c
> b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNe
> tFnChassis.c
> index 0c40ad20b98a..01682f55b36d 100644
> ---
> a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNe
> tFnChassis.c
> +++
> b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNe
> tFnChassis.c
> @@ -152,17 +152,58 @@ IpmiSetSystemBootOptions (
>)
>  {
>EFI_STATUS  Status;
> -  UINT32  DataSize;
> -
> -  DataSize = sizeof (*BootOptionsResponse);
> -  Status   = IpmiSubmitCommand (
> -   IPMI_NETFN_CHASSIS,
> -   IPMI_CHASSIS_SET_SYSTEM_BOOT_OPTIONS,
> -   (VOID *)BootOptionsRequest,
> -   sizeof (*BootOptionsRequest),
> -   (VOID *)BootOptionsResponse,
> -   
> -   );
> +  UINT32  RequestDataSize;
> +  UINT32  ResponseDataSize;
> +
> +  ResponseDataSize = sizeof (*BootOptionsResponse);  RequestDataSize  
> + = sizeof (*BootOptionsRequest);
> +
> +  switch (BootOptionsRequest->ParameterValid.Bits.ParameterSelector) {
> +case IPMI_BOOT_OPTIONS_PARAMETER_SELECTOR_SET_IN_PROGRESS:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_0);
> +  break;
> +
> +case
> IPMI_BOOT_OPTIONS_PARAMETER_SELECTOR_SERVICE_PARTITION_SELECT
> OR:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_1);
> +  break;
> +
> +case
> IPMI_BOOT_OPTIONS_PARAMETER_SELECTOR_SERVICE_PARTITION_SCAN:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_2);
> +  break;
> +
> +case IPMI_BOOT_OPTIONS_PARAMETER_SELECTOR_BMC_BOOT_FLAG:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_3);
> +  break;
> +
> +case IPMI_BOOT_OPTIONS_PARAMETER_BOOT_INFO_ACK:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_4);
> +  break;
> +
> +case IPMI_BOOT_OPTIONS_PARAMETER_BOOT_FLAGS:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_5);
> +  break;
> +
> +case IPMI_BOOT_OPTIONS_PARAMETER_BOOT_INITIATOR_INFO:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_6);
> +  break;
> +
> +case IPMI_BOOT_OPTIONS_PARAMETER_BOOT_INITIATOR_MAILBOX:
> +  RequestDataSize += sizeof
> (IPMI_BOOT_OPTIONS_RESPONSE_PARAMETER_7);
> +  break;
> +
> +default:
> +  return EFI_INVALID_PARAMETER;
> +  break;
> +  }
> +
> +  Status = IpmiSubmitCommand (
> + IPMI_NETFN_CHASSIS,
> + IPMI_CHASSIS_SET_SYSTEM_BOOT_OPTIONS,
> + (VOID *)BootOptionsRequest,
> + RequestDataSize,
> + (VOID *)BootOptionsResponse,
> + 
> + );
>return Status;
>  }
>
> @@ -184,16 +225,55 @@ IpmiGetSystemBootOptions (
>)
>  {
>EFI_STATUS  Status;
> -  UINT32  DataSize;
> -
> -  DataSize = sizeof (*BootOptionsResponse);
> -  Status   = IpmiSubmitCommand (
> -   IPMI_NETFN_CHASSIS,
> -   IPMI_CHASSIS_GET_SYSTEM_BOOT_OPTIONS,
> -   (VOID *)BootOptionsRequest,
> -   sizeof (*BootOptionsRequest),
> -   (VOID *)BootOptionsResponse,
> -   
> -   );
> +  UIN

Re: [edk2-devel][edk2-platforms][PATCH V4-1] IpmiFeaturePkg:Provided multiple IPMI interface support in PEI

2023-07-11 Thread Isaac Oram
I think the exception has something to do with gEfiPeiSmbus2PpiGuid.

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, July 11, 2023 6:45 PM
To: Arun K ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Ramkumar 
Krishnamoorthi ; Gao, Liming 
Subject: Re: [edk2-devel][edk2-platforms][PATCH V4-1] IpmiFeaturePkg:Provided 
multiple IPMI interface support in PEI

Arun,

My apologies that my feedback wasn't clear enough.  I would like to avoid the 
preprocessor optimization step of using #if in favor of using C code and using 
link time optimization to remove unused code.  I sent you a patch with examples 
of using the PCD in normal C logic.  I don't think it is 100%, but it should be 
clear on the concept.

Regarding the logic you implemented for 
  gIpmiFeaturePkgTokenSpaceGuid.PcdKcsInterfaceSupport
  gIpmiFeaturePkgTokenSpaceGuid.PcdBtInterfaceSupport
  gIpmiFeaturePkgTokenSpaceGuid.PcdSsifInterfaceSupport
  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmbInterfaceSupport

I think that there might be too much dynamic conditional logic.  Like case 
statements that have #if around cases that should only happen if the interface 
is present and enabled.  I think it is better to simplify the code so that the 
presence and use is enough.  I sent you a patch that converts all existing 
preprocessor (#if) logic to C logic.  But it is better if you can remove some 
of that conditional logic.  The more you can simplify the number of build/test 
combinations, the better.
What I mean specifically is if:
#if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1)
  if ((InterfaceType == SysInterfaceKcs) && 
(IpmiInstance->IpmiTransport2.Interface.KcsInterfaceState == 
IpmiInterfaceInitialized))...

Could be something like:
  if ((InterfaceType == SysInterfaceKcs) && 
(IpmiInstance->IpmiTransport2.Interface.KcsInterfaceState == 
IpmiInterfaceInitialized))...
Then that would be a little simpler and it doesn't initially look like we lose 
anything particularly valuable.  It doesn't look like enough code to be 
significant in a server use case.


It doesn't seem like everything is working properly with 
PcdSsifInterfaceSupport enabled.  In testing on WilsonCityRvp, I get an 
exception if it is enabled.  It might be a good idea to see if there is some 
more error checking needed there.  It might make sense that it isn't supported, 
but it should be a more graceful failure.

Please run python \edk2\BaseTools\Scripts\PatchCheck.py -3 on the changes and 
correct the issues.

Otherwise, the code looks good.

Regards,
Isaac

-Original Message-
From: Arun K  
Sent: Monday, July 3, 2023 7:43 AM
To: devel@edk2.groups.io; Arun K 
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Ramkumar Krishnamoorthi ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V4-1] IpmiFeaturePkg:Provided 
multiple IPMI interface support in PEI

Created IpmiTransport2 PPI/Protocol to support multiple IPMI BMC Interface 
support such as KCS/BT/SSIF/IPMB with 2 API's
IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
IpmiSubmitCommand2 - This API use the default interface
(PcdDefaultSystemInterface) to send IPMI command.
IpmiSubmitCommand2Ex - This API use the specific interface type to send IPMI 
command which is passed as an argument.

Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Signed-off-by: Arun K 
---
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 295 ++
 .../GenericIpmi/Pei/PeiGenericIpmi.h  |   3 +
 .../GenericIpmi/Pei/PeiGenericIpmi.inf|  16 +
 .../GenericIpmi/Pei/PeiIpmiBmc.c  | 117 +++---
 .../GenericIpmi/Pei/PeiIpmiBmc.h  |  11 +-
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  86 +++--
 .../GenericIpmi/Pei/PeiIpmiHooks.c| 363 ++
 .../GenericIpmi/Pei/PeiIpmiHooks.h| 218 +++
 8 files changed, 949 insertions(+), 160 deletions(-)  create mode 100644 
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiIpmiHooks.c
 create mode 100644 
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiIpmiHooks.h

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
index e8b99b6900..04ebfb6f23 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/
+++ PeiGenericIpmi.c
@@ -3,6 +3,7 @@


   @copyright

   Copyright 2017 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 
+ 

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

 **/



@@ -10,10 +11,143 @@
 #include "PeiGenericIpmi.h"

 #include 

 #include 

+#include 



 ///

-// Function Implementations

-//

+

+/**

+Initia

Re: [edk2-devel][edk2-platforms][PATCH V4-1] IpmiFeaturePkg:Provided multiple IPMI interface support in PEI

2023-07-11 Thread Isaac Oram
Arun,

My apologies that my feedback wasn't clear enough.  I would like to avoid the 
preprocessor optimization step of using #if in favor of using C code and using 
link time optimization to remove unused code.  I sent you a patch with examples 
of using the PCD in normal C logic.  I don't think it is 100%, but it should be 
clear on the concept.

Regarding the logic you implemented for 
  gIpmiFeaturePkgTokenSpaceGuid.PcdKcsInterfaceSupport
  gIpmiFeaturePkgTokenSpaceGuid.PcdBtInterfaceSupport
  gIpmiFeaturePkgTokenSpaceGuid.PcdSsifInterfaceSupport
  gIpmiFeaturePkgTokenSpaceGuid.PcdIpmbInterfaceSupport

I think that there might be too much dynamic conditional logic.  Like case 
statements that have #if around cases that should only happen if the interface 
is present and enabled.  I think it is better to simplify the code so that the 
presence and use is enough.  I sent you a patch that converts all existing 
preprocessor (#if) logic to C logic.  But it is better if you can remove some 
of that conditional logic.  The more you can simplify the number of build/test 
combinations, the better.
What I mean specifically is if:
#if (FixedPcdGet8 (PcdKcsInterfaceSupport) == 1)
  if ((InterfaceType == SysInterfaceKcs) && 
(IpmiInstance->IpmiTransport2.Interface.KcsInterfaceState == 
IpmiInterfaceInitialized))...

Could be something like:
  if ((InterfaceType == SysInterfaceKcs) && 
(IpmiInstance->IpmiTransport2.Interface.KcsInterfaceState == 
IpmiInterfaceInitialized))...
Then that would be a little simpler and it doesn't initially look like we lose 
anything particularly valuable.  It doesn't look like enough code to be 
significant in a server use case.


It doesn't seem like everything is working properly with 
PcdSsifInterfaceSupport enabled.  In testing on WilsonCityRvp, I get an 
exception if it is enabled.  It might be a good idea to see if there is some 
more error checking needed there.  It might make sense that it isn't supported, 
but it should be a more graceful failure.

Please run python \edk2\BaseTools\Scripts\PatchCheck.py -3 on the changes and 
correct the issues.

Otherwise, the code looks good.

Regards,
Isaac

-Original Message-
From: Arun K  
Sent: Monday, July 3, 2023 7:43 AM
To: devel@edk2.groups.io; Arun K 
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Ramkumar Krishnamoorthi ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V4-1] IpmiFeaturePkg:Provided 
multiple IPMI interface support in PEI

Created IpmiTransport2 PPI/Protocol to support multiple IPMI BMC Interface 
support such as KCS/BT/SSIF/IPMB with 2 API's
IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
IpmiSubmitCommand2 - This API use the default interface
(PcdDefaultSystemInterface) to send IPMI command.
IpmiSubmitCommand2Ex - This API use the specific interface type to send IPMI 
command which is passed as an argument.

Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Signed-off-by: Arun K 
---
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 295 ++
 .../GenericIpmi/Pei/PeiGenericIpmi.h  |   3 +
 .../GenericIpmi/Pei/PeiGenericIpmi.inf|  16 +
 .../GenericIpmi/Pei/PeiIpmiBmc.c  | 117 +++---
 .../GenericIpmi/Pei/PeiIpmiBmc.h  |  11 +-
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  86 +++--
 .../GenericIpmi/Pei/PeiIpmiHooks.c| 363 ++
 .../GenericIpmi/Pei/PeiIpmiHooks.h| 218 +++
 8 files changed, 949 insertions(+), 160 deletions(-)  create mode 100644 
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiIpmiHooks.c
 create mode 100644 
Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiIpmiHooks.h

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
index e8b99b6900..04ebfb6f23 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/
+++ PeiGenericIpmi.c
@@ -3,6 +3,7 @@


   @copyright

   Copyright 2017 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 
+ 

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

 **/



@@ -10,10 +11,143 @@
 #include "PeiGenericIpmi.h"

 #include 

 #include 

+#include 



 ///

-// Function Implementations

-//

+

+/**

+Initialize the API and parameters for IPMI Transport2 Instance

+

+@param[in] IpmiInstance Pointer to IPMI Instance

+

+@return VOID

+

+**/

+VOID

+InitIpmiTransport2 (

+  IN  PEI_IPMI_BMC_INSTANCE_DATA *IpmiInstance

+  )

+{

+  IpmiInstance->IpmiTransport2Ppi.InterfaceType   = FixedPcdGet8 
(PcdDefaultSystemInterface);

+  IpmiInstance->IpmiTransport2Ppi.IpmiTransport2Bm

Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Add Mem Type Info variable validity checks

2023-07-06 Thread Isaac Oram
Pushed as 87c40ac89b97eccac690762536db5376af15bb65

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Wednesday, July 5, 2023 7:57 PM
To: devel@edk2.groups.io; mikub...@linux.microsoft.com
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Eric ; Lautner, Kenneth 
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Add 
Mem Type Info variable validity checks

Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Wednesday, July 5, 2023 6:57 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Oram, Isaac W ; Gao, 
Liming ; Dong, Eric ; Lautner, 
Kenneth 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Add Mem 
Type Info variable validity checks

From: Michael Kubacki 

Adds some sanity checks around the Memory Type Information data restored from 
the `EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME` UEFI variable.

This is particularly useful when the structures that the data was saved against 
have changed in the latest firmware image. For example, 
`EfiUnacceptedMemoryType` was added to `EFI_MEMORY_TYPE` in
edk2 commit `502c01c`. This incremented `EfiMaxMemoryType` by `1`.

That change was first released in the `edk2-stable202211` stable tag.

Firmware performing an update across those stable tags may encounter issues 
depending on code implementation for handling `EfiMaxMemoryType` as a 
terminating loop value. This change checks the size and max memory type saved 
in the UEFI variable to determine whether it is better to start from the 
defaults and rebuild the UEFI variable data on the current boot.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Co-authored-by: Ken Lautner 
Signed-off-by: Michael Kubacki 
---
 
Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c 
| 32 +---
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
 
b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
index d8c96b52f4b3..bc97711a02f6 100644
--- 
a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Platfor
+++ mInitPreMem.c
@@ -164,18 +164,22 @@ BuildMemoryTypeInformation (
   EFI_STATUS  Status;
   EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
   UINTN   DataSize;
+  UINTN   Index;
   EFI_MEMORY_TYPE_INFORMATION MemoryData[EfiMaxMemoryType + 1];
 
   //
   // Locate system configuration variable
   //
-  Status = PeiServicesLocatePpi(
+  Status = PeiServicesLocatePpi (
  , // GUID
  0,// INSTANCE
  NULL, // EFI_PEI_PPI_DESCRIPTOR
  (VOID **)// PPI
  );
-  ASSERT_EFI_ERROR(Status);
+  if (EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+return;
+  }
 
   DataSize = sizeof (MemoryData);
   Status = VariableServices->GetVariable ( @@ -186,9 +190,29 @@ 
BuildMemoryTypeInformation (
,

);
-  if (EFI_ERROR(Status)) {
+  if (!EFI_ERROR (Status)) {
+if (DataSize % sizeof (EFI_MEMORY_TYPE_INFORMATION) != 0) {
+  DEBUG ((DEBUG_ERROR, "The UEFI Memory Type Information variable size is 
inconsistent with this build.\n"));
+  Status = EFI_COMPROMISED_DATA;
+} else {
+  // Loop through all except the last one and make sure it seems reasonable
+  for (Index = 0; Index < ((DataSize / sizeof 
(EFI_MEMORY_TYPE_INFORMATION)) - 1); Index++) {
+if (MemoryData[Index].Type >= EfiMaxMemoryType) {
+  DEBUG ((DEBUG_ERROR, "UEFI Memory Type Information variable has an 
invalid memory type.\n"));
+  Status = EFI_COMPROMISED_DATA;
+}
+  }
+  // The last entry must be MaxMemoryType with size 0
+  if ((MemoryData[Index].Type != EfiMaxMemoryType) || 
(MemoryData[Index].NumberOfPages != 0)) {
+DEBUG ((DEBUG_ERROR, "UEFI Memory Type Information variable contains 
an invalid last entry.\n"));
+Status = EFI_COMPROMISED_DATA;
+  }
+}
+  }
+
+  if (EFI_ERROR (Status)) {
 DataSize = sizeof (mDefaultMemoryTypeInformation);
-CopyMem(MemoryData, mDefaultMemoryTypeInformation, DataSize);
+CopyMem (MemoryData, mDefaultMemoryTypeInformation, DataSize);
   }
 
   ///
--
2.41.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106670): https://edk2.groups.io/g/devel/message/106670
Mute This Topic: https://groups.io/mt/99978201/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.i

Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Fix build errors in SmmVariableWriteLib

2023-07-06 Thread Isaac Oram
Pushed as f4fbaf6022603957fefa77c9ceb77f4b2851b0dc

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Wednesday, July 5, 2023 7:55 PM
To: devel@edk2.groups.io; mikub...@linux.microsoft.com
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Eric 
Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Fix 
build errors in SmmVariableWriteLib

Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Wednesday, July 5, 2023 6:40 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Oram, Isaac W ; Gao, 
Liming ; Dong, Eric 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Fix build 
errors in SmmVariableWriteLib

From: Michael Kubacki 

Commit `b71f2bd` introduced a couple build errors in VariableWritelib. This 
change adds the SMM Services Table (`gSmst`) and MM Services Table (`gMmst`) 
calls needed to register the protocol notify in the Traditional and Standalone 
MM services constructors.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
 
Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
  | 6 +-  
Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
 | 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
 
b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
index 8c2b7d18f5f8..447d358a3104 100644
--- 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
+++ b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/Standalo
+++ neMmVariableWriteLibConstructor.c
@@ -74,7 +74,11 @@ StandaloneMmVariableWriteLibConstructor (
   //
   // Register VarLibExitBootServicesCallback for 
gEdkiiSmmExitBootServicesProtocolGuid.
   //
-  Status = SmmRegisterProtocolNotify (, 
VarLibExitBootServicesCallback, );
+  Status = gMmst->MmRegisterProtocolNotify (
+,
+VarLibExitBootServicesCallback,
+
+);
   ASSERT_EFI_ERROR (Status);
 
   return Status;
diff --git 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
 
b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
index abc1e25cde6c..413930d465eb 100644
--- 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
+++ b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/Traditio
+++ nalMmVariableWriteLibConstructor.c
@@ -74,7 +74,11 @@ TraditionalMmVariableWriteLibConstructor (
   //
   // Register VarLibExitBootServicesCallback for 
gEdkiiSmmExitBootServicesProtocolGuid.
   //
-  Status = SmmRegisterProtocolNotify (, 
VarLibExitBootServicesCallback, );
+  Status = gSmst->SmmRegisterProtocolNotify (
+,
+VarLibExitBootServicesCallback,
+
+);
   ASSERT_EFI_ERROR (Status);
 
   return Status;
--
2.41.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106669): https://edk2.groups.io/g/devel/message/106669
Mute This Topic: https://groups.io/mt/99977994/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com] 
-=-=-=-=-=-=









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106712): https://edk2.groups.io/g/devel/message/106712
Mute This Topic: https://groups.io/mt/99977994/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 1/1] MinPlatformPkg: Add Mem Type Info variable validity checks

2023-07-05 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Wednesday, July 5, 2023 6:57 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Oram, Isaac W ; Gao, 
Liming ; Dong, Eric ; Lautner, 
Kenneth 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Add Mem 
Type Info variable validity checks

From: Michael Kubacki 

Adds some sanity checks around the Memory Type Information data restored from 
the `EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME` UEFI variable.

This is particularly useful when the structures that the data was saved against 
have changed in the latest firmware image. For example, 
`EfiUnacceptedMemoryType` was added to `EFI_MEMORY_TYPE` in
edk2 commit `502c01c`. This incremented `EfiMaxMemoryType` by `1`.

That change was first released in the `edk2-stable202211` stable tag.

Firmware performing an update across those stable tags may encounter issues 
depending on code implementation for handling `EfiMaxMemoryType` as a 
terminating loop value. This change checks the size and max memory type saved 
in the UEFI variable to determine whether it is better to start from the 
defaults and rebuild the UEFI variable data on the current boot.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Co-authored-by: Ken Lautner 
Signed-off-by: Michael Kubacki 
---
 
Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c 
| 32 +---
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
 
b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
index d8c96b52f4b3..bc97711a02f6 100644
--- 
a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Platfor
+++ mInitPreMem.c
@@ -164,18 +164,22 @@ BuildMemoryTypeInformation (
   EFI_STATUS  Status;
   EFI_PEI_READ_ONLY_VARIABLE2_PPI *VariableServices;
   UINTN   DataSize;
+  UINTN   Index;
   EFI_MEMORY_TYPE_INFORMATION MemoryData[EfiMaxMemoryType + 1];
 
   //
   // Locate system configuration variable
   //
-  Status = PeiServicesLocatePpi(
+  Status = PeiServicesLocatePpi (
  , // GUID
  0,// INSTANCE
  NULL, // EFI_PEI_PPI_DESCRIPTOR
  (VOID **)// PPI
  );
-  ASSERT_EFI_ERROR(Status);
+  if (EFI_ERROR (Status)) {
+ASSERT_EFI_ERROR (Status);
+return;
+  }
 
   DataSize = sizeof (MemoryData);
   Status = VariableServices->GetVariable ( @@ -186,9 +190,29 @@ 
BuildMemoryTypeInformation (
,

);
-  if (EFI_ERROR(Status)) {
+  if (!EFI_ERROR (Status)) {
+if (DataSize % sizeof (EFI_MEMORY_TYPE_INFORMATION) != 0) {
+  DEBUG ((DEBUG_ERROR, "The UEFI Memory Type Information variable size is 
inconsistent with this build.\n"));
+  Status = EFI_COMPROMISED_DATA;
+} else {
+  // Loop through all except the last one and make sure it seems reasonable
+  for (Index = 0; Index < ((DataSize / sizeof 
(EFI_MEMORY_TYPE_INFORMATION)) - 1); Index++) {
+if (MemoryData[Index].Type >= EfiMaxMemoryType) {
+  DEBUG ((DEBUG_ERROR, "UEFI Memory Type Information variable has an 
invalid memory type.\n"));
+  Status = EFI_COMPROMISED_DATA;
+}
+  }
+  // The last entry must be MaxMemoryType with size 0
+  if ((MemoryData[Index].Type != EfiMaxMemoryType) || 
(MemoryData[Index].NumberOfPages != 0)) {
+DEBUG ((DEBUG_ERROR, "UEFI Memory Type Information variable contains 
an invalid last entry.\n"));
+Status = EFI_COMPROMISED_DATA;
+  }
+}
+  }
+
+  if (EFI_ERROR (Status)) {
 DataSize = sizeof (mDefaultMemoryTypeInformation);
-CopyMem(MemoryData, mDefaultMemoryTypeInformation, DataSize);
+CopyMem (MemoryData, mDefaultMemoryTypeInformation, DataSize);
   }
 
   ///
--
2.41.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106670): https://edk2.groups.io/g/devel/message/106670
Mute This Topic: https://groups.io/mt/99978201/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com]
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106676): https://edk2.groups.io/g/devel/message/106676
Mute This Topic: https://groups.io/mt/99978201/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 1/1] MinPlatformPkg: Fix build errors in SmmVariableWriteLib

2023-07-05 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Wednesday, July 5, 2023 6:40 PM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Oram, Isaac W ; Gao, 
Liming ; Dong, Eric 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg: Fix build 
errors in SmmVariableWriteLib

From: Michael Kubacki 

Commit `b71f2bd` introduced a couple build errors in VariableWritelib. This 
change adds the SMM Services Table (`gSmst`) and MM Services Table (`gMmst`) 
calls needed to register the protocol notify in the Traditional and Standalone 
MM services constructors.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Michael Kubacki 
---
 
Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
  | 6 +-  
Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
 | 6 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
 
b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
index 8c2b7d18f5f8..447d358a3104 100644
--- 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/StandaloneMmVariableWriteLibConstructor.c
+++ b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/Standalo
+++ neMmVariableWriteLibConstructor.c
@@ -74,7 +74,11 @@ StandaloneMmVariableWriteLibConstructor (
   //
   // Register VarLibExitBootServicesCallback for 
gEdkiiSmmExitBootServicesProtocolGuid.
   //
-  Status = SmmRegisterProtocolNotify (, 
VarLibExitBootServicesCallback, );
+  Status = gMmst->MmRegisterProtocolNotify (
+,
+VarLibExitBootServicesCallback,
+
+);
   ASSERT_EFI_ERROR (Status);
 
   return Status;
diff --git 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
 
b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
index abc1e25cde6c..413930d465eb 100644
--- 
a/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/TraditionalMmVariableWriteLibConstructor.c
+++ b/Platform/Intel/MinPlatformPkg/Library/SmmVariableWriteLib/Traditio
+++ nalMmVariableWriteLibConstructor.c
@@ -74,7 +74,11 @@ TraditionalMmVariableWriteLibConstructor (
   //
   // Register VarLibExitBootServicesCallback for 
gEdkiiSmmExitBootServicesProtocolGuid.
   //
-  Status = SmmRegisterProtocolNotify (, 
VarLibExitBootServicesCallback, );
+  Status = gSmst->SmmRegisterProtocolNotify (
+,
+VarLibExitBootServicesCallback,
+
+);
   ASSERT_EFI_ERROR (Status);
 
   return Status;
--
2.41.0.windows.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106669): https://edk2.groups.io/g/devel/message/106669
Mute This Topic: https://groups.io/mt/99977994/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com]
-=-=-=-=-=-=




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




[edk2-devel] [PATCH 3/3] MdePkg/ReportStatusCodeLib: Add macros to identify status codes

2023-07-05 Thread Isaac Oram
Add macros that make it easier to determine if a status code
is an error, progress, or debug code.

Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Isaac Oram 
---
 .../Include/Guid/MemoryStatusCodeRecord.h |  2 +-
 MdePkg/Include/Library/ReportStatusCodeLib.h  | 61 +++
 2 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h 
b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
index a924c592c9..5e01600891 100644
--- a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
+++ b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
@@ -56,7 +56,7 @@ typedef struct {
 ///
 typedef struct {
   ///
-  /// The index pointing to the last recored being stored.
+  /// The index pointing to the last record being stored.
   ///
   UINT32RecordIndex;
   ///
diff --git a/MdePkg/Include/Library/ReportStatusCodeLib.h 
b/MdePkg/Include/Library/ReportStatusCodeLib.h
index 3763e69928..4b6647d91d 100644
--- a/MdePkg/Include/Library/ReportStatusCodeLib.h
+++ b/MdePkg/Include/Library/ReportStatusCodeLib.h
@@ -20,6 +20,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #define REPORT_STATUS_CODE_PROPERTY_ERROR_CODE_ENABLED 0x0002
 #define REPORT_STATUS_CODE_PROPERTY_DEBUG_CODE_ENABLED 0x0004
 
+//
+// Helpers for parsing status codes
+//
+#define IS_ERROR_STATUS_CODE(Type) (((Type) & EFI_STATUS_CODE_TYPE_MASK)   
   == EFI_ERROR_CODE)
+#define IS_PROGRESS_STATUS_CODE(Type)  (((Type) & EFI_STATUS_CODE_TYPE_MASK)   
   == EFI_PROGRESS_CODE)
+#define IS_DEBUG_STATUS_CODE(Type) (((Type) & EFI_STATUS_CODE_TYPE_MASK)   
   == EFI_DEBUG_CODE)
+
 /**
   Converts a status code to an 8-bit POST code value.
 
@@ -363,13 +370,13 @@ ReportDebugCodeEnabled (
   @retval  EFI_UNSUPPORTED   Report status code is not supported.
 
 **/
-#define REPORT_STATUS_CODE(Type, Value)
  \
-  (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_PROGRESS_CODE) ?  \
-  ReportStatusCode(Type,Value) 
  :  \
-  (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_ERROR_CODE)   ?  \
-  ReportStatusCode(Type,Value) 
  :  \
-  (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_DEBUG_CODE)   ?  \
-  ReportStatusCode(Type,Value) 
  :  \
+#define REPORT_STATUS_CODE(Type, Value)   \
+  (ReportProgressCodeEnabled () && IS_PROGRESS_STATUS_CODE (Type))  ? \
+  ReportStatusCode (Type, Value): \
+  (ReportErrorCodeEnabled () && IS_ERROR_STATUS_CODE (Type))? \
+  ReportStatusCode (Type, Value): \
+  (ReportDebugCodeEnabled () && IS_DEBUG_STATUS_CODE (Type))? \
+  ReportStatusCode (Type, Value): \
   EFI_UNSUPPORTED
 
 /**
@@ -393,13 +400,13 @@ ReportDebugCodeEnabled (
  is already in progress.
 
 **/
-#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type, Value, DevicePathParameter)  
   \
-  (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_PROGRESS_CODE) ?  \
-  ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter)   
  :  \
-  (ReportErrorCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_ERROR_CODE)   ?  \
-  ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter)   
  :  \
-  (ReportDebugCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_DEBUG_CODE)   ?  \
-  ReportStatusCodeWithDevicePath(Type,Value,DevicePathParameter)   
  :  \
+#define REPORT_STATUS_CODE_WITH_DEVICE_PATH(Type, Value, DevicePathParameter) \
+  (ReportProgressCodeEnabled () && IS_PROGRESS_STATUS_CODE (Type))  ? \
+  ReportStatusCodeWithDevicePath (Type, Value, DevicePathParameter) : \
+  (ReportErrorCodeEnabled () && IS_ERROR_STATUS_CODE (Type))? \
+  ReportStatusCodeWithDevicePath (Type, Value, DevicePathParameter) : \
+  (ReportDebugCodeEnabled () && IS_DEBUG_STATUS_CODE (Type))? \
+  ReportStatusCodeWithDevicePath (Type, Value, DevicePathParameter) : \
   EFI_UNSUPPORTED
 
 /**
@@ -425,13 +432,13 @@ ReportDebugCodeEnabled (
  is already in progress.
 
 **/
-#define REPORT_STATUS_CODE_WITH_EXTENDED_DATA(Type, Value, ExtendedData, 
ExtendedDataSize) \
-  (ReportProgressCodeEnabled() && ((Type) & EFI_STATUS_CODE_TYPE_MASK) == 
EFI_PROGRESS_CODE) ?  \
-  ReportStatusCodeWith

[edk2-devel] [PATCH 2/3] MdeModulePkg/StatusCodeHandlerSmm: Clarify ASSERT source

2023-07-05 Thread Isaac Oram
Disambiguate SMM sourced asserts from other DXE asserts.

Cc: Dandan Bi 
Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Isaac Oram 
---
 .../Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c 
b/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c
index e994e69e48..8a11c0f6bb 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/SerialStatusCodeWorker.c
@@ -57,7 +57,7 @@ SerialStatusCodeReportWorker (
 CharCount = AsciiSPrint (
   Buffer,
   sizeof (Buffer),
-  "\n\rDXE_ASSERT!: %a (%d): %a\n\r",
+  "\n\rSMM_ASSERT!: %a (%d): %a\n\r",
   Filename,
   LineNumber,
   Description
-- 
2.40.0.windows.1



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




[edk2-devel] [PATCH 1/3] MdeModulePkg/StatusCodeHandlerSmm: Remove unused code

2023-07-05 Thread Isaac Oram
Serial worker does not have this initialization function implemented.

Cc: Dandan Bi 
Cc: Liming Gao 
Cc: Michael D Kinney 
Signed-off-by: Isaac Oram 
---
 .../RuntimeDxe/StatusCodeHandlerRuntimeDxe.h  | 11 ---
 .../StatusCodeHandler/Smm/StatusCodeHandlerMm.h   | 11 ---
 2 files changed, 22 deletions(-)

diff --git 
a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
 
b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
index 7fa06389bb..26ad9e3585 100644
--- 
a/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
+++ 
b/MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
@@ -37,17 +37,6 @@
 
 extern RUNTIME_MEMORY_STATUSCODE_HEADER  *mRtMemoryStatusCodeTable;
 
-/**
-  Locates Serial I/O Protocol as initialization for serial status code worker.
-
-  @retval EFI_SUCCESS  Serial I/O Protocol is successfully located.
-
-**/
-EFI_STATUS
-EfiSerialStatusCodeInitializeWorker (
-  VOID
-  );
-
 /**
   Convert status code value and extended data to readable ASCII string, send 
string to serial I/O device.
 
diff --git a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h 
b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h
index e416220cb5..8196b0963d 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h
@@ -34,17 +34,6 @@
 
 extern RUNTIME_MEMORY_STATUSCODE_HEADER  *mMmMemoryStatusCodeTable;
 
-/**
-  Locates Serial I/O Protocol as initialization for serial status code worker.
-
-  @retval EFI_SUCCESS  Serial I/O Protocol is successfully located.
-
-**/
-EFI_STATUS
-EfiSerialStatusCodeInitializeWorker (
-  VOID
-  );
-
 /**
   Convert status code value and extended data to readable ASCII string, send 
string to serial I/O device.
 
-- 
2.40.0.windows.1



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




[edk2-devel] [PATCH 0/3] Small SMM status code handler fixes

2023-07-05 Thread Isaac Oram
This is some minor housekeeping on SMM status code handling.
https://github.com/tianocore/edk2/pull/4610

Cc: Dandan Bi 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Zhiguang Liu 
Signed-off-by: Isaac Oram 

Isaac Oram (3):
  MdeModulePkg/StatusCodeHandlerSmm: Remove unused code
  MdeModulePkg/StatusCodeHandlerSmm: Clarify ASSERT source
  MdePkg/ReportStatusCodeLib: Add macros to identify status codes

 .../Include/Guid/MemoryStatusCodeRecord.h |  2 +-
 .../RuntimeDxe/StatusCodeHandlerRuntimeDxe.h  | 11 
 .../Smm/SerialStatusCodeWorker.c  |  2 +-
 .../Smm/StatusCodeHandlerMm.h | 11 
 MdePkg/Include/Library/ReportStatusCodeLib.h  | 61 +++
 5 files changed, 36 insertions(+), 51 deletions(-)

--
2.40.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106671): https://edk2.groups.io/g/devel/message/106671
Mute This Topic: https://groups.io/mt/99978817/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] IntelSiliconPkg: Add gEndOfSiInitPpiGuid definition in DEC file

2023-06-30 Thread Isaac Oram
Pushed as dd09609ec9..bc10b26189

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Friday, June 30, 2023 1:51 PM
To: Chang, Hunter ; devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; S, Ashraf Ali ; Chen, 
Tina ; Chen, Arthur G 
Subject: Re: [edk2-devel] [PATCH v1] IntelSiliconPkg: Add gEndOfSiInitPpiGuid 
definition in DEC file

Reviewed-by: Isaac Oram 

-Original Message-
From: Chang, Hunter  
Sent: Tuesday, June 13, 2023 5:40 AM
To: devel@edk2.groups.io
Cc: Chang, Hunter ; Ni, Ray ; 
Chaganty, Rangasai V ; Oram, Isaac W 
; S, Ashraf Ali ; Chen, Tina 
; Chen, Arthur G 
Subject: [PATCH v1] IntelSiliconPkg: Add gEndOfSiInitPpiGuid definition in DEC 
file

From: Hunter Chang 

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

Add gEndOfSiInitPpiGuid definition in IntelSiliconPkg.dec gEndOfSiInitPpiGuid 
indicates the end of all of the silicon init.
Add it to IntellSiliconPkg for AFP improvement.

Signed-off-by: Hunter Chang 

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Isaac Oram 
Cc: Ashraf Ali S 
Cc: Tina Chen 
Cc: Arthur Chen 
---
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec 
b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index ec8690a8d6..c540ef40ad 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -113,6 +113,7 @@
   gEdkiiVTdInfoPpiGuid = { 0x8a59fcb3, 0xf191, 0x400c, { 0x97, 0x67, 0x67, 
0xaf, 0x2b, 0x25, 0x68, 0x4a } }   gEdkiiVTdNullRootEntryTableGuid = { 
0x3de0593f, 0x6e3e, 0x4542, { 0xa1, 0xcb, 0xcb, 0xb2, 0xdb, 0xeb, 0xd8, 0xff } 
}   gIntelDieInfoPpiGuid = { 0xF9E45CBF, 0x1E21, 0x434A, { 0x90, 0x88, 0x1D, 
0x10, 0x38, 0xF3, 0x68, 0xF2 }}+  gEndOfSiInitPpiGuid  = { 0xE2E3D5D1, 0x8356, 
0x4F96, { 0x9C, 0x9E, 0x2E, 0xC3, 0x48, 0x1D, 0xEA, 0x88 }}  [Protocols]   ## 
Protocols that provide services for the Intel(R) PCH SPI Host Controller 
Compatibility Interface-- 
2.26.2.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106582): https://edk2.groups.io/g/devel/message/106582
Mute This Topic: https://groups.io/mt/99504366/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] IntelSiliconPkg: Add gEndOfSiInitPpiGuid definition in DEC file

2023-06-30 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Chang, Hunter  
Sent: Tuesday, June 13, 2023 5:40 AM
To: devel@edk2.groups.io
Cc: Chang, Hunter ; Ni, Ray ; 
Chaganty, Rangasai V ; Oram, Isaac W 
; S, Ashraf Ali ; Chen, Tina 
; Chen, Arthur G 
Subject: [PATCH v1] IntelSiliconPkg: Add gEndOfSiInitPpiGuid definition in DEC 
file

From: Hunter Chang 

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

Add gEndOfSiInitPpiGuid definition in IntelSiliconPkg.dec gEndOfSiInitPpiGuid 
indicates the end of all of the silicon init.
Add it to IntellSiliconPkg for AFP improvement.

Signed-off-by: Hunter Chang 

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Isaac Oram 
Cc: Ashraf Ali S 
Cc: Tina Chen 
Cc: Arthur Chen 
---
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec 
b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index ec8690a8d6..c540ef40ad 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -113,6 +113,7 @@
   gEdkiiVTdInfoPpiGuid = { 0x8a59fcb3, 0xf191, 0x400c, { 0x97, 0x67, 0x67, 
0xaf, 0x2b, 0x25, 0x68, 0x4a } }   gEdkiiVTdNullRootEntryTableGuid = { 
0x3de0593f, 0x6e3e, 0x4542, { 0xa1, 0xcb, 0xcb, 0xb2, 0xdb, 0xeb, 0xd8, 0xff } 
}   gIntelDieInfoPpiGuid = { 0xF9E45CBF, 0x1E21, 0x434A, { 0x90, 0x88, 0x1D, 
0x10, 0x38, 0xF3, 0x68, 0xF2 }}+  gEndOfSiInitPpiGuid  = { 0xE2E3D5D1, 0x8356, 
0x4F96, { 0x9C, 0x9E, 0x2E, 0xC3, 0x48, 0x1D, 0xEA, 0x88 }}  [Protocols]   ## 
Protocols that provide services for the Intel(R) PCH SPI Host Controller 
Compatibility Interface-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106581): https://edk2.groups.io/g/devel/message/106581
Mute This Topic: https://groups.io/mt/99504366/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 1/1] IntelSiliconPkg/SpiFvbService: Non-functional cleanup

2023-06-30 Thread Isaac Oram
Pushed as 1befeabcc8..dd09609ec9

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Friday, June 30, 2023 1:22 PM
To: S, Ashraf Ali ; devel@edk2.groups.io; 
mikub...@linux.microsoft.com
Cc: Ni, Ray ; Chaganty, Rangasai V 

Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] 
IntelSiliconPkg/SpiFvbService: Non-functional cleanup

Reviewed-by: Isaac Oram 

Mixing DEBUG_WARN | DEBUG_ERROR confuses me a bit.  I would prefer simpler 
definitions were errors are "something is wrong" and warnings are "something 
might be wrong".
But it is a pretty minor nit and cleanup is good, so don't worry about changing 
it.

Regards,
Isaac

-Original Message-
From: S, Ashraf Ali 
Sent: Friday, June 30, 2023 11:57 AM
To: devel@edk2.groups.io; mikub...@linux.microsoft.com
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Oram, Isaac W 
Subject: RE: [edk2-devel] [edk2-platforms][PATCH v1 1/1] 
IntelSiliconPkg/SpiFvbService: Non-functional cleanup

Reviewed-by: Ashraf Ali S 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Friday, June 30, 2023 8:03 AM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Oram, Isaac W ; S, 
Ashraf Ali 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/1] 
IntelSiliconPkg/SpiFvbService: Non-functional cleanup

From: Michael Kubacki 

During a review of this driver a number of improvements were noted such as 
strengthening function input validation, checking return values, making debug 
print error levels consistent in certain code blocks, etc.

These type of changes are made with no explicit change to driver functionality.

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Isaac Oram 
Cc: Ashraf Ali S 
Signed-off-by: Michael Kubacki 
---
 Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c
 |  35 ++-
 
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c 
| 248 
 Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceMm.c
 |  54 +++--
 
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.h 
|  31 ++-
 Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceMm.h
 |   6 +-
 5 files changed, 239 insertions(+), 135 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c
index ab1cb2ef1622..ebbd9edaada3 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.
+++ c
@@ -2,16 +2,17 @@
   Defines data structure that is the volume header found.
   These data is intent to decouple FVB driver with FV header.
 
-Copyright (c) 2017, Intel Corporation. All rights reserved. -Copyright (c) 
Microsoft Corporation.
-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"
 
-#define FIRMWARE_BLOCK_SIZE 0x1
+#define FIRMWARE_BLOCK_SIZE SIZE_64KB
 #define FVB_MEDIA_BLOCK_SIZEFIRMWARE_BLOCK_SIZE
+
 typedef struct {
   EFI_PHYSICAL_ADDRESSBaseAddress;
   EFI_FIRMWARE_VOLUME_HEADER  FvbInfo;
@@ -19,7 +20,7 @@ typedef struct {
 } EFI_FVB2_MEDIA_INFO;
 
 /**
-  Returns FVB media information for NV variable storage.
+  Returns FVB media information for a firmware volume.
 
   @return   FvbMediaInfo  A pointer to an instance of FVB media 
info produced by this function.
   The buffer is allocated internally to 
this function and it is the caller's @@ -100,8 +101,21 @@ 
FVB_MEDIA_INFO_GENERATOR mFvbMediaInfoGenerators[] = {
   GenerateNvStorageFvbMediaInfo
 };
 
+/**
+  Returns an empty firmware volume for the firmware volume at the given base 
address.
+
+  @param[in]FvBaseAddress   The base address of the firmware volume 
requested.
+  @param[out]   FvbInfo A pointer that will be set to a buffer for 
the firmware volume header
+at the given base address. The buffer is a 
pool allocation made in this function.
+
+  @retval EFI_SUCCESS   The firmware volume was returned 
successfully.
+  @retval EFI_INVALID_PARAMETER The FvbInfo pointer argument is NULL.
+  @retval EFI_NOT_FOUND The firmware volume was not found for the 
given base address.
+  @retval EFI_OUT_OF_RESOURCES  Insufficient memory to allocate a buffer 
to the hold the firmware volume.
+
+**/
 EFI_STATUS
-GetFvbInfo (
+GetGeneratedFvByAddress (
   IN  EFI_PHYSICAL_ADDRESS FvBaseAddress,
   OUT EFI_FIRMWARE_VOLUME_HEADER   **FvbInfo
   )
@@ -111,11 +125,19 @@ GetFvbInfo (
   UINTN   Index;
   EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;
 
+  if (

Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg/SpiFvbService: Non-functional cleanup

2023-06-30 Thread Isaac Oram
Reviewed-by: Isaac Oram 

Mixing DEBUG_WARN | DEBUG_ERROR confuses me a bit.  I would prefer simpler 
definitions were errors are "something is wrong" and warnings are "something 
might be wrong".
But it is a pretty minor nit and cleanup is good, so don't worry about changing 
it.

Regards,
Isaac

-Original Message-
From: S, Ashraf Ali  
Sent: Friday, June 30, 2023 11:57 AM
To: devel@edk2.groups.io; mikub...@linux.microsoft.com
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Oram, Isaac W 
Subject: RE: [edk2-devel] [edk2-platforms][PATCH v1 1/1] 
IntelSiliconPkg/SpiFvbService: Non-functional cleanup

Reviewed-by: Ashraf Ali S 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Friday, June 30, 2023 8:03 AM
To: devel@edk2.groups.io
Cc: Ni, Ray ; Chaganty, Rangasai V 
; Oram, Isaac W ; S, 
Ashraf Ali 
Subject: [edk2-devel] [edk2-platforms][PATCH v1 1/1] 
IntelSiliconPkg/SpiFvbService: Non-functional cleanup

From: Michael Kubacki 

During a review of this driver a number of improvements were noted such as 
strengthening function input validation, checking return values, making debug 
print error levels consistent in certain code blocks, etc.

These type of changes are made with no explicit change to driver functionality.

Cc: Ray Ni 
Cc: Rangasai V Chaganty 
Cc: Isaac Oram 
Cc: Ashraf Ali S 
Signed-off-by: Michael Kubacki 
---
 Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c
 |  35 ++-
 
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c 
| 248 
 Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceMm.c
 |  54 +++--
 
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.h 
|  31 ++-
 Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceMm.h
 |   6 +-
 5 files changed, 239 insertions(+), 135 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c 
b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c
index ab1cb2ef1622..ebbd9edaada3 100644
--- a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/FvbInfo.
+++ c
@@ -2,16 +2,17 @@
   Defines data structure that is the volume header found.
   These data is intent to decouple FVB driver with FV header.
 
-Copyright (c) 2017, Intel Corporation. All rights reserved. -Copyright (c) 
Microsoft Corporation.
-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"
 
-#define FIRMWARE_BLOCK_SIZE 0x1
+#define FIRMWARE_BLOCK_SIZE SIZE_64KB
 #define FVB_MEDIA_BLOCK_SIZEFIRMWARE_BLOCK_SIZE
+
 typedef struct {
   EFI_PHYSICAL_ADDRESSBaseAddress;
   EFI_FIRMWARE_VOLUME_HEADER  FvbInfo;
@@ -19,7 +20,7 @@ typedef struct {
 } EFI_FVB2_MEDIA_INFO;
 
 /**
-  Returns FVB media information for NV variable storage.
+  Returns FVB media information for a firmware volume.
 
   @return   FvbMediaInfo  A pointer to an instance of FVB media 
info produced by this function.
   The buffer is allocated internally to 
this function and it is the caller's @@ -100,8 +101,21 @@ 
FVB_MEDIA_INFO_GENERATOR mFvbMediaInfoGenerators[] = {
   GenerateNvStorageFvbMediaInfo
 };
 
+/**
+  Returns an empty firmware volume for the firmware volume at the given base 
address.
+
+  @param[in]FvBaseAddress   The base address of the firmware volume 
requested.
+  @param[out]   FvbInfo A pointer that will be set to a buffer for 
the firmware volume header
+at the given base address. The buffer is a 
pool allocation made in this function.
+
+  @retval EFI_SUCCESS   The firmware volume was returned 
successfully.
+  @retval EFI_INVALID_PARAMETER The FvbInfo pointer argument is NULL.
+  @retval EFI_NOT_FOUND The firmware volume was not found for the 
given base address.
+  @retval EFI_OUT_OF_RESOURCES  Insufficient memory to allocate a buffer 
to the hold the firmware volume.
+
+**/
 EFI_STATUS
-GetFvbInfo (
+GetGeneratedFvByAddress (
   IN  EFI_PHYSICAL_ADDRESS FvBaseAddress,
   OUT EFI_FIRMWARE_VOLUME_HEADER   **FvbInfo
   )
@@ -111,11 +125,19 @@ GetFvbInfo (
   UINTN   Index;
   EFI_FIRMWARE_VOLUME_HEADER  *FvHeader;
 
+  if (FvbInfo == NULL) {
+return EFI_INVALID_PARAMETER;
+  }
+
   for (Index = 0; Index < ARRAY_SIZE (mFvbMediaInfoGenerators); Index++) {
 Status = mFvbMediaInfoGenerators[Index]();
 ASSERT_EFI_ERROR (Status);
 if (!EFI_ERROR (Status) && (FvbMediaInfo.BaseAddress == FvBaseAddress)) {
   FvHeader = AllocateCopyPool (FvbMediaInfo.FvbInfo.Head

Re: [edk2-devel][edk2-platforms][PATCH V3-1] IpmiFeaturePkg:Provided multiple IPMI interface support in DXE and SMM

2023-06-13 Thread Isaac Oram
I agree that less work and duplication is generally preferable.  I don't have 
an opinion in this case.  My experience is that a transition to a new solution 
takes years.  If there is a benefit to having both implementations, I am fine 
with that.

Regards,
Isaac

-Original Message-
From: Chang, Abner  
Sent: Monday, June 12, 2023 9:36 PM
To: devel@edk2.groups.io; Oram, Isaac W ; Arun K 

Cc: Desimone, Nathaniel L ; Ramkumar 
Krishnamoorthi ; Gao, Liming 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V3-1] IpmiFeaturePkg:Provided 
multiple IPMI interface support in DXE and SMM

[AMD Official Use Only - General]

Hi Isaac,
I had replied to AMI and had them to work on the ManageabilityPkg directly (I 
think it was few months ago) as we migrated all IPMI stuff from Intel 
IpmiFeaturePkg to ManageabilityPkg.
Do you think we still have to spend effort on IpmiFeaturePkg? AMD also has one 
IPMI feature waiting for upstream to edk2-platform, work on both packages will 
lead to divergency.
I suggest we just have AMI to revise their code to compliant with 
ManageabilityPkg.
Regards,
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Isaac
> Oram via groups.io
> Sent: Tuesday, June 13, 2023 8:27 AM
> To: Arun K ; devel@edk2.groups.io
> Cc: Desimone, Nathaniel L ; Ramkumar
> Krishnamoorthi ; Gao, Liming
> 
> Subject: Re: [edk2-devel][edk2-platforms][PATCH V3-1]
> IpmiFeaturePkg:Provided multiple IPMI interface support in DXE and SMM
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Comments inline, prefaced with "[Isaac]".  Mostly style things that you could
> probably fix with uncrustify also.
>
> The main concern is the controls seem confused with #defines and PCD.
> Simplifying to just use the PCD directly seems clear to me and eliminating the
> #if logic in favor of regular C logic is also preferred.
>
> Thanks,
> Isaac
>
> -Original Message-
> From: Arun K 
> Sent: Monday, June 12, 2023 5:52 AM
> To: devel@edk2.groups.io; Arun K 
> Cc: Oram, Isaac W ; Desimone, Nathaniel L
> ; Ramkumar Krishnamoorthi
> ; Gao, Liming 
> Subject: [edk2-devel][edk2-platforms][PATCH V3-1] IpmiFeaturePkg:Provided
> multiple IPMI interface support in DXE and SMM
>
> Created IpmiTransport2 PPI/Protocol to support multiple IPMI BMC Interface
> support such as KCS/BT/SSIF with 2 API's
> IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
> IpmiSubmitCommand2 - This API use the default interface
> (PcdDefaultSystemInterface) to send IPMI command.
> IpmiSubmitCommand2Ex - This API use the specific interface type to send
> IPMI command which is passed as an argument.
>
> Cc: Isaac Oram 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
>
> Signed-off-by: Arun K 
> ---
>  .../GenericIpmi/Common/IpmiBmc.h  |  10 +
>  .../GenericIpmi/Common/IpmiBmcCommon.h|   2 +
>  .../GenericIpmi/Common/IpmiHooks.c| 256 ++
>  .../GenericIpmi/Common/IpmiHooks.h|  93 ++-
>  .../GenericIpmi/Dxe/GenericIpmi.inf   |  14 +-
>  .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 205 ++
>  .../GenericIpmi/Smm/SmmGenericIpmi.c  | 200 +-
>  .../GenericIpmi/Smm/SmmGenericIpmi.inf|  12 +
>  .../IpmiFeaturePkg/IpmiFeaturePkg.dec |  45 +++
>  9 files changed, 832 insertions(+), 5 deletions(-)
>
> diff --git
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Com
> mon/IpmiBmc.h
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Com
> mon/IpmiBmc.h
> index d306a085e5..19fb2a26a3 100644
> ---
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Com
> mon/IpmiBmc.h
> +++
> b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Com
> m
> +++ on/IpmiBmc.h
> @@ -3,6 +3,7 @@
>
>
>@copyright
>
>Copyright 1999 - 2021 Intel Corporation. 
>
> +  Copyright (c) 1985 - 2023, American Megatrends International LLC.
> + 
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
>  **/
>
>
>
> @@ -21,6 +22,7 @@
>  #include 
>
>  #include 
>
>  #include 
>
> +#include 
>
>
>
>  #include "IpmiBmcCommon.h"
>
>  #include "KcsBmc.h"
>
> @@ -41,4 +43,12 @@
>SM_IPMI_BMC_SIGNATURE \
>
>)
>
>
>
> +#define INSTANCE_FROM_IPMI_TRANSPORT2_THIS(a) \
>
> +  CR ( \
>
> +  a, \
>
> +  IPMI_BMC_INSTANCE_DATA, \
>
> +  IpmiTransport2, \
>
> +  SM_IPMI_BMC_SIGNATURE \
>
> +  )
>
> +
>
>  #endif // _IPMI_BMC_H_
>
> diff --git
> a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Com

Re: [edk2-devel][edk2-platforms][PATCH V3-2] IpmiFeaturePkg:Provided multiple IPMI interface support in PEI

2023-06-12 Thread Isaac Oram
Similar issues with four space indents, lack of spaces before { and (, #if 
logic.

Regards,
Isaac

-Original Message-
From: Arun K  
Sent: Monday, June 12, 2023 5:53 AM
To: devel@edk2.groups.io; Arun K 
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Ramkumar Krishnamoorthi ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V3-2] IpmiFeaturePkg:Provided 
multiple IPMI interface support in PEI

Created IpmiTransport2 PPI/Protocol to support multiple IPMI BMC Interface 
support such as KCS/BT/SSIF with 2 API's
IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
IpmiSubmitCommand2 - This API use the default interface
(PcdDefaultSystemInterface) to send IPMI command.
IpmiSubmitCommand2Ex - This API use the specific interface type to send IPMI 
command which is passed as an argument.

Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Signed-off-by: Arun K 
---
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 295 ++
 .../GenericIpmi/Pei/PeiGenericIpmi.h  |   3 +
 .../GenericIpmi/Pei/PeiGenericIpmi.inf|  16 +
 .../GenericIpmi/Pei/PeiIpmiBmc.c  |   3 +-
 .../GenericIpmi/Pei/PeiIpmiBmc.h  |   9 +
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  11 +
 .../IpmiFeaturePkg/Include/IpmiFeature.dsc|  15 +
 7 files changed, 285 insertions(+), 67 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
index e8b99b6900..e0378d61d4 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Pei/
+++ PeiGenericIpmi.c
@@ -3,6 +3,7 @@


   @copyright

   Copyright 2017 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 
+ 

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

 **/



@@ -10,10 +11,143 @@
 #include "PeiGenericIpmi.h"

 #include 

 #include 

+#include 



 ///

-// Function Implementations

-//

+

+/**

+Initialize the API and parameters for IPMI Transport2 Instance

+

+@param[in] IpmiInstance Pointer to IPMI Instance

+

+@return VOID

+

+**/

+VOID

+InitIpmiTransport2 (

+  IN  PEI_IPMI_BMC_INSTANCE_DATA *IpmiInstance

+  )

+{

+  IpmiInstance->IpmiTransport2Ppi.InterfaceType   = FixedPcdGet8 
(PcdDefaultSystemInterface);

+  IpmiInstance->IpmiTransport2Ppi.IpmiTransport2BmcStatus = 
+ BmcStatusOk;

+  IpmiInstance->IpmiTransport2Ppi.IpmiSubmitCommand2  = 
PeiIpmiSendCommand2;

+  IpmiInstance->IpmiTransport2Ppi.IpmiSubmitCommand2Ex= 
PeiIpmiSendCommand2Ex;

+

+#if BtInterfaceSupport

+  if (!EFI_ERROR 
+ (PlatformIpmiIoRangeSet(FixedPcdGet16(PcdBtControlPort {

+  InitBtInterfaceData (>IpmiTransport2Ppi);

+  }

+#endif

+

+#if SsifInterfaceSupport

+  InitSsifInterfaceData (>IpmiTransport2Ppi);

+#endif

+

+#if IpmbInterfaceSupport

+  InitIpmbInterfaceData (>IpmiTransport2Ppi);

+#endif

+}

+

+/**

+Notify callback function for interfaces.

+

+@param[in] PeiServices  Describes the list of possible PEI

+Services.

+@param[in] NotifyDescriptor Pointer to notify descriptor.

+@param[in] Ppi  Pointer to Ppi.

+

+@return EFI_STATUS  Status of Notify call back.

+@retval EFI_NOT_FOUND   Ipmi hob is not found.

+@retval EFI_OUT_OF_RESOURCESFailed to allocate memory.

+@retval EFI_SUCCESS Interface is initialized and installed

+Ipmi Ppi successfully.

+@retval Others  Error status while installing Ppi.

+**/

+EFI_STATUS

+EFIAPI

+NotifyCallback (

+  IN EFI_PEI_SERVICES **PeiServices,

+  IN EFI_PEI_NOTIFY_DESCRIPTOR*NotifyDescriptor,

+  IN VOID *Ppi

+  )

+{

+  EFI_STATUSStatus;

+  PEI_IPMI_BMC_INSTANCE_DATA*IpmiInstance;

+  PEI_IPMI_DATA_HOB *IpmiInstancePtrHob;

+  EFI_HOB_GUID_TYPE *GuidHob;

+  IPMI_INTERFACE_STATE  InterfaceState;

+

+  InterfaceState = IpmiInterfaceNotReady;

+

+  GuidHob= GetFirstGuidHob ();

+  ASSERT (GuidHob != NULL);

+  if (GuidHob == NULL) {

+  return EFI_NOT_FOUND;

+  }

+

+  IpmiInstancePtrHob = (PEI_IPMI_DATA_HOB *) 
+ GET_GUID_HOB_DATA(GuidHob);

+  IpmiInstance   = (PEI_IPMI_BMC_INSTANCE_DATA*) 
IpmiInstancePtrHob->IpmiInstance;

+

+#if SsifInterfaceSupport

+  InitSsifInterfaceData(>IpmiTransport2Ppi);

+

+  if (IpmiInstance->IpmiTransport2Ppi.Interface.Ssif.InterfaceState == 
+ IpmiInterfaceInitialized){

+  InterfaceState = IpmiInterfaceInitialized;

+  }

+#endif

+

+#if IpmbInterfaceSupport

+  InitIpmbInterfaceData(

Re: [edk2-devel][edk2-platforms][PATCH V3-1] IpmiFeaturePkg:Provided multiple IPMI interface support in DXE and SMM

2023-06-12 Thread Isaac Oram
Comments inline, prefaced with "[Isaac]".  Mostly style things that you could 
probably fix with uncrustify also.

The main concern is the controls seem confused with #defines and PCD.  
Simplifying to just use the PCD directly seems clear to me and eliminating the 
#if logic in favor of regular C logic is also preferred.

Thanks,
Isaac

-Original Message-
From: Arun K  
Sent: Monday, June 12, 2023 5:52 AM
To: devel@edk2.groups.io; Arun K 
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Ramkumar Krishnamoorthi ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH V3-1] IpmiFeaturePkg:Provided 
multiple IPMI interface support in DXE and SMM

Created IpmiTransport2 PPI/Protocol to support multiple IPMI BMC Interface 
support such as KCS/BT/SSIF with 2 API's
IpmiSubmitCommand2 & IpmiSubmitCommand2Ex.
IpmiSubmitCommand2 - This API use the default interface
(PcdDefaultSystemInterface) to send IPMI command.
IpmiSubmitCommand2Ex - This API use the specific interface type to send IPMI 
command which is passed as an argument.

Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Signed-off-by: Arun K 
---
 .../GenericIpmi/Common/IpmiBmc.h  |  10 +
 .../GenericIpmi/Common/IpmiBmcCommon.h|   2 +
 .../GenericIpmi/Common/IpmiHooks.c| 256 ++
 .../GenericIpmi/Common/IpmiHooks.h|  93 ++-
 .../GenericIpmi/Dxe/GenericIpmi.inf   |  14 +-
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 205 ++
 .../GenericIpmi/Smm/SmmGenericIpmi.c  | 200 +-
 .../GenericIpmi/Smm/SmmGenericIpmi.inf|  12 +
 .../IpmiFeaturePkg/IpmiFeaturePkg.dec |  45 +++
 9 files changed, 832 insertions(+), 5 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
index d306a085e5..19fb2a26a3 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiBmc.h
@@ -3,6 +3,7 @@


   @copyright

   Copyright 1999 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 
+ 

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

 **/



@@ -21,6 +22,7 @@
 #include 

 #include 

 #include 

+#include 



 #include "IpmiBmcCommon.h"

 #include "KcsBmc.h"

@@ -41,4 +43,12 @@
   SM_IPMI_BMC_SIGNATURE \

   )



+#define INSTANCE_FROM_IPMI_TRANSPORT2_THIS(a) \

+  CR ( \

+  a, \

+  IPMI_BMC_INSTANCE_DATA, \

+  IpmiTransport2, \

+  SM_IPMI_BMC_SIGNATURE \

+  )

+

 #endif // _IPMI_BMC_H_

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
index 06eab62aae..3b252f5f1c 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiBmcCommon.h
@@ -3,6 +3,7 @@


   @copyright

   Copyright 1999 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 
+ 

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

 **/



@@ -55,6 +56,7 @@ typedef struct {
   UINT8   SoftErrorCount;

   UINT16  IpmiIoBase;

   IPMI_TRANSPORT  IpmiTransport;

+  IPMI_TRANSPORT2 IpmiTransport2;

   EFI_HANDLE  IpmiSmmHandle;

 } IPMI_BMC_INSTANCE_DATA;



diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiHooks.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiHooks.c
index b2788e5a4c..19e5c1c04b 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiHooks.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiHooks.c
@@ -3,6 +3,7 @@


   @copyright

   Copyright 2014 - 2021 Intel Corporation. 

+  Copyright (c) 1985 - 2023, American Megatrends International LLC. 
+ 

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

 **/



@@ -48,6 +49,11 @@ Returns:


 --*/

 {

+

+  if (This == NULL) {

+  return EFI_INVALID_PARAMETER;
[Isaac] The preceding line is improperly indented.

+  }

+

   //

   // This Will be unchanged ( BMC/KCS style )

   //

@@ -64,6 +70,251 @@ Returns:
);

 } // IpmiSendCommand()



+EFI_STATUS

+EFIAPI

+IpmiSendCommand2 (

+  IN  IPMI_TRANSPORT2  *This,

+  IN  UINT8NetFunction,

+  IN  UINT8Lun,

+  IN  UINT8Command,

+  IN  UINT8*CommandData,

+  IN  UINT32   CommandDataSize,

+  IN OUT  UINT8*ResponseData,

+  IN OUT  UINT32   *ResponseDataSize

+  )

+/*++

+

+Routin

Re: [edk2-devel] [RFC] Introduce new status code for ManageabilityPkg and Redfish*Pkg

2023-06-01 Thread Isaac Oram
Nickle,

This looks reasonable to me.  I can see an argument that suggests these align 
more with the peripheral class errors, but your proposal looks better to me.

Regards,
Isaac

From: devel@edk2.groups.io  On Behalf Of Nickle Wang via 
groups.io
Sent: Wednesday, May 31, 2023 9:23 PM
To: r...@edk2.groups.io
Cc: devel@edk2.groups.io; Simon Wang (SW-GPU) ; Chang, 
Abner ; Nick Ramirez 
Subject: [edk2-devel] [RFC] Introduce new status code for ManageabilityPkg and 
Redfish*Pkg

Hi edk2 community,

I like to introduce EFI_COMPUTING_UNIT_MANAGEABILITY status code to 
PiStatusCode.h. EFI_COMPUTING_UNIT_MANAGEABILITY will be used in edk2 
RedfishPkg and edk2-redfish-client RedfishClientPkg to report Redfish operation 
errors. It will also be used to report errors in edk2-platforms 
ManageabilityPkg.

EFI_COMPUTING_UNIT_MANAGEABILITY is created as one of the subclasses in 
computing unit class.

#define EFI_COMPUTING_UNIT_CACHE   (EFI_COMPUTING_UNIT | 0x0004)
#define EFI_COMPUTING_UNIT_MEMORY  (EFI_COMPUTING_UNIT | 0x0005)
#define EFI_COMPUTING_UNIT_CHIPSET (EFI_COMPUTING_UNIT | 0x0006)
+ #define EFI_COMPUTING_UNIT_MANAGEABILITY   (EFI_COMPUTING_UNIT | 
0x0007)

Below operation values are defined to report failure in manageability related 
operations. I only provide the definitions for Redfish functions but the 
failure case like in MCTP, IPMI and KCS can be created in the future.

+///
+/// Computing Unit Manageability Subclass Error Code definitions.
+/// The detail information is reported by REPORT_STATUS_CODE_WITH_EXTENDED_DATA
+//  with ASCII string in EFI_STATUS_CODE_STRING_DATA.
+///@{
+#define EFI_MANAGEABILITY_EC_REDFISH_COMMUNICATION_ERROR
(EFI_SUBCLASS_SPECIFIC | 0x)
+#define EFI_MANAGEABILITY_EC_REDFISH_HOST_INTERFACE_ERROR   
(EFI_SUBCLASS_SPECIFIC | 0x0001)
+#define EFI_MANAGEABILITY_EC_REDFISH_BOOTSTRAP_CREDENTIAL_ERROR 
(EFI_SUBCLASS_SPECIFIC | 0x0002)

* EFI_MANAGEABILITY_EC_REDFISH_COMMUNICATION_ERROR will be used to report 
communication failure between host and Redfish service providers (or BMC).
* EFI_MANAGEABILITY_EC_REDFISH_HOST_INTERFACE_ERROR is reported when host 
system can not create Redfish host interface due to some errors.
* EFI_MANAGEABILITY_EC_REDFISH_BOOTSTRAP_CREDENTIAL_ERROR is reported when host 
system cannot get bootstrap credentials by following the Host Interface 
standard.

Detail reason will be provided in ASCII string by calling 
REPORT_STATUS_CODE_WITH_EXTENDED_DATA().

The pull request is here for reference: 
https://github.com/nicklela/edk2/pull/4/files  Any feedback is welcome.

Thanks,
Nickle




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105595): https://edk2.groups.io/g/devel/message/105595
Mute This Topic: https://groups.io/mt/99257555/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 2/2] ManageabilityPkg/IpmiFrb: Add to ManageabilityPkg

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Saturday, May 13, 2023 5:33 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang 
Subject: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiFrb: Add 
to ManageabilityPkg

From: Abner Chang 

Add IpmiFrb to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 2 ++
 Features/ManageabilityPkg/Include/Manageability.dsc | 8 
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 3 +++
 Features/ManageabilityPkg/Include/PostMemory.fdf| 4 
 Features/ManageabilityPkg/Include/PreMemory.fdf | 4 
 5 files changed, 21 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index b0ca01094a..3980931424 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -79,6 +79,8 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x1004
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
+  
+ gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmFrb|FALSE|BOOLEA
+ N|0x100B  
+ gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmFrb|FALSE|BOOLEA
+ N|0x100C
 
 [PcdsDynamic, PcdsDynamicEx]
   gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0x2001
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index a432b0ff26..06fed828b2 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -30,6 +30,10 @@
   ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 !endif
 
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmFrb == TRUE
+  ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
+!endif
+
 [Components.X64, Components.AARCH64]
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiEnable == TRUE
   ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
@@ -51,3 +55,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmFrb == TRUE
+  ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
+!endif
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index e3baf27f2a..6fa3e3c6ae 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,8 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable  
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable  
|TRUE
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|TRUE
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmFrb  
|TRUE
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmFrb  
|TRUE
 
 #
 # Include common libraries
@@ -53,5 +55,6 @@
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
 !include Include/Manageability.dsc
diff --git a/Features/ManageabilityPkg/Include/PostMemory.fdf 
b/Features/ManageabilityPkg/Include/PostMemory.fdf
index 9100cb2646..84e7ea978b 100644
--- a/Features/ManageabilityPkg/Include/PostMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PostMemory.fdf
@@ -26,3 +26,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   INF ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmFrb == TRUE
+  INF ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
+!endif
diff --git a/Features/ManageabilityPkg/Include/PreMemory.fdf 
b/Features/ManageabilityPkg/Include/PreMemory.fdf
index 16e079f494..add36e2095 100644
--- a/Features/ManageabilityPkg/Include/PreMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PreMemory.fdf
@@ -10,3 +10,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmiEnable == TRUE
   INF  ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmFrb == TRUE
+  INF ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
+!endif
--
2.37.1.windows.1








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

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI FRB Driver

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

Typo in "wtchdog" and "Failt".  Can be fixed prior to commit.

-Original Message-
From: abner.ch...@amd.com  
Sent: Saturday, May 13, 2023 5:33 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: IPMI FRB Driver

From: Abner Chang 

IpmiFrb is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/Frb in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/Frb until the reference to this 
instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   5 +
 .../Universal/IpmiFrb/FrbDxe.inf  |  37 +++
 .../Universal/IpmiFrb/FrbPei.inf  |  37 +++
 .../Universal/IpmiFrb/FrbDxe.c| 212 ++
 .../Universal/IpmiFrb/FrbPei.c|  87 +++
 5 files changed, 378 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.c

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..b0ca01094a 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -80,3 +80,8 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
 
+[PcdsDynamic, PcdsDynamicEx]
+  
+gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag|TRUE|BOOLEAN|0x2
+001
+  ## This is the timeout value in milliseconds, default set to 360 
+milliseconds
+  # @Prompt IPMI Fault Resilient Booting timeout value in milliseconds.
+  
+gManageabilityPkgTokenSpaceGuid.PcdFRBTimeoutValue|360|UINT16|0x200
+2
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
new file mode 100644
index 00..ae57fe7697
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI FRB.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= FrbDxe
+  FILE_GUID= A142CEE5-99D5-4ECF-943E-D8F0DE3052AA
+  MODULE_TYPE  = DXE_DRIVER
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = FrbDxeEntryPoint
+
+[Sources]
+  FrbDxe.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  UefiLib
+  BaseMemoryLib
+  DebugLib
+  IpmiCommandLib
+  MemoryAllocationLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
new file mode 100644
index 00..89d633f32e
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbPei.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI FRB PEIM.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= FrbPei
+  FILE_GUID= 7CAAE1A7-0B37-4EEA-A432-2F203DA6F288
+  MODULE_TYPE  = PEIM
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeFrbPei
+
+[Sources]
+  FrbPei.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiCommandLib
+  PcdLib
+  PeimEntryPoint
+
+[Pcd]
+  gManageabilityPkgTokenSpaceGuid.PcdFRB2EnabledFlag
+  gManageabilityPkgTokenSpaceGuid.PcdFRBTimeoutValue
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c 
b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
new file mode 100644
index 00..46f741eed1
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFrb/FrbDxe.c
@@ -0,0 +1,212 @@
+/** @file
+IPMI Fault Resilient Booting Driver.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include  #include  
+#include  #include 
+
+/**
+  This routine disables the specified FRB timer.
+
+  @retval EFI

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiBmcAcpi: Add to ManageabilityPkg

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: abner.ch...@amd.com  
Sent: Saturday, May 13, 2023 8:49 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang 
Subject: [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiBmcAcpi: Add to 
ManageabilityPkg

From: Abner Chang 

Add IpmiBmcAcpi to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 1 +
 Features/ManageabilityPkg/Include/Manageability.dsc | 4 
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 3 ++-
 Features/ManageabilityPkg/Include/PostMemory.fdf| 4 
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..ac3504cb41 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -79,4 +79,5 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x1004
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
+  
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi|FALSE|BOOLEAN|0x100D
 
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index a432b0ff26..1a4f719dd3 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -51,3 +51,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi == TRUE
+  ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf
+!endif
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index e3baf27f2a..712483faeb 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,7 +37,7 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable  
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable  
|TRUE
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|TRUE
-
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi 
|TRUE
 #
 # Include common libraries
 #
@@ -53,5 +53,6 @@
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
 !include Include/Manageability.dsc
diff --git a/Features/ManageabilityPkg/Include/PostMemory.fdf 
b/Features/ManageabilityPkg/Include/PostMemory.fdf
index 9100cb2646..a23144d5aa 100644
--- a/Features/ManageabilityPkg/Include/PostMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PostMemory.fdf
@@ -26,3 +26,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   INF ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi == TRUE
+  INF ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf
+!endif
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105066): https://edk2.groups.io/g/devel/message/105066
Mute This Topic: https://groups.io/mt/98870432/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 1/2] ManageabilityPkg/IpmiFrb: IPMI BMC ACPI Driver

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

You could consider changing "INTEL" and ('M', 'S', 'F', 'T') to more generic 
placeholders.  But that is also something that could be looked at separately 
and more widely. 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Saturday, May 13, 2023 8:49 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFrb: 
IPMI BMC ACPI Driver

From: Abner Chang 

IpmiBmcAcpi is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/BmcAcpi in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/BmcAcpi until the reference to 
this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Universal/IpmiBmcAcpi/BmcAcpi.inf |  47 
 .../Universal/IpmiBmcAcpi/BmcAcpi.c   | 264 ++
 .../Universal/IpmiBmcAcpi/BmcSsdt/BmcSsdt.asl |  28 ++
 .../IpmiBmcAcpi/BmcSsdt/IpmiOprRegions.asi|  58 
 4 files changed, 397 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/BmcSsdt.asl
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcSsdt/IpmiOprRegions.asi

diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf 
b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf
new file mode 100644
index 00..a21c5b9b35
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.inf
@@ -0,0 +1,47 @@
+### @file
+# Component description file for BMC ACPI.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = BmcAcpi
+  FILE_GUID = 09E3B4BE-F731-4903-AAE6-BD5D573B6140
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = BmcAcpiEntryPoint
+
+[Sources]
+  BmcAcpi.c
+  BmcSsdt/BmcSsdt.asl
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiLib
+
+[Protocols]
+  gEfiFirmwareVolume2ProtocolGuid
+  gEfiAcpiTableProtocolGuid
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+
+[Depex]
+  gEfiAcpiTableProtocolGuid
+
+[BuildOptions]
+  *_*_*_ASL_FLAGS = -oi
diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c 
b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c
new file mode 100644
index 00..cf066dd095
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcAcpi/BmcAcpi.c
@@ -0,0 +1,264 @@
+/** @file
+  IPMI BMC ACPI.
+
+  Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+ reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+//
+// Statements that include other header files // #include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include  #include 
+ #include 
+
+#ifndef EFI_ACPI_CREATOR_ID
+#define EFI_ACPI_CREATOR_ID  SIGNATURE_32 ('M', 'S', 'F', 'T') #endif 
+#ifndef EFI_ACPI_CREATOR_REVISION #define EFI_ACPI_CREATOR_REVISION  
+0x010D #endif
+
+/**
+
+  Locate the first instance of a protocol.  If the protocol requested 
+ is an  FV protocol, then it will return the first FV that contains the 
+ ACPI table  storage file.
+
+  @param [in] Protocol  The protocol to find.
+  @param [in] Instance  Return pointer to the first instance of the protocol.
+  @param [in] Type  The type of protocol to locate.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+  @retval EFI_NOT_FOUND The protocol could not be located.
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to find the 
protocol.
+
+**/
+EFI_STATUS
+LocateSupportProtocol (
+  IN   EFI_GUID  *Protocol,
+  OUT  VOID  **Instance,
+  IN   UINT32Type
+  )
+{
+  EFI_STATUS  Status;
+  EFI_HANDLE  *HandleBuffer;
+  UINTN   NumberOfHandles;
+  EFI_FV_FILETYPE FileType;
+  UINT32  FvStatus = 0;
+  EFI_FV_FILE_ATTRIBUTES  Attributes;
+  UINTN   Size;
+  UINTN   Index;
+
+  Status = gBS->LocateHandleBuffer (ByProtocol, Protocol, NULL, 
+ , );  if (EFI_

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiBmcElog: Add to ManageabilityPkg

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Friday, May 12, 2023 2:58 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang 
Subject: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiBmcElog: 
Add to ManageabilityPkg

From: Abner Chang 

Add IpmiBmcElog to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 1 +
 Features/ManageabilityPkg/Include/Manageability.dsc | 4 
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 2 ++
 Features/ManageabilityPkg/Include/PostMemory.fdf| 4 
 4 files changed, 11 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..7c36ec93ff 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -79,4 +79,5 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x1004
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
+  
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcElog|FALSE|BOOLEAN|0x100A
 
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index a432b0ff26..6806093d98 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -51,3 +51,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcElog == TRUE
+  ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
+!endif
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index e3baf27f2a..2262362f97 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,7 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable  
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable  
|TRUE
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|TRUE
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcElog 
|TRUE
 
 #
 # Include common libraries
@@ -53,5 +54,6 @@
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
 !include Include/Manageability.dsc
diff --git a/Features/ManageabilityPkg/Include/PostMemory.fdf 
b/Features/ManageabilityPkg/Include/PostMemory.fdf
index 9100cb2646..e4eed660fd 100644
--- a/Features/ManageabilityPkg/Include/PostMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PostMemory.fdf
@@ -26,3 +26,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   INF ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcElog == TRUE
+  INF ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
+!endif
-- 
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105064): https://edk2.groups.io/g/devel/message/105064
Mute This Topic: https://groups.io/mt/98846236/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 1/2] ManageabilityPkg/IpmiBmcElog: IPMI BMC Elog Driver

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Friday, May 12, 2023 2:58 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiBmcElog: 
IPMI BMC Elog Driver

From: Abner Chang 

IpmiBmcElog is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/BmcElog in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/BmcElog until the reference to 
this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Universal/IpmiBmcElog/BmcElog.inf |  33 +++
 .../Universal/IpmiBmcElog/BmcElog.c   | 192 ++
 2 files changed, 225 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c

diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
new file mode 100644
index 00..4c28862fe5
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.inf
@@ -0,0 +1,33 @@
+### @file
+# Component description file for BMC ELOG.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= BmcElog
+  FILE_GUID= A0FF2235-B652-45E3-B3D2-B20F3E714E6F
+  MODULE_TYPE  = DXE_DRIVER
+  PI_SPECIFICATION_VERSION = 0x0001000A
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeBmcElogLayer
+
+[Sources]
+  BmcElog.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IpmiCommandLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c 
b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
new file mode 100644
index 00..ab179e9d49
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiBmcElog/BmcElog.c
@@ -0,0 +1,192 @@
+/** @file
+  BMC Event Log functions.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include  #include 
+
+#include 
+#include 
+
+EFI_STATUS
+EFIAPI
+CheckIfSelIsFull (
+  VOID
+  );
+
+/**
+  This function erases event logs and waits unti complete.
+
+  @param [in]  ResvId  - Reserved ID
+
+  @retval  EFI_STATUS   EFI_SUCCESS
+EFI_NO_RESPONSE
+
+**/
+EFI_STATUS
+WaitTillErased (
+  IN  UINT8  *ResvId
+  )
+{
+  INTN Counter;
+  IPMI_CLEAR_SEL_REQUEST   ClearSel;
+  IPMI_CLEAR_SEL_RESPONSE  ClearSelResponse;
+
+  Counter = 0x200;
+  ZeroMem (, sizeof (ClearSelResponse));
+
+  while (TRUE) {
+ZeroMem (, sizeof (ClearSel));
+ClearSel.Reserve[0] = ResvId[0];
+ClearSel.Reserve[1] = ResvId[1];
+ClearSel.AscC   = 0x43;
+ClearSel.AscL   = 0x4C;
+ClearSel.AscR   = 0x52;
+ClearSel.Erase  = 0x00;
+
+IpmiClearSel (
+  ,
+  
+  );
+
+if ((ClearSelResponse.ErasureProgress & 0xf) == 1) {
+  return EFI_SUCCESS;
+}
+
+//
+//  If there is not a response from the BMC controller we need to return 
and not hang.
+//
+--Counter;
+if (Counter == 0x0) {
+  return EFI_NO_RESPONSE;
+}
+  }
+}
+
+/**
+  This function activates BMC event log.
+
+  @param [in] EnableElog  Enable/Disable event log  @param [out] 
+ ElogStatus  return log status
+
+  @retval  EFI_STATUS
+
+**/
+EFI_STATUS
+EfiActivateBmcElog (
+  IN BOOLEAN   *EnableElog,
+  OUT BOOLEAN  *ElogStatus
+  )
+{
+  EFI_STATUSStatus;
+  UINT8 ElogStat;
+  IPMI_SET_BMC_GLOBAL_ENABLES_REQUEST   SetBmcGlobalEnables;
+  IPMI_GET_BMC_GLOBAL_ENABLES_RESPONSE  GetBmcGlobalEnables;
+  UINT8 CompletionCode;
+
+  Status   = EFI_SUCCESS;
+  ElogStat = 0;
+
+  Status = IpmiGetBmcGlobalEnables ();  if 
+ (EFI_ERROR (Status)) {
+return Status;
+  }
+
+  if (EnableElog == NULL) {
+*ElogStatus = 
+ GetBmcGlobalEnables.GetEnables.Bits.SystemEventLogging;
+  } else {
+if (Status == EFI_SUCCESS) {
+  if (*EnableElog) {
+ElogStat = 1;
+  }
+
+  CopyMem (, (UINT8 *) + 1, sizeof 
(UINT8));
+  SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging = 
+ ElogStat;
+
+  Status = IpmiSetBmcGlobalEnables (, );
+}
+  }
+
+  re

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiSolStatus: Add to ManageabilityPkg

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Friday, May 12, 2023 12:29 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang 
Subject: [edk2-devel] [edk2-platforms][PATCH 2/2] 
ManageabilityPkg/IpmiSolStatus: Add to ManageabilityPkg

From: Abner Chang 

Add IpmiSolStatus to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 1 +
 Features/ManageabilityPkg/Include/Manageability.dsc | 4 
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 2 ++
 Features/ManageabilityPkg/Include/PostMemory.fdf| 4 
 4 files changed, 11 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index c11bf5d0df..6bf65feda4 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -83,4 +83,5 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x1004
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
+  
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiSolStatus|FALSE|BOOLEAN|0x1009
 
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index a432b0ff26..5f014b5d8d 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -51,3 +51,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiSolStatus == TRUE
+  ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.inf
+!endif
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index e3baf27f2a..6426f84f1f 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,7 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable  
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable  
|TRUE
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|TRUE
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiSolStatus   
|TRUE
 
 #
 # Include common libraries
@@ -53,5 +54,6 @@
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
 !include Include/Manageability.dsc
diff --git a/Features/ManageabilityPkg/Include/PostMemory.fdf 
b/Features/ManageabilityPkg/Include/PostMemory.fdf
index 9100cb2646..2d04e736c1 100644
--- a/Features/ManageabilityPkg/Include/PostMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PostMemory.fdf
@@ -26,3 +26,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   INF ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiSolStatus == TRUE
+  INF ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.inf
+!endif
-- 
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105062): https://edk2.groups.io/g/devel/message/105062
Mute This Topic: https://groups.io/mt/98844866/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 1/2] ManageabilityPkg/IpmiSolStatus: IPMI Serail over Lan Driver

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Friday, May 12, 2023 12:29 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2] 
ManageabilityPkg/IpmiSolStatus: IPMI Serail over Lan Driver

From: Abner Chang 

IpmiSolStatus is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/SolStatus in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/SolStatus until the reference 
to this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |   4 +
 .../Universal/IpmiSolStatus/SolStatus.inf |  37 
 .../Universal/IpmiSolStatus/SolStatus.c   | 164 ++
 3 files changed, 205 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.c

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..c11bf5d0df 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -72,6 +72,10 @@
   # @Prompt MCTP KCS (Memory mapped) I/O base address
   gManageabilityPkgTokenSpaceGuid.PcdMctpKcsBaseAddress|0xca2|UINT32|0x0004
 
+  ## This is the value of SOL channels supported on platform.
+  # @Prompt SOL channel number
+  gManageabilityPkgTokenSpaceGuid.PcdMaxSolChannels|3|UINT8|0x0100
+
 [PcdsFeatureFlag]
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiEnable|FALSE|BOOLEAN|0x1001
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilitySmmIpmiEnable|FALSE|BOOLEAN|0x1002
diff --git a/Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.inf 
b/Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.inf
new file mode 100644
index 00..1d7cbf1a08
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.inf
@@ -0,0 +1,37 @@
+### @file
+# Component description file for IPMI Serial Over LAN (SOL) driver.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= SolStatus
+  FILE_GUID= 1AF7E6C4-7678-4A6D-9240-E8BA17C3B772
+  MODULE_TYPE  = DXE_DRIVER
+  PI_SPECIFICATION_VERSION = 0x0001000A
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = SolStatusEntryPoint
+
+[Sources]
+  SolStatus.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[Pcd]
+  gManageabilityPkgTokenSpaceGuid.PcdMaxSolChannels
+
+[LibraryClasses]
+  DebugLib
+  IpmiCommandLib
+  PcdLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.c 
b/Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.c
new file mode 100644
index 00..996386372e
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiSolStatus/SolStatus.c
@@ -0,0 +1,164 @@
+/** @file
+  IPMI Serial Over Lan Driver.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include  #include 
+
+#include 
+#include 
+#include 
+
+#define SOL_CMD_RETRY_COUNT  10
+
+/*++
+
+Routine Description:
+
+This routine gets the SOL payload status or settings for a specific 
channel.
+
+Arguments:
+Channel - LAN channel naumber.
+ParamSel- Configuration parameter selection.
+Data- Information returned from BMC.
+Returns:
+EFI_SUCCESS - SOL configuration parameters are successfully read from 
BMC.
+Others  - SOL configuration parameters could not be read from BMC.
+
+--*/
+EFI_STATUS
+GetSolStatus (
+  IN UINT8  Channel,
+  IN UINT8  ParamSel,
+  IN OUT UINT8  *Data
+  )
+{
+  EFI_STATUS  Status = EFI_SUCCESS;
+  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_REQUEST   
GetConfigurationParametersRequest;
+  IPMI_GET_SOL_CONFIGURATION_PARAMETERS_RESPONSE  
GetConfigurationParametersResponse;
+  UINT32  DataSize;
+  UINT8   RetryCount;
+
+  for (RetryCount = 0; RetryCount < SOL_CMD_RETRY_COUNT; RetryCount++) {
+ZeroMem (, sizeof 
(GetConfigurationParametersRequest));
+GetConfigurationParametersRequest.ChannelNumber.Bits.ChannelNumber = 
Chan

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiOsWdt: Add to ManageabilityPkg

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: abner.ch...@amd.com  
Sent: Thursday, May 11, 2023 9:07 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang 
Subject: [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiOsWdt: Add to 
ManageabilityPkg

From: Abner Chang 

Add IpmiOsWdt to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 1 +
 Features/ManageabilityPkg/Include/Manageability.dsc | 4 
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 2 ++
 Features/ManageabilityPkg/Include/PostMemory.fdf| 4 
 4 files changed, 11 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..0a1c527107 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -79,4 +79,5 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x1004
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
+  
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiOsWdt|FALSE|BOOLEAN|0x1008
 
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index a432b0ff26..439f3be1ce 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -51,3 +51,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiOsWdt == TRUE
+  ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.inf
+!endif
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index e3baf27f2a..177c900360 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,7 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable  
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable  
|TRUE
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|TRUE
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiOsWdt   
|TRUE
 
 #
 # Include common libraries
@@ -53,5 +54,6 @@
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
 !include Include/Manageability.dsc
diff --git a/Features/ManageabilityPkg/Include/PostMemory.fdf 
b/Features/ManageabilityPkg/Include/PostMemory.fdf
index 9100cb2646..1a2fed2253 100644
--- a/Features/ManageabilityPkg/Include/PostMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PostMemory.fdf
@@ -26,3 +26,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   INF ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiOsWdt == TRUE
+  INF ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.inf
+!endif
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105060): https://edk2.groups.io/g/devel/message/105060
Mute This Topic: https://groups.io/mt/98843096/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 1/2] ManageabilityPkg/IpmiOsWdt: IPMI OS Watchdog timer Driver

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, May 11, 2023 9:07 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiOsWdt: 
IPMI OS Watchdog timer Driver

From: Abner Chang 

IpmiOsWdt is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/OsWdt in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/OsWdt until the reference to 
this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Universal/IpmiOsWdt/OsWdt.inf |  33 ++
 .../Universal/IpmiOsWdt/OsWdt.c   | 112 ++
 2 files changed, 145 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.c

diff --git a/Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.inf 
b/Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.inf
new file mode 100644
index 00..b5af3b25e1
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.inf
@@ -0,0 +1,33 @@
+### @file
+# Component description file for IPMI OS watch dog timer driver.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = OsWdt
+  FILE_GUID  = BA4FD21F-8443-4017-8D13-70EC92F4BD4C
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= DriverInit
+
+[Sources]
+  OsWdt.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IpmiCommandLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiLib
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.c 
b/Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.c
new file mode 100644
index 00..e2bbd95b83
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiOsWdt/OsWdt.c
@@ -0,0 +1,112 @@
+/** @file
+  IPMI Os watchdog timer Driver.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+BOOLEAN  mOsWdtFlag = FALSE;
+
+EFI_EVENT  mExitBootServicesEvent;
+
+/*++
+
+Routine Description:
+  Enable the OS Boot Watchdog Timer.
+  Is called only on legacy or EFI OS boot.
+
+Arguments:
+  Event- Event type
+  *Context - Context for the event
+
+Returns:
+  None
+
+--*/
+VOID
+EFIAPI
+EnableEfiOsBootWdtHandler (
+  IN EFI_EVENT  Event,
+  IN VOID   *Context
+  )
+{
+  EFI_STATUSStatus;
+  IPMI_SET_WATCHDOG_TIMER_REQUEST   SetWatchdogTimer;
+  UINT8 CompletionCode;
+  IPMI_GET_WATCHDOG_TIMER_RESPONSE  GetWatchdogTimer;
+  static BOOLEANOsWdtEventHandled = FALSE;
+
+  DEBUG ((DEBUG_ERROR, "!!! EnableEfiOsBootWdtHandler()!!!\n"));
+
+  //
+  // Make sure it processes once only. And proceess it only if 
+ OsWdtFlag==TRUE;  //  if (OsWdtEventHandled || !mOsWdtFlag) {
+return;
+  }
+
+  OsWdtEventHandled = TRUE;
+
+  Status = IpmiGetWatchdogTimer ();  if (EFI_ERROR 
+ (Status)) {
+return;
+  }
+
+  ZeroMem (, sizeof (SetWatchdogTimer));  //  // Just 
+ flip the Timer Use bit. This should release the timer.
+  //
+  SetWatchdogTimer.TimerUse.Bits.TimerRunning= 1;
+  SetWatchdogTimer.TimerUse.Bits.TimerUse= 
IPMI_WATCHDOG_TIMER_OS_LOADER;
+  SetWatchdogTimer.TimerActions.Uint8= 
IPMI_WATCHDOG_TIMER_ACTION_HARD_RESET;
+  SetWatchdogTimer.TimerUseExpirationFlagsClear &= ~BIT4;  
+ SetWatchdogTimer.TimerUseExpirationFlagsClear |= BIT1 | BIT2;
+  SetWatchdogTimer.InitialCountdownValue = 600; // 100ms / count
+
+  Status = IpmiSetWatchdogTimer (, );
+  return;
+}
+
+/*++
+
+Routine Description:
+  This is the standard EFI driver point. This function intitializes
+  the private data required for creating ASRR Driver.
+
+Arguments:
+  As required for DXE driver enrty routine.
+  ImageHandle - ImageHandle of the loaded driver
+  SystemTable - Pointer to the System Table
+
+Returns:
+  @retval EFI_SUCCESS   Protocol successfully started and installed.
+  @retval EFI_OUT_OF_RESOURCES  The event could not be allocated.
+
+--*/
+EFI_STATUS
+EFIAPI
+DriverInit (
+  IN EFI_HANDLEImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS  Status;
+
+  Status = gB

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiFru: Add to ManageabilityPkg

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, May 11, 2023 8:27 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang 
Subject: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/IpmiFru: Add 
to ManageabilityPkg

From: Abner Chang 

Add IpmiFru to ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 Features/ManageabilityPkg/ManageabilityPkg.dec  | 1 +
 Features/ManageabilityPkg/Include/Manageability.dsc | 4 
 Features/ManageabilityPkg/ManageabilityPkg.dsc  | 2 ++
 Features/ManageabilityPkg/Include/PostMemory.fdf| 4 
 4 files changed, 11 insertions(+)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 38813c5f48..8e8f30b122 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -79,4 +79,5 @@
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x1004
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x1005
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|FALSE|BOOLEAN|0x1006
+  
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiFru|FALSE|BOOLEAN|0x1007
 
diff --git a/Features/ManageabilityPkg/Include/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Manageability.dsc
index a432b0ff26..337c1fb9cc 100644
--- a/Features/ManageabilityPkg/Include/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Manageability.dsc
@@ -51,3 +51,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiFru == TRUE
+  ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf
+!endif
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index e3baf27f2a..6074e9d904 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,7 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable  
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable  
|TRUE
   
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmSmbiosTransferEnable|TRUE
+  gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiFru 
|TRUE
 
 #
 # Include common libraries
@@ -53,5 +54,6 @@
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
+  IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
 !include Include/Manageability.dsc
diff --git a/Features/ManageabilityPkg/Include/PostMemory.fdf 
b/Features/ManageabilityPkg/Include/PostMemory.fdf
index 9100cb2646..2d7be8cc31 100644
--- a/Features/ManageabilityPkg/Include/PostMemory.fdf
+++ b/Features/ManageabilityPkg/Include/PostMemory.fdf
@@ -26,3 +26,7 @@
 !if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable == TRUE
   INF ManageabilityPkg/Universal/MctpProtocol/Dxe/MctpProtocolDxe.inf
 !endif
+
+!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiFru == TRUE
+  INF ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf
+!endif
-- 
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105058): https://edk2.groups.io/g/devel/message/105058
Mute This Topic: https://groups.io/mt/98842634/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 1/2] ManageabilityPkg/IpmiFru: IPMI FRU Driver

2023-05-18 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, May 11, 2023 8:27 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg/IpmiFru: 
IPMI FRU Driver

From: Abner Chang 

IpmiFru is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/IpmiFru in order to consolidate
edk2 system manageability support in one place.
Uncustify is applied to C files and no functionalities are changed in this 
patch.

We will still keep the one under IpmiFeaturePkg/IpmiFru until the reference to 
this instance are removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Universal/IpmiFru/IpmiFru.inf | 34 ++
 .../Universal/IpmiFru/IpmiFru.c   | 67 +++
 2 files changed, 101 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf
 create mode 100644 Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c

diff --git a/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf 
b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf
new file mode 100644
index 00..ddef310309
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.inf
@@ -0,0 +1,34 @@
+### @file
+# Component description file for IPMI FRU.
+#
+# Copyright (c) 2018 - 2019, Intel Corporation. All rights 
+reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION  = 0x00010005
+  BASE_NAME= IpmiFru
+  FILE_GUID= CD9B99D9-E86F-48CF-A8EB-20120AC22666
+  MODULE_TYPE  = DXE_DRIVER
+  PI_SPECIFICATION_VERSION = 0x0001000A
+  VERSION_STRING   = 1.0
+  ENTRY_POINT  = InitializeFru
+
+[Sources]
+  IpmiFru.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  IpmiCommandLib
+  UefiBootServicesTableLib
+  UefiDriverEntryPoint
+  UefiLib
+
+[Depex]
+  TRUE
diff --git a/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c 
b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c
new file mode 100644
index 00..2b489410db
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiFru/IpmiFru.c
@@ -0,0 +1,67 @@
+/** @file
+  IPMI FRU Driver.
+
+Copyright (c) 2018 - 2019, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include 
+#include 
+#include  #include  
+#include  #include 
+
+/*++
+
+Routine Description:
+
+  Initialize SM Redirection Fru Layer
+
+Arguments:
+
+  ImageHandle - ImageHandle of the loaded driver  SystemTable - Pointer 
+ to the System Table
+
+Returns:
+
+  EFI_STATUS
+
+--*/
+EFI_STATUS
+EFIAPI
+InitializeFru (
+  IN EFI_HANDLEImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS Status;
+  IPMI_GET_DEVICE_ID_RESPONSEControllerInfo;
+  IPMI_GET_FRU_INVENTORY_AREA_INFO_REQUEST   GetFruInventoryAreaInfoRequest;
+  IPMI_GET_FRU_INVENTORY_AREA_INFO_RESPONSE  
+GetFruInventoryAreaInfoResponse;
+
+  //
+  //  Get all the SDR Records from BMC and retrieve the Record ID from the 
structure for future use.
+  //
+  Status = IpmiGetDeviceId ();  if (EFI_ERROR (Status)) 
+ {
+DEBUG ((DEBUG_ERROR, "!!! IpmiFru  IpmiGetDeviceId Status=%x\n", Status));
+return Status;
+  }
+
+  DEBUG ((DEBUG_ERROR, "!!! IpmiFru  FruInventorySupport %x\n", 
+ ControllerInfo.DeviceSupport.Bits.FruInventorySupport));
+
+  if (ControllerInfo.DeviceSupport.Bits.FruInventorySupport) {
+GetFruInventoryAreaInfoRequest.DeviceId = 0;
+Status  = IpmiGetFruInventoryAreaInfo 
(, );
+if (EFI_ERROR (Status)) {
+  DEBUG ((DEBUG_ERROR, "!!! IpmiFru  IpmiGetFruInventoryAreaInfo 
Status=%x\n", Status));
+  return Status;
+}
+
+DEBUG ((DEBUG_ERROR, "!!! IpmiFru  InventoryAreaSize=%x\n", 
+ GetFruInventoryAreaInfoResponse.InventoryAreaSize));
+  }
+
+  return EFI_SUCCESS;
+}
--
2.37.1.windows.1








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




Re: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type mismatches from prototypes in BoardBdsHookLib.c

2023-05-16 Thread Isaac Oram
Pushed as acf260597a..15f27d5c30

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Monday, May 15, 2023 2:22 PM
To: devel@edk2.groups.io; rebe...@bsdio.com; Dong, Eric ; 
Gao, Liming ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 

Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type 
mismatches from prototypes in BoardBdsHookLib.c

Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Sunday, May 14, 2023 10:54 PM
To: devel@edk2.groups.io; Dong, Eric ; Oram, Isaac W 
; Gao, Liming ; Chaganty, 
Rangasai V ; Desimone, Nathaniel L 

Cc: Rebecca Cran 
Subject: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type 
mismatches from prototypes in BoardBdsHookLib.c

Add EFIAPI to the implementations of:

BdsBeforeConsoleAfterTrustedConsoleCallback
BdsBeforeConsoleBeforeEndOfDxeGuidCallback
BdsAfterConsoleReadyBeforeBootOptionCallback

This makes them match the prototypes, and avoids an -Wlto-type-mismatch warning.

Signed-off-by: Rebecca Cran 
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c 
b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
index e866f70bc336..bc80badb3e01 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHook
+++ Lib.c
@@ -1273,6 +1273,7 @@ BdsReadyToBootCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsBeforeConsoleAfterTrustedConsoleCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
@@ -1294,6 +1295,7 @@ BdsBeforeConsoleAfterTrustedConsoleCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsBeforeConsoleBeforeEndOfDxeGuidCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
@@ -1311,6 +1313,7 @@ BdsBeforeConsoleBeforeEndOfDxeGuidCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsAfterConsoleReadyBeforeBootOptionCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
--
2.39.2













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




Re: [edk2-devel] [PATCH edk2-platforms v2 0/2] Platform/Intel: Delete ALIGN16 macro and unused include files

2023-05-16 Thread Isaac Oram
Pushed as 3c8ea51b12..acf260597a

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, May 16, 2023 12:43 PM
To: Rebecca Cran ; devel@edk2.groups.io; Chiu, Chasel 
; Desimone, Nathaniel L 
; Chaganty, Rangasai V 

Subject: Re: [edk2-devel] [PATCH edk2-platforms v2 0/2] Platform/Intel: Delete 
ALIGN16 macro and unused include files

Series Reviewed-by: Isaac Oram 

-Original Message-
From: Rebecca Cran  
Sent: Monday, May 15, 2023 6:59 AM
To: devel@edk2.groups.io; Chiu, Chasel ; Desimone, 
Nathaniel L ; Chaganty, Rangasai V 
; Oram, Isaac W 
Cc: Rebecca Cran 
Subject: [PATCH edk2-platforms v2 0/2] Platform/Intel: Delete ALIGN16 macro and 
unused include files

Delete the ALIGN16 macro definitions in
Platform/Intel/{WhiskeylakeOpenBoardPkg,CometlakeOpenBoardPkg} since they were 
causing a build breakage since March, and aren't used anymore.

Delete include files in WhiskeylakeOpenBoardPkg which appear to be unused.


Changes from v1 to v2
=

Instead of fixing the ALIGN16 macro, just delete it.
In addition to the one in WhiskeylakeOpenBoardPkg, also delete the definition 
in CometlakeOpenBoardPkg.

Rebecca Cran (2):
  Platform/Intel: Delete ALIGN16 macro
  Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files

 
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
 |   3 -
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 | 131 
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 |  38 --
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h  
  | 103 ---
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h 
  |  42 ---
 
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
 |   3 -
 6 files changed, 320 deletions(-)
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h

--
2.39.2








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




Re: [edk2-devel] [PATCH edk2-platforms v2 0/2] Platform/Intel: Delete ALIGN16 macro and unused include files

2023-05-16 Thread Isaac Oram
Series Reviewed-by: Isaac Oram 

-Original Message-
From: Rebecca Cran  
Sent: Monday, May 15, 2023 6:59 AM
To: devel@edk2.groups.io; Chiu, Chasel ; Desimone, 
Nathaniel L ; Chaganty, Rangasai V 
; Oram, Isaac W 
Cc: Rebecca Cran 
Subject: [PATCH edk2-platforms v2 0/2] Platform/Intel: Delete ALIGN16 macro and 
unused include files

Delete the ALIGN16 macro definitions in
Platform/Intel/{WhiskeylakeOpenBoardPkg,CometlakeOpenBoardPkg} since they were 
causing a build breakage since March, and aren't used anymore.

Delete include files in WhiskeylakeOpenBoardPkg which appear to be unused.


Changes from v1 to v2
=

Instead of fixing the ALIGN16 macro, just delete it.
In addition to the one in WhiskeylakeOpenBoardPkg, also delete the definition 
in CometlakeOpenBoardPkg.

Rebecca Cran (2):
  Platform/Intel: Delete ALIGN16 macro
  Platform/Intel/WhiskeylakeOpenBoardPkg: Delete unused include files

 
Platform/Intel/CometlakeOpenBoardPkg/CometlakeURvp/Include/PlatformBoardConfig.h
 |   3 -
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 | 131 
 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 |  38 --
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h  
  | 103 ---
 Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h 
  |  42 ---
 
Platform/Intel/WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/Include/PlatformBoardConfig.h
 |   3 -
 6 files changed, 320 deletions(-)
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformHookLib.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/Library/PeiPlatformLib.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformBoardConfig.h
 delete mode 100644 
Platform/Intel/WhiskeylakeOpenBoardPkg/UpXtreme/Include/PlatformInfo.h

--
2.39.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104953): https://edk2.groups.io/g/devel/message/104953
Mute This Topic: https://groups.io/mt/98903762/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][RFC PATCH V1 1/1] MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory buffering

2023-05-16 Thread Isaac Oram
It is sometimes desirable to have debug logging enabled even in production 
systems.
But printing to serial ports on an SMI handler is slow, so SMM debug message 
printing is typically disabled.
This provides the ability to get the data via serial/BMC/production available 
channels.  
It should be high performance to add to the memory buffer, though I didn't 
measure.
It is a one time event to dump on assert.
It could be extended to dump on error codes.  Exceptions?
It could be provided as a protocol or such to allow anyone to trigger.


I just added the Data logging and connected the serial dump to ASSERT, but 
again, this is more an RFC on the general capability of logging strings (SMRAM 
is more plentiful than it once was, so only recording status code and value 
seems unnecessarily frugal) and dumping them to serial port.

I simply wanted to make it available and RFC seemed as good a way to do it as 
any.  If there is a preferred path for such topics, let me know.

Regards,
Isaac

-Original Message-
From: Kinney, Michael D  
Sent: Tuesday, May 16, 2023 11:01 AM
To: devel@edk2.groups.io; Oram, Isaac W 
Cc: Wang, Jian J ; Gao, Liming 
; Zimmer, Vincent ; Chiu, 
Chasel ; Kinney, Michael D 
Subject: RE: [edk2-devel][edk2-platforms][RFC PATCH V1 1/1] 
MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory buffering

Hi Isaac,

Multiple status code handlers can be registered.  One for memory and one for 
serial.

Why would we mix serial into memory one?

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Isaac 
> Oram
> Sent: Tuesday, May 16, 2023 10:39 AM
> To: devel@edk2.groups.io; Oram, Isaac W 
> Cc: Wang, Jian J ; Gao, Liming 
> ; Zimmer, Vincent 
> ; Chiu, Chasel 
> Subject: Re: [edk2-devel][edk2-platforms][RFC PATCH V1 1/1]
> MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory 
> buffering
> 
> Apologies, this is edk2 scope, not edk2-platforms.
> 
> This is an RFC to see if this kind of feature is widely interesting 
> and if someone wants to explore this in depth.
> This is not a complete or mature implementation.  I didn't fully 
> decipher the extended data format.
> 
> Regards,
> Isaac
> 
> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Isaac 
> Oram
> Sent: Tuesday, May 16, 2023 10:35 AM
> To: devel@edk2.groups.io
> Cc: Oram, Isaac W ; Wang, Jian J 
> ; Gao, Liming 
> Subject: [edk2-devel][edk2-platforms][RFC PATCH V1 1/1]
> MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory 
> buffering
> 
> Extend the MemoryStatusCodeWorker functionality to log the debug strings.
> In the event of an assert, dump the strings to serial port.
> The rationale is that SMI latency is very important.  This provides a 
> means to log messages quickly (to memory) and dump them in the event of an 
> assert.
> 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Signed-off-by: Isaac Oram 
> ---
>  .../Include/Guid/MemoryStatusCodeRecord.h |   7 +
>  .../Smm/MemoryStatusCodeWorker.c  | 199 ++
>  2 files changed, 206 insertions(+)
> 
> diff --git a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
> b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
> index a924c592c9..d37b6304c6 100644
> --- a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
> +++ b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
> @@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  
> #ifndef __MEMORY_STATUS_CODE_RECORD_H__  #define 
> __MEMORY_STATUS_CODE_RECORD_H__
> 
> +#include 
> +
>  ///
>  /// Global ID used to identify GUIDed HOBs that start with a 
> structure of type /// MEMORY_STATUSCODE_PACKET_HEADER, followed by an 
> array of structures of type @@ -90,6 +92,11 @@ typedef struct {
>/// the system. Valid instance numbers start with the number 1.
>///
>UINT32   Instance;
> +
> +  //
> +  // Extra data
> +  //
> +  UINT64   Data[(MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)) + 
> 1];
>  } MEMORY_STATUSCODE_RECORD;
> 
>  extern EFI_GUID  gMemoryStatusCodeRecordGuid; diff --git 
> a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWo
> rker.c
> b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeW
> orker.c
> index 80c94e4682..c482c4bd9a 100644
> ---
> a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWo
> rker.c
> +++
> b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeW
> orke
> +++ r.c
> @@ -11,6 +11,141 @@
> 
>  RUNTIME_MEMORY_STATUSCODE_HEADER  *mMmMemoryStatusCodeTable;
> 
> +VOID
> +DumpBufferToSerial (
> +  VOID
> +  );
> +
> +EFI_STATUS
> +EFIAPI
> +DumpRecordToSerial (
> +  IN EFI_STATUS_CODE_TYPE   CodeType,
> +  IN EFI_STA

Re: [edk2-devel][edk2-platforms][RFC PATCH V1 1/1] MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory buffering

2023-05-16 Thread Isaac Oram
Apologies, this is edk2 scope, not edk2-platforms.

This is an RFC to see if this kind of feature is widely interesting and if 
someone wants to explore this in depth.  
This is not a complete or mature implementation.  I didn't fully decipher the 
extended data format.

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, May 16, 2023 10:35 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Wang, Jian J 
; Gao, Liming 
Subject: [edk2-devel][edk2-platforms][RFC PATCH V1 1/1] 
MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory buffering

Extend the MemoryStatusCodeWorker functionality to log the debug strings.
In the event of an assert, dump the strings to serial port.
The rationale is that SMI latency is very important.  This provides a means to 
log messages quickly (to memory) and dump them in the event of an assert.

Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Isaac Oram 
---
 .../Include/Guid/MemoryStatusCodeRecord.h |   7 +
 .../Smm/MemoryStatusCodeWorker.c  | 199 ++
 2 files changed, 206 insertions(+)

diff --git a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h 
b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
index a924c592c9..d37b6304c6 100644
--- a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
+++ b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
@@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #ifndef 
__MEMORY_STATUS_CODE_RECORD_H__  #define __MEMORY_STATUS_CODE_RECORD_H__
 
+#include 
+
 ///
 /// Global ID used to identify GUIDed HOBs that start with a structure of type 
 /// MEMORY_STATUSCODE_PACKET_HEADER, followed by an array of structures of 
type @@ -90,6 +92,11 @@ typedef struct {
   /// the system. Valid instance numbers start with the number 1.
   ///
   UINT32   Instance;
+
+  //
+  // Extra data
+  //
+  UINT64   Data[(MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)) + 
1];
 } MEMORY_STATUSCODE_RECORD;
 
 extern EFI_GUID  gMemoryStatusCodeRecordGuid; diff --git 
a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c 
b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
index 80c94e4682..c482c4bd9a 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorke
+++ r.c
@@ -11,6 +11,141 @@
 
 RUNTIME_MEMORY_STATUSCODE_HEADER  *mMmMemoryStatusCodeTable;
 
+VOID
+DumpBufferToSerial (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+DumpRecordToSerial (
+  IN EFI_STATUS_CODE_TYPE   CodeType,
+  IN EFI_STATUS_CODE_VALUE  Value,
+  IN UINT32 Instance,
+  IN EFI_GUID   *CallerId,
+  IN EFI_STATUS_CODE_DATA   *Data OPTIONAL
+  )
+{
+  CHAR8  *Filename;
+  CHAR8  *Description;
+  CHAR8  *Format;
+  CHAR8  Buffer[MAX_EXTENDED_DATA_SIZE + sizeof (UINT64)];
+  UINT32 ErrorLevel;
+  UINT32 LineNumber;
+  UINTN  CharCount;
+  BASE_LIST  Marker;
+
+  Buffer[0] = '\0';
+
+  if ((Data != NULL) &&
+  ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, 
+ , , ))  {
+//
+// Print ASSERT() information into output buffer.
+//
+CharCount = AsciiSPrint (
+  Buffer,
+  sizeof (Buffer),
+  "\n\rDXE_ASSERT!: %a (%d): %a\n\r",
+  Filename,
+  LineNumber,
+  Description
+  );
+  } else if ((Data != NULL) &&
+ ReportStatusCodeExtractDebugInfo (Data, , 
+ , ))  {
+//
+// Print DEBUG() information into output buffer.
+//
+CharCount = AsciiBSPrint (
+  Buffer,
+  sizeof (Buffer),
+  Format,
+  Marker
+  );
+  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
+//
+// Print ERROR information into output buffer.
+//
+CharCount = AsciiSPrint (
+  Buffer,
+  sizeof (Buffer),
+  "ERROR: C%08x:V%08x I%x",
+  CodeType,
+  Value,
+  Instance
+  );
+ASSERT (CharCount > 0);
+
+if (CallerId != NULL) {
+  CharCount += AsciiSPrint (
+ [CharCount],
+ (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
+ " %g",
+ CallerId
+ );
+}
+
+if (Data != NULL) {
+  CharCount += AsciiSPrint (
+ [CharCount],
+ (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
+ " %x",
+ Data
+ );
+}
+
+CharCount += AsciiSPrint (
+   [CharCount],
+   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
+ 

[edk2-devel][edk2-platforms][RFC PATCH V1 1/1] MdeModulePkg/StatusCodeHandlerSmm: Add debug strings to memory buffering

2023-05-16 Thread Isaac Oram
Extend the MemoryStatusCodeWorker functionality to log the debug strings.
In the event of an assert, dump the strings to serial port.
The rationale is that SMI latency is very important.  This provides a
means to log messages quickly (to memory) and dump them in the event of
an assert.

Cc: Jian J Wang 
Cc: Liming Gao 
Signed-off-by: Isaac Oram 
---
 .../Include/Guid/MemoryStatusCodeRecord.h |   7 +
 .../Smm/MemoryStatusCodeWorker.c  | 199 ++
 2 files changed, 206 insertions(+)

diff --git a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h 
b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
index a924c592c9..d37b6304c6 100644
--- a/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
+++ b/MdeModulePkg/Include/Guid/MemoryStatusCodeRecord.h
@@ -10,6 +10,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #ifndef __MEMORY_STATUS_CODE_RECORD_H__
 #define __MEMORY_STATUS_CODE_RECORD_H__
 
+#include 
+
 ///
 /// Global ID used to identify GUIDed HOBs that start with a structure of type
 /// MEMORY_STATUSCODE_PACKET_HEADER, followed by an array of structures of type
@@ -90,6 +92,11 @@ typedef struct {
   /// the system. Valid instance numbers start with the number 1.
   ///
   UINT32   Instance;
+
+  //
+  // Extra data
+  //
+  UINT64   Data[(MAX_EXTENDED_DATA_SIZE / sizeof (UINT64)) + 
1];
 } MEMORY_STATUSCODE_RECORD;
 
 extern EFI_GUID  gMemoryStatusCodeRecordGuid;
diff --git 
a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c 
b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
index 80c94e4682..c482c4bd9a 100644
--- a/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
+++ b/MdeModulePkg/Universal/StatusCodeHandler/Smm/MemoryStatusCodeWorker.c
@@ -11,6 +11,141 @@
 
 RUNTIME_MEMORY_STATUSCODE_HEADER  *mMmMemoryStatusCodeTable;
 
+VOID
+DumpBufferToSerial (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+DumpRecordToSerial (
+  IN EFI_STATUS_CODE_TYPE   CodeType,
+  IN EFI_STATUS_CODE_VALUE  Value,
+  IN UINT32 Instance,
+  IN EFI_GUID   *CallerId,
+  IN EFI_STATUS_CODE_DATA   *Data OPTIONAL
+  )
+{
+  CHAR8  *Filename;
+  CHAR8  *Description;
+  CHAR8  *Format;
+  CHAR8  Buffer[MAX_EXTENDED_DATA_SIZE + sizeof (UINT64)];
+  UINT32 ErrorLevel;
+  UINT32 LineNumber;
+  UINTN  CharCount;
+  BASE_LIST  Marker;
+
+  Buffer[0] = '\0';
+
+  if ((Data != NULL) &&
+  ReportStatusCodeExtractAssertInfo (CodeType, Value, Data, , 
, ))
+  {
+//
+// Print ASSERT() information into output buffer.
+//
+CharCount = AsciiSPrint (
+  Buffer,
+  sizeof (Buffer),
+  "\n\rDXE_ASSERT!: %a (%d): %a\n\r",
+  Filename,
+  LineNumber,
+  Description
+  );
+  } else if ((Data != NULL) &&
+ ReportStatusCodeExtractDebugInfo (Data, , , 
))
+  {
+//
+// Print DEBUG() information into output buffer.
+//
+CharCount = AsciiBSPrint (
+  Buffer,
+  sizeof (Buffer),
+  Format,
+  Marker
+  );
+  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) {
+//
+// Print ERROR information into output buffer.
+//
+CharCount = AsciiSPrint (
+  Buffer,
+  sizeof (Buffer),
+  "ERROR: C%08x:V%08x I%x",
+  CodeType,
+  Value,
+  Instance
+  );
+ASSERT (CharCount > 0);
+
+if (CallerId != NULL) {
+  CharCount += AsciiSPrint (
+ [CharCount],
+ (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
+ " %g",
+ CallerId
+ );
+}
+
+if (Data != NULL) {
+  CharCount += AsciiSPrint (
+ [CharCount],
+ (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
+ " %x",
+ Data
+ );
+}
+
+CharCount += AsciiSPrint (
+   [CharCount],
+   (sizeof (Buffer) - (sizeof (Buffer[0]) * CharCount)),
+   "\n\r"
+   );
+  } else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_PROGRESS_CODE) {
+//
+// Print PROGRESS information into output buffer.
+//
+CharCount = AsciiSPrint (
+  Buffer,
+  sizeof (Buffer),
+  "PROGRESS CODE: V%08x I%x\n\r",
+  Value,
+  Instance
+  );
+  } else if ((Data != NULL) &&
+ CompareGuid (>Type, ) &&
+ (((EFI_STATUS_CODE_STRING_DATA *)Data)->StringType == 
EfiStringAscii))
+  {

Re: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type mismatches from prototypes in BoardBdsHookLib.c

2023-05-15 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Sunday, May 14, 2023 10:54 PM
To: devel@edk2.groups.io; Dong, Eric ; Oram, Isaac W 
; Gao, Liming ; Chaganty, 
Rangasai V ; Desimone, Nathaniel L 

Cc: Rebecca Cran 
Subject: [edk2-devel] [PATCH edk2-platforms 1/1] Platform/Intel: Fix type 
mismatches from prototypes in BoardBdsHookLib.c

Add EFIAPI to the implementations of:

BdsBeforeConsoleAfterTrustedConsoleCallback
BdsBeforeConsoleBeforeEndOfDxeGuidCallback
BdsAfterConsoleReadyBeforeBootOptionCallback

This makes them match the prototypes, and avoids an -Wlto-type-mismatch warning.

Signed-off-by: Rebecca Cran 
---
 Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c 
b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
index e866f70bc336..bc80badb3e01 100644
--- a/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
+++ b/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHook
+++ Lib.c
@@ -1273,6 +1273,7 @@ BdsReadyToBootCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsBeforeConsoleAfterTrustedConsoleCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
@@ -1294,6 +1295,7 @@ BdsBeforeConsoleAfterTrustedConsoleCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsBeforeConsoleBeforeEndOfDxeGuidCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
@@ -1311,6 +1313,7 @@ BdsBeforeConsoleBeforeEndOfDxeGuidCallback (
   @param[in] ContextPointer to the context data registered to the Event.
 **/
 VOID
+EFIAPI
 BdsAfterConsoleReadyBeforeBootOptionCallback (
   IN EFI_EVENT  Event,
   IN VOID   *Context
--
2.39.2








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104898): https://edk2.groups.io/g/devel/message/104898
Mute This Topic: https://groups.io/mt/98897921/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 v4 1/1] MinPlatformPkg: Add FspNvsBuffer compression option

2023-05-10 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: mikub...@linux.microsoft.com  
Sent: Wednesday, May 10, 2023 8:02 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Oram, Isaac W ; Gao, 
Liming ; Dong, Eric ; Gudla, 
Raghava 
Subject: [edk2-platforms][PATCH v4 1/1] MinPlatformPkg: Add FspNvsBuffer 
compression option

From: Michael Kubacki 

Adds a PCD called "PcdEnableCompressedFspNvsBuffer" that allows the 
"FspNvsBuffer" UEFI variable data to be saved as compressed data.

Especially due to the nature of the data saved in this variable, it compresses 
well. For example, it has been found to reduce ~63KB of data to ~13KB. Boot 
time impact has been found to be negligible.

The default value is FALSE to keep default behavior consistent.

Decompression can be performed on the variable data using the standard 
UefiDecompressLib.

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

Notes:
v4:
  - Rebase onto 42a677e992d2
  - Add CompressLib to MinPlatformPkg.dsc as well
v3:
  - Rebase onto 7ac91ec277db
  - Add CompressLib instance to CoreCommonLib.dsc
v2: Rebase onto 9769bf28d1fc

 Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c   
| 62 
 Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf 
|  4 ++
 Platform/Intel/MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
|  1 +
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec   
|  6 ++
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc   
|  1 +
 5 files changed, 61 insertions(+), 13 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c 
b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
index 0215e8eeddfb..95b8cef8b32b 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo
+++ ryConfig.c
@@ -3,6 +3,7 @@
   exists, and saves the data to nvRAM.
 
 Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -10,6 +11,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include 
  #include   #include 
+#include 
 #include 
 #include 
 #include 
@@ -19,6 +21,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent  #include 
  #include   #include 

+#include 
 #include 
 #include 
 
@@ -38,20 +41,26 @@ SaveMemoryConfigEntryPoint (
   IN EFI_SYSTEM_TABLE   *SystemTable
   )
 {
-  EFI_STATUSStatus;
-  EFI_HOB_GUID_TYPE *GuidHob;
-  VOID  *HobData;
-  VOID  *VariableData;
-  UINTN DataSize;
-  UINTN BufferSize;
-  BOOLEAN   DataIsIdentical;
+  EFI_STATUS Status;
+  EFI_HOB_GUID_TYPE  *GuidHob;
+  VOID   *HobData;
+  VOID   *VariableData;
+  UINTN  DataSize;
+  UINTN  BufferSize;
+  BOOLEANDataIsIdentical;
+  VOID   *CompressedData;
+  UINT64 CompressedSize;
+  UINTN  CompressedAllocationPages;
 
-  DataSize= 0;
-  BufferSize  = 0;
-  VariableData= NULL;
-  GuidHob = NULL;
-  HobData = NULL;
-  DataIsIdentical = FALSE;
+  DataSize  = 0;
+  BufferSize= 0;
+  VariableData  = NULL;
+  GuidHob   = NULL;
+  HobData   = NULL;
+  DataIsIdentical   = FALSE;
+  CompressedData= NULL;
+  CompressedSize= 0;
+  CompressedAllocationPages = 0;
 
   //
   // Search for the Memory Configuration GUID HOB.  If it is not present, then 
@@ -73,6 +82,29 @@ SaveMemoryConfigEntryPoint (
 }
   }
 
+  if (PcdGetBool (PcdEnableCompressedFspNvsBuffer)) {
+if (DataSize > 0) {
+  CompressedAllocationPages = EFI_SIZE_TO_PAGES (DataSize);
+  CompressedData= AllocatePages (CompressedAllocationPages);
+  if (CompressedData == NULL) {
+DEBUG ((DEBUG_ERROR, "[%a] - Failed to allocate compressed data 
buffer.\n", __FUNCTION__));
+ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);
+return EFI_OUT_OF_RESOURCES;
+  }
+
+  CompressedSize = EFI_PAGES_TO_SIZE (CompressedAllocationPages);
+  Status = Compress (HobData, DataSize, CompressedData, 
);
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "[%a] - failed to compress data. Status = %r\n", 
__FUNCTION__, Status));
+ASSERT_EFI_ERROR (Status);
+return Status;
+  }
+}
+
+HobData  = CompressedData;
+DataSize = (UINTN)CompressedSize;
+  }
+
   if (HobData != NULL) {
 DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataLength:%d\n", DataSize));

Re: [edk2-devel] [edk2-platforms][PATCH 2/2] ManageabilityPkg/ManageabilityTransportKcsLib: Add debug message of IPMI KCS Completion Code

2023-05-09 Thread Isaac Oram
Reviewed-by: Isaac Oram 

Multiple instances of typo:  AdditioalStatus   
I think it is ok to fix before push since it is simple search and replace.

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, May 9, 2023 12:56 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 2/2] 
ManageabilityPkg/ManageabilityTransportKcsLib: Add debug message of IPMI KCS 
Completion Code

From: abnchang 

Print out IPMI Completion Code and return additional transport interface status.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Common/ManageabilityTransportKcs.h| 18 +
 .../Common/KcsCommon.c| 39 +--
 .../Dxe/ManageabilityTransportKcs.c   |  7 +++-
 3 files changed, 42 insertions(+), 22 deletions(-)

diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
index 8c6a64416a..166aa8dcde 100644
--- 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/ManageabilityTransportKcs.h
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Com
+++ mon/ManageabilityTransportKcs.h
@@ -51,6 +51,7 @@ typedef struct {
 code is the first byte of response
 data.
   @param[in, out] ResponseDataSize  Size of Command Response Data.
+  @param[out] AdditioalStatus   Additional status of this transaction.
 
   @retval EFI_SUCCESS   The command byte stream was
 successfully submit to the device and 
a @@ -71,14 +72,15 @@ typedef struct {  EFI_STATUS  EFIAPI  
KcsTransportSendCommand (
-  IN  MANAGEABILITY_TRANSPORT_HEADER   TransmitHeader OPTIONAL,
-  IN  UINT16   TransmitHeaderSize,
-  IN  MANAGEABILITY_TRANSPORT_TRAILER  TransmitTrailer OPTIONAL,
-  IN  UINT16   TransmitTrailerSize,
-  IN  UINT8*RequestData OPTIONAL,
-  IN  UINT32   RequestDataSize,
-  OUT UINT8*ResponseData OPTIONAL,
-  IN OUT UINT32*ResponseDataSize OPTIONAL
+  IN  MANAGEABILITY_TRANSPORT_HEADER  TransmitHeader OPTIONAL,
+  IN  UINT16  TransmitHeaderSize,
+  IN  MANAGEABILITY_TRANSPORT_TRAILER TransmitTrailer OPTIONAL,
+  IN  UINT16  TransmitTrailerSize,
+  IN  UINT8   *RequestData OPTIONAL,
+  IN  UINT32  RequestDataSize,
+  OUT UINT8   *ResponseData OPTIONAL,
+  IN  OUT UINT32  *ResponseDataSize OPTIONAL,
+  OUT  MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS  *AdditioalStatus
   );
 
 /**
diff --git 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
 
b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
index a8c6a674c9..84792311be 100644
--- 
a/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Common/KcsCommon.c
+++ b/Features/ManageabilityPkg/Library/ManageabilityTransportKcsLib/Com
+++ mon/KcsCommon.c
@@ -392,10 +392,8 @@ KcsTransportRead (
 code is the first byte of response
 data.
   @param[in, out] ResponseDataSize  Size of Command Response Data.
-When IN, it is the expected data size
-of response data.
-When OUT, it is the data size of 
response
-exactly returned.
+  @param[out] AdditioalStatus   Additional status of this transaction.
+
   @retval EFI_SUCCESS   The command byte stream was
 successfully submit to the device and a
 response was successfully received.
@@ -414,20 +412,22 @@ KcsTransportRead (  EFI_STATUS  EFIAPI  
KcsTransportSendCommand (
-  IN  MANAGEABILITY_TRANSPORT_HEADER   TransmitHeader OPTIONAL,
-  IN  UINT16   TransmitHeaderSize,
-  IN  MANAGEABILITY_TRANSPORT_TRAILER  TransmitTrailer OPTIONAL,
-  IN  UINT16   TransmitTrailerSize,
-  IN  UINT8*RequestData OPTIONAL,
-  IN  UINT32   RequestDataSize,
-  OUT UINT8*ResponseData OPTIONAL,
-  IN OUT UINT32*ResponseDataSize OPTIONAL
+  IN  MANAGEABILITY_TRANSPORT_HEADER  TransmitHeader

Re: [edk2-devel] [edk2-platforms][PATCH 1/2] ManageabilityPkg: Add Manageability IPMI helper Library

2023-05-09 Thread Isaac Oram
Reviewed-by: Isaac Oram 

I noted that the BaseManageabilityTransportIpmiHelper.c file header comment 
indicates that this is a NULL library implementation which seems 
incorrect/misleading.  I think that this can be fixed before pushing.

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, May 9, 2023 12:56 AM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-platforms][PATCH 1/2] ManageabilityPkg: Add Manageability IPMI 
helper Library

From: Abner Chang 

Add IPMI helper library to print debug message of IPMI Completion Code in human 
readable string and return the transport interface additional status.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../BaseManageabilityTransportHelper.inf  |  1 +
 .../Library/ManageabilityTransportHelperLib.h | 24 +++
 .../Library/ManageabilityTransportIpmiLib.h   | 13 +++-
 .../Library/ManageabilityTransportLib.h   | 11 +--
 .../BaseManageabilityTransportIpmiHelper.c| 70 +++
 5 files changed, 112 insertions(+), 7 deletions(-)  create mode 100644 
Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportIpmiHelper.c

diff --git 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
index c9e5eaef60..0936449fda 100644
--- 
a/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
+++ b/Features/ManageabilityPkg/Library/BaseManageabilityTransportHelper
+++ Lib/BaseManageabilityTransportHelper.inf
@@ -21,6 +21,7 @@
 
 [Sources]
   BaseManageabilityTransportHelper.c
+  BaseManageabilityTransportIpmiHelper.c
 
 [LibraryClasses]
   BaseMemoryLib
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
index c2c98d6c2d..11a1bd0521 100644
--- 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHelperLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportHe
+++ lperLib.h
@@ -187,4 +187,28 @@ HelperManageabilityDebugPrint (
   ...
   );
 
+///
+/// IPMI Helper Functions.
+///
+
+/**
+  This function returns a human readable string of IPMI KCS Completion 
+Code
+  and returns the corresponding additional status of transport interface.
+
+  @param [in]  CompletionCode The Completion Code returned from KCS.
+  @param [out] CompletionCodeStr  Human readable string of IPMI Completion 
Code.
+  @param [out] AdditionalStatus   Return the addtional status.
+
+  @retval  EFI_SUCCESSThe information of Completion Code is 
returned.
+  @retval  EFI_NOT_FOUND  No information of Completion Code is 
returned.
+  @retval  EFI_INVALID_PARAMETER  The given parameter is incorrect.
+
+**/
+EFI_STATUS
+IpmiHelperCheckCompletionCode (
+  IN   UINT8  CompletionCode,
+  OUT  CHAR16 **CompletionCodeStr,
+  OUT  MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS  *AdditionalStatus
+  );
+
 #endif
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
index 1628255a6a..6d136e460f 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIpmiLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportIp
+++ miLib.h
@@ -16,9 +16,18 @@
 /// the payload.
 ///
 typedef struct {
-  UINT8Lun:2;
-  UINT8NetFn:6;
+  UINT8Lun   : 2;
+  UINT8NetFn : 6;
   UINT8Command;
 } MANAGEABILITY_IPMI_TRANSPORT_HEADER;
 
+///
+/// The IPMI Completion Code mapping.
+///
+typedef struct {
+  UINT8CompletionCode;
+  CHAR16   *CompletionCodeString;
+  MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUSAdditionalStatus;
+} MANAGEABILITY_IPMI_COMPLETTION_CODE_MAPPING;
+
 #endif
diff --git 
a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h 
b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
index 04072aee89..f423a1ed44 100644
--- a/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLib.h
+++ b/Features/ManageabilityPkg/Include/Library/ManageabilityTransportLi
+++ b.h
@@ -61,11 +61,12 @@ typedef union {
 /// Additional transport interface status.
 ///
 typedef UINT32 MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS;
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_NO_ERRORS  0x
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_ERROR  0x0001
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_READ   0x0002
-#define MANAGEABILITY_TRANSPORT_ADDITIONAL_STATUS_BUSY_IN_WRITE

Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Build: Add standalone MM build rules

2023-05-09 Thread Isaac Oram
Pushed as fe146bbec1..9018828bfb

-Original Message-
From: Chiu, Chasel  
Sent: Tuesday, May 2, 2023 1:07 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Gao, Liming 
; Dong, Eric 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Build: 
Add standalone MM build rules


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Oram, Isaac W 
> Sent: Wednesday, March 15, 2023 6:18 AM
> To: devel@edk2.groups.io
> Cc: Oram, Isaac W ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Gao, Liming 
> ; Dong, Eric 
> Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1] MinPlatformPkg/Build:
> Add standalone MM build rules
> 
> Adds MM_STANDALONE_CORE and MM_STANDALONE FFS file construction rules.
> 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Cc: Eric Dong 
> Signed-off-by: Isaac Oram 
> ---
>  .../MinPlatformPkg/Include/Fdf/RuleInclude.fdf| 15 +++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
> b/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
> index 85e6f773df..a737465d04 100644
> --- a/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
> +++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
> @@ -241,3 +241,18 @@
>FILE FV_IMAGE = $(NAMED_GUID) {
>  FV_IMAGE FV  |.fv
>}
> +
> +[Rule.Common.MM_CORE_STANDALONE]
> +  FILE MM_CORE_STANDALONE = $(NAMED_GUID) {
> +PE32 PE32$(INF_OUTPUT)/$(MODULE_NAME).efi
> +UI   STRING="$(MODULE_NAME)" Optional
> +VERSION  STRING="$(INF_VERSION)" Optional
> BUILD_NUM=$(BUILD_NUMBER)
> +  }
> +
> +[Rule.Common.MM_STANDALONE]
> +  FILE MM_STANDALONE = $(NAMED_GUID) {
> +SMM_DEPEXSMM_DEPEX Optional
> $(INF_OUTPUT)/$(MODULE_NAME).depex
> +PE32 PE32$(INF_OUTPUT)/$(MODULE_NAME).efi
> +UI   STRING="$(MODULE_NAME)" Optional
> +VERSION  STRING="$(INF_VERSION)" Optional
> BUILD_NUM=$(BUILD_NUMBER)
> +  }
> --
> 2.39.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104436): https://edk2.groups.io/g/devel/message/104436
Mute This Topic: https://groups.io/mt/97627030/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 1/1] WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures

2023-05-09 Thread Isaac Oram
Pushed as 92479808e7..fe146bbec1

-Original Message-
From: Chiu, Chasel  
Sent: Tuesday, May 2, 2023 1:06 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 1/1] 
WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Oram, Isaac W 
> Sent: Tuesday, March 7, 2023 4:16 PM
> To: devel@edk2.groups.io
> Cc: Oram, Isaac W ; Desimone, Nathaniel L 
> ; Chiu, Chasel 
> Subject: [edk2-devel][edk2-platforms][PATCH V1 1/1]
> WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures
> 
> Include for building Advanced Features was mistakenly removed in an 
> earlier commit.
> 
> Cc: Nate DeSimone 
> Cc: Chasel Chiu 
> Signed-off-by: Isaac Oram 
> ---
>  Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> index c784df0144..9452867edb 100644
> --- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> +++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
> @@ -59,6 +59,11 @@
>  [PcdsFixedAtBuild]
>gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
> 
> +#
> +# Include AdvancedFeatures
> +#
> +!include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
> +
>#
># Platform On/Off features are defined here
>#
> --
> 2.39.0.windows.1



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




Re: [edk2-devel] [PATCH edk2-platforms 1/4] QemuOpenBoardPkg: Use MdeModulePkg's SataControllerDxe

2023-05-09 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Pedro Falcato
Sent: Tuesday, May 9, 2023 9:15 AM
To: devel@edk2.groups.io
Cc: Pedro Falcato ; Oram, Isaac W 
; Theo Jehl 
Subject: [edk2-devel] [PATCH edk2-platforms 1/4] QemuOpenBoardPkg: Use 
MdeModulePkg's SataControllerDxe

As part of an effort to remove OvmfPkg/SataControllerDxe, switch to the generic 
version in MdeModulePkg.

Tested-by: Pedro Falcato 
Cc: Isaac Oram 
Cc: Theo Jehl 
Signed-off-by: Pedro Falcato 
---
 Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc | 2 +-
 Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc   | 2 +-
 Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc 
b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc
index 283c235b44c0..5a63848f26cd 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc
+++ b/Platform/Qemu/QemuOpenBoardPkg/Include/Dsc/Stage4.dsc.inc
@@ -21,7 +21,7 @@
 [Components.$(DXE_ARCH)]
   OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
   MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
-  OvmfPkg/SataControllerDxe/SataControllerDxe.inf
+  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
   MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
   MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc 
b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
index f5c317c83e6a..b409a6164412 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
+++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.dsc
@@ -160,7 +160,7 @@
 [Components.$(DXE_ARCH)]
   MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
-  OvmfPkg/SataControllerDxe/SataControllerDxe.inf
+  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
   MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
   MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
   MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
diff --git a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf 
b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
index 5af0f0f2faa2..b106828460a9 100644
--- a/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
+++ b/Platform/Qemu/QemuOpenBoardPkg/QemuOpenBoardPkg.fdf
@@ -266,7 +266,7 @@ SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize  
   = 0x80
   INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
   INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
 
-  INF OvmfPkg/SataControllerDxe/SataControllerDxe.inf
+  INF MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
 
   INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
   INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
--
2.40.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104433): https://edk2.groups.io/g/devel/message/104433
Mute This Topic: https://groups.io/mt/98787478/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] MinPlatformPkg/SaveMemoryConfig: Support NVS Data compression.

2023-05-09 Thread Isaac Oram
>> for
>>> data blob creation and use.  Data integrity, authentication, 
>>> compression, etc
>> all
>>> can be done based on more detailed knowledge of the silicon
>> implementation
>>> requirements.
>>>
>>> I can see another argument though that doing it inside FSP 
>>> effectively forces both bootloader and FSP to carry 
>>> compression/decompression.  The compression/decompression aren't 
>>> likely to need to be silicon specific.  And bootloader may have more 
>>> requirements to balance than just the silicon requirements.
>>>
>>> Can I get some votes on preferred answer for 
>>> compressing/decompressing
>> FSP
>>> non-volatile data in bootloader or FSP?
>>>
>>> Thanks,
>>> Isaac
>>>
>>> -Original Message-
>>> From: Gudla, Raghava 
>>> Sent: Friday, May 5, 2023 5:03 PM
>>> To: devel@edk2.groups.io
>>> Cc: Gudla, Raghava ; Chiu, Chasel 
>>> ; Desimone, Nathaniel L 
>>> ; Oram, Isaac W
>> 
>>> Subject: [edk2-platforms:PATCH V1] MinPlatformPkg/SaveMemoryConfig:
>>> Support NVS Data compression.
>>>
>>> Around 50KB "FspNonVolatileStorageHob" data can be compressed to 
>>> approximately 3 KB which can save NVRAM space and enhance life of 
>>> the SPI part by decreasing the number of reclaim cycles needed.
>>>
>>> This patch added support to compress "FspNonVolatileStorageHob" data
>> before
>>> saving to NVRAM.
>>>
>>> A PcdEnableCompressFspNvsHob is introduced to enable/disable this
>> feature per
>>> platform usage.
>>>
>>> Cc: Chasel Chiu 
>>> Cc: Nate DeSimone 
>>> Cc: Isaac Oram 
>>>
>>> Signed-off-by: Raghava Gudla 
>>> ---
>>>   .../SaveMemoryConfig/SaveMemoryConfig.c   | 34 +++
>>>   .../SaveMemoryConfig/SaveMemoryConfig.inf |  6 +++-
>>>   .../Include/Dsc/CoreCommonLib.dsc |  1 +
>>>   .../Intel/MinPlatformPkg/MinPlatformPkg.dec   |  5 +++
>>>   4 files changed, 45 insertions(+), 1 deletion(-)
>>>
>>> diff --git
>>>
>> a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo
>> r
>>> yConfig.c
>>>
>> b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMem
>> or
>>> yConfig.c
>>> index 0215e8eed..8aa935b54 100644
>>> ---
>>>
>> a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo
>> r
>>> yConfig.c
>>> +++
>>>
>> b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMem
>> o
>>> +++ ryConfig.c
>>> @@ -21,6 +21,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>>>   #include  #include 
>>>  #include 
>>> +#include +#include
>>>   /**   This is the standard EFI driver point that
>> detects
>>> whether there is a@@ -45,6 +47,9 @@ SaveMemoryConfigEntryPoint (
>>> UINTN DataSize;   UINTN BufferSize;   BOOLEAN
>>> DataIsIdentical;+  VOID  *CompressedData;+  UINT64
>>> CompressedSize;+  UINTN CompressedAllocationPages;DataSize
>> = 0;
>>> BufferSize  = 0;@@ -73,6 +78,35 @@ SaveMemoryConfigEntryPoint (
>>>   }   } +  if (PcdGetBool (PcdEnableCompressFspNvsHob) == 1) {+
>>> CompressedData= NULL;+CompressedSize= 0;+
>>> CompressedAllocationPages = 0;++DEBUG ((DEBUG_INFO, "compressing
>> mem
>>> config nvs variable\n"));+if (DataSize > 0) {+
>> CompressedAllocationPages =
>>> EFI_SIZE_TO_PAGES (DataSize);+  CompressedData = AllocatePages
>>> (CompressedAllocationPages);+  if (CompressedData == NULL) {+
>> DEBUG
>>> ((DEBUG_ERROR, "[%a] - Failed to allocate compressed data buffer.\n",
>>> __func__));+ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);+return
>>> EFI_OUT_OF_RESOURCES;+  }++  CompressedSize = EFI_PAGES_TO_SIZE
>>> (CompressedAllocationPages);+  Status = Compress (HobData, DataSize,
>>> CompressedData, );+  if (EFI_ERROR (Status)) {+
>> DEBUG
>>> ((DEBUG_ERROR, "[%a] - failed to compress data. Status = %r\n", __func__,
>>> Status));+ASSERT_EFI_ERROR (Status);+
>> FreePool(CompressedData);+
>>> return Status;+  } else {+HobData  = CompressedData;+
>>> DataSize
>> =
>>> (UINTN) CompressedSize;+

Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg/IpmiCommandLib:IPMI Command Library

2023-05-08 Thread Isaac Oram
Reviewed-by:  Isaac Oram 


A few superficial things that could be fixed now or later.

Typo:  EFI_STASTUS

There is a mismatch between function names and parameter names that looks like 
a cut/paste from prior function.  Updating would probably match the spirit of 
"no functional changes", but it is your choice to correct.
IpmiSetPowerRestorePolicy (
  IN  IPMI_SET_POWER_RESTORE_POLICY_REQUEST   *ChassisControlRequest,
  OUT IPMI_SET_POWER_RESTORE_POLICY_RESPONSE  *ChassisControlResponse
  )

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, May 4, 2023 10:24 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Abdul Lateef Attar 
; Nickle Wang ; Tinh Nguyen 

Subject: [edk2-devel] [edk2-platforms][PATCH] 
ManageabilityPkg/IpmiCommandLib:IPMI Command Library

From: Abner Chang 

BZ #: 

IpmiCommandLib is cloned from
edk2-platforms/Features/Intel/OutOfBandManagement/
IpmiFeaturePkg/Library/IpmiCommandLib in order to
consolidate edk2 system manageability support in
one place. Function header are added to the source
files and header files. Uncustify is applied to C
files and no functionalities are changed in this patch.

We will still keep the one under IpmiFeaturePkg/Library/
IpmiCommandLib until the reference to this instance are
removed from platforms.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Tinh Nguyen 
---
 .../Library/IpmiCommandLib/IpmiCommandLib.inf |  33 +
 .../Include/Library/IpmiCommandLib.h  | 620 ++
 .../IpmiCommandLib/IpmiCommandLibNetFnApp.c   | 444 +
 .../IpmiCommandLibNetFnChassis.c  | 199 ++
 .../IpmiCommandLibNetFnStorage.c  | 384 +++
 .../IpmiCommandLibNetFnTransport.c| 156 +
 6 files changed, 1836 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
 create mode 100644 Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnApp.c
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnChassis.c
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnStorage.c
 create mode 100644 
Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLibNetFnTransport.c

diff --git 
a/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf 
b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
new file mode 100644
index 00..3dc485cf38
--- /dev/null
+++ b/Features/ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
@@ -0,0 +1,33 @@
+### @file
+# Component description file for IPMI Command Library.
+#
+# Copyright (c) 2018 - 2021, Intel Corporation. All rights reserved.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = IpmiCommandLib
+  FILE_GUID  = 96FC1989-CB7F-489B-9D3B-68DCA2C2DADC
+  MODULE_TYPE= UEFI_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = IpmiCommandLib
+
+[sources]
+  IpmiCommandLibNetFnApp.c
+  IpmiCommandLibNetFnTransport.c
+  IpmiCommandLibNetFnChassis.c
+  IpmiCommandLibNetFnStorage.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  ManageabilityPkg/ManageabilityPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IpmiLib
diff --git a/Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h 
b/Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h
new file mode 100644
index 00..685f6e2ea2
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/IpmiCommandLib.h
@@ -0,0 +1,620 @@
+/** @file
+  This library abstract how to send/receive IPMI command.
+
+Copyright (c) 2018-2021, Intel Corporation. All rights reserved.
+Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef IPMI_COMMAND_LIB_H_
+#define IPMI_COMMAND_LIB_H_
+
+#include 
+#include 
+
+///
+/// Functions for IPMI NetFnApp commands
+///
+
+/**
+  This function is used to retrieve device ID.
+
+  @param [out]  DeviceId  The pointer to receive IPMI_GET_DEVICE_ID_RESPONSE.
+
+  @retval EFI_STASTUS   See the return values of IpmiSubmitCommand () function.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetDeviceId (
+  OUT IPMI_GET_DEVICE_ID_RESPONSE  *DeviceId
+  );
+
+/**
+  This function returns device self test results
+
+  @param [out]  SelfTestResult  The pointer to receive 
IPMI_SELF_TEST_RESULT_RESPONSE.
+
+  @retval EFI_STASTUS   See the return values of IpmiSubmitCommand () function.
+
+**/
+EFI_STATUS
+EFIAPI
+IpmiGetSelfTestResult (
+  OUT IPMI_SELF_TEST_RESULT_RESPONSE  *SelfTestResult
+  );
+
+/**
+  Thi

Re: [edk2-devel] [edk2-platforms:PATCH V1] MinPlatformPkg/SaveMemoryConfig: Support NVS Data compression.

2023-05-08 Thread Isaac Oram
The proposed implementation is fine and I will reviewed-by and push if that is 
the desired direction.

My question is if we generally like the design of doing compression in common 
MinPlatform code, decompression in board specific FSP wrapper code.  The 
alternative design is to do compression and decompression inside the FSP.  This 
seems like a slightly simpler separation of responsibilities.
The board code is responsible for save/restore, the FSP code is responsible for 
data blob creation and use.  Data integrity, authentication, compression, etc 
all can be done based on more detailed knowledge of the silicon implementation 
requirements.

I can see another argument though that doing it inside FSP effectively forces 
both bootloader and FSP to carry compression/decompression.  The 
compression/decompression aren't likely to need to be silicon specific.  And 
bootloader may have more requirements to balance than just the silicon 
requirements.

Can I get some votes on preferred answer for compressing/decompressing FSP 
non-volatile data in bootloader or FSP?

Thanks,
Isaac

-Original Message-
From: Gudla, Raghava  
Sent: Friday, May 5, 2023 5:03 PM
To: devel@edk2.groups.io
Cc: Gudla, Raghava ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Oram, Isaac W 
Subject: [edk2-platforms:PATCH V1] MinPlatformPkg/SaveMemoryConfig: Support NVS 
Data compression.

Around 50KB "FspNonVolatileStorageHob" data can be compressed to approximately 
3 KB which can save NVRAM space and enhance life of the SPI part by decreasing 
the number of reclaim cycles needed.

This patch added support to compress "FspNonVolatileStorageHob" data before 
saving to NVRAM.

A PcdEnableCompressFspNvsHob is introduced to enable/disable this feature per 
platform usage.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Isaac Oram 

Signed-off-by: Raghava Gudla 
---
 .../SaveMemoryConfig/SaveMemoryConfig.c   | 34 +++
 .../SaveMemoryConfig/SaveMemoryConfig.inf |  6 +++-
 .../Include/Dsc/CoreCommonLib.dsc |  1 +
 .../Intel/MinPlatformPkg/MinPlatformPkg.dec   |  5 +++
 4 files changed, 45 insertions(+), 1 deletion(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c 
b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
index 0215e8eed..8aa935b54 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.c
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo
+++ ryConfig.c
@@ -21,6 +21,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include  #include 
 #include 
+#include +#include 
  /**   This is the standard EFI driver point that 
detects whether there is a@@ -45,6 +47,9 @@ SaveMemoryConfigEntryPoint (
   UINTN DataSize;   UINTN BufferSize;   BOOLEAN
   DataIsIdentical;+  VOID  *CompressedData;+  UINT64
CompressedSize;+  UINTN CompressedAllocationPages;DataSize  
  = 0;   BufferSize  = 0;@@ -73,6 +78,35 @@ SaveMemoryConfigEntryPoint (
 }   } +  if (PcdGetBool (PcdEnableCompressFspNvsHob) == 1) {+
CompressedData= NULL;+CompressedSize= 0;+
CompressedAllocationPages = 0;++DEBUG ((DEBUG_INFO, "compressing mem config 
nvs variable\n"));+if (DataSize > 0) {+  CompressedAllocationPages = 
EFI_SIZE_TO_PAGES (DataSize);+  CompressedData = AllocatePages 
(CompressedAllocationPages);+  if (CompressedData == NULL) {+DEBUG 
((DEBUG_ERROR, "[%a] - Failed to allocate compressed data buffer.\n", 
__func__));+ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES);+return 
EFI_OUT_OF_RESOURCES;+  }++  CompressedSize = EFI_PAGES_TO_SIZE 
(CompressedAllocationPages);+  Status = Compress (HobData, DataSize, 
CompressedData, );+  if (EFI_ERROR (Status)) {+DEBUG 
((DEBUG_ERROR, "[%a] - failed to compress data. Status = %r\n", __func__, 
Status));+ASSERT_EFI_ERROR (Status);+FreePool(CompressedData);+ 
   return Status;+  } else {+HobData  = CompressedData;+
DataSize = (UINTN) CompressedSize;+  }+}+  }+   if (HobData != NULL) {  
   DEBUG ((DEBUG_INFO, "FspNvsHob.NvsDataLength:%d\n", DataSize)); DEBUG 
((DEBUG_INFO, "FspNvsHob.NvsDataPtr   : 0x%x\n", HobData));diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
 
b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
index 61e85a658..77920d031 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/SaveMemoryConfig/SaveMemo
+++ ryConfig.inf
@@ -26,6 +26,7 @@
   LargeVariableReadLib   LargeVariableWriteLib   BaseLib+  CompressLib  
[Packages]   MdePkg/MdePkg.dec@@ -45,6 +46,9 @@
   gFspNonVolati

Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-05-01 Thread Isaac Oram
Pushed as 64b06a4d19..d39c665fe3

Note I had trouble extracting the patch.  I had to ignore whitespace and then 
fixup line endings to pass
python \edk2\BaseTools\Scripts\PatchCheck.py -1

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Monday, May 1, 2023 5:08 PM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table 
based on PCD values

Reviewed-by: Isaac Oram 

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD 
values

[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase); 
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8 
+ (PcdSerialRegisterAccessWidth);  gSpcrInfo.BaseAddress.AccessSize =
+ (UINT8)PcdGet32 (PcdSerialRegisterStride);  if (PcdGetBool 
(PcdSerialUseMmio)) {
+gSpcrInfo.BaseAddress.AddressSpaceId = EFI_ACPI_3_0_SYSTEM_MEMORY; 
+ }
+
+  // OEM info
+  CopyMem (
+(VOID *) ,
+PcdGetPtr (PcdAcpiDefaultOemId),
+sizeof (gSpcrInfo.Header.OemId)
+);
+  AcpiTableOemId = PcdGet64 (PcdAcpiDefaultOemTableId);  CopyMem (
+(VOID *) ,
+(VOID *) ,
+sizeof (gSpcrInfo.Header.OemTableId)
+);
+  gSpcrInfo.Header.OemRevision

Re: [edk2-devel] [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

2023-05-01 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Attar, AbdulLateef (Abdul Lateef)  
Sent: Friday, April 28, 2023 2:46 AM
To: Attar, AbdulLateef (Abdul Lateef) ; 
devel@edk2.groups.io
Cc: Chang, Abner ; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: RE: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD 
values

[Public]

Hi Maintainers,
Please review the patch.
Thanks
AbduL

-Original Message-
From: Abdul Lateef Attar 
Sent: 10 April 2023 15:56
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang, Abner 
; Sai Chaganty ; Isaac Oram 
; Nate DeSimone ; 
Liming Gao 
Subject: [PATCH v1 1/1] SpcrFeaturePkg: Updated SPCR table based on PCD values

From: Abdul Lateef Attar 

Update the SPCR table based on PCD values, such as base address, register bit 
width, access size and address space id etc, along with OEM data.

Cc: Abner Chang 
Cc: Sai Chaganty 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Abdul Lateef Attar 
---
 .../SpcrAcpiDxe/SpcrAcpiDxe.inf   | 13 ++
 .../SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c | 26 +++
 2 files changed, 39 insertions(+)

diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
index 3fc84959a015..9a4f95e86bbf 100644
--- 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpiDxe.inf
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ AcpiDxe.inf
@@ -2,6 +2,7 @@
 # SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).
 #
 # Copyright (c) 2008 - 2020, Intel Corporation. All rights reserved.
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent  #  ## @@ -26,6 +27,7 @@ 
[LibraryClasses]

 [Packages]
   MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
   SpcrFeaturePkg/SpcrFeaturePkg.dec

 [Sources]
@@ -38,5 +40,16 @@ [Protocols]
   gEfiSerialIoProtocolGuid  ## SOMETIMES_CONSUMES
   gEfiPciIoProtocolGuid ## SOMETIMES_CONSUMES

+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultCreatorRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemRevision
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemTableId
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterAccessWidth
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio
+
 [Depex]
   TRUE
diff --git 
a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c 
b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
index 7ad0c058c844..51449d0fad9e 100644
--- a/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/SpcrAcpi.c
+++ b/Features/Intel/OutOfBandManagement/SpcrFeaturePkg/SpcrAcpiDxe/Spcr
+++ Acpi.c
@@ -3,6 +3,7 @@
   SPCR is abbreviation of Serial Port Console Redirection Table (SPCR).

   Copyright (c) 2004 - 2020, Intel Corporation. All rights reserved.
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent

 **/
@@ -368,6 +369,7 @@ OutOfBandACPITableConstruction (
   UINT32   FlowControl;
   VENDOR_DEVICE_PATH   *Vendor;
   UINT8Index;
+  UINT64   AcpiTableOemId;

   Handle  = NULL;

@@ -456,6 +458,30 @@ OutOfBandACPITableConstruction (
 goto out;
   }

+  // Base register details
+  gSpcrInfo.BaseAddress.Address = PcdGet64 (PcdSerialRegisterBase); 
+ gSpcrInfo.BaseAddress.RegisterBitWidth = PcdGet8 
+ (PcdSerialRegisterAccessWidth);  gSpcrInfo.BaseAddress.AccessSize =
+ (UINT8)PcdGet32 (PcdSerialRegisterStride);  if (PcdGetBool 
(PcdSerialUseMmio)) {
+gSpcrInfo.BaseAddress.AddressSpaceId = EFI_ACPI_3_0_SYSTEM_MEMORY; 
+ }
+
+  // OEM info
+  CopyMem (
+(VOID *) ,
+PcdGetPtr (PcdAcpiDefaultOemId),
+sizeof (gSpcrInfo.Header.OemId)
+);
+  AcpiTableOemId = PcdGet64 (PcdAcpiDefaultOemTableId);  CopyMem (
+(VOID *) ,
+(VOID *) ,
+sizeof (gSpcrInfo.Header.OemTableId)
+);
+  gSpcrInfo.Header.OemRevision = PcdGet32 (PcdAcpiDefaultOemRevision);
+  gSpcrInfo.Header.CreatorId   = PcdGet32 (PcdAcpiDefaultCreatorId);
+  gSpcrInfo.Header.CreatorRevision = PcdGet32 
+ (PcdAcpiDefaultCreatorRevision);
+
   //
   // Add table
   //
--
2.25.1



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

Re: [edk2-devel] [PATCH v2] MinPlatformPkg: Add Pcd for FADT REVISION and MINOR REVISION to update FADT entries from board package.

2023-04-12 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Chiu, Chasel  
Sent: Wednesday, April 12, 2023 9:41 AM
To: Chen, Aryeh ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 

Subject: RE: [PATCH v2] MinPlatformPkg: Add Pcd for FADT REVISION and MINOR 
REVISION to update FADT entries from board package.



Reviewed-by: Chasel Chiu 

Thanks,
Chasel



> -Original Message-
> From: Chen, Aryeh 
> Sent: Wednesday, April 12, 2023 9:27 AM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Oram, Isaac W 
> ; Gao, Liming ; 
> Dong, Eric 
> Subject: [PATCH v2] MinPlatformPkg: Add Pcd for FADT REVISION and 
> MINOR REVISION to update FADT entries from board package.
> 
> From: Aryeh Chen 
> 
> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4409
> 
> Add Pcd for FADT REVISION and MINOR REVISION to update FADT entries 
> from board package.
> 
> Signed-off-by: Aryeh Chen 
> Cc: Chasel Chiu 
> Cc: Nate DeSimone 
> Cc: Isaac Oram 
> Cc: Liming Gao 
> Cc: Eric Dong 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c   | 2 ++
>  Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf | 2 ++
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec   | 2 ++
>  3 files changed, 6 insertions(+)
> 
> diff --git 
> a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> index 6e57b638e0..e967031a3b 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
> @@ -1096,6 +1096,7 @@ PlatformUpdateTables (
>case EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE:
> FadtHeader = (EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE *) Table; +
> FadtHeader->Header.Revision   = PcdGet8 (PcdFadtMajorVersion);
> FadtHeader->PreferredPmProfile= PcdGet8
> (PcdFadtPreferredPmProfile); FadtHeader->IaPcBootArch 
>  =
> PcdGet16 (PcdFadtIaPcBootArch); FadtHeader->Flags 
> =
> PcdGet32 (PcdFadtFlags);@@ -1113,6 +1114,7 @@ PlatformUpdateTables (
>  FadtHeader->Gpe1Blk   = PcdGet16 
> (PcdAcpiGpe1BlockAddress);
> FadtHeader->Gpe1BlkLen= PcdGet8 
> (PcdAcpiGpe1BlockLength);
> FadtHeader->Gpe1Base  = PcdGet8 (PcdAcpiGpe1Base);+
> FadtHeader->MinorVersion  = PcdGet8 (PcdFadtMinorVersion);
> FadtHeader->XPm1aEvtBlk.Address   = PcdGet16
> (PcdAcpiPm1AEventBlockAddress); FadtHeader->XPm1bEvtBlk.Address
> = PcdGet16 (PcdAcpiPm1BEventBlockAddress);diff --git 
> a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> index 451034fb8a..694492112b 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.inf
> @@ -67,6 +67,8 @@
>gMinPlatformPkgTokenSpaceGuid.PcdFadtFlags
> gMinPlatformPkgTokenSpaceGuid.PcdFadtDutyOffset
> gMinPlatformPkgTokenSpaceGuid.PcdFadtDutyWidth+
> gMinPlatformPkgTokenSpaceGuid.PcdFadtMajorVersion+
> gMinPlatformPkgTokenSpaceGuid.PcdFadtMinorVersion
> gPcAtChipsetPkgTokenSpaceGuid.PcdHpetBaseAddress
> gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddressdiff --git 
> a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> index e6f714b181..784abb828e 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> @@ -346,6 +346,8 @@
> 
> gMinPlatformPkgTokenSpaceGuid.PcdFadtPreferredPmProfile|0x02|UINT8|0x9
> 025
> gMinPlatformPkgTokenSpaceGuid.PcdFadtIaPcBootArch|0x0001|UINT16|0x900
> 00026
> gMinPlatformPkgTokenSpaceGuid.PcdFadtFlags|0x86A5|UINT32|0x9
> 027+
> gMinPlatformPkgTokenSpaceGuid.PcdFadtMajorVersion|0x06|UINT8|0x90
> 30+
> gMinPlatformPkgTokenSpaceGuid.PcdFadtMinorVersion|0x03|UINT8|0x90
> 31  [PcdsFixedAtBuild] --
> 2.26.2.windows.1



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




Re: [edk2-devel] [edk2-platfoms][PATCH V2] Update PcdBoardID of JunctionCity and Aowanda platform to 0x81 and 0x82

2023-04-03 Thread Isaac Oram
Pushed as 857a342e50..07f5955bad

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Monday, April 3, 2023 8:56 AM
To: Ramkumar Krishnamoorthi ; devel@edk2.groups.io
Cc: Venkatesan, Selvaraj ; DOPPALAPUDI, HARIKRISHNA 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 
; Ponnusamy, Suresh ; Desimone, 
Nathaniel L 
Subject: Re: [edk2-devel] [edk2-platfoms][PATCH V2] Update PcdBoardID of 
JunctionCity and Aowanda platform to 0x81 and 0x82

Reviewed-by: Isaac Oram 

I amended the author to match "Ramkumar K ".  Please 
correct.  I am not sure if it is git config or groups.io that is mismatching.  
You can do git log and see the delta between author and your signoff.

Thanks for fixing the enum.

Regards,
Isaac

-Original Message-
From: Ramkumar Krishnamoorthi  
Sent: Monday, March 27, 2023 4:04 AM
To: devel@edk2.groups.io
Cc: Venkatesan, Selvaraj ; DOPPALAPUDI, HARIKRISHNA 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 
; Ponnusamy, Suresh ; Ramkumar 
Krishnamoorthi ; Oram, Isaac W ; 
Desimone, Nathaniel L 
Subject: [edk2-platfoms][PATCH V2] Update PcdBoardID of JunctionCity and 
Aowanda platform to 0x81 and 0x82

Subject: [edk2-platfoms][PATCH V2] Update PcdBoardID  of JunctionCity and 
Aowanda platform to 0x81 and 0x82

Fix to resolve the boot error - Change the enum constants values 
TypeBoardPortTemplate, TypeJunctionCity and TypeAowanda in PlatformInfoTypes.h.
Changed PcdBoardId as 0x81 and 0x82 for Junction and Aowanda on respective 
PlatformPkg.dsc.

Cc: Harikrishna Doppalapudi 
Cc: Sureshkumar Ponnusamy 
Cc: Manickavasakam Karpagavinayagam 
Cc: Selvaraj V 
Cc: Ramkumar K 
Cc: Isaac Oram 
Cc: Nate DeSimone 

Signed-off-by: Ramkumar K 
---
 Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc  | 2 +-
 Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc | 2 +-
 Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc
index 8761f8b56a..fa4cfc09db 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc
@@ -49,7 +49,7 @@
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0x80200047  # 
Built in messages:  Error, MTRR, info, load, warn, init
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 # This 
is set to INT3 (0x2) for Simics source level debugging
 !endif
-  gPlatformTokenSpaceGuid.PcdBoardId|0x26
+  gPlatformTokenSpaceGuid.PcdBoardId|0x82

 [PcdsFixedAtBuild.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1900
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc
index 8e226c1552..f934a456dd 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc
@@ -49,7 +49,7 @@
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0x80200047  # 
Built in messages:  Error, MTRR, info, load, warn, init
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 # This 
is set to INT3 (0x2) for Simics source level debugging
 !endif
-  gPlatformTokenSpaceGuid.PcdBoardId|0x25
+  gPlatformTokenSpaceGuid.PcdBoardId|0x81

 [PcdsFixedAtBuild.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1900
diff --git a/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h 
b/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h
index 0c14a2409f..ca96ab3304 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h
+++ b/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h
@@ -69,7 +69,7 @@ typedef enum {
   //
   // Vendor board range currently starts at 0x80
   //
-  TypeBoardPortTemplate,   // 0x80
+  TypeBoardPortTemplate = 0x80,   // 0x80
   TypeJunctionCity,
   TypeAowanda,
   EndOfVendorPlatformTypeEnum
--
2.37.1.windows.1
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.







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




Re: [edk2-devel] [edk2-platfoms][PATCH V2] Update PcdBoardID of JunctionCity and Aowanda platform to 0x81 and 0x82

2023-04-03 Thread Isaac Oram
Reviewed-by: Isaac Oram 

I amended the author to match "Ramkumar K ".  Please 
correct.  I am not sure if it is git config or groups.io that is mismatching.  
You can do git log and see the delta between author and your signoff.

Thanks for fixing the enum.

Regards,
Isaac

-Original Message-
From: Ramkumar Krishnamoorthi  
Sent: Monday, March 27, 2023 4:04 AM
To: devel@edk2.groups.io
Cc: Venkatesan, Selvaraj ; DOPPALAPUDI, HARIKRISHNA 
; KARPAGAVINAYAGAM, MANICKAVASAKAM 
; Ponnusamy, Suresh ; Ramkumar 
Krishnamoorthi ; Oram, Isaac W ; 
Desimone, Nathaniel L 
Subject: [edk2-platfoms][PATCH V2] Update PcdBoardID of JunctionCity and 
Aowanda platform to 0x81 and 0x82

Subject: [edk2-platfoms][PATCH V2] Update PcdBoardID  of JunctionCity and 
Aowanda platform to 0x81 and 0x82

Fix to resolve the boot error - Change the enum constants values 
TypeBoardPortTemplate, TypeJunctionCity and TypeAowanda in PlatformInfoTypes.h.
Changed PcdBoardId as 0x81 and 0x82 for Junction and Aowanda on respective 
PlatformPkg.dsc.

Cc: Harikrishna Doppalapudi 
Cc: Sureshkumar Ponnusamy 
Cc: Manickavasakam Karpagavinayagam 
Cc: Selvaraj V 
Cc: Ramkumar K 
Cc: Isaac Oram 
Cc: Nate DeSimone 

Signed-off-by: Ramkumar K 
---
 Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc  | 2 +-
 Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc | 2 +-
 Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc
index 8761f8b56a..fa4cfc09db 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/Aowanda/PlatformPkg.dsc
@@ -49,7 +49,7 @@
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0x80200047  # 
Built in messages:  Error, MTRR, info, load, warn, init
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 # This 
is set to INT3 (0x2) for Simics source level debugging
 !endif
-  gPlatformTokenSpaceGuid.PcdBoardId|0x26
+  gPlatformTokenSpaceGuid.PcdBoardId|0x82

 [PcdsFixedAtBuild.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1900
diff --git a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc
index 8e226c1552..f934a456dd 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/JunctionCity/PlatformPkg.dsc
@@ -49,7 +49,7 @@
   gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0x80200047  # 
Built in messages:  Error, MTRR, info, load, warn, init
   gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 # This 
is set to INT3 (0x2) for Simics source level debugging
 !endif
-  gPlatformTokenSpaceGuid.PcdBoardId|0x25
+  gPlatformTokenSpaceGuid.PcdBoardId|0x81

 [PcdsFixedAtBuild.X64]
   gPcAtChipsetPkgTokenSpaceGuid.PcdMinimalValidYear|1900
diff --git a/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h 
b/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h
index 0c14a2409f..ca96ab3304 100644
--- a/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h
+++ b/Silicon/Intel/WhitleySiliconPkg/Include/PlatformInfoTypes.h
@@ -69,7 +69,7 @@ typedef enum {
   //
   // Vendor board range currently starts at 0x80
   //
-  TypeBoardPortTemplate,   // 0x80
+  TypeBoardPortTemplate = 0x80,   // 0x80
   TypeJunctionCity,
   TypeAowanda,
   EndOfVendorPlatformTypeEnum
--
2.37.1.windows.1
-The information contained in this message may be confidential and proprietary 
to American Megatrends (AMI). This communication is intended to be read only by 
the individual or entity to whom it is addressed or by their designee. If the 
reader of this message is not the intended recipient, you are on notice that 
any distribution of this message, in any form, is strictly prohibited. Please 
promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and 
then delete or destroy all copies of the transmission.


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




Re: [edk2-devel] [PATCH v4 2/9] ManageabilityPkg: Initial package

2023-03-23 Thread Isaac Oram
Reviewed-by: Isaac Oram 

edk2 convention has changed to naming DSC include files *.dsc.inc.  I plan to 
update all the features sometime in the future.

Manageability.dsc:
I think that the "[LibraryClasses.ARM, LibraryClasses.AARCH64]" section 
contents should be moved to the ManageabilityPkg.dsc for package specific build 
settings.  These seem like ARM libraries not directly related to manageability 
features and we don't really want Manageability.dsc to override any board 
porting choices already made by the board.  And I think that we want these 
includable feature DSC to be scoped to the feature only as much as we can.

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Tuesday, March 21, 2023 7:49 PM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Abdul Lateef Attar ; Nickle 
Wang ; Igor Kulchytskyy ; Abdul Lateef Attar 

Subject: [edk2-devel] [PATCH v4 2/9] ManageabilityPkg: Initial package

From: Abner Chang 

Initial commit of ManageabilityPkg

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Abdul Lateef Attar 
Reviewed-by: Nickle Wang 
---
 .../ManageabilityPkg/ManageabilityPkg.dec | 21 ++
 .../Include/Dsc/Manageability.dsc | 16 
 .../ManageabilityPkg/ManageabilityPkg.dsc | 39 +++
 3 files changed, 76 insertions(+)
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
 create mode 100644 Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
new file mode 100644
index 00..71bd8a0c80
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -0,0 +1,21 @@
+## @file
+# Manageabilty Package
+# This is the package provides the edk2 drivers and libraries # those 
+are related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  DEC_SPECIFICATION = 0x0001001d
+  PACKAGE_NAME  = ManageabilityPkg
+  PACKAGE_GUID  = 36310119-4FB2-4BA3-959D-74C16B849F9E
+  PACKAGE_VERSION   = 1.0
+
+[Includes]
+  Include
+
+[Guids]
+  gManageabilityPkgTokenSpaceGuid = { 0xBDEFFF48, 0x1C31, 0x49CD, { 
+0xA7, 0x6D, 0x92, 0x9E, 0x60, 0xDB, 0xB9, 0xF8 } }
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
new file mode 100644
index 00..2cb63c1ca6
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -0,0 +1,16 @@
+## @file
+# Common libraries for Manageabilty Package # # Copyright (C) 2023 
+Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # This library provides the instrinsic functions generated by a given 
compiler.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
new file mode 100644
index 00..b3586afa07
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -0,0 +1,39 @@
+## @file
+# Manageabilty Package
+# This is the package provides edk2 drivers and libraries # those are 
+related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  PLATFORM_NAME  = ManageabilityPkg
+  PLATFORM_GUID  = 7A98123A-B194-40B6-A863-A52192F6D65D
+  PLATFORM_VERSION   = 1.0
+  DSC_SPECIFICATION  = 0x0001001e
+  OUTPUT_DIRECTORY   = Build/ManageabilityPkg
+  SUPPORTED_ARCHITECTURES= IA32|X64|ARM|AARCH64|RISCV64
+  BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
+  SKUID_IDENTIFIER   = DEFAULT
+
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[PcdsFeatureFlag]
+  #
+  # MinPlatform common include currently required PCD
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
+
+#
+# Include common libraries
+#
+!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
+!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
+
+!include Include/Dsc/Manageability.dsc
+
--
2.37.1.windows.1








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

Re: [edk2-devel] [PATCH v4 9/9] edk2-platforms: Maintainers.txt

2023-03-23 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Leif Lindholm  
Sent: Thursday, March 23, 2023 7:46 AM
To: abner.ch...@amd.com
Cc: devel@edk2.groups.io; Abdul Lateef Attar ; Kinney, 
Michael D ; Gao, Liming ; 
Oram, Isaac W ; Nickle Wang 
Subject: Re: [PATCH v4 9/9] edk2-platforms: Maintainers.txt

On Wed, Mar 22, 2023 at 10:48:40 +0800, abner.ch...@amd.com wrote:
> From: Abner Chang 
> 
> Add maintainer and reviewer of ManageabilityPkg.
> 
> Signed-off-by: Abner Chang 
> Cc: Abdul Lateef Attar 
> Cc: Leif Lindholm 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Isaac Oram 
> Cc: Nickle Wang 
> Reviewed-by: Michael D Kinney 
> Reviewed-by: Nickle Wang 
> ---
>  Maintainers.txt | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt index 
> 7471913660..1871ffaa26 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -164,6 +164,13 @@ F: Features/Intel/UserInterface/
>  M: Dandan Bi 
>  R: Liming Gao 
>  
> +Features/ManageabilityPkg
> +F: Features/ManageabilityPkg/
> +M: Abner Chang 
> +M: Isaac Oram 
> +R: Abdul Lateef Attar 
> +R: Nickle Wang 

Need R-b from Isaac and Abdul.
With that:
Reviewed-by: Leif Lindholm 

> +
>  Platform/Intel
>  F: Platform/Intel/
>  M: Sai Chaganty 
> --
> 2.37.1.windows.1
> 


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




Re: [edk2-devel] [PATCH v3] MdePkg/Include: Add IPMI KCS definitions

2023-03-23 Thread Isaac Oram
Acked-by: Isaac Oram 

-Original Message-
From: abner.ch...@amd.com  
Sent: Thursday, March 23, 2023 6:58 AM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; Nickle Wang 
; Igor Kulchytskyy ; Oram, Isaac W 
; Abdul Lateef Attar 
Subject: [PATCH v3] MdePkg/Include: Add IPMI KCS definitions

From: Abner Chang 

BZ #4354
This change adds definitions for IPMI KCS.

Spec ref:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Acked-by: Isaac Oram 
---
 MdePkg/MdePkg.dec |  6 ++
 MdePkg/Include/IndustryStandard/IpmiKcs.h | 76 +++
 2 files changed, 82 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 
2d643bede1d..5cf04bc0cb6 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -9,6 +9,7 @@
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP  # 
Copyright (c) 2022, Loongson Technology Corporation Limited. All rights 
reserved.  # Copyright (c) 2021 - 2022, Arm Limited. All rights 
reserved.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2342,6 +2343,11 @@
   # @Prompt Memory Address of GuidedExtractHandler Table.
   
gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x100|UINT64|0x30001015
 
+  ## This value is the IPMI KCS Interface I/O base address used to transmit 
IPMI commands.
+  #  The value of 0xca2 is the default I/O base address defined in IPMI 
specification.
+  # @Prompt IPMI KCS Interface I/O Base Address
+  
+ gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress|0xca2|UINT16|0x00
+ 31
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This value is used to set the base address of PCI express hierarchy.
   # @Prompt PCI Express Base Address.
diff --git a/MdePkg/Include/IndustryStandard/IpmiKcs.h 
b/MdePkg/Include/IndustryStandard/IpmiKcs.h
new file mode 100644
index 000..c3baf80bd76
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
@@ -0,0 +1,76 @@
+/** @file
+  IPMI KCS Register Definitions
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  IPMI Specification
+  Version 2.0, Rev. 1.1
+  
+https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi
+-second-gen-interface-spec-v2-rev1-1.html
+**/
+
+#ifndef IPMI_KCS_H_
+#define IPMI_KCS_H_
+
+#define IPMI_KCS_STATUS_REGISTER_OFFSET1
+#define IPMI_KCS_COMMAND_REGISTER_OFFSET   1
+#define IPMI_KCS_DATA_OUT_REGISTER_OFFSET  0
+#define IPMI_KCS_DATA_IN_REGISTER_OFFSET   0
+
+///
+/// IPMI KCS Interface Status Bits
+///
+#define IPMI_KCS_OBF   BIT0
+#define IPMI_KCS_IBF   BIT1
+#define IPMI_KCS_SMS_ATN   BIT2
+#define IPMI_KCS_COMMAND_DATA  BIT3
+#define IPMI_KCS_OEM1  BIT4
+#define IPMI_KCS_OEM2  BIT5
+#define IPMI_KCS_S0BIT6
+#define IPMI_KCS_S1BIT7
+
+///
+/// IPMI KCS Interface Control Codes
+///
+#define IPMI_KCS_CONTROL_CODE_GET_STATUS_ABORT  0x60
+#define IPMI_KCS_CONTROL_CODE_WRITE_START   0x61
+#define IPMI_KCS_CONTROL_CODE_WRITE_END 0x62
+#define IPMI_KCS_CONTROL_CODE_READ  0x68
+
+///
+/// Status Codes
+///
+#define IPMI_KCS_STATUS_NO_ERROR  0x00
+#define IPMI_KCS_STATUS_ABORT 0x01
+#define IPMI_KCS_STATUS_ILLEGAL   0x02
+#define IPMI_KCS_STATUS_LENGTH_ERROR  0x06
+#define IPMI_KCS_STATUS_UNSPECIFIED   0xFF
+
+///
+/// KCS Interface State Bit
+///
+typedef enum {
+  IPMI_KCS_IDLE_STATE = 0,
+  IPMI_KCS_READ_STATE,
+  IPMI_KCS_WRITE_STATE,
+  IPMI_KCS_ERROR_STATE
+} IPMI_KCS_STATE;
+
+///
+/// IPMI KCS Interface Request Format
+///
+typedef struct {
+  UINT8NetFunc;
+  UINT8Command;
+  UINT8Data[0];
+} IPMI_KCS_RESQUEST_HEADER;
+
+///
+/// IPMI KCS Interface Response Format
+///
+typedef struct {
+  UINT8NetFunc;
+  UINT8Command;
+} IPMI_KCS_RESPONSE_HEADER;
+#endif
--
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH edk2-platforms 0/2] IpmiFeaturePkg: small fixes

2023-03-21 Thread Isaac Oram
Series pushed as d7466862b7..4811c37ae3

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, March 21, 2023 1:44 PM
To: Mike Maslenkin 
Cc: devel@edk2.groups.io; Arunk ; Desimone, Nathaniel L 
; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH edk2-platforms 0/2] IpmiFeaturePkg: small fixes

Series Reviewed-by: Isaac Oram 

-Original Message-
From: Mike Maslenkin  
Sent: Saturday, March 11, 2023 3:30 AM
Cc: devel@edk2.groups.io; Mike Maslenkin ; Arunk 
; Oram, Isaac W ; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [PATCH edk2-platforms 0/2] IpmiFeaturePkg: small fixes

During review of a previous patchset with IpmiFeaturePkg changes, Arunk asked 
to add additional update of BmcStatus [*].
Also I found another issue at GetDeviceId() function that could be solved by 
trivial fix.

[*] https://edk2.groups.io/g/devel/message/100945

Signed-off-by: Mike Maslenkin 
Cc: Arunk 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 









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




Re: [edk2-devel] [PATCH edk2-platforms 0/2] IpmiFeaturePkg: small fixes

2023-03-21 Thread Isaac Oram
Series Reviewed-by: Isaac Oram 

-Original Message-
From: Mike Maslenkin  
Sent: Saturday, March 11, 2023 3:30 AM
Cc: devel@edk2.groups.io; Mike Maslenkin ; Arunk 
; Oram, Isaac W ; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [PATCH edk2-platforms 0/2] IpmiFeaturePkg: small fixes

During review of a previous patchset with IpmiFeaturePkg changes, Arunk asked 
to add additional update of BmcStatus [*].
Also I found another issue at GetDeviceId() function that could be solved by 
trivial fix.

[*] https://edk2.groups.io/g/devel/message/100945

Signed-off-by: Mike Maslenkin 
Cc: Arunk 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101504): https://edk2.groups.io/g/devel/message/101504
Mute This Topic: https://groups.io/mt/97538998/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 1/2][RESEND] PlatformPayloadFeaturePkg.dsc: Add missing packages

2023-03-21 Thread Isaac Oram
Pushed as 8efa4f42b5..d7466862b7

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, March 21, 2023 1:09 PM
To: devel@edk2.groups.io; Rudolph, Patrick 
Cc: quic_llind...@quicinc.com; Kinney, Michael D ; 
Chaganty, Rangasai V ; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Guo 
Subject: Re: [edk2-devel] [edk2-platforms][PATCH 1/2][RESEND] 
PlatformPayloadFeaturePkg.dsc: Add missing packages

Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Patrick Rudolph
Sent: Monday, March 20, 2023 1:53 AM
Cc: devel@edk2.groups.io; quic_llind...@quicinc.com; Kinney, Michael D 
; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2][RESEND] 
PlatformPayloadFeaturePkg.dsc: Add missing packages

Add package that are required to build PlatformPayloadFeaturePkg.

Test:
Running python 
Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
generates a FV.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4359
---
 Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc 
b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
index e36e5d6e..9dcd1da6 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
+++ b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg
+++ .dsc
@@ -33,6 +33,9 @@
  [Packages]   MinPlatformPkg/MinPlatformPkg.dec+  MdePkg/MdePkg.dec+  
MdeModulePkg/MdeModulePkg.dec+  UefiPayloadPkg/UefiPayloadPkg.dec  

 #-- 
2.39.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101414): https://edk2.groups.io/g/devel/message/101414
Mute This Topic: https://groups.io/mt/97727097/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com] 
-=-=-=-=-=-=









-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101503): https://edk2.groups.io/g/devel/message/101503
Mute This Topic: https://groups.io/mt/97727097/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 2/2][RESEND] PlatformPayloadFeaturePkg.py: Add Linux support

2023-03-21 Thread Isaac Oram
Pushed as 8efa4f42b5..d7466862b7

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, March 21, 2023 12:33 PM
To: Rudolph, Patrick 
Cc: devel@edk2.groups.io; quic_llind...@quicinc.com; Kinney, Michael D 
; Chaganty, Rangasai V 
; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Guo 
Subject: Re: [edk2-devel] [edk2-platforms][PATCH 2/2][RESEND] 
PlatformPayloadFeaturePkg.py: Add Linux support

Reviewed-by: Isaac Oram 

In the future, please CC maintainers from 
https://github.com/iworam/edk2-platforms/blob/master/Maintainers.txt in the 
commit messages.


-Original Message-
From: Patrick Rudolph  
Sent: Monday, March 20, 2023 1:53 AM
Cc: devel@edk2.groups.io; quic_llind...@quicinc.com; Kinney, Michael D 
; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: [edk2-platforms][PATCH 2/2][RESEND] PlatformPayloadFeaturePkg.py: Add 
Linux support

- Use OS specific path seperator instead of hardcoding ';'
- Fix case of build artifact FV/PLATFORMPAYLOAD.Fv

Test:
python Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
works on Linux.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4358
---
 Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py 
b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
index 2fbb8215..51aa8de5 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
+++ b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
@@ -38,7 +38,7 @@ def BuildUniversalPayload(Args, MacroList):
 # Find universal UEFI payload build build script

 #

 Edk2PayloadBuildScript = 
os.path.normpath("UefiPayloadPkg/UniversalPayloadBuild.py")

-for package_path in os.environ['PACKAGES_PATH'].split(';'):

+for package_path in os.environ['PACKAGES_PATH'].split(os.pathsep):

 if os.path.exists (os.path.join (package_path, 
Edk2PayloadBuildScript)):

 Edk2PayloadBuildScript = os.path.join (package_path, 
Edk2PayloadBuildScript)

 break

@@ -49,7 +49,7 @@ def BuildUniversalPayload(Args, MacroList):
 BuildDir   = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/UefiPayloadPkgX64"))

 PlatformFvReportPath   = os.path.join(BuildDir, 
"PlatformPayloadReport.txt")

 UniversalUefiPld   = os.path.join(BuildDir, 'UniversalPayload.elf')

-PlatformFv = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/PlatformPayloadFeaturePkg"), 
f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/PlatformPayload.Fv"))

+PlatformFv = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/PlatformPayloadFeaturePkg"), 
f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/PLATFORMPAYLOAD.Fv"))

 

 if "CLANG_BIN" in os.environ:

 LlvmObjcopyPath = os.path.join(os.environ["CLANG_BIN"], "llvm-objcopy")

-- 
2.39.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101502): https://edk2.groups.io/g/devel/message/101502
Mute This Topic: https://groups.io/mt/97727098/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 1/2][RESEND] PlatformPayloadFeaturePkg.dsc: Add missing packages

2023-03-21 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Patrick Rudolph
Sent: Monday, March 20, 2023 1:53 AM
Cc: devel@edk2.groups.io; quic_llind...@quicinc.com; Kinney, Michael D 
; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: [edk2-devel] [edk2-platforms][PATCH 1/2][RESEND] 
PlatformPayloadFeaturePkg.dsc: Add missing packages

Add package that are required to build PlatformPayloadFeaturePkg.

Test:
Running python 
Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
generates a FV.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4359
---
 Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc 
b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
index e36e5d6e..9dcd1da6 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.dsc
+++ b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg
+++ .dsc
@@ -33,6 +33,9 @@
  [Packages]   MinPlatformPkg/MinPlatformPkg.dec+  MdePkg/MdePkg.dec+  
MdeModulePkg/MdeModulePkg.dec+  UefiPayloadPkg/UefiPayloadPkg.dec  

 #-- 
2.39.1



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101414): https://edk2.groups.io/g/devel/message/101414
Mute This Topic: https://groups.io/mt/97727097/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com] 
-=-=-=-=-=-=




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101499): https://edk2.groups.io/g/devel/message/101499
Mute This Topic: https://groups.io/mt/97727097/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 2/2][RESEND] PlatformPayloadFeaturePkg.py: Add Linux support

2023-03-21 Thread Isaac Oram
Reviewed-by: Isaac Oram 

In the future, please CC maintainers from 
https://github.com/iworam/edk2-platforms/blob/master/Maintainers.txt in the 
commit messages.


-Original Message-
From: Patrick Rudolph  
Sent: Monday, March 20, 2023 1:53 AM
Cc: devel@edk2.groups.io; quic_llind...@quicinc.com; Kinney, Michael D 
; Chaganty, Rangasai V 
; Oram, Isaac W ; 
Desimone, Nathaniel L ; Gao, Liming 

Subject: [edk2-platforms][PATCH 2/2][RESEND] PlatformPayloadFeaturePkg.py: Add 
Linux support

- Use OS specific path seperator instead of hardcoding ';'
- Fix case of build artifact FV/PLATFORMPAYLOAD.Fv

Test:
python Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
works on Linux.

Signed-off-by: Patrick Rudolph 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4358
---
 Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py 
b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
index 2fbb8215..51aa8de5 100644
--- a/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
+++ b/Features/Intel/PlatformPayloadFeaturePkg/PlatformPayloadFeaturePkg.py
@@ -38,7 +38,7 @@ def BuildUniversalPayload(Args, MacroList):
 # Find universal UEFI payload build build script

 #

 Edk2PayloadBuildScript = 
os.path.normpath("UefiPayloadPkg/UniversalPayloadBuild.py")

-for package_path in os.environ['PACKAGES_PATH'].split(';'):

+for package_path in os.environ['PACKAGES_PATH'].split(os.pathsep):

 if os.path.exists (os.path.join (package_path, 
Edk2PayloadBuildScript)):

 Edk2PayloadBuildScript = os.path.join (package_path, 
Edk2PayloadBuildScript)

 break

@@ -49,7 +49,7 @@ def BuildUniversalPayload(Args, MacroList):
 BuildDir   = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/UefiPayloadPkgX64"))

 PlatformFvReportPath   = os.path.join(BuildDir, 
"PlatformPayloadReport.txt")

 UniversalUefiPld   = os.path.join(BuildDir, 'UniversalPayload.elf')

-PlatformFv = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/PlatformPayloadFeaturePkg"), 
f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/PlatformPayload.Fv"))

+PlatformFv = os.path.join(os.environ['WORKSPACE'], 
os.path.normpath("Build/PlatformPayloadFeaturePkg"), 
f"{BuildTarget}_{ToolChain}", os.path.normpath("FV/PLATFORMPAYLOAD.Fv"))

 

 if "CLANG_BIN" in os.environ:

 LlvmObjcopyPath = os.path.join(os.environ["CLANG_BIN"], "llvm-objcopy")

-- 
2.39.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101498): https://edk2.groups.io/g/devel/message/101498
Mute This Topic: https://groups.io/mt/97727098/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 V1 1/1] MinPlatformPkg/Build: Add standalone MM build rules

2023-03-15 Thread Isaac Oram
Adds MM_STANDALONE_CORE and MM_STANDALONE FFS file
construction rules.

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Isaac Oram 
---
 .../MinPlatformPkg/Include/Fdf/RuleInclude.fdf| 15 +++
 1 file changed, 15 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf 
b/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
index 85e6f773df..a737465d04 100644
--- a/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
+++ b/Platform/Intel/MinPlatformPkg/Include/Fdf/RuleInclude.fdf
@@ -241,3 +241,18 @@
   FILE FV_IMAGE = $(NAMED_GUID) {
 FV_IMAGE FV  |.fv
   }
+
+[Rule.Common.MM_CORE_STANDALONE]
+  FILE MM_CORE_STANDALONE = $(NAMED_GUID) {
+PE32 PE32$(INF_OUTPUT)/$(MODULE_NAME).efi
+UI   STRING="$(MODULE_NAME)" Optional
+VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
+  }
+
+[Rule.Common.MM_STANDALONE]
+  FILE MM_STANDALONE = $(NAMED_GUID) {
+SMM_DEPEXSMM_DEPEX Optional  $(INF_OUTPUT)/$(MODULE_NAME).depex
+PE32 PE32$(INF_OUTPUT)/$(MODULE_NAME).efi
+UI   STRING="$(MODULE_NAME)" Optional
+VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
+  }
-- 
2.39.0.windows.1



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




Re: [edk2-devel] [PATCH edk2-platforms 1/2] QemuOpenBoardPkg: Redo PCI bus initialization

2023-03-08 Thread Isaac Oram
We are doing some work to enable CI on edk2-platforms and would like to add 
QemuOpenBoardPkg to the CI list.  I do think that this will become more active 
over time.

Is there a V2 coming?  If so, I found a compiler issue with VS2019 and VS2015.
It doesn't like the local variable PlatformData having the same name as the 
global variable PlatformData.
I would suggest changing the global to mPlatformData.

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Pedro Falcato
Sent: Monday, January 30, 2023 3:28 AM
To: Gerd Hoffmann 
Cc: devel@edk2.groups.io; Oram, Isaac W ; Theo Jehl 

Subject: Re: [edk2-devel] [PATCH edk2-platforms 1/2] QemuOpenBoardPkg: Redo PCI 
bus initialization

On Fri, Jan 13, 2023 at 6:34 AM Gerd Hoffmann  wrote:
>
> > diff --git a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c 
> > b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
> > index 21705256191b..4f312c36016e 100644
> > --- a/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
> > +++ b/Platform/Qemu/QemuOpenBoardPkg/PlatformInitPei/Memory.c
>
> There is OvmfPkg/Library/PlatformInitLib which you could use instead 
> of reinventing the wheel ...
>
> If there are changes needed to make PlatformInitLib work for you feel 
> free to propose patches (same goes for eventually moving code from 
> OvmfPkg/PlatformPei to the Library).

Gerd,

Thank you for the comments.

That is an interesting idea, however I believe OvmfPkg/Library/PlatformInitLib 
is ATM a bit too tightly coupled with the rest of OVMF itself.
For instance, this work was partially inspired by your recent-ish work in 
similar OvmfPkg code and also drove me to remove the dependency on 
PciHostBridgeLib, et al (replacing it with the "standard"
MinPlatformPkg PCI libs). My solution is based on dynamic PCD war-crimes but it 
Just Works(tm).
Changing it in OvmfPkg would be too invasive, I feel; it's not like my solution 
is good or anything.

And because of the way the repos are split, there is no way to currently dedup 
OVMF's PciHostBridgeLib by also making OVMF depend on MinPlatformPkg's, because 
why would there be, right?

Anyway, doing deep changes to OVMF for QemuOpenBoardPkg is uncomfortable for me 
because its place in Tiano is not defined. OVMF and Intel folks have said very 
few things about QOBP.
At the moment, it's the typical "GSoC project stagnating in 
edk2-platforms/-staging" that Tianocore seems to love so much. I don't see much 
point in it being this way.
QemuOBP has been a nice fun exercise in reducing code duplication, which shows 
a lot of promise, but it also doesn't support some of the things OvmfPkg does, 
like PEI-less booting (and TDX/SEV but those could certainly be worked in).

If this kicks off discussion on the future of QemuOpenBoardPkg, I'll be happy.

Until that happens, I am reluctant to change OVMF internals for an obscure QEMU 
PlatformPkg hidden in the best worst repo, edk2-platforms
:)

> > +  // It's worth noting that QEMU also grew an option to change 
> > + lowmem based on the  // user's preferences. Because of all of 
> > + this, it's near impossible to hardcode  // a range, so we grab 
> > + TOLUD (not in a literal way, since QEMU does not implement  // 
> > + that register ;)) and calculate our PCI MMIO based on that. This also 
> > makes it so  // the DSDT built by QEMU will have correct _CRS ranges.
> > +  // hw/pci-host/q35.c explicitly says our PCI hole ranges from [TOLUD, IO 
> > APIC].
> > +  // As far as I can tell, we seem to be allowed to add a 64-bit resource 
> > range anywhere.
>
> There is a etc/reserved-memory-end fw_cfg FwCfg file.  If present it 
> the 64-bit resource range should be placed above the address specified 
> there (qemu uses that to reserve address space if needed, happens for 
> example when you enable memory hotplug).

ACK, will change on v2 (together with Isaac's comments).

> The patch should be splitted up into smaller pieces to make it easier 
> to review the changes.

Agreed, will try to devise a strategy to break it up in smaller, logical chunks.
Again, thank you so much for your time looking at something you're not even a 
maintainer for :))

--
Pedro







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




Re: [edk2-devel] [PATCH edk2-platforms v2 0/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response

2023-03-08 Thread Isaac Oram
Pushed as 90ea518edf..95b58f71d9

From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Wednesday, March 8, 2023 6:43 PM
To: Mike Maslenkin ; devel@edk2.groups.io
Subject: Re: [edk2-devel] [PATCH edk2-platforms v2 0/3] IpmiFeaturePkg: fix 
IPMI GetSelfTest command response

Series Reviewed-by: Isaac Oram 
mailto:isaac.w.o...@intel.com>>



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




Re: [edk2-devel] [PATCH edk2-platforms v2 0/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response

2023-03-08 Thread Isaac Oram
Series Reviewed-by: Isaac Oram 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100893): https://edk2.groups.io/g/devel/message/100893
Mute This Topic: https://groups.io/mt/97485240/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] MinPlatformPkg: Update MinDsdt device name from PCI0 to MinDsdt_PC00

2023-03-07 Thread Isaac Oram
Pushed as 65e001a7f2..90ea518edf

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Tuesday, March 7, 2023 4:28 PM
To: Chiu, Chasel ; Chen, Aryeh ; 
devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Gao, Liming 
; Dong, Eric 
Subject: Re: [edk2-devel] [PATCH v1] MinPlatformPkg: Update MinDsdt device name 
from PCI0 to MinDsdt_PC00

Reviewed-by: Isaac Oram 

-Original Message-
From: Chiu, Chasel  
Sent: Wednesday, March 1, 2023 8:03 AM
To: Chen, Aryeh ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 

Subject: RE: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from PCI0 to 
MinDsdt_PC00


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Chen, Aryeh 
> Sent: Tuesday, February 28, 2023 10:37 PM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Oram, Isaac W 
> ; Gao, Liming ; 
> Dong, Eric 
> Subject: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from 
> PCI0 to
> MinDsdt_PC00
> 
> From: Aryeh Chen 
> 
> Since AlderLake platform client project align Server project to use PC00.
> 
> Signed-off-by: Aryeh Chen 
> Cc: Chasel Chiu ,
> Cc: Nate DeSimone ,
> Cc: Isaac Oram ,
> Cc: Liming Gao ,
> Cc: Eric Dong 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> index 4efb8709ac..d84393d465 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> @@ -23,7 +23,7 @@ DefinitionBlock (
>
> //--- 
>   // Begin PCI
> tree object scope   
> //
> Device(PCI0) { // PCI Bridge "Host Bridge"+Device(PC00) { // PCI 
> Bridge
> "Host Bridge"   Name(_HID, EISAID("PNP0A08")) // Indicates PCI 
> Express/PCI-X
> Mode2 host hierarchy   Name(_CID, EISAID("PNP0A03")) // To support legacy
> OS that doesn't understand the new HID   Name(_SEG, 0)--
> 2.26.2.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100828): https://edk2.groups.io/g/devel/message/100828
Mute This Topic: https://groups.io/mt/97309232/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] MinPlatformPkg: Update MinDsdt device name from PCI0 to MinDsdt_PC00

2023-03-07 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Chiu, Chasel  
Sent: Wednesday, March 1, 2023 8:03 AM
To: Chen, Aryeh ; devel@edk2.groups.io
Cc: Desimone, Nathaniel L ; Oram, Isaac W 
; Gao, Liming ; Dong, Eric 

Subject: RE: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from PCI0 to 
MinDsdt_PC00


Reviewed-by: Chasel Chiu 

Thanks,
Chasel


> -Original Message-
> From: Chen, Aryeh 
> Sent: Tuesday, February 28, 2023 10:37 PM
> To: devel@edk2.groups.io
> Cc: Chen, Aryeh ; Chiu, Chasel 
> ; Desimone, Nathaniel L 
> ; Oram, Isaac W 
> ; Gao, Liming ; 
> Dong, Eric 
> Subject: [PATCH v1] MinPlatformPkg: Update MinDsdt device name from 
> PCI0 to
> MinDsdt_PC00
> 
> From: Aryeh Chen 
> 
> Since AlderLake platform client project align Server project to use PC00.
> 
> Signed-off-by: Aryeh Chen 
> Cc: Chasel Chiu ,
> Cc: Nate DeSimone ,
> Cc: Isaac Oram ,
> Cc: Liming Gao ,
> Cc: Eric Dong 
> ---
>  Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> index 4efb8709ac..d84393d465 100644
> --- a/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> +++ b/Platform/Intel/MinPlatformPkg/Acpi/MinDsdt/MinDsdt.asl
> @@ -23,7 +23,7 @@ DefinitionBlock (
>
> //--- 
>   // Begin PCI
> tree object scope   
> //
> Device(PCI0) { // PCI Bridge "Host Bridge"+Device(PC00) { // PCI 
> Bridge
> "Host Bridge"   Name(_HID, EISAID("PNP0A08")) // Indicates PCI 
> Express/PCI-X
> Mode2 host hierarchy   Name(_CID, EISAID("PNP0A03")) // To support legacy
> OS that doesn't understand the new HID   Name(_SEG, 0)--
> 2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100827): https://edk2.groups.io/g/devel/message/100827
Mute This Topic: https://groups.io/mt/97309232/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 V1 1/1] WhitleyOpenBoardPkg/DSC: Restore AdvancedFeatures

2023-03-07 Thread Isaac Oram
Include for building Advanced Features was mistakenly removed
in an earlier commit.

Cc: Nate DeSimone 
Cc: Chasel Chiu 
Signed-off-by: Isaac Oram 
---
 Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc 
b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
index c784df0144..9452867edb 100644
--- a/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
+++ b/Platform/Intel/WhitleyOpenBoardPkg/PlatformPkg.dsc
@@ -59,6 +59,11 @@
 [PcdsFixedAtBuild]
   gUsb3DebugFeaturePkgTokenSpaceGuid.PcdUsb3DebugPortLibInstance|1
 
+#
+# Include AdvancedFeatures
+#
+!include AdvancedFeaturePkg/Include/AdvancedFeatures.dsc
+
   #
   # Platform On/Off features are defined here
   #
-- 
2.39.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100826): https://edk2.groups.io/g/devel/message/100826
Mute This Topic: https://groups.io/mt/97462761/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] MdePkg/Include: Add IPMI KCS definitions

2023-03-07 Thread Isaac Oram
Acked-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, March 2, 2023 7:17 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; Nickle Wang 
; Igor Kulchytskyy ; Oram, Isaac W 
; Abdul Lateef Attar 
Subject: [edk2-devel] [PATCH V2] MdePkg/Include: Add IPMI KCS definitions

From: Abner Chang 

BZ #4354
This change adds definitions for IPMI KCS.

Spec ref:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
---
 MdePkg/MdePkg.dec |  5 ++
 MdePkg/Include/IndustryStandard/IpmiKcs.h | 77 +++
 2 files changed, 82 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/IpmiKcs.h

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 
3d08f20d15b..0ed033983bf 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -9,6 +9,7 @@
 # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP  # 
Copyright (c) 2022, Loongson Technology Corporation Limited. All rights 
reserved.  # Copyright (c) 2021 - 2022, Arm Limited. All rights 
reserved.
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent  # @@ -2332,6 +2333,10 @@
   # @Prompt Memory Address of GuidedExtractHandler Table.
   
gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress|0x100|UINT64|0x30001015
 
+  ## This value is the IPMI KCS Interface I/O base address used to transmit 
IPMI commands.
+  # @Prompt IPMI KCS Interface I/O Base Address
+  
+ gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsBaseAddress|0xca2|UINT16|0x0031
+
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This value is used to set the base address of PCI express hierarchy.
   # @Prompt PCI Express Base Address.
diff --git a/MdePkg/Include/IndustryStandard/IpmiKcs.h 
b/MdePkg/Include/IndustryStandard/IpmiKcs.h
new file mode 100644
index 000..6533135dcde
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/IpmiKcs.h
@@ -0,0 +1,77 @@
+/** @file
+  IPMI KCS Register Definitions
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  IPMI Specification
+  Version 2.0, Rev. 1.1
+  
+https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi
+-second-gen-interface-spec-v2-rev1-1.html
+**/
+
+#ifndef IPMI_KCS_H_
+#define IPMI_KCS_H_
+
+#define IPMI_KCS_STATUS_REGISTER_OFFSET1
+#define IPMI_KCS_COMMAND_REGISTER_OFFSET   1
+#define IPMI_KCS_DATA_OUT_REGISTER_OFFSET  0
+#define IPMI_KCS_DATA_IN_REGISTER_OFFSET   0
+
+///
+/// IPMI KCS Interface Status Bits
+///
+#define IPMI_KCS_OBF   BIT0
+#define IPMI_KCS_IBF   BIT1
+#define IPMI_KCS_SMS_ATN   BIT2
+#define IPMI_KCS_COMMAND_DATA  BIT3
+#define IPMI_KCS_OEM1  BIT4
+#define IPMI_KCS_OEM2  BIT5
+#define IPMI_KCS_S0BIT6
+#define IPMI_KCS_S1BIT7
+
+///
+/// IPMI KCS Interface Control Codes
+///
+#define IPMI_KCS_CONTROL_CODE_GET_STATUS_ABORT  0x60
+#define IPMI_KCS_CONTROL_CODE_WRITE_START   0x61
+#define IPMI_KCS_CONTROL_CODE_WRITE_END 0x62
+#define IPMI_KCS_CONTROL_CODE_READ  0x68
+
+///
+/// Status Codes
+///
+#define IPMI_KCS_STATUS_NO_ERROR  0x00
+#define IPMI_KCS_STATUS_ABORT 0x01
+#define IPMI_KCS_STATUS_ILLEGAL   0x02
+#define IPMI_KCS_STATUS_LENGTH_ERROR  0x06
+#define IPMI_KCS_STATUS_UNSPECIFIED   0xFF
+
+///
+/// KCS Interface State Bit
+///
+typedef enum {
+  IPMI_KCS_IDLE_STATE = 0,
+  IPMI_KCS_READ_STATE,
+  IPMI_KCS_WRITE_STATE,
+  IPMI_KCS_ERROR_STATE
+} IPMI_KCS_STATE;
+
+///
+/// IPMI KCS Interface Request Format
+///
+typedef struct {
+  UINT8NetFunc;
+  UINT8Command;
+  UINT8Data[0];
+} IPMI_KCS_RESQUEST_HEADER;
+
+///
+/// IPMI KCS Interface Response Format
+///
+typedef struct {
+  UINT8NetFunc;
+  UINT8Command;
+  UINT8CompletionCode;
+} IPMI_KCS_RESPONSE_HEADER;
+#endif
--
2.37.1.windows.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100825): https://edk2.groups.io/g/devel/message/100825
Mute This Topic: https://groups.io/mt/97355098/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] MdePkg/Include: Add DMTF MCTP definitions

2023-03-07 Thread Isaac Oram
Acked-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chang, Abner via 
groups.io
Sent: Thursday, March 2, 2023 7:25 PM
To: devel@edk2.groups.io
Cc: Kinney, Michael D ; Gao, Liming 
; Liu, Zhiguang ; Nickle Wang 
; Igor Kulchytskyy ; Oram, Isaac W 
; Abdul Lateef Attar 
Subject: [edk2-devel] [PATCH V2] MdePkg/Include: Add DMTF MCTP definitions

From: Abner Chang 

BZ #4355
This change adds definitions for DMTF MCTP base specification.

Spec ref:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0236_1.3.1.pdf

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
---
 MdePkg/Include/IndustryStandard/Mctp.h | 114 +
 1 file changed, 114 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/Mctp.h

diff --git a/MdePkg/Include/IndustryStandard/Mctp.h 
b/MdePkg/Include/IndustryStandard/Mctp.h
new file mode 100644
index 000..b71063a6502
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Mctp.h
@@ -0,0 +1,114 @@
+/** @file
+
+  The definitions of DMTF Management Component Transport Protocol 
+ (MCTP)  Base Specification.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+ reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  DMTF Management Component Transport Protocol (MCTP) Base 
+Specification
+  Version 1.3.1
+  
+https://www.dmtf.org/sites/default/files/standards/documents/DSP0236_1.
+3.1.pdf
+**/
+
+#ifndef MCTP_H_
+#define MCTP_H_
+
+///
+/// Definitions of endpoint ID
+///
+#define MCTP_NULL_DESTINATION_ENDPOINT_ID  0
+#define MCTP_NULL_SOURCE_ENDPOINT_ID   0
+#define MCTP_RESERVED_ENDPOINT_START_ID1
+#define MCTP_RESERVED_ENDPOINT_END_ID  7
+#define MCTP_BROADCAST_ENDPOINT_ID 0xFF
+
+// Minimum transmission size is 64 bytes.
+#define MCTP_BASELINE_MINIMUM_UNIT_TRANSMISSION_SIZE  0x40
+
+///
+/// The 32-bit Header of MCTP packet.
+///
+typedef union {
+  struct {
+UINT8Reserved  : 4; ///< Reserved for future definitions.
+UINT8HeaderVersion : 4; ///< The version of header.
+UINT8DestinationEndpointId : 8; ///< Destination endpoint Id (EID).
+UINT8SourceEndpointId  : 8; ///< Source endpoint Id (EID)
+UINT8StartOfMessage: 1; ///< Indicates the first packet of 
message.
+UINT8EndOfMessage  : 1; ///< Indicates the last packet of 
message.
+UINT8PacketSequence: 2; ///< Sequence number increments modulo 
4 on
+///< each packet.
+UINT8TagOwner  : 1; ///< Tag owner identifies the message 
was
+///< originated by the source EID or
+///< destination EID.
+UINT8MessageTag: 3; ///< Check the MCTP Base specification 
for the
+///< usages.
+  } Bits;
+  UINT32Header;
+} MCTP_HEADER;
+
+///
+/// MCTP Control Commands
+///
+#define   MCTP_CONTROL_RESERVED0x00
+#define   MCTP_CONTROL_SET_ENDPOINT_ID 0x01
+#define   MCTP_CONTROL_GET_ENDPOINT_ID 0x02
+#define   MCTP_CONTROL_GET_ENDPOINT_UUID   0x03
+#define   MCTP_CONTROL_GET_MCTP_VERSION_SUPPORT0x04
+#define   MCTP_CONTROL_GET_MESSAGE_TYPE_SUPPORT0x05
+#define   MCTP_CONTROL_GET_VENDOR_DEFINED_MESSAGE_SUPPORT  0x06
+#define   MCTP_CONTROL_RESOLVE_ENDPOINT_ID 0x07
+#define   MCTP_CONTROL_ALLOCATE_ENDPOINT_IDS   0x08
+#define   MCTP_CONTROL_ROUTING_INFORMATION_UPDATE  0x09
+#define   MCTP_CONTROL_GET_ROUTINE_TABLE_ENTRIES   0x0A
+#define   MCTP_CONTROL_PREPARE_FOR_ENDPOINT_DISCOVERY  0x0B
+#define   MCTP_CONTROL_ENDPOINT_DISCOVERY  0x0C
+#define   MCTP_CONTROL_DISCOVERY_NOTIFY0x0D
+#define   MCTP_CONTROL_GET_NETWORK_ID  0x0E
+#define   MCTP_CONTROL_QUERY_HOP   0x0F
+#define   MCTP_CONTROL_RESOLVE_UUID0x10
+#define   MCTP_CONTROL_QUERY_RATE_LIMIT0x11
+#define   MCTP_CONTROL_REQUEST_TX_RATE_LIMIT   0x12
+#define   MCTP_CONTROL_UPDATE_RATE_LIMIT   0x13
+#define   MCTP_CONTROL_QUERY_SUPPORTED_INTERFACES  0x14
+#define   MCTP_CONTROL_TRANSPORT_SPECIFIC_START0xF0
+#define   MCTP_CONTROL_TRANSPORT_SPECIFIC_END  0xFF
+
+///
+/// MCTP Control Message Completion Codes ///
+#define   MCTP_CONTROL_COMPLETION_CODES_SUCCESS 0x00
+#define   MCTP_CONTROL_COMPLETION_CODES_ERROR   0x01
+#define   MCTP_CONTROL_COMPLETION_CODES_ERROR_INVALID_DATA  0x02
+#define   MCTP_CONTROL_COMPLETION_CODE

[edk2-devel][edk2-platforms][PATCH V1 1/1] IpmiFeaturePkg/Build: Fix DSC organization issues

2023-03-07 Thread Isaac Oram
Move libraries from [Components] to [LibraryClasses]
Match build to library supported build types
Add missing SmmGenericIpmi.inf driver
Move common library include to package build as this feature
should not choose common libraries for board use

Cc: Nate DeSimone 
Cc: Liming Gao 
Signed-off-by: Isaac Oram 
---
 .../IpmiFeaturePkg/Include/IpmiFeature.dsc| 24 +++
 .../IpmiFeaturePkg/IpmiFeaturePkg.dsc |  1 +
 2 files changed, 10 insertions(+), 15 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
index 237a4fc006..958ed1420d 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.dsc
@@ -31,20 +31,23 @@
 #
 

 
-!include MdePkg/MdeLibs.dsc.inc
-
 [LibraryClasses]
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
 
   IpmiCommandLib|IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf
   
IpmiPlatformHookLib|IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
 
-[LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM]
+[LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM]
   IpmiBaseLib|IpmiFeaturePkg/Library/PeiIpmiBaseLib/PeiIpmiBaseLib.inf
 
-[LibraryClasses.common.DXE_DRIVER,LibraryClasses.common.UEFI_DRIVER]
+[LibraryClasses.common.DXE_DRIVER, LibraryClasses.common.DXE_RUNTIME_DRIVER, 
LibraryClasses.common.UEFI_DRIVER, LibraryClasses.common.UEFI_APPLICATION]
   IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLib/IpmiBaseLib.inf
 
+[LibraryClasses.common.SMM_CORE, LibraryClasses.common.DXE_SMM_DRIVER]
+  IpmiBaseLib|IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf
+
+
+
 

 #
 # Component section - list of all components that need built for this feature.
@@ -70,11 +73,6 @@
   # IPMI Feature Package
   #
 
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
-
   #
   # Add components here that should be included in the package build.
   #
@@ -93,16 +91,10 @@
   # IPMI Feature Package
   #
 
-  # Add library instances here that are not included in package components and 
should be tested
-  # in the package build.
-
-  IpmiFeaturePkg/Library/IpmiPlatformHookLibNull/IpmiPlatformHookLibNull.inf
-
   #
   # Add components here that should be included in the package build.
   #
   IpmiFeaturePkg/GenericIpmi/Dxe/GenericIpmi.inf
-  IpmiFeaturePkg/Library/SmmIpmiBaseLib/SmmIpmiBaseLib.inf
   IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf
   IpmiFeaturePkg/BmcElog/BmcElog.inf
   IpmiFeaturePkg/Frb/FrbDxe.inf
@@ -110,3 +102,5 @@
   IpmiFeaturePkg/IpmiInit/DxeIpmiInit.inf
   IpmiFeaturePkg/OsWdt/OsWdt.inf
   IpmiFeaturePkg/SolStatus/SolStatus.inf
+
+  IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc
index 76d2c45a73..cee7c7e065 100644
--- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/IpmiFeaturePkg.dsc
@@ -38,6 +38,7 @@
 #
 # Include common libraries
 #
+!include MdePkg/MdeLibs.dsc.inc
 !include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
 !include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
 !include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
-- 
2.39.0.windows.1



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




Re: [edk2-devel] [PATCH edk2-platforms 3/3] IpmiFeaturePkg: refine GetSelfTest function

2023-03-07 Thread Isaac Oram
Coding convention does not allow Hungarian notation, 
https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/v/release-2.20/4_naming_conventions/43_identifiers#4.3.3-hungarian-prefixes
Please change pSelfTestResult to SelfTestResult.

Thanks,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Mike Maslenkin
Sent: Monday, February 27, 2023 3:28 PM
To: devel@edk2.groups.io
Cc: Mike Maslenkin ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [edk2-devel] [PATCH edk2-platforms 3/3] IpmiFeaturePkg: refine 
GetSelfTest function

Use predefined type while accessing IPMI command returned data instead of raw 
byte array.

Signed-off-by: Mike Maslenkin 
---
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index 8a0c596a6434..1db47e28c54e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -86,6 +86,8 @@ Returns:
   BOOLEAN bResultFlag = FALSE;   UINT8   TempData[MAX_TEMP_DATA]; +  
IPMI_SELF_TEST_RESULT_RESPONSE *pSelfTestResult;+   //   // Get the SELF TEST 
Results.   //@@ -100,7 +102,8 @@ Returns:
DataSize = sizeof (TempData); -  TempData[1] = 0;+  pSelfTestResult = 
(IPMI_SELF_TEST_RESULT_RESPONSE*)[0];+  
pSelfTestResult->CompletionCode = 0;do { Status = IpmiSendCommand (@@ 
-114,7 +117,7 @@ Returns:
); if (Status == EFI_SUCCESS) {-   
   switch (TempData[1]) {+  switch (pSelfTestResult->Result) { case 
IPMI_APP_SELFTEST_NO_ERROR: case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: 
case IPMI_APP_SELFTEST_ERROR:@@ -147,7 +150,7 @@ Returns:
 IpmiInstance->BmcStatus = BMC_HARDFAIL; return Status;   } else {-
DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", TempData[1], 
TempData[2]));+DEBUG ((DEBUG_INFO, "[IPMI] BMC self-test result: 
%02X-%02X\n", pSelfTestResult->Result, pSelfTestResult->Param)); // // 
Copy the Self test results to Error Status.  Data will be copied as long as it  
   // does not exceed the size of the ErrorStatus variable.@@ -162,7 +165,7 @@ 
Returns:
 // Check the IPMI defined self test results. // Additional Cases are 
device specific test results. //-switch (TempData[1]) {+switch 
(pSelfTestResult->Result) {   case IPMI_APP_SELFTEST_NO_ERROR:   case 
IPMI_APP_SELFTEST_NOT_IMPLEMENTED: IpmiInstance->BmcStatus = BMC_OK;@@ 
-174,7 +177,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All // other errors are BMC soft failures. //-if 
((TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) 
{+if ((pSelfTestResult->Param & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) { 
  IpmiInstance->BmcStatus = BMC_HARDFAIL; } else {   
IpmiInstance->BmcStatus = BMC_SOFTFAIL;@@ -182,7 +185,7 @@ Returns:
 // // Check if SDR repository is empty and report it if it is. 
//-if ((TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) 
!= 0) {+if ((pSelfTestResult->Param & 
IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {   if (*ErrorCount < 
MAX_SOFT_COUNT) { StatusCodeValue[*ErrorCount] = 
EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | CU_FP_EC_SDR_EMPTY; 
(*ErrorCount)++;-- 
2.35.3



-=-=-=-=-=-=
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100527): https://edk2.groups.io/g/devel/message/100527
Mute This Topic: https://groups.io/mt/97279450/1492418
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [isaac.w.o...@intel.com] 
-=-=-=-=-=-=




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




Re: [edk2-devel] [PATCH edk2-platforms 2/3] IpmiFeaturePkg: remove buffer temporary buffer from BMC instance structure

2023-03-07 Thread Isaac Oram
Mike,

Thanks for the fixes.  There is one more instance using TempData in 
SmmGenericIpmi.c.  Could you please fix that as well?  I noted that it isn't 
currently built/included by the IpmiFeaturePkg.dsc.  I will fix that.

Also, please add maintainers and reviewers for the package to commit messages, 
e.g.:
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Liming Gao 

Regards,
Isaac

-Original Message-
From: Mike Maslenkin  
Sent: Monday, February 27, 2023 3:28 PM
To: devel@edk2.groups.io
Cc: Mike Maslenkin ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [PATCH edk2-platforms 2/3] IpmiFeaturePkg: remove buffer temporary 
buffer from BMC instance structure

There is no point to have temporary buffer in BMC instance data used only for 
synchronous IPMI command as a transfer buffer.
Using local variables make things much simpler.

Signed-off-by: Mike Maslenkin 
---
 .../GenericIpmi/Common/IpmiBmc.c  |  5 ++-
 .../GenericIpmi/Common/IpmiBmcCommon.h|  1 -
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c | 39 ++-
 .../GenericIpmi/Pei/PeiGenericIpmi.c  | 11 +++---
 .../GenericIpmi/Pei/PeiIpmiBmc.c  |  5 ++-
 .../GenericIpmi/Pei/PeiIpmiBmcDef.h   |  1 -
 6 files changed, 33 insertions(+), 29 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
index 03b8174e3786..a6be2f46e84e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmc.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiBmc.c
@@ -101,6 +101,7 @@ Returns:
   IPMI_RESPONSE   *IpmiResponse;   UINT8   RetryCnt = 
IPMI_SEND_COMMAND_MAX_RETRY;   UINT8   Index;+  UINT8   
TempData[MAX_TEMP_DATA];IpmiInstance = 
INSTANCE_FROM_SM_IPMI_BMC_THIS (This); @@ -110,8 +111,8 @@ Returns:
 // response data.  Since the command format is different from the response 
// format, the buffer is cast to both structure definitions. //-
IpmiCommand  = (IPMI_COMMAND*)  IpmiInstance->TempData;-IpmiResponse = 
(IPMI_RESPONSE*) IpmiInstance->TempData;+IpmiCommand  = (IPMI_COMMAND*)  
TempData;+IpmiResponse = (IPMI_RESPONSE*) TempData;  // // Send 
IPMI command to BMCdiff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
index 1e5dfd81f1fb..06eab62aaec9 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Common/IpmiBmcCommon.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Comm
+++ on/IpmiBmcCommon.h
@@ -50,7 +50,6 @@ typedef struct {
   UINTN   Signature;   UINT64  KcsTimeoutPeriod;   
UINT8   SlaveAddress;-  UINT8   
TempData[MAX_TEMP_DATA];   BMC_STATUS  BmcStatus;   UINT64  
ErrorStatus;   UINT8   SoftErrorCount;diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index aeaefaad642e..8a0c596a6434 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -84,6 +84,7 @@ Returns:
   UINT8   *TempPtr;   UINT32  Retries;   BOOLEAN bResultFlag = 
FALSE;+  UINT8   TempData[MAX_TEMP_DATA];//   // Get the SELF TEST 
Results.@@ -97,9 +98,9 @@ Returns:
 Retries = PcdGet8 (PcdIpmiBmcReadyDelayTimer);   } -  DataSize = sizeof 
(IpmiInstance->TempData);+  DataSize = sizeof (TempData); -  
IpmiInstance->TempData[1] = 0;+  TempData[1] = 0;do { Status = 
IpmiSendCommand (@@ -109,11 +110,11 @@ Returns:
IPMI_APP_GET_SELFTEST_RESULTS,NULL, 
   0,-   IpmiInstance->TempData,+   TempData,   
 ); if (Status == EFI_SUCCESS) {-  switch 
(IpmiInstance->TempData[1]) {+  switch (TempData[1]) { case 
IPMI_APP_SELFTEST_NO_ERROR: case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: 
case IPMI_APP_SELFTEST_ERROR:@@ -146,7 +147,7 @@ Returns:
 IpmiInstance->BmcStatus = BMC_HARDFAIL; return Status;   } else {-
DEBUG ((EFI_D_INFO, "[IPMI] BMC self-test result: %02X-%02X\n", 
IpmiInstance->TempData[1], IpmiInstance->TempData[2]));+DEBUG ((DEBUG_INFO, 
"[IPMI] BMC self-test result: %02X-%02X\n", TempData[1], TempData[2])); //  
   // Copy the Self test results to Error Status.  Data will be copied as long 
as it // does not exceed the size of the ErrorStatus variable.@@ -155,13 
+156,13 @@ Returns:
  (Index < DataS

Re: [edk2-devel] [PATCH edk2-platforms 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest command response parsing

2023-03-07 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: Mike Maslenkin  
Sent: Monday, February 27, 2023 3:28 PM
To: devel@edk2.groups.io
Cc: Mike Maslenkin ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Gao, Liming 
Subject: [PATCH edk2-platforms 1/3] IpmiFeaturePkg: fix IPMI GetSelfTest 
command response parsing

Byte 0 of a response contains completion code for the command.
So, the examined data starts from byte 1. It's easy to make a mistake here 
since specification counts response data from 1.

For the "Get Self Test Results" command Intelligent Platform Management 
Interface Specification v2.0 rev 1.1 paragraph 20.4 defines response as:
+-+---+
|byte | data field|
+-+---+
| 1   | Completion Code   |
| |   |
| 2   | 55h =  No error. All Self Tests Passed.   |
| | 56h = Self Test function not implemented in this controller.  |
| | 57h = Corrupted or inaccessible data or devices   |
| | 58h = Fatal hardware error|
| |   |
| 3   | For byte 2 = 55h, 56h, FFh: 00h   |
| | For byte 2 = 58h, all other: Device-specific  |
| | For byte 2 = 57h: self-test error bitfield.   |
+-+---+

Signed-off-by: Mike Maslenkin 
---
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index d788b4886723..aeaefaad642e 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -161,7 +161,7 @@ Returns:
 // Check the IPMI defined self test results. // Additional Cases are 
device specific test results. //-switch (IpmiInstance->TempData[0]) {+  
  switch (IpmiInstance->TempData[1]) {   case IPMI_APP_SELFTEST_NO_ERROR:   
case IPMI_APP_SELFTEST_NOT_IMPLEMENTED: IpmiInstance->BmcStatus = 
BMC_OK;@@ -173,7 +173,7 @@ Returns:
 // BootBlock Firmware corruption, and Operational Firmware Corruption. 
 All // other errors are BMC soft failures. //-if 
((IpmiInstance->TempData[1] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) 
{+if ((IpmiInstance->TempData[2] & (IPMI_APP_SELFTEST_FRU_CORRUPT | 
IPMI_APP_SELFTEST_FW_BOOTBLOCK_CORRUPT | IPMI_APP_SELFTEST_FW_CORRUPT)) != 0) { 
  IpmiInstance->BmcStatus = BMC_HARDFAIL; } else {   
IpmiInstance->BmcStatus = BMC_SOFTFAIL;@@ -181,7 +181,7 @@ Returns:
 // // Check if SDR repository is empty and report it if it is. 
//-if ((IpmiInstance->TempData[1] & 
IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {+if 
((IpmiInstance->TempData[2] & IPMI_APP_SELFTEST_SDR_REPOSITORY_EMPTY) != 0) {   
if (*ErrorCount < MAX_SOFT_COUNT) { 
StatusCodeValue[*ErrorCount] = EFI_COMPUTING_UNIT_FIRMWARE_PROCESSOR | 
CU_FP_EC_SDR_EMPTY; (*ErrorCount)++;-- 
2.35.3



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100814): https://edk2.groups.io/g/devel/message/100814
Mute This Topic: https://groups.io/mt/97279448/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 7/7] edk2-platforms: Maintainers.txt

2023-02-15 Thread Isaac Oram
Please add me as a maintainer.  That gives us redundancy in maintainers and 
will also incentivize me to provide feedback on proprietary implementations 
which could hamper adoption.

Regards,
Isaac

From: Chang, Abner 
Sent: Tuesday, February 7, 2023 10:25 AM
To: devel@edk2.groups.io
Cc: Attar, AbdulLateef (Abdul Lateef) ; Leif 
Lindholm ; Kinney, Michael D 
; Gao, Liming ; Oram, 
Isaac W ; Desimone, Nathaniel L 

Subject: Re: [edk2-devel] [edk2-platforms][PATCH 7/7] edk2-platforms: 
Maintainers.txt


[AMD Official Use Only - General]

Hi Isaac, Nate and Liming,
Please let me know if you would like to be the reviewer for ManageabilityPkg or 
not. I will add you to the maintainer list in the next patch set if you want.
Thanks
Abner


Get Outlook for Android<https://aka.ms/AAb9ysg>

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> on behalf of Chang, Abner 
via groups.io 
mailto:abner.chang=amd@groups.io>>
Sent: Tuesday, February 7, 2023 11:22:36 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>>
Cc: Attar, AbdulLateef (Abdul Lateef) 
mailto:abdullateef.at...@amd.com>>; Leif Lindholm 
mailto:quic_llind...@quicinc.com>>; Michael D Kinney 
mailto:michael.d.kin...@intel.com>>; Liming Gao 
mailto:gaolim...@byosoft.com.cn>>; Isaac Oram 
mailto:isaac.w.o...@intel.com>>; Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>
Subject: [edk2-devel] [edk2-platforms][PATCH 7/7] edk2-platforms: 
Maintainers.txt

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.


From: Abner Chang mailto:abner.ch...@amd.com>>

Add maintainer and reviewer of ManageabilityPkg.

Signed-off-by: Abner Chang mailto:abner.ch...@amd.com>>
Cc: Abdul Lateef Attar mailto:abdat...@amd.com>>
Cc: Leif Lindholm mailto:quic_llind...@quicinc.com>>
Cc: Michael D Kinney 
mailto:michael.d.kin...@intel.com>>
Cc: Liming Gao mailto:gaolim...@byosoft.com.cn>>
Cc: Isaac Oram mailto:isaac.w.o...@intel.com>>
Cc: Nate DeSimone 
mailto:nathaniel.l.desim...@intel.com>>
---
 Maintainers.txt | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index da1c98638d..1bd7838d61 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -164,6 +164,11 @@ F: Features/Intel/UserInterface/
 M: Dandan Bi mailto:dandan...@intel.com>>
 R: Liming Gao mailto:gaolim...@byosoft.com.cn>>

+Features/ManageabilityPkg
+F: Features/ManageabilityPkg/
+M: Abner Chang mailto:abner.ch...@amd.com>>
+R: Abdul Lateef Attar 
mailto:abdullateef.at...@amd.com>>
+
 Platform/Intel
 F: Platform/Intel/
 M: Sai Chaganty 
mailto:rangasai.v.chaga...@intel.com>>
@@ -326,10 +331,10 @@ R: Yuwei Chen 
mailto:yuwei.c...@intel.com>>

 Loongson platforms
 F: Platform/Loongson/
-M: Bibo Mao mailto:maob...@loongson.cn>>
+M: Bibo Mao mailto:maob...@loongson.cn>>
 M: Xianglai li mailto:lixiang...@loongson.cn>>
 M: Chao Li mailto:lic...@loongson.cn>>
-
+
 Marvell platforms and silicon
 F: Platform/Marvell/
 F: Platform/SolidRun/Armada80x0McBin/
--
2.37.1.windows.1







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100258): https://edk2.groups.io/g/devel/message/100258
Mute This Topic: https://groups.io/mt/96813351/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 4/7] ManageabilityPkg: Initial package

2023-02-15 Thread Isaac Oram
I think that the ManageabilityPkg shouldn't have a file like CommonLibs.dsc.inc 
that defines commonly used content.  It is the wrong scope.  I would prefer to 
use the MinPlatformPkg content on the theory that it will move MinPlatformPkg 
to a more general location once it is in wider use.

Put another way, either we want many packages to include it, which is weird 
since the content isn't scoped to this package, or it is just for this package 
and others shouldn't include it, in which case, separating it from 
ManageabilityPkg.dsc via an include doesn't add anything.

If you don't want to use MinPlatformPkg then I would suggest following the 
original buildable package convention and put this content in the 
ManageabilityPkg/ManageabilityPkg.dsc.

"Manageabilty" is misspelled in a number of places in these files.

Regards,
Isaac

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, February 7, 2023 8:23 AM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Abdul Lateef Attar ; Nickle 
Wang ; Igor Kulchytskyy 
Subject: [edk2-platforms][PATCH 4/7] ManageabilityPkg: Initial package

From: Abner Chang 

Initial commit of ManageabilityPkg

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../ManageabilityPkg/ManageabilityPkg.dec | 18 +
 .../Include/CommonLibs.dsc.inc| 40 +++
 .../ManageabilityPkg/ManageabilityPkg.dsc | 23 +++
 3 files changed, 81 insertions(+)
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dec
 create mode 100644 Features/ManageabilityPkg/Include/CommonLibs.dsc.inc
 create mode 100644 Features/ManageabilityPkg/ManageabilityPkg.dsc

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
new file mode 100644
index 00..8a0e28f50b
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -0,0 +1,18 @@
+## @file
+# Manageabilty Package
+# This is the package provides the edk2 drivers and libraries # those 
+are related to the platform management.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[Defines]
+  DEC_SPECIFICATION = 0x0001001d
+  PACKAGE_NAME  = ManageabilityPkg
+  PACKAGE_GUID  = 36310119-4FB2-4BA3-959D-74C16B849F9E
+  PACKAGE_VERSION   = 1.0
+
+[Includes]
+  Include
diff --git a/Features/ManageabilityPkg/Include/CommonLibs.dsc.inc 
b/Features/ManageabilityPkg/Include/CommonLibs.dsc.inc
new file mode 100644
index 00..2dc2d07f17
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/CommonLibs.dsc.inc
@@ -0,0 +1,40 @@
+## @file
+# Common libraries for Manageabilty Package # # Copyright (C) 2023 
+Advanced Micro Devices, Inc. All rights reserved. # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+[LibraryClasses]
+  
+UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntr
+yPoint.inf
+  
+UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBo
+otServicesTableLib.inf
+  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+  DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  
+DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Base
+DebugPrintErrorLevelLib.inf
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  
+MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAl
+locationLib.inf
+
+[LibraryClasses.common.PEIM]
+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+  
+PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt
+/PeiServicesTablePointerLibIdt.inf
+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+  
+MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllo
+cationLib.inf
+  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
+
+[LibraryClasses.common.DXE_SMM_DRIVER]
+  
+SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTable
+Lib.inf
+  
+MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllo
+cationLib.inf
+
+[LibraryClasses.ARM, LibraryClasses.AARCH64]
+  #
+  # This library provides the instrinsic functions generated by a given 
compiler.
+  #
+  NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf
+  NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf
+  ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf
+
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
new file mode 100644
index 00..9ae398277f
--- /dev/null
+++ b/Features/ManageabilityPkg/ManageabilityPkg.d

Re: [edk2-devel] [edk2-platforms][PATCH 5/7] ManageabilityPkg: Implement Ipmi Protocol/Ppi

2023-02-15 Thread Isaac Oram
I find the code to be misleading because source code looks like it is using the 
edk2 API but it actually invokes the IpmiFeaturePkg implementations of the 
IpmiTransport* API.  we end up with things like a depex that says TRUE, but 
really includes a library that carries a dependency on a different protocol 
than the one in the INF.  It includes IpmiProtocol.h, but actually invokes a 
library that locates and uses IpmiTransportProtocol.h.

I think that we should have these implement IpmiPpi.h and IpmiProtocol.h 
instead of chaining them into the old implementation.  

If we don't want to implement them directly, I would prefer to obviously have 
the IpmiPpi and IpmiProtocol implementations look up and invoke 
IpmiTransportPpi and IpmiTransportProtocol directly so that the code is obvious 
about what it is doing.  It seems that IpmiBaseLib only abstracts the phase for 
calling code.  Is there any other value for phase specific code to obfuscate 
what is really happening by adding the library layer?  If the library is there 
to avoid source code collisions, then I guess detailed commenting at all the 
misleading places is probably the only answer besides implementing directly.

Regards,
Isaac

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, February 7, 2023 8:23 AM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Abdul Lateef Attar ; Nickle 
Wang ; Igor Kulchytskyy 
Subject: [edk2-platforms][PATCH 5/7] ManageabilityPkg: Implement Ipmi 
Protocol/Ppi

From: Abner Chang 

Add Ipmi Protocol/Ppi implementation. The underlying implementation is provided 
by IpmiBaseLib.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  37 +++
 .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  38 +++
 .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  40 +++
 .../Universal/IpmiProtocol/Dxe/IpmiProtocol.c |  97 +
 .../Universal/IpmiProtocol/Pei/IpmiPpi.c  | 102 ++
 .../Universal/IpmiProtocol/Smm/IpmiProtocol.c |  98 +
 6 files changed, 412 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolSmm.inf
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocol.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpi.c
 create mode 100644 
Features/ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c

diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolDxe.inf
new file mode 100644
index 00..0737a5ad8f
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Dxe/IpmiProtocolD
+++ xe.inf
@@ -0,0 +1,37 @@
+## @file
+# IPMI Protocol DXE Driver.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+[Defines]
+  INF_VERSION= 0x0001001d
+  BASE_NAME  = IpmiDxe
+  FILE_GUID  = BC41B0C2-9D8A-42B5-A28F-02CE0D4A6C28
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  ENTRY_POINT= IpmiEntry
+
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  IpmiProtocol.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  IpmiFeaturePkg/IpmiFeaturePkg.dec
+
+[LibraryClasses]
+  IpmiBaseLib
+  UefiDriverEntryPoint
+  UefiBootServicesTableLib
+
+[Protocols]
+  gIpmiProtocolGuid   # PROTOCOL ALWAYS_PRODUCED
+
+[Depex]
+  TRUE
diff --git 
a/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf 
b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.inf
new file mode 100644
index 00..7ba8584f84
--- /dev/null
+++ b/Features/ManageabilityPkg/Universal/IpmiProtocol/Pei/IpmiPpiPei.in
+++ f
@@ -0,0 +1,38 @@
+## @file
+# IPMI Protocol PEI Driver.
+#
+# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights 
+reserved. # SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+[Defines]
+  INF_VERSION= 0x0001001d
+  BASE_NAME  = IpmiPei
+  FILE_GUID  = 7832F989-CB72-4715-ADCA-35C0B031856C
+  MODULE_TYPE= PEIM
+  VERSION_STRING = 1.0
+  ENTRY_POINT= IpmiEntry
+
+#
+# The following information is for reference only and not required by the 
build tools.
+#
+#  VALID_ARCHITECTURES   = IA32 X64 ARM AARCH64
+#
+
+[Sources]
+  IpmiPpi.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec

Re: [edk2-devel] [edk2-platforms][PATCH 3/7] ManageabilityPkg: Add Readme file

2023-02-15 Thread Isaac Oram
Nits, not blocking (I don't know how pedantic the community is and if we care 
about these insignificant details, obviously lots of code doesn't):
- I don't find that saying it is the "EDK2" Manageability Package adds much 
value/clarity.  I would strip out "EDK2" from the discussion, except where it 
is clarifying.  My reasoning is that we may expand with content that isn't 
really edk2 content in some senses.  We might want to put more content in here 
and I wouldn't want people to thing it doesn't belong because of the name.
- "for the industry platform management standards".  I stumbled on this 
sentance, maybe removing "the" would be clearer.
- "PACKAGES_PATH must contains the path".  "contains" should probably be the 
singular "contain".

Regards,
Isaac

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, February 7, 2023 8:23 AM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Nickle Wang ; Igor 
Kulchytskyy ; Abdul Lateef Attar 
Subject: [edk2-platforms][PATCH 3/7] ManageabilityPkg: Add Readme file

From: Abner Chang 

Add Readme file of edk2 platform ManageabilityPkg.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
---
 Features/ManageabilityPkg/Readme.md | 37 +
 1 file changed, 37 insertions(+)
 create mode 100644 Features/ManageabilityPkg/Readme.md

diff --git a/Features/ManageabilityPkg/Readme.md 
b/Features/ManageabilityPkg/Readme.md
new file mode 100644
index 00..880aa4aa48
--- /dev/null
+++ b/Features/ManageabilityPkg/Readme.md
@@ -0,0 +1,37 @@
+# EDK2 Manageability Package
+
+The edk2 Manageability package is introduced to provide edk2 drivers 
+and libraries for the industry platform management standards, such as 
+PLDM (Platform Level Data Model), MCTP (Management Component Transfer 
+Protocol) and IPMI (Intelligent Platform Management Interface). The 
+framework of edk2 Manageability package is designed to flexibly support 
+transports for the above industry standards, the transports such as KCS or I2C 
for IPMI, PCI VDM (Vendor Defined Message), I2C or KCS for MCTP, or the OEM 
proprietary transports.
+
+## EDK2 Manageability Package Driver Stack
+
+Below figure shows the driver stacks which are abstracted to support 
+disparate transports for the platform management.
+![Manageability Package Driver 
+Stack](https://github.com/tianocore/edk2-platforms/blob/master/Features
+/ManageabilityPkg/Documents/Media/ManageabilityDriverStack.svg?raw=true
+)
+
+## Build the Manageability Package
+In order to use the modules provided by ManageabilityPkg, 
+**PACKAGES_PATH** must contains the path to point to [edk2-platform 
Features](https://github.com/tianocore/edk2-platforms/tree/master/Features):
+
+```
+$ export 
+PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-platforms/Feature
+s
+```
+
+Due to the [IPMI Migration 
+Work](#migration-of-ipmi-driver-stack-from-outofbandmanagement) is in 
+progress, an additional package path is required to add to 
+**PACKAGES_PATH** for the reference of IPMI modules those are currently 
+located under
+[OutOfBandManagement](https://github.com/tianocore/edk2-platforms/tree/master/Features/Intel/OutOfBandManagement)
 folder.
+
+```
+$PWD/edk2-platforms/Features/Intel/OutOfBandManagement
+```
+
+## Migration of IPMI Driver Stack from OutOfBandManagement
+
+This is the ongoing task that relocates IPMI modules from 
+OutOfBandManagement to under ManageabilityPkg. This task also requires 
+to abstract the transport layer from IPMI driver in order to flexibly support 
different transports adopted on the platform.
--
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100255): https://edk2.groups.io/g/devel/message/100255
Mute This Topic: https://groups.io/mt/96810543/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 1/7] IpmiFeaturePkg: Rename IpmiSubmitCommand function

2023-02-15 Thread Isaac Oram
I see your point that it is confusing the sets of protocols and libraries that 
have the same function.  I think that the solution should be to decouple them 
so that we can clearly say something like "use edk2 interfaces, IpmiLib, and 
ManageabilityPkg or IpmiFeaturePkg, do not mix the two solutions".  And if at 
some point in the future both are consuming edk2 API and ManageabilityPkg 
shared content, we can remove that comment.

Specific feedback on this commit:
edk2-platforms/Platform/Intel/PurleyOpenBoardPkg/Features/Ipmi/Library/IpmiLibKcs/IpmiLibKcs.c
 (212) has another instance of "IpmiSubmitCommand" that should be changed to 
"IpmiSendCommand" to match the rest of the patch.

We should not make this change.  We should modify the series to not use 
IpmiBaseLib/IpmiTransportPpi/IpmiTransportProtocol.

Regards,
Isaac

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, February 7, 2023 8:23 AM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Nickle Wang ; Igor 
Kulchytskyy ; Abdul Lateef Attar 
Subject: [edk2-platforms][PATCH 1/7] IpmiFeaturePkg: Rename IpmiSubmitCommand 
function

From: Abner Chang 

Rename IpmiSubmitCommand to IpmiSendCommand because the naming of this function 
is confusing with IpmiSubmitCommand defined in IPMI Protocol.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
---
 .../Include/Library/IpmiBaseLib.h |  2 +-
 .../Include/Ppi/IpmiTransportPpi.h|  2 +-
 .../Include/Protocol/IpmiTransportProtocol.h  |  2 +-  
.../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c |  2 +-
 .../GenericIpmi/Pei/PeiGenericIpmi.c  |  2 +-
 .../GenericIpmi/Smm/SmmGenericIpmi.c  |  2 +-
 .../Library/IpmiBaseLib/IpmiBaseLib.c |  4 +--
 .../Library/IpmiBaseLibNull/IpmiBaseLibNull.c |  2 +-
 .../IpmiCommandLib/IpmiCommandLibNetFnApp.c   | 26 +--
 .../IpmiCommandLibNetFnChassis.c  | 12 -
 .../IpmiCommandLibNetFnStorage.c  | 24 -
 .../IpmiCommandLibNetFnTransport.c|  8 +++---
 .../Library/PeiIpmiBaseLib/PeiIpmiBaseLib.c   |  4 +--
 .../Library/SmmIpmiBaseLib/SmmIpmiBaseLib.c   |  4 +--
 .../Ipmi/Library/IpmiLibKcs/IpmiLibKcs.c  | 12 -
 15 files changed, 54 insertions(+), 54 deletions(-)

diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h
index 8487ace5ba..9e77bdad8d 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/IpmiBaseLib.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Library/
+++ IpmiBaseLib.h
@@ -37,7 +37,7 @@ InitializeIpmiBase (
 
 **/
 EFI_STATUS
-IpmiSubmitCommand (
+IpmiSendCommand (
   IN UINT8 NetFunction,
   IN UINT8 Command,
   IN UINT8 *CommandData,
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ppi/IpmiTransportPpi.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ppi/IpmiTransportPpi.h
index 9ecb20f9bf..4bdb5db00b 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ppi/IpmiTransportPpi.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ppi/Ipmi
+++ TransportPpi.h
@@ -59,7 +59,7 @@ EFI_STATUS
 //
 struct _PEI_IPMI_TRANSPORT_PPI {
   UINT64  Revision;
-  PEI_IPMI_SEND_COMMAND   IpmiSubmitCommand;
+  PEI_IPMI_SEND_COMMAND   IpmiSendCommand;
   PEI_IPMI_GET_CHANNEL_STATUS GetBmcStatus;  };
 
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Protocol/IpmiTransportProtocol.h
 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Protocol/IpmiTransportProtocol.h
index 2ee6f98e07..bb17073f06 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Protocol/IpmiTransportProtocol.h
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Protocol
+++ /IpmiTransportProtocol.h
@@ -63,7 +63,7 @@ EFI_STATUS
 //
 struct _IPMI_TRANSPORT {
   UINT64  Revision;
-  IPMI_SEND_COMMAND   IpmiSubmitCommand;
+  IPMI_SEND_COMMAND   IpmiSendCommand;
   IPMI_GET_CHANNEL_STATUS GetBmcStatus;
   EFI_HANDLE  IpmiHandle;
   UINT8   CompletionCode;
diff --git 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c 
b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
index d788b48867..f1f089b575 100644
--- 
a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c
+++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/GenericIpmi/Dxe/
+++ IpmiInit.c
@@ -396,7 +396,7 @@ InitializeIpmiKcsPhysicalLayer (
 mIpmiInstance->Signature= SM_IPMI_BMC_SIGNATURE;
 mIpmiInstance->SlaveAddress

Re: [edk2-devel] [edk2-platforms][PATCH 0/7] Implementation of IPMI Protocol

2023-02-15 Thread Isaac Oram
In looking at the code, this is what I see:

edk2:
There is an IpmiLib.h library class which abstracts the 
IpmiPpi.h/IpmiProtocol.h use
There is an IpmiPpi.h/IpmiProtocol.h which provide an interface to send 
a command "via IPMI"
Current IpmiPpi.h/IpmiProtocol.h implementations use IpmiBaseLib 
library class to send commands

edk2-platforms/Features/Intel/OutOfBandManagement/IpmiFeaturePkg:
There is an IpmiBaseLib library class which abstracts 
IpmiTransportPpi.h/IpmiTransportProtocol.h use
There is an IpmiTransportPpi.h/IpmiTransportProtocol.h that abstracts 
the transport protocol. 
Currently IpmiTransportPpi.h/IpmiTransportProtocol.h are implemented in 
"GenericIpmi".

It appears to me that they are meant to be the same API.  The IpmiFeaturePkg 
transport version adds a function to GetBmcStatus, but it seems like 
IpmiSubmitCommand is meant to be the same function throughout.
I don't find any use of the GetBmcStatus function that is in the IpmiFeaturePkg 
but not the edk2 API.  I am not sure what to make of that.  I think we need 
more feedback from current consumers to resolve that.


When I look at our internal reference version which is an ancestor to the 
edk2-platforms/Feature/Intel.../IpmiFeaturePkg version, there is no use of the 
IpmiLib.h/IpmiPpi.h/IpmiProtocol.h.  There are additional fields in interfaces, 
like GetBmcStatus and data values, but they seem to have been redesigned out 
when open sourcing the interfaces.


My main questions:  
To your understanding, are the IpmiLib.h/IpmiPpi.h/IpmiProtocol.h and the 
IpmiBaseLib.h/IpmiTransportPpi.h/IpmiTransportProtocol.h simply two versions of 
basically the same with a library API abstracting a dynamic phase specific IPMI 
transport API?
Why does ManageabilityPkg use IpmiBaseLib and not IpmiLib?  Is it more than a 
temporary solution?


High level feedback:
0001 - I think we should not make this change.  It impacts any existing users 
for no reason I can justify.
0002 - Not sure - per my understanding of the stack, it doesn't quite fit the 
code in an obvious way.
0003 - More description of the design and duplication, the roles of the library 
class and the PPI/protocols, and the relationship to other IPMI code in the 
repos.
0004 - Minor feedback only
0005/0006 - I think that we should skip the step of using IpmiBaseLib and just 
implement the modified version of GenericIpmi to support the edk2 API stack 
design.

I will send more specific details in response to each commit shortly.

Regards,
Isaac

-Original Message-
From: abner.ch...@amd.com  
Sent: Tuesday, February 7, 2023 8:22 AM
To: devel@edk2.groups.io
Cc: Gao, Liming ; Oram, Isaac W 
; Desimone, Nathaniel L 
; Nickle Wang ; Igor 
Kulchytskyy ; Abdul Lateef Attar ; Leif 
Lindholm ; Kinney, Michael D 

Subject: [edk2-platforms][PATCH 0/7] Implementation of IPMI Protocol

From: Abner Chang 

This change implementes IPMI Protocol and PPI in the new introduced 
ManageabilityPkg (described in below email)
https://edk2.groups.io/g/devel/message/95579?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3ACreated%2C%2CManageability%2C20%2C2%2C0%2C94572748

BZ #4336:
The change also fixes the confusion (Patch 1/7) of IpmiSubmitCommand() deinfed 
in IPMI Transport protocol.

You can skip reviewing on patch 2/7 as it is an image file.

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Abdul Lateef Attar 
Cc: Leif Lindholm 
Cc: Michael D Kinney 

Abner Chang (7):
  IpmiFeaturePkg: Rename IpmiSubmitCommand function
  ManageabilityPkg: Add diagrams
  ManageabilityPkg: Add Readme file
  ManageabilityPkg: Initial package
  ManageabilityPkg: Implement Ipmi Protocol/Ppi
  IpmiProtocol: Add to Manageability Package
  edk2-platforms: Maintainers.txt

 .../ManageabilityPkg/ManageabilityPkg.dec |  18 
 .../Include/CommonLibs.dsc.inc|  52 +
 .../ManageabilityPkg/ManageabilityPkg.dsc |  27 +
 .../IpmiProtocol/Dxe/IpmiProtocolDxe.inf  |  37 +++
 .../Universal/IpmiProtocol/Pei/IpmiPpiPei.inf |  38 +++
 .../IpmiProtocol/Smm/IpmiProtocolSmm.inf  |  40 +++
 .../Include/Library/IpmiBaseLib.h |   2 +-
 .../Include/Ppi/IpmiTransportPpi.h|   2 +-
 .../Include/Protocol/IpmiTransportProtocol.h  |   2 +-
 .../IpmiFeaturePkg/GenericIpmi/Dxe/IpmiInit.c |   2 +-
 .../GenericIpmi/Pei/PeiGenericIpmi.c  |   2 +-
 .../GenericIpmi/Smm/SmmGenericIpmi.c  |   2 +-
 .../Library/IpmiBaseLib/IpmiBaseLib.c |   4 +-
 .../Library/IpmiBaseLibNull/IpmiBaseLibNull.c |   2 +-
 .../IpmiCommandLib/IpmiCommandLibNetFnApp.c   |  26 ++---
 .../IpmiCommandLibNetFnChassis.c  |  12 +--
 .../IpmiCommandLibNetFnStorage.c  |  24 ++---
 .../IpmiCommandLibNetFnTransport.c|   8 +-
 .../Library/PeiIpmiBaseLib/PeiIpmiBaseLib.c   |   4 +-
 .../Library/SmmIpmiBaseLib/SmmIpmiBaseLib.c   |  

Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] SpiFvbServiceStandaloneMm: Add changes for rewrite varstore header

2023-02-09 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: mikub...@linux.microsoft.com  
Sent: Thursday, February 9, 2023 4:52 PM
To: devel@edk2.groups.io
Cc: S, Ashraf Ali ; Oram, Isaac W 
; Chaganty, Rangasai V ; 
Ni, Ray ; Chiu, Chasel 
Subject: [edk2-platforms][PATCH v1 1/1] SpiFvbServiceStandaloneMm: Add changes 
for rewrite varstore header

From: Michael Kubacki 

Updates the Standalone MM module to have the necessary INF changes to build 
with the following two recent commits made to rewrite the the variable store 
header in the MM SPI FVB service.

  - e95c798
  - 88d44c5

Cc: Ashraf Ali S 
Cc: Isaac Oram 
Cc: Rangasai V Chaganty 
Cc: Ray Ni 
Cc: Chasel Chiu 
Signed-off-by: Michael Kubacki 
---
 
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
 | 4 
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec  
 | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
 
b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
index 152cf0036fdb..717b6fc00cc6 100644
--- 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceStandaloneMm.inf
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSe
+++ rviceStandaloneMm.inf
@@ -44,6 +44,8 @@ [Packages]
 [Pcd]
   gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES
   gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES
+  gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType   ## 
SOMETIMES_CONSUMES
+  gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageAdditionalSize ## 
+ CONSUMES
 
 [Sources]
   FvbInfo.c
@@ -60,6 +62,8 @@ [Protocols]
 [Guids]
   gEfiFirmwareFileSystem2Guid   ## CONSUMES
   gEfiSystemNvDataFvGuid## CONSUMES
+  gEfiVariableGuid  ## SOMETIMES_CONSUMES
+  gEfiAuthenticatedVariableGuid ## SOMETIMES_CONSUMES
 
 [Depex]
   TRUE
diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec 
b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index d73a51ca5235..cad22acda496 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -188,7 +188,8 @@ [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, 
PcdsDynamicEx]
 
   ## Define Flash Variable Store type.
   #  When Flash Variable Store corruption happened, the SpiFvbService will 
recreate Variable Store
-  #  with valid header information provided by this PCD value.
+  #  with valid header information provided by this PCD value.
+  #  Note: This PCD must be FixedAtBuild when using Standalone MM.
   #  0: Variable Store is gEfiVariableGuid type.
   #  1: Variable Store is gEfiAuthenticatedVariableGuid type.
   #  Other value: reserved for future use. @@ -199,6 +200,7 @@ 
[PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   #  Platform may implement a Regular variable region and an additional 
region, which will require this PCD
   #  to tell SpiFvbService to include both regions.
   #  Note: This PCD is for compatible with legacy usages that should be 
deprecated.
+  #  Note: This PCD must be FixedAtBuild when using Standalone MM.
   #  The new usage model should define separate regions without implicit 
connections to UEFI Variable or FTW regions.
   #  Example legacy usage is to set this PCD equal to platform 
PcdFlashFvNvStorageEventLogSize.
   #  0: No additional NVS region.
--
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99943): https://edk2.groups.io/g/devel/message/99943
Mute This Topic: https://groups.io/mt/96867025/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 v4] IntelSiliconPkg/SpiFvbServiceSmm: Support Additional NVS region.

2023-02-09 Thread Isaac Oram
Reviewed-by: Isaac Oram  

-Original Message-
From: Chiu, Chasel  
Sent: Thursday, February 9, 2023 10:27 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; S, Ashraf Ali 
; Oram, Isaac W ; Chaganty, 
Rangasai V ; Ni, Ray ; 
Kubacki, Michael 
Subject: [edk2-platforms: PATCH v4] IntelSiliconPkg/SpiFvbServiceSmm: Support 
Additional NVS region.

Platform may implement an additional NVS region following Regular variable 
region and in this case SpiFvbService should include both region size when 
calculating the total NVS region size.

The PcdFlashNvStorageAdditionalSize is for compatible with legacy usages that 
should be deprecated. The new usage model should define separate regions 
without implicit connections to UEFI Variable or FTW regions.

Example NVS flash map for such legacy usage:
Note: PcdFlashNvStorageAdditionalSize is equal to platform
  PcdFlashFvNvStorageEventLogSize.

  ---
  |UEFI Variable|
  ---
  |EventLog | <= this is Additional NVS region
  ---
  |FTW Working  |
  ---
  |FTW Spare|
  ---

Cc: Ashraf Ali S 
Cc: Isaac Oram 
Cc: Rangasai V Chaganty 
Cc: Ray Ni 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
Reviewed-by: Michael Kubacki 
---
 
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c 
| 22 ++  
Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf  
|  7 ---
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec  
 | 11 +++
 3 files changed, 37 insertions(+), 3 deletions(-)

diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c
 
b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c
index 942abf95a6..fcdc715263 100644
--- 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSe
+++ rviceCommon.c
@@ -568,6 +568,28 @@ GetVariableFvInfo (
 return;   } +  //+  // GetVariableFlashNvStorageInfo () only reports 
regular variable region information,+  // if platform implemented an additional 
NVS region following the regular variable region,+  // then both region size 
should be included as overall NVS region size.+  //+  // The below 
PcdFlashNvStorageAdditionalSize is for compatible with legacy usages that 
should be deprecated.+  // The new usage model should define separate regions 
without implicit connections to UEFI Variable or FTW regions.+  //+  // Example 
NVS flash map for such legacy usage:+  // Note: PcdFlashNvStorageAdditionalSize 
is equal to platform PcdFlashFvNvStorageEventLogSize.+  //  ---+  
//  |UEFI Variable|+  //  ---+  //  |EventLog | <= this is 
Additional NVS region+  //  ---+  //  |FTW Working  |+  //  
---+  //  |FTW Spare|+  //  ---+  //+  
NvStoreLength += PcdGet32 (PcdFlashNvStorageAdditionalSize);+   Status = 
GetVariableFlashFtwSpareInfo (, );   if (!EFI_ERROR 
(Status)) { // Stay within the current UINT32 size assumptions in the 
variable stack.diff --git 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf
 
b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf
index 73049eceb2..f4009d8d8c 100644
--- 
a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf
+++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbSe
+++ rviceSmm.inf
@@ -43,9 +43,10 @@
   IntelSiliconPkg/IntelSiliconPkg.dec  [Pcd]-  
gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES-  
gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES-  
gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType   ## 
SOMETIMES_CONSUMES+  gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase 
   ## CONSUMES+  gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize 
   ## CONSUMES+  gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType   
   ## SOMETIMES_CONSUMES+  
gIntelSiliconPkgTokenSpaceGuid.PcdFlashNvStorageAdditionalSize## CONSUMES  
[Sources]   FvbInfo.cdiff --git 
a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec 
b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index 63dae756ad..d73a51ca52 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -194,3 +194,14 @@
   #  Other value: reserved for future use.   # @Prompt Flash Variable 
Store type.   
gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType|0x00|UINT8|0x000E++
  ## Declares Additional NVS Region Size.+  #  Platform may implement a 
Regular variable region and an additional region, which will require this PCD+  
#  to tell SpiFvbService to include both regions.+  #  Note: This PCD is for 
compatible with legacy usages that should be deprecated.+  #  The new usage 

Re: [edk2-devel] [edk2-platforms: PATCH] IntelSiliconPkg/SpiFvbServiceSmm: Support Other NVS variable region.

2023-02-09 Thread Isaac Oram
It is a legacy that exists in current and past implementations.  There is a 
complex arbitrary relationship between the runtime updateable regions in 
existing platform designs.
There is something like:
- Variable store (large)
- Error log (small)
- Fault tolerant working area (>= size of prior 2 regions)
- Fault tolerant metadata (small).
And there are assumptions about ordering and packing built into board flash 
layouts.

I don't think that we should introduce "other variable" as a concept, because 
variable solutions don't support two regions, so it isn't a UEFI variable 
region.  OtherUpdatable might be ok, but still seems confusing to me.
I think that we should add the support for the *ErrorLog* region so that the 
open FvbServices can be used by current implementations.  Then we should 
eliminate the "ErrorLog" use completely.  My thought is that this makes the 
connection to legacy clear.  And also motivates us to eliminate all the 
vestigial references to the ErrorLog in edk2 and edk2-platforms.

New updateable regions should not be hard-coded into this area and should have 
a cleaner solution, as Michael suggests.

I understand if we don't want to support legacy or workarounds, but I think 
that currently adoption and use of the open content is higher priority.  Which 
is why we are requesting this workaround to match "proprietary" FVB services 
behavior.

Regards,
Isaac

-Original Message-
From: Michael Kubacki  
Sent: Thursday, February 9, 2023 7:40 AM
To: devel@edk2.groups.io; Chiu, Chasel 
Cc: S, Ashraf Ali ; Oram, Isaac W 
; Chaganty, Rangasai V ; 
Ni, Ray ; Kubacki, Michael 
Subject: Re: [edk2-devel] [edk2-platforms: PATCH] 
IntelSiliconPkg/SpiFvbServiceSmm: Support Other NVS variable region.

Is there a reason this other content can't go into it's own FV?

On 2/9/2023 12:14 AM, Chiu, Chasel wrote:
> Platform may implement Other NVS variable region following Regular 
> variable region and in this case SpiFvbService should include both 
> region size when calculating the total NVS region size.
> 
> One usage model is EventLog NVS region and there could be others.
> 
> Cc: Ashraf Ali S 
> Cc: Isaac Oram 
> Cc: Rangasai V Chaganty 
> Cc: Ray Ni 
> Cc: Michael Kubacki 
> Signed-off-by: Chasel Chiu 
> ---
>   
> Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceCommon.c
>  | 7 +++
>   
> Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf
>   | 7 ---
>   Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec   
> | 8 
>   3 files changed, 19 insertions(+), 3 deletions(-)
> 
> diff --git 
> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceCommon.c 
> b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceCommon.c
> index 942abf95a6..bcde98131d 100644
> --- 
> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceCommon.c
> +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvb
> +++ ServiceCommon.c
> @@ -568,6 +568,13 @@ GetVariableFvInfo (
>   return;
> 
> }
> 
>   
> 
> +  //
> 
> +  // GetVariableFlashNvStorageInfo () only reports regular variable 
> + region information,
> 
> +  // if platform implemented a separate Other variable region 
> + following the regular variable region,
> 
> +  // the size should be included as overall NVS variable region size.
> 
> +  //
> 
> +  NvStoreLength += PcdGet32 (PcdFlashNvStorageOtherVariableSize);
> 
> +
> 
> Status = GetVariableFlashFtwSpareInfo (, );
> 
> if (!EFI_ERROR (Status)) {
> 
>   // Stay within the current UINT32 size assumptions in the variable 
> stack.
> 
> diff --git 
> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceSmm.inf 
> b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceSmm.inf
> index 73049eceb2..f40067418a 100644
> --- 
> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceSmm.inf
> +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvb
> +++ ServiceSmm.inf
> @@ -43,9 +43,10 @@
> IntelSiliconPkg/IntelSiliconPkg.dec
> 
>   
> 
>   [Pcd]
> 
> -  gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase ## CONSUMES
> 
> -  gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize ## CONSUMES
> 
> -  gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariableStoreType   ## 
> SOMETIMES_CONSUMES
> 
> +  gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase## 
> CONSUMES
> 
> +  gIntelSiliconPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize## 
> CONSUMES
> 
> +  gIntelSiliconPkgTokenSpaceGuid.PcdFlashVariabl

Re: [edk2-devel] [edk2-non-osi][PATCH V1] ASpeed/ASpeedGopBinPkg: Correct all INF_VERSION value

2023-02-08 Thread Isaac Oram
Pushed as bc0b6bf..bd07ad3

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Wednesday, February 8, 2023 5:59 PM
To: devel@edk2.groups.io; tommy_hu...@aspeedtech.com
Cc: a...@kernel.org; Desimone, Nathaniel L ; 
quic_llind...@quicinc.com; Kinney, Michael D ; 
Chen, Ryan ; bmc...@aspeedtech.com
Subject: Re: [edk2-devel] [edk2-non-osi][PATCH V1] ASpeed/ASpeedGopBinPkg: 
Correct all INF_VERSION value

Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Tommy Huang
Sent: Wednesday, February 1, 2023 3:14 AM
To: devel@edk2.groups.io
Cc: a...@kernel.org; Desimone, Nathaniel L ; 
Oram, Isaac W ; quic_llind...@quicinc.com; Kinney, 
Michael D ; Chen, Ryan ; 
bmc...@aspeedtech.com
Subject: [edk2-devel] [edk2-non-osi][PATCH V1] ASpeed/ASpeedGopBinPkg: Correct 
all INF_VERSION value

1. Correct all INF_VERSION value.

Cc: Ard Biesheuvel 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Ryan Chen 
Cc: BMC-SW 

Signed-off-by: Tommy Huang 
---
 Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf | 4 ++--  
Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf 
b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
index d6a674c..6bda488 100644
--- a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
+++ b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
@@ -10,11 +10,11 @@
 ##

 

 [Defines]

-  INF_VERSION= 0x00011302
+  INF_VERSION= 1.29
   BASE_NAME  = ASpeedAst2500GopDxe

   FILE_GUID  = 7F81D838-F91D-4C44-8552-8FB912122FDD

   MODULE_TYPE= UEFI_DRIVER

-  VERSION_STRING = 1.29
+  VERSION_STRING = 1.13.02
 

 [Binaries.AArch64]

   PE32|AArch64/ASpeedAst2500Gop.efi|*

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf 
b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf
index a652ced..3375407 100644
--- a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf
+++ b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf
@@ -9,11 +9,11 @@
 ##
 
 [Defines]
-  INF_VERSION= 0x00011302
+  INF_VERSION= 1.29
   BASE_NAME  = ASpeedAst2600GopDxe
   FILE_GUID  = 36f08597-2a8d-4824-9416-59c810b0d9f3
   MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.29
+  VERSION_STRING = 1.13.02
 
 [Binaries.AArch64]
   PE32|AArch64/ASpeedAst2600Gop.efi|*
--
2.25.1













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




Re: [edk2-devel] [edk2-non-osi][PATCH V1] ASpeed/ASpeedGopBinPkg: Correct all INF_VERSION value

2023-02-08 Thread Isaac Oram
Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Tommy Huang
Sent: Wednesday, February 1, 2023 3:14 AM
To: devel@edk2.groups.io
Cc: a...@kernel.org; Desimone, Nathaniel L ; 
Oram, Isaac W ; quic_llind...@quicinc.com; Kinney, 
Michael D ; Chen, Ryan ; 
bmc...@aspeedtech.com
Subject: [edk2-devel] [edk2-non-osi][PATCH V1] ASpeed/ASpeedGopBinPkg: Correct 
all INF_VERSION value

1. Correct all INF_VERSION value.

Cc: Ard Biesheuvel 
Cc: Isaac Oram 
Cc: Nate DeSimone 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
Cc: Ryan Chen 
Cc: BMC-SW 

Signed-off-by: Tommy Huang 
---
 Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf | 4 ++--  
Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf 
b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
index d6a674c..6bda488 100644
--- a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
+++ b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2500GopDxe.inf
@@ -10,11 +10,11 @@
 ##

 

 [Defines]

-  INF_VERSION= 0x00011302
+  INF_VERSION= 1.29
   BASE_NAME  = ASpeedAst2500GopDxe

   FILE_GUID  = 7F81D838-F91D-4C44-8552-8FB912122FDD

   MODULE_TYPE= UEFI_DRIVER

-  VERSION_STRING = 1.29
+  VERSION_STRING = 1.13.02
 

 [Binaries.AArch64]

   PE32|AArch64/ASpeedAst2500Gop.efi|*

diff --git a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf 
b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf
index a652ced..3375407 100644
--- a/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf
+++ b/Drivers/ASpeed/ASpeedGopBinPkg/ASpeedAst2600GopDxe.inf
@@ -9,11 +9,11 @@
 ##
 
 [Defines]
-  INF_VERSION= 0x00011302
+  INF_VERSION= 1.29
   BASE_NAME  = ASpeedAst2600GopDxe
   FILE_GUID  = 36f08597-2a8d-4824-9416-59c810b0d9f3
   MODULE_TYPE= UEFI_DRIVER
-  VERSION_STRING = 1.29
+  VERSION_STRING = 1.13.02
 
 [Binaries.AArch64]
   PE32|AArch64/ASpeedAst2600Gop.efi|*
--
2.25.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99843): https://edk2.groups.io/g/devel/message/99843
Mute This Topic: https://groups.io/mt/96619610/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 V2 1/1] AdvancedFeaturePkg: Improve sample build instructions

2023-02-08 Thread Isaac Oram
Pushed as 615afc82db..ab4ddecb12

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Thursday, January 19, 2023 7:56 AM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Desimone, Nathaniel L 
; Gao, Liming ; 
Rebecca Cran 
Subject: Re: [edk2-devel][edk2-platforms][PATCH V2 1/1] AdvancedFeaturePkg: 
Improve sample build instructions

Reviewed-by: Rebecca Cran 

On 1/18/23 18:20, Isaac Oram wrote:
> V1: Make the Windows build example current working directory based 
> instead of arbitrary.
> V2: Fix case mismatch in edk2 repo local name.
> 
> Cc: Sai Chaganty 
> Cc: Nate DeSimone 
> Cc: Liming Gao 
> Cc: Rebecca Cran 
> Signed-off-by: Isaac Oram 
> ---
>   Features/Intel/AdvancedFeaturePkg/Readme.md | 14 --
>   1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/Features/Intel/AdvancedFeaturePkg/Readme.md 
> b/Features/Intel/AdvancedFeaturePkg/Readme.md
> index ba50560328..20f456bebe 100644
> --- a/Features/Intel/AdvancedFeaturePkg/Readme.md
> +++ b/Features/Intel/AdvancedFeaturePkg/Readme.md
> @@ -19,19 +19,21 @@ Supported build targets
>   * GCC5
>   
>   ## Windows Example:
> -With current working directory at O:\
> -
>   git clone https://github.com/tianocore/edk2.git
>   
> +git clone https://github.com/tianocore/edk2-non-osi.git
> +
>   git clone https://github.com/tianocore/edk2-platforms.git
>   
> -set workspace=O:\
> +set workspace=%cd%
>   
> -set EDK_TOOLS_PATH=O:\Edk2\BaseTools
> +set EDK_TOOLS_PATH=%workspace%\edk2\BaseTools
>   
> -set 
> packages_path=O:\edk2;O:\edk2-non-osi;O:\edk2-platforms\Platform\Intel
> ;O:\edk2-platforms\Silicon\Intel;O:\edk2-platforms\Platform\Qemu;O:\ed
> k2-platforms\Silicon\Qemu;O:\edk2-platforms\Features\Intel;O:\edk2-pla
> tforms\Features\Intel\Debugging;O:\edk2-platforms\Features\Intel\Netwo
> rk;O:\edk2-platforms\Features\Intel\OutOfBandManagement;O:\edk2-platfo
> rms\Features\Intel\PowerManagement;O:\edk2-platforms\Features\Intel\Sy
> stemInformation;O:\edk2-platforms\Features\Intel\UserInterface
> +set 
> +packages_path=%workspace%\edk2;%workspace%\edk2-non-osi;%workspace%\e
> +dk2-platforms\Platform\Intel;%workspace%\edk2-platforms\Silicon\Intel
> +;%workspace%\edk2-platforms\Platform\Qemu;%workspace%\edk2-platforms\
> +Silicon\Qemu;%workspace%\edk2-platforms\Features\Intel;%workspace%\ed
> +k2-platforms\Features\Intel\Debugging;%workspace%\edk2-platforms\Feat
> +ures\Intel\Network;%workspace%\edk2-platforms\Features\Intel\OutOfBan
> +dManagement;%workspace%\edk2-platforms\Features\Intel\PowerManagement
> +;%workspace%\edk2-platforms\Features\Intel\SystemInformation;%workspa
> +ce%\edk2-platforms\Features\Intel\UserInterface
>   
> -cd \edk2
> +cd %workspace%\edk2
> +
> +git submodule update --init
>   
>   edksetup.bat Rebuild
>   







-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#99836): https://edk2.groups.io/g/devel/message/99836
Mute This Topic: https://groups.io/mt/96368993/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 v4] IntelSiliconPkg/SpiFvbServiceSmm: Rewrite VariableStore header.

2023-02-08 Thread Isaac Oram
Reviewed-by: Isaac Oram 

At some point, we should work to comment the related flows better so that code 
is clear on the different responsibilities for the different paths through 
first boots, normal scenarios, reclaims, and error remediation.  For now 
though, this is fine.

Regards,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Michael Kubacki
Sent: Wednesday, February 8, 2023 4:41 PM
To: devel@edk2.groups.io; Chiu, Chasel 
Cc: S, Ashraf Ali ; Oram, Isaac W 
; Chaganty, Rangasai V ; 
Ni, Ray ; Kubacki, Michael 
Subject: Re: [edk2-devel] [edk2-platforms: PATCH v4] 
IntelSiliconPkg/SpiFvbServiceSmm: Rewrite VariableStore header.

Reviewed-by: Michael Kubacki 

On the following lines, I recommend moving the assignment until after the if 
block. It seems unnecessary to assign a potentially invalid value to a local 
variable before checking the validation result.

   Status = SafeUint64ToUint32 (BaseAddress, [0].FvBase);
   NvStorageBaseAddress = mPlatformFvBaseAddress[0].FvBase;
   if (EFI_ERROR (Status)) {
 ASSERT_EFI_ERROR (Status);
 DEBUG ((DEBUG_ERROR, "[%a] - 64-bit variable storage base address not 
supported.\n", __FUNCTION__));
 return;
   }

---

(similar for NvStorageFvSize)

Thanks,
Michael

On 2/8/2023 5:17 PM, Chiu, Chasel wrote:
> When invalid VariableStore FV header detected, current SpiFvbService 
> will erase both FV and VariableStore headers from flash, however, it 
> will only rewrite FV header back and cause invalid VariableStore 
> header.
> 
> This patch adding the support for rewriting both FV header and 
> VariableStore header when VariableStore corruption happened.
> The Corrupted variable content should be taken care by 
> FaultTolerantWrite driver later.
> 
> Platform has to set PcdFlashVariableStoreType to inform SpiFvbService 
> which VariableStoreType should be rewritten.
> 
> Cc: Ashraf Ali S 
> Cc: Isaac Oram 
> Cc: Rangasai V Chaganty 
> Cc: Ray Ni 
> Cc: Michael Kubacki 
> Signed-off-by: Chasel Chiu 
> ---
>   Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceMm.c 
>| 69 -
>   
> Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServiceSmm.inf
>  |  3 +++
>   Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec   
>|  8 
>   3 files changed, 75 insertions(+), 5 deletions(-)
> 
> diff --git 
> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceMm.c 
> b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceMm.c
> index 6b4bcdcfe3..052be97872 100644
> --- 
> a/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvbServ
> iceMm.c
> +++ b/Silicon/Intel/IntelSiliconPkg/Feature/Flash/SpiFvbService/SpiFvb
> +++ ServiceMm.c
> @@ -12,6 +12,7 @@
>   #include 
> 
>   #include 
> 
>   #include 
> 
> +#include 
> 
>   
> 
>   /**
> 
> The function installs EFI_FIRMWARE_VOLUME_BLOCK protocol
> 
> @@ -113,7 +114,12 @@ FvbInitialize (
> UINT32MaxLbaSize;
> 
> UINT32BytesWritten;
> 
> UINTN BytesErased;
> 
> +  EFI_PHYSICAL_ADDRESS  NvStorageBaseAddress;
> 
> UINT64NvStorageFvSize;
> 
> +  UINT32ExpectedBytesWritten;
> 
> +  VARIABLE_STORE_HEADER *VariableStoreHeader;
> 
> +  UINT8 VariableStoreType;
> 
> +  UINT8 *NvStoreBuffer;
> 
>   
> 
> Status = GetVariableFlashNvStorageInfo (, 
> );
> 
> if (EFI_ERROR (Status)) {
> 
> @@ -124,12 +130,14 @@ FvbInitialize (
>   
> 
> // Stay within the current UINT32 size assumptions in the variable stack.
> 
> Status = SafeUint64ToUint32 (BaseAddress, 
> [0].FvBase);
> 
> +  NvStorageBaseAddress = mPlatformFvBaseAddress[0].FvBase;
> 
> if (EFI_ERROR (Status)) {
> 
>   ASSERT_EFI_ERROR (Status);
> 
>   DEBUG ((DEBUG_ERROR, "[%a] - 64-bit variable storage base 
> address not supported.\n", __FUNCTION__));
> 
>   return;
> 
> }
> 
> Status = SafeUint64ToUint32 (NvStorageFvSize, 
> [0].FvSize);
> 
> +  NvStorageFvSize = mPlatformFvBaseAddress[0].FvSize;
> 
> if (EFI_ERROR (Status)) {
> 
>   ASSERT_EFI_ERROR (Status);
> 
>   DEBUG ((DEBUG_ERROR, "[%a] - 64-bit variable storage size not 
> supported.\n", __FUNCTION__));
> 
> @@ -186,8 +194,59 @@ FvbInitialize (
> }
> 
> continue;
> 
>   

Re: [edk2-devel] MinPlatformPkg question

2023-01-31 Thread Isaac Oram
Garrett,

Yeah, that was what I was trying to get at with "let's use what we have now and 
then make an incompatible V1.0".  I like the idea of alternates too.  I dislike 
punishing early adopters and I don't think alternatives hurt most of the 
envisioned use cases.
Maybe we should start a branch for proposing and staging concrete changes.

It isn't well polished, but if I summarize what we were going for, it looks 
something like this:

The key objectives for specifying FV are to:

  *   Enable developers to rapidly understand what is same and different 
between boards and platforms
  *   Enable binary reuse use cases (integration, test, security, update) at a 
larger scope than individual drivers.
  *   Leverage validation of binaries across targets

The potential key use cases for specified Firmware Volumes include:

  *   Auditing:  Develop tools that can decompose the defined portion of a UEFI 
firmware solution.
  *   Integration:  Binary FV containing common core elements (Stage III) can 
be well defined, with clear interfaces, dependencies, and functionality.
  *   Integration:  Binary FV containing silicon support can be well defined 
and more readily managed, integrated, and audited.
  *   Auditing:  Build tool extensions can produce cryptographic strength 
hashes of defined FV that should not be customized.
  *   Optimization:  Support tools that can intelligently optimize out unneeded 
components.
  *   Simplification:  By separating into a set of known FV, we can define and 
mature them such that ownership can be maintained by one entity.

Is there anything you would add or change for why the spec should specify FV?  
What are interesting use cases you would like to see or prioritize?

Regards,
Isaac


From: devel@edk2.groups.io  On Behalf Of Kirkendall, 
Garrett via groups.io
Sent: Tuesday, January 31, 2023 11:28 AM
To: Pedro Falcato ; devel@edk2.groups.io
Cc: Oram, Isaac W ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Eric ; Bobroff, Zachary ; Zimmer, 
Vincent 
Subject: Re: [edk2-devel] MinPlatformPkg question


[AMD Official Use Only - General]

While I can work with Fsp named items in the MinPlatformPkg specification, I 
assumed the UEFI/edk2 team and maintainers might be amenable to making the 
specification more generic.  One of my concerns with Fsp named FVs is that 
critical core edk2 components are specified in them like PeiCore is specified 
in FvFspM.fv, etc.  There is only one guaranteed vendor implementing FSP and 
therefore it might be better to have more generic names which could attract 
more adopters more easily and reduce confusion.  Maybe there could be specified 
alternate names for non-FSP implementations?

Having FSP in the name would imply that the product supports FSP when it does 
not.

I'm looking forward in time as much as possible where this specification could 
encompass ARM, RISCV, etc. and provide similar useful items MinPlatformPkg can 
provide to x86 platforms.

I look forward to the next level of unified flow/structure that Minimum 
Platform can provide to the industry.

GARRETT KIRKENDALL
--
Facebook |  Twitter |  
amd.com
[cid:image001.png@01D93569.E8855270]

Words to live by: "Slow is Smooth.  Smooth is Fast."

From: Pedro Falcato mailto:pedro.falc...@gmail.com>>
Sent: Tuesday, January 31, 2023 12:58 PM
To: devel@edk2.groups.io; Kirkendall, Garrett 
mailto:garrett.kirkend...@amd.com>>
Cc: Oram, Isaac W mailto:isaac.w.o...@intel.com>>; 
Chiu, Chasel mailto:chasel.c...@intel.com>>; Desimone, 
Nathaniel L 
mailto:nathaniel.l.desim...@intel.com>>; Gao, 
Liming mailto:gaolim...@byosoft.com.cn>>; Dong, Eric 
mailto:eric.d...@intel.com>>; Bobroff, Zachary 
mailto:zacha...@ami.com>>; Zimmer, Vincent 
mailto:vincent.zim...@intel.com>>
Subject: Re: [edk2-devel] MinPlatformPkg question

Caution: This message originated from an External Source. Use proper caution 
when opening attachments, clicking links, or responding.

On Tue, Jan 31, 2023 at 4:54 PM Kirkendall, Garrett via 
groups.io 
mailto:amd@groups.io>> wrote:

[Public]

Isaac,

One of the obvious hindrances to acceptance is the Firmware Volumes with Fsp in 
the name.  They would be obvious to an Intel FSP solution, but they are not 
obvious to any other solution.  Would it be possible to give them a more 
generic descriptive name that would apply to any type of solution?

GARRETT KIRKENDALL
--
Facebook |  Twitter |  
amd.com
[cid:image001.png@01D93569.E8855270]

Words to live by: "Slow is Smooth.  Smooth is Fast."


Garrett,

Surely you've 

[edk2-devel][edk2-platforms][PATCH V2 1/1] AdvancedFeaturePkg: Improve sample build instructions

2023-01-18 Thread Isaac Oram
V1: Make the Windows build example current working directory based instead of
arbitrary.
V2: Fix case mismatch in edk2 repo local name.

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Rebecca Cran 
Signed-off-by: Isaac Oram 
---
 Features/Intel/AdvancedFeaturePkg/Readme.md | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/Features/Intel/AdvancedFeaturePkg/Readme.md 
b/Features/Intel/AdvancedFeaturePkg/Readme.md
index ba50560328..20f456bebe 100644
--- a/Features/Intel/AdvancedFeaturePkg/Readme.md
+++ b/Features/Intel/AdvancedFeaturePkg/Readme.md
@@ -19,19 +19,21 @@ Supported build targets
 * GCC5
 
 ## Windows Example:
-With current working directory at O:\
-
 git clone https://github.com/tianocore/edk2.git
 
+git clone https://github.com/tianocore/edk2-non-osi.git
+
 git clone https://github.com/tianocore/edk2-platforms.git
 
-set workspace=O:\
+set workspace=%cd%
 
-set EDK_TOOLS_PATH=O:\Edk2\BaseTools
+set EDK_TOOLS_PATH=%workspace%\edk2\BaseTools
 
-set 
packages_path=O:\edk2;O:\edk2-non-osi;O:\edk2-platforms\Platform\Intel;O:\edk2-platforms\Silicon\Intel;O:\edk2-platforms\Platform\Qemu;O:\edk2-platforms\Silicon\Qemu;O:\edk2-platforms\Features\Intel;O:\edk2-platforms\Features\Intel\Debugging;O:\edk2-platforms\Features\Intel\Network;O:\edk2-platforms\Features\Intel\OutOfBandManagement;O:\edk2-platforms\Features\Intel\PowerManagement;O:\edk2-platforms\Features\Intel\SystemInformation;O:\edk2-platforms\Features\Intel\UserInterface
+set 
packages_path=%workspace%\edk2;%workspace%\edk2-non-osi;%workspace%\edk2-platforms\Platform\Intel;%workspace%\edk2-platforms\Silicon\Intel;%workspace%\edk2-platforms\Platform\Qemu;%workspace%\edk2-platforms\Silicon\Qemu;%workspace%\edk2-platforms\Features\Intel;%workspace%\edk2-platforms\Features\Intel\Debugging;%workspace%\edk2-platforms\Features\Intel\Network;%workspace%\edk2-platforms\Features\Intel\OutOfBandManagement;%workspace%\edk2-platforms\Features\Intel\PowerManagement;%workspace%\edk2-platforms\Features\Intel\SystemInformation;%workspace%\edk2-platforms\Features\Intel\UserInterface
 
-cd \edk2
+cd %workspace%\edk2
+
+git submodule update --init
 
 edksetup.bat Rebuild
 
-- 
2.39.0.windows.1



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




Re: [edk2-devel] [PATCH v3 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

2023-01-18 Thread Isaac Oram
Series Pushed as 3b368b33e9..201514e6f5

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Isaac Oram
Sent: Wednesday, January 18, 2023 4:30 PM
To: devel@edk2.groups.io; abdat...@amd.com
Cc: Abdul Lateef Attar ; Dong, Eric 
; Gao, Liming 
Subject: Re: [edk2-devel] [PATCH v3 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

Series Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: Wednesday, January 18, 2023 5:04 AM
To: devel@edk2.groups.io
Cc: Abdul Lateef Attar ; Oram, Isaac W 
; Dong, Eric ; Gao, Liming 

Subject: [edk2-devel] [PATCH v3 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

From: Abdul Lateef Attar 

PR : https://github.com/tianocore/edk2-platforms/pull/55/

V3 delta changes:
Addressed below review comments from Isaac Patch 1:
  Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
  Line 168: Don't we need to free buffer on this path?
  Lines 655, 1083:  Please put a newline between while and the block to free 
resources.
DONE

Patch 2:
  
edk2-platforms/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
 338:
  Can you change to mUefiShellFileGuid and initialize it to zero?
  It seems misleading to me to have the default value here when it is not used.
  I think we should also move the declarations to the beginning of the file.
DONE

Cc: Oram Isaac W 
Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (2):
  BoardModulePkg: Copy device path before processing
  BoardModulePkg: Adds PCD to load UEFI Shell image

 .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 24 +++
 .../BoardBdsHookLib/BoardBdsHookLib.inf   |  3 ++
 .../Library/BoardBdsHookLib/BoardBootOption.c | 29 +--
 .../Intel/MinPlatformPkg/MinPlatformPkg.dec   |  5 
 4 files changed, 41 insertions(+), 20 deletions(-)

--
2.25.1













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




Re: [edk2-devel] [PATCH v3 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

2023-01-18 Thread Isaac Oram
Series Reviewed-by: Isaac Oram 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Abdul Lateef 
Attar via groups.io
Sent: Wednesday, January 18, 2023 5:04 AM
To: devel@edk2.groups.io
Cc: Abdul Lateef Attar ; Oram, Isaac W 
; Dong, Eric ; Gao, Liming 

Subject: [edk2-devel] [PATCH v3 0/2] BoardModulePkg: BoardBdsHookLib GCC fix

From: Abdul Lateef Attar 

PR : https://github.com/tianocore/edk2-platforms/pull/55/

V3 delta changes:
Addressed below review comments from Isaac Patch 1:
  Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.c
  Line 168: Don't we need to free buffer on this path?
  Lines 655, 1083:  Please put a newline between while and the block to free 
resources.
DONE

Patch 2:
  
edk2-platforms/Platform/Intel/BoardModulePkg/Library/BoardBdsHookLib/BoardBootOption.c
 338:
  Can you change to mUefiShellFileGuid and initialize it to zero?
  It seems misleading to me to have the default value here when it is not used.
  I think we should also move the declarations to the beginning of the file.
DONE

Cc: Oram Isaac W 
Cc: Eric Dong 
Cc: Liming Gao 

Abdul Lateef Attar (2):
  BoardModulePkg: Copy device path before processing
  BoardModulePkg: Adds PCD to load UEFI Shell image

 .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 24 +++
 .../BoardBdsHookLib/BoardBdsHookLib.inf   |  3 ++
 .../Library/BoardBdsHookLib/BoardBootOption.c | 29 +--
 .../Intel/MinPlatformPkg/MinPlatformPkg.dec   |  5 
 4 files changed, 41 insertions(+), 20 deletions(-)

--
2.25.1








-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98834): https://edk2.groups.io/g/devel/message/98834
Mute This Topic: https://groups.io/mt/96352999/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 0/2] Update Si support

2023-01-18 Thread Isaac Oram
Series Pushed as 6c1ab0c4a1..3b368b33e9

-Original Message-
From: Desimone, Nathaniel L  
Sent: Tuesday, January 17, 2023 5:27 PM
To: Oram, Isaac W ; devel@edk2.groups.io
Cc: Chiu, Chasel 
Subject: RE: [edk2-devel][edk2-platforms][PATCH V1 0/2] Update Si support

Good work Isaac!

For the series...

Reviewed-by: Nate DeSimone 

-Original Message-
From: Oram, Isaac W  
Sent: Thursday, January 12, 2023 3:57 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W ; Desimone, Nathaniel L 
; Chiu, Chasel 
Subject: [edk2-devel][edk2-platforms][PATCH V1 0/2] Update Si support

Updates for latest validated FSP, 4.2.0.2A.
There are binary incompatible Dispatch mode interface changes necessary.
API mode interfaces are unchanged.

Cc: Nate DeSimone 
Cc: Chasel Chiu 

Isaac Oram (2):
  WhitleySiliconPkg: Update to Whitley FSP 4.2.0.2A
  WhitleyOpenBoardPkg: Update to Whitley FSP 4.2.0.2A

 .../Dxe/PlatformCpuPolicy/PlatformCpuPolicy.c |   2 +-
 .../AcpiTables/Dsdt/CommonPlatform10nm.asi|   1 +
 .../Pci/Dxe/PciHostBridge/PciRebalance.c  | 243 ++
 .../Include/Dsc/BuildOptions.dsc  |   2 +-
 .../Include/Dsc/EnableRichDebugMessages.dsc   |   9 +
 .../Include/Guid/SetupVariable.h  |   3 +
 .../SiliconPolicyUpdateLib.c  |   2 +-
 .../SiliconPolicyUpdateLibFsp.c   |   2 +-
 .../WhitleyOpenBoardPkg/PlatformPkgConfig.dsc |   6 +-
 .../WhitleyOpenBoardPkg/StructurePcd.dsc  | 173 -
 .../WhitleyOpenBoardPkg/StructurePcdCpx.dsc   |  91 ++-
 Silicon/Intel/WhitleySiliconPkg/CpRcPkg.dec   |  23 +-
 .../Intel/WhitleySiliconPkg/Cpu/CpuRcPkg.dec  |   4 +-
 .../Cpu/Include/CpuPolicyPeiDxeCommon.h   |   2 +-
 .../WhitleySiliconPkg/Include/BdatSchema.h|  16 +-
 .../Include/Guid/MemoryMapData.h  |   4 +-
 .../Include/Guid/SocketIioVariable.h  |  13 +-
 .../Include/Guid/SocketMemoryVariable.h   |   3 +
 .../Include/Guid/SocketPciResourceData.h  |   4 +-
 .../Guid/SocketPowermanagementVariable.h  |   2 +
 .../Guid/SocketProcessorCoreVariable.h|   2 +-
 .../WhitleySiliconPkg/Include/IioConfig.h |  11 +-
 .../Intel/WhitleySiliconPkg/Include/IioRegs.h |   1 -
 .../Include/Library/EnhancedWarningLogLib.h   |   2 -
 .../Include/PlatformInfoTypes.h   |  16 +-
 .../Include/Ppi/MemoryPolicyPpi.h |  10 +
 .../Include/Ppi/RasImcS3Data.h|   6 -
 .../WhitleySiliconPkg/Include/Upi/KtiHost.h   |   2 -
 .../Core/Include/DataTypes.h  |  10 +-
 .../BaseMemoryCoreLib/Core/Include/MemHost.h  |   6 +-
 .../BaseMemoryCoreLib/Platform/PlatformHost.h |   5 -
 .../Include/Private/Library/PchSpiCommonLib.h |   1 -
 .../Product/Whitley/SiliconPkg10nmPcds.dsc|   5 +
 .../SecurityIp/SecurityIpSgxTem1v0_Inputs.h   |   2 +-
 .../SecurityIp/SecurityIpSgxTem1v0_Outputs.h  |   2 +-
 .../Intel/WhitleySiliconPkg/SiliconPkg.dec|  26 +-
 36 files changed, 521 insertions(+), 191 deletions(-)

--
2.39.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#98832): https://edk2.groups.io/g/devel/message/98832
Mute This Topic: https://groups.io/mt/96235809/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 1/1] Features/Intel: Prepare for edk2-platforms CI

2023-01-18 Thread Isaac Oram
New patch here since I had already pushed.  
https://edk2.groups.io/g/devel/message/98829

Thanks,
Isaac

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Rebecca Cran
Sent: Friday, January 13, 2023 6:46 AM
To: devel@edk2.groups.io; Oram, Isaac W 
Cc: Chaganty, Rangasai V ; Desimone, Nathaniel L 
; Gao, Liming ; Dong, 
Eric ; Bi, Dandan 
Subject: Re: [edk2-devel][edk2-platforms][PATCH V1 1/1] Features/Intel: Prepare 
for edk2-platforms CI

On 1/9/23 17:05, Isaac Oram wrote:

> --- /dev/null
> +++ b/Features/Intel/AdvancedFeaturePkg/Readme.md

...

> +## Windows Example:
> +With current working directory at O:\
> +
> +git clone https://github.com/tianocore/edk2.git
> +
> +git clone https://github.com/tianocore/edk2-platforms.git
> +
> +set workspace=O:\
> +
> +set EDK_TOOLS_PATH=O:\Edk2\BaseTools

Would "set workspace=%cd%" work better? That would avoid hard-coding the 
assumption that the workspace is on the O: drive.

Then, subsequent paths should be
%workspace%\edk2;%workspace%\edk2-non-osi etc.

> +
> +set 
> +packages_path=O:\edk2;O:\edk2-non-osi;O:\edk2-platforms\Platform\Inte
> +l;O:\edk2-platforms\Silicon\Intel;O:\edk2-platforms\Platform\Qemu;O:\
> +edk2-platforms\Silicon\Qemu;O:\edk2-platforms\Features\Intel;O:\edk2-
> +platforms\Features\Intel\Debugging;O:\edk2-platforms\Features\Intel\N
> +etwork;O:\edk2-platforms\Features\Intel\OutOfBandManagement;O:\edk2-p
> +latforms\Features\Intel\PowerManagement;O:\edk2-platforms\Features\In
> +tel\SystemInformation;O:\edk2-platforms\Features\Intel\UserInterface
> +
> +cd \edk2

Either here or earlier you probably want to add a step of running "git 
submodule update --init" otherwise the Rebuild step below will fail.

--
Rebecca Cran







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




  1   2   >