Re: [edk2-devel] [edk2-platforms][PATCH 05/14] ManageabilityPkg: Add PldmProtocolLib

2023-04-11 Thread Nickle Wang via groups.io
Hi Abner,

It seems to me that some of protocol GUIDs are defined in [Guids] section 
instead of [Protocol] section in Features/ManageabilityPkg/ManageabilityPkg.dec 
file. Could you please address this together?

Thanks,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Monday, April 3, 2023 11:05 PM
> To: devel@edk2.groups.io
> Cc: Isaac Oram ; Abdul Lateef Attar
> ; Nickle Wang ; Igor Kulchytskyy
> 
> Subject: [edk2-platforms][PATCH 05/14] ManageabilityPkg: Add
> PldmProtocolLib
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> PldmProtocolLib provides the library
> function to PLDM protocol.
> 
> Signed-off-by: Abner Chang 
> Cc: Isaac Oram 
> Cc: Abdul Lateef Attar 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../ManageabilityPkg/ManageabilityPkg.dec |  3 +
>  .../Include/Dsc/Manageability.dsc |  3 +
>  .../ManageabilityPkg/ManageabilityPkg.dsc |  1 +
>  .../Dxe/PldmProtocolLib.inf   | 42 +
>  .../Include/Library/BasePldmProtocolLib.h | 41 +
>  .../Include/Protocol/PldmProtocol.h   | 87 +++
>  .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c | 87 +++
>  .../Dxe/PldmProtocolLib.uni   | 18 
>  8 files changed, 282 insertions(+)
>  create mode 100644
> Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.i
> nf
>  create mode 100644
> Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
>  create mode 100644
> Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h
>  create mode 100644
> Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.c
>  create mode 100644
> Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.
> uni
> 
> diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec
> b/Features/ManageabilityPkg/ManageabilityPkg.dec
> index 9a930d3e4b..1e9245c8dc 100644
> --- a/Features/ManageabilityPkg/ManageabilityPkg.dec
> +++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
> @@ -48,3 +48,6 @@
>gManageabilityProtocolMctpGuid= { 0x76FED8F1, 0x0BE5, 0x4269, { 0xA3,
> 0x1A, 0x38, 0x0F, 0x54, 0xF1, 0xA1, 0x8A } }
># Manageability Protocol PLDM
>gManageabilityProtocolPldmGuid= { 0x3958090D, 0x69DD, 0x4868, { 0x9C,
> 0x41, 0xC9, 0xAC, 0x31, 0xB5, 0x25, 0xC5 } }
> +
> +[Protocols]
> +  gEdkiiPldmProtocolGuid= { 0x60997616, 0xDB70, 0x4B5F, { 
> 0x86,
> 0xA4, 0x09, 0x58, 0xA3, 0x71, 0x47, 0xB4 } }
> diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
> b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
> index 0d868fdf4a..59549eb39a 100644
> --- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
> +++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
> @@ -8,6 +8,9 @@
>  [LibraryClasses]
> 
> ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageability
> TransportHelperLib/BaseManageabilityTransportHelper.inf
> 
> +[LibraryClasses.common.DXE_DRIVER]
> +
> +PldmProtocolLib|ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmPr
> +otocolLib.inf
> +
>  [LibraryClasses.ARM, LibraryClasses.AARCH64]
>#
># This library provides the instrinsic functions generated by a given 
> compiler.
> diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc
> b/Features/ManageabilityPkg/ManageabilityPkg.dsc
> index 6a083385fd..412029ef6c 100644
> --- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
> +++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
> @@ -37,6 +37,7 @@
> 
>  [Components]
> 
> ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageability
> TransportKcs.inf
> +  ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
> 
>  [LibraryClasses]
> 
> ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransp
> ortNullLib/BaseManageabilityTransportNull.inf
> diff --git
> a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLi
> b.inf
> b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLi
> b.inf
> new file mode 100644
> index 00..1233d76726
> --- /dev/null
> +++ b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProt
> +++ ocolLib.inf
> @@ -0,0 +1,42 @@
> +## @file
> +#  Instance of PLDM Protocol Library in DXE phase.
> +#
> +#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights
> +reserved. # #  SPDX-License-Identifier: BSD-2-Clause-Patent # # ##
> +
> +[Defines]
> +  INF_VERSION= 0x00010005
> +  BASE_NAME  = PldmProtocolLib
> +  MODULE_UNI_FILE= PldmProtocolLib.uni
> +  FILE_GUID  = 5B1173E8-6A5A-468B-BDA4-02303530C55C
> +  MODULE_TYPE= DXE_DRIVER
> +  VERSION_STRING = 1.0
> +  LIBRARY_CLASS  = PldmProtocolLib|DXE_RUNTIME_DRIVER
> DXE_DRIVER DXE_CORE UEFI_DRIVER UEFI_APPLICATION
> +
> +#
> +#  VALID_ARCHITECTURES

