[edk2-devel] [edk2-redfish-client][PATCH 05/13] RedfishClientPkg/RedfishFeatureUtilityLib: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
- Remove RedfishHttpCacheLib and use EDK2 RedfishHttpLib.
- Remove RedfishLib.
- Remove CreatePayloadToPostResource and CreatePayloadToPatchResource
because we no longer need them.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../RedfishFeatureUtilityLib.inf  |   3 +-
 .../Library/RedfishFeatureUtilityLib.h|  46 +
 .../RedfishFeatureUtilityInternal.h   |   3 +-
 .../RedfishFeatureUtilityLib.c| 182 +-
 4 files changed, 6 insertions(+), 228 deletions(-)

diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
index d8f3da373..1cb2d5595 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
@@ -40,7 +40,7 @@
   ConverterCommonLib
   DebugLib
   MemoryAllocationLib
-  RedfishLib
+  RedfishHttpLib
   RedfishPlatformConfigLib
   UefiLib
   UefiBootServicesTableLib
@@ -48,7 +48,6 @@
   PrintLib
   HttpLib
   RedfishDebugLib
-  RedfishHttpCacheLib
 
 [Protocols]
   gEdkIIRedfishETagProtocolGuid   ## CONSUMED ##
diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h 
b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
index 1b6d3f4cf..ba9ea0150 100644
--- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
+++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
@@ -12,7 +12,7 @@
 #ifndef REDFISH_FEATURE_UTILITY_LIB_H_
 #define REDFISH_FEATURE_UTILITY_LIB_H_
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -352,50 +352,6 @@ ApplyFeatureSettingsBooleanArrayType (
   IN  RedfishCS_bool_Array  *ArrayHead
   );
 
-/**
-
-  Create HTTP payload and send them to redfish service with POST method.
-
-  @param[in]  Service Redfish service.
-  @param[in]  TargetPayload   Target payload
-  @param[in]  JsonData in JSON format.
-  @param[out] LocationReturned location string from Redfish service.
-  @param[out] EtagReturned ETAG string from Redfish service.
-
-  @retval EFI_SUCCESS Data is sent to redfish service successfully.
-  @retval Others  Errors occur.
-
-**/
-EFI_STATUS
-CreatePayloadToPostResource (
-  IN  REDFISH_SERVICE  *Service,
-  IN  REDFISH_PAYLOAD  *TargetPayload,
-  IN  CHAR8*Json,
-  OUT EFI_STRING   *Location,
-  OUT CHAR8**Etag
-  );
-
-/**
-
-  Create HTTP payload and send them to redfish service with PATCH method.
-
-  @param[in]  Service Redfish service.
-  @param[in]  TargetPayload   Target payload
-  @param[in]  JsonData in JSON format.
-  @param[out] EtagReturned ETAG string from Redfish service.
-
-  @retval EFI_SUCCESS Data is sent to redfish service successfully.
-  @retval Others  Errors occur.
-
-**/
-EFI_STATUS
-CreatePayloadToPatchResource (
-  IN  REDFISH_SERVICE  *Service,
-  IN  REDFISH_PAYLOAD  *TargetPayload,
-  IN  CHAR8*Json,
-  OUT CHAR8**Etag
-  );
-
 /**
 
   Save Redfish URI in database for further use.
diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
index b4cfca030..b1c2ee468 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityInternal.h
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
index 21ce8ddad..cc2b37b79 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
@@ -154,7 +154,7 @@ SetEtagFromUri (
   }
 
   ZeroMem (, sizeof (Response));
-  Status = RedfishHttpGetResource (RedfishService, Uri, , TRUE);
+  Status = RedfishHttpGetResource (RedfishService, Uri, NULL, , TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a: get resource from: %s failed\n", __func__, Uri));
 return Status;
@@ -215,14 +215,7 @@ ON_RELEASE:
 FreePool (PendingSettingUri);
   }
 
-  if (Response.Payload != NULL) {
-RedfishFreeResponse (
-  Response.StatusCode,
-  Response.HeaderCount,
-  Response.Headers,
-  Response.Payload
-  );
-  }
+  RedfishHttpFreeResponse ();
 
   return Status;
 }
@@ -1894,175 +1887,6 @@ CheckIsServerEtagSupported (
   return FixedPcdGetBool (PcdRedfishServiceEtagSupported);
 }
 
-/**
-
-  Create HTTP payload and 

[edk2-devel] [edk2-redfish-client][PATCH 04/13] RedfishClientPkg/RedfishResourceConfigLib: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Remove RedfishHttpCacheLib and use EDK2 RedfishHttpLib.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .../EdkIIRedfishResourceConfigLib.inf   | 2 +-
 .../Include/Library/EdkIIRedfishResourceConfigLib.h | 4 ++--
 .../EdkIIRedfishResourceConfigLib.c | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
index a5a81e9a2..2d10445f0 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.inf
@@ -39,7 +39,7 @@
   MemoryAllocationLib
   RedfishFeatureUtilityLib
   RedfishPlatformConfigLib
-  RedfishHttpCacheLib
+  RedfishHttpLib
 
 [Protocols]
   gEdkIIRedfishResourceConfigProtocolGuid   ## CONSUMES ##
diff --git a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h 
b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
index 561ecbbaf..3aa953cec 100644
--- a/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
+++ b/RedfishClientPkg/Include/Library/EdkIIRedfishResourceConfigLib.h
@@ -2,7 +2,7 @@
   This file defines the EDKII resource config Library interface.
 
   (C) Copyright 2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -13,7 +13,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
index ed225a23b..5d0944f8c 100644
--- 
a/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
+++ 
b/RedfishClientPkg/Library/EdkIIRedfishResourceConfigLib/EdkIIRedfishResourceConfigLib.c
@@ -15,8 +15,8 @@
 #include 
 #include 
 #include 
+#include 
 #include 
-#include 
 
 EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL   
*mRedfishResourceConfigProtocol = NULL;
 EFI_HANDLE   mCachedHandle;
@@ -58,7 +58,7 @@ GetRedfishSchemaInfo (
   }
 
   ZeroMem (, sizeof (Response));
-  Status = RedfishHttpGetResource (RedfishService, Uri, , TRUE);
+  Status = RedfishHttpGetResource (RedfishService, Uri, NULL, , TRUE);
   if (EFI_ERROR (Status)) {
 DEBUG ((DEBUG_ERROR, "%a, failed to get resource from %s: %r", __func__, 
Uri, Status));
 return Status;
@@ -99,7 +99,7 @@ GetRedfishSchemaInfo (
   //
   JsonStructProtocol->DestoryStructure (JsonStructProtocol, Header);
   FreePool (JsonText);
-  RedfishFreeResponse (Response.StatusCode, Response.HeaderCount, 
Response.Headers, Response.Payload);
+  RedfishHttpFreeResponse ();
 
   return EFI_SUCCESS;
 }
-- 
2.34.1



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




[edk2-devel] [edk2-redfish-client][PATCH 03/13] RedfishClientPkg: ues RedfishHttpLib

2024-02-29 Thread Nickle Wang via groups.io
Use EDK2 RedfishHttpLib to replace RedfishHttpCacheLib and RedfishLib

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/Include/RedfishCollectionCommon.h | 3 +--
 RedfishClientPkg/Include/RedfishResourceCommon.h   | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/RedfishClientPkg/Include/RedfishCollectionCommon.h 
b/RedfishClientPkg/Include/RedfishCollectionCommon.h
index b1e313da2..f7c870172 100644
--- a/RedfishClientPkg/Include/RedfishCollectionCommon.h
+++ b/RedfishClientPkg/Include/RedfishCollectionCommon.h
@@ -21,13 +21,12 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
-#include 
 
 //
 // Protocols
diff --git a/RedfishClientPkg/Include/RedfishResourceCommon.h 
b/RedfishClientPkg/Include/RedfishResourceCommon.h
index c1286adc1..43a527a05 100644
--- a/RedfishClientPkg/Include/RedfishResourceCommon.h
+++ b/RedfishClientPkg/Include/RedfishResourceCommon.h
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -32,7 +32,6 @@
 #include 
 #include 
 #include 
-#include 
 
 //
 // Protocols
-- 
2.34.1



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




[edk2-devel] [edk2-redfish-client][PATCH 02/13] RedfishClientPkg: remove RedfishHttpCacheLib

2024-02-29 Thread Nickle Wang via groups.io
Remove RedfishHttpCacheLib and use EDK2 RedfishHttpLib.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/RedfishClientPkg.dec |   1 -
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   2 +-
 RedfishClientPkg/RedfishClientPkg.dsc |   1 -
 .../RedfishHttpCacheLib.inf   |  48 --
 .../Include/Library/RedfishHttpCacheLib.h |  59 --
 .../RedfishHttpCacheLibInternal.h |  63 --
 .../RedfishHttpCacheLib/RedfishHttpCacheLib.c | 774 --
 7 files changed, 1 insertion(+), 947 deletions(-)
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
 delete mode 100644 RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLibInternal.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.c

diff --git a/RedfishClientPkg/RedfishClientPkg.dec 
b/RedfishClientPkg/RedfishClientPkg.dec
index ce3b6d975..aa018d714 100644
--- a/RedfishClientPkg/RedfishClientPkg.dec
+++ b/RedfishClientPkg/RedfishClientPkg.dec
@@ -27,7 +27,6 @@
   EdkIIRedfishResourceConfigLib|Include/Library/EdkIIRedfishResourceConfigLib.h
   RedfishEventLib|Include/Library/RedfishEventLib.h
   RedfishVersionLib|Include/Library/RedfishVersionLib.h
-  RedfishHttpCacheLib|Include/Library/RedfishHttpCacheLib.h
 
 [LibraryClasses.Common.Private]
   ##  @libraryclass Redfish Helper Library
diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc 
b/RedfishClientPkg/RedfishClientLibs.dsc.inc
index 9c7889d2b..8ec27baa3 100644
--- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
+++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
@@ -42,4 +42,4 @@
   
RedfishVersionLib|RedfishClientPkg/Library/RedfishVersionLib/RedfishVersionLib.inf
   
RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
   RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
-  
RedfishHttpCacheLib|RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
+  RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
diff --git a/RedfishClientPkg/RedfishClientPkg.dsc 
b/RedfishClientPkg/RedfishClientPkg.dsc
index 0e3ef1ac9..f37bf93ac 100644
--- a/RedfishClientPkg/RedfishClientPkg.dsc
+++ b/RedfishClientPkg/RedfishClientPkg.dsc
@@ -61,6 +61,5 @@
   
RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.inf
   RedfishClientPkg/PrivateLibrary/RedfishLib/RedfishLib.inf
   RedfishClientPkg/Library/RedfishAddendumLib/RedfishAddendumLib.inf
-  RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
 
   !include RedfishClientPkg/RedfishClient.dsc.inc
diff --git 
a/RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf 
b/RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
deleted file mode 100644
index e76c8b65e..0
--- a/RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
+++ /dev/null
@@ -1,48 +0,0 @@
-## @file
-#  Redfish HTTP cache library helps Redfish application to get Redfish resource
-#  from Redfish service with cache mechanism enabled.
-#
-#  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
-#
-#  SPDX-License-Identifier: BSD-2-Clause-Patent
-#
-##
-
-[Defines]
-  INF_VERSION= 0x00010006
-  BASE_NAME  = RedfishHttpCacheLib
-  FILE_GUID  = 21F8FEEC-023C-451D-824D-823058FD9481
-  MODULE_TYPE= DXE_DRIVER
-  VERSION_STRING = 1.0
-  LIBRARY_CLASS  = RedfishHttpCacheLib| DXE_DRIVER UEFI_DRIVER
-  CONSTRUCTOR= RedfishHttpCacheConstructor
-  DESTRUCTOR = RedfishHttpCacheDestructor
-
-#
-#  VALID_ARCHITECTURES   = IA32 X64 EBC
-#
-
-[Sources]
-  RedfishHttpCacheLibInternal.h
-  RedfishHttpCacheLib.c
-
-[Packages]
-  MdePkg/MdePkg.dec
-  MdeModulePkg/MdeModulePkg.dec
-  RedfishPkg/RedfishPkg.dec
-  RedfishClientPkg/RedfishClientPkg.dec
-
-[LibraryClasses]
-  BaseLib
-  DebugLib
-  UefiBootServicesTableLib
-  MemoryAllocationLib
-  RedfishLib
-  UefiLib
-  RedfishDebugLib
-  ReportStatusCodeLib
-  PrintLib
-
-[depex]
-  TRUE
-
diff --git a/RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h 
b/RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
deleted file mode 100644
index 1277b9814..0
--- a/RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/** @file
-  This file defines the Redfish HTTP cache library interface.
-
-  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
-
-  SPDX-License-Identifier: BSD-2-Clause-Patent
-
-**/
-
-#ifndef REDFISH_HTTP_CACHE_LIB_H_
-#define REDFISH_HTTP_CACHE_LIB_H_
-
-#include 
-#include 
-
-/**
-  Get redfish resource from given resource URI with cache mechanism
-  supported. It's caller's responsibility to Response 

[edk2-devel] [edk2-redfish-client][PATCH 01/13] RedfishClientPkg/.github: do not run uncrustify to deleted file.

2024-02-29 Thread Nickle Wang via groups.io
Check to see if file exists or not before running uncrustify.
The file in change list may be a deleted file.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
---
 .github/workflows/uncrustify-check.sh | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/uncrustify-check.sh 
b/.github/workflows/uncrustify-check.sh
index 7c1765cff..e6cf00b1f 100755
--- a/.github/workflows/uncrustify-check.sh
+++ b/.github/workflows/uncrustify-check.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 #
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -40,12 +40,17 @@ fi
 
 for file in $CHANGED_FILES
 do
-  echo "Uncrustify check file: $file"
-  uncrustify -c $CONFIG_FILE -f $file --check
-  if [ $? -ne 0 ]
+  if [ -e "$file" ]
   then
-echo "Uncrustify check failure on file: $file"
-FAILURE=1
+echo "Uncrustify check file: $file"
+uncrustify -c $CONFIG_FILE -f $file --check
+if [ $? -ne 0 ]
+then
+  echo "Uncrustify check failure on file: $file"
+  FAILURE=1
+fi
+  else
+echo "File does not exist (deleted file?): $file"
   fi
 done
 
-- 
2.34.1



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




[edk2-devel] [edk2-redfish-client][PATCH 00/13] use Redfish HTTP protocol

2024-02-29 Thread Nickle Wang via groups.io
Redfish HTTP protocol is introduced to edk2 RedfishPkg. Update 
RedfishClientPkg to use RedfishHttpLib. And remove the use of 
RedfishHttpCacheLib. 

I also replace several functions from RedfishLib with the function 
provided in RedfishHttpLib. In this way, there is no dependency on 
RedfishLib in RedfishClientPkg.

I noticed that there is false alarm in uncrustify check. When there
are deleted files, uncrustiry cannot check them and trigger uncrustify
failure.

Pull request is created here for testing CI: 
https://github.com/tianocore/edk2-redfish-client/pull/79

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 

Nickle Wang (13):
  RedfishClientPkg/.github: do not run uncrustify to deleted file.
  RedfishClientPkg: remove RedfishHttpCacheLib
  RedfishClientPkg: ues RedfishHttpLib
  RedfishClientPkg/RedfishResourceConfigLib: ues RedfishHttpLib
  RedfishClientPkg/RedfishFeatureUtilityLib: ues RedfishHttpLib
  RedfishClientPkg/RedfishVersionLib: ues RedfishHttpLib
  RedfishClientPkg/BiosDxe: ues RedfishHttpLib
  RedfishClientPkg/BootOptionDxe: ues RedfishHttpLib
  RedfishClientPkg/BootOptionCollectionDxe: ues RedfishHttpLib
  RedfishClientPkg/ComputerSystemDxe: ues RedfishHttpLib
  RedfishClientPkg/ComputerSystemCollectionDxe: ues RedfishHttpLib
  RedfishClientPkg/MemoryDxe: ues RedfishHttpLib
  RedfishClientPkg/MemoryCollectionDxe: ues RedfishHttpLib

 RedfishClientPkg/RedfishClientPkg.dec |   1 -
 RedfishClientPkg/RedfishClientLibs.dsc.inc|   2 +-
 RedfishClientPkg/RedfishClientPkg.dsc |   1 -
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.inf  |   3 +-
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.inf   |   5 +-
 .../BootOptionCollectionDxe.inf   |   5 +-
 .../v1_13_0/Dxe/ComputerSystemDxe.inf |   3 +-
 .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   3 +-
 .../ComputerSystemCollectionDxe.inf   |   3 +-
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.inf  |   3 +-
 .../MemoryCollectionDxe.inf   |   3 +-
 .../EdkIIRedfishResourceConfigLib.inf |   2 +-
 .../RedfishFeatureUtilityLib.inf  |   3 +-
 .../RedfishHttpCacheLib.inf   |  48 --
 .../RedfishVersionLib/RedfishVersionLib.inf   |   3 +-
 .../Library/EdkIIRedfishResourceConfigLib.h   |   4 +-
 .../Library/RedfishFeatureUtilityLib.h|  46 +-
 .../Include/Library/RedfishHttpCacheLib.h |  59 --
 .../Include/RedfishCollectionCommon.h |   3 +-
 .../Include/RedfishResourceCommon.h   |   3 +-
 .../RedfishFeatureUtilityInternal.h   |   3 +-
 .../RedfishHttpCacheLibInternal.h |  63 --
 .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  92 +--
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 113 +--
 .../v1_0_4/Common/BootOptionCommon.c  |  45 +-
 .../BootOption/v1_0_4/Dxe/BootOptionDxe.c |  86 +-
 .../BootOptionCollectionDxe.c |  26 +-
 .../v1_13_0/Common/ComputerSystemCommon.c |  68 +-
 .../v1_13_0/Dxe/ComputerSystemDxe.c   |  85 +-
 .../v1_5_0/Common/ComputerSystemCommon.c  |  68 +-
 .../v1_5_0/Dxe/ComputerSystemDxe.c|  84 +-
 .../ComputerSystemCollectionDxe.c |  15 +-
 .../Memory/V1_7_1/Common/MemoryCommon.c   |  86 +-
 .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 111 +--
 .../MemoryCollectionDxe/MemoryCollectionDxe.c |  15 +-
 .../EdkIIRedfishResourceConfigLib.c   |   6 +-
 .../RedfishFeatureUtilityLib.c| 182 +---
 .../RedfishHttpCacheLib/RedfishHttpCacheLib.c | 774 --
 .../RedfishVersionLib/RedfishVersionLib.c |  24 +-
 .github/workflows/uncrustify-check.sh |  17 +-
 40 files changed, 328 insertions(+), 1838 deletions(-)
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.inf
 delete mode 100644 RedfishClientPkg/Include/Library/RedfishHttpCacheLib.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLibInternal.h
 delete mode 100644 
RedfishClientPkg/Library/RedfishHttpCacheLib/RedfishHttpCacheLib.c

-- 
2.34.1



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




Re: [edk2-devel] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-28 Thread Mike Maslenkin
Reviewed-by: Mike Maslenkin 

Regards,
Mike.

On Mon, Feb 26, 2024 at 7:55 AM  wrote:
>
> From: Abner Chang 
>
> Clarify the HTTP method that is used to provision BIOS
> managed Redfish resource.
>
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Cc: Mike Maslenkin 
> ---
>  RedfishClientPkg/Readme.md| 35 ---
>  .../Media/redfish-call-flow-provisioning.svg  |  2 +-
>  .../Media/redfish-synchronization-design.svg  |  4 +--
>  3 files changed, 26 insertions(+), 15 deletions(-)
>
> diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
> index 82cb9c8c99..1789dff6f8 100644
> --- a/RedfishClientPkg/Readme.md
> +++ b/RedfishClientPkg/Readme.md
> @@ -310,21 +310,32 @@ job.
>
>  Several interfaces defined in EDKII Redfish Resource Config Protocol work 
> together to support Redfish synchronization:
>  - Identify()
> -  - This function is used to check if the given Redfish resource is the one 
> the feature driver wants to manage. A platform
> -library `RedfishResourceIdentifyLib` is introduced for platform to 
> implement its own policy to identify Redfish resource.
> +  - This function is used to check if the given Redfish resource is the one 
> the feature driver
> +wants to manage. A platform library `RedfishResourceIdentifyLib` is 
> introduced for
> +platform to implement its own policy to identify Redfish resource.
>  - Check()
> -  - This function is used to check the attribute status on Redfish service. 
> If all attributes the feature driver manages
> -are presented in Redfish service, feature driver must provision them 
> already. Otherwise, Provisioning() will be called
> -to perform resource provisioning job.
> +  - This function is used to check the attribute status on Redfish service. 
> If all attributes
> +the feature driver manages are presented in Redfish service, feature 
> driver must provision
> +them already. Otherwise, Provisioning() will be called to perform 
> resource provisioning
> +job.
>  - Provisioning()
> -  - When this function is called, feature driver will provision all 
> attributes that it managed to Redfish service. This
> -operation usually create new resource at Redfish service and require 
> different operation that specified by Redfish service.
> +  - When this function is called, feature driver will provision all 
> attributes that it managed
> +to Redfish service. This operation usually creates the new Redfish 
> properties at the
> +existing URI in Redfish service. Use HTTP PATCH to provision Redfish 
> properties as BIOS
> +may only manage some but not all of the properties of the resource. See 
> [Redfish-edk2 
> implementation](#Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfish)
>  for
> +the details. HTTP POST is still used for creating a collection member, 
> such as the
> +collection member of processor or memory for the Redfish inventory 
> management.
> +However, HTTP PUT to overwrite an entire Redfish resource is not used in 
> edk2 Redfish
> +implementation as edk2 Redfish implementation has no idea of whether the 
> Redfish resource
> +is entirely managed by BIOS or not.
>  - Consume()
> -  - When there is pending settings in Redfish service, this function is 
> called for feature driver to consume pending settings
> -requested by user.
> +  - When there is pending settings in Redfish service, this function is 
> called for feature
> +driver to consume pending settings requested by user. HTTP GET is the 
> method used
> +to retrieve Redfish properties.
>  - Update()
> -  - When platform configuration is updated, this function is called to 
> update configuration changes to Redfish service and
> -Redfish service can show the latest settings on platform.
> +  - When platform configuration is updated, this function is called to 
> update configuration
> +changes to Redfish service and Redfish service can show the latest 
> settings on platform.
> +HTTP PATCH is the method used to update the properties of Redfish 
> resource.
>
>  The EDKII Redfish Resource Addendum Protocol is introduced to provide 
> platform addendum data that Redfish service requires.
>  This protocol will be called at Provisioning() and Update() functions so 
> platform can add OEM attribute or any other attribute
> @@ -338,7 +349,7 @@ struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {
>  };
>  ```
>
> -### Redfish Service Implementation that Incorporates with EDK2 Redfish
> +###  name="Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfish">Redfish
>  Service Implementation that Incorporates with EDK2 Redfish
>  The idea of Redfish synchronization design is to manage Redfish resource 
> directly by platform host
>  firmware. To do this, Redfish synchronization functions have to work with 
> Redfish service implementation
>  in BMC firmware. This is because the mechanism between platform host 
> 

Re: [edk2-devel] [edk2][PATCH V2 1/2] ArmPkg/ArmGicArchLib: Add macros for SPI and extended SPI ranges

2024-02-28 Thread Sami Mujawar
+Resending with email address for maintainers.

Hi Ard, Leif,

This patch adds macros that can be used to validate that the SPI ranges are 
valid.
These have been define here so that we do not duplicate it at multiple places.

Can you let me know if I can merge this patch, please?

Regards,

Sami Mujawar

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


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




Re: [edk2-devel] [edk2][PATCH V2 1/2] ArmPkg/ArmGicArchLib: Add macros for SPI and extended SPI ranges

2024-02-28 Thread Sami Mujawar
Hi Ard, Leif,

This patch adds macros that can be used to validate that the SPI ranges are 
valid.
These have been define here so that we do not duplicate it at multiple places.

Can you let me know if I can merge this patch, please?

Regards,

Sami Mujawar


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




Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: check JSON value type

2024-02-27 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Nickle,
As this change is in the autogenerate source files. We have to update the 
script here: https://github.com/DMTF/Redfish-Schema-C-Struct-Generator
Not sure if you have access to this repo, however I am pleased inviting you to 
update the script on DMTF Github.
We will not merging this change on edk2-redfish-client repo.

Thanks
Abner


> -Original Message-
> From: Nickle Wang 
> Sent: Tuesday, February 27, 2024 8:53 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: check
> JSON value type
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Check and see if JSON object type is desired type before
> getting its value. According to the Redfish schema, attribute
> value can be null value. Add this error handling to avoid
> system assertion while getting attribute value.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 10 ++
>  1 file changed, 10 insertions(+)
>
> diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> index 250ef75e4..7ee3c86e1 100644
> --- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> +++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
> @@ -1,5 +1,7 @@
>  /** @file
>
> +  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +
>Copyright Notice:
>Copyright 2019-2024 Distributed Management Task Force, Inc. All rights
> reserved.
>License: BSD 3-Clause License. For full text see link:
> https://github.com/DMTF/Redfish-JSON-C-Struct-
> Converter/blob/master/LICENSE.md
> @@ -829,6 +831,10 @@ GetRedfishPropertyStr (
>  return RedfishCS_status_not_found;
>}
>
> +  if (!json_is_string (TempJsonObj)) {
> +return RedfishCS_status_not_found;
> +  }
> +
>Status = allocateDuplicateStr (Cs, (char *)json_string_value (TempJsonObj),
> (void **)DstBuffer);
>return Status;
>  }
> @@ -914,6 +920,10 @@ GetRedfishPropertyInt64 (
>  return Status;
>}
>
> +  if (!json_is_integer (TempJsonObj)) {
> +return RedfishCS_status_not_found;
> +  }
> +
>**Dst = (RedfishCS_int64)json_integer_value (TempJsonObj);
>return RedfishCS_status_success;
>  }
> --
> 2.34.1



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




Re: [edk2-devel] [edk2 Patch 1/1] BaseTools: Syntax warning invalid escape sequence \C

2024-02-27 Thread Rebecca Cran

Merged as 3e91e421365027ee3e655feab33c67a4f544c777.


--
Rebecca Cran


On 2/6/24 00:02, Jayaprakash N wrote:

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

This commit fixes the issue reported through BZ4666.
The Syntax warning related to invalid escape sequence
for \C is seen on Windows OS based builds of edk2 sources.
On Windows the path seperator needs to prefixed with \
so essentially we need to use \\ as path seperator.

Cc: Rebecca Cran 
Cc: Michael D Kinney 
Cc: Laszlo Ersek 
Cc: Liming Gao 
Cc: Bob Feng 
Cc: Yuwei Chen 
Cc: Jayaprakash N 
Signed-off-by: Jayaprakash N 
---
  BaseTools/Source/Python/Workspace/DscBuildData.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Source/Python/Workspace/DscBuildData.py 
b/BaseTools/Source/Python/Workspace/DscBuildData.py
index 4768099343..b69d406249 100644
--- a/BaseTools/Source/Python/Workspace/DscBuildData.py
+++ b/BaseTools/Source/Python/Workspace/DscBuildData.py
@@ -2949,7 +2949,7 @@ class DscBuildData(PlatformBuildClassObject):
  for include_file in IncFileList:
  MakeApp += "$(OBJECTS) : %s\n" % include_file
  if sys.platform == "win32":
-PcdValueCommonPath = 
os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], 
"Source\C\Common\PcdValueCommon.c"))
+PcdValueCommonPath = 
os.path.normpath(mws.join(GlobalData.gGlobalDefines["EDK_TOOLS_PATH"], 
"Source\\C\\Common\\PcdValueCommon.c"))
  MakeApp = MakeApp + '%s\\PcdValueCommon.c : %s\n' % 
(self.OutputPath, PcdValueCommonPath)
  MakeApp = MakeApp + '\tcopy /y %s $@\n' % (PcdValueCommonPath)
  else:



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




Re: [edk2-devel] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-27 Thread Igor Kulchytskyy via groups.io
Reviewed-by: Igor Kulchytskyy 

Regards,
Igor

-Original Message-
From: abner.ch...@amd.com 
Sent: Sunday, February 25, 2024 11:55 PM
To: devel@edk2.groups.io
Cc: Nickle Wang ; Igor Kulchytskyy ; Mike 
Maslenkin 
Subject: [EXTERNAL] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify 
HTTP method used for provisioning


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

From: Abner Chang 

Clarify the HTTP method that is used to provision BIOS
managed Redfish resource.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Mike Maslenkin 
---
 RedfishClientPkg/Readme.md| 35 ---
 .../Media/redfish-call-flow-provisioning.svg  |  2 +-
 .../Media/redfish-synchronization-design.svg  |  4 +--
 3 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
index 82cb9c8c99..1789dff6f8 100644
--- a/RedfishClientPkg/Readme.md
+++ b/RedfishClientPkg/Readme.md
@@ -310,21 +310,32 @@ job.

 Several interfaces defined in EDKII Redfish Resource Config Protocol work 
together to support Redfish synchronization:
 - Identify()
-  - This function is used to check if the given Redfish resource is the one 
the feature driver wants to manage. A platform
-library `RedfishResourceIdentifyLib` is introduced for platform to 
implement its own policy to identify Redfish resource.
+  - This function is used to check if the given Redfish resource is the one 
the feature driver
+wants to manage. A platform library `RedfishResourceIdentifyLib` is 
introduced for
+platform to implement its own policy to identify Redfish resource.
 - Check()
-  - This function is used to check the attribute status on Redfish service. If 
all attributes the feature driver manages
-are presented in Redfish service, feature driver must provision them 
already. Otherwise, Provisioning() will be called
-to perform resource provisioning job.
+  - This function is used to check the attribute status on Redfish service. If 
all attributes
+the feature driver manages are presented in Redfish service, feature 
driver must provision
+them already. Otherwise, Provisioning() will be called to perform resource 
provisioning
+job.
 - Provisioning()
-  - When this function is called, feature driver will provision all attributes 
that it managed to Redfish service. This
-operation usually create new resource at Redfish service and require 
different operation that specified by Redfish service.
+  - When this function is called, feature driver will provision all attributes 
that it managed
+to Redfish service. This operation usually creates the new Redfish 
properties at the
+existing URI in Redfish service. Use HTTP PATCH to provision Redfish 
properties as BIOS
+may only manage some but not all of the properties of the resource. See 
[Redfish-edk2 
implementation](#Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfish)
 for
+the details. HTTP POST is still used for creating a collection member, 
such as the
+collection member of processor or memory for the Redfish inventory 
management.
+However, HTTP PUT to overwrite an entire Redfish resource is not used in 
edk2 Redfish
+implementation as edk2 Redfish implementation has no idea of whether the 
Redfish resource
+is entirely managed by BIOS or not.
 - Consume()
-  - When there is pending settings in Redfish service, this function is called 
for feature driver to consume pending settings
-requested by user.
+  - When there is pending settings in Redfish service, this function is called 
for feature
+driver to consume pending settings requested by user. HTTP GET is the 
method used
+to retrieve Redfish properties.
 - Update()
-  - When platform configuration is updated, this function is called to update 
configuration changes to Redfish service and
-Redfish service can show the latest settings on platform.
+  - When platform configuration is updated, this function is called to update 
configuration
+changes to Redfish service and Redfish service can show the latest 
settings on platform.
+HTTP PATCH is the method used to update the properties of Redfish resource.

 The EDKII Redfish Resource Addendum Protocol is introduced to provide platform 
addendum data that Redfish service requires.
 This protocol will be called at Provisioning() and Update() functions so 
platform can add OEM attribute or any other attribute
@@ -338,7 +349,7 @@ struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {
 };
 ```

-### Redfish Service Implementation that Incorporates with EDK2 Redfish
+### Redfish
 Service Implementation that Incorporates with EDK2 Redfish
 The idea of Redfish synchronization design is to manage Redfish resource 
directly by platform host
 firmware. To do this, Redfish synchronization functions have to 

Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-27 Thread Heinrich Schuchardt

On 27.02.24 07:37, Chao Li wrote:

DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));

DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it.

Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct-Wincompatible-pointer-types 
warnings")

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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Cc: Samer El-Haj-Mahmoud 
Cc: Eric Jin 
Cc: Arvin Chen 
Cc: Supreeth Venkatesh 
Cc: Heinrich Schuchardt 
Signed-off-by: Chao Li 
---
  .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
}
  
if (DNS->IsIPv6 == 0) {

-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
}
  
if (DNS->IsIPv6 == 1) {

-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
}
  
return (EFI_DEVICE_PATH_PROTOCOL *) DNS;


Reviewed-by: Heinrich Schuchardt 


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




[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/ConverterLib: check JSON value type

2024-02-27 Thread Nickle Wang via groups.io
Check and see if JSON object type is desired type before
getting its value. According to the Redfish schema, attribute
value can be null value. Add this error handling to avoid
system assertion while getting attribute value.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nick Ramirez 
---
 RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c 
b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
index 250ef75e4..7ee3c86e1 100644
--- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
+++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
@@ -1,5 +1,7 @@
 /** @file
 
+  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
   Copyright Notice:
   Copyright 2019-2024 Distributed Management Task Force, Inc. All rights 
reserved.
   License: BSD 3-Clause License. For full text see link: 
https://github.com/DMTF/Redfish-JSON-C-Struct-Converter/blob/master/LICENSE.md
@@ -829,6 +831,10 @@ GetRedfishPropertyStr (
 return RedfishCS_status_not_found;
   }
 
+  if (!json_is_string (TempJsonObj)) {
+return RedfishCS_status_not_found;
+  }
+
   Status = allocateDuplicateStr (Cs, (char *)json_string_value (TempJsonObj), 
(void **)DstBuffer);
   return Status;
 }
@@ -914,6 +920,10 @@ GetRedfishPropertyInt64 (
 return Status;
   }
 
+  if (!json_is_integer (TempJsonObj)) {
+return RedfishCS_status_not_found;
+  }
+
   **Dst = (RedfishCS_int64)json_integer_value (TempJsonObj);
   return RedfishCS_status_success;
 }
-- 
2.34.1



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




Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-27 Thread G Edhaya Chandran
The patch is upstreamed through the commit:
https://github.com/tianocore/edk2-test/commit/cabb98d44be94e7547605435a0be7c4946d10f8b


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




Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-27 Thread Chao Li

Hi Edhay,

OK, thank you!


Thanks,
Chao
On 2024/2/27 17:19, G Edhaya Chandran wrote:


Hi Li Chao,

    As per the maintenance process, I will raise a PR on your behalf 
based on your patch.


And will later close your PR.

With Warm Regards,
Edhay

*From:* Chao Li 
*Sent:* Tuesday, February 27, 2024 1:34 PM
*To:* devel@edk2.groups.io; G Edhaya Chandran 
*Subject:* Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter 
error in DevicePathFromTextBBTestCoverage.c


Hi Edhaya,

Thanks for you review, I have created a PR on Github: 
https://github.com/tianocore/edk2-test/pull/87


Thanks,
Chao

On 2024/2/27 15:50, G Edhaya Chandran wrote:

Hi Li Chao, Thank you for the solution.
Reviewed OK.

Reviewed-by: G Edhaya Chandran 
<mailto:edhaya.chand...@arm.com>



IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended 
recipient, please notify the sender immediately and do not disclose 
the contents to any other person, use it for any purpose, or store or 
copy the information in any medium. Thank you. 



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




Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-27 Thread G Edhaya Chandran
Hi Li Chao,

As per the maintenance process, I will raise a PR on your behalf based on 
your patch.
And will later close your PR.

With Warm Regards,
Edhay


From: Chao Li 
Sent: Tuesday, February 27, 2024 1:34 PM
To: devel@edk2.groups.io; G Edhaya Chandran 
Subject: Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in 
DevicePathFromTextBBTestCoverage.c


Hi Edhaya,

Thanks for you review, I have created a PR on Github: 
https://github.com/tianocore/edk2-test/pull/87

Thanks,
Chao
On 2024/2/27 15:50, G Edhaya Chandran wrote:
Hi Li Chao, Thank you for the solution.
Reviewed OK.

Reviewed-by: G Edhaya Chandran 
<mailto:edhaya.chand...@arm.com>

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.


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




Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-27 Thread Chao Li

Hi Edhaya,

Thanks for you review, I have created a PR on Github: 
https://github.com/tianocore/edk2-test/pull/87



Thanks,
Chao
On 2024/2/27 15:50, G Edhaya Chandran wrote:

Hi Li Chao, Thank you for the solution.
Reviewed OK.

Reviewed-by: G Edhaya Chandran 




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




Re: [edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread G Edhaya Chandran
Hi Li Chao, Thank you for the solution.
Reviewed OK.

Reviewed-by: G Edhaya Chandran 


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




[edk2-devel] [edk2-test v2] SctPkg: Fixed a pinter error in DevicePathFromTextBBTestCoverage.c

2024-02-26 Thread Chao Li
DevicePathFromTextBBTextCoverage.c function CreateDNSDeviceNode has a
bug, code:

SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));

DNS is a pointer, which is increased by a structure size and converted
to EFI_IPv4_ADDRESS*, which will point to an unknown address. So fix it.

Fixes: 847e0363e846 ("SctPkg: Fix the UefiSct-Wincompatible-pointer-types 
warnings")

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

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Cc: Samer El-Haj-Mahmoud 
Cc: Eric Jin 
Cc: Arvin Chen 
Cc: Supreeth Venkatesh 
Cc: Heinrich Schuchardt 
Signed-off-by: Chao Li 
---
 .../BlackBoxTest/DevicePathFromTextBBTestCoverage.c   | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
index c96ee246..bd11c25a 100644
--- 
a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
+++ 
b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DevicePathFromText/BlackBoxTest/DevicePathFromTextBBTestCoverage.c
@@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
   }
 
   if (DNS->IsIPv6 == 0) {
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
   }
 
   if (DNS->IsIPv6 == 1) {
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH)));
-SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH)));
+SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)((UINT8 *)DNS + sizeof 
(DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
   }
 
   return (EFI_DEVICE_PATH_PROTOCOL *) DNS;
-- 
2.27.0



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




Re: [edk2-devel] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-26 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi @Igor Kulchytskyy and @Mike Maslenkin,
I would like to wait until your review to make sure we all agree with the usage 
of HTTP methods in edk2 Redfish implementation.

Thanks
Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, February 26, 2024 9:51 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy ; Mike Maslenkin
> 
> Subject: RE: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP
> method used for provisioning
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Reviewed-by: Nickle Wang 
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: abner.ch...@amd.com 
> > Sent: Monday, February 26, 2024 12:55 PM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy ;
> > Mike Maslenkin 
> > Subject: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP
> method
> > used for provisioning
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: Abner Chang 
> >
> > Clarify the HTTP method that is used to provision BIOS managed Redfish
> > resource.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > Cc: Mike Maslenkin 
> > ---
> >  RedfishClientPkg/Readme.md| 35 ---
> >  .../Media/redfish-call-flow-provisioning.svg  |  2 +-  .../Media/redfish-
> > synchronization-design.svg  |  4 +--
> >  3 files changed, 26 insertions(+), 15 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
> index
> > 82cb9c8c99..1789dff6f8 100644
> > --- a/RedfishClientPkg/Readme.md
> > +++ b/RedfishClientPkg/Readme.md
> > @@ -310,21 +310,32 @@ job.
> >
> >  Several interfaces defined in EDKII Redfish Resource Config Protocol work
> > together to support Redfish synchronization:
> >  - Identify()
> > -  - This function is used to check if the given Redfish resource is the 
> > one the
> > feature driver wants to manage. A platform
> > -library `RedfishResourceIdentifyLib` is introduced for platform to
> implement its
> > own policy to identify Redfish resource.
> > +  - This function is used to check if the given Redfish resource is the 
> > one the
> > feature driver
> > +wants to manage. A platform library `RedfishResourceIdentifyLib` is
> > introduced for
> > +platform to implement its own policy to identify Redfish resource.
> >  - Check()
> > -  - This function is used to check the attribute status on Redfish 
> > service. If all
> > attributes the feature driver manages
> > -are presented in Redfish service, feature driver must provision them
> already.
> > Otherwise, Provisioning() will be called
> > -to perform resource provisioning job.
> > +  - This function is used to check the attribute status on Redfish 
> > service. If all
> > attributes
> > +the feature driver manages are presented in Redfish service, feature 
> > driver
> > must provision
> > +them already. Otherwise, Provisioning() will be called to perform 
> > resource
> > provisioning
> > +job.
> >  - Provisioning()
> > -  - When this function is called, feature driver will provision all 
> > attributes that
> it
> > managed to Redfish service. This
> > -operation usually create new resource at Redfish service and require
> different
> > operation that specified by Redfish service.
> > +  - When this function is called, feature driver will provision all 
> > attributes
> that it
> > managed
> > +to Redfish service. This operation usually creates the new Redfish
> properties
> > at the
> > +existing URI in Redfish service. Use HTTP PATCH to provision Redfish
> > properties as BIOS
> > +may only manage some but not all of the properties of the resource. See
> > [Redfish-edk2 implementation](#Redfish-Service-Implementation-that-
> > Incorporates-with-EDK2-Redfish) for
> > +the details. HTTP POST is still used for creating a collection member, 
> > such
> as
> > the
> > +collection member of processor or memory for the Redfish inventory
> > management.
> > +However, HTTP PUT to overwrite an entire Redfish resource is not used 
> > in
> > edk2 Redfish
> > +implementation as edk2 Redfish implementation has no idea of whether
> the
> > Redfish resource
> > +is entirely managed by BIOS or not.
> >  - Consume()
> > -  - When there is pending settings in Redfish service, this function is 
> > called
> for
> > feature driver to consume pending settings
> > -requested by user.
> > +  - When there is pending settings in Redfish service, this function is 
> > called
> for
> > feature
> > +driver to consume pending settings requested by user. HTTP GET is the
> method
> > used
> > +to retrieve Redfish properties.
> >  - Update()
> > -  - When platform configuration is updated, this function is called to 
> > update
> > configuration changes to Redfish service 

Re: [edk2-devel] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-26 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Monday, February 26, 2024 12:55 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy ;
> Mike Maslenkin 
> Subject: [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method
> used for provisioning
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Clarify the HTTP method that is used to provision BIOS managed Redfish
> resource.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Cc: Mike Maslenkin 
> ---
>  RedfishClientPkg/Readme.md| 35 ---
>  .../Media/redfish-call-flow-provisioning.svg  |  2 +-  .../Media/redfish-
> synchronization-design.svg  |  4 +--
>  3 files changed, 26 insertions(+), 15 deletions(-)
> 
> diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md index
> 82cb9c8c99..1789dff6f8 100644
> --- a/RedfishClientPkg/Readme.md
> +++ b/RedfishClientPkg/Readme.md
> @@ -310,21 +310,32 @@ job.
> 
>  Several interfaces defined in EDKII Redfish Resource Config Protocol work
> together to support Redfish synchronization:
>  - Identify()
> -  - This function is used to check if the given Redfish resource is the one 
> the
> feature driver wants to manage. A platform
> -library `RedfishResourceIdentifyLib` is introduced for platform to 
> implement its
> own policy to identify Redfish resource.
> +  - This function is used to check if the given Redfish resource is the one 
> the
> feature driver
> +wants to manage. A platform library `RedfishResourceIdentifyLib` is
> introduced for
> +platform to implement its own policy to identify Redfish resource.
>  - Check()
> -  - This function is used to check the attribute status on Redfish service. 
> If all
> attributes the feature driver manages
> -are presented in Redfish service, feature driver must provision them 
> already.
> Otherwise, Provisioning() will be called
> -to perform resource provisioning job.
> +  - This function is used to check the attribute status on Redfish service. 
> If all
> attributes
> +the feature driver manages are presented in Redfish service, feature 
> driver
> must provision
> +them already. Otherwise, Provisioning() will be called to perform 
> resource
> provisioning
> +job.
>  - Provisioning()
> -  - When this function is called, feature driver will provision all 
> attributes that it
> managed to Redfish service. This
> -operation usually create new resource at Redfish service and require 
> different
> operation that specified by Redfish service.
> +  - When this function is called, feature driver will provision all 
> attributes that it
> managed
> +to Redfish service. This operation usually creates the new Redfish 
> properties
> at the
> +existing URI in Redfish service. Use HTTP PATCH to provision Redfish
> properties as BIOS
> +may only manage some but not all of the properties of the resource. See
> [Redfish-edk2 implementation](#Redfish-Service-Implementation-that-
> Incorporates-with-EDK2-Redfish) for
> +the details. HTTP POST is still used for creating a collection member, 
> such as
> the
> +collection member of processor or memory for the Redfish inventory
> management.
> +However, HTTP PUT to overwrite an entire Redfish resource is not used in
> edk2 Redfish
> +implementation as edk2 Redfish implementation has no idea of whether the
> Redfish resource
> +is entirely managed by BIOS or not.
>  - Consume()
> -  - When there is pending settings in Redfish service, this function is 
> called for
> feature driver to consume pending settings
> -requested by user.
> +  - When there is pending settings in Redfish service, this function is 
> called for
> feature
> +driver to consume pending settings requested by user. HTTP GET is the 
> method
> used
> +to retrieve Redfish properties.
>  - Update()
> -  - When platform configuration is updated, this function is called to update
> configuration changes to Redfish service and
> -Redfish service can show the latest settings on platform.
> +  - When platform configuration is updated, this function is called to update
> configuration
> +changes to Redfish service and Redfish service can show the latest 
> settings on
> platform.
> +HTTP PATCH is the method used to update the properties of Redfish 
> resource.
> 
>  The EDKII Redfish Resource Addendum Protocol is introduced to provide 
> platform
> addendum data that Redfish service requires.
>  This protocol will be called at Provisioning() and Update() functions so 
> platform
> can add OEM attribute or any other attribute @@ -338,7 +349,7 @@ struct
> _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {  };  ```
> 
> -### Redfish Service Implementation that Incorporates with EDK2 Redfish
> +###  +name="Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfis
> +h">Redfish 

[edk2-devel] [edk2-redfish-client][PATCH] edk2-Redfish-client: Clarify HTTP method used for provisioning

2024-02-25 Thread Chang, Abner via groups.io
From: Abner Chang 

Clarify the HTTP method that is used to provision BIOS
managed Redfish resource.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Cc: Mike Maslenkin 
---
 RedfishClientPkg/Readme.md| 35 ---
 .../Media/redfish-call-flow-provisioning.svg  |  2 +-
 .../Media/redfish-synchronization-design.svg  |  4 +--
 3 files changed, 26 insertions(+), 15 deletions(-)

diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
index 82cb9c8c99..1789dff6f8 100644
--- a/RedfishClientPkg/Readme.md
+++ b/RedfishClientPkg/Readme.md
@@ -310,21 +310,32 @@ job.
 
 Several interfaces defined in EDKII Redfish Resource Config Protocol work 
together to support Redfish synchronization:
 - Identify()
-  - This function is used to check if the given Redfish resource is the one 
the feature driver wants to manage. A platform
-library `RedfishResourceIdentifyLib` is introduced for platform to 
implement its own policy to identify Redfish resource.
+  - This function is used to check if the given Redfish resource is the one 
the feature driver
+wants to manage. A platform library `RedfishResourceIdentifyLib` is 
introduced for
+platform to implement its own policy to identify Redfish resource.
 - Check()
-  - This function is used to check the attribute status on Redfish service. If 
all attributes the feature driver manages
-are presented in Redfish service, feature driver must provision them 
already. Otherwise, Provisioning() will be called
-to perform resource provisioning job.
+  - This function is used to check the attribute status on Redfish service. If 
all attributes
+the feature driver manages are presented in Redfish service, feature 
driver must provision
+them already. Otherwise, Provisioning() will be called to perform resource 
provisioning
+job.
 - Provisioning()
-  - When this function is called, feature driver will provision all attributes 
that it managed to Redfish service. This
-operation usually create new resource at Redfish service and require 
different operation that specified by Redfish service.
+  - When this function is called, feature driver will provision all attributes 
that it managed
+to Redfish service. This operation usually creates the new Redfish 
properties at the
+existing URI in Redfish service. Use HTTP PATCH to provision Redfish 
properties as BIOS
+may only manage some but not all of the properties of the resource. See 
[Redfish-edk2 
implementation](#Redfish-Service-Implementation-that-Incorporates-with-EDK2-Redfish)
 for
+the details. HTTP POST is still used for creating a collection member, 
such as the
+collection member of processor or memory for the Redfish inventory 
management.
+However, HTTP PUT to overwrite an entire Redfish resource is not used in 
edk2 Redfish
+implementation as edk2 Redfish implementation has no idea of whether the 
Redfish resource
+is entirely managed by BIOS or not.
 - Consume()
-  - When there is pending settings in Redfish service, this function is called 
for feature driver to consume pending settings
-requested by user.
+  - When there is pending settings in Redfish service, this function is called 
for feature
+driver to consume pending settings requested by user. HTTP GET is the 
method used
+to retrieve Redfish properties.
 - Update()
-  - When platform configuration is updated, this function is called to update 
configuration changes to Redfish service and
-Redfish service can show the latest settings on platform.
+  - When platform configuration is updated, this function is called to update 
configuration
+changes to Redfish service and Redfish service can show the latest 
settings on platform.
+HTTP PATCH is the method used to update the properties of Redfish resource.
 
 The EDKII Redfish Resource Addendum Protocol is introduced to provide platform 
addendum data that Redfish service requires.
 This protocol will be called at Provisioning() and Update() functions so 
platform can add OEM attribute or any other attribute
@@ -338,7 +349,7 @@ struct _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {
 };
 ```
 
-### Redfish Service Implementation that Incorporates with EDK2 Redfish
+### Redfish
 Service Implementation that Incorporates with EDK2 Redfish
 The idea of Redfish synchronization design is to manage Redfish resource 
directly by platform host
 firmware. To do this, Redfish synchronization functions have to work with 
Redfish service implementation
 in BMC firmware. This is because the mechanism between platform host firmware 
and BMC firmware is not
diff --git 
a/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg 
b/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg
index 70556152fe..d1d653b621 100755
--- a/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg
+++ b/RedfishClientPkg/Documents/Media/redfish-call-flow-provisioning.svg

Re: [edk2-devel] edk2-test: bug in DevicePathFromTextBBTestCoverage.c

2024-02-25 Thread Laszlo Ersek
Hello Charles,

On 2/24/24 17:01, Charles Hyde wrote:
> There is a bug in the following source file:
>
> uefi-sct\
>   SctPkg\
>  TestCase\
> UEFI\
>EFI\
>   Protocol\
>  DevicePathFromText\
> BlackBoxTest\
>DevicePathFromTextBBTestCoverage.c
>
>
> Lines 1737, 1738, 1742, and 1743 reference DNS without any cast
> override, which causes the pointer reference logic to be wrong,
> leading the functions SctStrToIPv4Addr and SctStrToIPv6Addr to cause
> memory corruption.  The DNS reference needs to have (UINT8 *) cast
> override, like is done in DevicePathToTextBBTestMain.c.

You are correct, as far as I can tell.

This is a regression from:

commit 847e0363e846296881c238dc43766fd40f6c2aec
Author: Abdul Lateef Attar 
Date:   Thu Jun 9 16:24:02 2022 +0530

SctPkg: Fix the UefiSct -Wincompatible-pointer-types warnings

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

Fixes the incompatible pointer types warning for UefiSct package.

Cc: G Edhaya Chandran 
Cc: Barton Gao 
Cc: Carolyn Gjertsen 
Cc: Samer El-Haj-Mahmoud 
Cc: Eric Jin 
Cc: Arvin Chen 
Cc: Supreeth Venkatesh 
Signed-off-by: Abdul Lateef Attar 

 500 files changed, 5537 insertions(+), 1162 deletions(-)

Unfortunately, the change for "DevicePathFromTextBBTestCoverage.c" in
this -- *way* oversized -- patch was incorrect:

> @@ -1734,13 +1734,13 @@ CreateDNSDeviceNode (
>}
>
>if (DNS->IsIPv6 == 0) {
> -SctStrToIPv4Addr (, (UINT8 *)DNS + sizeof (DNS_DEVICE_PATH));
> -SctStrToIPv4Addr (, (UINT8 *)DNS + sizeof (DNS_DEVICE_PATH) + 
> sizeof(EFI_IP_ADDRESS));
> +SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
> (DNS_DEVICE_PATH)));
> +SctStrToIPv4Addr (, (EFI_IPv4_ADDRESS *)(DNS + sizeof 
> (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
>}
>
>if (DNS->IsIPv6 == 1) {
> -SctStrToIPv6Addr (, (UINT8 *)DNS + sizeof (DNS_DEVICE_PATH));
> -SctStrToIPv6Addr (, (UINT8 *)DNS + sizeof (DNS_DEVICE_PATH) + 
> sizeof(EFI_IP_ADDRESS));
> +SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
> (DNS_DEVICE_PATH)));
> +SctStrToIPv6Addr (, (EFI_IPv6_ADDRESS *)(DNS + sizeof 
> (DNS_DEVICE_PATH) + sizeof(EFI_IP_ADDRESS)));
>}
>
>return (EFI_DEVICE_PATH_PROTOCOL *) DNS;

The original (UINT8*) cast was correct for determining the "IPv4Addr"
and "IPv6Addr" argument *values* for SctStrToIPv4Addr() and
SctStrToIPv6Addr(), respectively; the problem was with the argument
*types*. The patch added the necessary outer cast, but incorrectly
removed the still needed inner cast.

... The original code was in poor style to begin with. The following
should work, without any casts at all:

  SctStrToIPv4Addr (, >DnsServerIp[0].v4);
  SctStrToIPv4Addr (, >DnsServerIp[1].v4);

  SctStrToIPv6Addr (, >DnsServerIp[0].v6);
  SctStrToIPv6Addr (, >DnsServerIp[1].v6);

That's because DNS is of type pointer-to-DNS_DEVICE_PATH, and
DNS_DEVICE_PATH is defined as follows, in
"MdePkg/Include/Protocol/DevicePath.h":

> #pragma pack(1)
> ...
> typedef struct {
>   EFI_DEVICE_PATH_PROTOCOLHeader;
>   ///
>   /// Indicates the DNS server address is IPv4 or IPv6 address.
>   ///
>   UINT8   IsIPv6;
>   ///
>   /// Instance of the DNS server address.
>   ///
>   EFI_IP_ADDRESS  DnsServerIp[];
> } DNS_DEVICE_PATH;
> ...
> #pragma pack()

and "EFI_IP_ADDRESS" is defined in "MdePkg/Include/Uefi/UefiBaseType.h"
as follows:

> typedef union {
>   UINT32  Addr[4];
>   EFI_IPv4_ADDRESSv4;
>   EFI_IPv6_ADDRESSv6;
> } EFI_IP_ADDRESS;

The "DnsServerIp" flexible array member should simply be put to use.

AbduL, can you please post a fix?

Thanks
Laszlo



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




Re: [edk2-devel] [edk2-InfSpecification PATCH 0/2] README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() for SEC modules

2024-02-24 Thread Laszlo Ersek
On 2/24/24 22:28, Laszlo Ersek wrote:
> The first patch is a minor cleanup, the new feature is documented in the
> second patch.
> 
> Rendered version:
> 
>   
> https://lersek.github.io/edk2-InfSpecification/ProcessLibraryConstructorList-SEC-991/
>   
> https://github.com/lersek/edk2-InfSpecification/actions/workflows/gitbook-action.yml

Branch on github, if someone wants to fetch it:

https://github.com/lersek/edk2-InfSpecification/tree/ProcessLibraryConstructorList-SEC-991

Laszlo

> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Rebecca Cran 
> Cc: Yuwei Chen 
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (2):
>   README.md: fix revision history whitespace
>   README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() for SEC
> modules
> 
>  README.md | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> 
> base-commit: a31e3c842beed72661b6ccf9dbb34df8d0c1afa6
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [edk2-BuildSpecification PATCH 0/3] AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules

2024-02-24 Thread Laszlo Ersek
On 2/24/24 22:23, Laszlo Ersek wrote:
> The first two patches are cleanups, the new feature is documented in the
> third patch.
> 
> I managed to render these updates to public HTML, following
> 
> (a) Mike's note from October 2020:
> 
>   https://edk2.groups.io/g/devel/message/66426
>   msgid 
> 
> 
> (b) the github access token / project secrets steps at
> 
>   
> https://github.com/ZanderZhao/gitbook-action?tab=readme-ov-file#step2--generate-token-and-add-to-secrets
> 
> Therefore:
> 
>   
> https://lersek.github.io/edk2-BuildSpecification/ProcessLibraryConstructorList-SEC-991/
>   
> https://github.com/lersek/edk2-BuildSpecification/actions/workflows/gitbook-action.yml

Branch on github, if someone wants to fetch it:

https://github.com/lersek/edk2-BuildSpecification/tree/ProcessLibraryConstructorList-SEC-991

Laszlo

> 
> Cc: Bob Feng 
> Cc: Liming Gao 
> Cc: Michael D Kinney 
> Cc: Rebecca Cran 
> Cc: Yuwei Chen 
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (3):
>   README.md: fix revision history whitespace
>   AutoGen.c: list the SEC module type for /
> (VOID)
>   AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules
> 
>  8_pre-build_autogen_stage/83_auto-generated_code.md | 42 +++-
>  README.md   |  5 ++-
>  2 files changed, 36 insertions(+), 11 deletions(-)
> 
> 
> base-commit: db69f5661caec977fac9730e21e5a1132f6ff80b
> 
> 
> 
> 
> 



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




[edk2-devel] [edk2-InfSpecification PATCH 2/2] README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() for SEC modules

2024-02-24 Thread Laszlo Ersek
Simply bump INF_VERSION (spec release version) as a fence for the feature

  AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules

described comprehensively in the Build spec.

(The INF spec does not seem to have an explicit compatibility table tied
to INF_VERSION, except this revision history in "README.md". Furthermore,
sections "2.1 Processing Overview" and "2.4 [Defines] Section" explicitly
defer to the Build spec regarding the autogenerated files.)

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Suggested-by: Liming Gao 
Suggested-by: Michael D Kinney 
Signed-off-by: Laszlo Ersek 
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index ea7bf9b9dc43..d077ab1ceaad 100644
--- a/README.md
+++ b/README.md
@@ -203,3 +203,4 @@ Copyright (c) 2007-2017, Intel Corporation. All rights 
reserved.
 || [#1162](https://bugzilla.tianocore.org/show_bug.cgi?id=1162) 
Correct the item in Table 1 to align with 3.4 section   

   |   |
 | 1.28   | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) 
Update INF spec to remove EDK related contents  

   | Mar 2019  |
 | 1.29   | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) 
Add new MODULE_TYPE HOST_APPLICATION

   | July 2019 |
+| 1.30   | [#991](https://bugzilla.tianocore.org/show_bug.cgi?id=991) 
generate ProcessLibraryConstructorList() declaration in AutoGen.h for SEC 
modules 
   | February 2024 |


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




[edk2-devel] [edk2-InfSpecification PATCH 1/2] README.md: fix revision history whitespace

2024-02-24 Thread Laszlo Ersek
Fix the right-hand-side whitespace in the revision history table.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Signed-off-by: Laszlo Ersek 
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 60fba19fd67f..ea7bf9b9dc43 100644
--- a/README.md
+++ b/README.md
@@ -201,5 +201,5 @@ Copyright (c) 2007-2017, Intel Corporation. All rights 
reserved.
 || Add clarification that !error statement is not permitted in INF 
file

|   |
 || INF Spec: FixedAtBuild (VOID*) PCD use in the [DEPEX] section   


|   |
 || [#1162](https://bugzilla.tianocore.org/show_bug.cgi?id=1162) 
Correct the item in Table 1 to align with 3.4 section   

   |   |
-| 1.28   | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) 
Update INF spec to remove EDK related contents  



  | Mar 2019  |
-| 1.29   | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) 
Add new MODULE_TYPE HOST_APPLICATION

   | July 2019  |
+| 1.28   | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) 
Update INF spec to remove EDK related contents  

   | Mar 2019  |
+| 1.29   | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) 
Add new MODULE_TYPE HOST_APPLICATION

   | July 2019 |



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




[edk2-devel] [edk2-InfSpecification PATCH 0/2] README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() for SEC modules

2024-02-24 Thread Laszlo Ersek
The first patch is a minor cleanup, the new feature is documented in the
second patch.

Rendered version:

  
https://lersek.github.io/edk2-InfSpecification/ProcessLibraryConstructorList-SEC-991/
  
https://github.com/lersek/edk2-InfSpecification/actions/workflows/gitbook-action.yml

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 

Thanks
Laszlo

Laszlo Ersek (2):
  README.md: fix revision history whitespace
  README: INF_VERSION >= 1.30: declare ProcessLibraryCon...() for SEC
modules

 README.md | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)


base-commit: a31e3c842beed72661b6ccf9dbb34df8d0c1afa6


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




[edk2-devel] [edk2-BuildSpecification PATCH 2/3] AutoGen.c: list the SEC module type for / (VOID)

2024-02-24 Thread Laszlo Ersek
Minimally as of edk2 commit edc6681206c1, the

- CreateLibraryConstructorCode()
- CreateLibraryDestructorCode()

methods in "BaseTools/Source/Python/AutoGen/GenC.py" generate declarations
and calls of the form

-  (VOID)
-  (VOID)

(respectively), for pre-requisite libraries that have type BASE or SEC:

   1340 if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
   1341 
ConstructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
   1342 
ConstructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))

   1403 if Lib.ModuleType in [SUP_MODULE_BASE, SUP_MODULE_SEC]:
   1404 
DestructorPrototypeString.Append(gLibraryStructorPrototype[SUP_MODULE_BASE].Replace(Dict))
   1405 
DestructorCallingString.Append(gLibraryStructorCall[SUP_MODULE_BASE].Replace(Dict))

The build spec only lists BASE thus far; cover SEC now.

This patch is best viewed with "git show -W".

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Signed-off-by: Laszlo Ersek 
---
 8_pre-build_autogen_stage/83_auto-generated_code.md | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/8_pre-build_autogen_stage/83_auto-generated_code.md 
b/8_pre-build_autogen_stage/83_auto-generated_code.md
index b9a40ef44435..3e1da3809000 100644
--- a/8_pre-build_autogen_stage/83_auto-generated_code.md
+++ b/8_pre-build_autogen_stage/83_auto-generated_code.md
@@ -756,7 +756,7 @@ library instances that are being linked to.
 ```c
 If (CONSTRUCTOR defined in INF) {
 
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
 include_statement (AutoGen.c, "
   EFI_STATUS
   EFIAPI
@@ -798,7 +798,7 @@ If (CONSTRUCTOR defined in INF) {
 
 } // End CONSTRUCTOR defined in INF
 
-If (MODULE_TYPE == "BASE") {
+If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
   include_statement (AutoGen.c, "
 VOID
 EFIAPI
@@ -841,11 +841,11 @@ include_statement (AutoGen.c, "
 ");
 
 If (CONSTRUCTOR defined in INF) {
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
 include_statement (AutoGen.c, "
EFI_STATUS Status;
 
-   Status = ();
+   Status =  ();
ASSERT_EFI_ERROR (Status);
 
 ");
@@ -889,7 +889,7 @@ of the library instances that are being linked to.
 
 ```c
 If (DESTRUCTOR defined in INF) {
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
 include_statement (AutoGen.c, "
   EFI_STATUS
   EFIAPI
@@ -925,7 +925,7 @@ If (DESTRUCTOR defined in INF) {
   }
 } // End DESTRUCTOR defined in INF
 
-If (MODULE_TYPE == "BASE") {
+If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
   include_statement (AutoGen.c, "
 VOID
 EFIAPI
@@ -971,11 +971,11 @@ include_statement (AutoGen.c, "
 ");
 
 If (DESTRUCTOR defined in INF) {
-  If (MODULE_TYPE == "BASE") {
+  If ((MODULE_TYPE == "BASE") || (MODULE_TYPE == "SEC")) {
 include_statement (AutoGen.c, "
   EFI_STATUS Status;
 
-  Status = ();
+  Status =  ();
   ASSERT_EFI_ERROR (Status);
 
 ");



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




[edk2-devel] [edk2-BuildSpecification PATCH 3/3] AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules

2024-02-24 Thread Laszlo Ersek
Most module types have standardized entry point function prototypes. They
are declared in headers like

- MdePkg/Include/Library/PeiCoreEntryPoint.h
- MdePkg/Include/Library/PeimEntryPoint.h
- MdePkg/Include/Library/DxeCoreEntryPoint.h
- MdePkg/Include/Library/UefiDriverEntryPoint.h
- MdePkg/Include/Library/UefiApplicationEntryPoint.h

These header files also declare matching ProcessLibraryConstructorList()
prototypes.

The SEC module type does not have a standardized entry point prototype
(aka parameter list), therefore no header file like the above ones exists
for SEC. Consequently, no header file *declares*
ProcessLibraryConstructorList() for SEC modules, even though AutoGen
always *defines* ProcessLibraryConstructorList() with the same, empty,
parameter list (i.e., just (VOID)).

The lack of a central declaration is a problem because in SEC code,
ProcessLibraryConstructorList() needs to be called manually, and those
calls need a prototype. Most SEC modules in edk2 get around this by
declaring ProcessLibraryConstructorList() manually, while some others use
an incorrect (PEIM) prototype.

Liming suggested in
 that AutoGen
provide the declaration as well. Accompanying the upcoming BaseTools
patch, document the feature in the Build spec.

"INF_VERSION >= 1.30" reflects that the latest (draft) version of the INF
specification, as of this writing, is commit a31e3c842bee / version 1.29.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Suggested-by: Liming Gao 
Suggested-by: Michael D Kinney 
Signed-off-by: Laszlo Ersek 
---
 8_pre-build_autogen_stage/83_auto-generated_code.md | 26 +++-
 README.md   |  1 +
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/8_pre-build_autogen_stage/83_auto-generated_code.md 
b/8_pre-build_autogen_stage/83_auto-generated_code.md
index 3e1da3809000..8b20a6ace9f8 100644
--- a/8_pre-build_autogen_stage/83_auto-generated_code.md
+++ b/8_pre-build_autogen_stage/83_auto-generated_code.md
@@ -649,7 +649,31 @@ include_statement(AutoGen.h, "
 ");
 ```
 
- 8.3.6.5 AutoGen Epilogue
+ 8.3.6.5 `ProcessLibraryConstructorList` function declaration
+
+Entry point functions of non-library SEC modules do not have standardized
+parameter lists, therefore edk2 does not offer an
+`MdePkg/Include/Library/*EntryPoint.h` header file for such modules.
+Consequently, `ProcessLibraryConstructorList` is not declared for them either,
+despite the fact that they must call `ProcessLibraryConstructorList` 
explicitly.
+Historically, each such module has declared `ProcessLibraryConstructorList`
+internally for itself, compensating for the lack of a central declaration.
+
+The `ProcessLibraryConstructorList` function is declared in `AutoGen.h` for
+non-library SEC modules, if `INF_VERSION` in the module's INF file is greater
+than or equal to `1.30`.
+
+```c
+include_statement (AutoGen.h, "
+  VOID
+  EFIAPI
+  ProcessLibraryConstructorList (
+VOID
+  );
+");
+```
+
+ 8.3.6.6 AutoGen Epilogue
 
 ```c
 #ifdef __cplusplus
diff --git a/README.md b/README.md
index 6d41f3a94fc2..7c7c2a60bd2d 100644
--- a/README.md
+++ b/README.md
@@ -231,3 +231,4 @@ Copyright (c) 2008-2017, Intel Corporation. All rights 
reserved.
 || [#598](https://bugzilla.tianocore.org/show_bug.cgi?id=598) 
update supported operators in 8.2.4.6 Expressions   


 |   |
 | 1.29   | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) 
Update Build spec to remove EDK related contents


   | Mar 2019  |
 | 1.30   | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) 
Update Build spec to support HOST_APPLICATION MODULE_TYPE   


   | July 2019 |
+| 1.31   | [#991](https://bugzilla.tianocore.org/show_bug.cgi?id=991) 
generate ProcessLibraryConstructorList() declaration in AutoGen.h for SEC 
modules 

   | February 2024 |


-=-=-=-=-=-=-=-=-=-=-=-

[edk2-devel] [edk2-BuildSpecification PATCH 0/3] AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules

2024-02-24 Thread Laszlo Ersek
The first two patches are cleanups, the new feature is documented in the
third patch.

I managed to render these updates to public HTML, following

(a) Mike's note from October 2020:

  https://edk2.groups.io/g/devel/message/66426
  msgid 


(b) the github access token / project secrets steps at

  
https://github.com/ZanderZhao/gitbook-action?tab=readme-ov-file#step2--generate-token-and-add-to-secrets

Therefore:

  
https://lersek.github.io/edk2-BuildSpecification/ProcessLibraryConstructorList-SEC-991/
  
https://github.com/lersek/edk2-BuildSpecification/actions/workflows/gitbook-action.yml

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 

Thanks
Laszlo

Laszlo Ersek (3):
  README.md: fix revision history whitespace
  AutoGen.c: list the SEC module type for /
(VOID)
  AutoGen.h: declare ProcessLibraryConstructorList() for SEC modules

 8_pre-build_autogen_stage/83_auto-generated_code.md | 42 +++-
 README.md   |  5 ++-
 2 files changed, 36 insertions(+), 11 deletions(-)


base-commit: db69f5661caec977fac9730e21e5a1132f6ff80b


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




[edk2-devel] [edk2-BuildSpecification PATCH 1/3] README.md: fix revision history whitespace

2024-02-24 Thread Laszlo Ersek
Fix the right-hand-side whitespace in the revision history table.

Cc: Bob Feng 
Cc: Liming Gao 
Cc: Michael D Kinney 
Cc: Rebecca Cran 
Cc: Yuwei Chen 
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=991
Signed-off-by: Laszlo Ersek 
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index bedc3e7ce6e4..6d41f3a94fc2 100644
--- a/README.md
+++ b/README.md
@@ -229,5 +229,5 @@ Copyright (c) 2008-2017, Intel Corporation. All rights 
reserved.
 || Add !error statement section



|   |
 || [#1110](https://bugzilla.tianocore.org/show_bug.cgi?id=1110) 
Extend exclamation statement's keyword to case-insensitive  


   |   |
 || [#598](https://bugzilla.tianocore.org/show_bug.cgi?id=598) 
update supported operators in 8.2.4.6 Expressions   


 |   |
-| 1.29   | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) 
Update Build spec to remove EDK related contents



| Mar 2019  |
-| 1.30   | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) 
Update Build spec to support HOST_APPLICATION MODULE_TYPE   


   | July 2019  |
+| 1.29   | [#1453](https://bugzilla.tianocore.org/show_bug.cgi?id=1453) 
Update Build spec to remove EDK related contents


   | Mar 2019  |
+| 1.30   | [#1952](https://bugzilla.tianocore.org/show_bug.cgi?id=1952) 
Update Build spec to support HOST_APPLICATION MODULE_TYPE   


   | July 2019 |



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




[edk2-devel] edk2-test: bug in DevicePathFromTextBBTestCoverage.c

2024-02-24 Thread Charles Hyde

There is a bug in the following source file:

uefi-sct\
  SctPkg\
 TestCase\
UEFI\
   EFI\
  Protocol\
 DevicePathFromText\
BlackBoxTest\
   DevicePathFromTextBBTestCoverage.c


Lines 1737, 1738, 1742, and 1743 reference DNS without any cast override, 
which causes the pointer reference logic to be wrong, leading the functions 
SctStrToIPv4Addr and SctStrToIPv6Addr to cause memory corruption.  The DNS 
reference needs to have (UINT8 *) cast override, like is done in 
DevicePathToTextBBTestMain.c.


Regards,
Chip 




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




Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-23 Thread Nickle Wang via groups.io
Thanks Mike! I merged the pull request.

Regards,
Nickle

From: M M 
Sent: Friday, February 23, 2024 7:32 PM
To: Nickle Wang 
Cc: devel@edk2.groups.io; Abner Chang ; Igor Kulchytskyy 

Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: 
refine RedfishExternalResourceResourceFeatureCallback

External email: Use caution opening links or attachments

Hi Nickle,

I've updated commit message with your R-b and pushed it to PR.

Regards,
Mike.


On 23. 2. 2024., at 12:38, Nickle Wang 
mailto:nick...@nvidia.com>> wrote:

Hi @Mike Maslenkin<mailto:mike.maslen...@gmail.com>,

Can you please help me to add my reviewed-by to this commit message? 
https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af
  Then I can merge this pull request.

Thanks,
Nickle

> -Original Message-
> From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
> mailto:devel@edk2.groups.io>> On Behalf Of Nickle Wang
> via groups.io<http://groups.io/>
> Sent: Thursday, February 22, 2024 10:14 AM
> To: Mike Maslenkin 
> mailto:mike.maslen...@gmail.com>>; 
> devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> Cc: Abner Chang mailto:abner.ch...@amd.com>>; Igor 
> Kulchytskyy mailto:ig...@ami.com>>
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] 
> RedfishClientPkg:
> refine RedfishExternalResourceResourceFeatureCallback
>
> External email: Use caution opening links or attachments
>
>
> Thanks for addressing my comment.
>
>
> Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>
> > Sent: Thursday, February 22, 2024 4:06 AM
> > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>
> > Cc: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>; Nickle Wang
> > mailto:nick...@nvidia.com>>; Abner Chang 
> > mailto:abner.ch...@amd.com>>; Igor
> > Kulchytskyy mailto:ig...@ami.com>>
> > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> > RedfishExternalResourceResourceFeatureCallback
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Use local variable for BiosUri passed to HandleResource() to avoid
> > problems in case of Private->Uri is overriden down the call stack.
> >
> > Suggested-by: Nickle Wang mailto:nick...@nvidia.com>>
> > Cc: Abner Chang mailto:abner.ch...@amd.com>>
> > Cc: Nickle Wang mailto:nick...@nvidia.com>>
> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
> > Signed-off-by: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>
> > ---
> >  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-
> >  1 file changed, 6 insertions(+), 5 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > index f40f2d85af80..db77ed3dfccb 100644
> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> >REDFISH_SERVICE  RedfishService;
> >
> >REDFISH_RESOURCE_COMMON_PRIVATE  *Private;
> >
> >EFI_STRING   ResourceUri;
> >
> > +  EFI_STRING   BiosUri;
> >
> >
> >
> >if (FeatureAction != CallbackActionStartOperation) {
> >
> >  return EFI_UNSUPPORTED;
> >
> > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> >//
> >
> >// Initialize collection path
> >
> >//
> >
> > -  Private->Uri = RedfishGetUri (ResourceUri);
> >
> > -  if (Private->Uri == NULL) {
> >
> > +  BiosUri = RedfishGetUri (ResourceUri);
> >
> > +  if (BiosUri == NULL) {
> >
> >  ASSERT (FALSE);
> >
> >  FreePool (ResourceUri);
> >
> >  return EFI_OUT_OF_RESOURCES;
> >
> >}
> >
> >
> >
> > -  Status = HandleResource (Private, Private->Uri);
> >
> > +  Status = HandleResource (Private, BiosUri);
> >
> >if (EFI_ERROR (Status)) {
> >
> > -DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> > __func__, Private->Uri, Status));
> >
> > +DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> > + %r\n", __func__, BiosUri, Status));
> >
> >}
> >
> >
> >
> > -  FreePool (Private->Uri);
> >
> > +  FreePool (BiosUri);
> >
> >FreePool (ResourceUri);
> >
> >return Status;
> >
> >  }
> >
> > --
> > 2.32.0 (Apple Git-132)
>
>
>
> 
>



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




Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-23 Thread Mike Maslenkin
Hi Nickle,

I've updated commit message with your R-b and pushed it to PR.

Regards,
Mike.

> On 23. 2. 2024., at 12:38, Nickle Wang  wrote:
> 
> Hi @Mike Maslenkin <mailto:mike.maslen...@gmail.com>,
>  
> Can you please help me to add my reviewed-by to this commit message? 
> https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af
>  
> <https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af>
>   Then I can merge this pull request.
>  
> Thanks,
> Nickle
>  
> > -Original Message-
> > From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> 
> > mailto:devel@edk2.groups.io>> On Behalf Of Nickle 
> > Wang
> > via groups.io <http://groups.io/>
> > Sent: Thursday, February 22, 2024 10:14 AM
> > To: Mike Maslenkin  > <mailto:mike.maslen...@gmail.com>>; devel@edk2.groups.io 
> > <mailto:devel@edk2.groups.io>
> > Cc: Abner Chang mailto:abner.ch...@amd.com>>; Igor 
> > Kulchytskyy mailto:ig...@ami.com>>
> > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] 
> > RedfishClientPkg:
> > refine RedfishExternalResourceResourceFeatureCallback
> > 
> > External email: Use caution opening links or attachments
> > 
> > 
> > Thanks for addressing my comment.
> > 
> > 
> > Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>
> > 
> > Regards,
> > Nickle
> > 
> > > -Original Message-
> > > From: Mike Maslenkin  > > <mailto:mike.maslen...@gmail.com>>
> > > Sent: Thursday, February 22, 2024 4:06 AM
> > > To: devel@edk2.groups.io <mailto:devel@edk2.groups.io>
> > > Cc: Mike Maslenkin  > > <mailto:mike.maslen...@gmail.com>>; Nickle Wang
> > > mailto:nick...@nvidia.com>>; Abner Chang 
> > > mailto:abner.ch...@amd.com>>; Igor
> > > Kulchytskyy mailto:ig...@ami.com>>
> > > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> > > RedfishExternalResourceResourceFeatureCallback
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > Use local variable for BiosUri passed to HandleResource() to avoid
> > > problems in case of Private->Uri is overriden down the call stack.
> > >
> > > Suggested-by: Nickle Wang mailto:nick...@nvidia.com>>
> > > Cc: Abner Chang mailto:abner.ch...@amd.com>>
> > > Cc: Nickle Wang mailto:nick...@nvidia.com>>
> > > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>
> > > Signed-off-by: Mike Maslenkin  > > <mailto:mike.maslen...@gmail.com>>
> > > ---
> > >  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-
> > >  1 file changed, 6 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > index f40f2d85af80..db77ed3dfccb 100644
> > > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> > > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
> > >REDFISH_SERVICE  RedfishService;
> > >
> > >REDFISH_RESOURCE_COMMON_PRIVATE  *Private;
> > >
> > >EFI_STRING   ResourceUri;
> > >
> > > +  EFI_STRING   BiosUri;
> > >
> > >
> > >
> > >if (FeatureAction != CallbackActionStartOperation) {
> > >
> > >  return EFI_UNSUPPORTED;
> > >
> > > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
> > >//
> > >
> > >// Initialize collection path
> > >
> > >//
> > >
> > > -  Private->Uri = RedfishGetUri (ResourceUri);
> > >
> > > -  if (Private->Uri == NULL) {
> > >
> > > +  BiosUri = RedfishGetUri (ResourceUri);
> > >
> > > +  if (BiosUri == NULL) {
> > >
> > >  ASSERT (FALSE);
> > >
> > >  FreePool (ResourceUri);
> > >
> > >  return EFI_OUT_OF_RESOURCES;
> > >
> > >}
> > >
> > >
> > >
> > > -  Status = HandleResource (Private, Private->Uri);
> > >
> > > +  Status = HandleResource (Private, BiosUri);
> > >
> > >if (EFI_ERROR (Status)) {
> > >
> > > -DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: 
> > > %r\n",
> > > __func__, Private->Uri, Status));
> > >
> > > +DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> > > + %r\n", __func__, BiosUri, Status));
> > >
> > >}
> > >
> > >
> > >
> > > -  FreePool (Private->Uri);
> > >
> > > +  FreePool (BiosUri);
> > >
> > >FreePool (ResourceUri);
> > >
> > >return Status;
> > >
> > >  }
> > >
> > > --
> > > 2.32.0 (Apple Git-132)
> > 
> > 
> > 
> > 
> > 



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




Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-23 Thread Nickle Wang via groups.io
Hi @Mike Maslenkin<mailto:mike.maslen...@gmail.com>,



Can you please help me to add my reviewed-by to this commit message? 
https://github.com/tianocore/edk2-redfish-client/pull/76/commits/7110d17629d6131030a3c382ca46d9331e13f2af
  Then I can merge this pull request.



Thanks,

Nickle



> -Original Message-

> From: devel@edk2.groups.io  On Behalf Of Nickle Wang

> via groups.io

> Sent: Thursday, February 22, 2024 10:14 AM

> To: Mike Maslenkin ; devel@edk2.groups.io

> Cc: Abner Chang ; Igor Kulchytskyy 

> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] 
> RedfishClientPkg:

> refine RedfishExternalResourceResourceFeatureCallback

>

> External email: Use caution opening links or attachments

>

>

> Thanks for addressing my comment.

>

>

> Reviewed-by: Nickle Wang mailto:nick...@nvidia.com>>

>

> Regards,

> Nickle

>

> > -Original Message-

> > From: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > Sent: Thursday, February 22, 2024 4:06 AM

> > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>

> > Cc: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>; Nickle Wang

> > mailto:nick...@nvidia.com>>; Abner Chang 
> > mailto:abner.ch...@amd.com>>; Igor

> > Kulchytskyy mailto:ig...@ami.com>>

> > Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine

> > RedfishExternalResourceResourceFeatureCallback

> >

> > External email: Use caution opening links or attachments

> >

> >

> > Use local variable for BiosUri passed to HandleResource() to avoid

> > problems in case of Private->Uri is overriden down the call stack.

> >

> > Suggested-by: Nickle Wang mailto:nick...@nvidia.com>>

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

> > Cc: Nickle Wang mailto:nick...@nvidia.com>>

> > Cc: Igor Kulchytskyy mailto:ig...@ami.com>>

> > Signed-off-by: Mike Maslenkin 
> > mailto:mike.maslen...@gmail.com>>

> > ---

> >  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-

> >  1 file changed, 6 insertions(+), 5 deletions(-)

> >

> > diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > index f40f2d85af80..db77ed3dfccb 100644

> > --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c

> > @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (

> >REDFISH_SERVICE  RedfishService;

> >

> >REDFISH_RESOURCE_COMMON_PRIVATE  *Private;

> >

> >EFI_STRING   ResourceUri;

> >

> > +  EFI_STRING   BiosUri;

> >

> >

> >

> >if (FeatureAction != CallbackActionStartOperation) {

> >

> >  return EFI_UNSUPPORTED;

> >

> > @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (

> >//

> >

> >// Initialize collection path

> >

> >//

> >

> > -  Private->Uri = RedfishGetUri (ResourceUri);

> >

> > -  if (Private->Uri == NULL) {

> >

> > +  BiosUri = RedfishGetUri (ResourceUri);

> >

> > +  if (BiosUri == NULL) {

> >

> >  ASSERT (FALSE);

> >

> >  FreePool (ResourceUri);

> >

> >  return EFI_OUT_OF_RESOURCES;

> >

> >}

> >

> >

> >

> > -  Status = HandleResource (Private, Private->Uri);

> >

> > +  Status = HandleResource (Private, BiosUri);

> >

> >if (EFI_ERROR (Status)) {

> >

> > -DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",

> > __func__, Private->Uri, Status));

> >

> > +DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:

> > + %r\n", __func__, BiosUri, Status));

> >

> >}

> >

> >

> >

> > -  FreePool (Private->Uri);

> >

> > +  FreePool (BiosUri);

> >

> >FreePool (ResourceUri);

> >

> >return Status;

> >

> >  }

> >

> > --

> > 2.32.0 (Apple Git-132)

>

>

>

> 

>




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115877): https://edk2.groups.io/g/devel/message/115877
Mute This Topic: https://groups.io/mt/104495956/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 V3] Silicon/Marvell: Update for UEFI spec v2.9 - mantis #1866

2024-02-22 Thread Gahan
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4689

Bug 4689 - GetInfo() of Adapter Information Protocol
should have a provision for IHV to return no data for
UEFI Spec compliance 2.9 [mantis #1866]

Cc: Marcin Wojtas 
Cc: Leif Lindholm 
Signed-off-by: Gahan Saraiya 
---
 Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c 
b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
index 5e463ac932..517b21940d 100644
--- a/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
+++ b/Silicon/Marvell/Drivers/Net/Pp2Dxe/Pp2Dxe.c
@@ -1394,6 +1394,7 @@ Pp2DxeSnpInstall (

   @retval EFI_SUCCESSThe InformationType information was 
retrieved.
   @retval EFI_UNSUPPORTEDThe InformationType is not known.
+  @retval EFI_NOT_FOUND  Information is not available for the 
requested information type.
   @retval EFI_DEVICE_ERROR   The device reported an error.
   @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to 
a lack of resources.
   @retval EFI_INVALID_PARAMETER  This is NULL.
--
2.39.2.windows.1



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




Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-21 Thread Nickle Wang via groups.io
Thanks for addressing my comment.


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: Mike Maslenkin 
> Sent: Thursday, February 22, 2024 4:06 AM
> To: devel@edk2.groups.io
> Cc: Mike Maslenkin ; Nickle Wang
> ; Abner Chang ; Igor Kulchytskyy
> 
> Subject: [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine
> RedfishExternalResourceResourceFeatureCallback
> 
> External email: Use caution opening links or attachments
> 
> 
> Use local variable for BiosUri passed to HandleResource() to avoid problems in
> case of Private->Uri is overriden down the call stack.
> 
> Suggested-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> Signed-off-by: Mike Maslenkin 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index f40f2d85af80..db77ed3dfccb 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
>REDFISH_SERVICE  RedfishService;
> 
>REDFISH_RESOURCE_COMMON_PRIVATE  *Private;
> 
>EFI_STRING   ResourceUri;
> 
> +  EFI_STRING   BiosUri;
> 
> 
> 
>if (FeatureAction != CallbackActionStartOperation) {
> 
>  return EFI_UNSUPPORTED;
> 
> @@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
>//
> 
>// Initialize collection path
> 
>//
> 
> -  Private->Uri = RedfishGetUri (ResourceUri);
> 
> -  if (Private->Uri == NULL) {
> 
> +  BiosUri = RedfishGetUri (ResourceUri);
> 
> +  if (BiosUri == NULL) {
> 
>  ASSERT (FALSE);
> 
>  FreePool (ResourceUri);
> 
>  return EFI_OUT_OF_RESOURCES;
> 
>}
> 
> 
> 
> -  Status = HandleResource (Private, Private->Uri);
> 
> +  Status = HandleResource (Private, BiosUri);
> 
>if (EFI_ERROR (Status)) {
> 
> -DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n",
> __func__, Private->Uri, Status));
> 
> +DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed:
> + %r\n", __func__, BiosUri, Status));
> 
>}
> 
> 
> 
> -  FreePool (Private->Uri);
> 
> +  FreePool (BiosUri);
> 
>FreePool (ResourceUri);
> 
>return Status;
> 
>  }
> 
> --
> 2.32.0 (Apple Git-132)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115771): https://edk2.groups.io/g/devel/message/115771
Mute This Topic: https://groups.io/mt/104495956/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 1/1] Platform/Loongson: loongarch supports parsing multi-chip flash

2024-02-21 Thread Chao Li

Reviewed-by: Chao Li 


Thanks,
Chao
On 2024/2/19 10:03, xianglai wrote:

The current implementation of loongarch NorFlashQemuLib is to
parse fdt and think that the first flash address resolved to
the NVRAM space, with the evolution of qemu code, loongarch
uses the first flash to store UEFI code and the second flash
as NVRAM space, so NorFlashQemuLib needs to be able to parse
multiple flash base addresses. By default, the first piece of
flash other than UEFI code is considered as NVRAM space.

Cc: Andrea Bolognani
Cc: Bibo Mao
Cc: Chao Li
Signed-off-by: Xianglai Li
---
  .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 75 ---
  .../NorFlashQemuLib/NorFlashQemuLib.inf   |  2 +
  .../Loongson/LoongArchQemuPkg/Loongson.fdf|  4 +-
  3 files changed, 51 insertions(+), 30 deletions(-)

diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
index 2e0bf3cef0..1781c1c321 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
@@ -84,34 +84,53 @@ VirtNorFlashPlatformGetDevices (
  return EFI_NOT_FOUND;
}
  
-  Base = SwapBytes64 (ReadUnaligned64 ((VOID *)[0]));

-  Size = SwapBytes64 (ReadUnaligned64 ((VOID *)[2]));
-
-  mNorFlashDevices.DeviceBaseAddress = (UINTN)Base;
-  mNorFlashDevices.RegionBaseAddress = (UINTN)Base;
-  mNorFlashDevices.Size  = (UINTN)Size;
-  mNorFlashDevices.BlockSize = QEMU_NOR_BLOCK_SIZE;
-
-  Status = PcdSet32S (PcdFlashNvStorageVariableBase, Base);
-  ASSERT_EFI_ERROR (Status);
-
-  /*
-   * Base is the value of PcdFlashNvStorageVariableBase,
-   * PcdFlashNvStorageFtwWorkingBase can be got by
-   *   PcdFlashNvStorageVariableBase + PcdFlashNvStorageVariableSize
-   */
-  Base += PcdGet32 (PcdFlashNvStorageVariableSize);
-  Status = PcdSet32S (PcdFlashNvStorageFtwWorkingBase, Base);
-  ASSERT_EFI_ERROR (Status);
-
-  /*
-   * Now,Base is the value of PcdFlashNvStorageFtwWorkingBase,
-   * PcdFlashNvStorageFtwSpareBase can be got by
-   *   PcdFlashNvStorageFtwWorkingBase + PcdFlashNvStorageFtwWorkingSize.
-   */
-  Base += PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
-  Status = PcdSet32S (PcdFlashNvStorageFtwSpareBase, Base);
-  ASSERT_EFI_ERROR (Status);
+  while (PropSize >= (4 * sizeof (UINT32))) {
+Base = SwapBytes64 (ReadUnaligned64 ((VOID *)[0]));
+Size = SwapBytes64 (ReadUnaligned64 ((VOID *)[2]));
+Reg += 4;
+
+PropSize -= 4 * sizeof (UINT32);
+
+//
+// Disregard any flash devices that overlap with the primary FV.
+// The firmware is not updatable from inside the guest anyway.
+//
+if ((PcdGet32 (PcdOvmfFdBaseAddress) + PcdGet32 (PcdOvmfFirmwareFdSize) > Base) 
&&
+((Base + Size) > PcdGet32 (PcdOvmfFdBaseAddress)))
+{
+  continue;
+}
+
+//
+//By default, the second available flash is stored as a non-volatile 
variable.
+//
+mNorFlashDevices.DeviceBaseAddress = (UINTN)Base;
+mNorFlashDevices.RegionBaseAddress = (UINTN)Base;
+mNorFlashDevices.Size  = (UINTN)Size;
+mNorFlashDevices.BlockSize = QEMU_NOR_BLOCK_SIZE;
+
+Status = PcdSet32S (PcdFlashNvStorageVariableBase, Base);
+ASSERT_EFI_ERROR (Status);
+
+/*
+ * Base is the value of PcdFlashNvStorageVariableBase,
+ * PcdFlashNvStorageFtwWorkingBase can be got by
+ *   PcdFlashNvStorageVariableBase + PcdFlashNvStorageVariableSize
+ */
+Base += PcdGet32 (PcdFlashNvStorageVariableSize);
+Status = PcdSet32S (PcdFlashNvStorageFtwWorkingBase, Base);
+ASSERT_EFI_ERROR (Status);
+
+/*
+ * Now,Base is the value of PcdFlashNvStorageFtwWorkingBase,
+ * PcdFlashNvStorageFtwSpareBase can be got by
+ *   PcdFlashNvStorageFtwWorkingBase + PcdFlashNvStorageFtwWorkingSize.
+ */
+Base += PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
+Status = PcdSet32S (PcdFlashNvStorageFtwSpareBase, Base);
+ASSERT_EFI_ERROR (Status);
+break;
+  }
  