[edk2-devel] [edk2-platforms][PATCH 05/14] ManageabilityPkg: Add PldmProtocolLib

2023-04-03 Thread Chang, Abner via groups.io
From: Abner Chang 

PldmProtocolLib provides the library
function to PLDM protocol.

Signed-off-by: Abner Chang 
Cc: Isaac Oram 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../ManageabilityPkg/ManageabilityPkg.dec |  3 +
 .../Include/Dsc/Manageability.dsc |  3 +
 .../ManageabilityPkg/ManageabilityPkg.dsc |  1 +
 .../Dxe/PldmProtocolLib.inf   | 42 +
 .../Include/Library/BasePldmProtocolLib.h | 41 +
 .../Include/Protocol/PldmProtocol.h   | 87 +++
 .../PldmProtocolLibrary/Dxe/PldmProtocolLib.c | 87 +++
 .../Dxe/PldmProtocolLib.uni   | 18 
 8 files changed, 282 insertions(+)
 create mode 100644 
Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
 create mode 100644 
Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
 create mode 100644 Features/ManageabilityPkg/Include/Protocol/PldmProtocol.h
 create mode 100644 
Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.c
 create mode 100644 
Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.uni

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dec 
b/Features/ManageabilityPkg/ManageabilityPkg.dec
index 9a930d3e4b..1e9245c8dc 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dec
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dec
@@ -48,3 +48,6 @@
   gManageabilityProtocolMctpGuid= { 0x76FED8F1, 0x0BE5, 0x4269, { 0xA3, 
0x1A, 0x38, 0x0F, 0x54, 0xF1, 0xA1, 0x8A } }
   # Manageability Protocol PLDM
   gManageabilityProtocolPldmGuid= { 0x3958090D, 0x69DD, 0x4868, { 0x9C, 
0x41, 0xC9, 0xAC, 0x31, 0xB5, 0x25, 0xC5 } }
+
+[Protocols]
+  gEdkiiPldmProtocolGuid= { 0x60997616, 0xDB70, 0x4B5F, { 
0x86, 0xA4, 0x09, 0x58, 0xA3, 0x71, 0x47, 0xB4 } }
diff --git a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc 
b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
index 0d868fdf4a..59549eb39a 100644
--- a/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
+++ b/Features/ManageabilityPkg/Include/Dsc/Manageability.dsc
@@ -8,6 +8,9 @@
 [LibraryClasses]
   
ManageabilityTransportHelperLib|ManageabilityPkg/Library/BaseManageabilityTransportHelperLib/BaseManageabilityTransportHelper.inf
 
+[LibraryClasses.common.DXE_DRIVER]
+  
PldmProtocolLib|ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
+
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #
   # This library provides the instrinsic functions generated by a given 
compiler.
diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 6a083385fd..412029ef6c 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -37,6 +37,7 @@
 
 [Components]
   
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
+  ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
 
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
diff --git 
a/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf 
b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
new file mode 100644
index 00..1233d76726
--- /dev/null
+++ 
b/Features/ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
@@ -0,0 +1,42 @@
+## @file
+#  Instance of PLDM Protocol Library in DXE phase.
+#
+#  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PldmProtocolLib
+  MODULE_UNI_FILE= PldmProtocolLib.uni
+  FILE_GUID  = 5B1173E8-6A5A-468B-BDA4-02303530C55C
+  MODULE_TYPE= DXE_DRIVER
+  VERSION_STRING = 1.0
+  LIBRARY_CLASS  = PldmProtocolLib|DXE_RUNTIME_DRIVER 
DXE_DRIVER DXE_CORE UEFI_DRIVER UEFI_APPLICATION
+
+#
+#  VALID_ARCHITECTURES  = IA32 X64
+#
+
+[Sources]
+  PldmProtocolLib.c
+
+[Packages]
+  ManageabilityPkg/ManageabilityPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+
+[LibraryClasses]
+  DebugLib
+  ManageabilityTransportHelperLib
+  UefiBootServicesTableLib
+
+[Guids]
+  gManageabilityProtocolPldmGuid
+
+[Protocols]
+  gEdkiiPldmProtocolGuid  ## ALWAYS_CONSUMES
+
diff --git a/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h 
b/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
new file mode 100644
index 00..5523ac3a4d
--- /dev/null
+++ b/Features/ManageabilityPkg/Include/Library/BasePldmProtocolLib.h
@@ -0,0 +1,41 @@
+/** @file
+
+  This file defines EDKII Pldm Protocol library and functions.
+
+  Copyright (C) 2023 Advanced Micro