//

// UEFI takes ownership of the NOR flash, and exposes its functionality
diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
index da05ca0898..a9b6c38783 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
@@ -35,6 +35,8 @@
gFdtClientProtocolGuid
  
  [Pcd]

+gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress
+gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf 

[edk2-devel] [edk2-redfish-client][PATCH v2 4/4] RedfishClientPkg: use Json value from a function argument

2024-02-21 Thread Mike Maslenkin
This patch replaces value Private->Json with Json used as second argument
for RedfishIdentifyResource(). Currently Json argument is not used at all
and the pattern for caller side is:
  Status = RedfishIdentifyResourceCommon (Private, Private->Json);

So in scope of RedfishIdentifyResourceCommon Json actually is the same
value as Private->Json. Let's make code a bit cleaner.

Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Mike Maslenkin 
Reviewed-by: Abner Chang 
Reviewed-by: Nickle Wang 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c   | 2 +-
 .../Features/BootOption/v1_0_4/Common/BootOptionCommon.c| 2 +-
 .../ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c| 2 +-
 .../ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c | 2 +-
 RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c   | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
index 0ae841499692..f3f993c8782e 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
@@ -729,7 +729,7 @@ RedfishIdentifyResourceCommon (
   EFI_STRING   EndOfChar;
   REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST  ConfigLangList;
 
-  Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+  Supported = RedfishIdentifyResource (Private->Uri, Json);
   if (Supported) {
 Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, );
 if (EFI_ERROR (Status)) {
diff --git 
a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
index 0b9f2bf28434..f471c01c3790 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCommon.c
@@ -791,7 +791,7 @@ RedfishIdentifyResourceCommon (
 {
   BOOLEAN  Supported;
 
-  Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+  Supported = RedfishIdentifyResource (Private->Uri, Json);
   if (Supported) {
 return EFI_SUCCESS;
   }
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
index cee6c8bf9ba1..d69fc176ad94 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
@@ -848,7 +848,7 @@ RedfishIdentifyResourceCommon (
   EFI_STRING   EndOfChar;
   REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST  ConfigLangList;
 
-  Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+  Supported = RedfishIdentifyResource (Private->Uri, Json);
   if (Supported) {
 Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, );
 if (EFI_ERROR (Status)) {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
index a67ef3dac283..11bcb5f76cab 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
@@ -1718,7 +1718,7 @@ RedfishIdentifyResourceCommon (
   EFI_STRING   EndOfChar;
   REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST  ConfigLangList;
 
-  Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+  Supported = RedfishIdentifyResource (Private->Uri, Json);
   if (Supported) {
 Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, );
 if (EFI_ERROR (Status)) {
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
index eb52c68c5dcb..00a69f748c3c 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.c
@@ -2516,7 +2516,7 @@ RedfishIdentifyResourceCommon (
   EFI_STRING   EndOfChar;
   REDFISH_FEATURE_ARRAY_TYPE_CONFIG_LANG_LIST  ConfigLangList;
 
-  Supported = RedfishIdentifyResource (Private->Uri, Private->Json);
+  Supported = RedfishIdentifyResource (Private->Uri, Json);
   if (Supported) {
 Status = RedfishFeatureGetUnifiedArrayTypeConfigureLang (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, REDPATH_ARRAY_PATTERN, );
 if (EFI_ERROR (Status)) {
-- 
2.32.0 (Apple Git-132)



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

[edk2-devel] [edk2-redfish-client][PATCH v2 3/4] RedfishClientPkg/Bios: fix leak of GetPendingSettings URI.

2024-02-21 Thread Mike Maslenkin
Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Mike Maslenkin 
Reviewed-by: Abner Chang 
Reviewed-by: Nickle Wang 
---
 .../Features/Bios/v1_0_9/Dxe/BiosDxe.c  | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index db77ed3dfccb..a442d446bc35 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -132,12 +132,13 @@ RedfishResourceConsumeResource (
   // Check and see if "@Redfish.Settings" exist or not.
   //
   ZeroMem (, sizeof (REDFISH_RESPONSE));
-  Status = GetPendingSettings (
- Private->RedfishService,
- Response.Payload,
- ,
- 
- );
+  PendingSettingUri = NULL;
+  Status= GetPendingSettings (
+Private->RedfishService,
+Response.Payload,
+,
+
+);
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
 Private->Uri = PendingSettingUri;
@@ -206,6 +207,10 @@ RedfishResourceConsumeResource (
 FreePool (Etag);
   }
 
+  if (PendingSettingUri != NULL) {
+FreePool (PendingSettingUri);
+  }
+
   return Status;
 }
 
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [edk2-redfish-client][PATCH v2 1/4] RedfishClientPkg/RedfishFeatureUtilityLib: fix memory leak on error path

2024-02-21 Thread Mike Maslenkin
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Cc: Nickle Wang 
Signed-off-by: Mike Maslenkin 
Reviewed-by: Abner Chang 
Reviewed-by: Nickle Wang 
---
 .../Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c  | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
index e1494471038c..21ce8ddad9d5 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
@@ -4010,6 +4010,7 @@ RedfishRemoveUnchangeableProperties (
  (RedfishCS_uint32)AsciiStrSize (*JsonString)
  );
   if (Status != RedfishCS_status_success) {
+FreePool (UpdatedJsonString);
 return EFI_DEVICE_ERROR;
   }
 
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [edk2-redfish-client][PATCH v2 2/4] RedfishClientPkg: refine RedfishExternalResourceResourceFeatureCallback

2024-02-21 Thread Mike Maslenkin
Use local variable for BiosUri passed to HandleResource() to avoid
problems in case of Private->Uri is overriden down the call stack.

Suggested-by: Nickle Wang 
Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Signed-off-by: Mike Maslenkin 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index f40f2d85af80..db77ed3dfccb 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -670,6 +670,7 @@ RedfishExternalResourceResourceFeatureCallback (
   REDFISH_SERVICE  RedfishService;
   REDFISH_RESOURCE_COMMON_PRIVATE  *Private;
   EFI_STRING   ResourceUri;
+  EFI_STRING   BiosUri;
 
   if (FeatureAction != CallbackActionStartOperation) {
 return EFI_UNSUPPORTED;
@@ -707,19 +708,19 @@ RedfishExternalResourceResourceFeatureCallback (
   //
   // Initialize collection path
   //
-  Private->Uri = RedfishGetUri (ResourceUri);
-  if (Private->Uri == NULL) {
+  BiosUri = RedfishGetUri (ResourceUri);
+  if (BiosUri == NULL) {
 ASSERT (FALSE);
 FreePool (ResourceUri);
 return EFI_OUT_OF_RESOURCES;
   }
 
-  Status = HandleResource (Private, Private->Uri);
+  Status = HandleResource (Private, BiosUri);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n", 
__func__, Private->Uri, Status));
+DEBUG ((DEBUG_ERROR, "%a, process external resource: %s failed: %r\n", 
__func__, BiosUri, Status));
   }
 
-  FreePool (Private->Uri);
+  FreePool (BiosUri);
   FreePool (ResourceUri);
   return Status;
 }
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [edk2-redfish-client][PATCH v2 0/4] RedfishClientPkg: fix memory leaks and refine code

2024-02-21 Thread Mike Maslenkin
This set contains a trivial fix for a leak reviewed on Feb 1 [1] and a fix for 
а leak discussed in [2]

PR: https://github.com/tianocore/edk2-redfish-client/pull/76

[1] https://edk2.groups.io/g/devel/message/114925
[2] https://edk2.groups.io/g/devel/message/114765


v2:
in commit message put Cc back for the ones had given R-b
collected R-b
renamed CollectionUri to BiosUri

Signed-off-by: Mike Maslenkin 
Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115734): https://edk2.groups.io/g/devel/message/115734
Mute This Topic: https://groups.io/mt/104495953/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 V3] OptionRomPkg: Update for UEFI spec v2.9 - mantis #1866

2024-02-20 Thread Gahan
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4689

Bug 4689 - GetInfo() of Adapter Information Protocol
should have a provision for IHV to return no data for
UEFI Spec compliance 2.9 [mantis #1866]

Cc: Ray Ni 
Signed-off-by: Gahan Saraiya 
---
 Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h 
b/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
index 31c55a8e11..45c1f41414 100644
--- a/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
+++ b/Drivers/OptionRomPkg/UndiRuntimeDxe/Undi32.h
@@ -350,23 +350,24 @@ VOID PxeUpdate (NIC_DATA_INSTANCE *NicPtr, PXE_SW_UNDI 
*PxePtr);

   This function returns information of type InformationType from the adapter.
   If an adapter does not support the requested informational type, then
-  EFI_UNSUPPORTED is returned.
+  EFI_UNSUPPORTED is returned.

   @param[in]  This   A pointer to the 
EFI_ADAPTER_INFORMATION_PROTOCOL instance.
   @param[in]  InformationTypeA pointer to an EFI_GUID that defines the 
contents of InformationBlock.
-  @param[out] InforamtionBlock   The service returns a pointer to the 
buffer with the InformationBlock
+  @param[out] InformationBlock   The service returns a pointer to the 
buffer with the InformationBlock
  structure which contains details about 
the data specific to InformationType.
-  @param[out] InforamtionBlockSize   The driver returns the size of the 
InformationBlock in bytes.
+  @param[out] InformationBlockSize   The driver returns the size of the 
InformationBlock in bytes.

   @retval EFI_SUCCESSThe InformationType information was 
retrieved.
   @retval EFI_UNSUPPORTEDThe InformationType is not known.
+  @retval EFI_NOT_FOUND  Information is not available for the 
requested information type.
   @retval EFI_DEVICE_ERROR   The device reported an error.
   @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to 
a lack of resources.
-  @retval EFI_INVALID_PARAMETER  This is NULL.
-  @retval EFI_INVALID_PARAMETER  InformationBlock is NULL.
+  @retval EFI_INVALID_PARAMETER  This is NULL.
+  @retval EFI_INVALID_PARAMETER  InformationBlock is NULL.
   @retval EFI_INVALID_PARAMETER  InformationBlockSize is NULL.

-**/
+**/
 EFI_STATUS
 EFIAPI
 UndiAipGetInfo (
@@ -396,7 +397,7 @@ UndiAipGetInfo (
   @retval EFI_INVALID_PARAMETER  InformationBlock is NULL.
   @retval EFI_WRITE_PROTECTEDThe InformationType cannot be modified 
using EFI_ADAPTER_INFO_SET_INFO().

-**/
+**/
 EFI_STATUS
 EFIAPI
 UndiAipSetInfo (
@@ -427,7 +428,7 @@ UndiAipSetInfo (
   @retval EFI_INVALID_PARAMETER InfoTypesBufferCount is NULL.
   @retval EFI_OUT_OF_RESOURCES  There is not enough pool memory to store 
the results.

-**/
+**/
 EFI_STATUS
 EFIAPI
 UndiAipGetSupportedTypes (
--
2.39.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#115702): https://edk2.groups.io/g/devel/message/115702
Mute This Topic: https://groups.io/mt/104482288/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 V3] MinPlatformPkg: Update for UEFI spec v2.9 - mantis #1866

2024-02-20 Thread Gahan
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4689

Bug 4689 - GetInfo() of Adapter Information Protocol
should have a provision for IHV to return no data for
UEFI Spec compliance 2.9 [mantis #1866]

Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Liming Gao 
Cc: Eric Dong 
Signed-off-by: Gahan Saraiya 
---
 .../Test/Library/TestPointLib/DxeTestPointAip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointAip.c 
b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointAip.c
index a7fe9530cf..fcfef58175 100644
--- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointAip.c
+++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointLib/DxeTestPointAip.c
@@ -12,7 +12,7 @@

   This function returns information of type InformationType from the adapter.
   If an adapter does not support the requested informational type, then
-  EFI_UNSUPPORTED is returned.
+  EFI_UNSUPPORTED is returned.

   @param[in]  This   A pointer to the 
EFI_ADAPTER_INFORMATION_PROTOCOL instance.
   @param[in]  InformationTypeA pointer to an EFI_GUID that defines the 
contents of InformationBlock.
@@ -24,8 +24,8 @@
   @retval EFI_UNSUPPORTEDThe InformationType is not known.
   @retval EFI_DEVICE_ERROR   The device reported an error.
   @retval EFI_OUT_OF_RESOURCES   The request could not be completed due to 
a lack of resources.
-  @retval EFI_INVALID_PARAMETER  This is NULL.
-  @retval EFI_INVALID_PARAMETER  InformationBlock is NULL.
+  @retval EFI_INVALID_PARAMETER  This is NULL.
+  @retval EFI_INVALID_PARAMETER  InformationBlock is NULL.
   @retval EFI_INVALID_PARAMETER  InformationBlockSize is NULL.

 **/
--
2.39.2.windows.1



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




[edk2-devel] [edk2-redfish-client][PATCH 0/4] RedfishClientPkg: fix memory leaks and refine code

2024-02-20 Thread Mike Maslenkin
This set contains a trivial fix for a leak reviewed on Feb 1 [1]
and a fix for а leak discussed in [2].

PR: https://github.com/tianocore/edk2-redfish-client/pull/76

[1] https://edk2.groups.io/g/devel/message/114925
[2] https://edk2.groups.io/g/devel/message/114765


Signed-off-by: Mike Maslenkin 
Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 





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




Re: [edk2-devel] [edk2-test][PATCH v1 0/4] uefi-sct/SctPkg: Add SCT Documents

2024-02-20 Thread G Edhaya Chandran
Thank you Samer.

The test case spec is consolidated and upstreamed by: 
https://github.com/tianocore/edk2-test/commit/f999690054b56780f5efbe0999507d7176bd87f6


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




Re: [edk2-devel] [edk2-redfish-client][PATCH V3] RedfishClientPkg: Readme.md update

2024-02-19 Thread Nickle Wang via groups.io



Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Monday, February 5, 2024 4:36 PM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V3] RedfishClientPkg:
> Readme.md update
> 
> External email: Use caution opening links or attachments
> 
> 
> [AMD Official Use Only - General]
> 
> Hi Igor and Nickle,
> Sorry for sending out V3 so quick. I forget to add the criteria for HTTP POST 
> and
> DELETE.
> 
> Thanks
> Abner
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Chang,
> > Abner via groups.io
> > Sent: Monday, February 5, 2024 4:34 PM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy 
> > Subject: [edk2-devel] [edk2-redfish-client][PATCH V3] RedfishClientPkg:
> > Readme.md update
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > From: Abner Chang 
> >
> > Update Readme file to align with Redfish Client implementation.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > ---
> >  RedfishClientPkg/Readme.md | 175
> > +
> >  1 file changed, 160 insertions(+), 15 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Readme.md b/RedfishClientPkg/Readme.md
> > index edef2ec23b..82cb9c8c99 100644
> > --- a/RedfishClientPkg/Readme.md
> > +++ b/RedfishClientPkg/Readme.md
> > @@ -294,7 +294,7 @@ PCD is set to `TRUE`.
> >  The purpose of Redfish feature driver is to do the synchronization
> > job between Redfish service and BIOS. The operation of synchronization
> > can be simply divided into two types:
> >
> >   Provisioning resource
> > -Below is the flow diagram of provisioning platform configuration to
> > Redfish service at Bios resource. With the x-uefi-redfish
> > +Below is the flow diagram of provisioning platform configuration to
> > +Redfish
> > service at BIOS resource. With the x-uefi-redfish  configure language
> > described in above section, Redfish feature driver collect all BIOS
> > attributes from HII database and populated  them to Redfish service.
> >  ![provisioning](https://github.com/tianocore/edk2-redfish-
> > client/blob/main/RedfishClientPkg/Documents/Media/redfish-call-flow-
> > provisioning.svg?raw=true)
> > @@ -311,7 +311,7 @@ job.
> >  Several interfaces defined in EDKII Redfish Resource Config Protocol
> > work together to support Redfish synchronization:
> >  - Identify()
> >- This function is used to check if the given Redfish resource is
> > the one the feature driver wants to manage. A platform
> > -library `RedfishReesourceIdentifyLib` is introduced for platform to
> > implement its own policy to identify Redfish resource.
> > +library `RedfishResourceIdentifyLib` is introduced for platform
> > + to
> > implement its own policy to identify Redfish resource.
> >  - Check()
> >- This function is used to check the attribute status on Redfish
> > service. If all attributes the feature driver manages
> >  are presented in Redfish service, feature driver must provision them 
> > already.
> > Otherwise, Provisioning() will be called @@ -338,19 +338,164 @@ struct
> > _EDKII_REDFISH_RESOURCE_ADDENDUM_PROTOCOL {  };  ```
> >
> > - Redfish service implementation
> > -The idea of Redfish synchronization design is to manage Redfish
> > resource directly by platform firmware. To do this, Redfish
> > -synchronization functions have to work with Redfish service
> > implementation in BMC firmware. This is because the interface -between
> > platform firmware and BMC firmware is not defined in any
> > specification.
> > -Several prerequisites must be satisfied:
> > -- Platform firmware has permission to manage Redfish resource. BMC
> > has ability to tell the difference between platform request
> > -  and out-of-band user. This can normally be done by identifying the
> > bootstrap account in HTTP request. The bootstrap account is
> > -  described in Host Interface specification 1.3.0 section 9.
> > -- The ability to tell if there is an user who changes to Redfish resource 
> > or not.
> > Redfish feature drivers can only be executed at
> > -  POST time. So the modification to BIOS managed resource is an
> > asynchronous operation

Re: [edk2-devel] [edk2-platforms PATCH 5/6] LoongArchQemuPkg: fix SEC ProcessLibraryConstructorList() prototype

2024-02-19 Thread Laszlo Ersek
On 2/19/24 03:21, Chao Li wrote:
> Hi Laszlo,
> 
> I have tested:
> 
> 1. Follow edk2 series patch 3 changes to
> BaseTools/Source/Python/AutoGen/GenC.py.
> 
> 2. Follow edk2-platforms series patch 5 changes to
> edk2-platforms/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c.
> 
> After the changes, I have built and tested, and it works fine.
> 
> 
> BTW, you can get the LoongArch cross-toolchain in two ways:
> 
> 1. Download it from LoongArch cross-toolchain website, URL:
> https://github.com/loongson/build-tools, the last release date is Aug 8,
> 2023.
> 
> 2. Use the Fedora39 docker or virt-machin(X64), and install the
> LoongArch cross-toolchain from rpm source.
> 
> 
> Build-tested-by: Chao Li 
> 
> Reviewed-by: Chao Li 

Thanks -- in fact I've remembered since that, at an earlier time, I've
already used a LoongArch toolchain in a Fedora VM, with a virtio filesystem.

Laszlo

> 
> 
> Thanks,
> Chao
> On 2024/2/7 09:09, Laszlo Ersek wrote:
>> The current declaration of, and call to, SEC
>> ProcessLibraryConstructorList() in LoongArchQemuPkg matches the PEIM entry
>> point parameter list. Fix the call, and rely on AutoGen for the
>> declaration.
>>
>> Untested (have no cross-toolchain installed for LOONGARCH64).
>>
>> Cc: Bibo Mao 
>> Cc: Chao Li 
>> Cc: Xianglai li 
>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=990
>> Signed-off-by: Laszlo Ersek 
>> ---
>>  Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c 
>> b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c
>> index 3f1998c48c12..50d898859a99 100644
>> --- a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c
>> +++ b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c
>> @@ -9,7 +9,6 @@
>>  
>>  #include 
>>  
>> -#include 
>>  #include 
>>  #include 
>>  #include 
>> @@ -378,7 +377,7 @@ SecCoreStartupWithStack (
>>  
>>DEBUG ((DEBUG_INFO, "Entering C environment\n"));
>>  
>> -  ProcessLibraryConstructorList (NULL, NULL);
>> +  ProcessLibraryConstructorList ();
>>  
>>DEBUG ((DEBUG_INFO,
>>  "SecCoreStartupWithStack (0x%lx, 0x%lx)\n",
>>
>>
>>
>> 
>>
>>



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




Re: [edk2-devel] [edk2-stable202402 PATCH 1/2] UefiCpuPkg/PiSmmCpuDxeSmm: distinguish GetSmBase() failure modes

2024-02-19 Thread duntan
Laszlo,

Sorry for the late reply. Thanks for your code refactoring patch and bugfix 
patch!

Thanks,
Dun

-Original Message-
From: Laszlo Ersek  
Sent: Thursday, February 15, 2024 4:45 PM
To: Kinney, Michael D ; Leif Lindholm 
; devel@edk2.groups.io; Leif Lindholm 
; Andrew Fish (af...@apple.com) ; 
Gao, Liming 
Cc: Tan, Dun ; Gerd Hoffmann ; Kumar, 
Rahul R ; Ni, Ray 
Subject: Re: [edk2-devel] [edk2-stable202402 PATCH 1/2] 
UefiCpuPkg/PiSmmCpuDxeSmm: distinguish GetSmBase() failure modes

On 2/14/24 18:26, Kinney, Michael D wrote:
> Merged: https://github.com/tianocore/edk2/pull/5373

Thanks!
Laszlo

> 
>> -Original Message-
>> From: Leif Lindholm 
>> Sent: Wednesday, February 14, 2024 5:08 AM
>> To: devel@edk2.groups.io; Kinney, Michael D 
>> ; ler...@redhat.com; Leif Lindholm 
>> ; Andrew Fish (af...@apple.com) 
>> ; Gao, Liming 
>> Cc: Tan, Dun ; Gerd Hoffmann ; 
>> Kumar, Rahul R ; Ni, Ray 
>> Subject: Re: [edk2-devel] [edk2-stable202402 PATCH 1/2]
>> UefiCpuPkg/PiSmmCpuDxeSmm: distinguish GetSmBase() failure modes
>>
>> On 2024-02-14 03:43, Michael D Kinney wrote:
>>> Hi Laszlo,
>>>
>>> Thank you for the quick fix.
>>>
>>> I have reviewed the changes.  I agree they fix the issue at hand.
>>>
>>> Reviewed-by: Michael D Kinney 
>>>
>>> I have adjusted the commit message with your suggested changes in 
>>> the PR I have prepared:
>>>
>>> https://github.com/tianocore/edk2/pull/5373
>>>
>>> There may be better ways to organize this code in general to make it 
>>> easier to understand and maintain in the future, but we can let Ray 
>>> review that when he returns.  That will also likely be a much bugger 
>>> change that can be accepted just before a release.
>>>
>>> I also approve this as a critical fix for edk2-stable202402
>>>
>>> I will wait till tomorrow morning my time to see if Gerd and Rahul 
>>> and Leif can also provide their reviews/approvals and to give me 
>>> some time to run some tests.
>>
>> For the series:
>> Reviewed-by: Leif Lindholm  I'm happy for 
>> this to go into the stable tag.
>>
>> /
>>  Leif
>>
>>> I do not expect Ray Ni or Dun Tan to be available this week.
>>>
>>> Best regards,
>>>
>>> Mike
>>>
>>>> -Original Message-
>>>> From: devel@edk2.groups.io  On Behalf Of
>> Laszlo
>>>> Ersek
>>>> Sent: Tuesday, February 13, 2024 1:36 PM
>>>> To: devel@edk2.groups.io
>>>> Cc: Tan, Dun ; Gerd Hoffmann 
>>>> ; Kumar, Rahul R ; Ni, 
>>>> Ray 
>>>> Subject: Re: [edk2-devel] [edk2-stable202402 PATCH 1/2]
>>>> UefiCpuPkg/PiSmmCpuDxeSmm: distinguish GetSmBase() failure modes
>>>>
>>>> On 2/13/24 22:09, Laszlo Ersek wrote:
>>>>> Commit 725acd0b9cc0 ("UefiCpuPkg: Avoid assuming only one
>>>> smmbasehob",
>>>>> 2023-12-12) introduced a helper function called GetSmBase(),
>>>> replacing the
>>>>> lookup of the first and only "gSmmBaseHobGuid" GUID HOB, with
>>>> iterated
>>>>> lookups plus memory allocation.
>>>>>
>>>>> This introduced a new failure mode for setting
>>>> "mCpuHotPlugData.SmBase".
>>>>> Namely, before commit 725acd0b9cc0, "mCpuHotPlugData.SmBase" would
>> be
>>>> set
>>>>> to NULL if and only if the GUID HOB was absent. After the commit, 
>>>>> a
>>>> NULL
>>>>> assignment would be possible if the GUID HOB was absent, *or* one
>> of
>>>> the
>>>>> memory allocations inside GetSmBase() failed.
>>>>
>>>> Sorry, these two paragraphs are not precise. A better version:
>>>>
>>>> --
>>>> Commit 725acd0b9cc0 ("UefiCpuPkg: Avoid assuming only one
>> smmbasehob",
>>>> 2023-12-12) introduced a helper function called GetSmBase(),
>> replacing
>>>> the lookup of the first and only "gSmmBaseHobGuid" GUID HOB and 
>>>> unconditional "mCpuHotPlugData.SmBase" allocation, with iterated 
>>>> lookups plus conditional memory allocation.
>>>>
>>>> This introduced a new failure mode for setting 
>>>> "mCpuHotPlugData.SmBase".
>>>> Namely, before commit 725acd0b9cc0, "mCpuHotPlugData.SmBase" would
>> be
>&g

Re: [edk2-devel] [edk2-platforms PATCH 5/6] LoongArchQemuPkg: fix SEC ProcessLibraryConstructorList() prototype

2024-02-18 Thread Chao Li

Hi Laszlo,

I have tested:

1. Follow edk2 series patch 3 changes to 
BaseTools/Source/Python/AutoGen/GenC.py.


2. Follow edk2-platforms series patch 5 changes to 
edk2-platforms/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c.


After the changes, I have built and tested, and it works fine.


BTW, you can get the LoongArch cross-toolchain in two ways:

1. Download it from LoongArch cross-toolchain website, URL: 
https://github.com/loongson/build-tools, the last release date is Aug 8, 
2023.


2. Use the Fedora39 docker or virt-machin(X64), and install the 
LoongArch cross-toolchain from rpm source.



Build-tested-by: Chao Li 

Reviewed-by: Chao Li 


Thanks,
Chao
On 2024/2/7 09:09, Laszlo Ersek wrote:

The current declaration of, and call to, SEC
ProcessLibraryConstructorList() in LoongArchQemuPkg matches the PEIM entry
point parameter list. Fix the call, and rely on AutoGen for the
declaration.

Untested (have no cross-toolchain installed for LOONGARCH64).

Cc: Bibo Mao
Cc: Chao Li
Cc: Xianglai li
Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=990
Signed-off-by: Laszlo Ersek
---
  Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c 
b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c
index 3f1998c48c12..50d898859a99 100644
--- a/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c
+++ b/Platform/Loongson/LoongArchQemuPkg/Sec/SecMain.c
@@ -9,7 +9,6 @@
  
  #include 
  
-#include 

  #include 
  #include 
  #include 
@@ -378,7 +377,7 @@ SecCoreStartupWithStack (
  
DEBUG ((DEBUG_INFO, "Entering C environment\n"));
  
-  ProcessLibraryConstructorList (NULL, NULL);

+  ProcessLibraryConstructorList ();
  
DEBUG ((DEBUG_INFO,

  "SecCoreStartupWithStack (0x%lx, 0x%lx)\n",









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




[edk2-devel] [edk2-platforms 0/1] loongarch supports parsing multi-chip flash

2024-02-18 Thread xianglai
The current implementation of loongarch NorFlashQemuLib is to
parse fdt and think that the first flash address resolved to
the NVRAM space, with the evolution of qemu code, loongarch
uses the first flash to store UEFI code and the second flash
as NVRAM space, so NorFlashQemuLib needs to be able to parse
multiple flash base addresses. By default, the first piece of
flash other than UEFI code is considered as NVRAM space.

Cc: Andrea Bolognani 
Cc: Bibo Mao 
Cc: Chao Li 

Xianglai Li (1):
  Platform/Loongson: loongarch supports parsing multi-chip flash

 .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 75 ---
 .../NorFlashQemuLib/NorFlashQemuLib.inf   |  2 +
 .../Loongson/LoongArchQemuPkg/Loongson.fdf|  4 +-
 3 files changed, 51 insertions(+), 30 deletions(-)

-- 
2.39.1



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




[edk2-devel] [edk2-platforms 1/1] Platform/Loongson: loongarch supports parsing multi-chip flash

2024-02-18 Thread xianglai
The current implementation of loongarch NorFlashQemuLib is to
parse fdt and think that the first flash address resolved to
the NVRAM space, with the evolution of qemu code, loongarch
uses the first flash to store UEFI code and the second flash
as NVRAM space, so NorFlashQemuLib needs to be able to parse
multiple flash base addresses. By default, the first piece of
flash other than UEFI code is considered as NVRAM space.

Cc: Andrea Bolognani 
Cc: Bibo Mao 
Cc: Chao Li 
Signed-off-by: Xianglai Li 
---
 .../Library/NorFlashQemuLib/NorFlashQemuLib.c | 75 ---
 .../NorFlashQemuLib/NorFlashQemuLib.inf   |  2 +
 .../Loongson/LoongArchQemuPkg/Loongson.fdf|  4 +-
 3 files changed, 51 insertions(+), 30 deletions(-)

diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
index 2e0bf3cef0..1781c1c321 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.c
@@ -84,34 +84,53 @@ VirtNorFlashPlatformGetDevices (
 return EFI_NOT_FOUND;
   }
 
-  Base = SwapBytes64 (ReadUnaligned64 ((VOID *)[0]));
-  Size = SwapBytes64 (ReadUnaligned64 ((VOID *)[2]));
-
-  mNorFlashDevices.DeviceBaseAddress = (UINTN)Base;
-  mNorFlashDevices.RegionBaseAddress = (UINTN)Base;
-  mNorFlashDevices.Size  = (UINTN)Size;
-  mNorFlashDevices.BlockSize = QEMU_NOR_BLOCK_SIZE;
-
-  Status = PcdSet32S (PcdFlashNvStorageVariableBase, Base);
-  ASSERT_EFI_ERROR (Status);
-
-  /*
-   * Base is the value of PcdFlashNvStorageVariableBase,
-   * PcdFlashNvStorageFtwWorkingBase can be got by
-   *   PcdFlashNvStorageVariableBase + PcdFlashNvStorageVariableSize
-   */
-  Base += PcdGet32 (PcdFlashNvStorageVariableSize);
-  Status = PcdSet32S (PcdFlashNvStorageFtwWorkingBase, Base);
-  ASSERT_EFI_ERROR (Status);
-
-  /*
-   * Now,Base is the value of PcdFlashNvStorageFtwWorkingBase,
-   * PcdFlashNvStorageFtwSpareBase can be got by
-   *   PcdFlashNvStorageFtwWorkingBase + PcdFlashNvStorageFtwWorkingSize.
-   */
-  Base += PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
-  Status = PcdSet32S (PcdFlashNvStorageFtwSpareBase, Base);
-  ASSERT_EFI_ERROR (Status);
+  while (PropSize >= (4 * sizeof (UINT32))) {
+Base = SwapBytes64 (ReadUnaligned64 ((VOID *)[0]));
+Size = SwapBytes64 (ReadUnaligned64 ((VOID *)[2]));
+Reg += 4;
+
+PropSize -= 4 * sizeof (UINT32);
+
+//
+// Disregard any flash devices that overlap with the primary FV.
+// The firmware is not updatable from inside the guest anyway.
+//
+if ((PcdGet32 (PcdOvmfFdBaseAddress) + PcdGet32 (PcdOvmfFirmwareFdSize) > 
Base) &&
+((Base + Size) > PcdGet32 (PcdOvmfFdBaseAddress)))
+{
+  continue;
+}
+
+//
+//By default, the second available flash is stored as a non-volatile 
variable.
+//
+mNorFlashDevices.DeviceBaseAddress = (UINTN)Base;
+mNorFlashDevices.RegionBaseAddress = (UINTN)Base;
+mNorFlashDevices.Size  = (UINTN)Size;
+mNorFlashDevices.BlockSize = QEMU_NOR_BLOCK_SIZE;
+
+Status = PcdSet32S (PcdFlashNvStorageVariableBase, Base);
+ASSERT_EFI_ERROR (Status);
+
+/*
+ * Base is the value of PcdFlashNvStorageVariableBase,
+ * PcdFlashNvStorageFtwWorkingBase can be got by
+ *   PcdFlashNvStorageVariableBase + PcdFlashNvStorageVariableSize
+ */
+Base += PcdGet32 (PcdFlashNvStorageVariableSize);
+Status = PcdSet32S (PcdFlashNvStorageFtwWorkingBase, Base);
+ASSERT_EFI_ERROR (Status);
+
+/*
+ * Now,Base is the value of PcdFlashNvStorageFtwWorkingBase,
+ * PcdFlashNvStorageFtwSpareBase can be got by
+ *   PcdFlashNvStorageFtwWorkingBase + PcdFlashNvStorageFtwWorkingSize.
+ */
+Base += PcdGet32 (PcdFlashNvStorageFtwWorkingSize);
+Status = PcdSet32S (PcdFlashNvStorageFtwSpareBase, Base);
+ASSERT_EFI_ERROR (Status);
+break;
+  }
 
   //
   // UEFI takes ownership of the NOR flash, and exposes its functionality
diff --git 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
index da05ca0898..a9b6c38783 100644
--- 
a/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
+++ 
b/Platform/Loongson/LoongArchQemuPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
@@ -35,6 +35,8 @@
   gFdtClientProtocolGuid
 
 [Pcd]
+gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFdBaseAddress
+gUefiOvmfPkgTokenSpaceGuid.PcdOvmfFirmwareFdSize
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
diff --git a/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf 
b/Platform/Loongson/LoongArchQemuPkg/Loongson.fdf
index 8a759c0238..5af691c6af 100644
--- 

[edk2-devel] [edk2-redfish-client][PATCH 2/2] RedfishClientPkg: fix memory leak in ConverterLib

2024-01-26 Thread Mike Maslenkin
The memory returned by json_dumps() must be freed.

Signed-off-by: Mike Maslenkin 
Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c 
b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
index 126200dd019c..250ef75e40de 100644
--- a/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
+++ b/RedfishClientPkg/ConverterLib/src/RedfishCsCommon.c
@@ -379,15 +379,19 @@ CreateCsJsonByNode (
   if (TempChar != NULL) {
 Status = allocateRecordCsMemory (Cs, sizeof (RedfishCS_Type_JSON_Data), 
(void **));
 if (Status != RedfishCS_status_success) {
+  free (TempChar);
   return Status;
 }
 
 Status = allocateRecordCsMemory (Cs, (RedfishCS_int)strlen (TempChar) + 1, 
(void **));
 if (Status != RedfishCS_status_success) {
+  free (TempChar);
   return Status;
 }
 
 strncpy (DumpStr, TempChar, strlen (TempChar) + 1);
+free (TempChar);
+
 InitializeLinkHead (>Header.LinkEntry);
 CsTypeJson->Header.ResourceType = RedfishCS_Type_JSON;
 CsTypeJson->Header.ThisUri  = ParentUri;
@@ -1506,9 +1510,10 @@ RemoveUnchangeableProperties (
   Status = RedfishCS_status_insufficient_memory;
 } else {
   memcpy (NewJsonBuffer, TempChar, strlen (TempChar) + 1);
-  free (TempChar);
   Status = RedfishCS_status_success;
 }
+
+free (TempChar);
   } else {
 Status = RedfishCS_status_unknown_error;
   }
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [edk2-redfish-client][PATCH 1/2] RedfishClientPkg: fix uninitialized variable build error

2024-01-26 Thread Mike Maslenkin
Variable 'Status' may be used uninitialized in this function
[-Werror=maybe-uninitialized]

Signed-off-by: Mike Maslenkin 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c 
b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
index dce83a8a986f..e76f8d106987 100644
--- a/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
+++ b/RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.c
@@ -152,6 +152,7 @@ StartUpFeatureDriver (
   }
 
   ThisList = ThisFeatureDriverList;
+  Status   = EFI_SUCCESS;
   while (TRUE) {
 if (ThisList->Callback != NULL) {
   ThisList->InformationExchange = mInformationExchange;
-- 
2.32.0 (Apple Git-132)



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




[edk2-devel] [edk2-redfish-client][PATCH 0/2] RedfishClientPkg: fix memory leak in ConverterLib

2024-01-26 Thread Mike Maslenkin
This patchset contains a trivial fix for memory leak in ConverterLib
Also patch 1 is a resend of the same patch sent to list on 4th Jan with
added Rb (https://edk2.groups.io/g/devel/message/113162).

PR: https://github.com/tianocore/edk2-redfish-client/pull/74

Signed-off-by: Mike Maslenkin 
Cc: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 




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




Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-26 Thread Mike Maslenkin
BTW did you consider to remove this Private->Uri someday at all ?
I tried to remove it, but since it declared in a common header for all redfish 
client feature drivers
those changes was huge comparing to a small memory leak I tried to fix.
And now such pattern spreads into new feature drivers. 
In short: there is no need to cache this value in Private->Uri, but pass it as 
an argument down to stack in EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL 
implementation.
I think it just small design flaw. 

The code I'm talking about:
+  //
+  // Check and see if "@Redfish.Settings" exist or not.
+  //
+  ZeroMem (, sizeof (REDFISH_RESPONSE));
+  Status = GetPendingSettings (
+ Private->RedfishService,
+ Response.Payload,
+ ,
+ 
+ );
+  if (!EFI_ERROR (Status)) {
+DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+Private->Uri = PendingSettingUri;
+ExpectedResponse = 
+  } else {
+DEBUG ((REDFISH_DEBUG_TRACE, "%a: No @Redfish.Settings is found\n", 
__func__));
+Private->Uri = Uri;
+ExpectedResponse = 
+  }

In this pattern PendingSettingUri is leaked, since Private->Uri belongs to 
caller and never released.

But... in fact it is not true for Feature/Bios driver, and actually leaked 
resource is original Private->Uri string.

This is because these EDKII_REDFISH_RESOURCE_CONFIG_PROTOCOL function called by
HandleResource() function, which in turns called from here:
  //
  // Initialize collection path
  //
  Private->Uri = RedfishGetUri (ResourceUri);
  if (Private->Uri == NULL) {
ASSERT (FALSE);
FreePool (ResourceUri);
return EFI_OUT_OF_RESOURCES;
  }

  Status = HandleResource (Private, Private->Uri);
  if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a, process external resource: %a failed: %r\n", 
__func__, Private->Uri, Status));
  }

  FreePool (Private->Uri);


Too many "Private->Uri" with a different value. 

PS: Funny, just pay attention to the log trace above - %a used for 
Private->Uri. Probably it was one of the factors 
induced me to write previous message :)

Regards,
Mike.


> On 26. 1. 2024., at 17:13, Chang, Abner  wrote:
> 
> [AMD Official Use Only - General]
> 
> It is no problem.  Thank you Mike for looking into this patch.
> Abner
> 
>> -Original Message-
>> From: M M 
>> Sent: Friday, January 26, 2024 10:11 PM
>> To: Chang, Abner 
>> Cc: devel@edk2.groups.io; Nickle Wang ; Igor
>> Kulchytskyy 
>> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V2]
>> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
>> 
>> Caution: This message originated from an External Source. Use proper caution
>> when opening attachments, clicking links, or responding.
>> 
>> 
>> You are right.
>> 
>> Sorry for the noise!
>> 
>> No problems here.
>> I mixed up with tags in my editor while looked into patch.
>> 
>> Regards,
>> Mike
>> 
>>> On 26. 1. 2024., at 17:03, Chang, Abner  wrote:
>>> 
>>> [AMD Official Use Only - General]
>>> 
>>> Hi Mike,
>>> I can't identify the issue on %s as Private->Uri is defined as EFI_STRING, 
>>> or I
>> miss something?
>>> 
>>> Thanks
>>> Abner
>>> 
>>>> -Original Message-
>>>> From: M M 
>>>> Sent: Friday, January 26, 2024 9:55 PM
>>>> To: devel@edk2.groups.io; Nickle Wang 
>>>> Cc: Chang, Abner ; Igor Kulchytskyy
>>>> 
>>>> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V2]
>>>> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
>>>> 
>>>> Caution: This message originated from an External Source. Use proper
>> caution
>>>> when opening attachments, clicking links, or responding.
>>>> 
>>>> 
>>>> Hi Abner,
>>>> 
>>>>> On 26. 1. 2024., at 05:20, Nickle Wang via groups.io
>>>>  wrote:
>>>>> 
>>>>> Hi Abner,
>>>>> 
>>>>> Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.
>>>>> 
>>>>>> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish
>>>> ConfigureLang
>>>>>> found for %s\n", __func__, Private->Uri));
>>>>> 
>>>>> Regards,
>>>>> Nickle
>>>> 
>>>> There are two issues in this string. The second one is incorrect  %s format
>> used
>>>> for Private->Uri.
>>>> This issue exists in V3 not only in the line mentioned above.
>>>> 
>>>> Regards,
>>>> Mike.
> 



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




Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-26 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

It is no problem.  Thank you Mike for looking into this patch.
Abner

> -Original Message-
> From: M M 
> Sent: Friday, January 26, 2024 10:11 PM
> To: Chang, Abner 
> Cc: devel@edk2.groups.io; Nickle Wang ; Igor
> Kulchytskyy 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V2]
> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> You are right.
>
> Sorry for the noise!
>
> No problems here.
> I mixed up with tags in my editor while looked into patch.
>
> Regards,
> Mike
>
> > On 26. 1. 2024., at 17:03, Chang, Abner  wrote:
> >
> > [AMD Official Use Only - General]
> >
> > Hi Mike,
> > I can't identify the issue on %s as Private->Uri is defined as EFI_STRING, 
> > or I
> miss something?
> >
> > Thanks
> > Abner
> >
> >> -Original Message-
> >> From: M M 
> >> Sent: Friday, January 26, 2024 9:55 PM
> >> To: devel@edk2.groups.io; Nickle Wang 
> >> Cc: Chang, Abner ; Igor Kulchytskyy
> >> 
> >> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V2]
> >> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
> >>
> >> Caution: This message originated from an External Source. Use proper
> caution
> >> when opening attachments, clicking links, or responding.
> >>
> >>
> >> Hi Abner,
> >>
> >>> On 26. 1. 2024., at 05:20, Nickle Wang via groups.io
> >>  wrote:
> >>>
> >>> Hi Abner,
> >>>
> >>> Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.
> >>>
> >>>> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish
> >> ConfigureLang
> >>>> found for %s\n", __func__, Private->Uri));
> >>>
> >>> Regards,
> >>> Nickle
> >>
> >> There are two issues in this string. The second one is incorrect  %s format
> used
> >> for Private->Uri.
> >> This issue exists in V3 not only in the line mentioned above.
> >>
> >> Regards,
> >> Mike.



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




Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-26 Thread Mike Maslenkin
You are right.

Sorry for the noise!

No problems here.
I mixed up with tags in my editor while looked into patch.

Regards,
Mike

> On 26. 1. 2024., at 17:03, Chang, Abner  wrote:
> 
> [AMD Official Use Only - General]
> 
> Hi Mike,
> I can't identify the issue on %s as Private->Uri is defined as EFI_STRING, or 
> I miss something?
> 
> Thanks
> Abner
> 
>> -Original Message-
>> From: M M 
>> Sent: Friday, January 26, 2024 9:55 PM
>> To: devel@edk2.groups.io; Nickle Wang 
>> Cc: Chang, Abner ; Igor Kulchytskyy
>> 
>> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V2]
>> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
>> 
>> Caution: This message originated from an External Source. Use proper caution
>> when opening attachments, clicking links, or responding.
>> 
>> 
>> Hi Abner,
>> 
>>> On 26. 1. 2024., at 05:20, Nickle Wang via groups.io
>>  wrote:
>>> 
>>> Hi Abner,
>>> 
>>> Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.
>>> 
>>>> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish
>> ConfigureLang
>>>> found for %s\n", __func__, Private->Uri));
>>> 
>>> Regards,
>>> Nickle
>> 
>> There are two issues in this string. The second one is incorrect  %s format 
>> used
>> for Private->Uri.
>> This issue exists in V3 not only in the line mentioned above.
>> 
>> Regards,
>> Mike.



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




Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-26 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Hi Mike,
I can't identify the issue on %s as Private->Uri is defined as EFI_STRING, or I 
miss something?

Thanks
Abner

> -Original Message-
> From: M M 
> Sent: Friday, January 26, 2024 9:55 PM
> To: devel@edk2.groups.io; Nickle Wang 
> Cc: Chang, Abner ; Igor Kulchytskyy
> 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V2]
> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
>
> > On 26. 1. 2024., at 05:20, Nickle Wang via groups.io
>  wrote:
> >
> > Hi Abner,
> >
> > Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.
> >
> >> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish
> ConfigureLang
> >> found for %s\n", __func__, Private->Uri));
> >
> > Regards,
> > Nickle
>
> There are two issues in this string. The second one is incorrect  %s format 
> used
> for Private->Uri.
> This issue exists in V3 not only in the line mentioned above.
>
> Regards,
> Mike.


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




Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-26 Thread Mike Maslenkin
Hi Abner,

> On 26. 1. 2024., at 05:20, Nickle Wang via groups.io 
>  wrote:
> 
> Hi Abner,
> 
> Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.
> 
>> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish ConfigureLang
>> found for %s\n", __func__, Private->Uri));
> 
> Regards,
> Nickle

There are two issues in this string. The second one is incorrect  %s format 
used for Private->Uri.
This issue exists in V3 not only in the line mentioned above.

Regards,
Mike.

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




Re: [edk2-devel] [edk2-redfish-client][PATCH V3] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-25 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, January 26, 2024 10:32 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [edk2-redfish-client][PATCH V3] RedfishClientPkg/FeatureDriver:
> ComputerSystem_1_13_0 driver
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Initial version of edk2 Redfish feature of
> Redfish schema ComputerSystem_1_13_0. This driver
> handles ComputerSystem Boot properties but not all.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../v1_13_0/Dxe/ComputerSystemDxe.inf |  53 ++
>  .../v1_13_0/Common/ComputerSystemCommon.h |  29 +
>  .../v1_13_0/Common/ComputerSystemCommon.c | 899
> ++
>  .../v1_13_0/Dxe/ComputerSystemDxe.c   | 702 ++
>  4 files changed, 1683 insertions(+)
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.
> inf
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyste
> mCommon.h
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyste
> mCommon.c
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.
> c
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.inf
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.inf
> new file mode 100644
> index 00..be1c2164d8
> --- /dev/null
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.inf
> @@ -0,0 +1,53 @@
> +## @file
> +#
> +#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +
> +[Defines]
> +  INF_VERSION   = 0x00010005
> +  BASE_NAME = ComputerSystemDxe
> +  FILE_GUID = D94362A1-C358-4059-B014-F07D1AE04F16
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 1.0
> +  ENTRY_POINT   = RedfishResourceEntryPoint
> +  UNLOAD_IMAGE  = RedfishResourceUnload
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +  RedfishClientPkg/RedfishClientPkg.dec
> +
> +[Sources]
> +  ../Common/ComputerSystemCommon.h
> +  ../Common/ComputerSystemCommon.c
> +  ComputerSystemDxe.c
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  DebugLib
> +  EdkIIRedfishResourceConfigLib
> +  RedfishLib
> +  RedfishFeatureUtilityLib
> +  RedfishResourceIdentifyLib
> +  UefiLib
> +  UefiDriverEntryPoint
> +  RedfishAddendumLib
> +  RedfishHttpCacheLib
> +
> +[Protocols]
> +  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
> +  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
> +  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
> +
> +[Pcd]
> +  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
> +  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
> +
> +[Depex]
> +  TRUE
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.h
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.h
> new file mode 100644
> index 00..7b83d2939c
> --- /dev/null
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.h
> @@ -0,0 +1,29 @@
> +/** @file
> +
> +  Redfish feature driver implementation - internal header file
> +  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
> +#define EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
> +
> +#include
>  >
> +#include 
> +
> +//
> +// Schema information.
> +//
> +#define RESOURCE_SCHEMA  "ComputerSystem"
> +#define RESOURCE_SCHEMA_MAJOR"1"
> +#define RESOURCE_SCHEMA_MINOR"13"
> +#define RESOURCE_SCHEMA_ERRATA   "0"
> +#define RESOURCE_SCHEMA_VERSION  "v1_13_0"
> +#define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
> +#define REDPATH_ARRAY_PREFIX L"/Systems/"
> +#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-
> ComputerSystem.v1_13_0"
> +
> +#endif
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.c
> new file mode 100644
> index 00..cee6c8bf9b
> --- /dev/null
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.c
> @@ -0,0 +1,899 @@
> +/** @file
> +  Redfish feature driver implementation - common functions
> +
> +  (C) Copyright 2020-2022 Hewlett 

Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver

2024-01-25 Thread Nickle Wang via groups.io


Reviewed-by: Nickle Wang 

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, January 26, 2024 10:29 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver:
> ComputerSystem_1_5_0 driver
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Update Redfish ComputerSystem_1_5_0 feature driver to align the
> implementation with latest code. This driver handles all of ComputerSystem
> v1_5_0 properties and incorporate with Redfish simualtor.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   1 +
>  .../v1_5_0/Common/ComputerSystemCommon.c  | 347 --
>  .../v1_5_0/Dxe/ComputerSystemDxe.c|  64 ++--
>  3 files changed, 271 insertions(+), 141 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.inf
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.inf
> index 36cbe06211..4e7dc5c7c5 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.inf
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem
> +++ Dxe.inf
> @@ -37,6 +37,7 @@
>RedfishResourceIdentifyLib
>UefiLib
>UefiDriverEntryPoint
> +  RedfishAddendumLib
>RedfishHttpCacheLib
> 
>  [Protocols]
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> index 3ace03bd4c..a67ef3dac2 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSys
> +++ temCommon.c
> @@ -53,7 +53,7 @@ RedfishConsumeResourceCommon (
>(EFI_REST_JSON_STRUCTURE_HEADER
> **)
>);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, 
> Status));
> +DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__,
> + Status));
>  return Status;
>}
> 
> @@ -66,8 +66,8 @@ RedfishConsumeResourceCommon (
>  //
>  // No change
>  //
> -DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore
> consume action\n", __func__, Private->Uri));
> -Status = EFI_ALREADY_STARTED;
> +DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore
> consume action\n", __func__, Private->Uri));
> +Status = EFI_SUCCESS;
>  goto ON_RELEASE;
>}
> 
> @@ -154,12 +154,12 @@ RedfishConsumeResourceCommon (
>  if (ConfigureLang != NULL) {
>Status = ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA,
> RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot-
> >BootOrder);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
> __func__,
> ConfigureLang, Status));
> +DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n",
> + __func__, ConfigureLang, Status));
>}
> 
>FreePool (ConfigureLang);
>  } else {
> -  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: 
> %s\n",
> __func__, Private->Uri));
> +  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI:
> + %s\n", __func__, Private->Uri));
>  }
>}
> 
> @@ -174,12 +174,12 @@ RedfishConsumeResourceCommon (
>  if (ConfigureLang != NULL) {
>Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA,
> RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot-
> >BootSourceOverrideEnabled);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
> __func__,
> ConfigureLang, Status));
> +DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n",
> + __func__, ConfigureLang, Status));
>}
> 
>FreePool (ConfigureLang);
>  } else {
> -  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: 
> %s\n",
> __func__, Private->Uri));
> +  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI:
> + %s\n", __func__, Private->Uri));
>  }
>}
> 
> @@ -194,12 +194,12 @@ RedfishConsumeResourceCommon (
>  if (ConfigureLang != NULL) {
>Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA,
> RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot-
> >BootSourceOverrideMode);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
> __func__,
> ConfigureLang, Status));
> +DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n",
> + __func__, ConfigureLang, Status));
>}
> 
>FreePool (ConfigureLang);
>  } else {
> -  DEBUG ((DEBUG_ERROR, "%a, can 

Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-25 Thread Chang, Abner via groups.io
[AMD Official Use Only - General]

Thanks Nickle, I just sent out the updates.

Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Friday, January 26, 2024 10:21 AM
> To: devel@edk2.groups.io; Chang, Abner 
> Cc: Igor Kulchytskyy 
> Subject: RE: [edk2-devel] [edk2-redfish-client][PATCH V2]
> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
>
> Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.
>
> > +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish
> ConfigureLang
> > found for %s\n", __func__, Private->Uri));
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Chang,
> Abner
> > via groups.io
> > Sent: Friday, January 26, 2024 9:00 AM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy 
> > Subject: [edk2-devel] [edk2-redfish-client][PATCH V2]
> > RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: Abner Chang 
> >
> > Initial version of edk2 Redfish feature of
> > Redfish schema ComputerSystem_1_13_0. This driver
> > handles ComputerSystem Boot properties but not all.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > ---
> >  .../v1_13_0/Dxe/ComputerSystemDxe.inf |  53 ++
> >  .../v1_13_0/Common/ComputerSystemCommon.h |  29 +
> >  .../v1_13_0/Common/ComputerSystemCommon.c | 899
> > ++
> >  .../v1_13_0/Dxe/ComputerSystemDxe.c   | 702 ++
> >  4 files changed, 1683 insertions(+)
> >  create mode 100644
> >
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystem
> Dxe.
> > inf
> >  create mode 100644
> >
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerS
> yste
> > mCommon.h
> >  create mode 100644
> >
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerS
> yste
> > mCommon.c
> >  create mode 100644
> >
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystem
> Dxe.
> > c
> >
> > diff --git
> >
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> mD
> > xe.inf
> >
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyst
> emD
> > xe.inf
> > new file mode 100644
> > index 00..6bc5cb358e
> > --- /dev/null
> > +++
> >
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyst
> emD
> > xe.inf
> > @@ -0,0 +1,53 @@
> > +## @file
> > +#
> > +#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development
> LP
> > +#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> > +#
> > +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> > +#
> > +##
> > +
> > +
> > +[Defines]
> > +  INF_VERSION   = 0x00010005
> > +  BASE_NAME = ComputerSystemDxe
> > +  FILE_GUID = D94362A1-C358-4059-B014-F07D1AE04F16
> > +  MODULE_TYPE   = DXE_DRIVER
> > +  VERSION_STRING= 1.0
> > +  ENTRY_POINT   = RedfishResourceEntryPoint
> > +  UNLOAD_IMAGE  = RedfishResourceUnload
> > +
> > +[Packages]
> > +  MdePkg/MdePkg.dec
> > +  MdeModulePkg/MdeModulePkg.dec
> > +  RedfishPkg/RedfishPkg.dec
> > +  RedfishClientPkg/RedfishClientPkg.dec
> > +
> > +[Sources]
> > +  ../Common/ComputerSystemCommon.h
> > +  ../Common/ComputerSystemCommon.c
> > +  ComputerSystemDxe.c
> > +
> > +[LibraryClasses]
> > +  BaseMemoryLib
> > +  DebugLib
> > +  EdkIIRedfishResourceConfigLib
> > +  RedfishLib
> > +  RedfishFeatureUtilityLib
> > +  RedfishResourceIdentifyLib
> > +  UefiLib
> > +  UefiDriverEntryPoint
> > +  RedfishAddendumLib
> > +  RedfishHttpCacheLib
> > +
> > +[Protocols]
> > +  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
> > +  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
> > +  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
> > +
> > +[Pcd]
> > +  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
> > +  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
> >

[edk2-devel] [edk2-redfish-client][PATCH V3] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-25 Thread Chang, Abner via groups.io
From: Abner Chang 

Initial version of edk2 Redfish feature of
Redfish schema ComputerSystem_1_13_0. This driver
handles ComputerSystem Boot properties but not all.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../v1_13_0/Dxe/ComputerSystemDxe.inf |  53 ++
 .../v1_13_0/Common/ComputerSystemCommon.h |  29 +
 .../v1_13_0/Common/ComputerSystemCommon.c | 899 ++
 .../v1_13_0/Dxe/ComputerSystemDxe.c   | 702 ++
 4 files changed, 1683 insertions(+)
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c

diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
new file mode 100644
index 00..be1c2164d8
--- /dev/null
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
@@ -0,0 +1,53 @@
+## @file
+#
+#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = ComputerSystemDxe
+  FILE_GUID = D94362A1-C358-4059-B014-F07D1AE04F16
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishResourceEntryPoint
+  UNLOAD_IMAGE  = RedfishResourceUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  ../Common/ComputerSystemCommon.h
+  ../Common/ComputerSystemCommon.c
+  ComputerSystemDxe.c
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  EdkIIRedfishResourceConfigLib
+  RedfishLib
+  RedfishFeatureUtilityLib
+  RedfishResourceIdentifyLib
+  UefiLib
+  UefiDriverEntryPoint
+  RedfishAddendumLib
+  RedfishHttpCacheLib
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
+  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
+  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
+
+[Pcd]
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
+
+[Depex]
+  TRUE
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
new file mode 100644
index 00..7b83d2939c
--- /dev/null
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
@@ -0,0 +1,29 @@
+/** @file
+
+  Redfish feature driver implementation - internal header file
+  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
+#define EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
+
+#include 

+#include 
+
+//
+// Schema information.
+//
+#define RESOURCE_SCHEMA  "ComputerSystem"
+#define RESOURCE_SCHEMA_MAJOR"1"
+#define RESOURCE_SCHEMA_MINOR"13"
+#define RESOURCE_SCHEMA_ERRATA   "0"
+#define RESOURCE_SCHEMA_VERSION  "v1_13_0"
+#define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
+#define REDPATH_ARRAY_PREFIX L"/Systems/"
+#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-ComputerSystem.v1_13_0"
+
+#endif
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
new file mode 100644
index 00..cee6c8bf9b
--- /dev/null
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
@@ -0,0 +1,899 @@
+/** @file
+  Redfish feature driver implementation - common functions
+
+  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "ComputerSystemCommon.h"
+
+CHAR8  ComputerSystemEmptyJson[] = "{\"@odata.id\": \"\", \"@odata.type\": 
\"#ComputerSystem.v1_13_0.ComputerSystem\", \"Id\": \"\", \"Name\": \"\", 
\"Boot\":{}}";
+
+REDFISH_RESOURCE_COMMON_PRIVATE  *mRedfishResourcePrivate = NULL;
+EFI_HANDLE   mRedfishResourceConfigProtocolHandle = NULL;
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   This

[edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver

2024-01-25 Thread Chang, Abner via groups.io
From: Abner Chang 

Update Redfish ComputerSystem_1_5_0 feature
driver to align the implementation with latest
code. This driver handles all of ComputerSystem
v1_5_0 properties and incorporate with Redfish simualtor.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   1 +
 .../v1_5_0/Common/ComputerSystemCommon.c  | 347 --
 .../v1_5_0/Dxe/ComputerSystemDxe.c|  64 ++--
 3 files changed, 271 insertions(+), 141 deletions(-)

diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
index 36cbe06211..4e7dc5c7c5 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
@@ -37,6 +37,7 @@
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
+  RedfishAddendumLib
   RedfishHttpCacheLib
 
 [Protocols]
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
index 3ace03bd4c..a67ef3dac2 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
@@ -53,7 +53,7 @@ RedfishConsumeResourceCommon (
   (EFI_REST_JSON_STRUCTURE_HEADER 
**)
   );
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, Status));
+DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__, Status));
 return Status;
   }
 
@@ -66,8 +66,8 @@ RedfishConsumeResourceCommon (
 //
 // No change
 //
-DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consume 
action\n", __func__, Private->Uri));
-Status = EFI_ALREADY_STARTED;
+DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore consume 
action\n", __func__, Private->Uri));
+Status = EFI_SUCCESS;
 goto ON_RELEASE;
   }
 
@@ -154,12 +154,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootOrder);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
   }
 
   FreePool (ConfigureLang);
 } else {
-  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", 
__func__, Private->Uri));
+  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", 
__func__, Private->Uri));
 }
   }
 
@@ -174,12 +174,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, 
ComputerSystemCs->Boot->BootSourceOverrideEnabled);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
   }
 
   FreePool (ConfigureLang);
 } else {
-  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", 
__func__, Private->Uri));
+  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", 
__func__, Private->Uri));
 }
   }
 
@@ -194,12 +194,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, 
ComputerSystemCs->Boot->BootSourceOverrideMode);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
   }
 
   FreePool (ConfigureLang);
 } else {
-  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", 
__func__, Private->Uri));
+  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", 
__func__, Private->Uri));
 }
   }
 
@@ -234,12 +234,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, 
ComputerSystemCs->Boot->UefiTargetBootSourceOverride);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 

Re: [edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-25 Thread Nickle Wang via groups.io
Hi Abner,

Same minor issue as 1_5_0. Please add "%a:" to below DEBUG call.

> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish ConfigureLang
> found for %s\n", __func__, Private->Uri));

Regards,
Nickle

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang, Abner
> via groups.io
> Sent: Friday, January 26, 2024 9:00 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [edk2-devel] [edk2-redfish-client][PATCH V2]
> RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Initial version of edk2 Redfish feature of
> Redfish schema ComputerSystem_1_13_0. This driver
> handles ComputerSystem Boot properties but not all.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../v1_13_0/Dxe/ComputerSystemDxe.inf |  53 ++
>  .../v1_13_0/Common/ComputerSystemCommon.h |  29 +
>  .../v1_13_0/Common/ComputerSystemCommon.c | 899
> ++
>  .../v1_13_0/Dxe/ComputerSystemDxe.c   | 702 ++
>  4 files changed, 1683 insertions(+)
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.
> inf
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyste
> mCommon.h
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyste
> mCommon.c
>  create mode 100644
> RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.
> c
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.inf
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.inf
> new file mode 100644
> index 00..6bc5cb358e
> --- /dev/null
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemD
> xe.inf
> @@ -0,0 +1,53 @@
> +## @file
> +#
> +#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +
> +[Defines]
> +  INF_VERSION   = 0x00010005
> +  BASE_NAME = ComputerSystemDxe
> +  FILE_GUID = D94362A1-C358-4059-B014-F07D1AE04F16
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 1.0
> +  ENTRY_POINT   = RedfishResourceEntryPoint
> +  UNLOAD_IMAGE  = RedfishResourceUnload
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +  RedfishClientPkg/RedfishClientPkg.dec
> +
> +[Sources]
> +  ../Common/ComputerSystemCommon.h
> +  ../Common/ComputerSystemCommon.c
> +  ComputerSystemDxe.c
> +
> +[LibraryClasses]
> +  BaseMemoryLib
> +  DebugLib
> +  EdkIIRedfishResourceConfigLib
> +  RedfishLib
> +  RedfishFeatureUtilityLib
> +  RedfishResourceIdentifyLib
> +  UefiLib
> +  UefiDriverEntryPoint
> +  RedfishAddendumLib
> +  RedfishHttpCacheLib
> +
> +[Protocols]
> +  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
> +  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
> +  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
> +
> +[Pcd]
> +  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
> +  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
> +
> +[Depex]
> +  TRUE
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.h
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.h
> new file mode 100644
> index 00..c9c8512881
> --- /dev/null
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSyst
> emCommon.h
> @@ -0,0 +1,29 @@
> +/** @file
> +
> +  Redfish feature driver implementation - internal header file
> +  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
> +#define EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
> +
> +#include
>  >
> +#include 
> +
> +//
> +// Schema information.
> +//
> +#define RESOURCE_SCHEMA  "ComputerSystem"
> +#define RESOURCE_SCHEMA_MAJOR"1"
> +#define RESOURCE_SCHEMA_MINOR"13"
> +#define RESOURCE_SCHEMA_ERRATA   "

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver

2024-01-25 Thread Nickle Wang via groups.io
Hi Abner,

I found one minor issue:

>  if (ConfigLangList.Count == 0) {
> +  DEBUG ((DEBUG_MANAGEABILITY, "  No platform Redfish ConfigureLang
> + found for %s\n", __func__, Private->Uri));
>return EFI_SUCCESS;


"%a:" is missing above.

Regards,
Nickle

> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Friday, January 26, 2024 9:15 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver:
> ComputerSystem_1_5_0 driver
> 
> External email: Use caution opening links or attachments
> 
> 
> From: Abner Chang 
> 
> Update Redfish ComputerSystem_1_5_0 feature driver to align the
> implementation with latest code. This driver handles all of ComputerSystem
> v1_5_0 properties and incorporate with Redfish simualtor.
> 
> Signed-off-by: Abner Chang 
> Cc: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   1 +
>  .../v1_5_0/Common/ComputerSystemCommon.c  | 347 --
>  .../v1_5_0/Dxe/ComputerSystemDxe.c|  64 ++--
>  3 files changed, 271 insertions(+), 141 deletions(-)
> 
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.inf
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.inf
> index 36cbe06211..4e7dc5c7c5 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDx
> e.inf
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystem
> +++ Dxe.inf
> @@ -37,6 +37,7 @@
>RedfishResourceIdentifyLib
>UefiLib
>UefiDriverEntryPoint
> +  RedfishAddendumLib
>RedfishHttpCacheLib
> 
>  [Protocols]
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> index 3ace03bd4c..7cd2a6f378 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSyste
> mCommon.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSys
> +++ temCommon.c
> @@ -53,7 +53,7 @@ RedfishConsumeResourceCommon (
>(EFI_REST_JSON_STRUCTURE_HEADER
> **)
>);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, 
> Status));
> +DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__,
> + Status));
>  return Status;
>}
> 
> @@ -66,8 +66,8 @@ RedfishConsumeResourceCommon (
>  //
>  // No change
>  //
> -DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore
> consume action\n", __func__, Private->Uri));
> -Status = EFI_ALREADY_STARTED;
> +DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore
> consume action\n", __func__, Private->Uri));
> +Status = EFI_SUCCESS;
>  goto ON_RELEASE;
>}
> 
> @@ -154,12 +154,12 @@ RedfishConsumeResourceCommon (
>  if (ConfigureLang != NULL) {
>Status = ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA,
> RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot-
> >BootOrder);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
> __func__,
> ConfigureLang, Status));
> +DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n",
> + __func__, ConfigureLang, Status));
>}
> 
>FreePool (ConfigureLang);
>  } else {
> -  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: 
> %s\n",
> __func__, Private->Uri));
> +  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI:
> + %s\n", __func__, Private->Uri));
>  }
>}
> 
> @@ -174,12 +174,12 @@ RedfishConsumeResourceCommon (
>  if (ConfigureLang != NULL) {
>Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA,
> RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot-
> >BootSourceOverrideEnabled);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
> __func__,
> ConfigureLang, Status));
> +DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n",
> + __func__, ConfigureLang, Status));
>}
> 
>FreePool (ConfigureLang);
>  } else {
> -  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: 
> %s\n",
> __func__, Private->Uri));
> +  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI:
> + %s\n", __func__, Private->Uri));
>  }
>}
> 
> @@ -194,12 +194,12 @@ RedfishConsumeResourceCommon (
>  if (ConfigureLang != NULL) {
>Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA,
> RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot-
> >BootSourceOverrideMode);
>if (EFI_ERROR (Status)) {
> -DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
> __func__,
> ConfigureLang, 

[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver: ComputerSystem_1_5_0 driver

2024-01-25 Thread Chang, Abner via groups.io
From: Abner Chang 

Update Redfish ComputerSystem_1_5_0 feature
driver to align the implementation with latest
code. This driver handles all of ComputerSystem
v1_5_0 properties and incorporate with Redfish simualtor.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../v1_5_0/Dxe/ComputerSystemDxe.inf  |   1 +
 .../v1_5_0/Common/ComputerSystemCommon.c  | 347 --
 .../v1_5_0/Dxe/ComputerSystemDxe.c|  64 ++--
 3 files changed, 271 insertions(+), 141 deletions(-)

diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
index 36cbe06211..4e7dc5c7c5 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.inf
@@ -37,6 +37,7 @@
   RedfishResourceIdentifyLib
   UefiLib
   UefiDriverEntryPoint
+  RedfishAddendumLib
   RedfishHttpCacheLib
 
 [Protocols]
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
index 3ace03bd4c..7cd2a6f378 100644
--- 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/ComputerSystemCommon.c
@@ -53,7 +53,7 @@ RedfishConsumeResourceCommon (
   (EFI_REST_JSON_STRUCTURE_HEADER 
**)
   );
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, ToStructure() failed: %r\n", __func__, Status));
+DEBUG ((DEBUG_ERROR, "%a: ToStructure() failed: %r\n", __func__, Status));
 return Status;
   }
 
@@ -66,8 +66,8 @@ RedfishConsumeResourceCommon (
 //
 // No change
 //
-DEBUG ((DEBUG_MANAGEABILITY, "%a, ETAG: %s has no change, ignore consume 
action\n", __func__, Private->Uri));
-Status = EFI_ALREADY_STARTED;
+DEBUG ((DEBUG_MANAGEABILITY, "%a: ETAG: %s has no change, ignore consume 
action\n", __func__, Private->Uri));
+Status = EFI_SUCCESS;
 goto ON_RELEASE;
   }
 
@@ -154,12 +154,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringArrayType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, ComputerSystemCs->Boot->BootOrder);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
   }
 
   FreePool (ConfigureLang);
 } else {
-  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", 
__func__, Private->Uri));
+  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", 
__func__, Private->Uri));
 }
   }
 
@@ -174,12 +174,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, 
ComputerSystemCs->Boot->BootSourceOverrideEnabled);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
   }
 
   FreePool (ConfigureLang);
 } else {
-  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", 
__func__, Private->Uri));
+  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", 
__func__, Private->Uri));
 }
   }
 
@@ -194,12 +194,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, 
ComputerSystemCs->Boot->BootSourceOverrideMode);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
   }
 
   FreePool (ConfigureLang);
 } else {
-  DEBUG ((DEBUG_ERROR, "%a, can not get configure language for URI: %s\n", 
__func__, Private->Uri));
+  DEBUG ((DEBUG_ERROR, "%a: can not get configure language for URI: %s\n", 
__func__, Private->Uri));
 }
   }
 
@@ -234,12 +234,12 @@ RedfishConsumeResourceCommon (
 if (ConfigureLang != NULL) {
   Status = ApplyFeatureSettingsStringType (RESOURCE_SCHEMA, 
RESOURCE_SCHEMA_VERSION, ConfigureLang, 
ComputerSystemCs->Boot->UefiTargetBootSourceOverride);
   if (EFI_ERROR (Status)) {
-DEBUG ((DEBUG_ERROR, "%a, apply setting for %s failed: %r\n", 
__func__, ConfigureLang, Status));
+DEBUG ((DEBUG_ERROR, "%a: apply setting for %s failed: %r\n", 

[edk2-devel] [edk2-redfish-client][PATCH V2] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-25 Thread Chang, Abner via groups.io
From: Abner Chang 

Initial version of edk2 Redfish feature of
Redfish schema ComputerSystem_1_13_0. This driver
handles ComputerSystem Boot properties but not all.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../v1_13_0/Dxe/ComputerSystemDxe.inf |  53 ++
 .../v1_13_0/Common/ComputerSystemCommon.h |  29 +
 .../v1_13_0/Common/ComputerSystemCommon.c | 899 ++
 .../v1_13_0/Dxe/ComputerSystemDxe.c   | 702 ++
 4 files changed, 1683 insertions(+)
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c

diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
new file mode 100644
index 00..6bc5cb358e
--- /dev/null
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
@@ -0,0 +1,53 @@
+## @file
+#
+#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = ComputerSystemDxe
+  FILE_GUID = D94362A1-C358-4059-B014-F07D1AE04F16
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishResourceEntryPoint
+  UNLOAD_IMAGE  = RedfishResourceUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  ../Common/ComputerSystemCommon.h
+  ../Common/ComputerSystemCommon.c
+  ComputerSystemDxe.c
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  EdkIIRedfishResourceConfigLib
+  RedfishLib
+  RedfishFeatureUtilityLib
+  RedfishResourceIdentifyLib
+  UefiLib
+  UefiDriverEntryPoint
+  RedfishAddendumLib
+  RedfishHttpCacheLib
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
+  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
+  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
+
+[Pcd]
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
+
+[Depex]
+  TRUE
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
new file mode 100644
index 00..c9c8512881
--- /dev/null
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
@@ -0,0 +1,29 @@
+/** @file
+
+  Redfish feature driver implementation - internal header file
+  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
+#define EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
+
+#include 

+#include 
+
+//
+// Schema information.
+//
+#define RESOURCE_SCHEMA  "ComputerSystem"
+#define RESOURCE_SCHEMA_MAJOR"1"
+#define RESOURCE_SCHEMA_MINOR"13"
+#define RESOURCE_SCHEMA_ERRATA   "0"
+#define RESOURCE_SCHEMA_VERSION  "v1_13_0"
+#define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
+#define REDPATH_ARRAY_PREFIX L"/Systems/"
+#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-ComputerSystem.v1_13_0"
+
+#endif
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
new file mode 100644
index 00..bc24c49206
--- /dev/null
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
@@ -0,0 +1,899 @@
+/** @file
+  Redfish feature driver implementation - common functions
+
+  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "ComputerSystemCommon.h"
+
+CHAR8  ComputerSystemEmptyJson[] = "{\"@odata.id\": \"\", \"@odata.type\": 
\"#ComputerSystem.v1_13_0.ComputerSystem\", \"Id\": \"\", \"Name\": \"\", 
\"Boot\":{}}";
+
+REDFISH_RESOURCE_COMMON_PRIVATE  *mRedfishResourcePrivate = NULL;
+EFI_HANDLE   mRedfishResourceConfigProtocolHandle = NULL;
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   This

Re: [edk2-devel][edk2-platforms][PATCH v4] MinPlatformPkg: Support SecFspWrapperPlatformSecLib in X64

2024-01-25 Thread Chaganty, Rangasai V
Looks good to me. Please get RB by atleast one of the Pkg maintainers. 
With that:
Reviewed-by: Sai Chaganty 

-Original Message-
From: Kuo, Ted  
Sent: Tuesday, January 2, 2024 1:41 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V ; Chiu, Chasel 
; Desimone, Nathaniel L 
; Dong, Eric ; S, Ashraf 
Ali ; Duggapu, Chinni B ; 
Gao, Liming 
Subject: [edk2-devel][edk2-platforms][PATCH v4] MinPlatformPkg: Support 
SecFspWrapperPlatformSecLib in X64

https://bugzilla.tianocore.org/show_bug.cgi?id=4623
1.Added PeiCoreEntry.nasm, SecEntry.nasm and Stack.nasm for X64.
2.Made changes in common files to support both IA32 and X64.
3.Added the PCDs below for FSP-T UPD revisions and reset vector in FSP.
 - PcdFspWrapperBfvforResetVectorInFsp
 - PcdFsptUpdHeaderRevision
 - PcdFsptArchUpdRevision

Cc: Sai Chaganty 
Cc: Chasel Chiu 
Cc: Nate DeSimone 
Cc: Eric Dong 
Cc: Ashraf Ali S 
Cc: Chinni B Duggapu 
Cc: Liming Gao 
Signed-off-by: Ted Kuo 
---
 .../SecFspWrapperPlatformSecLib/FsptCoreUpd.h |  25 ++-
 .../Ia32/SecEntry.nasm|   4 +-
 .../SecFspWrapperPlatformSecLib.inf   |   9 +-
 ...pWrapperPlatformSecLibResetVectorInFsp.inf | 101 +
 .../SecGetPerformance.c   |  11 +-
 .../SecPlatformInformation.c  |   8 +-
 .../SecRamInitData.c  |  73 +--
 .../X64/PeiCoreEntry.nasm | 202 ++
 .../X64/SecEntry.nasm |  71 ++
 .../X64/Stack.nasm|  72 +++
 .../Ia32 => Include}/Fsp.h|   6 +-
 .../Intel/MinPlatformPkg/MinPlatformPkg.dec   |  17 +-
 12 files changed, 565 insertions(+), 34 deletions(-)  create mode 100644 
Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLibResetVectorInFsp.inf
 create mode 100644 
Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/X64/PeiCoreEntry.nasm
 create mode 100644 
Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/X64/SecEntry.nasm
 create mode 100644 
Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/X64/Stack.nasm
 rename 
Platform/Intel/MinPlatformPkg/{FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32
 => Include}/Fsp.h (79%)

diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/FsptCoreUpd.h
 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/FsptCoreUpd.h
index 7c0f605b92..24c18f25b8 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/FsptCoreUpd.h
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat
+++ formSecLib/FsptCoreUpd.h
@@ -1,6 +1,6 @@
 /** @file -Copyright (c) 2017, Intel Corporation. All rights 
reserved.+Copyright (c) 2017 - 2024, Intel Corporation. All rights 
reserved. SPDX-License-Identifier: BSD-2-Clause-Patent  **/@@ -10,6 +10,7 
@@ SPDX-License-Identifier: BSD-2-Clause-Patent
  #pragma pack(1) +#if FixedPcdGet8 (PcdFsptArchUpdRevision) <= 1 /** Fsp T 
Core UPD **/ typedef struct {@@ -34,6 +35,28 @@ typedef struct {
 **/   UINT8   Reserved[16]; } FSPT_CORE_UPD;+#else+/** Fsp 
T Core UPD+**/+typedef struct {++/** Offset 0x0040+**/+  EFI_PHYSICAL_ADDRESS   
 MicrocodeRegionBase;++/** Offset 0x0048+**/+  UINT64  
MicrocodeRegionSize;++/** Offset 0x0050+**/+  EFI_PHYSICAL_ADDRESS
CodeRegionBase;++/** Offset 0x0058+**/+  UINT64  
CodeRegionSize;+} FSPT_CORE_UPD;+#endif  #pragma pack() diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/SecEntry.nasm
 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/SecEntry.nasm
index 7f6d771e41..0b3f343991 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/Ia32/SecEntry.nasm
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat
+++ formSecLib/Ia32/SecEntry.nasm
@@ -1,6 +1,6 @@
 
;-- 
;-; Copyright (c) 2019, Intel Corporation. All rights reserved.+; Copyright 
(c) 2019 - 2024, Intel Corporation. All rights reserved. ; 
SPDX-License-Identifier: BSD-2-Clause-Patent ; Module Name: ;@@ -13,7 +13,7 @@  
; 
;-- 
-#include "Fsp.h"+#include   SECTION .text diff --git 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
 
b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
index 2e0d67eae4..6806e000ce 100644
--- 
a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
+++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Librar

Re: [edk2-devel] [edk2-platforms][PATCH V2 4/8] Platform/Sgi: Add ACPI tables for RD-Fremont platform

2024-01-25 Thread Prabin CA
Thanks, resolved.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114456): https://edk2.groups.io/g/devel/message/114456
Mute This Topic: https://groups.io/mt/103685116/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 3/8] Platform/Sgi: Introduce a flag to enable PCIe support for RD Platforms

2024-01-25 Thread Prabin CA
Hi Pierre,

Since, Pcie is not enabled in the platform we have to suppress the Pcie related 
modules while in booting, other wise it cause the boot hazard to the platforms.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114455): https://edk2.groups.io/g/devel/message/114455
Mute This Topic: https://groups.io/mt/103685115/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 0/8] Platform/Sgi: Add support for RD-Fremont platform

2024-01-25 Thread Prabin CA
Hi Pierre,

Thanks for reviewing it, I have followed the links you send to correct the 
signed-off. Please review the patches.

This patch have dependencies with 
https://edk2.groups.io/g/devel/message/113732. I had already mentioned same in 
the cover letter of this Patches too.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114454): https://edk2.groups.io/g/devel/message/114454
Mute This Topic: https://groups.io/mt/103685111/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 v3 8/8] Platform/Sgi: Add CPPC support for RD-Fremont platform

2024-01-25 Thread Prabin CA
Enable ACPI CPPC mechanism for RD-Fremont as defined by the ACPI
specification. The implementation uses AMU registers accessible as
Fixed-feature Hardware (FFixedHW) for monitoring the performance.
Non-secure SCMI fastchannels are used to communicate with LCP to set
the desired performance. RD-Fremont platform does not support CPPC
revision 1 and below. So update the _OSC method to let OSPM know about
this fact.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf |   1 +
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl  | 162 

 2 files changed, 163 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
index 7556c1239116..fcaa3299c4ea 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
@@ -48,6 +48,7 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt
   gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
   gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
+  gArmSgiTokenSpaceGuid.PcdOscCppcEnable
   gArmSgiTokenSpaceGuid.PcdOscLpiEnable
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
index f921eeb2d99e..b9aca8477ca4 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
@@ -11,6 +11,10 @@
 *   - ACPI 6.5, Chapter 8, Section 8.4.3, Lower Power Idle States
 *   - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Section 3.1,
 * Idle management and Low Power Idle states
+*   - ACPI 6.5, Chapter 8, Section 8.4.6, Collaborative Processor Performance
+* Control
+*   - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Section 3.2,
+* Performance management and Collaborative Processor Performance Control
 *
 **/
 
@@ -43,6 +47,20 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", 
"ARMSGI",
   Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
 }
   }
+
+  If (And (CAP0, OSC_CAP_CPPC_SUPPORT)) {
+/* CPPC revision 1 and below not supported */
+And (CAP0, Not (OSC_CAP_CPPC_SUPPORT), CAP0)
+Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
+  }
+
+  If (And (CAP0, OSC_CAP_CPPC2_SUPPORT)) {
+if (LEqual (FixedPcdGet32 (PcdOscCppcEnable), Zero)) {
+  And (CAP0, Not (OSC_CAP_CPPC2_SUPPORT), CAP0)
+  Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
+}
+  }
+
 } Else {
   And (STS0, Not (OSC_STS_MASK), STS0)
   Or (STS0, Or (OSC_STS_FAILURE, OSC_STS_UNRECOGNIZED_REV), STS0)
@@ -116,6 +134,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", 
"ARMSGI",
 Name (_UID, 0)
 Name (_STA, 0xF)
 
+Name (_CPC, Package()
+  CPPC_PACKAGE_INIT (0x200093000, 0x200093004, 20, 160, 160, 85, 85, 5)
+)
+
+Name (_PSD, Package () {
+  Package ()
+PSD_INIT (0)
+})
+
 Method (_LPI, 0, NotSerialized) {
   Return (\_SB.PLPI)
 }
@@ -131,6 +158,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", 
"ARMSGI",
 Name (_UID, 1)
 Name (_STA, 0xF)
 
+Name (_CPC, Package()
+  CPPC_PACKAGE_INIT (0x200293000, 0x200293004, 20, 160, 160, 85, 85, 5)
+)
+
+Name (_PSD, Package () {
+  Package ()
+PSD_INIT (1)
+})
+
 Method (_LPI, 0, NotSerialized) {
   Return (\_SB.PLPI)
 }
@@ -146,6 +182,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", 
"ARMSGI",
 Name (_UID, 2)
 Name (_STA, 0xF)
 
+Name (_CPC, Package()
+  CPPC_PACKAGE_INIT (0x200493000, 0x200493004, 20, 160, 160, 85, 85, 5)
+)
+
+Name (_PSD, Package () {
+  Package ()
+PSD_INIT (2)
+})
+
 Method (_LPI, 0, NotSerialized) {
   Return (\_SB.PLPI)
 }
@@ -161,6 +206,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", 
"ARMSGI",
 Name (_UID, 3)
 Name (_STA, 0xF)
 
+Name (_CPC, Package()
+  CPPC_PACKAGE_INIT (0x200693000, 0x200693004, 20, 160, 160, 85, 85, 5)
+)
+
+Name (_PSD, Package () {
+  Package ()
+PSD_INIT (3)
+})
+
 Method (_LPI, 0, NotSerialized) {
   Return (\_SB.PLPI)
 }
@@ -176,6 +230,15 @@ DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", 
"ARMSGI",
 Name (_UID, 4)
 Name (_STA, 0xF)
 
+Name (_CPC, Package()
+  CPPC_PACKAGE_INIT (0x200893000, 0x200893004, 20, 160, 160, 85, 85, 5)
+)
+
+Name (_PSD, Package () {
+  Package ()
+PSD_INIT (4)
+})
+
 Method (_LPI, 0, 

[edk2-devel] [edk2-platforms][PATCH v3 7/8] Platform/Sgi: Low Power Idle States for RD-Fremont

2024-01-25 Thread Prabin CA
RD-Fremont platform supports two LPI states, LPI1 (Standby WFI) and LPI3
(Power-down). The cluster supports LPI2 (Power-down) state. The LPI
implementation also supports combined power state for core and cluster.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf |   1 +
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl  | 154 

 2 files changed, 155 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
index 9d07001dec96..7556c1239116 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
@@ -48,6 +48,7 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt
   gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
   gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
+  gArmSgiTokenSpaceGuid.PcdOscLpiEnable
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
index 8812ea877f7a..f921eeb2d99e 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
@@ -8,6 +8,9 @@
 * @par Specification Reference:
 *   - ACPI 6.5, Chapter 5, Section 5.2.11.1, Differentiated System Description
 * Table (DSDT)
+*   - ACPI 6.5, Chapter 8, Section 8.4.3, Lower Power Idle States
+*   - Arm Functional Fixed Hardware Specification v1.2, Chapter 3, Section 3.1,
+* Idle management and Low Power Idle states
 *
 **/
 
@@ -17,6 +20,93 @@
 DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
  EFI_ACPI_ARM_OEM_REVISION) {
   Scope (_SB) {
+/* _OSC: Operating System Capabilities */
+Method (_OSC, 4, Serialized) {
+  CreateDWordField (Arg3, 0x00, STS0)
+  CreateDWordField (Arg3, 0x04, CAP0)
+
+  /* Platform-wide Capabilities */
+  If (LEqual (Arg0, ToUUID("0811b06e-4a27-44f9-8d60-3cbbc22e7b48"))) {
+/* OSC rev 1 supported, for other version, return failure */
+If (LEqual (Arg1, One)) {
+  And (STS0, Not (OSC_STS_MASK), STS0)
+
+  If (And (CAP0, OSC_CAP_OS_INITIATED_LPI)) {
+/* OS initiated LPI not supported */
+And (CAP0, Not (OSC_CAP_OS_INITIATED_LPI), CAP0)
+Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
+  }
+
+  If (And (CAP0, OSC_CAP_PLAT_COORDINATED_LPI)) {
+if (LEqual (FixedPcdGet32 (PcdOscLpiEnable), Zero)) {
+  And (CAP0, Not (OSC_CAP_PLAT_COORDINATED_LPI), CAP0)
+  Or (STS0, OSC_STS_CAPABILITY_MASKED, STS0)
+}
+  }
+} Else {
+  And (STS0, Not (OSC_STS_MASK), STS0)
+  Or (STS0, Or (OSC_STS_FAILURE, OSC_STS_UNRECOGNIZED_REV), STS0)
+}
+  } Else {
+And (STS0, Not (OSC_STS_MASK), STS0)
+Or (STS0, Or (OSC_STS_FAILURE, OSC_STS_UNRECOGNIZED_UUID), STS0)
+  }
+
+  Return (Arg3)
+}
+
+Name (PLPI, Package () {  /* LPI for Processor, support 2 LPI states */
+  0,  // Version
+  0,  // Level Index
+  2,  // Count
+  Package () {// WFI for CPU
+1,// Min residency (uS)
+1,// Wake latency (uS)
+1,// Flags
+0,// Arch Context lost Flags (no loss)
+0,// Residency Counter Frequency
+0,// No parent state
+ResourceTemplate () { // Register Entry method
+  Register (FFixedHW,
+32,   // Bit Width
+0,// Bit Offset
+0x,   // Address
+3,// Access Size
+  )
+},
+ResourceTemplate () { // Null Residency Counter
+  Register (SystemMemory, 0, 0, 0, 0)
+},
+ResourceTemplate () { // Null Usage Counter
+  Register (SystemMemory, 0, 0, 0, 0)
+},
+"LPI1-Core"
+  },
+  Package () {// Power Gating state for CPU
+150,  // Min residency (uS)
+350,  // Wake latency (uS)
+1,// Flags
+1,// Arch Context lost Flags (Core context lost)
+0,// Residency Counter Frequency
+0,// No parent state
+ResourceTemplate () { // Register Entry method
+  Register (FFixedHW,
+32,   // Bit Width
+0,// Bit Offset
+0x4002,   // Address (PwrLvl:core, StateTyp:PwrDn)
+3,// Access Size
+  )
+},
+

[edk2-devel] [edk2-platforms][PATCH v3 6/8] Platform/Sgi: Extend SMBIOS support for RD-Fremont

2024-01-25 Thread Prabin CA
Extend the SMBIOS support for RD-Fremont platform. RD-Fremont is a
16 core platform with Poseidon CPU. Each of the CPUs include
64KB L1 Data cache, 64KB L1 Instruction cache and 2MB L2 cache.
The platform also includes system level cache of 32MB and 8GB of RAM.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h | 5 
+
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c| 5 
-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c | 5 
-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c | 1 +
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c | 6 
++
 5 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index 6fa39d407bc9..acfa45910aed 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -51,6 +51,10 @@
 #define RD_V2_PART_NUM0x7F2
 #define RD_V2_CONF_ID 0x1
 
+// RD-Fremont Platform Identification values
+#define RD_Fremont_PART_NUM   0x7EE
+#define RD_Fremont_CONF_ID0x1
+
 #define SGI_CONFIG_MASK   0x0F
 #define SGI_CONFIG_SHIFT  0x1C
 #define SGI_PART_NUM_MASK 0xFFF
@@ -90,6 +94,7 @@ typedef enum {
   RdN2Cfg1,
   RdN2Cfg2,
   RdV2,
+  RdFremont,
 } ARM_RD_PRODUCT_ID;
 
 // Arm ProductId look-up table
diff --git 
a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c 
b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
index edf2a5f63c63..9c28b051ebc2 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
@@ -34,7 +34,8 @@
   "RdN2\0"  \
   "RdN2Cfg1\0"  \
   "RdN2Cfg2\0"  \
-  "RdV2\0"
+  "RdV2\0"  \
+  "RdFremont\0"
 
 typedef enum {
   ManufacturerName = 1,
@@ -74,6 +75,8 @@ STATIC GUID mSmbiosUid[] = {
   {0xd2946d07, 0x8057, 0x4c26, {0xbf, 0x53, 0x78, 0xa6, 0x5b, 0xe1, 0xc1, 
0x60}},
   /* Rd-V2 */
   {0x3b1180a3, 0x0744, 0x4194, {0xae, 0x2e, 0xed, 0xa5, 0xbc, 0x2e, 0x43, 
0x45}},
+  /* Rd-Fremont*/
+  {0x904b28d6, 0x0662, 0x11ed, {0xb9, 0x39, 0x02, 0x42, 0xac, 0x12, 0x00, 
0x02}},
 };
 
 /* System information */
diff --git 
a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c 
b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c
index ee269f707714..c39c1553f6aa 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c
@@ -44,6 +44,7 @@
   "Neoverse-N2\0"   \
   "Neoverse-N2\0"   \
   "Neoverse-V2\0"   \
+  "Neoverse-Poseidon\0" \
   "000-0\0" /* Serial number */ \
   "783-3\0" \
   "786-1\0" \
@@ -54,7 +55,8 @@
   "7B7-1\0" \
   "7B6-1\0" \
   "7B7-1\0" \
-  "7F2-1\0"
+  "7F2-1\0" \
+  "7EE-1\0"
 
 typedef enum {
   PartNumber = 1,
@@ -181,6 +183,7 @@ InstallType4ProcessorInformation (
   case RdN2:
   case RdN2Cfg1:
   case RdV2:
+  case RdFremont:
 mArmRdSmbiosType4.Base.CoreCount = CoreCount;
 mArmRdSmbiosType4.Base.EnabledCoreCount = CoreCount;
 mArmRdSmbiosType4.Base.ThreadCount = CoreCount;
diff --git 
a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c 
b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c
index 4af72919a3f1..4cdea5b3b763 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c
@@ -335,6 +335,7 @@ InstallType7CacheInformation (
 mArmRdSmbiosType7[4].Base.Associativity = CacheAssociativity16Way;
 break;
   case RdV2:
+  case RdFremont:
 /* L1 instruction cache */
 mArmRdSmbiosType7[0].Base.MaximumCacheSize2 = 64;// 64KB
 mArmRdSmbiosType7[0].Base.InstalledSize2 = 64;   // 64KB
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c 
b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c
index 14b06796ae9c..ae31be142d12 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c
+++ 

[edk2-devel] [edk2-platforms][PATCH v3 5/8] Platform/Sgi: Add initial support for RD-Fremont platform

2024-01-25 Thread Prabin CA
The RD-Fremont fixed virtual platform simulates 16 CPUs and 8GB of RAM.
Add initial support for this platform by adding the required platform
build configuration files. This platform has considerable differences in
its memory map compared to its predecessors. So add a corresponding
memory map file as well to define the PCDs for its generation of
platforms.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiMemoryMap3.dsc.inc   | 71 
 Platform/ARM/SgiPkg/RdFremont/RdFremont.dsc | 55 +++
 Platform/ARM/SgiPkg/RdFremont/RdFremont.fdf.inc | 10 +++
 3 files changed, 136 insertions(+)

diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap3.dsc.inc 
b/Platform/ARM/SgiPkg/SgiMemoryMap3.dsc.inc
new file mode 100644
index ..06c3b37388c1
--- /dev/null
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap3.dsc.inc
@@ -0,0 +1,71 @@
+#
+#  Copyright (c) 2024, Arm Limited. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+[PcdsFixedAtBuild.common]
+  # System Peripherals
+  gArmSgiTokenSpaceGuid.PcdSmcCs0Base|0x0800
+  gArmSgiTokenSpaceGuid.PcdSmcCs1Base|0x06
+  gArmSgiTokenSpaceGuid.PcdSysPeriphBase|0x0C00
+  gArmSgiTokenSpaceGuid.PcdSysPeriphSysRegBase|0x0C01
+
+  # SP804 dual timer
+  gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress|0x0C11
+  gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize|0x0001
+  gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt|216
+
+  # Virtio Disk
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress|0x0C13
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize|0x1
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt|184
+
+  # GPIO controller
+  gArmSgiTokenSpaceGuid.PcdGpioController0BaseAddress|0x0C1D
+  gArmSgiTokenSpaceGuid.PcdGpioController0Size|0x0001
+  gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt|168
+
+   # Ethernet
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress|0x0C15
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt|186
+
+  # PL031 RealTimeClock
+  gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0C17
+
+  # Virtio P9
+  gArmSgiTokenSpaceGuid.PcdVirtioP9BaseAddress|0x0C19
+  gArmSgiTokenSpaceGuid.PcdVirtioP9Size|0x1
+  gArmSgiTokenSpaceGuid.PcdVirtioP9Interrupt|185
+
+  # PL370 - HDLCD1
+  gArmPlatformTokenSpaceGuid.PcdArmHdLcdBase|0x0EF6
+
+  # PL011 - Serial Debug UART
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase|0x0EF7
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt|179
+
+  # PL011 - Serial Terminal
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt|112
+
+  # System Memory (2GB - 128MB of Trusted DRAM at the top of the 32bit address 
space)
+  gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
+  gArmTokenSpaceGuid.PcdSystemMemorySize|0x7800
+
+  # SMMU
+  gArmSgiTokenSpaceGuid.PcdSmmuBase|0x28000
+  gArmSgiTokenSpaceGuid.PcdSmmuSize|0x400
+
+  # Non-Volatile variable storage
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0x06
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64|0x060140
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0x060280
+
+  # Address bus width - 64TB address space
+  gArmSgiTokenSpaceGuid.PcdMaxAddressBitsPerChip|46
+
+  # Timer & Watchdog interrupts
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv|109
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv|108
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv|110
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|111
diff --git a/Platform/ARM/SgiPkg/RdFremont/RdFremont.dsc 
b/Platform/ARM/SgiPkg/RdFremont/RdFremont.dsc
new file mode 100644
index ..b52d2f59e15d
--- /dev/null
+++ b/Platform/ARM/SgiPkg/RdFremont/RdFremont.dsc
@@ -0,0 +1,55 @@
+#
+#  Copyright (c) 2024, Arm Limited. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+
+[Defines]
+  PLATFORM_NAME  = RdFremont
+  PLATFORM_GUID  = fd140b0f-4467-4314-aa69-cd0bd712e08e
+  PLATFORM_VERSION   = 0.1
+  DSC_SPECIFICATION  = 0x0001001B
+  OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
+  SUPPORTED_ARCHITECTURES= AARCH64
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
+  SKUID_IDENTIFIER   = DEFAULT
+  FLASH_DEFINITION   = Platform/ARM/SgiPkg/SgiPlatform.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/ARM/SgiPkg/RdFremont/RdFremont.fdf.inc
+  BUILD_NUMBER   = 1
+
+# include common definitions from SgiPlatform.dsc
+!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+!include Platform/ARM/SgiPkg/SgiMemoryMap3.dsc.inc
+
+# include common/basic libraries from MdePkg.
+!include MdePkg/MdeLibs.dsc.inc
+
+
+#
+# Pcd Section - list of 

[edk2-devel] [edk2-platforms][PATCH v3 4/8] Platform/Sgi: Add ACPI tables for RD-Fremont platform

2024-01-25 Thread Prabin CA
From: Shriram K 

RD-Fremont is the next platform in the Arm's reference design platform
series. This platform includes 32 CPUs but the fixed virtual platform
(FVP) simulates 16 CPUs of the platform. There is one CPU per cluster in
the system and so the FVP simulates 16 clusters. In preparation for
adding support for this platform, add the initial set of ACPI tables and
reuse existing ACPI tables as applicable to boot a operating system on
this platform.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf |  73 
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl  | 196 

 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Madt.aslc | 138 ++
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Pptt.aslc | 167 +
 4 files changed, 574 insertions(+)

diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
new file mode 100644
index ..9d07001dec96
--- /dev/null
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
@@ -0,0 +1,73 @@
+## @file
+#  ACPI table data and ASL sources required to boot the platform.
+#
+#  Copyright (c) 2024, Arm Ltd. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION= 0x0001001A
+  BASE_NAME  = RdFremontAcpiTables
+  FILE_GUID  = c712719a-0aaf-438c-9cdd-35ab4d60207d  # 
gArmSgiAcpiTablesGuid
+  MODULE_TYPE= USER_DEFINED
+  VERSION_STRING = 1.0
+
+[Sources]
+  Dbg2.aslc
+  Fadt.aslc
+  Gtdt.aslc
+  RdFremont/Dsdt.asl
+  RdFremont/Madt.aslc
+  RdFremont/Pptt.aslc
+  Spcr.aslc
+  SsdtEvents.asl
+  SsdtRos.asl
+  SsdtRosVirtioP9.asl
+
+[Packages]
+  ArmPkg/ArmPkg.dec
+  ArmPlatformPkg/ArmPlatformPkg.dec
+  EmbeddedPkg/EmbeddedPkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MdePkg/MdePkg.dec
+  Platform/ARM/SgiPkg/SgiPlatform.dec
+
+[FixedPcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase
+
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgInterrupt
+  gArmPlatformTokenSpaceGuid.PcdSerialDbgRegisterBase
+  gArmPlatformTokenSpaceGuid.PL011UartInterrupt
+  gArmPlatformTokenSpaceGuid.PcdCoreCount
+  gArmPlatformTokenSpaceGuid.PcdClusterCount
+
+  gArmSgiTokenSpaceGuid.PcdGpioController0BaseAddress
+  gArmSgiTokenSpaceGuid.PcdGpioController0Size
+  gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt
+  gArmSgiTokenSpaceGuid.PcdGtFrame0Gsiv
+  gArmSgiTokenSpaceGuid.PcdGtFrame1Gsiv
+  gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress
+  gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize
+  gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkSize
+  gArmSgiTokenSpaceGuid.PcdVirtioBlkInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioNetBaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioNetSize
+  gArmSgiTokenSpaceGuid.PcdVirtioNetInterrupt
+  gArmSgiTokenSpaceGuid.PcdVirtioP9BaseAddress
+  gArmSgiTokenSpaceGuid.PcdVirtioP9Size
+  gArmSgiTokenSpaceGuid.PcdVirtioP9Interrupt
+  gArmSgiTokenSpaceGuid.PcdWdogWS0Gsiv
+  gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv
+
+  gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum
+  gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum
+  gArmTokenSpaceGuid.PcdGicDistributorBase
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogControlBase
+  gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl 
b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
new file mode 100644
index ..8812ea877f7a
--- /dev/null
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
@@ -0,0 +1,196 @@
+/** @file
+*  Differentiated System Description Table Fields (DSDT)
+*
+*  Copyright (c) 2024, Arm Limited. All rights reserved.
+*
+*  SPDX-License-Identifier: BSD-2-Clause-Patent
+*
+* @par Specification Reference:
+*   - ACPI 6.5, Chapter 5, Section 5.2.11.1, Differentiated System Description
+* Table (DSDT)
+*
+**/
+
+#include "SgiAcpiHeader.h"
+#include "SgiPlatform.h"
+
+DefinitionBlock ("DsdtTable.aml", "DSDT", 2, "ARMLTD", "ARMSGI",
+ EFI_ACPI_ARM_OEM_REVISION) {
+  Scope (_SB) {
+Device (CL00) {   // Cluster 0
+  Name (_HID, "ACPI0010")
+  Name (_UID, 0)
+
+  Device (CP00) { // Neoverse Poseidon core 0
+Name (_HID, "ACPI0007")
+Name (_UID, 0)
+Name (_STA, 0xF)
+  }
+}
+
+Device (CL01) {   // Cluster 1
+  Name (_HID, "ACPI0010")
+  Name (_UID, 1)
+
+  Device (CP01) { // Neoverse Poseidon core 1
+Name (_HID, "ACPI0007")
+Name (_UID, 1)
+Name (_STA, 0xF)
+  }
+}
+
+Device (CL02) {   // Cluster 2
+  Name (_HID, "ACPI0010")
+  Name (_UID, 2)
+
+  Device (CP02) { // Neoverse Poseidon core 2
+Name 

[edk2-devel] [edk2-platforms][PATCH v3 3/8] Platform/Sgi: Introduce a flag to enable PCIe support for RD Platforms

2024-01-25 Thread Prabin CA
Introducing a flag called PCIE_ENABLE, which can be set to TRUE or
FALSE from the respective .dsc files to enable or disable the
PCIe support. As not all reference design platforms have PCIe support
enabled, this flag is introduced.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec  |  1 +
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc  |  6 ++
 Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc|  4 +++-
 Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc|  4 +++-
 Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc|  4 +++-
 Platform/ARM/SgiPkg/RdV1/RdV1.dsc|  4 +++-
 Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc|  4 +++-
 Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc|  4 +++-
 Platform/ARM/SgiPkg/SgiPlatform.fdf  |  4 +++-
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf  |  5 -
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 19 
+++
 11 files changed, 43 insertions(+), 16 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 4087ff6cad2e..af7887e54126 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -31,6 +31,7 @@ [Guids.common]
 [PcdsFeatureFlag.common]
   gArmSgiTokenSpaceGuid.PcdVirtioBlkSupported|FALSE|BOOLEAN|0x0001
   gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|FALSE|BOOLEAN|0x0010
+  gArmSgiTokenSpaceGuid.PcdPcieEnable|FALSE|BOOLEAN|0x002E
 
 [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x0002
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 1cfe07c7e4ed..1bf489ffeb39 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -103,6 +103,10 @@ [PcdsFeatureFlag.common]
   gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|TRUE
   gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache|FALSE
 
+!if $(PCIE_ENABLE) == TRUE
+  gArmSgiTokenSpaceGuid.PcdPcieEnable|TRUE
+!endif
+
 [PcdsFixedAtBuild.common]
   gArmTokenSpaceGuid.PcdVFPEnabled|1
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000
@@ -330,6 +334,7 @@ [Components.common]
   # Virtio Network
   OvmfPkg/VirtioNetDxe/VirtioNet.inf
 
+!if $(PCIE_ENABLE) == TRUE
   #
   # Required by PCI
   #
@@ -343,6 +348,7 @@ [Components.common]
 
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8010004F
   }
+!endif
 
   #
   # AHCI Support
diff --git a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc 
b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
index 32d67d380814..c7463da5203e 100644
--- a/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
+++ b/Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2020-2022, ARM Limited. All rights reserved.
+#  Copyright (c) 2020-2024, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -22,6 +22,8 @@ [Defines]
   BOARD_DXE_FV_COMPONENTS= 
Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.fdf.inc
   BUILD_NUMBER   = 1
 
+  DEFINE PCIE_ENABLE = TRUE
+
 # include common definitions from SgiPlatform.dsc
 !include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
 !include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
diff --git a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc 
b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
index 6c9a64df054f..77efec9d9533 100644
--- a/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
+++ b/Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2020-2022, ARM Limited. All rights reserved.
+#  Copyright (c) 2020-2024, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -22,6 +22,8 @@ [Defines]
   BOARD_DXE_FV_COMPONENTS= 
Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.fdf.inc
   BUILD_NUMBER   = 1
 
+  DEFINE PCIE_ENABLE = TRUE
+
 # include common definitions from SgiPlatform.dsc
 !include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
 !include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
diff --git a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc 
b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
index 10e5bfa29b46..521d88925059 100644
--- a/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
+++ b/Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2020-2022, ARM Limited. All rights reserved.
+#  Copyright (c) 2020-2024, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -22,6 +22,8 @@ [Defines]
   BOARD_DXE_FV_COMPONENTS= 
Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.fdf.inc
   BUILD_NUMBER   = 1
 
+  DEFINE PCIE_ENABLE = TRUE
+
 # include common definitions from SgiPlatform.dsc
 !include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
 !include Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
diff --git a/Platform/ARM/SgiPkg/RdV1/RdV1.dsc 

[edk2-devel] [edk2-platforms][PATCH v3 2/8] Platform/Sgi: Refactor system memory base and size definitions

2024-01-25 Thread Prabin CA
In preparation of adding the next generation of reference design
platform that have different memory map, refactor the
PcdSystemMemoryBase and PcdSystemMemorySize PCD definitions from the
common PCD definitions file into the various platform generation
specific memory map PCD definitions file.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc  | 8 +++-
 Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc | 8 +++-
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc   | 6 +-
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc 
b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
index 0c577c42..eab43b23ec6d 100644
--- a/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2020 - 2022, Arm Limited. All rights reserved.
+#  Copyright (c) 2020 - 2024, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -67,3 +67,9 @@ [PcdsFixedAtBuild.common]
   gArmSgiTokenSpaceGuid.PcdGpioController0BaseAddress|0x1C1D
   gArmSgiTokenSpaceGuid.PcdGpioController0Size|0x0001
   gArmSgiTokenSpaceGuid.PcdGpioController0Interrupt|136
+
+  # System Memory (1GB - 16MB of Trusted DRAM at the top of the
+  # 32bit address space)
+  gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
+  gArmTokenSpaceGuid.PcdSystemMemorySize|0x7F00
+
diff --git a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc 
b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
index de1d8ea24b89..35e27d42d5a2 100644
--- a/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2020 - 2023, Arm Limited. All rights reserved.
+#  Copyright (c) 2020 - 2024, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -75,3 +75,9 @@ [PcdsFixedAtBuild.common]
 
   # IO virtualization block
   gArmSgiTokenSpaceGuid.PcdIoVirtSocExpBlk0Base|0x108000
+
+  # System Memory (1GB - 16MB of Trusted DRAM at the top of the
+  # 32bit address space)
+  gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
+  gArmTokenSpaceGuid.PcdSystemMemorySize|0x7F00
+
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc 
b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 26ecd9ed59a7..1cfe07c7e4ed 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2018 - 2022, ARM Limited. All rights reserved.
+#  Copyright (c) 2018 - 2024, Arm Limited. All rights reserved.
 #  (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -131,10 +131,6 @@ [PcdsFixedAtBuild.common]
   gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4
   gArmPlatformTokenSpaceGuid.PcdCPUCoreSecondaryStackSize|0x0
 
-  # System Memory (1GB - 16MB of Trusted DRAM at the top of the 32bit address 
space)
-  gArmTokenSpaceGuid.PcdSystemMemoryBase|0x8000
-  gArmTokenSpaceGuid.PcdSystemMemorySize|0x7F00
-
   # ACPI Table Version
   gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
 
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114447): https://edk2.groups.io/g/devel/message/114447
Mute This Topic: https://groups.io/mt/103959494/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 v3 1/8] Platform/Sgi: Update the datatype of PcdSmmuBase from u32 to u64

2024-01-25 Thread Prabin CA
From: Vivek Gautam 

On RD-N2 and previous generation platforms, the base address was within
32-bit region. However, on upcoming platforms, the SMMUv3 base address
is beyond 32-bit address region. So, update the datatype of SMMUv3 base
PCD.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec  | 2 +-
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 103dff8471a7..4087ff6cad2e 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -79,7 +79,7 @@ [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdWdogWS1Gsiv|0|UINT32|0x0014
 
   # SMMU
-  gArmSgiTokenSpaceGuid.PcdSmmuBase|0|UINT32|0x001D
+  gArmSgiTokenSpaceGuid.PcdSmmuBase|0|UINT64|0x001D
   gArmSgiTokenSpaceGuid.PcdSmmuSize|0|UINT32|0x001E
 
   # GPIO Controller
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c 
b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
index fa3cfbc730f6..62c212f3c5b0 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2018-2023, ARM Limited. All rights reserved.
+*  Copyright (c) 2018-2024, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -167,8 +167,8 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].Attributes  = 
ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
   // Sub System Peripherals - SMMU
-  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet32 (PcdSmmuBase);
-  VirtualMemoryTable[Index].VirtualBase = FixedPcdGet32 (PcdSmmuBase);
+  VirtualMemoryTable[++Index].PhysicalBase  = FixedPcdGet64 (PcdSmmuBase);
+  VirtualMemoryTable[Index].VirtualBase = FixedPcdGet64 (PcdSmmuBase);
   VirtualMemoryTable[Index].Length  = FixedPcdGet32 (PcdSmmuSize);
   VirtualMemoryTable[Index].Attributes  = 
ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
 
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114446): https://edk2.groups.io/g/devel/message/114446
Mute This Topic: https://groups.io/mt/103959493/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 v3 0/8] Platform/Sgi: Add support for RD-Fremont platform

2024-01-25 Thread Prabin CA
Changes since V2:
- Removed author's signed-off on the patches, which is owned by another author.

Changes since V1:
- Corrected memory map in the DSDT file.

This patch series introduce support for RD-Fremont reference design
platform. This platform includes 32 CPUs, but the fixed virtual platform
(FVP) simulates 16 CPUs of the platform. There is one CPU per cluster in
the system and so the FVP simulates 16 clusters. Each of the CPUs
include 64KB L1 Data cache, 64KB L1 Instruction cache and 2MB L2 cache.
The platform also includes system level cache of 32MB and 8GB of RAM.
Also, this patch series adding the extended SMBIO support for RD-Fremont
platform.

In addition to patches that introduce RD-Fremont platform, there are
three patches that update support for existing platforms. The first
patch in this series changes the data type of PcdSmmuBase from u32 to
u64. The second patch refactor the system memory map base and size
values. The third patch add a flag to enable PCIE support for existing
and future platforms.

This patch series should be applied on top of the patch series
https://edk2.groups.io/g/devel/message/113732

Link to gitlab branch with the patches in this series -
https://gitlab.arm.com/infra-solutions/reference-design/platsw/edk2-platforms/-/tree/topics/rdfremont


Prabin CA (6):
  Platform/Sgi: Refactor system memory base and size definitions
  Platform/Sgi: Introduce a flag to enable PCIe support for RD Platforms
  Platform/Sgi: Add initial support for RD-Fremont platform
  Platform/Sgi: Extend SMBIOS support for RD-Fremont
  Platform/Sgi: Low Power Idle States for RD-Fremont
  Platform/Sgi: Add CPPC support for RD-Fremont platform

Shriram K (1):
  Platform/Sgi: Add ACPI tables for RD-Fremont platform

Vivek Gautam (1):
  Platform/Sgi: Update the datatype of PcdSmmuBase from u32 to u64

 Platform/ARM/SgiPkg/SgiPlatform.dec   |   
3 +-
 Platform/ARM/SgiPkg/SgiMemoryMap.dsc.inc  |   
8 +-
 Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc |   
8 +-
 Platform/ARM/SgiPkg/{SgiMemoryMap2.dsc.inc => SgiMemoryMap3.dsc.inc}  |  
88 ++--
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc   |  
12 +-
 Platform/ARM/SgiPkg/RdE1Edge/RdE1Edge.dsc |   
4 +-
 Platform/ARM/SgiPkg/{RdV1/RdV1.dsc => RdFremont/RdFremont.dsc}|  
14 +-
 Platform/ARM/SgiPkg/RdN1Edge/RdN1Edge.dsc |   
4 +-
 Platform/ARM/SgiPkg/RdN1EdgeX2/RdN1EdgeX2.dsc |   
4 +-
 Platform/ARM/SgiPkg/RdV1/RdV1.dsc |   
4 +-
 Platform/ARM/SgiPkg/RdV1Mc/RdV1Mc.dsc |   
4 +-
 Platform/ARM/SgiPkg/Sgi575/Sgi575.dsc |   
4 +-
 Platform/ARM/SgiPkg/SgiPlatform.fdf   |   
4 +-
 Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf|  
75 +++
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf   |   
5 +-
 Platform/ARM/SgiPkg/Include/SgiPlatform.h |   
5 +
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c|   
5 +-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c |   
5 +-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c |   
1 +
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c |   
6 +
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c  |  
25 +-
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl | 
512 
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Madt.aslc| 
138 ++
 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Pptt.aslc| 
167 +++
 Platform/ARM/SgiPkg/RdFremont/RdFremont.fdf.inc   |  
10 +
 25 files changed, 1032 insertions(+), 83 deletions(-)
 copy Platform/ARM/SgiPkg/{SgiMemoryMap2.dsc.inc => SgiMemoryMap3.dsc.inc} (62%)
 copy Platform/ARM/SgiPkg/{RdV1/RdV1.dsc => RdFremont/RdFremont.dsc} (77%)
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdFremontAcpiTables.inf
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Dsdt.asl
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Madt.aslc
 create mode 100644 Platform/ARM/SgiPkg/AcpiTables/RdFremont/Pptt.aslc
 create mode 100644 Platform/ARM/SgiPkg/RdFremont/RdFremont.fdf.inc

-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114445): https://edk2.groups.io/g/devel/message/114445
Mute This Topic: https://groups.io/mt/103959491/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 v4 6/6] Platform/Sgi: Extend SMBIOS support for RD-V2 platform

2024-01-25 Thread Prabin CA
From: Pranav Madhu 

The Neoverse RD-V2 FVP platform includes 16 CPUs and each CPU has 64KB
of L1 instruction/data cache, 2MB of L2 cache and 32MB of system level
cache. Extend the SMBIOS support for RD-V2 platform with this
configuration and reuse rest of the RD-N2 SMBIOS configuration for the
RD-V2 platform.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c|  7 
+--
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c |  9 
++---
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c | 20 
+++-
 3 files changed, 30 insertions(+), 6 deletions(-)

diff --git 
a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c 
b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
index b7e2238fb39c..edf2a5f63c63 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
@@ -5,7 +5,7 @@
   Reference Design platforms. Type 1 table defines attributes of the
   overall system such as manufacturer, product name, UUID etc.
 
-  Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
+  Copyright (c) 2021 - 2024, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Specification Reference:
@@ -33,7 +33,8 @@
   "RdV1Mc\0"\
   "RdN2\0"  \
   "RdN2Cfg1\0"  \
-  "RdN2Cfg2\0"
+  "RdN2Cfg2\0"  \
+  "RdV2\0"
 
 typedef enum {
   ManufacturerName = 1,
@@ -71,6 +72,8 @@ STATIC GUID mSmbiosUid[] = {
   {0xa4941d3d, 0xfac3, 0x4ace, {0x9a, 0x7e, 0xce, 0x26, 0x76, 0x64, 0x5e, 
0xda}},
   /* Rd-N2-Cfg2*/
   {0xd2946d07, 0x8057, 0x4c26, {0xbf, 0x53, 0x78, 0xa6, 0x5b, 0xe1, 0xc1, 
0x60}},
+  /* Rd-V2 */
+  {0x3b1180a3, 0x0744, 0x4194, {0xae, 0x2e, 0xed, 0xa5, 0xbc, 0x2e, 0x43, 
0x45}},
 };
 
 /* System information */
diff --git 
a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c 
b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c
index b59172cf1cb9..ee269f707714 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c
@@ -6,7 +6,7 @@
   family, processor id, maximum operating frequency, and other information
   related to the processor.
 
-  Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
+  Copyright (c) 2021 - 2024, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Specification Reference:
@@ -27,7 +27,7 @@
 #define SOCKET_TYPE_BASE3
 #define SOCKET_TYPE_NUM 1
 #define PROCESSOR_VERSION_BASE  (SOCKET_TYPE_BASE + SOCKET_TYPE_NUM)
-#define PROCESSOR_VERSION_NUM   10
+#define PROCESSOR_VERSION_NUM   11
 #define SERIAL_NUMBER_BASE  (PROCESSOR_VERSION_BASE + 
PROCESSOR_VERSION_NUM)
 #define TYPE4_STRINGS   \
   "0x000\0" /* Part Number */   \
@@ -43,6 +43,7 @@
   "Neoverse-N2\0"   \
   "Neoverse-N2\0"   \
   "Neoverse-N2\0"   \
+  "Neoverse-V2\0"   \
   "000-0\0" /* Serial number */ \
   "783-3\0" \
   "786-1\0" \
@@ -52,7 +53,8 @@
   "78A-2\0" \
   "7B7-1\0" \
   "7B6-1\0" \
-  "7B7-1\0"
+  "7B7-1\0" \
+  "7F2-1\0"
 
 typedef enum {
   PartNumber = 1,
@@ -178,6 +180,7 @@ InstallType4ProcessorInformation (
 break;
   case RdN2:
   case RdN2Cfg1:
+  case RdV2:
 mArmRdSmbiosType4.Base.CoreCount = CoreCount;
 mArmRdSmbiosType4.Base.EnabledCoreCount = CoreCount;
 mArmRdSmbiosType4.Base.ThreadCount = CoreCount;
diff --git 
a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c 
b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c
index b71ce721e2e8..4af72919a3f1 100644
--- a/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c
+++ b/Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c
@@ -6,7 +6,7 @@
   implemented, cache configuration, ways of associativity and other
   information related to cache memory installed.
 
-  Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
+  Copyright (c) 2021 - 2024, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Specification Reference:
@@ -334,6 +334,24 @@ InstallType7CacheInformation (
  

[edk2-devel] [edk2-platforms][PATCH v4 5/6] Platform/Sgi: Define RD-V2 platform id values

2024-01-25 Thread Prabin CA
From: Pranav Madhu 

Add RD-V2 platform identification values including the part number
and configuration number. This information will be used in populating
the SMBIOS tables.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h | 7 ++-
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c | 8 +++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/Include/SgiPlatform.h 
b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
index e83853664c4c..6fa39d407bc9 100644
--- a/Platform/ARM/SgiPkg/Include/SgiPlatform.h
+++ b/Platform/ARM/SgiPkg/Include/SgiPlatform.h
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2018 - 2022, Arm Limited. All rights reserved.
+*  Copyright (c) 2018 - 2024, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -47,6 +47,10 @@
 #define RD_N2_PART_NUM0x7B7
 #define RD_N2_CONF_ID 0x1
 
+// RD-V2 Platform Identification values
+#define RD_V2_PART_NUM0x7F2
+#define RD_V2_CONF_ID 0x1
+
 #define SGI_CONFIG_MASK   0x0F
 #define SGI_CONFIG_SHIFT  0x1C
 #define SGI_PART_NUM_MASK 0xFFF
@@ -85,6 +89,7 @@ typedef enum {
   RdN2,
   RdN2Cfg1,
   RdN2Cfg2,
+  RdV2,
 } ARM_RD_PRODUCT_ID;
 
 // Arm ProductId look-up table
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c 
b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c
index fa006320025b..14b06796ae9c 100644
--- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c
+++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c
@@ -1,6 +1,6 @@
 /** @file
 *
-*  Copyright (c) 2018 - 2022, Arm Limited. All rights reserved.
+*  Copyright (c) 2018 - 2024, Arm Limited. All rights reserved.
 *
 *  SPDX-License-Identifier: BSD-2-Clause-Patent
 *
@@ -79,6 +79,12 @@ STATIC CONST SGI_PRODUCT_ID_LOOKUP SgiProductIdLookup[] = {
 RD_N2_CONF_ID,
 1
   },
+  {
+RdV2,
+RD_V2_PART_NUM,
+RD_V2_CONF_ID,
+0
+  },
 };
 
 EFI_BOOT_MODE
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114443): https://edk2.groups.io/g/devel/message/114443
Mute This Topic: https://groups.io/mt/103959451/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 v4 4/6] Platform/Sgi: Add support for RD-N2-Cfg3 platform

2024-01-25 Thread Prabin CA
The Neoverse RD-N2-Cfg3 platform is a variant of RD-N2 platform with a
different mesh size and GIC ITS count. As part of the initial platform
support, add the corresponding platform and flash description files.
Use PcdPlatformVariant for the RD-N2-Cfg3 platform to specify the
platform variant. RD-N2-Cfg3 has 12 GIC ITS blocks when compared to the
other RD-N2 variants that have 6 GIC ITS blocks.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.dsc 
| 58 
 Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf 
|  3 +-
 Platform/ARM/SgiPkg/AcpiTables/{RdN2AcpiTables.inf => RdN2Cfg3AcpiTables.inf} 
| 15 ++---
 Platform/ARM/SgiPkg/AcpiTables/RdN2/Madt.aslc 
| 14 -
 Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.fdf.inc 
| 10 
 5 files changed, 88 insertions(+), 12 deletions(-)

diff --git a/Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.dsc 
b/Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.dsc
new file mode 100644
index ..88293b236a32
--- /dev/null
+++ b/Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.dsc
@@ -0,0 +1,58 @@
+#
+#  Copyright (c) 2024, ARM Limited. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+
+[Defines]
+  PLATFORM_NAME  = RdN2Cfg3
+  PLATFORM_GUID  = b890ba7d-a256-4820-9d3a-655acbb737c9
+  PLATFORM_VERSION   = 0.1
+  DSC_SPECIFICATION  = 0x0001001B
+  OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
+  SUPPORTED_ARCHITECTURES= AARCH64
+  BUILD_TARGETS  = NOOPT|DEBUG|RELEASE
+  SKUID_IDENTIFIER   = DEFAULT
+  FLASH_DEFINITION   = Platform/ARM/SgiPkg/SgiPlatform.fdf
+  BOARD_DXE_FV_COMPONENTS= 
Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.fdf.inc
+  BUILD_NUMBER   = 1
+
+# include common definitions from SgiPlatform.dsc
+!include Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+!include Platform/ARM/SgiPkg/SgiMemoryMap2.dsc.inc
+
+# include common/basic libraries from MdePkg.
+!include MdePkg/MdeLibs.dsc.inc
+
+
+#
+# Pcd Section - list of all EDK II PCD Entries defined by this Platform
+#
+
+
+[PcdsFixedAtBuild.common]
+  # GIC configurations
+  gArmTokenSpaceGuid.PcdGicDistributorBase|0x3000
+  gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x3030
+  gArmSgiTokenSpaceGuid.PcdGicSize|0x40
+
+  # ARM Cores and Clusters
+  gArmPlatformTokenSpaceGuid.PcdCoreCount|1
+  gArmPlatformTokenSpaceGuid.PcdClusterCount|16
+
+  # RdN2Cfg3 is the third variant from RdN2 Platform
+  gArmSgiTokenSpaceGuid.PcdPlatformVariant|3
+
+
+#
+# Components Section - list of all EDK II Modules needed by this Platform
+#
+
+
+[Components.common]
+  Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg3AcpiTables.inf
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
index 8025ef58171b..afc38385c051 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
@@ -1,7 +1,7 @@
 ## @file
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.
+#  Copyright (c) 2020 - 2024, Arm Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -67,6 +67,7 @@ [FixedPcd]
   gArmSgiTokenSpaceGuid.PcdMaxAddressBitsPerChip
   gArmSgiTokenSpaceGuid.PcdOscLpiEnable
   gArmSgiTokenSpaceGuid.PcdOscCppcEnable
+  gArmSgiTokenSpaceGuid.PcdPlatformVariant
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerBaseAddress
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerSize
   gArmSgiTokenSpaceGuid.PcdSp804DualTimerInterrupt
diff --git a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf 
b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg3AcpiTables.inf
similarity index 90%
copy from Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
copy to Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg3AcpiTables.inf
index 8025ef58171b..a703d5a994f7 100644
--- a/Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf
+++ b/Platform/ARM/SgiPkg/AcpiTables/RdN2Cfg3AcpiTables.inf
@@ -1,7 +1,7 @@
 ## @file
 #  ACPI table data and ASL sources required to boot the platform.
 #
-#  Copyright (c) 2020 - 2023, Arm Ltd. All rights reserved.
+#  Copyright (c) 2024, Arm Ltd. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -9,7 

[edk2-devel] [edk2-platforms][PATCH v4 3/6] Platform/Sgi: Add a PCD to specify platform variant

2024-01-25 Thread Prabin CA
A new PCD named PcdPlatformVariant is introduced to specify the variant
number of a platform. This PCD can be used to select platform variant
specific configurations. The default value of this PCD is 0 which
selects the base variant.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiPlatform.dec | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec 
b/Platform/ARM/SgiPkg/SgiPlatform.dec
index 1613cc01981e..103dff8471a7 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dec
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dec
@@ -1,5 +1,5 @@
 #
-#  Copyright (c) 2018 - 2023, Arm Limited. All rights reserved.
+#  Copyright (c) 2018 - 2024, Arm Limited. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -51,8 +51,9 @@ [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdVirtioP9Size|0x|UINT32|0x0029
   gArmSgiTokenSpaceGuid.PcdVirtioP9Interrupt|0x|UINT32|0x002A
 
-  # Chip count on the platform
+  # Chip count on the platform and platform variant
   gArmSgiTokenSpaceGuid.PcdChipCount|1|UINT32|0x000B
+  gArmSgiTokenSpaceGuid.PcdPlatformVariant|0|UINT32|0x002D
 
   # GIC
   gArmSgiTokenSpaceGuid.PcdGicSize|0|UINT64|0x000A
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114441): https://edk2.groups.io/g/devel/message/114441
Mute This Topic: https://groups.io/mt/103959447/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 v4 2/6] Platform/Sgi: Add VariableFlashInfoLib to fix missing dependency

2024-01-25 Thread Prabin CA
From: Vijayenthiran Subramaniam 

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

A recent change in MdeModulePkg [1] introduced VariableFlashInfoLib as a
dependency to support dynamic variable flash information. Add an
instance for the library class VariableFlashInfoLib in
SgiPlatformMm.dsc.inc to resolve this dependency.

[1]: 
https://github.com/tianocore/edk2/commit/8db39c60cdf35e0a53ccdbccf7e152ab41f54f4c

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc 
b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
index ab54b3b25f4c..0dd9ebbfc16c 100644
--- a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
@@ -70,6 +70,7 @@ [LibraryClasses.common.MM_STANDALONE]
   
SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf
   TimerLib|MdePkg/Library/BaseTimerLibNullTemplate/BaseTimerLibNullTemplate.inf
   VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf
+  
VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseVariableFlashInfoLib.inf
   SafeIntLib|MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf
 !endif
 
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114440): https://edk2.groups.io/g/devel/message/114440
Mute This Topic: https://groups.io/mt/103959446/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 v4 1/6] Platform/Sgi: remove +nofp gcc option flag

2024-01-25 Thread Prabin CA
From: Omkar Anand Kulkarni 

The software executing at a higher privileged level on the reference
design platforms have been updated to allow software executing at EL1
and EL0 to access the Advanced SIMD and floating-point registers (FPEN
field of CPACR_EL1 system register is programmed to allow access). So,
remove the use of +nofp gcc build option flag.

Signed-off-by: Prabin CA 
---
 Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc 
b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
index ae0ff7247a6a..ab54b3b25f4c 100644
--- a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
@@ -145,5 +145,5 @@ [Components.AARCH64]
 #
 
###
 [BuildOptions.AARCH64]
-  GCC:*_*_*_CC_FLAGS = -mstrict-align -march=armv8-a+nofp -D 
DISABLE_NEW_DEPRECATED_INTERFACES
+  GCC:*_*_*_CC_FLAGS = -mstrict-align -march=armv8-a -D 
DISABLE_NEW_DEPRECATED_INTERFACES
   GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114439): https://edk2.groups.io/g/devel/message/114439
Mute This Topic: https://groups.io/mt/103959444/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 v4 0/6] Platform/Sgi: Add support for RD-N2-Cfg3 and RD-V2 platform

2024-01-25 Thread Prabin CA
Changes since V3:
- Removed author's signed-off on the patches, which is owned by another author.

Changes since V2:
- Removed the patch which introduce fno-stack-protector in the build flag.

Changes since V1:
- Addressed comments from Sami

This patch series introduces support for two reference design platforms-
RD-N2-Cfg3 and RD-V2. The RD-N2-Cfg3 FVP platform is a variant of RD-N2
platform with a different mesh size and GIC ITS count. It is based on
the Neoverse N2 CPUs and includes 16xMP1 CPUs. RD-N2-Cfg3 has 12 GIC ITS
blocks, 6 more than the other RD-N2 variants.

The Neoverse RD-V2 FVP platform includes 16xMP1 Neoverse V2 CPUs and
each CPU has 64KB of L1 instruction/data cache, 2MB of L2 cache and 32MB
of system level cache. The system architecture of the RD-V2 platform is
similar to the RD-N2 platform, except for the CPU and L2 cache size. So
existing RD-N2 SMBIOS support is extended for RD-V2 platform to reuse
rest of the RD-N2 SMBIOS configuration for the RD-V2 platform.

In addition to patches that introduce support for these two platforms,
there are two patches that update support for existing platforms. The
first patch in this series removes +nofp gcc option flag. The second
patch adds VariableFlashInfoLib to the common dsc file.

Link to gitlb branch with the patches in this series -
https://gitlab.arm.com/infra-solutions/reference-design/platsw/edk2-platforms/-/tree/topics/rdn2cfg3_rdv2_updates

Omkar Anand Kulkarni (1):
  Platform/Sgi: remove +nofp gcc option flag

Prabin CA (2):
  Platform/Sgi: Add a PCD to specify platform variant
  Platform/Sgi: Add support for RD-N2-Cfg3 platform

Pranav Madhu (2):
  Platform/Sgi: Define RD-V2 platform id values
  Platform/Sgi: Extend SMBIOS support for RD-V2 platform

Vijayenthiran Subramaniam (1):
  Platform/Sgi: Add VariableFlashInfoLib to fix missing dependency

 Platform/ARM/SgiPkg/SgiPlatform.dec   
|  5 +-
 Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc 
|  3 +-
 Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.dsc 
| 58 
 Platform/ARM/SgiPkg/AcpiTables/RdN2AcpiTables.inf 
|  3 +-
 Platform/ARM/SgiPkg/AcpiTables/{RdN2AcpiTables.inf => RdN2Cfg3AcpiTables.inf} 
| 15 ++---
 Platform/ARM/SgiPkg/Include/SgiPlatform.h 
|  7 ++-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type1SystemInformation.c
|  7 ++-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type4ProcessorInformation.c 
|  9 ++-
 Platform/ARM/SgiPkg/Drivers/SmbiosPlatformDxe/Type7CacheInformation.c 
| 20 ++-
 Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.c 
|  8 ++-
 Platform/ARM/SgiPkg/AcpiTables/RdN2/Madt.aslc 
| 14 -
 Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.fdf.inc 
| 10 
 12 files changed, 136 insertions(+), 23 deletions(-)
 create mode 100644 Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.dsc
 copy Platform/ARM/SgiPkg/AcpiTables/{RdN2AcpiTables.inf => 
RdN2Cfg3AcpiTables.inf} (90%)
 create mode 100644 Platform/ARM/SgiPkg/RdN2Cfg3/RdN2Cfg3.fdf.inc

-- 
2.34.1



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




[edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg/FeatureDriver: ComputerSystem_1_13_0 driver

2024-01-25 Thread Chang, Abner via groups.io
From: Abner Chang 

Initial version of edk2 Redfish feature of
Redfish schema ComputerSystem_1_13_0. This driver
handles ComputerSystem Boot properties but not all.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../v1_13_0/Dxe/ComputerSystemDxe.inf |  53 ++
 .../v1_13_0/Common/ComputerSystemCommon.h |  29 +
 .../v1_13_0/Common/ComputerSystemCommon.c | 899 ++
 .../v1_13_0/Dxe/ComputerSystemDxe.c   | 702 ++
 4 files changed, 1683 insertions(+)
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 create mode 100644 
RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c

diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
new file mode 100644
index 00..1830e67702
--- /dev/null
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.inf
@@ -0,0 +1,53 @@
+## @file
+#
+#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+#  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+  INF_VERSION   = 0x00010005
+  BASE_NAME = ComputerSystemDxe
+  FILE_GUID = 584bae05-d78d-4df9-b5e9-3e987a99480a
+  MODULE_TYPE   = DXE_DRIVER
+  VERSION_STRING= 1.0
+  ENTRY_POINT   = RedfishResourceEntryPoint
+  UNLOAD_IMAGE  = RedfishResourceUnload
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  RedfishPkg/RedfishPkg.dec
+  RedfishClientPkg/RedfishClientPkg.dec
+
+[Sources]
+  ../Common/ComputerSystemCommon.h
+  ../Common/ComputerSystemCommon.c
+  ComputerSystemDxe.c
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  EdkIIRedfishResourceConfigLib
+  RedfishLib
+  RedfishFeatureUtilityLib
+  RedfishResourceIdentifyLib
+  UefiLib
+  UefiDriverEntryPoint
+  RedfishAddendumLib
+  RedfishHttpCacheLib
+
+[Protocols]
+  gEdkIIRedfishConfigHandlerProtocolGuid  ## PRODUCED
+  gEfiRestJsonStructureProtocolGuid   ## CONSUMED
+  gEdkIIRedfishResourceConfigProtocolGuid ## PRODUCED
+
+[Pcd]
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize
+
+[Depex]
+  TRUE
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
new file mode 100644
index 00..c9c8512881
--- /dev/null
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.h
@@ -0,0 +1,29 @@
+/** @file
+
+  Redfish feature driver implementation - internal header file
+  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
+#define EFI_REDFISH_COMPUTERSYSTEM_COMMON_H_
+
+#include 

+#include 
+
+//
+// Schema information.
+//
+#define RESOURCE_SCHEMA  "ComputerSystem"
+#define RESOURCE_SCHEMA_MAJOR"1"
+#define RESOURCE_SCHEMA_MINOR"13"
+#define RESOURCE_SCHEMA_ERRATA   "0"
+#define RESOURCE_SCHEMA_VERSION  "v1_13_0"
+#define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
+#define REDPATH_ARRAY_PREFIX L"/Systems/"
+#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-ComputerSystem.v1_13_0"
+
+#endif
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
new file mode 100644
index 00..bc24c49206
--- /dev/null
+++ 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/ComputerSystemCommon.c
@@ -0,0 +1,899 @@
+/** @file
+  Redfish feature driver implementation - common functions
+
+  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
+  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include "ComputerSystemCommon.h"
+
+CHAR8  ComputerSystemEmptyJson[] = "{\"@odata.id\": \"\", \"@odata.type\": 
\"#ComputerSystem.v1_13_0.ComputerSystem\", \"Id\": \"\", \"Name\": \"\", 
\"Boot\":{}}";
+
+REDFISH_RESOURCE_COMMON_PRIVATE  *mRedfishResourcePrivate = NULL;
+EFI_HANDLE   mRedfishResourceConfigProtocolHandle = NULL;
+
+/**
+  Consume resource from given URI.
+
+  @param[in]   This

Re: [edk2-devel] [edk2-discuss] Multi-ISA Driver Compatibility Survey

2024-01-23 Thread Laszlo Ersek
On 1/22/24 20:04, Rebecca Cran wrote:
> Originally posted at
> https://twitter.com/UEFIForum/status/1745518769232077208
> 
> The Multi-ISA Driver Compatibility Survey is at
> https://docs.google.com/forms/d/e/1FAIpQLScXjwaSBgLeqB1coEDxCPxho5JWF3AMqshOTJ2wd6Tf0He4LA/viewform
> 
> From that page:
> 
> Did you know Tiano today supports four 64-bit architectures, yet plug-in
> device OpRoms are still mostly limited to x64 and CSM? While
> binary-translation approaches are a useful stop-gap solution for both
> AArch64 and RV64 ecosystems, we need a common approach that is not a
> technical debt nightmare and that will be adopted by IHVs and endorsed
> by OSVs.
> 
> The  Multi-ISA Driver Compatibility talk went over some of the possible
> approaches, as a lead-in for an open discussion, and raised the
> long-term importance of solving cross-architecture compatibility issues
> for OpRom drivers.
> 
> This survey is an opportunity provide feedback to guide further
> exploration in this space.
> 
> The discussed options were:
> 
> - Do nothing. This is an IHV problem. IHV should continue shipping
> support for whatever architectures they deem necessary.
> - Resurrect EFI Byte Code. Invest in compilers and tooling (e.g.
> addr2line, JIT, etc) to get parity with existing native drivers.
> - Look at WASM, and solve tooling constraints (around sandboxing) that
> prevent adoption.
> - eBPF, and solve tooling constraints (around sandboxing) that prevent
> adoption.
> - Constrained, well-defined subset of x64. This meets IHVs half-way by
> avoiding significant perturbations to existing driver development and
> release processes, and achieves compatibility with existing x64 systems
> in the market "for free", while addressing most of the concerns around
> binary translation of x64 code.

This list seems too restrictive.

As long as IHVs are not interested in their cards booting on non-x86
boards, nothing sustainable can be done.

Assuming IHVs are *slightly* interested (which does not mean "full
support" at all), things can be done. Among those things, binary-based
approaches are all futile, IMO, because they do not allow for debugging
and improvements by the *board* vendor. EBC, WASM, eBFP, constrained X64
are all the same in this regard. If the original driver doesn't perform
proper mapping for DMA for example, that issue can only be identified
and fixed by *source-level* work.

IMO the only sustainable approach is if an IHV licenses the source code
of their driver (containing X64 shortcuts) to the vendor of the
(non-x86) board, preferably including documentation. Then the board
vendor can identify issues, and propose source-level fixes. That's less
burden on the IHV (mostly just regression testing on x86) than taking on
full support themselves. Regarding distribution, the non-x86 binaries
could be distributed on USB sticks (and loaded via Driver), possibly
even by the board vendor. Not super comfortable for the end-user, but it
would not intrude on the card flash (so the IHV wouldn't have to account
for it).

Of course this requires the IHV to be willing to show their source code
to the board vendor (possibly under NDA). Until that happens, this mess
will persist. In my opinion.

Either way, I believe that this option is not represented in the survey.

Laszlo

> 
> Note: the last three options (WASM, eBPF and constrained x64) are not
> neutral with respect to host natural register width, which will mean a
> break in compatibility with future TBD 128-bit environments, unless a
> TBD OpRom sandboxing technology is invented.
> 
> Note 2: emails and names/sign-ins are not collected, this is an
> anonymous response.
> 
> 
> 
> 
> 
> 



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




Re: [edk2-devel] [edk2-platforms][PATCH V4 4/4] Silicon/ARM/NeoverseN1Soc: Consume N1SdpNtFwConfigPei supplied data

2024-01-23 Thread sahil
Hi All,

Please find the links to previous discussions below :

V1 -
https://edk2.groups.io/g/devel/topic/96088980#100022
V2 -
https://edk2.groups.io/g/devel/topic/96671861#103652
V3 -
https://edk2.groups.io/g/devel/topic/100912169#112452

Thanks,
Sahil


On Thu, 4 Jan 2024 at 18:46, sahil  wrote:
>
> N1SdpNtFwConfigPei PEIM extracts platform information from NT_FW_CONFIG
> and provides it to other modules as a PPI and a HOB. PlatformLibMem
> then consumes these values in the form of a PPI during PEI phase and
> ConfigurationManagerDxe as a HOB during DXE phase. The previous
> approach of fetching platform information from a fixed address
> is also removed in this patch.
>
> Signed-off-by: sahil 
> ---
>  
> Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
>  |  6 +++-
>  Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
>|  1 +
>  
> Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
>   |  5 ++-
>  Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
>|  5 ---
>  
> Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
>   | 33 +-
>  Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLibMem.c   
>| 35 +++-
>  6 files changed, 55 insertions(+), 30 deletions(-)
>
> diff --git 
> a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
>  
> b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
> index 4f8e7f13021a..e4aaed3e9dd5 100644
> --- 
> a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
> +++ 
> b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManagerDxe.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Configuration Manager Dxe
>  #
> -#  Copyright (c) 2021, ARM Limited. All rights reserved.
> +#  Copyright (c) 2021 - 2024, ARM Limited. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -42,6 +42,7 @@
>
>  [LibraryClasses]
>ArmPlatformLib
> +  HobLib
>PrintLib
>UefiBootServicesTableLib
>UefiDriverEntryPoint
> @@ -170,5 +171,8 @@
>gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieMmio64Translation
>gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieSegmentNumber
>
> +[Guids]
> +  gArmNeoverseN1SocPlatformInfoDescriptorGuid
> +
>  [Depex]
>TRUE
> diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf 
> b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
> index ead7f11ec964..e7af4c711817 100644
> --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
> +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
> @@ -64,3 +64,4 @@
>  [Ppis]
>gArmMpCoreInfoPpiGuid
>gArmNeoverseN1SocParameterPpiGuid
> +  gArmNeoverseN1SocPlatformInfoDescriptorPpiGuid
> diff --git 
> a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
>  
> b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
> index 303c38dcaee9..ea9cb20ba752 100644
> --- 
> a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
> +++ 
> b/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
> @@ -1,6 +1,6 @@
>  /** @file
>
> -  Copyright (c) 2021, ARM Limited. All rights reserved.
> +  Copyright (c) 2021-2024, ARM Limited. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -302,6 +302,9 @@ typedef struct PlatformRepositoryInfo {
>/// Memory Affinity Info
>CM_ARM_MEMORY_AFFINITY_INFO   MemAffInfo[DDR_REGION_COUNT];
>
> +  /// N1Sdp Platform Info
> +  NEOVERSEN1SOC_PLAT_INFO   *PlatInfo;
> +
>  } EDKII_PLATFORM_REPOSITORY_INFO;
>
>  #endif // CONFIGURATION_MANAGER_H_
> diff --git a/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h 
> b/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
> index 2bddf5007431..5483e7bc5f68 100644
> --- a/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
> +++ b/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
> @@ -41,11 +41,6 @@
>  #define NEOVERSEN1SOC_EXP_PERIPH_BASE0   0x1C00
>  #define NEOVERSEN1SOC_EXP_PERIPH_BASE0_SZ0x130
>
> -// Base address to a structure of type NEOVERSEN1SOC_PLAT_INFO which is
> -// pre-populated by a earlier boot stage
> -#define NEOVERSEN1SOC_PLAT_INFO_STRUCT_BASE  
> (NEOVERSEN1SOC_NON_SECURE_SRAM_BASE + \
> -  0x8000)
> -
>  /*
>   * Platform information structure stored in Non-secure SRAM. Platform
>   * information are passed from the trusted firmware with the below structure
> diff --git 
> a/Platform/ARM/N1Sdp/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
>  
> 

Re: [edk2-devel] [edk2-platforms][PATCH V4 3/4] Platform/ARM/N1Sdp: Enable N1SdpNtFwConfigPei PEI module for N1Sdp

2024-01-23 Thread sahil
Hi All,

Please find the links to previous discussions below :

V1 -
https://edk2.groups.io/g/devel/topic/96088980#100022
V2 -
https://edk2.groups.io/g/devel/topic/96671861#103652
V3 -
https://edk2.groups.io/g/devel/topic/100912169#112452

Thanks,
Sahil


On Thu, 4 Jan 2024 at 18:46, sahil  wrote:
>
> Incorporate N1SdpNtFwConfigPei PEI module which parses NT_FW_CONFIG and
> passes it to other PEI modules(as PPI) and DXE modules(as HOB).
>
> Signed-off-by: sahil 
> ---
>  Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec | 3 +++
>  Platform/ARM/N1Sdp/N1SdpPlatform.dsc| 5 -
>  Platform/ARM/N1Sdp/N1SdpPlatform.fdf| 3 ++-
>  3 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec 
> b/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> index c04162e7e7cd..cca5bf45db67 100644
> --- a/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> +++ b/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> @@ -22,6 +22,8 @@
>Include# Root include for the package
>
>  [Guids.common]
> +  # ARM NeoverseN1Soc Platform Info descriptor
> +  gArmNeoverseN1SocPlatformInfoDescriptorGuid = { 0x9fa16eb5, 0xce13, 
> 0x4d37, { 0x96, 0xf0, 0x0a, 0xb5, 0xf1, 0xab, 0xff, 0x01 } }
>gArmNeoverseN1SocTokenSpaceGuid = { 0xab93eb78, 0x60d7, 0x4099, { 0xac, 
> 0xeb, 0x6d, 0xb5, 0x02, 0x58, 0x7c, 0x24 } }
>
>  [PcdsFixedAtBuild]
> @@ -85,4 +87,5 @@
>
> gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieSegmentNumber|2|UINT32|0x0051
>
>  [Ppis]
> +  gArmNeoverseN1SocPlatformInfoDescriptorPpiGuid = { 0x21D04AD4, 0x4D23, 
> 0x426D, { 0x8D, 0x3E, 0x92, 0x23, 0x3E, 0xF4, 0xB9, 0x5E } }
>gArmNeoverseN1SocParameterPpiGuid = { 0x4DDD5A72, 0x31AD, 0x4B20, { 0x8F, 
> 0x5F, 0xB3, 0xE8, 0x24, 0x6F, 0x80, 0x2B } }
> diff --git a/Platform/ARM/N1Sdp/N1SdpPlatform.dsc 
> b/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
> index d04b22d3ef51..013a2e706e1a 100644
> --- a/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
> +++ b/Platform/ARM/N1Sdp/N1SdpPlatform.dsc
> @@ -4,7 +4,7 @@
>  # This provides platform specific component descriptions and libraries that
>  # conform to EFI/Framework standards.
>  #
> -# Copyright (c) 2018 - 2021, ARM Limited. All rights reserved.
> +# Copyright (c) 2018 - 2024, ARM Limited. All rights reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -228,6 +228,9 @@
># Platform driver
>Platform/ARM/N1Sdp/Drivers/PlatformDxe/PlatformDxe.inf
>
> +  # PEI Phase modules
> +  Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.inf
> +
># Human Interface Support
>MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
>
> diff --git a/Platform/ARM/N1Sdp/N1SdpPlatform.fdf 
> b/Platform/ARM/N1Sdp/N1SdpPlatform.fdf
> index e5e24ea50294..4c4a6b193658 100644
> --- a/Platform/ARM/N1Sdp/N1SdpPlatform.fdf
> +++ b/Platform/ARM/N1Sdp/N1SdpPlatform.fdf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  FDF file of N1Sdp
>  #
> -#  Copyright (c) 2018 - 2021, ARM Limited. All rights reserved.
> +#  Copyright (c) 2018 - 2024, ARM Limited. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  ##
> @@ -195,6 +195,7 @@ READ_LOCK_STATUS   = TRUE
>INF MdeModulePkg/Core/Pei/PeiMain.inf
>INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
>INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
> +  INF Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.inf
>
>FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
>  SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED 
> = TRUE {
> --
> 2.25.1
>
>
>
> 
> Groups.io Links: You receive all messages sent to this group.
> View/Reply Online (#113166): https://edk2.groups.io/g/devel/message/113166
> Mute This Topic: https://groups.io/mt/103521646/7175337
> Group Owner: devel+ow...@edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub [sahilkausha...@gmail.com]
> 
>
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114187): https://edk2.groups.io/g/devel/message/114187
Mute This Topic: https://groups.io/mt/103521646/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 2/4] Platform/ARM/N1Sdp: Add N1SdpNtFwConfigPei PEI module

2024-01-23 Thread sahil
Hi All,

Please find the links to previous discussions below :

V1 -
https://edk2.groups.io/g/devel/topic/96088980#100022
V2 -
https://edk2.groups.io/g/devel/topic/96671861#103652
V3 -
https://edk2.groups.io/g/devel/topic/100912169#112452

Thanks,
Sahil


On Thu, 4 Jan 2024 at 18:46, sahil  wrote:
>
> This patch adds a PEI to parse NT_FW_CONFIG and pass it to
> other PEI modules(as PPI) and DXE modules(as HOB).
>
> Signed-off-by: sahil 
> ---
>  Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.inf |  41 ++
>  Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.c   | 132 
> 
>  2 files changed, 173 insertions(+)
>
> diff --git a/Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.inf 
> b/Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.inf
> new file mode 100644
> index ..363351b5a1df
> --- /dev/null
> +++ b/Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.inf
> @@ -0,0 +1,41 @@
> +## @file
> +#  This PEI module parse the NtFwConfig for N1Sdp platform and produce
> +#  the PPI and HOB.
> +#
> +#  Copyright (c) 2024, ARM Limited. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION= 0x0001001B
> +  BASE_NAME  = N1SdpNtFwConfigPei
> +  FILE_GUID  = CE76D56C-D3A5-4763-9138-DF09E1D1B614
> +  MODULE_TYPE= PEIM
> +  VERSION_STRING = 1.0
> +  ENTRY_POINT= NtFwConfigPeEntryPoint
> +
> +[Sources]
> +  NtFwConfigPei.c
> +
> +[Packages]
> +  EmbeddedPkg/EmbeddedPkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  FdtLib
> +  HobLib
> +  PeimEntryPoint
> +
> +[Ppis]
> +  gArmNeoverseN1SocPlatformInfoDescriptorPpiGuid
> +  gArmNeoverseN1SocParameterPpiGuid
> +
> +[Guids]
> +  gArmNeoverseN1SocPlatformInfoDescriptorGuid
> +
> +[Depex]
> +  gArmNeoverseN1SocParameterPpiGuid
> diff --git a/Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.c 
> b/Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.c
> new file mode 100644
> index ..330377d21a79
> --- /dev/null
> +++ b/Platform/ARM/N1Sdp/Drivers/N1SdpNtFwConfigPei/NtFwConfigPei.c
> @@ -0,0 +1,132 @@
> +/** @file
> +
> +  Copyright (c) 2024, ARM Limited. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +
> +STATIC EFI_PEI_PPI_DESCRIPTOR  mPpi;
> +
> +/**
> +  The entrypoint of the module, parse NtFwConfig and produce the PPI and HOB.
> +
> +  @param[in]  FileHandle   Handle of the file being invoked.
> +  @param[in]  PeiServices  Describes the list of possible PEI Services.
> +
> +  @retval EFI_SUCCESS  Either no NT_FW_CONFIG was given by EL3 
> firmware
> +   OR the N1Sdp FDT HOB was successfully created.
> +  @retval EFI_NOT_FOUNDError processing the DTB
> +  @retval EFI_OUT_OF_RESOURCES Could not allocate memory for the HOB
> +  @retval *Other errors are possible.
> +**/
> +EFI_STATUS
> +EFIAPI
> +NtFwConfigPeEntryPoint (
> +  IN EFI_PEI_FILE_HANDLE FileHandle,
> +  IN CONST EFI_PEI_SERVICES  **PeiServices
> +  )
> +{
> +  CONST NEOVERSEN1SOC_EL3_FW_HANDOFF_PARAM_PPI  *ParamPpi;
> +  CONST UINT32  *Property;
> +  INT32 Offset;
> +  NEOVERSEN1SOC_PLAT_INFO   *PlatInfo;
> +  INT32 Status;
> +
> +  PlatInfo = BuildGuidHob (
> +   ,
> +   sizeof (*PlatInfo)
> +   );
> +
> +  if (PlatInfo == NULL) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "[%a]: failed to allocate platform info HOB\n",
> +  gEfiCallerBaseName
> +  ));
> +return EFI_OUT_OF_RESOURCES;
> +  }
> +
> +  Status = PeiServicesLocatePpi (
> + ,
> + 0,
> + NULL,
> + (VOID **)
> + );
> +
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((
> +  DEBUG_ERROR,
> +  "[%a]: failed to locate gArmNeoverseN1SocParameterPpiGuid - %r\n",
> +  gEfiCallerBaseName,
> +  Status
> +  ));
> +return Status;
> +  }
> +
> +  if (fdt_check_header (ParamPpi->NtFwConfig) != 0) {
> +DEBUG ((DEBUG_ERROR, "Invalid DTB file %p passed\n", 
> ParamPpi->NtFwConfig));
> +return EFI_NOT_FOUND;
> +  }
> +
> +  Offset = fdt_subnode_offset (ParamPpi->NtFwConfig, 0, "platform-info");
> +  if (Offset == -FDT_ERR_NOTFOUND) {
> +DEBUG ((DEBUG_ERROR, "Invalid DTB : platform-info node not found\n"));
> +return EFI_NOT_FOUND;
> +  }
> +
> +  Property = fdt_getprop (ParamPpi->NtFwConfig, Offset, "local-ddr-size", 
> NULL);
> +  if (Property == NULL) {
> +DEBUG ((DEBUG_ERROR, "local-ddr-size property not found\n"));
> +return 

Re: [edk2-devel] [edk2-platforms][PATCH V4 1/4] Silicon/ARM/NeoverseN1Soc: Extract NT_FW_CONFIG address passed by TF-A

2024-01-23 Thread sahil
Hi All,

Please find the links to previous discussions below :

V1 -
https://edk2.groups.io/g/devel/topic/96088980#100022
V2 -
https://edk2.groups.io/g/devel/topic/96671861#103652
V3 -
https://edk2.groups.io/g/devel/topic/100912169#112452

Thanks,
Sahil

On Thu, 4 Jan 2024 at 18:46, sahil  wrote:
>
> NT_FW_CONFIG DTB contains platform information passed by TF-A boot
> stage. This patch enables support to first extract address of
> NT_FW_CONFIG and then pass it to other modules as a PPI.
>
> Signed-off-by: sahil 
> ---
>  Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec|  5 -
>  Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf  |  3 ++-
>  Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h  |  9 ++---
>  Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c| 12 
> +++-
>  Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/AArch64/Helper.S |  4 +++-
>  5 files changed, 26 insertions(+), 7 deletions(-)
>
> diff --git a/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec 
> b/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> index d59f25a5b915..c04162e7e7cd 100644
> --- a/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> +++ b/Silicon/ARM/NeoverseN1Soc/NeoverseN1Soc.dec
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Describes the entire platform configuration.
>  #
> -#  Copyright (c) 2018 - 2021, ARM Limited. All rights reserved.
> +#  Copyright (c) 2018 - 2024, ARM Limited. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -83,3 +83,6 @@
>
> gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieMmio32Translation|0x400|UINT64|0x004F
>
> gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieMmio64Translation|0x400|UINT64|0x0050
>
> gArmNeoverseN1SocTokenSpaceGuid.PcdRemotePcieSegmentNumber|2|UINT32|0x0051
> +
> +[Ppis]
> +  gArmNeoverseN1SocParameterPpiGuid = { 0x4DDD5A72, 0x31AD, 0x4B20, { 0x8F, 
> 0x5F, 0xB3, 0xE8, 0x24, 0x6F, 0x80, 0x2B } }
> diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf 
> b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
> index 96e590cdd810..ead7f11ec964 100644
> --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
> +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.inf
> @@ -1,7 +1,7 @@
>  ## @file
>  #  Platform Library for N1Sdp.
>  #
> -#  Copyright (c) 2018-2021, ARM Limited. All rights reserved.
> +#  Copyright (c) 2018-2024, ARM Limited. All rights reserved.
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
> @@ -63,3 +63,4 @@
>
>  [Ppis]
>gArmMpCoreInfoPpiGuid
> +  gArmNeoverseN1SocParameterPpiGuid
> diff --git a/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h 
> b/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
> index 097160c7e2d1..2bddf5007431 100644
> --- a/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
> +++ b/Silicon/ARM/NeoverseN1Soc/Include/NeoverseN1Soc.h
> @@ -1,6 +1,6 @@
>  /** @file
>  *
> -* Copyright (c) 2018 - 2020, ARM Limited. All rights reserved.
> +* Copyright (c) 2018 - 2024, ARM Limited. All rights reserved.
>  *
>  * SPDX-License-Identifier: BSD-2-Clause-Patent
>  *
> @@ -55,12 +55,15 @@
>  typedef struct {
>/*! 0 - Single Chip, 1 - Chip to Chip (C2C) */
>UINT8   MultichipMode;
> -  /*! Slave count in C2C mode */
> -  UINT8   SlaveCount;
> +  /*! Secondary chip count in C2C mode */
> +  UINT8   SecondaryChipCount;
>/*! Local DDR memory size in GigaBytes */
>UINT8   LocalDdrSize;
>/*! Remote DDR memory size in GigaBytes */
>UINT8   RemoteDdrSize;
>  } NEOVERSEN1SOC_PLAT_INFO;
>
> +typedef struct {
> +  CONST VOID*NtFwConfig;
> +} NEOVERSEN1SOC_EL3_FW_HANDOFF_PARAM_PPI;
>  #endif
> diff --git a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c 
> b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c
> index c0effd37f333..e8568b7a039b 100644
> --- a/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c
> +++ b/Silicon/ARM/NeoverseN1Soc/Library/PlatformLib/PlatformLib.c
> @@ -1,6 +1,6 @@
>  /** @file
>
> -  Copyright (c) 2018-2021, ARM Limited. All rights reserved.
> +  Copyright (c) 2018 - 2024, ARM Limited. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -8,8 +8,12 @@
>
>  #include 
>  #include 
> +#include 
>  #include 
>
> +UINT64  gArgNtFwConfigDtPtr;
> +STATIC  NEOVERSEN1SOC_EL3_FW_HANDOFF_PARAM_PPI mNeoverseN1SocParameterPpi;
> +
>  STATIC ARM_CORE_INFO mCoreInfoTable[] = {
>{ 0x0, 0x0 }, // Cluster 0, Core 0
>{ 0x0, 0x1 }, // Cluster 0, Core 1
> @@ -46,6 +50,7 @@ ArmPlatformInitialize (
>IN UINTN  MpId
>)
>  {
> +  mNeoverseN1SocParameterPpi.NtFwConfig = (VOID *)gArgNtFwConfigDtPtr;
>return RETURN_SUCCESS;
>  }
>
> @@ -80,6 +85,11 @@ EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
>  EFI_PEI_PPI_DESCRIPTOR_PPI,
>  ,
>  
> +  },
> +  {
> +EFI_PEI_PPI_DESCRIPTOR_PPI,
> +,
> +
>}
>  };
>
> diff --git 

Re: [edk2-devel] [edk2-platforms][PATCH V2 1/1] Platform/ARM/N1Sdp: Route the Debug Serial Port to IOFPGA UART1

2024-01-19 Thread Himanshu Sharma
Link to V1: [edk2-platforms][PATCH V1 1/1] Platform/ARM/N1Sdp: Modify IRQ ID of 
Debug UART and routing to IOFPGA UART1 (groups.io) ( 
https://edk2.groups.io/g/devel/message/98064?p=%2C%2C%2C20%2C0%2C0%2C0%3A%3Arecentpostdate%2Fsticky%2C%2Chimanshu%2C20%2C2%2C0%2C96088965
 )


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114043): https://edk2.groups.io/g/devel/message/114043
Mute This Topic: https://groups.io/mt/103691696/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 0/4] Add support to parse NT_FW_CONFIG

2024-01-19 Thread Sami Mujawar
Hi Sahil,
On Thu, Jan 4, 2024 at 05:16 AM, sahil wrote:

> 
> v4:
> - Fixed code review comments
> - Split the patch into four patches

Can you add git notes for the patches in the future, please? See 
https://github.com/tianocore/tianocore.github.io/wiki/Laszlo%27s-unkempt-git-guide-for-edk2-contributors-and-maintainers#contrib-30
Also, it would be of great help if you can add a link to the edk2 mailing list 
discussion that has taken place. I normally do that as it helps the maintainer 
locate the previous discussion easily.

For now, can you reply to the individual patches with the links to the previous 
discussion, please?

Regards,

Sami Mujawar


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




<    1   2   3   4   5   6   7   8   9   10   >