Re: [edk2-devel] GitHub PR Code Review process now active

2024-05-29 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Hi Mike,
Wondering if we also plan to apply GitHub PR process on edk2-platforms repo? Or 
other repos under tianocore? I found there is another email thread "Enable 
GitHub PR, protected branches, and 'push' label" on edk2-platforms, but no 
further discussions then.

Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Michael D
> Kinney via groups.io
> Sent: Wednesday, May 29, 2024 2:54 AM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D 
> Subject: [edk2-devel] GitHub PR Code Review process now active
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hello,
>
> The GitHub PR code review process is now active.  Please
> use the new PR based code review process for all new
> submissions starting today.
>
> * The Wiki has been updated with the process changes.
>
>   https://github.com/tianocore/tianocore.github.io/wiki/EDK-II-
> Development-Process
>
>   Big thanks to Michael Kubacki for writing up all the
>   changes based on the RFC proposal and community discussions.
>
>   We will learn by using, so if you see anything missing or
>   incorrect or clarifications needed, please send feedback
>   here so the Wiki pages can be updated quickly for everyone.
>
> * The edk2 repo settings have been updated to require
>   a GitHub PR code review approval before merging and
>   all conversations must be resolved before merging.
>
> * A PR has been opened that removes the requirement for
>   Cc: tags in the commit messages and is the first PR
>   that will use the new process. This PR needs to be
>   reviewed and merged to support the revised commit
>   message format.
>
>   https://github.com/tianocore/edk2/pull/5688
>
>   https://github.com/tianocore/tianocore.github.io/wiki/Commit-Message-
> Format
>
> * Please use "Draft" PRs to run CI without any reviews.
>   Once ready for reviews, convert from "Draft" to
>   "Ready for Review".
>
> * For active code reviews that are almost complete and will
>   be ready for merge in the next few days, the submitter may
>   choose to either complete using the email review process,
>   or switch to the PR based code review process.
>
> * For active code reviews that are expected to take more than
>   a few days to complete, please convert to a PR based code review.
>
> Thanks,
>
> Mike
>
>
>
> 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119337): https://edk2.groups.io/g/devel/message/119337
Mute This Topic: https://groups.io/mt/106355103/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 2/3] AmdPlatformPkg: Implements SmmCorePlatformHookLib library

2024-05-29 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Tuesday, May 28, 2024 10:08 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms 2/3] AmdPlatformPkg: Implements
> SmmCorePlatformHookLib library
>
> Implements SmmCorePlatformHookLib library for AMD platform.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec |   5 +
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |   6 +
>  .../Library/AmdSmmCorePlatformHookLib.h   |  68 +++
>  .../SmmCorePlatformHookLib.c  | 169 ++
>  .../SmmCorePlatformHookLib.inf|  39 
>  .../SmmCorePlatformHookLib.uni|  11 ++
>  6 files changed, 298 insertions(+)
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Include/Library/AmdSmmCorePlatformHoo
> kLib.h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCorePlatformHookLib/SmmCor
> ePlatformHookLib.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCorePlatformHookLib/SmmCor
> ePlatformHookLib.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCorePlatformHookLib/SmmCor
> ePlatformHookLib.uni
>
> diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> index 106820dc85..3020e628a3 100644
> --- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> +++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> @@ -21,6 +21,11 @@
>##  @libraryclass  Defines a get/set interface for platform specific data.
>PlatformSocLib|Include/Library/AmdPlatformSocLib.h
>
> +  ##  @libraryclass AMD SMM core platform hook library
> +  #   Provide the functions to register hook before and
> +  #   after SMM dispatcher.
> +
> SmmCorePlatformHookLib|Include/Library/AmdSmmCorePlatformHookLib.h
> +
>  [Guids]
>gAmdPlatformPkgTokenSpaceGuid   = { 0x663DE733, 0x70E0, 0x4D37,
> { 0xBB, 0x30, 0x7D, 0x9E, 0xAF, 0x9B, 0xDA, 0xE9 }}
>
> diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> index d11d3594e3..482e6f2f30 100644
> --- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> +++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> @@ -62,6 +62,9 @@
>
> MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemor
> yAllocationLib.inf
>
> PlatformSocLib|AmdPlatformPkg/Library/DxePlatformSocLib/DxePlatformSoc
> LibNull.inf
>
> +[LibraryClasses.common.SMM_CORE]
> +
> SmmCorePlatformHookLib|AmdPlatformPkg/Library/SmmCorePlatformHook
> Lib/SmmCorePlatformHookLib.inf
> +
>  [Components]
>
> AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLi
> b.inf
>AmdPlatformPkg/Library/DxePlatformSocLib/DxePlatformSocLibNull.inf
> @@ -73,3 +76,6 @@
>AmdPlatformPkg/Universal/LogoDxe/LogoDxe.inf   
> #
> Server platfrom Bitmap logo driver
>AmdPlatformPkg/Universal/LogoDxe/S3LogoDxe.inf
>AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCommonDxe.inf
> +
> +[Components.common.SMM_CORE]
> +
> AmdPlatformPkg/Library/SmmCorePlatformHookLib/SmmCorePlatformHook
> Lib.inf
> diff --git
> a/Platform/AMD/AmdPlatformPkg/Include/Library/AmdSmmCorePlatformHo
> okLib.h
> b/Platform/AMD/AmdPlatformPkg/Include/Library/AmdSmmCorePlatformHo
> okLib.h
> new file mode 100644
> index 00..6ae76920b4
> --- /dev/null
> +++
> b/Platform/AMD/AmdPlatformPkg/Include/Library/AmdSmmCorePlatformHo
> okLib.h
> @@ -0,0 +1,68 @@
> +/** @file
> +  AMD Smm Core Platform Hook Library
> +
> +  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef AMD_SMM_CORE_PLATFORM_HOOK_LIB_
> +#define AMD_SMM_CORE_PLATFORM_HOOK_LIB_
> +
> +/**
> +  This is the prototype of SMM Dispatcher hook before.
> +
> +  @retval EFI_STATUS
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *AMD_SMM_DISPATCH_HOOK_BEFORE)(
> +  VOID
> +  );
> +
> +/**
> +  This is the prototype of SMM Dispatcher after before.
> +
> +  @retval EFI_STATUS
> +
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *AMD_SMM_DISPATCH_HOOK_AFTER)(
> +  VOID
> +  );
> +
> +typedef  UINT32 AMD_SMM_DISPATCH_HOOK_PRIORITY;
> +
> +///
> +/// This is the structure of the SMM Dispatcher hook record
> +///
> +typedef struct {
> +  LIST_ENTRYNextList; ///< Point to 
> next
> AMD_SMM_DISPATCH_HOOK.
> +  AMD_SMM_DISPATCH_HOOK_BEFORE  AmdSmmDispatchHookBefore;
> ///< The hook before function.
> +  AMD_SMM_DISPATCH_HOOK_AFTER   AmdSmmDispatchHookAfter;  ///<
> The hook after function.
> +  AMD_SMM_DISPATCH_HOOK_PRIORITYPriority; ///< The 
> priority
> of this hook instance.
> +  ///< 

Re: [edk2-devel] [edk2-platforms 3/3] AmdPlatformPkg: Adds SPI smm core platform hook

2024-05-29 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Tuesday, May 28, 2024 10:08 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms 3/3] AmdPlatformPkg: Adds SPI smm core platform
> hook
>
> Register a smm core platform hook handler for SPI device,
> using AMD SmmCorePlatformHookLib library.
>
> This platform hook saves the SPI host controller state.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec |   3 +
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |   2 +
>  .../Include/Protocol/AmdSpiSmmHcState.h   | 107 +
>  .../SmmCoreAmdSpiHcHookLib.c  | 145 ++
>  .../SmmCoreAmdSpiHcHookLib.h  |  20 +++
>  .../SmmCoreAmdSpiHcHookLib.inf|  41 +
>  .../SmmCoreAmdSpiHcHookLib.uni|  11 ++
>  7 files changed, 329 insertions(+)
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Include/Protocol/AmdSpiSmmHcState.h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCoreAmdSpiHcHookLib/SmmC
> oreAmdSpiHcHookLib.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCoreAmdSpiHcHookLib/SmmC
> oreAmdSpiHcHookLib.h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCoreAmdSpiHcHookLib/SmmC
> oreAmdSpiHcHookLib.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SmmCoreAmdSpiHcHookLib/SmmC
> oreAmdSpiHcHookLib.uni
>
> diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> index 3020e628a3..907c5b9b74 100644
> --- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> +++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> @@ -29,6 +29,9 @@
>  [Guids]
>gAmdPlatformPkgTokenSpaceGuid   = { 0x663DE733, 0x70E0, 0x4D37,
> { 0xBB, 0x30, 0x7D, 0x9E, 0xAF, 0x9B, 0xDA, 0xE9 }}
>
> +[Protocols]
> +  gAmdSpiHcStateProtocolGuid  = { 0x189566ab, 0x245, 0x43ae, {0x9d,
> 0x1, 0xd2, 0x21, 0x1c, 0xb9, 0x1a, 0xda }}
> +
>  [PcdsDynamic]
>## Event GUID to trigger logo displaying
>#  Default set to
> gMinPlatformPkgTokenSpaceGuid.gBdsEventAfterConsoleReadyBeforeBootO
> ptionGuid
> diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> index 482e6f2f30..012270074d 100644
> --- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> +++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
> @@ -64,6 +64,7 @@
>
>  [LibraryClasses.common.SMM_CORE]
>
> SmmCorePlatformHookLib|AmdPlatformPkg/Library/SmmCorePlatformHook
> Lib/SmmCorePlatformHookLib.inf
> +
> SmmCoreAmdSpiHcHookLib|AmdPlatformPkg/Library/SmmCoreAmdSpiHcH
> ookLib/SmmCoreAmdSpiHcHookLib.inf
>
>  [Components]
>
> AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLi
> b.inf
> @@ -79,3 +80,4 @@
>
>  [Components.common.SMM_CORE]
>
> AmdPlatformPkg/Library/SmmCorePlatformHookLib/SmmCorePlatformHook
> Lib.inf
> +
> AmdPlatformPkg/Library/SmmCoreAmdSpiHcHookLib/SmmCoreAmdSpiHcH
> ookLib.inf
> diff --git
> a/Platform/AMD/AmdPlatformPkg/Include/Protocol/AmdSpiSmmHcState.h
> b/Platform/AMD/AmdPlatformPkg/Include/Protocol/AmdSpiSmmHcState.h
> new file mode 100644
> index 00..0e2bccb3ef
> --- /dev/null
> +++
> b/Platform/AMD/AmdPlatformPkg/Include/Protocol/AmdSpiSmmHcState.h
> @@ -0,0 +1,107 @@
> +/** @file
> +  Header file of AMD SMM SPI host controller state protocol
> +
> +  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#ifndef AMD_SMM_SPI_HC_STATE_PROTOCOL_H_
> +#define AMD_SMM_SPI_HC_STATE_PROTOCOL_H_
> +
> +typedef struct _SMM_EFI_SPI_HC_STATE_PROTOCOL
> SMM_EFI_SPI_HC_STATE_PROTOCOL;
> +
> +/**
> +  Save/Restore the state of the SPI Host Controller
> +
> +  Use a chipset specific method to save the state of the SPI Host controller 
> so
> +  it can be used without disturbing other transactions.
> +
> +  @param[in] This   Pointer to an SMM_EFI_SPI_HC_STATE_PROTOCOL
> structure.
> +
> +  @retval EFI_SUCCESSThe State was saved successfully
> +  @retval DEVICE_ERROR   SPI Executes command failed
> +
> +**/
> +typedef EFI_STATUS
> +(EFIAPI *SMM_SPI_HC_STATE)(
> +  IN CONST SMM_EFI_SPI_HC_STATE_PROTOCOL  *This
> +  );
> +
> +/**
> +  Lock/Unlock the SPI host controller register
> +
> +  Use a chipset specific method to lock or unlock SPI host controller 
> register.
> +
> +  @param[in] This   Pointer to an SMM_EFI_SPI_HC_STATE_PROTOCOL
> structure.
> +
> +  @retval EFI_SUCCESS  The clock was set up successfully
> +  @retval DEVICE_ERROR SPI Executes command failed
> +
> +
> +**/
> +typedef EFI_STATUS
> +(EFIAPI *SMM_SPI_HC_LOCK_UNLOCK)(
> +  IN CONST SMM_EFI_SPI_HC_STATE_PROTOCOL  *This
> +  );
> +
> +/**
> +  

Re: [edk2-devel] [edk2-platforms 1/3] AmdPlatformPkg: Removes unused gBoardBdsBootFromDevicePathProtocolGuid

2024-05-29 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Tuesday, May 28, 2024 10:08 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms 1/3] AmdPlatformPkg: Removes unused
> gBoardBdsBootFromDevicePathProtocolGuid
>
> Removes unused gBoardBdsBootFromDevicePathProtocolGuid protocol,
> and its corresponding code changes.
> Adds missing Pcd/SmbiosPcd.h file.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AmdPlatformPkg/Include/Pcd/SmbiosPcd.h|  58 
>  .../SmbiosCommonDxe/DefaultLomDevicePath.c| 130 --
>  .../Universal/SmbiosCommonDxe/SmbiosCommon.h  |  12 --
>  .../SmbiosCommonDxe/SmbiosCommonDxe.inf   |   3 -
>  .../SmbiosCommonDxe/SmbiosCommonEntryPoint.c  |   2 -
>  5 files changed, 58 insertions(+), 147 deletions(-)
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Include/Pcd/SmbiosPcd.h
>  delete mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLom
> DevicePath.c
>
> diff --git a/Platform/AMD/AmdPlatformPkg/Include/Pcd/SmbiosPcd.h
> b/Platform/AMD/AmdPlatformPkg/Include/Pcd/SmbiosPcd.h
> new file mode 100644
> index 00..2dd0480df9
> --- /dev/null
> +++ b/Platform/AMD/AmdPlatformPkg/Include/Pcd/SmbiosPcd.h
> @@ -0,0 +1,58 @@
> +/** @file
> +  Miscellaneous smbios data structures.
> +
> +  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#ifndef AMD_SMBIOS_PCD_H_
> +#define AMD_SMBIOS_PCD_H_
> +
> +#include 
> +#include 
> +
> +#define AMD_SMBIOS_TYPE8_MAX_PORT_CONNETORS16
> +#define AMD_SMBIOS_TYPE41_MAX_ONBOARD_DEVICES  16
> +
> +typedef struct {
> +  CHAR8IntDesignatorStr[SMBIOS_STRING_MAX_LENGTH];
> +  CHAR8ExtDesignatorStr[SMBIOS_STRING_MAX_LENGTH];
> +} PORT_CONNECTOR_STR;
> +
> +//
> +// AMD SMBIOS type 8 record structure.
> +//
> +typedef struct {
> +  SMBIOS_TABLE_TYPE8Type8Data;
> +  PORT_CONNECTOR_STRDesinatorStr;
> +} SMBIOS_PORT_CONNECTOR_RECORD;
> +
> +//
> +// AMD SMBIOS type 8 record structure array.
> +//
> +typedef struct {
> +  SMBIOS_PORT_CONNECTOR_RECORD
> SmbiosPortConnectorRecords[AMD_SMBIOS_TYPE8_MAX_PORT_CONNETOR
> S];
> +} SMBIOS_PORT_CONNECTOR_RECORD_ARRAY;
> +
> +//
> +// AMD SMBIOS type 41 record structure
> +//
> +typedef struct {
> +  SMBIOS_TABLE_STRINGReferenceDesignation;
> +  UINT8  DeviceType;
> +  UINT8  DeviceEnabled;
> +  UINT8  DeviceTypeInstance;
> +  UINT16 VendorId;
> +  UINT16 DeviceId;
> +  CHAR8  RefDesignationStr[SMBIOS_STRING_MAX_LENGTH];
> +} SMBIOS_ONBOARD_DEV_EXT_INFO_RECORD;
> +
> +//
> +// AMD SMBIOS type 41 record structure array.
> +//
> +typedef struct {
> +  SMBIOS_ONBOARD_DEV_EXT_INFO_RECORD
> SmbiosOnboardDevExtInfos[AMD_SMBIOS_TYPE41_MAX_ONBOARD_DEVIC
> ES];
> +} SMBIOS_ONBOARD_DEV_EXT_INFO_ARRAY;
> +
> +#endif // AMD_SMBIOS_PCD_H_
> diff --git
> a/Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLo
> mDevicePath.c
> b/Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLo
> mDevicePath.c
> deleted file mode 100644
> index 92c7aa5e07..00
> ---
> a/Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLo
> mDevicePath.c
> +++ /dev/null
> @@ -1,130 +0,0 @@
> -/** @file
> -  This file contains the implementation of the DefaultLomDevicePath protocol.
> -  The DefaultLomDevicePath protocol is used to identify the default LOM
> device
> -  path for the system. The protocol is installed by the SmbiosCommonDxe
> driver
> -  and is used by the BDS to identify the default LOM device path for the
> system.
> -
> -  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
> -
> -  SPDX-License-Identifier: BSD-2-Clause-Patent
> -**/
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include 
> -#include "SmbiosCommon.h"
> -#include 
> -#include 
> -
> -EFI_HANDLEmBoardBdsHandle = NULL;
> -BOARD_BDS_BOOT_FROM_DEVICE_PATH_PROTOCOL
> mBootDevicePathProtocol;
> -
> -/**
> -  Find the Lan-On-Motherboard device path. Installs
> BOARD_BDS_BOOT_FROM_DEVICE_PATH_PROTOCOL
> -  with the LOM device path protocol
> -
> -  @retval EFI NOT_FOUND LOM device path is not found
> -  @retval EFI_SUCCESS   LOM device path found
> -**/
> -EFI_STATUS
> -EFIAPI
> -InstallLomDevicePath (
> -  )
> -{
> -  SMBIOS_ONBOARD_DEV_EXT_INFO_RECORD  *DevExtInfoRecord;
> -  EFI_STATUS  Status;
> -  EFI_HANDLE  *PciHandles;
> -  UINTN   PciHandlesSize;
> -  UINTN   Index;
> -  EFI_PCI_IO_PROTOCOL *PciProtocol;
> -  PCI_IO_DEVICE 

Re: [edk2-devel] [edk2-platform 0/2] AmdPlatformPkg: Fix the build failure

2024-05-27 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

This patch set was reviewed on GitHub PR.

Hi Abdul, please go ahead to push this patch.
Thanks!

Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Tuesday, May 28, 2024 11:28 AM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Grimes,
> Paul ; Chang, Abner 
> Subject: [edk2-platform 0/2] AmdPlatformPkg: Fix the build failure
>
> PR: https://github.com/tianocore/edk2-platforms/pull/146
>
> Cc: Paul Grimes 
> Cc: Abner Chang 
>
> Abdul Lateef Attar (2):
>   AmdPlatformPkg: Corrects file path of LogoDxe driver
>   AmdPlatformPkg: Fix windows VC compilation warning
>
>  .../Universal/Acpi/AcpiCommon/PciSsdt.c   |   4 +-
>  .../LogoDxe/{LogoDxe => }/JpegLogo.idf|   0
>  .../LogoDxe/{LogoDxe => }/JpegLogoDxe.inf |   0
>  .../Universal/LogoDxe/{LogoDxe => }/Logo.bmp  | Bin
>  .../AmdPlatformPkg/Universal/LogoDxe/Logo.c   | 392 +-
>  .../Universal/LogoDxe/{LogoDxe => }/Logo.h|   0
>  .../Universal/LogoDxe/{LogoDxe => }/Logo.idf  |   0
>  .../Universal/LogoDxe/{LogoDxe => }/Logo.jpg  | Bin
>  .../LogoDxe/{LogoDxe => }/LogoDxe.inf |   0
>  .../Universal/LogoDxe/LogoDxe/Logo.c  | 194 -
>  .../Universal/LogoDxe/LogoDxe/S3Logo.bmp  | Bin 964114 -> 0 bytes
>  .../Universal/LogoDxe/LogoDxe/S3Logo.idf  |  10 -
>  .../Universal/LogoDxe/LogoDxe/S3LogoDxe.inf   |  57 ---
>  .../Universal/LogoDxe/S3Logo.idf  |  19 +-
>  .../Universal/LogoDxe/S3LogoDxe.inf   | 112 ++---
>  15 files changed, 263 insertions(+), 525 deletions(-)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/JpegLogo.idf (100%)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/JpegLogoDxe.inf (100%)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/Logo.bmp (100%)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/Logo.h (100%)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/Logo.idf (100%)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/Logo.jpg (100%)
>  rename Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/{LogoDxe
> => }/LogoDxe.inf (100%)
>  delete mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/LogoDxe/Logo.c
>  delete mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/LogoDxe/S3Logo.bmp
>  delete mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/LogoDxe/S3Logo.idf
>  delete mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/LogoDxe/LogoDxe/S3LogoDxe.inf
>
> --
> 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119291): https://edk2.groups.io/g/devel/message/119291
Mute This Topic: https://groups.io/mt/106342980/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 2/3] Platform/AMD: Update Readme.md

2024-05-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Cc: Paul Grimes 
Cc: Abdul Lateef Attar 
Cc: Igniculus Fu 
Cc: Ken Yao 
Cc: Eric Xing 
Cc: Duke Zhai 
Signed-off-by: Abner Chang 
---
 Platform/AMD/Readme.md | 64 --
 1 file changed, 49 insertions(+), 15 deletions(-)

diff --git a/Platform/AMD/Readme.md b/Platform/AMD/Readme.md
index 99d2b990c7..3297c6ba59 100644
--- a/Platform/AMD/Readme.md
+++ b/Platform/AMD/Readme.md
@@ -7,18 +7,25 @@ booting certain AMD platforms. The definition of sub-folders 
is described in bel
 
 ## Term and Definitions
 
+* **AGESA**
+
+  AMD Generic Encapsulated Software Architecture that are executed as part of a
+  host platform BIOS.
+
 * **AMD Platform** (platform in short)
 
-  AMD platform refers to a platform that supports the particular AMD SoC 
(processor), such as AMD EPYC Milan and Genoa processors.
+  AMD platform refers to a platform that supports the particular AMD SoC 
(processor), such as
+  AMD EPYC Milan and Genoa processors.
 
 * **AMD Board** (board in short)
 
   AMD board is a generic terminology refers to a board that is designed based 
on a
   specific AMD SoC architecture (also referred as AMD platform). More than one 
boards
-  are possibly designed to support an AMD platform with different 
configuration, such as 1-processor socket or 2-processor sockets board.
+  are possibly designed to support an AMD platform with different 
configuration, such as
+  1-processor socket or 2-processor sockets board.
 
 * **AMD edk2 Platform Package** (platform package in short)
-  
+
   The folder has the AMD edk2 platform common modules.
 
 * **AMD edk2 Board Package** (board package in short)
@@ -28,29 +35,52 @@ booting certain AMD platforms. The definition of 
sub-folders is described in bel
 
 ## Package Definition
 
+* **AgesaModulePkg**
+
+  This package contains all of the private interfaces and build configuration 
files for the
+  AGESA support.
+
+* **AgesaPkg**
+
+  This package contains all of the public interfaces and build configuration 
files
+  for the AGESA support.
+
+* **AmdCbsPkg**
+
+  AMD Configurable BIOS Setting. Provides the edk2 formset following the UEFI 
HII
+  spec to configure BIOS settings.
+
+* **AmdCpmPkg**
+
+  AMD Common Platform Module software is a BIOS procedure library designed to 
aid
+  AMD customers to quickly implement AMD platform technology into their 
products.
+
 * **AmdPlatformPkg**
 
-  AMD platform edk2 package under this folder provides the common edk2 modules 
those
-  are leverage by platforms. Usually those modules have no dependencies with
-  particular platforms. The module under this scope can provides a common 
implementation
-  for all platforms, or it may just provide a framework but the differences of 
implementation could be configured through the PCDs declared in 
AmdPlatformPkg.dec, or
-  the board level library provided in the \Pkg.
+  AMD platform edk2 package under this folder provides the common edk2
+  modules that are leveraged by platforms. Usually those modules have no 
dependencies with
+  particular platforms. Modules under this scope can provide a common 
implementation
+  for all platforms, or may just provide a framework but the differences of 
implementation
+  could be configured through the PCDs declared in AmdPlatformPkg.dec, or the 
board level
+  library provided in the \Pkg.
 
 * **AmdMinBoardPkg**
 
-  This package provides the common edk2 modules those can be leverage across 
AMD boards those use MinPlatformPkg framework.
+  This package provides the common edk2 modules that can be leveraged across 
AMD boards using
+  the MinPlatform framework.
 
 * **\Board**
 
-  This is the folder named by SoC and accommodate one or multiple board 
packages those
-  are designed base on the same SoC platform. Board folder may 
contain edk2
-  package meta files directly or the sub-folders named by \Pkg 
for a 
-  variety configurations of a platform.
+  This is the folder named by SoC and accommodates one or multiple board 
packages
+  that are designed based on the same SoC platform. Board folder may
+  contain edk2 package meta files directly or the sub-folders named by \Pkg for
+  a variety configurations of a platform.
 
 * **Pkg**
 
-  This is the folder that contains edk2 package meta files for a board which 
is designed base on a platform. Besides the edk2 meta files, Pkg 
may also provides
-  edk2 modules which are specifically to a board.
+  This is the folder that contains edk2 package meta files for a board which 
is designed base
+  on a platform. Besides the edk2 meta files, Pkg may also 
provides edk2 modules
+  which are specifically to a board.
 
   ```
   e.g. OverdriveBoard
@@ -63,6 +93,10 @@ booting certain AMD platforms. The definition of sub-folders 
is described in bel
 
   ```
   Platform/AMD
+|AgesaModulePkg
+|AgesaPkg
+|AmdCbsPkg
+|AmdCpmPkg
 |AmdPlatformPkg
 

[edk2-devel] [edk2-platforms][PATCH 3/3] edk2-platform/Maintainer: Add entries for AMD packages

2024-05-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Maintainers.txt | 14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/Maintainers.txt b/Maintainers.txt
index 877620a1b0..af688c3813 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -86,8 +86,20 @@ M: Leif Lindholm 
 AMD
 F: Platform/AMD
 M: Abner Chang 
-M: Abdul Lateef Attar 
+M: Abdul Lateef Attar 
+M: Paul Grimes 
+
+F: Platform/AMD/AgesaModulePkg
+F: Platform/AMD/AgesaPkg
+F: Platform/AMD/AmdCbsPkg
+M: Paul Grimes 
+R: Abdul Lateef Attar 
+R: Abner Chang 
+
+F: Platform/AMD/AmdCpmPkg
+M: Abdul Lateef Attar 
 R: Paul Grimes 
+R: Abner Chang 
 
 AMD Seattle
 F: Platform/AMD/OverdriveBoard/
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119129): https://edk2.groups.io/g/devel/message/119129
Mute This Topic: https://groups.io/mt/106257081/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 RESEND v2 3/5] AmdMinBoardPkg: Implement BoardInitLib for PEI phase

2024-05-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Monday, May 20, 2024 9:50 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms RESEND v2 3/5] AmdMinBoardPkg: Implement
> BoardInitLib for PEI phase
>
> PeiBoardInitPreMemLib library provides board-specific
> initialization functions for the PEI phase.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |   8 +
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |   5 +
>  .../PeiBoardInitPreMemLib/AmdMemoryInfoHob.h  |  50 
>  .../PeiBoardInitPreMemLib.c   | 229 ++
>  .../PeiBoardInitPreMemLib.inf |  45 
>  .../PeiBoardInitPreMemLib/PeiMemoryInit.c | 198 +++
>  .../PeiBoardInitPreMemLib/PeiMemoryInit.h |  50 
>  7 files changed, 585 insertions(+)
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMem
> oryInfoHob.h
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardI
> nitPreMemLib.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardI
> nitPreMemLib.inf
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemor
> yInit.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemor
> yInit.h
>
> diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> index 03d1d77c34..98768af210 100644
> --- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> +++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
> @@ -19,6 +19,10 @@
>
>  [Guids]
>gAmdMinBoardPkgTokenSpaceGuid  = {0xd4d23d79, 0x73bf, 0x460a, {0xa1,
> 0xc7, 0x85, 0xa3, 0xca, 0x71, 0xb9, 0x4c}}
> +  gAmdMemoryInfoHobGuid  = { 0x1bce3d14, 0xa5fe, 0x4a0b, { 0x9a,
> 0x8d, 0x69, 0xca, 0x5d, 0x98, 0x38, 0xd3}}
> +
> +[Ppis]
> +  gAmdMemoryInfoHobPpiGuid   = { 0xba16e587, 0x1d66, 0x41b7, { 0x9b,
> 0x52, 0xca, 0x4f, 0x2c, 0xad, 0x0d, 0xc8}}
>
>  [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
>#
> @@ -41,3 +45,7 @@
>gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecuritySize
> |0x|UINT32|0x1008
>gAmdMinBoardPkgTokenSpaceGuid.PcdAmdFlashFvAdvancedSecurityOffset
> |0x|UINT32|0x1009
>
> +  # SMRAM size
> +  # Holds the SMRAM area size, which is reserved for SMRAM operation
> +  # default value 128MB
> +  gAmdMinBoardPkgTokenSpaceGuid.PcdAmdSmramAreaSize
> |0x0800|UINT64|0x2100
> diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> index be33089a45..7e356a2a67 100644
> --- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> +++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
> @@ -22,6 +22,9 @@
>MinPlatformPkg/MinPlatformPkg.dec
>UefiCpuPkg/UefiCpuPkg.dec
>
> +[PcdsDynamicDefault]
> +  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x1000
> +
>  [LibraryClasses]
>SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
>ReportFvLib|AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
> @@ -38,6 +41,7 @@
>
>  [LibraryClasses.common.PEIM]
>
> SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLi
> b.inf
> +
> BoardInitLib|AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInit
> PreMemLib.inf
>
>  [Components]
>AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
> @@ -45,6 +49,7 @@
>  [Components.IA32]
>AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
>AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
> +
> AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.in
> f
>
>  [Components.X64]
>AmdMinBoardPkg/PciHotPlug/PciHotPlugInit.inf
> diff --git
> a/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMe
> moryInfoHob.h
> b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMe
> moryInfoHob.h
> new file mode 100644
> index 00..b596b3bdf3
> --- /dev/null
> +++
> b/Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMe
> moryInfoHob.h
> @@ -0,0 +1,50 @@
> +/** @file
> +  Defines AMD memory info hob.
> +
> +  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef AMD_MEMORY_INFO_HOB_H_
> +#define AMD_MEMORY_INFO_HOB_H_
> +
> +#pragma pack (push, 1)
> +
> +/// Memory descriptor structure for each memory range
> +typedef struct {
> +  UINT64Base;   ///< Base address of memory rang
> +  UINT64Size;   ///< Size of memory rang
> +  UINT32Attribute;  ///< Attribute of memory rang
> +  UINT32Reserved;  

Re: [edk2-devel] [edk2-platforms] AmdPlatformPkg: Adds SmbiosCommonDxe driver

2024-05-20 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Already reviewed internally.
Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Monday, May 20, 2024 6:24 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-platforms] AmdPlatformPkg: Adds SmbiosCommonDxe driver
>
> Adds SMBIOS common driver which generates various
> tables for AMD platforms.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec |  63 -
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |   3 +-
>  .../SmbiosCommonDxe/DefaultLomDevicePath.c| 130 ++
>  .../Universal/SmbiosCommonDxe/SmbiosCommon.h  | 210
> 
>  .../SmbiosCommonDxe/SmbiosCommonDxe.inf   |  76 ++
>  .../SmbiosCommonDxe/SmbiosCommonEntryPoint.c  | 148 +++
>  .../Type11OemStringsFunction.c|  91 +++
>  .../Type12SystemCfgOptionsFunction.c  |  90 +++
>  .../Type13BiosLanguageInfoFunction.c  | 146 +++
>  .../Type38IpmiDeviceInformation.c |  70 ++
>  .../Type41OnboardDevExtInfoFunction.c | 237 ++
>  .../Type8PortConnectorInfoFunction.c  | 133 ++
>  .../Type9SystemSlotInfoFunction.c |  94 +++
>  13 files changed, 1489 insertions(+), 2 deletions(-)
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/DefaultLom
> DevicePath.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCom
> mon.h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCom
> monDxe.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/SmbiosCom
> monEntryPoint.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type11Oem
> StringsFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type12Syste
> mCfgOptionsFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type13BiosL
> anguageInfoFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type38Ipmi
> DeviceInformation.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type41Onb
> oardDevExtInfoFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type8PortC
> onnectorInfoFunction.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/SmbiosCommonDxe/Type9Syste
> mSlotInfoFunction.c
>
> diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> index 83f57f6d0a..787dac4cca 100644
> --- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> +++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dec
> @@ -8,7 +8,7 @@
>  #
>  ##
>
> -[Defines]
> +[Defines]
>DEC_SPECIFICATION = 1.27
>PACKAGE_NAME  = AmdPlatformPkg
>PACKAGE_GUID  = 2CB1238B-18E2-4837-B714-9DAB2B30A3C2
> @@ -42,3 +42,64 @@
># 3 - BT
># 4 - SSIF
>
> gAmdPlatformPkgTokenSpaceGuid.PcdIpmiInterfaceType|0|UINT8|0x00020
> 001
> +
> +  #
> +  # This PCD is mapped to AMD SMBIOS type 8 record structure
> +  #
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType8Number|0|UINT8|0
> x00020002
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType8|{0x0}|SMBIOS_PO
> RT_CONNECTOR_RECORD_ARRAY|0x00020003 {
> +  
> +Pcd/SmbiosPcd.h
> +  
> +AmdPlatformPkg/AmdPlatformPkg.dec
> +MdePkg/MdePkg.dec
> +MdeModulePkg/MdeModulePkg.dec
> +  }
> +
> +  #
> +  # This PCD is mapped to AMD SMBIOS type 41 record structure
> +  #
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType41Number|0|UINT8|
> 0x00020004
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType41|{0x0}|SMBIOS_O
> NBOARD_DEV_EXT_INFO_ARRAY|0x00020005 {
> +  
> +Pcd/SmbiosPcd.h
> +  
> +AmdPlatformPkg/AmdPlatformPkg.dec
> +MdePkg/MdePkg.dec
> +MdeModulePkg/MdeModulePkg.dec
> +  }
> +
> +  #
> +  # These PCDs are mapped to AMD SMBIOS type 9 record structure
> +  #
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1|
> {0x0}|MISC_SLOT_CHARACTERISTICS1|0x00020009 {
> +  
> +IndustryStandard/SmBios.h
> +  }
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> CharacteristicsUnknown|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> Provides50Volts|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> Provides33Volts|1
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> SharedSlot|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> PcCard16Supported|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> CardBusSupported|0
> +
> gAmdPlatformPkgTokenSpaceGuid.PcdAmdSmbiosType9SlotCharacteristics1.
> ZoomVideoSupported|0
> +
> 

Re: [edk2-devel] [PATCH 0/5] AmdMinBoardPkg: AMD board specific modules

2024-05-16 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Already reviewed internally.
Reviewed-by: Abner Chang 

Hi Abdul, please add the tag [edk2-platforms] in subject next time when send 
the patch for edk2-platforms changes.
Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Abdul
> Lateef Attar via groups.io
> Sent: Friday, May 17, 2024 11:49 AM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [edk2-devel] [PATCH 0/5] AmdMinBoardPkg: AMD board specific
> modules
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> PR: https://github.com/tianocore/edk2-platforms/pull/143
> Adds various module common to AMD boards.
> Cc: Abner Chang 
> Cc: Paul Grimes 
>
> Abdul Lateef Attar (5):
>   AmdMinBoardPkg: Uncrustify PciHotPlug module
>   AmdMinBoardPkg/Library: Uncrustify the Library module
>   AmdMinBoardPkg: Implement BoardInitLib for PEI phase
>   AmdMinBoardPkg: Implement BoardInitLib for DXE phase
>   AmdMinBoardPkg: Implements BoardBdsHookLib library
>
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec |   10 +
>  .../AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc |   10 +-
>  .../Include/Library/AmdBoardBdsHookLib.h  |  130 ++
>  .../Library/BoardBdsHookLib/BoardBdsHook.h|  242 +++
>  .../Library/BoardBdsHookLib/BoardBdsHookLib.c | 1712
> +
>  .../BoardBdsHookLib/BoardBdsHookLib.inf   |  105 +
>  .../Library/BoardBdsHookLib/BoardBootOption.c |  754 
>  .../Library/BoardBdsHookLib/BoardMemoryTest.c |   83 +
>  .../Library/DxeBoardInitLib/DxeBoardInitLib.c |  253 +++
>  .../DxeBoardInitLib/DxeBoardInitLib.inf   |   51 +
>  .../DxeBoardInitLib/DxeBoardInitLibInternal.c |  306 +++
>  .../DxeBoardInitLib/DxeBoardInitLibInternal.h |  159 ++
>  .../DxeBoardInitLib/MadtAcpiTablePatch.c  |  243 +++
>  .../PeiBoardInitPreMemLib/AmdMemoryInfoHob.h  |   50 +
>  .../PeiBoardInitPreMemLib.c   |  229 +++
>  .../PeiBoardInitPreMemLib.inf |   45 +
>  .../PeiBoardInitPreMemLib/PeiMemoryInit.c |  198 ++
>  .../PeiBoardInitPreMemLib/PeiMemoryInit.h |   50 +
>  .../Library/PeiReportFvLib/PeiReportFvLib.c   |   12 +-
>  .../Library/SetCacheMtrrLib/SetCacheMtrrLib.c |3 +-
>  .../PciHotPlug/PciHotPlugInit.c   |4 +-
>  .../PciHotPlug/PciHotPlugInit.inf |5 +-
>  22 files changed, 4647 insertions(+), 7 deletions(-)
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Include/Library/AmdBoardBdsHookLib.h
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHook.
> h
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLi
> b.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLi
> b.inf
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBootOptio
> n.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/BoardBdsHookLib/BoardMemoryT
> est.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.in
> f
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLibIn
> ternal.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLibIn
> ternal.h
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/DxeBoardInitLib/MadtAcpiTablePat
> ch.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/AmdMem
> oryInfoHob.h
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardI
> nitPreMemLib.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardI
> nitPreMemLib.inf
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemor
> yInit.c
>  create mode 100644
> Platform/AMD/AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiMemor
> yInit.h
>
> --
> 2.34.1
>
>
>
> 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118982): https://edk2.groups.io/g/devel/message/118982
Mute This Topic: https://groups.io/mt/106148089/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] ManageabilityPkg: add support for the phosphor ipmi blob transfer protocol

2024-05-16 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

That is awesome!  Thank you!

Abner

> -Original Message-
> From: Nhi Pham 
> Sent: Thursday, May 16, 2024 4:50 PM
> To: Chang, Abner ; devel@edk2.groups.io;
> nick...@nvidia.com; Rebecca Cran 
> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef)
> ; Tinh Nguyen
> 
> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add
> support for the phosphor ipmi blob transfer protocol
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> On 5/16/2024 3:44 PM, Chang, Abner wrote:
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > Hi Nhi,
> > Are you using SSIF as the transport interface based on the ManabeabilityPkg
> framework? If yes, will you contribute that driver?
> >
>
> yes, we are. I will need to update the SSIF driver to be compatible with
> the ManabeabilityPkg and upstream it.
>
> Regards,
> Nhi


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118953): https://edk2.groups.io/g/devel/message/118953
Mute This Topic: https://groups.io/mt/98212643/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] ManageabilityPkg: add support for the phosphor ipmi blob transfer protocol

2024-05-16 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Hi Nhi,
Are you using SSIF as the transport interface based on the ManabeabilityPkg 
framework? If yes, will you contribute that driver?

Thanks
Abner

> -Original Message-
> From: Nhi Pham 
> Sent: Thursday, May 16, 2024 4:40 PM
> To: devel@edk2.groups.io; nick...@nvidia.com; Chang, Abner
> ; Rebecca Cran 
> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul Lateef)
> ; Tinh Nguyen
> 
> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add
> support for the phosphor ipmi blob transfer protocol
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Thanks Nickle. I'm reviewing and testing it. Will get back to you soon.
>
> On 5/15/2024 10:14 PM, Nickle Wang via groups.io wrote:
> > Hi Nhi,
> >
> > Version 2 patch files are sent for review here:
> https://edk2.groups.io/g/devel/message/118914 and
> https://edk2.groups.io/g/devel/message/118922
> >
> > For your convenience, below are two pull requests if you would like to test
> them.
> >
> > 1) https://github.com/tianocore/edk2/pull/5660
> > 2) https://github.com/tianocore/edk2-platforms/pull/76
> >
> > I had tried to address review comments as much as I can. Please feel free to
> let me know if you see any issue in this version of patch set.
> >
> > Thanks,
> > Nickle
> >
> >> -Original Message-
> >> From: Nhi Pham 
> >> Sent: Tuesday, May 14, 2024 10:26 AM
> >> To: Nickle Wang ; devel@edk2.groups.io;
> >> abner.ch...@amd.com; Rebecca Cran 
> >> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul
> Lateef)
> >> ; Tinh Nguyen
> >> 
> >> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: add
> >> support for the phosphor ipmi blob transfer protocol
> >>
> >> External email: Use caution opening links or attachments
> >>
> >>
> >> Thanks Nickle. I will help review and verify your patch.
> >>
> >> On 5/14/2024 8:56 AM, Nickle Wang wrote:
> >>> Hi Nhi,
> >>>
> >>> This task is on my list but with lower priority. I will try to provide 
> >>> version 2
> patch
> >> for review here by the end of this week.
> >>>
> >>> Thanks,
> >>> Nickle
> >>>
> >>>> -Original Message-
> >>>> From: Nhi Pham 
> >>>> Sent: Monday, May 13, 2024 5:02 PM
> >>>> To: devel@edk2.groups.io; abner.ch...@amd.com; Nickle Wang
> >>>> ; Rebecca Cran 
> >>>> Cc: Isaac Oram ; Attar, AbdulLateef (Abdul
> >>>> Lateef) ; Tinh Nguyen
> >>>> 
> >>>> Subject: Re: [edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg:
> >>>> add support for the phosphor ipmi blob transfer protocol
> >>>>
> >>>> External email: Use caution opening links or attachments
> >>>>
> >>>>
> >>>> On 2/9/2024 11:37 PM, Chang, Abner via groups.io wrote:
> >>>>> [AMD Official Use Only - General]
> >>>>>
> >>>>> Yeah, I forget this patch set and seems we don't have any follow up
> >>>>> conversation
> >>>> after below feedbacks from community.
> >>>>>
> >>>>>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fed
> >>>>>
> >>
> k2%2F=05%7C02%7Cnicklew%40nvidia.com%7Cdc53be8f0cf24ccfd35
> 108d
> >> c
> >>>>>
> >>
> 73bd2d45%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C63851
> 25035
> >> 6068
> >>>>>
> >>
> 8708%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2l
> uMzIi
> >> LCJ
> >>>>>
> >>
> BTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C=%2BCkaU%2Fcd
> G1v
> >> r6uPsA
> >>>>> 7fqrvhvxg%2FX5FqcmJ6fizaa9fA%3D=0
> >>>>> .groups.io%2Fg%2Fdevel%2Fmessage%2F103116=05%7C02%7
> Cnickle
> >> w
> >>>> %40nvi
> >>>>>
> >>>>
> >>
> dia.com%7C8b9e1a8a8d044208f8d608dc732b678d%7C43083d15727340c
> 1b7db
> >>>> 39efd
> >>>>>
> >>>>
> >>
> 9ccc17a%7C0%7C0%7C638511877469561600%7CUnknown%7CTWFpbGZs
> b3d8
> >>>> eyJWIjoiM
> >>>>>
> >>>>
> >>
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

2024-05-15 Thread Chang, Abner via groups.io
or
> > >
> > > -Original Message-
> > > From: Nickle Wang 
> > > Sent: Tuesday, May 14, 2024 8:40 AM
> > > To: devel@edk2.groups.io; abner.ch...@amd.com; Igor Kulchytskyy
> > > 
> > > Cc: Nick Ramirez 
> > > Subject: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> > > RedfishClientPkg: introduce RedfishBootstrapAccountDxe
> > >
> > >
> > > **CAUTION: The e-mail below is from an external source. Please
> > > exercise caution before opening attachments, clicking links, or
> > > following guidance.**
> > >
> > > Hi Abner,
> > >
> > > > Ok, then I don't have the problem with invoking GetAuthInfo again.
> > > However, I
> > > > will suggest to add more description in GetAuthInfo function header,
> > > mention that
> > > > we will keep the auth info in EFI variable until exist boot service.
> > > > Also, give some more descriptions on the code you invoke to
> GetAuthInfo.
> > >
> > > Thanks for your comment. I add descriptions to explain above before
> > > calling GetAuthInfo(). Version 2 path is here:
> > >
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fedk
> 2
> >
> > .groups.io%2Fg%2Fdevel%2Fmessage%2F118889=05%7C02%7Cnick
> lew
> > %40nvi
> > >
> >
> dia.com%7C10ec4812a68a434b806008dc75445994%7C43083d15727340c
> 1b7db
> > 39efd
> > >
> >
> 9ccc17a%7C0%7C0%7C638514183674607956%7CUnknown%7CTWFpbGZs
> b3d8
> > eyJWIjoiM
> > >
> >
> C4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7
> C%7
> > C%7C
> > >
> >
> =GNlisCnBmVQRhCLTxICGDsArv%2B64lC%2BkktUMi8Yg%2BJM%3D
> ese
> > rved=0
> > >
> > > Regards,
> > > Nickle
> > >
> > > > -Original Message-
> > > > From: devel@edk2.groups.io  On Behalf Of
> > > > Chang,
> > > Abner
> > > > via groups.io
> > > > Sent: Tuesday, April 23, 2024 3:42 PM
> > > > To: Nickle Wang ; Igor Kulchytskyy
> > > > ; devel@edk2.groups.io
> > > > Cc: Nick Ramirez 
> > > > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg:
> > > > introduce RedfishBootstrapAccountDxe
> > > >
> > > > External email: Use caution opening links or attachments
> > > >
> > > >
> > > > [AMD Official Use Only - General]
> > > >
> > > > > -Original Message-
> > > > > From: Nickle Wang 
> > > > > Sent: Tuesday, April 23, 2024 3:09 PM
> > > > > To: Igor Kulchytskyy ; Chang, Abner
> > > > > ; devel@edk2.groups.io
> > > > > Cc: Nick Ramirez 
> > > > > Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH]
> > > RedfishClientPkg:
> > > > > introduce RedfishBootstrapAccountDxe
> > > > >
> > > > > [AMD Official Use Only - General]
> > > > >
> > > > > Caution: This message originated from an External Source. Use
> > > > > proper caution when opening attachments, clicking links, or
> responding.
> > > > >
> > > > >
> > > > > Hi Igor, Abner,
> > > > >
> > > > > Thanks for your review. Please allow me to answer your questions
> > > together.
> > > > >
> > > > > > 1. We suppose acquire the credential before we start to
> > > > > > communicate with
> > > > > Redfish. Will Redfish credential driver create another bootstrap
> > > > > account here after provisioning?
> > > > > No, according to the RedfishPlatformCredentialIpmiLib
> > > > > implementation, Redfish credential driver requests credential from
> > > > > BMC and will keep it for later use. So only one credential is
> > > > > requested for BIOS Redfish feature drivers during POST time.
> > > > Ok, then I don't have the problem with invoking GetAuthInfo again.
> > > However, I
> > > > will suggest to add more description in GetAuthInfo function header,
> > > mention that
> > > > we will keep the auth info in EFI variable until exist boot service.
> > > > Also, give some more descriptions on the code you invoke to
> GetAuthInfo.
> > > >
> > > > >
> > > > > > 2. And why do we delete the credential after provisioning? How
> > 

Re: [edk2-devel] [PATCH] MdePkg: Remove non-ASCII characters from header file (BZ# 4775)

2024-05-15 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Thanks Liming! We can merge it after the stable release.

Abner

> -Original Message-
> From: gaoliming 
> Sent: Thursday, May 16, 2024 9:09 AM
> To: devel@edk2.groups.io; Chang, Abner ; Hsueh,
> Hong-Chih (Neo) 
> Cc: michael.d.kin...@intel.com; zhiguang@intel.com; He, Jiangang
> 
> Subject: 回复: [edk2-devel] [PATCH] MdePkg: Remove non-ASCII characters
> from header file (BZ# 4775)
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Abner:
>   This change is good to me. Reviewed-by: Liming Gao
> 
>
>   But, this is not critical issue. So, I suggest to merge it after the stable 
> tag.
>
> Thanks
> Liming
> > -邮件原件-
> > 发件人: devel@edk2.groups.io  代表 Chang, Abner
> via
> > groups.io
> > 发送时间: 2024年5月16日 8:50
> > 收件人: Hsueh, Hong-Chih (Neo) ;
> > devel@edk2.groups.io
> > 抄送: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn;
> > zhiguang@intel.com; He, Jiangang 
> > 主题: Re: [edk2-devel] [PATCH] MdePkg: Remove non-ASCII characters from
> > header file (BZ# 4775)
> >
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > Hi Mike, Liming and Zhiguang,
> > Could you please check this patch sent two weeks ago? The corresponding
> BZ
> > ticket is 4775. We overlooked tracking this issue and missed the 202405
> stable
> > release. As this impacts the build, do you think we can have a quick review
> and
> > approve it; having this change pulled in 202405 stable release? Otherwise
> we will
> > have to wait until next stable release.
> >
> > Thanks
> > Abner
> >
> > > -Original Message-
> > > From: Hsueh, Hong-Chih (Neo) 
> > > Sent: Thursday, May 2, 2024 3:31 AM
> > > To: devel@edk2.groups.io
> > > Cc: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn;
> > > zhiguang@intel.com; He, Jiangang ; Chang,
> > > Abner ; Hsueh, Hong-Chih (Neo)  > > chih.hs...@amd.com>
> > > Subject: [PATCH] MdePkg: Remove non-ASCII characters from header file
> > >
> > > Cc: Jiangang He 
> > > Signed-off-by: Neo Hsueh 
> > > ---
> > >  MdePkg/Include/Register/Amd/Cpuid.h  | 4 ++--
> > >  MdePkg/Include/Register/Intel/ArchitecturalMsr.h | 8 
> > >  2 files changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/MdePkg/Include/Register/Amd/Cpuid.h
> > > b/MdePkg/Include/Register/Amd/Cpuid.h
> > > index add43c40aa..51fa9f235c 100644
> > > --- a/MdePkg/Include/Register/Amd/Cpuid.h
> > > +++ b/MdePkg/Include/Register/Amd/Cpuid.h
> > > @@ -46,9 +46,9 @@ CPUID Signature Information
> > >CPUID Extended Topology Enumeration
> > >
> > >@note
> > > -  Reference: AMD64 Architecture Programmer’s Manual Volume 3:
> General-
> > > Purpose and System Instructions,
> > > +  Reference: AMD64 Architecture Programmer's Manual Volume 3:
> General-
> > > Purpose and System Instructions,
> > >   Revision 3.35 Appendix E,
> > > -  E.4.24 Function 8000_0026—Extended CPU Topology:
> > > +  E.4.24 Function 8000_0026-Extended CPU Topology:
> > >  CPUID Fn8000_0026 reports extended topology information for logical
> > > processors, including
> > >  asymmetric and heterogenous topology descriptions. Individual logical
> > > processors may report
> > >  different values in systems with asynchronous and heterogeneous
> > > topologies.
> > > diff --git a/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> > > b/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> > > index 756e7c86ec..4715c59dc4 100644
> > > --- a/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> > > +++ b/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> > > @@ -5733,9 +5733,9 @@ typedef union {
> > >  /// [Bit 7:4] TME Policy/Encryption Algorithm: Only algorithms
> > enumerated
> > > in
> > >  /// IA32_TME_CAPABILITY are allowed.
> > >  /// For example:
> > > -///    – AES-XTS-128.
> > > -///   0001 – AES-XTS-128 with integrity.
> > > -///   0010 – AES-XTS-256.
> > > +///    - AES-XTS-128.
> > > +///   0001 - AES-XTS-128 with integrity.
> > > +///   0010 - AES-XTS-256.
> > >  ///   Other values are invalid.
> > >  ///
> > >  UINT32TmePolicy

Re: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file for OEM net function

2024-05-15 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Thanks! Will merge later after the hard freeze.

Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Thursday, May 16, 2024 9:04 AM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Nick
> Ramirez 
> Subject: RE: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file
> for OEM net function
>
> [AMD Official Use Only - AMD Internal Distribution Only]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Yes, this is pull request: https://github.com/tianocore/edk2/pull/5660
>
> Thanks,
> Nickle
>
> > -Original Message-
> > From: Chang, Abner 
> > Sent: Thursday, May 16, 2024 9:01 AM
> > To: devel@edk2.groups.io; Nickle Wang 
> > Cc: Attar, AbdulLateef (Abdul Lateef) ; Nick
> > Ramirez 
> > Subject: RE: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file
> for
> > OEM net function
> >
> > External email: Use caution opening links or attachments
> >
> >
> > [AMD Official Use Only - AMD Internal Distribution Only]
> >
> > Reviewed-by: Abner Chang 
> >
> > Hi Nickle,
> > Do you have the corresponding PR for this? I will merge it after hard 
> > freeze.
> > Thanks
> > Abner
> >
> > > -Original Message-
> > > From: devel@edk2.groups.io  On Behalf Of Nickle
> > > Wang via groups.io
> > > Sent: Wednesday, May 15, 2024 4:50 PM
> > > To: devel@edk2.groups.io
> > > Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> > > Lateef) ; Nick Ramirez
> > > 
> > > Subject: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file
> > > for OEM net function
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Add net function definitions for OEM/Non-IPMI group request and
> > > response
> > >
> > > Signed-off-by: Nickle Wang 
> > > Cc: Abner Chang 
> > > Cc: Abdul Lateef Attar 
> > > Cc: Nick Ramirez 
> > > ---
> > >  MdePkg/Include/IndustryStandard/IpmiNetFnOem.h | 18
> > > ++
> > >  1 file changed, 18 insertions(+)
> > >  create mode 100644
> MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > >
> > > diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > > b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > > new file mode 100644
> > > index 00..48c5dbd803
> > > --- /dev/null
> > > +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> > > @@ -0,0 +1,18 @@
> > > +/** @file
> > > +  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision
> 1.1.
> > > +
> > > +  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > > reserved.
> > > +
> > > +  SPDX-License-Identifier: BSD-2-Clause-Patent **/
> > > +
> > > +#ifndef IPMI_NET_FN_OEM_H_
> > > +#define IPMI_NET_FN_OEM_H_
> > > +
> > > +//
> > > +// Net function definition for OEM/Group command //
> > > +#define IPMI_NETFN_OEM0x2E
> > > +#define IPMI_NETFN_OEM_GROUP  0x2F
> > > +
> > > +#endif
> > > --
> > > 2.34.1
> > >
> > >
> > >
> > > 
> > >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118937): https://edk2.groups.io/g/devel/message/118937
Mute This Topic: https://groups.io/mt/106110708/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: introduce RedfishBootstrapAccountDxe

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

HI Igor,
This sounds to me reasonable to me. As you mentioned, RedfishPkg was designed 
to support multiple Redfish applications and RedfishClientPkg is just one of 
them. I think we can review the implementation of acquiring/deleting credential.

Thanks
Abner


> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Wednesday, May 15, 2024 11:02 PM
> To: Nickle Wang ; devel@edk2.groups.io; Chang, Abner
> 
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg: introduce RedfishBootstrapAccountDxe
>
> [AMD Official Use Only - General]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Nickle,
> I have one more question to discuss regarding this driver.
> We have a bootstrap account and creation of this account controlled by
> RedfishCredentialDxe driver in RedfishPkg.
> But deletion of that bootstrap account is moved to RedfishClientPkg.
> What if we have another Redfish Client or some customer service which uses
> RedfishPkg for the communication.
> Architecturally it is allowed.
> But then RedfishBootstrapAccountDxe module would delete account just
> based on the RedfishClientPkg needs.
> Maybe we should consider moving RedfishBootstrapAccountDxe driver to
> RedfishPkg and have some register mechanism which will be used by
> interested drivers to notify that they finished their job and after that
> RedfishBootstrapAccountDxe driver would delete an account.
> What do you think?
> Thank you,
> Igor
>
> -Original Message-
> From: Nickle Wang 
> Sent: Tuesday, May 14, 2024 8:40 AM
> To: devel@edk2.groups.io; abner.ch...@amd.com; Igor Kulchytskyy
> 
> Cc: Nick Ramirez 
> Subject: [EXTERNAL] RE: [edk2-devel] [edk2-redfish-client][PATCH]
> RedfishClientPkg: introduce RedfishBootstrapAccountDxe
>
>
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
>
> Hi Abner,
>
> > Ok, then I don't have the problem with invoking GetAuthInfo again.
> However, I
> > will suggest to add more description in GetAuthInfo function header,
> mention that
> > we will keep the auth info in EFI variable until exist boot service.
> > Also, give some more descriptions on the code you invoke to GetAuthInfo.
>
> Thanks for your comment. I add descriptions to explain above before calling
> GetAuthInfo(). Version 2 path is here:
> https://edk2.groups.io/g/devel/message/118889
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Chang,
> Abner
> > via groups.io
> > Sent: Tuesday, April 23, 2024 3:42 PM
> > To: Nickle Wang ; Igor Kulchytskyy ;
> > devel@edk2.groups.io
> > Cc: Nick Ramirez 
> > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg:
> > introduce RedfishBootstrapAccountDxe
> >
> > External email: Use caution opening links or attachments
> >
> >
> > [AMD Official Use Only - General]
> >
> > > -Original Message-
> > > From: Nickle Wang 
> > > Sent: Tuesday, April 23, 2024 3:09 PM
> > > To: Igor Kulchytskyy ; Chang, Abner
> > > ; devel@edk2.groups.io
> > > Cc: Nick Ramirez 
> > > Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH]
> RedfishClientPkg:
> > > introduce RedfishBootstrapAccountDxe
> > >
> > > [AMD Official Use Only - General]
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Igor, Abner,
> > >
> > > Thanks for your review. Please allow me to answer your questions
> together.
> > >
> > > > 1. We suppose acquire the credential before we start to communicate
> > > > with
> > > Redfish. Will Redfish credential driver create another bootstrap
> > > account here after provisioning?
> > > No, according to the RedfishPlatformCredentialIpmiLib implementation,
> > > Redfish credential driver requests credential from BMC and will keep
> > > it for later use. So only one credential is requested for BIOS Redfish
> > > feature drivers during POST time.
> > Ok, then I don't have the problem with invoking GetAuthInfo again.
> However, I
> > will suggest to add more description in GetAuthInfo function header,
> mention that
> > we will keep the auth info in EFI variable until exis

Re: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file for OEM net function

2024-05-15 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Abner Chang 

Hi Nickle,
Do you have the corresponding PR for this? I will merge it after hard freeze.
Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Nickle
> Wang via groups.io
> Sent: Wednesday, May 15, 2024 4:50 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> Lateef) ; Nick Ramirez 
> Subject: [edk2-devel] [PATCH] MdePkg: Add Ipmi definitions header file for
> OEM net function
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Add net function definitions for OEM/Non-IPMI group
> request and response
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Cc: Nick Ramirez 
> ---
>  MdePkg/Include/IndustryStandard/IpmiNetFnOem.h | 18
> ++
>  1 file changed, 18 insertions(+)
>  create mode 100644 MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
>
> diff --git a/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> new file mode 100644
> index 00..48c5dbd803
> --- /dev/null
> +++ b/MdePkg/Include/IndustryStandard/IpmiNetFnOem.h
> @@ -0,0 +1,18 @@
> +/** @file
> +  IPMI 2.0 definitions from the IPMI Specification Version 2.0, Revision 1.1.
> +
> +  Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +**/
> +
> +#ifndef IPMI_NET_FN_OEM_H_
> +#define IPMI_NET_FN_OEM_H_
> +
> +//
> +// Net function definition for OEM/Group command
> +//
> +#define IPMI_NETFN_OEM0x2E
> +#define IPMI_NETFN_OEM_GROUP  0x2F
> +
> +#endif
> --
> 2.34.1
>
>
>
> 
>



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




Re: [edk2-devel] [PATCH] MdePkg: Remove non-ASCII characters from header file (BZ# 4775)

2024-05-15 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Hi Mike, Liming and Zhiguang,
Could you please check this patch sent two weeks ago? The corresponding BZ 
ticket is 4775. We overlooked tracking this issue and missed the 202405 stable 
release. As this impacts the build, do you think we can have a quick review and 
approve it; having this change pulled in 202405 stable release? Otherwise we 
will have to wait until next stable release.

Thanks
Abner

> -Original Message-
> From: Hsueh, Hong-Chih (Neo) 
> Sent: Thursday, May 2, 2024 3:31 AM
> To: devel@edk2.groups.io
> Cc: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn;
> zhiguang@intel.com; He, Jiangang ; Chang,
> Abner ; Hsueh, Hong-Chih (Neo)  chih.hs...@amd.com>
> Subject: [PATCH] MdePkg: Remove non-ASCII characters from header file
>
> Cc: Jiangang He 
> Signed-off-by: Neo Hsueh 
> ---
>  MdePkg/Include/Register/Amd/Cpuid.h  | 4 ++--
>  MdePkg/Include/Register/Intel/ArchitecturalMsr.h | 8 
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/MdePkg/Include/Register/Amd/Cpuid.h
> b/MdePkg/Include/Register/Amd/Cpuid.h
> index add43c40aa..51fa9f235c 100644
> --- a/MdePkg/Include/Register/Amd/Cpuid.h
> +++ b/MdePkg/Include/Register/Amd/Cpuid.h
> @@ -46,9 +46,9 @@ CPUID Signature Information
>CPUID Extended Topology Enumeration
>
>@note
> -  Reference: AMD64 Architecture Programmer’s Manual Volume 3: General-
> Purpose and System Instructions,
> +  Reference: AMD64 Architecture Programmer's Manual Volume 3: General-
> Purpose and System Instructions,
>   Revision 3.35 Appendix E,
> -  E.4.24 Function 8000_0026—Extended CPU Topology:
> +  E.4.24 Function 8000_0026-Extended CPU Topology:
>  CPUID Fn8000_0026 reports extended topology information for logical
> processors, including
>  asymmetric and heterogenous topology descriptions. Individual logical
> processors may report
>  different values in systems with asynchronous and heterogeneous
> topologies.
> diff --git a/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> b/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> index 756e7c86ec..4715c59dc4 100644
> --- a/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> +++ b/MdePkg/Include/Register/Intel/ArchitecturalMsr.h
> @@ -5733,9 +5733,9 @@ typedef union {
>  /// [Bit 7:4] TME Policy/Encryption Algorithm: Only algorithms enumerated
> in
>  /// IA32_TME_CAPABILITY are allowed.
>  /// For example:
> -///    – AES-XTS-128.
> -///   0001 – AES-XTS-128 with integrity.
> -///   0010 – AES-XTS-256.
> +///    - AES-XTS-128.
> +///   0001 - AES-XTS-128 with integrity.
> +///   0010 - AES-XTS-256.
>  ///   Other values are invalid.
>  ///
>  UINT32TmePolicy : 4;
> @@ -5756,7 +5756,7 @@ typedef union {
>  /// Similar to enumeration, this is an encoded value.
>  /// Writing a value greater than MK_TME_MAX_KEYID_BITS will result in
> #GP.
>  /// Writing a non-zero value to this field will #GP if bit 1 of EAX 
> (Hardware
> -/// Encryption Enable) is not also set to ‘1, as encryption hardware 
> must be
> +/// Encryption Enable) is not also set to 1, as encryption hardware must 
> be
>  /// enabled to use MKTME.
>  /// Example: To support 255 keys, this field would be set to a value of 
> 8.
>  ///
> --
> 2.40.0.windows.1



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




Re: [edk2-devel] [RESEND 0/7] AmdPlatformPkg: Adds board independent modules

2024-05-14 Thread Chang, Abner via groups.io
[AMD Official Use Only - AMD Internal Distribution Only]

Already reviewed off-line.
For this patch set, Reviewed-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Wednesday, May 15, 2024 11:50 AM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Grimes, Paul 
> Subject: [RESEND 0/7] AmdPlatformPkg: Adds board independent modules
>
> PR: https://github.com/tianocore/edk2-platforms/pull/141
> Adds various libraries and drivers for AMD Platform.
>
> Cc: Abner Chang 
> Cc: Paul Grimes 
>
> Abdul Lateef Attar (7):
>   AmdPlatformPkg: Adds LogoDxe driver
>   AmdPlatformPkg: Adds BaseAlwaysFalseDepexLib Library
>   AmdPlatformPkg: Implements SerialPortLib for simulator
>   AmdPlatformPkg: Adds PlatformSocLib library class
>   AmdPlatformPkg: Adds AmdConfigRouting driver
>   AmdPlatformPkg: Adds SecureBootDefaultKeysInit driver
>   AmdPlatformPkg: Adds ACPI common driver
>
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dec |   30 +-
>  .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc |   56 +-
>  .../Include/Library/AmdPlatformSocLib.h   |  134 ++
>  .../BaseAlwaysFalseDepexLib.c |   20 +
>  .../BaseAlwaysFalseDepexLib.inf   |   35 +
>  .../BaseAlwaysFalseDepexLib.uni   |   12 +
>  .../DxePlatformSocLib/DxePlatformSocLibNull.c |   75 +
>  .../DxePlatformSocLibNull.inf |   26 +
>  .../DxePlatformSocLibNull.uni |   13 +
>  .../SimulatorSerialPortLibPort80.c|  208 +++
>  .../SimulatorSerialPortLibPort80.inf  |   31 +
>  .../Universal/Acpi/AcpiCommon/AcpiCommon.c|  226 +++
>  .../Universal/Acpi/AcpiCommon/AcpiCommon.h|  118 ++
>  .../Universal/Acpi/AcpiCommon/AcpiCommon.inf  |   74 +
>  .../Universal/Acpi/AcpiCommon/CpuSsdt.c   |  345 
>  .../Universal/Acpi/AcpiCommon/PciSsdt.c   | 1381 +
>  .../Universal/Acpi/AcpiCommon/Spmi.c  |  111 ++
>  .../HiiConfigRouting/AmdConfigRouting.inf |   45 +
>  .../HiiConfigRouting/AmdConfigRoutingEntry.c  |   57 +
>  .../HiiConfigRouting/AmdHiiConfigRouting.c| 1101 +
>  .../HiiConfigRouting/AmdHiiConfigRouting.h|  189 +++
>  .../Universal/LogoDxe/LogoDxe/JpegLogo.idf|   10 +
>  .../Universal/LogoDxe/LogoDxe/JpegLogoDxe.inf |   57 +
>  .../Universal/LogoDxe/LogoDxe/Logo.bmp|  Bin 0 -> 522054 bytes
>  .../Universal/LogoDxe/LogoDxe/Logo.c  |  194 +++
>  .../Universal/LogoDxe/LogoDxe/Logo.h  |   23 +
>  .../Universal/LogoDxe/LogoDxe/Logo.idf|   10 +
>  .../Universal/LogoDxe/LogoDxe/Logo.jpg|  Bin 0 -> 75403 bytes
>  .../Universal/LogoDxe/LogoDxe/LogoDxe.inf |   58 +
>  .../Universal/LogoDxe/LogoDxe/S3Logo.bmp  |  Bin 0 -> 964114 bytes
>  .../Universal/LogoDxe/LogoDxe/S3Logo.idf  |   10 +
>  .../Universal/LogoDxe/LogoDxe/S3LogoDxe.inf   |   57 +
>  .../SecureBootDefaultKeysInit.c   |  645 
>  .../SecureBootDefaultKeysInit.inf |   49 +
>  34 files changed, 5396 insertions(+), 4 deletions(-)
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Include/Library/AmdPlatformSocLib.h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwa
> ysFalseDepexLib.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwa
> ysFalseDepexLib.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwa
> ysFalseDepexLib.uni
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/DxePlatformSocLib/DxePlatformSocL
> ibNull.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/DxePlatformSocLib/DxePlatformSocL
> ibNull.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/DxePlatformSocLib/DxePlatformSocL
> ibNull.uni
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SimulatorSerialPortLibPort80/Simula
> torSerialPortLibPort80.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Library/SimulatorSerialPortLibPort80/Simula
> torSerialPortLibPort80.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/Acpi/AcpiCommon/AcpiCommon.
> c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/Acpi/AcpiCommon/AcpiCommon.
> h
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/Acpi/AcpiCommon/AcpiCommon.
> inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/Acpi/AcpiCommon/CpuSsdt.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/Acpi/AcpiCommon/PciSsdt.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/Acpi/AcpiCommon/Spmi.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/HiiConfigRouting/AmdConfigRou
> ting.inf
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/HiiConfigRouting/AmdConfigRou
> tingEntry.c
>  create mode 100644
> Platform/AMD/AmdPlatformPkg/Universal/HiiConfigRouting/AmdHiiConfigR
> outing.c
>  create mode 100644
> 

Re: [edk2-devel] [edk2-redfish-client][PATCH] Tool/Redfish-Profile-Simulator: fix Werkzeug security issue

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

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Wednesday, May 8, 2024 4:09 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH] Tool/Redfish-Profile-Simulator: fix
> Werkzeug security issue
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Upgrade Werkzeug to version 3.0.3 to address CVE-2024-34069
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py | 7 ---
>  Tools/Redfish-Profile-Simulator/requirements.txt   | 6 ++
>  2 files changed, 6 insertions(+), 7 deletions(-)
>
> diff --git a/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
> b/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
> index 91c792a2b..58697328a 100644
> --- a/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
> +++ b/Tools/Redfish-Profile-Simulator/redfishProfileSimulator.py
> @@ -1,6 +1,7 @@
>  # Copyright Notice:
>  #
>  # Copyright (c) 2019, Intel Corporation. All rights reserved.
> +# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
>  #
>  # Copyright Notice:
> @@ -89,8 +90,8 @@ class
> PreconditionRequired(werkzeug.exceptions.HTTPException):
>
>  def main(argv):
>  #Monkey patch the set_etag() method for conditional request.
> -_old_set_etag = werkzeug.ETagResponseMixin.set_etag
> -@functools.wraps(werkzeug.ETagResponseMixin.set_etag)
> +_old_set_etag = werkzeug.wrappers.Response.set_etag
> +@functools.wraps(werkzeug.wrappers.Response.set_etag)
>  def _new_set_etag(self, etag, weak=False):
>  # only check the first time through; when called twice
>  # we're modifying
> @@ -107,7 +108,7 @@ def main(argv):
>  raise NotModified
>  flask.g.condtnl_etags_start = False
>  _old_set_etag(self, etag, weak)
> -werkzeug.ETagResponseMixin.set_etag = _new_set_etag
> +werkzeug.wrappers.Response.set_etag = _new_set_etag
>
>  # set default option args
>  rf_profile_path = os.path.abspath("./MockupData/SimpleOcpServerV1")
> diff --git a/Tools/Redfish-Profile-Simulator/requirements.txt b/Tools/Redfish-
> Profile-Simulator/requirements.txt
> index 359a81446..83d2d8130 100644
> --- a/Tools/Redfish-Profile-Simulator/requirements.txt
> +++ b/Tools/Redfish-Profile-Simulator/requirements.txt
> @@ -1,5 +1,3 @@
> -Werkzeug==0.16
> -Jinja2==3.0.3
> -itsdangerous==2.0.1
> -flask==1.1.1
> +Werkzeug>=3.0.3
> +flask==3.0.0
>  pyOpenSSL
> --
> 2.34.1



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




Re: [edk2-devel] [PATCH v1 3/6] MdeModulePkg: Adding SpiBus Drivers

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

Hi MdeModulePkg maintainers,
Please review this patch as we would like to merge it before the upcoming hard 
freeze.
Thanks
Abner

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH v1 3/6] MdeModulePkg: Adding SpiBus Drivers
>
> From: Brit Chesley 
>
> Including the SpiBus drivers in MdeModulePkg.dsc
>
> Platform Initialization spec 1.7 volume 5 section 18.1.6
>
> Bugzilla #4753
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/MdeModulePkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc
> index 6bed9205ea69..33d6f4a1f6a6 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -287,6 +287,8 @@ [Components]
>
> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciD
> eviceDxe.inf
>
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
>
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.i
> nf
> +  MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
> +  MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
>
>MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
>MdeModulePkg/Core/Pei/PeiMain.inf
> --
> 2.42.1



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




Re: [edk2-devel] [PATCH v1 6/6] MdeModulePkg: Adding SpiHc Drivers

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

Hi MdeModulePkg maintainers,
Please review this patch as we would like to merge it before the upcoming hard 
freeze.
Thanks
Abner

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH v1 6/6] MdeModulePkg: Adding SpiHc Drivers
>
> From: Brit Chesley 
>
> Including the SpiHc drivers in MdeModulePkg.dsc
>
> Bugzilla #4753
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/MdeModulePkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc
> index 177128bdfd3e..a1c8e2f90524 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -290,6 +290,8 @@ [Components]
>
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.i
> nf
>MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
>MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
> +  MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
> +  MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
>
>MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
>MdeModulePkg/Core/Pei/PeiMain.inf
> --
> 2.42.1



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




Re: [edk2-devel] [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL lib instance

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

Hi MdeModulePkg maintainers,
Please review this patch as we would like to merge it before the upcoming hard 
freeze.
Thanks
Abner

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL
> lib instance
>
> From: Brit Chesley 
>
> Adding NULL SpiHcPlatformLib instance. This library is responsible for
> handling the low level details of the SPI host controller. Since this is
> platform specific this library will be dependent on OEM SPI
> implementation. The SPI host controller layer will utilize this library
> for SPI bus transactions.
>
> Bugzilla #4753
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/MdeModulePkg.dec |   5 +
>  MdeModulePkg/MdeModulePkg.dsc |   2 +
>  .../BaseSpiHcPlatformLibNull.inf  |  33 
>  .../Include/Library/SpiHcPlatformLib.h| 148 ++
>  .../BaseSpiHcPlatformLibNull.c| 145 +
>  .../BaseSpiHcPlatformLibNull.uni  |  11 ++
>  6 files changed, 344 insertions(+)
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> inf
>  create mode 100644 MdeModulePkg/Include/Library/SpiHcPlatformLib.h
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> c
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> uni
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 085370eae41a..8a3bcb9aded1 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -169,6 +169,11 @@ [LibraryClasses]
>#
>ImagePropertiesRecordLib|Include/Library/ImagePropertiesRecordLib.h
>
> +  ##  @libraryclass   Platform SPI Host Controller library which provides 
> low-
> level
> +  #   control over the SPI hardware
> +  #
> +  SpiHcPlatformLib|Include/Library/SpiHcPlatformLib.h
> +
>  [Guids]
>## MdeModule package token space guid
># Include/Guid/MdeModulePkgTokenSpace.h
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc
> index 33d6f4a1f6a6..177128bdfd3e 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -107,6 +107,7 @@ [LibraryClasses]
>
> MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblo
> ckMemoryLibNull.inf
>
> VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV
> ariableFlashInfoLib.inf
>
> IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIp
> miCommandLibNull.inf
> +
> SpiHcPlatformLib|MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpi
> HcPlatformLibNull.inf
>
>  [LibraryClasses.EBC.PEIM]
>IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
> @@ -528,6 +529,7 @@ [Components.IA32, Components.X64]
>
> MdeModulePkg/Library/TraceHubDebugSysTLib/BaseTraceHubDebugSysTLib.i
> nf
>
> MdeModulePkg/Library/TraceHubDebugSysTLib/PeiTraceHubDebugSysTLib.in
> f
>
> MdeModulePkg/Library/TraceHubDebugSysTLib/DxeSmmTraceHubDebugSys
> TLib.inf
> +
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> inf
>
>  [Components.X64]
>MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
> diff --git
> a/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN
> ull.inf
> b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN
> ull.inf
> new file mode 100644
> index ..805f50b89565
> --- /dev/null
> +++
> b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN
> ull.inf
> @@ -0,0 +1,33 @@
> +## @file
> +#  NULL library for platform SPI Host controller, which should be provided
> +#  by the OEM.
> +#
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +##
> +[Defines]
> +  INF_VERSION   = 1.27
> +  BASE_NAME = BaseSpiHcPlatformLibNull
> +  FILE_GUID = 3C230948-6DF5-4802-8177-967A190579CF
> +  MODULE_TYPE   = BASE
> +  VERSION_STRING= 0.1
> +  PI_SPECIFICATION_VERSION  = 0x0001000A
> +  LIBRARY_CLASS = SpiHcPlatformLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +
> +[LibraryClasses]
> +  DevicePathLib
> +  UefiLib
> +
> +[Sources]
> +  BaseSpiHcPlatformLibNull.c
> +
> +[Depex]
> +  TRUE
> +
> +[UserExtensions.TianoCore."ExtraFiles"]
> +  BaseSpiHcPlatformLibNull.uni
> diff --git a/MdeModulePkg/Include/Library/SpiHcPlatformLib.h
> b/MdeModulePkg/Include/Library/SpiHcPlatformLib.h
> new file mode 100644
> index ..c68f7455372c
> --- /dev/null
> +++ 

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: rename x-uefi-redfish to x-UEFI-redfish

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

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Friday, May 3, 2024 9:57 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg: rename x-uefi-redfish
> to x-UEFI-redfish
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Rename x-uefi-redfish to x-UEFI-redfish to match the format of
> UEFI configuration namespace prefix.
>
> RFC: https://edk2.groups.io/g/rfc/message/849
>
> Signed-off-by: Jeff Brasen 
> Co-authored-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../Features/Bios/v1_0_9/Common/BiosCommon.h  |  2 +-
>  .../v1_0_4/Common/BootOptionCommon.h  |  2 +-
>  .../v1_13_0/Common/ComputerSystemCommon.h |  2 +-
>  .../v1_5_0/Common/ComputerSystemCommon.h  |  2 +-
>  .../Memory/V1_7_1/Common/MemoryCommon.h   |  2 +-
>  .../HiiToRedfishBootDxe/HiiToRedfishBootDxe.h |  2 +-
>  .../EdkIIRedfishResourceConfigInternal.h  |  2 +-
>  .../RedfishFeatureUtilityInternal.h   |  2 +-
>  .../HiiToRedfishBootDxe/HiiToRedfishBootDxe.c |  4 +-
>  .../Media/RedfishClientDriverStack.svg|  2 +-
>  .../HiiToRedfishBiosDxeMap.uni| 16 +++---
>  .../HiiToRedfishBootDxeMap.uni| 32 +--
>  .../HiiToRedfishMemoryDxeMap.uni  | 56 +--
>  RedfishClientPkg/Readme.md| 41 +++---
>  14 files changed, 84 insertions(+), 83 deletions(-)
>
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
> index 9a6f9684b..50772d5da 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.h
> @@ -24,7 +24,7 @@
>  #define RESOURCE_SCHEMA_VERSION  "v1_0_9"
>  #define REDPATH_ARRAY_PATTERNL"/Bios/.*"
>  #define REDPATH_ARRAY_PREFIX L"/Bios/"
> -#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-Bios.v1_0_9"
> +#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-Bios.v1_0_9"
>  #define REDFISH_SCHEMA_NAME  "ComputerSystem"
>
>  #endif
> diff --git
> a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCom
> mon.h
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCom
> mon.h
> index 83babf16f..9293d22cd 100644
> ---
> a/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCom
> mon.h
> +++
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Common/BootOptionCom
> mon.h
> @@ -27,7 +27,7 @@
>  #define RESOURCE_SCHEMA_VERSION  "v1_0_4"
>  #define REDPATH_ARRAY_PATTERNL"/BootOptions/\\{.*\\}/"
>  #define REDPATH_ARRAY_PREFIX L"/BootOptions/"
> -#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-BootOption.v1_0_4"
> +#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-
> BootOption.v1_0_4"
>  #define REDFISH_BOOT_OPTION_PARAMETERL"?name="
>  #define REDFISH_BOOT_OPTION_DEBUG_TRACE  DEBUG_INFO
>  #endif
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/Compute
> rSystemCommon.h
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/Compute
> rSystemCommon.h
> index 7b83d2939..b5e3fa919 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/Compute
> rSystemCommon.h
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Common/Compute
> rSystemCommon.h
> @@ -24,6 +24,6 @@
>  #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"
> +#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-
> ComputerSystem.v1_13_0"
>
>  #endif
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer
> SystemCommon.h
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer
> SystemCommon.h
> index a0eb41b8b..24a484d18 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer
> SystemCommon.h
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Common/Computer
> SystemCommon.h
> @@ -22,6 +22,6 @@
>  #define RESOURCE_SCHEMA_VERSION  "v1_5_0"
>  #define REDPATH_ARRAY_PATTERNL"/Systems/\\{.*\\}/"
>  #define REDPATH_ARRAY_PREFIX L"/Systems/"
> -#define RESOURCE_SCHEMA_FULL "x-uefi-redfish-
> ComputerSystem.v1_5_0"
> +#define RESOURCE_SCHEMA_FULL "x-UEFI-redfish-
> ComputerSystem.v1_5_0"
>
>  #endif
> diff --git
> a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.
> h
> b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.
> h
> index c857868ea..2120dc0e4 100644
> ---
> a/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.
> h
> +++
> b/RedfishClientPkg/Features/Memory/V1_7_1/Common/MemoryCommon.
> h
> @@ 

Re: [edk2-devel] [PATCH] RedfishPkg: Rename x-uefi-redfish to x-UEFI-redfish

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

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Friday, May 3, 2024 9:56 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [PATCH] RedfishPkg: Rename x-uefi-redfish to x-UEFI-redfish
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Rename x-uefi-redfish to x-UEFI-redfish to match the format of
> UEFI configuration namespace prefix.
>
> RFC: https://edk2.groups.io/g/rfc/message/849
>
> Signed-off-by: Jeff Brasen 
> Co-authored-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  RedfishPkg/RedfishPkg.dec |  6 +-
>  .../Library/RedfishPlatformConfigLib.h|  4 +-
>  .../Protocol/EdkIIRedfishPlatformConfig.h |  4 +-
>  .../RedfishPlatformConfigDxe.h|  2 +-
>  .../RedfishPlatformConfigImpl.h   | 16 ++--
>  .../RedfishPlatformConfigLib.c|  4 +-
>  .../RedfishPlatformConfigDxe.c|  4 +-
>  .../RedfishPlatformConfigImpl.c   | 86 +--
>  8 files changed, 63 insertions(+), 63 deletions(-)
>
> diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
> index c048e43f53..54318527fe 100644
> --- a/RedfishPkg/RedfishPkg.dec
> +++ b/RedfishPkg/RedfishPkg.dec
> @@ -195,10 +195,10 @@
>
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x000
> 01012
>#
># Redfish RedfishPlatformConfigDxe Debug Properties
> -  #   0x0001  x-uefi-redfish string database message enabled
> +  #   0x0001  x-UEFI-redfish string database message enabled
>#   0x0002  Debug Message for dumping formset
> -  #   0x0004  Debug Message for x-uefi-redfish searching result
> -  #   0x0008  Debug Message for x-uefi-redfish Regular Expression
> searching result
> +  #   0x0004  Debug Message for x-UEFI-redfish searching result
> +  #   0x0008  Debug Message for x-UEFI-redfish Regular Expression
> searching result
>#
>
> gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|
> UINT32|0x1013
>#
> diff --git a/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
> b/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
> index 51a1861639..b6e60635ea 100644
> --- a/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
> +++ b/RedfishPkg/Include/Library/RedfishPlatformConfigLib.h
> @@ -2,7 +2,7 @@
>Definitions of RedfishPlatformConfigLib
>
>(C) Copyright 2021 Hewlett Packard Enterprise Development LP
> -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -82,7 +82,7 @@ RedfishPlatformConfigGetConfigureLang (
>Get the list of supported Redfish schema from platform configuration.
>
>@param[out]  SupportedSchema The supported schema list which is
> separated by ';'.
> -   For example: 
> "x-uefi-redfish-Memory.v1_7_1;x-uefi-
> redfish-Boot.v1_0_1"
> +   For example: 
> "x-UEFI-redfish-Memory.v1_7_1;x-UEFI-
> redfish-Boot.v1_0_1"
> The SupportedSchema is allocated by the 
> callee. It's caller's
> responsibility to free this buffer using 
> FreePool().
>
> diff --git a/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
> b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
> index d20b2c980e..a1d5592c7e 100644
> --- a/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
> +++ b/RedfishPkg/Include/Protocol/EdkIIRedfishPlatformConfig.h
> @@ -2,7 +2,7 @@
>This file defines the EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL
> interface.
>
>(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -227,7 +227,7 @@ EFI_STATUS
>
>@param[in]   ThisPointer to
> EDKII_REDFISH_PLATFORM_CONFIG_PROTOCOL instance.
>@param[out]  SupportedSchema The supported schema list which is
> separated by ';'.
> -   For example: 
> "x-uefi-redfish-Memory.v1_7_1;x-uefi-
> redfish-Boot.v1_0_1"
> +   For example: 
> "x-UEFI-redfish-Memory.v1_7_1;x-UEFI-
> redfish-Boot.v1_0_1"
> The SupportedSchema is allocated by the 
> callee. It's caller's
> responsibility to free this buffer using 
> FreePool().
>
> diff --git
> a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
> 

Re: [edk2-devel] [PATCH v1 6/6] MdeModulePkg: Adding SpiHc Drivers

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

Acked-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH v1 6/6] MdeModulePkg: Adding SpiHc Drivers
>
> From: Brit Chesley 
>
> Including the SpiHc drivers in MdeModulePkg.dsc
>
> Bugzilla #4753
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/MdeModulePkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc
> index 177128bdfd3e..a1c8e2f90524 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -290,6 +290,8 @@ [Components]
>
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.i
> nf
>MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
>MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
> +  MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
> +  MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
>
>MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
>MdeModulePkg/Core/Pei/PeiMain.inf
> --
> 2.42.1



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




Re: [edk2-devel] [PATCH v1 5/6] MdeModulePkg: SpiHc: SpiHc Drivers

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

We had reviewed this patch internally before sending this to community.
Reviewed-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> Lateef) 
> Subject: [PATCH v1 5/6] MdeModulePkg: SpiHc: SpiHc Drivers
>
> From: Brit Chesley 
>
> Added SpiHc DXE and SMM drivers. This code receives bus transactions
> from the SpiBus layer and passes them onto the SpiHcPlatformLib
>
> Platform Initialization Spec 1.7 volume 5 section 18.1.7
>
> Bugzilla #4753
>
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf |  47 ++
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf |  45 +
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h  | 117
> 
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHc.c  | 115
> +++
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.c   | 101 
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.c   |  79 
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHc.uni|  10 ++
>  7 files changed, 514 insertions(+)
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHc.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHc.uni
>
> diff --git a/MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
> b/MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
> new file mode 100644
> index ..b71f1535cd46
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
> @@ -0,0 +1,47 @@
> +## @file
> +#  The SPI Host Controller Module DXE driver INF file
> +#
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION   = 1.27
> +  BASE_NAME = SpiHcDxe
> +  FILE_GUID = 95D148FF-5A23-43B9-9FC4-80AE0DD48D32
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 0.1
> +  PI_SPECIFICATION_VERSION  = 0x0001000A
> +  ENTRY_POINT   = SpiHcProtocolEntry
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  BaseMemoryLib
> +  DebugLib
> +  DevicePathLib
> +  MemoryAllocationLib
> +  SpiHcPlatformLib
> +  UefiBootServicesTableLib
> +  UefiDriverEntryPoint
> +  UefiLib
> +  UefiRuntimeServicesTableLib
> +
> +[Sources]
> +  SpiHc.h
> +  SpiHc.c
> +  SpiHcDxe.c
> +
> +[Protocols]
> +  gEfiSpiHcProtocolGuid
> +
> +[Depex]
> +  TRUE
> +
> +[UserExtensions.TianoCore."ExtraFiles"]
> +  SpiHc.uni
> diff --git a/MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
> b/MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
> new file mode 100644
> index ..95d5466d904b
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
> @@ -0,0 +1,45 @@
> +## @file
> +#  The SPI Host Controller Module SMM driver INF file
> +#
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION   = 1.27
> +  BASE_NAME = SpiHcSmm
> +  FILE_GUID = 0CDAE298-CB3B-480A-BDC4-A6840FFE1F5E
> +  MODULE_TYPE   = DXE_SMM_DRIVER
> +  VERSION_STRING= 0.1
> +  PI_SPECIFICATION_VERSION  = 0x0001000A
> +  ENTRY_POINT   = SpiHcProtocolEntry
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  BaseMemoryLib
> +  DebugLib
> +  MemoryAllocationLib
> +  MmServicesTableLib
> +  SpiHcPlatformLib
> +  UefiDriverEntryPoint
> +  UefiLib
> +
> +[Sources]
> +  SpiHc.h
> +  SpiHc.c
> +  SpiHcSmm.c
> +
> +[Protocols]
> +  gEfiSpiSmmHcProtocolGuid
> +
> +[Depex]
> +  TRUE
> +
> +[UserExtensions.TianoCore."ExtraFiles"]
> +  SpiHc.uni
> diff --git a/MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h
> b/MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h
> new file mode 100644
> index ..c6e4c5893d53
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h
> @@ -0,0 +1,117 @@
> +/** @file
> +
> +  SPI Host Controller function declarations
> +
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef SPI_HC_H_
> +#define SPI_HC_H_
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +/**
> +  Assert or deassert the SPI chip select.
> +
> +  This routine is called at TPL_NOTIFY.
> +  Update the value of the chip select line for a SPI peripheral. The SPI bus
> +  layer calls this routine either in the board layer or in the SPI 

Re: [edk2-devel] [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL lib instance

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

Acked-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH v1 4/6] MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL
> lib instance
>
> From: Brit Chesley 
>
> Adding NULL SpiHcPlatformLib instance. This library is responsible for
> handling the low level details of the SPI host controller. Since this is
> platform specific this library will be dependent on OEM SPI
> implementation. The SPI host controller layer will utilize this library
> for SPI bus transactions.
>
> Bugzilla #4753
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/MdeModulePkg.dec |   5 +
>  MdeModulePkg/MdeModulePkg.dsc |   2 +
>  .../BaseSpiHcPlatformLibNull.inf  |  33 
>  .../Include/Library/SpiHcPlatformLib.h| 148 ++
>  .../BaseSpiHcPlatformLibNull.c| 145 +
>  .../BaseSpiHcPlatformLibNull.uni  |  11 ++
>  6 files changed, 344 insertions(+)
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> inf
>  create mode 100644 MdeModulePkg/Include/Library/SpiHcPlatformLib.h
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> c
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> uni
>
> diff --git a/MdeModulePkg/MdeModulePkg.dec
> b/MdeModulePkg/MdeModulePkg.dec
> index 085370eae41a..8a3bcb9aded1 100644
> --- a/MdeModulePkg/MdeModulePkg.dec
> +++ b/MdeModulePkg/MdeModulePkg.dec
> @@ -169,6 +169,11 @@ [LibraryClasses]
>#
>ImagePropertiesRecordLib|Include/Library/ImagePropertiesRecordLib.h
>
> +  ##  @libraryclass   Platform SPI Host Controller library which provides 
> low-
> level
> +  #   control over the SPI hardware
> +  #
> +  SpiHcPlatformLib|Include/Library/SpiHcPlatformLib.h
> +
>  [Guids]
>## MdeModule package token space guid
># Include/Guid/MdeModulePkgTokenSpace.h
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc
> index 33d6f4a1f6a6..177128bdfd3e 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -107,6 +107,7 @@ [LibraryClasses]
>
> MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblo
> ckMemoryLibNull.inf
>
> VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV
> ariableFlashInfoLib.inf
>
> IpmiCommandLib|MdeModulePkg/Library/BaseIpmiCommandLibNull/BaseIp
> miCommandLibNull.inf
> +
> SpiHcPlatformLib|MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpi
> HcPlatformLibNull.inf
>
>  [LibraryClasses.EBC.PEIM]
>IoLib|MdePkg/Library/PeiIoLibCpuIo/PeiIoLibCpuIo.inf
> @@ -528,6 +529,7 @@ [Components.IA32, Components.X64]
>
> MdeModulePkg/Library/TraceHubDebugSysTLib/BaseTraceHubDebugSysTLib.i
> nf
>
> MdeModulePkg/Library/TraceHubDebugSysTLib/PeiTraceHubDebugSysTLib.in
> f
>
> MdeModulePkg/Library/TraceHubDebugSysTLib/DxeSmmTraceHubDebugSys
> TLib.inf
> +
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> inf
>
>  [Components.X64]
>MdeModulePkg/Universal/CapsulePei/CapsuleX64.inf
> diff --git
> a/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN
> ull.inf
> b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN
> ull.inf
> new file mode 100644
> index ..805f50b89565
> --- /dev/null
> +++
> b/MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibN
> ull.inf
> @@ -0,0 +1,33 @@
> +## @file
> +#  NULL library for platform SPI Host controller, which should be provided
> +#  by the OEM.
> +#
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +##
> +[Defines]
> +  INF_VERSION   = 1.27
> +  BASE_NAME = BaseSpiHcPlatformLibNull
> +  FILE_GUID = 3C230948-6DF5-4802-8177-967A190579CF
> +  MODULE_TYPE   = BASE
> +  VERSION_STRING= 0.1
> +  PI_SPECIFICATION_VERSION  = 0x0001000A
> +  LIBRARY_CLASS = SpiHcPlatformLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +
> +[LibraryClasses]
> +  DevicePathLib
> +  UefiLib
> +
> +[Sources]
> +  BaseSpiHcPlatformLibNull.c
> +
> +[Depex]
> +  TRUE
> +
> +[UserExtensions.TianoCore."ExtraFiles"]
> +  BaseSpiHcPlatformLibNull.uni
> diff --git a/MdeModulePkg/Include/Library/SpiHcPlatformLib.h
> b/MdeModulePkg/Include/Library/SpiHcPlatformLib.h
> new file mode 100644
> index ..c68f7455372c
> --- /dev/null
> +++ b/MdeModulePkg/Include/Library/SpiHcPlatformLib.h
> @@ -0,0 +1,148 @@
> +/** @file
> +
> +  Function declarations for SpiHcPlatformLib
> +
> +  Copyright 

Re: [edk2-devel] [PATCH v1 3/6] MdeModulePkg: Adding SpiBus Drivers

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

Acked-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH v1 3/6] MdeModulePkg: Adding SpiBus Drivers
>
> From: Brit Chesley 
>
> Including the SpiBus drivers in MdeModulePkg.dsc
>
> Platform Initialization spec 1.7 volume 5 section 18.1.6
>
> Bugzilla #4753
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/MdeModulePkg.dsc | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/MdeModulePkg/MdeModulePkg.dsc
> b/MdeModulePkg/MdeModulePkg.dsc
> index 6bed9205ea69..33d6f4a1f6a6 100644
> --- a/MdeModulePkg/MdeModulePkg.dsc
> +++ b/MdeModulePkg/MdeModulePkg.dsc
> @@ -287,6 +287,8 @@ [Components]
>
> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciD
> eviceDxe.inf
>
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
>
> MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.i
> nf
> +  MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
> +  MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
>
>MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
>MdeModulePkg/Core/Pei/PeiMain.inf
> --
> 2.42.1



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




Re: [edk2-devel] [PATCH v1 2/6] MdeModulePkg/Bus/Spi/SpiBus: Adding SpiBus Drivers

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

We had reviewed this patch internally before sending this to community.
Reviewed-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> Lateef) 
> Subject: [PATCH v1 2/6] MdeModulePkg/Bus/Spi/SpiBus: Adding SpiBus
> Drivers
>
> From: Brit Chesley 
>
> Added SpiBus DXE and SMM drivers. This code translates SPI requests from
> the application layer into SPI Bus transactions on the SPI host
> controller. The code is responsible for checking if the transaction is
> valid, then setting up the SPI clock and chip select properly before
> passing the bus transaction to the host controller.
>
> Platform Initialization Spec 1.7 volume 5 section 18.1.6
>
> Bugzilla #4753
>
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf |  41 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf |  41 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h  | 167 +
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBus.c  | 433
> ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.c   | 198 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.c   | 162 
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBus.uni|  10 +
>  7 files changed, 1052 insertions(+)
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBus.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBus.uni
>
> diff --git a/MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
> b/MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
> new file mode 100644
> index ..3e2cc2daba1c
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
> @@ -0,0 +1,41 @@
> +## @file
> +#  Component description for the SPI BUS DXE module
> +#
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +[Defines]
> +  INF_VERSION   = 1.27
> +  BASE_NAME = SpiBusDxe
> +  FILE_GUID = 25CE038C-5C3A-4A9B-A111-90DF5897E058
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 0.1
> +  PI_SPECIFICATION_VERSION  = 0x0001000A
> +  ENTRY_POINT   = SpiBusEntry
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  DevicePathLib
> +  MemoryAllocationLib
> +  UefiBootServicesTableLib
> +  UefiDriverEntryPoint
> +
> +[Sources]
> +  SpiBusDxe.c
> +  SpiBus.c
> +  SpiBus.h
> +
> +[Protocols]
> +  gEfiSpiConfigurationProtocolGuid  ## CONSUMES
> +  gEfiSpiHcProtocolGuid ## CONSUMES
> +
> +[Depex]
> +  gEfiSpiConfigurationProtocolGuid AND
> +  gEfiSpiHcProtocolGuid
> +
> +[UserExtensions.TianoCore."ExtraFiles"]
> +  SpiBus.uni
> diff --git a/MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
> b/MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
> new file mode 100644
> index ..9e3a5aae7d87
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
> @@ -0,0 +1,41 @@
> +## @file
> +#  Component description for the SPI BUS SMM module
> +#
> +#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +[Defines]
> +  INF_VERSION   = 1.27
> +  BASE_NAME = SpiBusSmm
> +  FILE_GUID = 5DBB52E1-3D78-4C9C-A9D7-A43E79E93AC0
> +  MODULE_TYPE   = DXE_SMM_DRIVER
> +  VERSION_STRING= 0.1
> +  PI_SPECIFICATION_VERSION  = 0x0001000A
> +  ENTRY_POINT   = SpiBusEntry
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +
> +[LibraryClasses]
> +  DebugLib
> +  DevicePathLib
> +  MemoryAllocationLib
> +  MmServicesTableLib
> +  UefiDriverEntryPoint
> +
> +[Sources]
> +  SpiBus.h
> +  SpiBus.c
> +  SpiBusSmm.c
> +
> +[Protocols]
> +  gEfiSpiSmmConfigurationProtocolGuid   ## CONSUMES
> +  gEfiSpiSmmHcProtocolGuid  ## CONSUMES
> +
> +[Depex]
> +  gEfiSpiSmmConfigurationProtocolGuid AND
> +  gEfiSpiSmmHcProtocolGuid
> +
> +[UserExtensions.TianoCore."ExtraFiles"]
> +  SpiBus.uni
> diff --git a/MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h
> b/MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h
> new file mode 100644
> index ..7a43f66ac750
> --- /dev/null
> +++ b/MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h
> @@ -0,0 +1,167 @@
> +/** @file
> +
> +  SPI bus driver
> +
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef SPI_BUS_H_
> +#define SPI_BUS_H_
> +
> +#include 
> +#include 
> +#include 
> 

Re: [edk2-devel] [PATCH v1 1/6] MdePkg/SpiConfiguration: Correct the definition spelling

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

Reviewed-by: Abner Chang 

> -Original Message-
> From: Chesley, Brit 
> Sent: Thursday, May 2, 2024 3:05 AM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Attar, AbdulLateef (Abdul
> Lateef) 
> Subject: [PATCH v1 1/6] MdePkg/SpiConfiguration: Correct the definition
> spelling
>
> From: Abner Chang 
>
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Signed-off-by: Brit Chesley 
> ---
>  MdePkg/Include/Protocol/SpiConfiguration.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h
> b/MdePkg/Include/Protocol/SpiConfiguration.h
> index 120b54bbad8e..cd7c1dd71ee9 100644
> --- a/MdePkg/Include/Protocol/SpiConfiguration.h
> +++ b/MdePkg/Include/Protocol/SpiConfiguration.h
> @@ -173,8 +173,8 @@ typedef struct _EFI_SPI_BUS {
>  /// Definitions of SPI Part Attributes.
>  ///
>  #define SPI_PART_SUPPORTS_2_BIT_DATA_BUS_WIDTH  BIT0
> -#define SPI_PART_SUPPORTS_4_B1T_DATA_BUS_WIDTH  BIT1
> -#define SPI_PART_SUPPORTS_8_B1T_DATA_BUS_WIDTH  BIT2
> +#define SPI_PART_SUPPORTS_4_BIT_DATA_BUS_WIDTH  BIT1
> +#define SPI_PART_SUPPORTS_8_BIT_DATA_BUS_WIDTH  BIT2
>
>  ///
>  /// The EFI_SPI_PERIPHERAL data structure describes how a specific block of
> --
> 2.42.1



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




Re: [edk2-devel] [PATCH 0/5] SPI Driver Stack

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

Hi Brit,
We have to fix the CI failure.

Thanks
Abner

> -Original Message-
> From: Chesley, Brit 
> Sent: Tuesday, April 30, 2024 10:06 PM
> To: devel@edk2.groups.io
> Cc: Liming Gao ; Ray Ni ;
> Chang, Abner ; Attar, AbdulLateef (Abdul Lateef)
> 
> Subject: [PATCH 0/5] SPI Driver Stack
>
> From: Brit Chesley 
>
> This patchset introduces the SPI driver stack as defined in the Platform
> Initialization specification Volume 5 chapter 18 (DXE) and Volume 4 chapter
> 12 (SMM). The SPI stack decouples the SPI chip details from the SPI
> controller and SPI bus configuration details to enable silicon vendors
> to write drivers effectively. This patchset also introduces the
> SpiHcPlatformLib, which allows for OEMs to handle low level SPI host
> controller details while using the generic SPI bus/hc drivers.
>
> https://github.com/BritChesley/edk2/tree/SpiBusStack
>
> Cc: Liming Gao 
> Cc: Ray Ni 
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
>
> Brit Chesley (5):
>   MdeModulePkg/Bus/Spi/SpiBus: Adding SpiBus Drivers
>   MdeModulePkg: Adding SpiBus Drivers
>   MdeModulePkg:BaseSpiHcPlatformLib: Adding NULL lib instance
>   MdeModulePkg: SpiHc: SpiHc Drivers
>   MdeModulePkg: Adding SpiHc Drivers
>
>  MdeModulePkg/MdeModulePkg.dec |   5 +
>  MdeModulePkg/MdeModulePkg.dsc |   5 +
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf |  42 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf |  42 ++
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf   |  46 ++
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf   |  44 ++
>  .../BaseSpiHcPlatformLibNull.inf  |  35 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h  | 167 +++
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h| 111 +
>  .../Include/Library/SpiHcPlatformLib.h| 148 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBus.c  | 433 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.c   | 198 
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.c   | 162 +++
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHc.c| 115 +
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.c | 101 
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.c |  79 
>  .../BaseSpiHcPlatformLibNull.c| 145 ++
>  MdeModulePkg/Bus/Spi/SpiBus/SpiBus.uni|  10 +
>  MdeModulePkg/Bus/Spi/SpiHc/SpiHc.uni  |  10 +
>  .../BaseSpiHcPlatformLibNull.uni  |  11 +
>  20 files changed, 1909 insertions(+)
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.inf
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> inf
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBus.h
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHc.h
>  create mode 100644 MdeModulePkg/Include/Library/SpiHcPlatformLib.h
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBus.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusDxe.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBusSmm.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHc.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcDxe.c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHcSmm.c
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> c
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiBus/SpiBus.uni
>  create mode 100644 MdeModulePkg/Bus/Spi/SpiHc/SpiHc.uni
>  create mode 100644
> MdeModulePkg/Library/BaseSpiHcPlatformLibNull/BaseSpiHcPlatformLibNull.
> uni
>
> --
> 2.42.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118454): https://edk2.groups.io/g/devel/message/118454
Mute This Topic: https://groups.io/mt/105821487/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] ManageabilityPkg: Remove the dependency with MinPlatform

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

Thanks for reviewing this, the change is merged.

Abner

From: Attar, AbdulLateef (Abdul Lateef) 
Sent: Tuesday, April 30, 2024 3:36 PM
To: Chang, Abner ; devel@edk2.groups.io
Cc: Nickle Wang 
Subject: Re: [edk2-platforms][PATCH] ManageabilityPkg: Remove the dependency 
with MinPlatform


Reviewed-by: Abdul Lateef Attar 

On 29-04-2024 10:31, abner.ch...@amd.com wrote:

From: Abner Chang 



BZ# 4695



Signed-off-by: Abner Chang 

Cc: Abdul Lateef Attar 


Cc: Nickle Wang 

---

 .../ManageabilityPkg/ManageabilityPkg.dsc | 72 ++-

 1 file changed, 56 insertions(+), 16 deletions(-)



diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc

index 87b32f1182..8608450a3b 100644

--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc

+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc

@@ -3,7 +3,7 @@

 # This is the package provides edk2 drivers and libraries

 # those are related to the platform management.

 #

-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.

+# Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.

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

 #

 ##

@@ -18,15 +18,7 @@

   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT

   SKUID_IDENTIFIER   = DEFAULT



-[Packages]

-  MinPlatformPkg/MinPlatformPkg.dec

-

 [PcdsFeatureFlag]

-  #

-  # MinPlatform common include currently required PCD

-  #

-  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE

-  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE



   #

   # Manageability modules

@@ -45,19 +37,67 @@

   gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmiFrb 
|TRUE

   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi 
|TRUE



-#

-# Include common libraries

-#

-!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc

-!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc

-!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc

-

 [Components]

   
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf

   
ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/DxeManageabilityTransportMctp.inf

   ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf

   ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf



+  #

+  # Generic EDKII Lib

+  #

+

+!include MdePkg/MdeLibs.dsc.inc

+

+[LibraryClasses.common]

+

+  #

+  # Entry point

+  #

+  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf

+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf

+  #

+  # Basic

+  #

+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf

+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf

+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf

+  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf

+  #

+  # UEFI & PI

+  #

+  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf

+  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf

+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf

+  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf

+  
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf

+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf

+  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf

+  
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf

+  #

+  # Misc

+  #

+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf

+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf

+  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf

+  
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf

+  
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf

+  
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf

+

+[LibraryClasses.common.DXE_SMM_DRIVER]

+  
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf

+  MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf

+  
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf

+  
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf

+

+[LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE, 
LibraryClasses.common.PEIM]

+  

[edk2-devel] [edk2-platforms][PATCH] ManageabilityPkg: Remove the dependency with MinPlatform

2024-04-28 Thread Chang, Abner via groups.io
From: Abner Chang 

BZ# 4695

Signed-off-by: Abner Chang 
Cc: Abdul Lateef Attar 
Cc: Nickle Wang 
---
 .../ManageabilityPkg/ManageabilityPkg.dsc | 72 ++-
 1 file changed, 56 insertions(+), 16 deletions(-)

diff --git a/Features/ManageabilityPkg/ManageabilityPkg.dsc 
b/Features/ManageabilityPkg/ManageabilityPkg.dsc
index 87b32f1182..8608450a3b 100644
--- a/Features/ManageabilityPkg/ManageabilityPkg.dsc
+++ b/Features/ManageabilityPkg/ManageabilityPkg.dsc
@@ -3,7 +3,7 @@
 # This is the package provides edk2 drivers and libraries
 # those are related to the platform management.
 #
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2023-2024 Advanced Micro Devices, Inc. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -18,15 +18,7 @@
   BUILD_TARGETS  = DEBUG|RELEASE|NOOPT
   SKUID_IDENTIFIER   = DEFAULT
 
-[Packages]
-  MinPlatformPkg/MinPlatformPkg.dec
-
 [PcdsFeatureFlag]
-  #
-  # MinPlatform common include currently required PCD
-  #
-  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable   
|FALSE
-  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable  
|FALSE
 
   #
   # Manageability modules
@@ -45,19 +37,67 @@
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmiFrb 
|TRUE
   gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiBmcAcpi 
|TRUE
 
-#
-# Include common libraries
-#
-!include MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
-!include MinPlatformPkg/Include/Dsc/CorePeiLib.dsc
-!include MinPlatformPkg/Include/Dsc/CoreDxeLib.dsc
-
 [Components]
   
ManageabilityPkg/Library/ManageabilityTransportKcsLib/Dxe/DxeManageabilityTransportKcs.inf
   
ManageabilityPkg/Library/ManageabilityTransportMctpLib/Dxe/DxeManageabilityTransportMctp.inf
   ManageabilityPkg/Library/PldmProtocolLibrary/Dxe/PldmProtocolLib.inf
   ManageabilityPkg/Library/IpmiCommandLib/IpmiCommandLib.inf
 
+  #
+  # Generic EDKII Lib
+  #
+
+!include MdePkg/MdeLibs.dsc.inc
+
+[LibraryClasses.common]
+
+  #
+  # Entry point
+  #
+  
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
+  PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf
+  #
+  # Basic
+  #
+  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
+  BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
+  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
+  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
+  #
+  # UEFI & PI
+  #
+  
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
+  
UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
+  UefiLib|MdePkg/Library/UefiLib/UefiLib.inf
+  
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/PeiServicesTablePointerLibIdt.inf
+  PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+  DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
+  
DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
+  #
+  # Misc
+  #
+  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+  PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
+  
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
+  
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
+  
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
+
+[LibraryClasses.common.DXE_SMM_DRIVER]
+  
SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
+  MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
+  
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
+
+[LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE, 
LibraryClasses.common.PEIM]
+  
S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf
+  PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+  HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
+  
MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf
+  
ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLibBase.inf
+
 [LibraryClasses]
   
ManageabilityTransportLib|ManageabilityPkg/Library/BaseManageabilityTransportNullLib/BaseManageabilityTransportNull.inf
   IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
-- 
2.37.1.windows.1



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

Re: [edk2-devel] [edk2-redfish-client][PATCH] RedfishClientPkg: introduce RedfishBootstrapAccountDxe

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

> -Original Message-
> From: Nickle Wang 
> Sent: Tuesday, April 23, 2024 3:09 PM
> To: Igor Kulchytskyy ; Chang, Abner
> ; devel@edk2.groups.io
> Cc: Nick Ramirez 
> Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> introduce RedfishBootstrapAccountDxe
>
> [AMD Official Use Only - General]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Igor, Abner,
>
> Thanks for your review. Please allow me to answer your questions together.
>
> > 1. We suppose acquire the credential before we start to communicate with
> Redfish. Will Redfish credential driver create another bootstrap account here
> after provisioning?
> No, according to the RedfishPlatformCredentialIpmiLib implementation,
> Redfish credential driver requests credential from BMC and will keep it for 
> later
> use. So only one credential is requested for BIOS Redfish feature drivers 
> during
> POST time.
Ok, then I don't have the problem with invoking GetAuthInfo again. However, I 
will suggest to add more description in GetAuthInfo function header, mention 
that we will keep the auth info in EFI variable until exist boot service.
Also, give some more descriptions on the code you invoke to GetAuthInfo.

>
> > 2. And why do we delete the credential after provisioning? How about the
> later Redfish property updating process?
> In this driver, we listen to "AfterProvisioning" event. And this is the event
> triggered after Redfish feature driver finish all jobs. There is no feature 
> driver
> which gets executed after this event. And since we finished all Redfish
> operations, we remove this account on BMC.
Then this makes sense to me now.

>
> > Why do we need to delete those credentials? According to spec BMC should
> delete the bootstrap credentials automatically on host or service reset.
> Yes, bootstrap credentials get deleted on host reset. In practice, server in
> datacenter usually takes long time running under OS before it gets rebooted.
> The bootstrap credentials are exposed to end user at
> "/redfish/v1/AccountService/Accounts". I got report that there is concern for
> end user to see this unused account.
This sounds to me reasonable as we will give bootstrap credential a high 
privilege to update Redfish resource. Leave this information in Account service 
seems not a good idea.

Thanks
Abner

>
> So, I create this driver to allows us to remove bootstrap account at BMC after
> we finish Redfish jobs. And this also release the BMC account resource since
> this account won't be used for a long period of time.
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: Igor Kulchytskyy 
> > Sent: Monday, April 22, 2024 11:03 PM
> > To: Chang, Abner ; Nickle Wang
> > ; devel@edk2.groups.io
> > Cc: Nick Ramirez 
> > Subject: RE: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> > introduce RedfishBootstrapAccountDxe
> >
> > External email: Use caution opening links or attachments
> >
> >
> > Hi Nickle and Abner,
> > I also have the same question as Abner.
> > Why do we need to delete those credentials?
> > According to spec BMC should delete the bootstrap credentials automatically
> on
> > host or service reset.
> > Thank you,
> > Igor
> >
> > -Original Message-
> > From: Chang, Abner 
> > Sent: Sunday, April 21, 2024 10:25 PM
> > To: Nickle Wang ; devel@edk2.groups.io
> > Cc: Igor Kulchytskyy ; Nick Ramirez
> 
> > Subject: [EXTERNAL] RE: [edk2-redfish-client][PATCH] RedfishClientPkg:
> > introduce RedfishBootstrapAccountDxe
> >
> >
> > **CAUTION: The e-mail below is from an external source. Please exercise
> > caution before opening attachments, clicking links, or following guidance.**
> >
> > [AMD Official Use Only - General]
> >
> > Hi Nickle,
> > One comment and few questions,
> >
> > > -Original Message-
> > > From: Nickle Wang 
> > > Sent: Thursday, April 18, 2024 8:28 PM
> > > To: devel@edk2.groups.io
> > > Cc: Chang, Abner ; Igor Kulchytskyy
> > > ; Nick Ramirez 
> > > Subject: [edk2-redfish-client][PATCH] RedfishClientPkg: introduce
> > > RedfishBootstrapAccountDxe
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > -Introduce RedfishBootstrapAccountDxe to delete bootstrap account from
> > > /redfish/v1/AccountService/Accounts after BIOS finished all Redfish
> > > jobs. The bootstrap account won't be available to other application.
> > > So deleting bootstrap account helps to release resource at BMC.
> > > - After bootstrap account is deleted at BMC, the Redfish service
> > > instance is no longer usable. Close Redfish service instance to
> > > release the HTTP connection between BIOS and BMC.
> > >
> > > Signed-off-by: Nickle Wang 
> > > Cc: Abner Chang 
> > > Cc: Igor Kulchytskyy 
> > > Cc: Nick Ramirez 
> > > ---
> > 

Re: [edk2-devel] [PATCH RESEND v1] MdePkg: Adds a PCD to define IPMI interface type

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

Hi Sean,
I was struggling when introduce IPMI KCS base IO PCD in Mde, although it is a  
industry value but seems it is fine to have it in ManageabilityPkg. How do you 
think if we relocate those IPMI PCDs back to ManageabilityPkg?

Thanks
Abner


From: Sean Brogan 
Sent: Tuesday, April 23, 2024 4:18 AM
To: devel@edk2.groups.io; Attar, AbdulLateef (Abdul Lateef) 
; Liming Gao ; Michael D 
Kinney ; Zhiguang Liu 
Cc: Chang, Abner ; Chris Fernald 

Subject: Re: [edk2-devel] [PATCH RESEND v1] MdePkg: Adds a PCD to define IPMI 
interface type

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


This seems like a bad design to require the ipmi interface type at such a high 
level in the code tree.  UEFI provides plenty protocol and library abstractions 
for IPMI so I would really prefer not to leak this type of information into a 
PCD defined in MdePkg.  Happy to discuss IPMI support and I would really like 
to see edk2, edk2-platforms/Features/ManageabilityPkg at master · 
tianocore/edk2-platforms 
(github.com),
  microsoft/mu_feature_ipmi: Project Mu - Feature Repo- Firmware support for 
IPMI (github.com), and commercial 
vendors find some sort of alignment going forward as no one wins with the mess 
that is in the industry now.

Thanks

Sean


On 4/22/2024 3:50 AM, Abdul Lateef Attar via groups.io wrote:
Gentle reminder, review please.

On 30-03-2024 10:52, Abdul Lateef Attar wrote:

Define IPMI interface type as per specification version 2.0,
section C1-1.1.

Cc: Abner Chang 
Cc: Michael D Kinney 

Cc: Liming Gao 
Cc: Zhiguang Liu 
Signed-off-by: Abdul Lateef Attar 

---
  MdePkg/MdePkg.dec | 11 ++-
  1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 0c18e1decd..396d960dca 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -9,7 +9,7 @@
  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
  # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights 
reserved.
  # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights 
reserved.
  # Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
  #
  # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -2401,6 +2401,15 @@
# @Prompt Time-out for a response, internal

gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond|6|UINT32|0x0036
  +  ## Indicates IPMI Interface Type
+  # The IPMI specification defines the following interface types: (section 
C1-1.1)
+  # 0 - Unknown
+  # 1 - KCS : Keyboard Controller Style
+  # 2 - SMIC: Server Management Interface Chip
+  # 3 - BT  : Block Transfer
+  # 4 - SSIF: SMBus System Interface
+  gEfiMdePkgTokenSpaceGuid.PcdIpmiInterfaceType|0|UINT8|0x0038
+
  [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64]
## GUID identifying the Rng algorithm implemented by CPU instruction.
# @Prompt CPU Rng algorithm's GUID.






-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118106): https://edk2.groups.io/g/devel/message/118106
Mute This Topic: https://groups.io/mt/105228733/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: introduce RedfishBootstrapAccountDxe

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

Hi Nickle,
One comment and few questions,

> -Original Message-
> From: Nickle Wang 
> Sent: Thursday, April 18, 2024 8:28 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg: introduce
> RedfishBootstrapAccountDxe
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> -Introduce RedfishBootstrapAccountDxe to delete bootstrap
> account from /redfish/v1/AccountService/Accounts after BIOS
> finished all Redfish jobs. The bootstrap account won't be
> available to other application. So deleting bootstrap account
> helps to release resource at BMC.
> - After bootstrap account is deleted at BMC, the Redfish service
> instance is no longer usable. Close Redfish service instance to
> release the HTTP connection between BIOS and BMC.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../RedfishClientComponents.dsc.inc   |   1 +
>  .../RedfishBootstrapAccountDxe.inf|  53 +++
>  .../RedfishBootstrapAccountDxe.h  |  58 
>  .../RedfishBootstrapAccountDxe.c  | 328 ++
>  RedfishClientPkg/RedfishClient.fdf.inc|   1 +
>  5 files changed, 441 insertions(+)
>  create mode 100644
> RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
>  create mode 100644
> RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
>  create mode 100644
> RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.c
>
> diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> index 42fc0c299..fe5248b62 100644
> --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> @@ -20,6 +20,7 @@
>RedfishClientPkg/HiiToRedfishMemoryDxe/HiiToRedfishMemoryDxe.inf
>RedfishClientPkg/HiiToRedfishBootDxe/HiiToRedfishBootDxe.inf
>RedfishClientPkg/HiiToRedfishBiosDxe/HiiToRedfishBiosDxe.inf
> +
> RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.inf
>  !endif
>#
># Below two modules should be pulled in by build tool.
> diff --git
> a/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.in
> f
> b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.in
> f
> new file mode 100644
> index 0..4073e95f4
> --- /dev/null
> +++
> b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.in
> f
> @@ -0,0 +1,53 @@
> +## @file
> +#  This driver deletes bootstrap account in BMC after BIOS Redfish finished
> +#  all jobs
> +#
> +#  (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +#  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.


Not sure if you want to update the copyright to 2024.


> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION   = 0x0001000b
> +  BASE_NAME = RedfishBootstrapAccountDxe
> +  FILE_GUID = 87555253-2F7E-45FC-B469-FD35B2E51210
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 1.0
> +  ENTRY_POINT   = RedfishBootstrapAccountEntryPoint
> +  UNLOAD_IMAGE  = RedfishBootstrapAccountUnload
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  RedfishPkg/RedfishPkg.dec
> +  RedfishClientPkg/RedfishClientPkg.dec
> +
> +[Sources]
> +  RedfishBootstrapAccountDxe.h
> +  RedfishBootstrapAccountDxe.c
> +
> +[LibraryClasses]
> +  BaseLib
> +  BaseMemoryLib
> +  DebugLib
> +  MemoryAllocationLib
> +  PrintLib
> +  RedfishEventLib
> +  RedfishFeatureUtilityLib
> +  RedfishDebugLib
> +  RedfishVersionLib
> +  RedfishHttpLib
> +  UefiLib
> +  UefiBootServicesTableLib
> +  UefiRuntimeServicesTableLib
> +  UefiDriverEntryPoint
> +
> +[Protocols]
> +  gEdkIIRedfishConfigHandlerProtocolGuid  ## CONSUMES ##
> +  gEdkIIRedfishCredentialProtocolGuid ## CONSUMES ##
> +  gEfiRestExProtocolGuid  ## CONSUMES ##
> +
> +[Depex]
> +  gEdkIIRedfishCredentialProtocolGuid
> diff --git
> a/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
> b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
> new file mode 100644
> index 0..5262f1e6b
> --- /dev/null
> +++
> b/RedfishClientPkg/RedfishBootstrapAccountDxe/RedfishBootstrapAccountDxe.h
> @@ -0,0 +1,58 @@
> +/** @file
> +  Common header file for RedfishBootstrapAccountDxe driver.
> +
> +  (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> +  Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef REDFISH_BOOTSTRAP_ACCOUNT_DXE_H_
> +#define 

Re: [edk2-devel] [PATCH 1/2] Platform/AMD: Add AmdSvsmLib to required DSC files

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

I guess my RB misled contributors thought the patch is good to merge. However, 
I was thinking Eric's team should give the final RB after the validation as 
they are the maintainers for the subordinate VanGoghBoard platform. Suppose the 
impacted packages should be built successfully with the patches applied, as 
this is considered the base requirement of the code change. Nevertheless, the 
special build sauce for VanGoghBoard may be not easy for contributors to verify 
the build.

Eric, I have few suggestions for this failure, for the short term, you can 
commit another change to remove this change, as the build failure has impacts 
on our customer support. You can decide to recover this or not depends on your 
business requirement.
For the long term, besides of code base upgrade, we could consider to revise 
VanGoghBoard to use native edk2 build script. Maybe we can leverage prebuild 
mechanism to cover the platform specific build requirements.

Thanks
Abner


> -Original Message-
> From: Xing, Eric 
> Sent: Friday, April 19, 2024 7:32 PM
> To: Ard Biesheuvel 
> Cc: devel@edk2.groups.io; Zhai, MingXin (Duke) ;
> Lendacky, Thomas ; Chang, Abner
> ; Yao, Ken ; Roth, Michael
> ; Attar, AbdulLateef (Abdul Lateef)
> ; Ard Biesheuvel ;
> Gerd Hoffmann ; Min Xu ; Leif
> Lindholm 
> Subject: RE: [edk2-devel] [PATCH 1/2] Platform/AMD: Add AmdSvsmLib to
> required DSC files
>
> [AMD Official Use Only - General]
>
> Hi Ard,
>
> Agree with you, reverting code looks not a good way now. We will think about
> new method to resolve this issue. Just need a bit more time and I will hold on
> checking in code to VanGoghBoard before it.
> Thanks again for your suggestion and help us improve code in VanGoghBoard.
>
> Thanks,
> Eric
>
>
> > -Original Message-
> > From: Ard Biesheuvel 
> > Sent: Friday, April 19, 2024 5:25 PM
> > To: Xing, Eric 
> > Cc: devel@edk2.groups.io; Zhai, MingXin (Duke) ;
> > Lendacky, Thomas ; Chang, Abner
> > ; Yao, Ken ; Roth, Michael
> > ; Attar, AbdulLateef (Abdul Lateef)
> > ; Ard Biesheuvel
> > ; Gerd Hoffmann ; Min
> > Xu ; Leif Lindholm 
> > Subject: Re: [edk2-devel] [PATCH 1/2] Platform/AMD: Add AmdSvsmLib to
> > required DSC files
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > On Fri, 19 Apr 2024 at 11:06, Xing, Eric  wrote:
> > >
> > > [AMD Official Use Only - General]
> > >
> > > Hi Ard,
> > >
> > > This checkin causes VanGoghBoard build fail now. Would you help revert it?
> > > I will merge PATCH to VanGoghBoard after the code review process done
> > and code changes are verified pass on real board.
> > >
> >
> > Please provide a solution instead that makes upstream edk2 work with
> > upstream edk2-platforms.
> >
> > For downstream builds, you can combine the old EDK2_202208 with an older
> > checkout of edk2-platforms, right?



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




Re: [edk2-devel] [PATCH V3 6/6] Maintainers.txt: Update maintainer for SPI modules

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

Hi edk2 stewards,
Per off-line discussion with Ray Ni, he considers Liming's RB is good enough 
for this patch set. Please help to review this and give your RB to the 
maintainship of MdeModulePkg/Bus/Spi If you don't have concerns.

Thank you!
Abner


> -Original Message-
> From: Chang, Abner
> Sent: Thursday, April 11, 2024 9:38 AM
> To: devel@edk2.groups.io
> Cc: Michael D Kinney ; Andrew Fish
> ; Leif Lindholm ; Attar,
> AbdulLateef (Abdul Lateef) ; Chesley, Brit
> ; Jian J Wang ; Liming Gao
> ; Hao A Wu ; Ray Ni
> ; Zhiguang Liu 
> Subject: RE: [edk2-devel] [PATCH V3 6/6] Maintainers.txt: Update maintainer
> for SPI modules
>
> Hi maintainers,
> Please help to check this update as we added an entry for Bus\Spi under
> MdeModulePkg.
>
> Thanks
> Abner
>
> > -Original Message-----
> > From: devel@edk2.groups.io  On Behalf Of Chang,
> > Abner via groups.io
> > Sent: Sunday, August 13, 2023 12:37 PM
> > To: devel@edk2.groups.io
> > Cc: Michael D Kinney ; Andrew Fish
> > ; Leif Lindholm ; Attar,
> > AbdulLateef (Abdul Lateef) ; Chesley, Brit
> > ; Jian J Wang ; Liming Gao
> > ; Hao A Wu ; Ray Ni
> > ; Zhiguang Liu 
> > Subject: [edk2-devel] [PATCH V3 6/6] Maintainers.txt: Update maintainer for
> > SPI modules
> >
> > Caution: This message originated from an External Source. Use proper
> > caution when opening attachments, clicking links, or responding.
> >
> >
> > From: Abner Chang 
> >
> > Add maintainer entry of MdeModulePkg/Bus/Spi.
> >
> > Cc: Michael D Kinney 
> > Cc: Andrew Fish 
> > Cc: Leif Lindholm 
> > Cc: Abdul Lateef Attar 
> > Cc: Brit Chesley 
> > Cc: Jian J Wang 
> > Cc: Liming Gao 
> > Cc: Hao A Wu 
> > Cc: Ray Ni 
> > Cc: Zhiguang Liu 
> > Signed-off-by: Abner Chang 
> > ---
> >  Maintainers.txt | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/Maintainers.txt b/Maintainers.txt
> > index 5a95929a14b..a6a5a9b4e03 100644
> > --- a/Maintainers.txt
> > +++ b/Maintainers.txt
> > @@ -443,6 +443,11 @@ F:
> > MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h
> >  M: Richard Ho  [richardho]
> >  R: Rebecca Cran  [bcran]
> >
> > +MdeModulePkg: SPI Bus modules
> > +F: MdeModulePkg/Bus/Spi
> > +M: Abner Chang  [changab]
> > +R: Brit Chesley  [BritChesley]
> > +
> >  MdePkg
> >  F: MdePkg/
> >  W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
> > --
> > 2.37.1.windows.1
> >
> >
> >
> > 
> >



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




Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

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

Right, Abdul's RB is sufficient!


Thanks
Abner

From: Ni, Ray 
Sent: Friday, April 19, 2024 11:35:17 AM
To: Wu, Jiaxin ; devel@edk2.groups.io 

Cc: Zeng, Star ; Gerd Hoffmann ; Kumar, 
Rahul R ; Dong, Guo ; Rhodes, Sean 
; Lu, James ; Guo, Gua 
; Ard Biesheuvel ; Yao, Jiewen 
; Attar, AbdulLateef (Abdul Lateef) 
; Chang, Abner ; Lendacky, 
Thomas 
Subject: Re: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

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

Jiaxin,
I see Abdul from AMD has given R-B. I assume that's sufficient for merging this 
patch.

Thanks,
Ray

From: Wu, Jiaxin 
Sent: Thursday, April 18, 2024 16:03
To: devel@edk2.groups.io ; Wu, Jiaxin 

Cc: Ni, Ray ; Zeng, Star ; Gerd Hoffmann 
; Kumar, Rahul R ; Dong, Guo 
; Rhodes, Sean ; Lu, James 
; Guo, Gua ; Ard Biesheuvel 
; Yao, Jiewen ; Abdul Lateef 
Attar ; Abner Chang ; Tom 
Lendacky 
Subject: RE: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib

Hi Tom & Abner,

Could you help check & review AMD related patch?
 >   UefiCpuPkg/SmmRelocationLib: Add library instance for AMD

Thanks,
Jiaxin

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Wu,
> Jiaxin
> Sent: Thursday, April 18, 2024 2:56 PM
> To: devel@edk2.groups.io
> Cc: Ni, Ray ; Zeng, Star ; Gerd
> Hoffmann ; Kumar, Rahul R ;
> Dong, Guo ; Rhodes, Sean ;
> Lu, James ; Guo, Gua ; Ard
> Biesheuvel ; Yao, Jiewen
> ; Abdul Lateef Attar ;
> Abner Chang ; Tom Lendacky
> 
> Subject: [edk2-devel] [PATCH v3 00/13] Add SmmRelocationLib
>
> PR: https://github.com/tianocore/edk2/pull/5546
>
> Intel plans to separate the smbase relocation logic from
> PiSmmCpuDxeSmm driver, and the related behavior will be
> moved to the new interface defined by the SmmRelocationLib
> class.
>
> The SmmRelocationLib class provides the SmmRelocationInit()
> interface for platform to do the smbase relocation, which
> shall provide below 2 functionalities:
> 1. Relocate smbases for each processor.
> 2. Create the gSmmBaseHobGuid HOB.
>
> With SmmRelocationLib, PiSmmCpuDxeSmm driver (which runs at
> a later phase) can be simplfied as below for SMM init:
> 1. Consume the gSmmBaseHobGuid HOB for the relocated smbases
> for each Processor.
> 2. Execute the early SMM Init.
>
> Cc: Ray Ni 
> Cc: Zeng Star 
> Cc: Gerd Hoffmann 
> Cc: Rahul Kumar 
> Cc: Guo Dong 
> Cc: Sean Rhodes 
> Cc: James Lu 
> Cc: Gua Guo 
> Cc: Ard Biesheuvel 
> Cc: Jiewen Yao 
> Cc: Abdul Lateef Attar 
> Cc: Abner Chang 
> Cc: Tom Lendacky 
> Signed-off-by: Jiaxin Wu 
>
> Jiaxin Wu (13):
>   UefiCpuPkg: Add SmmRelocationLib class
>   UefiCpuPkg/SmmRelocationLib: Add SmmRelocationLib library instance
>   UefiCpuPkg/SmmRelocationLib: Rename global variables
>   UefiCpuPkg/SmmRelocationLib: Avoid unnecessary memory allocation
>   UefiCpuPkg/SmmRelocationLib: Remove unnecessary global variable
>   UefiCpuPkg/SmmRelocationLib: Add library instance for AMD
>   OvmfPkg/SmmRelocationLib: Add library instance for OVMF
>   OvmfPkg/PlatformInitLib: Create gEfiSmmSmramMemoryGuid
>   OvmfPkg: Refine SmmAccess implementation
>   OvmfPkg/SmmCpuFeaturesLib: Check Smbase Relocation is done or not
>   OvmfPkg/PlatformPei: Relocate SmBases in PEI phase
>   UefiPayloadPkg/UefiPayloadPkg.dsc: Include SmmRelocationLib
>   UefiCpuPkg/PiSmmCpuDxeSmm: Remove SmBases relocation logic
>
>  OvmfPkg/AmdSev/AmdSevX64.dsc   |   1 +
>  OvmfPkg/CloudHv/CloudHvX64.dsc |   1 +
>  OvmfPkg/Library/PlatformInitLib/MemDetect.c| 104 ++--
>  .../Library/PlatformInitLib/PlatformInitLib.inf|   6 +-
>  .../Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c  |  33 +-
>  .../Library/SmmRelocationLib}/Ia32/Semaphore.c |  13 +-
>  .../Library/SmmRelocationLib}/Ia32/SmmInit.nasm|  83 +++-
>  .../SmmRelocationLib/InternalSmmRelocationLib.h| 127 +
>  .../Library/SmmRelocationLib/SmmRelocationLib.c| 549
> +
>  .../Library/SmmRelocationLib/SmmRelocationLib.inf  |  60 +++
>  .../SmmRelocationLib/SmramSaveStateConfig.c| 100 
>  .../Library/SmmRelocationLib}/X64/Semaphore.c  |  13 +-
>  .../Library/SmmRelocationLib}/X64/SmmInit.nasm |  85 +++-
>  OvmfPkg/Microvm/MicrovmX64.dsc |   1 +
>  OvmfPkg/OvmfPkgIa32.dsc|   1 +
>  OvmfPkg/OvmfPkgIa32X64.dsc |   1 +
>  OvmfPkg/OvmfPkgX64.dsc |   1 +
>  OvmfPkg/PlatformPei/Platform.c |   3 +
>  OvmfPkg/PlatformPei/Platform.h |   5 +
>  OvmfPkg/PlatformPei/PlatformPei.inf|   5 +-
>  OvmfPkg/PlatformPei/SmmRelocation.c|  80 +++
>  OvmfPkg/SmmAccess/SmmAccess2Dxe.c  |   4 +-
>  OvmfPkg/SmmAccess/SmmAccess2Dxe.inf|   5 +
>  OvmfPkg/SmmAccess/SmmAccessPei.c  

Re: [edk2-devel] [PATCH 1/2] Platform/AMD: Add AmdSvsmLib to required DSC files

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

Reviewed-by: 

Thanks

> -Original Message-
> From: Lendacky, Thomas 
> Sent: Monday, April 15, 2024 11:01 PM
> To: devel@edk2.groups.io
> Cc: Ard Biesheuvel ; Gerd Hoffmann
> ; Roth, Michael ; Min Xu
> ; Leif Lindholm ; Michael D
> Kinney ; Chang, Abner
> ; Attar, AbdulLateef (Abdul Lateef)
> ; Xing, Eric 
> Subject: [PATCH 1/2] Platform/AMD: Add AmdSvsmLib to required DSC files
>
> Any DSC file that uses the UefiCpuPkg MpInitLib library now requires the
> AmdSvsmLib library. Update the DSC files to include the AmdSvsmLib NULL
> library implementation. Also, fix the specification of VmgExitLib as it
> was renamed to CcExitLib.
>
> Cc: Abner Chang 
> Cc: Abdul Lateef Attar 
> Cc: Eric Xing 
> Signed-off-by: Tom Lendacky 
> ---
>  Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Project.dsc | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Project.dsc
> b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Project.dsc
> index 20f06dd851..e478e0b0c2 100644
> --- a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Project.dsc
> +++ b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Project.dsc
> @@ -371,7 +371,8 @@
>
>  [LibraryClasses.common]
>
> RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
> -  VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf
> +  CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf
> +  AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf
>
>  [PcdsFixedAtBuild]
>gEfiAmdAgesaPkgTokenSpaceGuid.PcdFchOemBeforePciRestoreSwSmi|0xEA
> --
> 2.43.2



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




Re: [edk2-devel] [PATCH V3 6/6] Maintainers.txt: Update maintainer for SPI modules

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

Hi maintainers,
Please help to check this update as we added an entry for Bus\Spi under 
MdeModulePkg.

Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang,
> Abner via groups.io
> Sent: Sunday, August 13, 2023 12:37 PM
> To: devel@edk2.groups.io
> Cc: Michael D Kinney ; Andrew Fish
> ; Leif Lindholm ; Attar,
> AbdulLateef (Abdul Lateef) ; Chesley, Brit
> ; Jian J Wang ; Liming Gao
> ; Hao A Wu ; Ray Ni
> ; Zhiguang Liu 
> Subject: [edk2-devel] [PATCH V3 6/6] Maintainers.txt: Update maintainer for
> SPI modules
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> From: Abner Chang 
>
> Add maintainer entry of MdeModulePkg/Bus/Spi.
>
> Cc: Michael D Kinney 
> Cc: Andrew Fish 
> Cc: Leif Lindholm 
> Cc: Abdul Lateef Attar 
> Cc: Brit Chesley 
> Cc: Jian J Wang 
> Cc: Liming Gao 
> Cc: Hao A Wu 
> Cc: Ray Ni 
> Cc: Zhiguang Liu 
> Signed-off-by: Abner Chang 
> ---
>  Maintainers.txt | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 5a95929a14b..a6a5a9b4e03 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -443,6 +443,11 @@ F:
> MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h
>  M: Richard Ho  [richardho]
>  R: Rebecca Cran  [bcran]
>
> +MdeModulePkg: SPI Bus modules
> +F: MdeModulePkg/Bus/Spi
> +M: Abner Chang  [changab]
> +R: Brit Chesley  [BritChesley]
> +
>  MdePkg
>  F: MdePkg/
>  W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
> --
> 2.37.1.windows.1
>
>
>
> 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117607): https://edk2.groups.io/g/devel/message/117607
Mute This Topic: https://groups.io/mt/105455146/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 1/2] RedfishClientPkg/Features: support Redfish Secure Boot

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

Ok, then you can just merge this patch set.

thanks
Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Wednesday, April 10, 2024 4:17 PM
> To: devel@edk2.groups.io; Chang, Abner 
> Cc: Igor Kulchytskyy ; Nick Ramirez 
> Subject: RE: [edk2-devel] [edk2-redfish-client][PATCH v2 1/2]
> RedfishClientPkg/Features: support Redfish Secure Boot
>
> [AMD Official Use Only - General]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Thanks for your review, Abner!
>
> The reason why I keep HPE copyright statement is because I create this feature
> driver by copying existing one and modifying it. Since I still leverage some
> functions contributed by HPE, I think I am supposed to keep HPE copyright
> statement.
>
> Regards,
> Nickle
>
> > -----Original Message-
> > From: devel@edk2.groups.io  On Behalf Of Chang,
> Abner
> > via groups.io
> > Sent: Wednesday, April 10, 2024 9:43 AM
> > To: Nickle Wang ; devel@edk2.groups.io
> > Cc: Igor Kulchytskyy ; Nick Ramirez 
> > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH v2 1/2]
> > RedfishClientPkg/Features: support Redfish Secure Boot
> >
> > External email: Use caution opening links or attachments
> >
> >
> > [AMD Official Use Only - General]
> >
> > Hi Nickle,
> > I don't see the obvious coding error in this patch. However, I think we can
> remove
> > HPE copyright from Redfish secure boot feature driver, as this is a new 
> > feature
> > driver and HPE doesn't have contributions to these files, right? If so, then
> please
> > remove it.
> >
> > Thanks
> >
> > Reviewed-by: Abner Chang 
> >
> > > -Original Message-
> > > From: Nickle Wang 
> > > Sent: Monday, April 1, 2024 10:18 PM
> > > To: devel@edk2.groups.io
> > > Cc: Chang, Abner ; Igor Kulchytskyy
> > > ; Nick Ramirez 
> > > Subject: [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features:
> > > support Redfish Secure Boot
> > >
> > > Caution: This message originated from an External Source. Use proper
> > > caution when opening attachments, clicking links, or responding.
> > >
> > >
> > > Introduce SecureBoot driver to support
> > > /redfish/v1/Systems/SYS/SecureBoot resource.
> > >
> > > Signed-off-by: Nickle Wang 
> > > Cc: Abner Chang 
> > > Cc: Igor Kulchytskyy 
> > > Cc: Nick Ramirez 
> > > ---
> > >  .../RedfishClientComponents.dsc.inc   |   2 +
> > >  RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +
> > >  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf   |  60 ++
> > >  .../v1_1_0/Common/SecureBootCommon.h  |  40 +
> > >  .../v1_1_0/Common/SecureBootCommon.c  | 765
> +
> > >  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.c | 809
> ++
> > >  RedfishClientPkg/RedfishClient.fdf.inc|   1 +
> > >  7 files changed, 1681 insertions(+)
> > >  create mode 100644
> > > RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> > >  create mode 100644
> > > RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> > > n.h
> > >  create mode 100644
> > > RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> > > n.c
> > >  create mode 100644
> > > RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.c
> > >
> > > diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > > b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > > index ae2a4b025..42fc0c299 100644
> > > --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > > +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> > > @@ -34,6 +34,7 @@
> > >RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
> > >
> > >
> RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.in
> > > f
> > >RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
> > > +  RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> > >
> > >!include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc
> > >
> > > @@ -47,3 +48,4 @@
> > >RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf
> > >
> > >
> RedfishClientPkg/Converter/BootOptionCollection/RedfishBootOptionCollecti
> &

Re: [edk2-devel] [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: release resources

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

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, April 1, 2024 10:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH v2 2/2] RedfishClientPkg/Features: 
> release
> resources
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> -Release Etag and PendingSettingUri resources.
> -Update function header for GetHttpResponseEtag() and
> GetHttpResponseLocation(). Caller has to release returned
> memory buffer from these two functions.
> -Fix typo.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../Features/Bios/v1_0_9/Common/BiosCommon.c  |  2 +-
>  .../Features/Bios/v1_0_9/Dxe/BiosDxe.c| 20 --
>  .../BootOption/v1_0_4/Dxe/BootOptionDxe.c | 33 -
>  .../BootOptionCollectionDxe.c |  2 +-
>  .../v1_13_0/Dxe/ComputerSystemDxe.c   | 33 -
>  .../v1_5_0/Dxe/ComputerSystemDxe.c| 33 -
>  .../ComputerSystemCollectionDxe.c |  2 +-
>  .../Features/Memory/V1_7_1/Dxe/MemoryDxe.c| 37 ++-
>  .../MemoryCollectionDxe/MemoryCollectionDxe.c |  2 +-
>  .../RedfishFeatureUtilityLib.c|  2 +
>  10 files changed, 118 insertions(+), 48 deletions(-)
>
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> index f40fe215a..5dc97876c 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Common/BiosCommon.c
> @@ -815,7 +815,7 @@ HandleResource (
>
>//
>// Check and see if target property exist or not even when collection 
> member
> exists.
> -  // If not, we sill do provision.
> +  // If not, we still do provision.
>//
>DEBUG ((REDFISH_DEBUG_TRACE, "%a Check for %s\n", __func__, Uri));
>Status = EdkIIRedfishResourceConfigCheck (, Uri, NULL);
> diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> index bb64ef862..5955917f2 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -158,8 +158,12 @@ RedfishResourceConsumeResource (
>//
>// Searching for etag in HTTP response header
>//
> -  Etag = NULL;
> -  GetHttpResponseEtag (ExpectedResponse, );
> +  Etag   = NULL;
> +  Status = GetHttpResponseEtag (ExpectedResponse, );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n",
> __func__));
> +  }
> +
>Status = RedfishConsumeResourceCommon (Private, Private->Json, Etag);
>if (EFI_ERROR (Status)) {
>  DEBUG ((DEBUG_ERROR, "%a: failed to consume resource from: %s: %r\n",
> __func__, Private->Uri, Status));
> @@ -338,8 +342,12 @@ RedfishResourceCheck (
>//
>// Find etag in HTTP response header
>//
> -  Etag = NULL;
> -  GetHttpResponseEtag (, );
> +  Etag   = NULL;
> +  Status = GetHttpResponseEtag (, );
> +  if (EFI_ERROR (Status)) {
> +DEBUG ((DEBUG_ERROR, "%a, failed to get ETag from HTTP header\n",
> __func__));
> +  }
> +
>Status = RedfishCheckResourceCommon (Private, Private->Json, Etag);
>if (EFI_ERROR (Status)) {
>  DEBUG ((DEBUG_ERROR, "%a, failed to check resource from: %s: %r\n",
> __func__, Uri, Status));
> @@ -348,6 +356,10 @@ RedfishResourceCheck (
>//
>// Release resource
>//
> +  if (Etag != NULL) {
> +FreePool (Etag);
> +  }
> +
>RedfishHttpFreeResponse ();
>Private->Payload = NULL;
>
> diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> index 5a66fe59e..1a1262403 100644
> --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> @@ -122,12 +122,13 @@ RedfishResourceConsumeResource (
>//
>// Check and see if "@Redfish.Settings" exist or not.
>//
> -  Status = GetPendingSettings (
> - Private->RedfishService,
> - Response.Payload,
> - ,
> - 
> - );
> +  PendingSettingUri = NULL;
> +  Status= GetPendingSettings (
> +Private->RedfishService,
> +Response.Payload,
> +,
> +
> +);
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings
> found: %s\n", __func__, PendingSettingUri));
>  SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> @@ -147,8 +148,12 @@ RedfishResourceConsumeResource (
>//
>// Find etag in 

Re: [edk2-devel] [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features: support Redfish Secure Boot

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

Hi Nickle,
I don't see the obvious coding error in this patch. However, I think we can 
remove HPE copyright from Redfish secure boot feature driver, as this is a new 
feature driver and HPE doesn't have contributions to these files, right? If so, 
then please remove it.

Thanks

Reviewed-by: Abner Chang 

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, April 1, 2024 10:18 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> ; Nick Ramirez 
> Subject: [edk2-redfish-client][PATCH v2 1/2] RedfishClientPkg/Features:
> support Redfish Secure Boot
>
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
>
>
> Introduce SecureBoot driver to support
> /redfish/v1/Systems/SYS/SecureBoot resource.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nick Ramirez 
> ---
>  .../RedfishClientComponents.dsc.inc   |   2 +
>  RedfishClientPkg/RedfishClientLibs.dsc.inc|   4 +
>  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf   |  60 ++
>  .../v1_1_0/Common/SecureBootCommon.h  |  40 +
>  .../v1_1_0/Common/SecureBootCommon.c  | 765 +
>  .../SecureBoot/v1_1_0/Dxe/SecureBootDxe.c | 809 ++
>  RedfishClientPkg/RedfishClient.fdf.inc|   1 +
>  7 files changed, 1681 insertions(+)
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> n.h
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Common/SecureBootCommo
> n.c
>  create mode 100644
> RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.c
>
> diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> index ae2a4b025..42fc0c299 100644
> --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc
> +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc
> @@ -34,6 +34,7 @@
>RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf
>
> RedfishClientPkg/Features/BootOptionCollection/BootOptionCollectionDxe.in
> f
>RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.inf
> +  RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
>
>!include RedfishClientPkg/RedfishJsonStructureDxe.dsc.inc
>
> @@ -47,3 +48,4 @@
>RedfishClientPkg/Converter/Bios/v1_0_9/RedfishBios_V1_0_9_Dxe.inf
>
> RedfishClientPkg/Converter/BootOptionCollection/RedfishBootOptionCollecti
> on_Dxe.inf
>
> RedfishClientPkg/Converter/BootOption/v1_0_4/RedfishBootOption_V1_0_4_
> Dxe.inf
> +
> RedfishClientPkg/Converter/SecureBoot/v1_1_0/RedfishSecureBoot_V1_1_0_
> Dxe.inf
> diff --git a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> index 6599926ab..9126465df 100644
> --- a/RedfishClientPkg/RedfishClientLibs.dsc.inc
> +++ b/RedfishClientPkg/RedfishClientLibs.dsc.inc
> @@ -25,6 +25,8 @@
>
> BiosV1_0_9Lib|RedfishClientPkg/ConverterLib/edk2library/Bios/v1_0_9/Lib.in
> f
>
> BootOptionCollectionLib|RedfishClientPkg/ConverterLib/edk2library/BootOp
> tionCollection/Lib.inf
>
> BootOptionV1_0_4Lib|RedfishClientPkg/ConverterLib/edk2library/BootOptio
> n/v1_0_4/Lib.inf
> +
> SecureBootV1_1_0Lib|RedfishClientPkg/ConverterLib/edk2library/SecureBoot
> /v1_1_0/Lib.inf
> +
>#
># Above modules should be pulled in by build tool.
>#
> @@ -42,3 +44,5 @@
>
> RedfishAddendumLib|RedfishClientPkg/Library/RedfishAddendumLib/Redfis
> hAddendumLib.inf
>RedfishDebugLib|RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
>RedfishHttpLib|RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
> +
> SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBo
> otVariableLib.inf
> +
> PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolic
> y/PlatformPKProtectionLibVarPolicy.inf
> diff --git
> a/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> new file mode 100644
> index 0..1ad8c623f
> --- /dev/null
> +++ b/RedfishClientPkg/Features/SecureBoot/v1_1_0/Dxe/SecureBootDxe.inf
> @@ -0,0 +1,60 @@
> +## @file
> +#
> +#  (C) Copyright 2020-2022 Hewlett Packard Enterprise Development LP
> +#  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +
> +[Defines]
> +  INF_VERSION   = 0x00010005
> +  BASE_NAME = SecureBootDxe
> +  FILE_GUID = 5E4025F8-DA42-468A-853E-6A1091D35052
> +  MODULE_TYPE   = DXE_DRIVER
> +  VERSION_STRING= 1.0
> +  ENTRY_POINT   = RedfishResourceEntryPoint
> +  UNLOAD_IMAGE  = RedfishResourceUnload
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> 

Re: [edk2-devel] [PATCH V3 0/6] Config language searching algorithm enhancement and the bug fixes

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

Thanks Igor. This patch set is merged.

Abner

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Thursday, April 4, 2024 9:34 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Nickle Wang 
> Subject: RE: [EXTERNAL] [PATCH V3 0/6] Config language searching algorithm
> enhancement and the bug fixes
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Reviewed-by: Igor Kulchytskyy 
>
> Regards,
> Igor
>
> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Thursday, April 4, 2024 6:18 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [EXTERNAL] [PATCH V3 0/6] Config language searching algorithm
> enhancement and the bug fixes
>
>
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
>
> From: Abner Chang 
>
> PR # 5517
>
> In V3, adddressed comments from Nickle and Igor.
> In V2, add patch 6/6 contibuted by Nvidia for updating BIOS
> menu path implementation based on the performance improvement.
>
> In this patch set,
> 1 We enhance the config language searching algorithm.
>   As the performance of searching config language using HII GetString is
>   pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
>   to build up the metadata required for Redfish BIOS resource. With this
>   improvement, it only takes 4 seconds.
>
> 2.Introduce the Redfish debug framework, there are three edk2 Redfish
>   debug scopes.
>   a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug
> message
>  for edk2 Redfish.
>   b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
>  component. Currently we only support RedfishPlatformConfigDxe
>  module.
>   c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
>  scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.
>
> 3 This patch set also fixes an issue that deletes HII string unexpectedly.
>
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
>
> Abner Chang (4):
>   RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
>   RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
>   RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
> unexpectedly
>   EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs
>
> Nickle Wang (1):
>   RedfishPkg/RedfishPlatformConfigDxe: support menu path report
>
> abnchang (1):
>   RedfishPkg/RedfishPlatformConfigDxe: Config language searching
> optimization
>
>  RedfishPkg/RedfishPkg.dec |  24 +
>  EmulatorPkg/EmulatorPkg.dsc   |  21 +
>  .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
>  .../RedfishPlatformConfigDxe.inf  |   8 +
>  RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
>  .../RedfishPlatformConfigDxe.h|  48 +-
>  .../RedfishPlatformConfigImpl.h   | 135 ++-
>  .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
>  .../RedfishPlatformConfigCapability.c |  58 ++
>  .../RedfishPlatformConfigDxe.c|  89 +-
>  .../RedfishPlatformConfigImpl.c   | 927 --
>  11 files changed, 1239 insertions(+), 173 deletions(-)
>  create mode 100644
> RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c
>
> --
> 2.37.1.windows.1
>
> -The information contained in this message may be confidential and
> proprietary to American Megatrends (AMI). This communication is intended
> to be read only by the individual or entity to whom it is addressed or by 
> their
> designee. If the reader of this message is not the intended recipient, you are
> on notice that any distribution of this message, in any form, is strictly
> prohibited. Please promptly notify the sender by reply e-mail or by telephone
> at 770-246-8600, and then delete or destroy all copies of the transmission.


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




[edk2-devel] [PATCH V3 6/6] RedfishPkg/RedfishPlatformConfigDxe: support menu path report

2024-04-04 Thread Chang, Abner via groups.io
From: Nickle Wang 

"MenuPath" is the attribute in BIOS attribute registry. To support
reporting this attribute, we need to include the formset without
x-uefi-redfish support in database. So driver can find menu path to
target attribute in BIOS menu.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
Signed-off-by: Abner Chang 
---
 .../RedfishPlatformConfigDxe.h|  8 +--
 .../RedfishPlatformConfigDxe.c|  8 +--
 .../RedfishPlatformConfigImpl.c   | 51 +++
 3 files changed, 49 insertions(+), 18 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 688f2067bff..8eb7b0dc2aa 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -2,7 +2,7 @@
   This file defines the EDKII Redfish Platform Config Protocol interface.
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -49,8 +49,8 @@
 // 2  RedfishPlatformConfigDxe debug enablement must be set in
 //PcdRedfishDebugCategory (defined in RedfishPkg.dec)
 //
-// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
-//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+// 3. The subordinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugProperty (defined
 //in RedfishPkg.dec).
 //
 #define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
@@ -116,7 +116,7 @@ typedef struct {
 
 #define REDFISH_MENU_PATH_SIZE  8
 
-// Definitions of Redfish platform config capbility
+// Definitions of Redfish platform config capability
 #define REDFISH_PLATFORM_CONFIG_BUILD_MENU_PATH   0x1
 #define REDFISH_PLATFORM_CONFIG_ALLOW_SUPPRESSED  0x2
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index 86f5d3c4478..8bcee5a16ae 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -2016,7 +2016,7 @@ RedfishPlatformConfigProtocolGetConfigureLang (
   UINTN   Index;
   CHAR8   *FullSchema;
 
-  DEBUG ((DEBUG_INFO, "%a: Harvest config language of %a_%a (Regex: %s).\n", 
__func__, Schema, Version, RegexPattern));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Harvest config language of %a_%a 
(Regex: %s).\n", __func__, Schema, Version, RegexPattern));
 
   if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) 
|| (Count == NULL) || (ConfigureLangList == NULL) || IS_EMPTY_STRING 
(RegexPattern)) {
 return EFI_INVALID_PARAMETER;
@@ -2103,7 +2103,7 @@ RELEASE_RESOURCE:
 ReleaseStatementList ();
   }
 
-  DEBUG ((DEBUG_INFO, "%a: exit.\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: exit.\n", __func__));
   return Status;
 }
 
@@ -2318,7 +2318,7 @@ RedfishPlatformConfigProtocolGetAttribute (
   CHAR8  *FullSchema;
   CHAR8  *Buffer;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Entry\n", __func__));
   if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) 
|| IS_EMPTY_STRING (ConfigureLang) || (AttributeValue == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
@@ -2395,7 +2395,7 @@ RELEASE_RESOURCE:
 FreePool (FullSchema);
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Exit\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Exit\n", __func__));
   return Status;
 }
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
index 03dcc8dbcd1..5fcaf426107 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
@@ -2,7 +2,7 @@
   The implementation of EDKII Redfish Platform Config Protocol.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -656,8 +656,10 @@ GetStatementPrivateByConfigureLangRegex (
   ++StatementList->Count;
 }
   } else {

[edk2-devel] [PATCH V3 5/6] EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

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

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Reviewed-by: Nickle Wang 
---
 EmulatorPkg/EmulatorPkg.dsc | 21 +
 1 file changed, 21 insertions(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 85134b07816..5fa1ed345a3 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -278,6 +278,27 @@
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePath|{DEVICE_PATH("MAC(,0x1)")}
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|False
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|False
+
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfSecureBootDisabled|False
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfExitbootService|False
+
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishServiceEtagSupported|False
+
+  #
+  # Redfish Debug enablement
+  #
+  # 0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0
+
+  # Redfish Platform Configure DXE driver feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0
 !endif
 
 [PcdsDynamicDefault.common.DEFAULT]
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V3 4/6] RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly

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

Add the condition check when delete HII string.
Only when the HiiStatement operand equal to "EFI_IFR_STRING_OP"
and the statement value type = EFI_IFR_TYPE_STRING.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index 99e7827eeaf..86f5d3c4478 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -1873,8 +1873,11 @@ RedfishPlatformConfigSetStatementCommon (
 DEBUG ((DEBUG_ERROR, "%a: failed to save question value: %r\n", __func__, 
Status));
   }
 
-  if (StatementValue->Value.string != 0) {
-HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+  if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && 
(StatementValue->Type == EFI_IFR_TYPE_STRING)) {
+if (StatementValue->Value.string != 0) {
+  // Delete HII string which was created for HII statement operand = 
EFI_IFR_STRING_OP and Type = EFI_IFR_TYPE_STRING.
+  HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+}
   }
 
   return Status;
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V3 3/6] RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support

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

Add RedfishPlatformConfigDxe debug capability that aligns
with edk2 Redfish debug mechanism.

- PcdRedfishPlatformConfigDebugProperty, add PCD to control
  RedfishPlatformConfigDxe subordinate of Redfish debug
  capabilities.
- PcdRedfishPlatformConfigFeatureProperty, add PCD to
  manage RedfishPlatformConfigDxe features.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 RedfishPkg/RedfishPkg.dec |  15 +++
 .../RedfishPlatformConfigDxe.inf  |   8 ++
 .../RedfishPlatformConfigDxe.h|  46 +++-
 .../RedfishPlatformConfigImpl.h   |  28 +
 .../RedfishPlatformConfigCapability.c |  58 ++
 .../RedfishPlatformConfigDxe.c|  59 +++---
 .../RedfishPlatformConfigImpl.c   | 107 +++---
 7 files changed, 262 insertions(+), 59 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index a9665ff68ef..c048e43f53b 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -193,3 +193,18 @@
   #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
   #
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
+  #
+  # Redfish RedfishPlatformConfigDxe Debug Properties
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|UINT32|0x1013
+  #
+  # RedfishPlatformConfigDxe feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  #
+  # Redfish RedfishPlatformConfigDxe feature Properties
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0|UINT32|0x1014
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
index 5a249c8c3bc..2db47c2cffc 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
@@ -3,6 +3,7 @@
 #
 #  (C) Copyright 2021 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
 #
@@ -23,6 +24,7 @@
   RedfishPkg/RedfishPkg.dec
 
 [Sources]
+  RedfishPlatformConfigCapability.c
   RedfishPlatformConfigDxe.h
   RedfishPlatformConfigDxe.c
   RedfishPlatformConfigImpl.h
@@ -36,7 +38,9 @@
   HiiLib
   HiiUtilityLib
   MemoryAllocationLib
+  PcdLib
   PrintLib
+  RedfishDebugLib
   UefiLib
   UefiBootServicesTableLib
   UefiRuntimeServicesTableLib
@@ -51,5 +55,9 @@
 [Guids]
   gEfiRegexSyntaxTypePerlGuid ## CONSUMED
 
+[FixedPcd]
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 38adea04c5b..688f2067bff 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -3,6 +3,7 @@
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
   Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,7 +21,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -37,6 +40,41 @@
 //
 #include 
 
+//
+// Debug message in DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE scope.
+// To enable the debug message for this module, below PCDs must be set.
+//
+// 1. DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+//
+// 2  RedfishPlatformConfigDxe debug enablement must be set in
+//PcdRedfishDebugCategory (defined in RedfishPkg.dec)
+//
+// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+//in RedfishPkg.dec).
+//
+#define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
+  while (RedfishPlatformConfigDebugProp (DebugSubordinate)) { \
+DEBUG_REDFISH(DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE, ##__VA_ARGS__); 
\
+break; \
+  }
+
+#define DEBUG_REDFISH_THIS_MODULE_CODE_BEGIN(DebugSubordinate) \
+  if 

[edk2-devel] [PATCH V3 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

Build up the x-uefi-redfish string database for the Redfish confg
language searching, instead of using HII String protocol.
This can improve the time consumption lot on searching strings.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 .../RedfishPlatformConfigImpl.h   | 107 ++-
 .../RedfishPlatformConfigDxe.c|  23 +-
 .../RedfishPlatformConfigImpl.c   | 819 +-
 3 files changed, 877 insertions(+), 72 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
index 9f4312decf5..8b8c544d58e 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
@@ -2,7 +2,8 @@
   This file defines the EDKII Redfish Platform Config Protocol private 
structure.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -30,6 +31,10 @@
 #define ENGLISH_LANGUAGE_CODE  "en-US"
 #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
 
+#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in UCS.
+
+typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE 
REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
 //
@@ -46,17 +51,49 @@ typedef struct {
   CHAR8**SchemaList;// Schema list
 } REDFISH_PLATFORM_CONFIG_SCHEMA;
 
+// Defines the number of elements in array
+#define X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
+
+//
+// Definition of x-uefi-redfish string element.
+//
+typedef struct {
+  EFI_STRING_IDStringId;
+  CHAR16   *UcsString;
+} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
+
+//
+// Discrete string array buffer, each has X_UEFI_REDFISH_STRING_ARRAY_NUMBER 
element.
+//
+typedef struct {
+  LIST_ENTRY  NextArray;
+  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
+} REDFISH_X_UEFI_STRINGS_ARRAY;
+
+//
+// x-uefi-redfish string database, x-uefi-redfish language based.
+//
+typedef struct {
+  LIST_ENTRYNextXuefiRedfishLanguage; 
// Link to the next suppoted x-uefi-Redfish language.
+  CHAR8 *XuefiRedfishLanguage;
// x-uefi-redfish language.
+  UINTN StringsArrayBlocks;   
// Number of the array blocks that accommodate 
X_UEFI_REDFISH_STRING_ARRAY_NUMBER
+  
// elements in each.
+  LIST_ENTRYXuefiRedfishStringArrays; 
// Link entry of x-uefi-redfish string array.
+} REDFISH_X_UEFI_STRING_DATABASE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
 //
 typedef struct {
   LIST_ENTRYLink;
-  HII_FORMSET   *HiiFormSet; // Pointer to HII formset 
data.
-  EFI_GUID  Guid;// Formset GUID.
-  EFI_HII_HANDLEHiiHandle;   // Hii Handle of this 
formset.
-  LIST_ENTRYHiiFormList; // Form list that keep 
form data under this formset.
-  CHAR16*DevicePathStr;  // Device path of this 
formset.
-  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema; // Schema that is 
supported in this formset.
+  HII_FORMSET   *HiiFormSet;// Pointer to 
HII formset data.
+  EFI_GUID  Guid;   // Formset 
GUID.
+  EFI_HII_HANDLEHiiHandle;  // Hii Handle 
of this formset.
+  EFI_HII_PACKAGE_LIST_HEADER   *HiiPackageListHeader;  // Hii Package 
list header.
+  LIST_ENTRYHiiFormList;// Form list 
that keep form data under this formset.
+  CHAR16*DevicePathStr; // Device path 
of this formset.
+  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema;// Schema that 
is supported in this formset.
+  LIST_ENTRYXuefiRedfishStringDatabase; // 
x-uefi-redfish string/Id data base;
 } REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE;
 
 #define REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK(a)  BASE_CR (a, 
REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE, Link)
@@ -90,19 +127,19 @@ typedef struct {
 //
 // Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
 //
-typedef struct {
+struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE {
   LIST_ENTRY

[edk2-devel] [PATCH V3 0/6] Config language searching algorithm enhancement and the bug fixes

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

PR # 5517

In V3, adddressed comments from Nickle and Igor.
In V2, add patch 6/6 contibuted by Nvidia for updating BIOS
menu path implementation based on the performance improvement.

In this patch set,
1 We enhance the config language searching algorithm.
  As the performance of searching config language using HII GetString is
  pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
  to build up the metadata required for Redfish BIOS resource. With this
  improvement, it only takes 4 seconds.

2.Introduce the Redfish debug framework, there are three edk2 Redfish
  debug scopes.
  a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
 for edk2 Redfish.
  b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
 component. Currently we only support RedfishPlatformConfigDxe
 module.
  c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
 scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.

3 This patch set also fixes an issue that deletes HII string unexpectedly.

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

Abner Chang (4):
  RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
  RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
  RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
unexpectedly
  EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

Nickle Wang (1):
  RedfishPkg/RedfishPlatformConfigDxe: support menu path report

abnchang (1):
  RedfishPkg/RedfishPlatformConfigDxe: Config language searching
optimization

 RedfishPkg/RedfishPkg.dec |  24 +
 EmulatorPkg/EmulatorPkg.dsc   |  21 +
 .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
 .../RedfishPlatformConfigDxe.inf  |   8 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
 .../RedfishPlatformConfigDxe.h|  48 +-
 .../RedfishPlatformConfigImpl.h   | 135 ++-
 .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
 .../RedfishPlatformConfigCapability.c |  58 ++
 .../RedfishPlatformConfigDxe.c|  89 +-
 .../RedfishPlatformConfigImpl.c   | 927 --
 11 files changed, 1239 insertions(+), 173 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V3 2/6] RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro

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

Introduce DEBUG_REDFISH macro for the debug message
of edk2 Redfish components.
DEBUG_REDFISH can be used in any edk2 Redfish component
with Redfish DebugCatagory as the first parameter.
Whether the debug message is output or not depends on
the platform setting of PcdRedfishDebugCatagory.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
Reviewed-by: Nickle Wang 
---
 RedfishPkg/RedfishPkg.dec |  9 +++
 .../RedfishDebugLib/RedfishDebugLib.inf   |  4 ++
 RedfishPkg/Include/Library/RedfishDebugLib.h  | 43 +++
 .../Library/RedfishDebugLib/RedfishDebugLib.c | 55 ---
 4 files changed, 57 insertions(+), 54 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 1a9c9ed7bc5..a9665ff68ef 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -5,6 +5,7 @@
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
 # Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -184,3 +185,11 @@
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
   ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
+  #
+  # Redfish debug catagories
+  # To enable the debug message for the entire edk2 Redfish implementation, 
below PCDs must be set.
+  # DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+  #
+  #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index d468bb213b6..42ff321b48e 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -2,6 +2,7 @@
 #  INF file for Redfish debug library.
 #
 #  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,5 +36,8 @@
   RedfishHttpLib
   UefiLib
 
+[FixedPcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index ad7a6975867..19e5a895cc8 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -2,6 +2,7 @@
   This file defines the Redfish debug library interface.
 
   Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -11,28 +12,48 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 
-#define DEBUG_REDFISH_NETWORK DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
-#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
+// Used with MdePKg DEBUG macro.
+#define DEBUG_REDFISH_NETWORK  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Host INterface
+#define DEBUG_REDFISH_PLATFORM_CONFIG  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Platform Configure Driver
+
+//
+// Definitions of Redfish debug capability in Redfish component scope, used 
with DEBUG_REDFISH macro
+// For example, Redfish Platform Config Driver
+//   DEBUG_REDFISH(DEBUG_REDFISH_PLATFORM_CONFIG_DXE, ...)
+//
+#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE  0x0001
+
+#define DEBUG_REDFISH(DebugCategory, ...) \
+do {\
+  if (!DebugPrintEnabled()) {   \
+break;  \
+  } \
+  if (!DebugRedfishComponentEnabled (DebugCategory)) { \
+break; \
+  }\
+  DEBUG ((DEBUG_MANAGEABILITY, ##__VA_ARGS__));   \
+} while (FALSE)
 
 /**
-  Debug print the value of StatementValue.
+  Determine whether the Redfish debug category is enabled in
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory.
 
-  @param[in]  ErrorLevel DEBUG macro error level.
-  @param[in]  StatementValue The statement value to print.
+  

[edk2-devel] [PATCH V5 6/6] Maintainers: AMD as SPI driver stack maintainer

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

Signed-off-by: Abner Chang 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 Maintainers.txt | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 799f27f914c..7d9cdca611f 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -417,6 +417,11 @@ M: Abner Chang  [changab]
 R: Abdul Lateef Attar  [abdattar]
 R: Nickle Wang  [nicklela]
 
+MdeModulePkg: SPI driver stack
+F: MdeModulePkg/Bus/Spi/
+M: Abner Chang  [changab]
+R: Brit Chesley  [BritChesley]
+
 MdePkg
 F: MdePkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
@@ -450,6 +455,12 @@ M: Abner Chang  [changab]
 R: Abdul Lateef Attar  [abdattar]
 R: Nickle Wang  [nicklela]
 
+MdePkg: SPI related C header files
+F: MdePkg/Include/Protocol/Spi*.h
+F: MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
+M: Abner Chang  [changab]
+R: Brit Chesley  [BritChesley]
+
 NetworkPkg
 F: NetworkPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V5 5/6] MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

BZ#: 4471
SPI NOR Flash JEDEC Serial Flash Discoverable Driver
implementation.

Signed-off-by: Abner Chang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 MdeModulePkg/MdeModulePkg.dsc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index c0f1df3bfbc..6bed9205ea6 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -4,7 +4,7 @@
 # (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
 # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
 # Copyright (c) Microsoft Corporation.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -285,6 +285,8 @@
   MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
   MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
   
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
+  MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
+  MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.inf
 
   MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
   MdeModulePkg/Core/Pei/PeiMain.inf
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V5 3/6] MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver

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

BZ#: 4473

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Jian J Wang 
Cc: Abdul Lateef Attar 
---
 MdeModulePkg/MdeModulePkg.dec | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index a82dedc070d..050871cdf6b 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -9,7 +9,7 @@
 # (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 # Copyright (c) Microsoft Corporation.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -454,6 +454,12 @@
   ## GUID used for Boot Discovery Policy FormSet guid and related variables.
   gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 
0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }
 
+  #
+  # SPI NOR flash JEDEC Serial Flash Discoverable Parameters (SFDP) driver GUID
+  #
+  gEdk2JedecSfdpSpiDxeDriverGuid  = { 0xBE71701E, 0xB63C, 0x4574, { 0x9C, 
0x5C, 0x36, 0x29, 0xE8, 0xEA, 0xC4, 0x14 }}
+  gEdk2JedecSfdpSpiSmmDriverGuid  = { 0x95A1E915, 0x195C, 0x477C, { 0x92, 
0x6F, 0x7E, 0x24, 0x67, 0xC1, 0xB3, 0x1F }}
+
 [Ppis]
   ## Include/Ppi/FirmwareVolumeShadowPpi.h
   gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 
0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }
@@ -1638,6 +1644,26 @@
   # @Prompt The value of Retry Count,  Default value is 5.
   gEfiMdeModulePkgTokenSpaceGuid.PcdAhciCommandRetryCount|5|UINT32|0x0032
 
+  ## SPI NOR Flash operation retry counts
+  #  0x:  No retry
+  #  0x:  Maximum retry value
+  #
+  # @Prompt SPI NOR Flash Operation Retry Value
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashOperationRetryCount|0x0003|UINT32|0x0033
+
+  ## SPI NOR Flash operation retry counts for the fixed timeout value
+  #  0x:  No retry
+  #  0x:  Maximum retry value
+  #
+  # @Prompt SPI NOR Flash Operation Retry Value for the Fixed Timeout Value
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashFixedTimeoutRetryCount|0x|UINT32|0x0034
+
+  ## SPI NOR Flash operation delay in microseconds
+  #  Deafult is set to 0x0010 microseconds
+  #
+  # @Prompt SPI NOR Flash Operation Delay in Microseconds (16 us)
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashOperationDelayMicroseconds|0x0010|UINT32|0x0035
+
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This PCD defines the Console output row. The default value is 25 
according to UEFI spec.
   #  This PCD could be set to 0 then console output would be at max column and 
max row.
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V5 2/6] MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

BZ#: 4472
Add definition of JEDEC Serial Flash Discoverable Parameters
(SFDP) specification.
https://www.jedec.org/standards-documents/docs/jesd216b

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 .../IndustryStandard/SpiNorFlashJedecSfdp.h   | 324 ++
 1 file changed, 324 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h

diff --git a/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h 
b/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
new file mode 100644
index 000..2577a1289be
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
@@ -0,0 +1,324 @@
+/** @file
+  SPI NOR Flash JEDEC Serial Flash Discoverable Parameters (SFDP)
+  header file.
+
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+- JEDEC Standard, JESD216F.02
+  https://www.jedec.org/document_search?search_api_views_fulltext=JESD216
+
+  @par Glossary:
+- SFDP - Serial Flash Discoverable Parameters
+- PTP  - Parameter Table Pointer
+**/
+
+#ifndef SPI_NOR_FLASH_JEDEC_H_
+#define SPI_NOR_FLASH_JEDEC_H_
+
+#include 
+
+#define SFDP_HEADER_SIGNATURE  0x50444653
+#define SFDP_SUPPORTED_MAJOR_REVISION  0x1ul
+
+/// JEDEC Basic Flash Parameter Header
+#define SFDP_BASIC_PARAMETER_ID_LSB  0x00
+#define SFDP_BASIC_PARAMETER_ID_MSB  0xFF
+
+///
+/// JDEC Sector Map Parameter Header and Table
+///
+#define SFDP_SECTOR_MAP_PARAMETER_ID_LSB0x81
+#define SFDP_FOUR_BYTE_ADDRESS_INSTRUCTION_LSB  0x84
+#define SFDP_SECTOR_MAP_PARAMETER_ID_MSB0xFF
+
+#define SFDP_FLASH_MEMORY_DENSITY_4GBIT  0x8000
+
+#pragma pack (1)
+typedef struct _SFDP_HEADER {
+  UINT32Signature;
+  UINT32MinorRev: 8;
+  UINT32MajorRev: 8;
+  UINT32NumParameterHeaders : 8;
+  UINT32AccessProtocol  : 8;
+} SFDP_HEADER;
+
+typedef struct _SFDP_PARAMETER_HEADER {
+  UINT32IdLsb: 8;
+  UINT32MinorRev : 8;
+  UINT32MajorRev : 8;
+  UINT32Length   : 8;
+  UINT32TablePointer : 24;
+  UINT32IdMsb: 8;
+} SFDP_PARAMETER_HEADER;
+
+typedef struct _SFDP_BASIC_FLASH_PARAMETER {
+  // DWORD 1
+  UINT32EraseSizes : 2;
+  UINT32WriteGranularity   : 1;
+  UINT32VolatileStatusBlockProtect : 1;
+  UINT32WriteEnableVolatileStatus  : 1;
+  UINT32Unused1Dw1 : 3;
+  UINT32FourKEraseInstr: 8;
+  UINT32FastRead112: 1;
+  UINT32AddressBytes   : 2;
+  UINT32DtrClocking: 1;
+  UINT32FastRead122: 1;
+  UINT32FastRead144: 1;
+  UINT32FastRead114: 1;
+  UINT32Unused2Dw1 : 9;
+  // DWORD 2
+  UINT32Density;
+  // DWORD 3
+  // Fast Read 144
+  UINT32FastRead144Dummy   : 5;
+  UINT32FastRead144ModeClk : 3;
+  UINT32FastRead144Instr   : 8;
+  // Fast Read 114
+  UINT32FastRead114Dummy   : 5;
+  UINT32FastRead114ModeClk : 3;
+  UINT32FastRead114Instr   : 8;
+  // DWORD 4
+  // Fast Read 112
+  UINT32FastRead112Dummy   : 5;
+  UINT32FastRead112ModeClk : 3;
+  UINT32FastRead112Instr   : 8;
+  // Fast Read 122
+  UINT32FastRead122Dummy   : 5;
+  UINT32FastRead122ModeClk : 3;
+  UINT32FastRead122Instr   : 8;
+  // DWORD 5
+  UINT32FastRead222: 1;
+  UINT32Unused1Dw5 : 3;
+  UINT32FastRead444: 1;
+  UINT32Unused2Dw5 : 27;
+  // DWORD 6
+  UINT32UnusedDw6  : 16;
+  // Fast Read 222
+  UINT32FastRead222Dummy   : 5;
+  UINT32FastRead222ModeClk : 3;
+  UINT32FastRead222Instr   : 8;
+  // DWORD 7
+  UINT32UnusedDw7  : 16;
+  // Fast Read 444
+  UINT32FastRead444Dummy   : 5;
+  UINT32FastRead444ModeClk : 3;
+  UINT32FastRead444Instr   : 8;
+  // DWORD 8
+  UINT32Erase1Size : 8;
+  UINT32Erase1Instr: 8;
+  UINT32Erase2Size : 8;
+  UINT32Erase2Instr: 8;
+  // DWORD 9
+  UINT32Erase3Size : 8;
+  UINT32Erase3Instr: 8;
+  UINT32Erase4Size : 8;
+  UINT32Erase4Instr: 8;
+  // DWORD 10
+  UINT32EraseMultiplier: 4;
+  UINT32Erase1Time : 7;
+  UINT32Erase2Time : 7;
+  UINT32Erase3Time : 7;
+  UINT32Erase4Time : 7;
+  // DWORD 11
+  UINT32ProgramMultiplier  : 4;
+  UINT32PageSize   : 4;

[edk2-devel] [PATCH V5 1/6] MdePkg/Include: Update definitions of SPI related header files

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

BZ#: 4471
Update definitions according to PI spec 1.8 errata A

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 MdePkg/Include/Protocol/SpiConfiguration.h | 10 +-
 MdePkg/Include/Protocol/SpiHc.h| 16 +++-
 MdePkg/Include/Protocol/SpiIo.h| 12 +++-
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h 
b/MdePkg/Include/Protocol/SpiConfiguration.h
index 3f8fb9ff62c..120b54bbad8 100644
--- a/MdePkg/Include/Protocol/SpiConfiguration.h
+++ b/MdePkg/Include/Protocol/SpiConfiguration.h
@@ -2,10 +2,11 @@
   This file defines the SPI Configuration Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -168,6 +169,13 @@ typedef struct _EFI_SPI_BUS {
   VOID*ClockParameter;
 } EFI_SPI_BUS;
 
+///
+/// Definitions of SPI Part Attributes.
+///
+#define SPI_PART_SUPPORTS_2_BIT_DATA_BUS_WIDTH  BIT0
+#define SPI_PART_SUPPORTS_4_B1T_DATA_BUS_WIDTH  BIT1
+#define SPI_PART_SUPPORTS_8_B1T_DATA_BUS_WIDTH  BIT2
+
 ///
 /// The EFI_SPI_PERIPHERAL data structure describes how a specific block of
 /// logic which is connected to the SPI bus. This data structure also selects
diff --git a/MdePkg/Include/Protocol/SpiHc.h b/MdePkg/Include/Protocol/SpiHc.h
index 30128dd5c4d..354de721606 100644
--- a/MdePkg/Include/Protocol/SpiHc.h
+++ b/MdePkg/Include/Protocol/SpiHc.h
@@ -2,10 +2,11 @@
   This file defines the SPI Host Controller Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -121,6 +122,19 @@ typedef EFI_STATUS
   IN EFI_SPI_BUS_TRANSACTION*BusTransaction
   );
 
+///
+/// Definitions of SPI Host Controller Attributes.
+///
+#define HC_SUPPORTS_WRITE_ONLY_OPERATIONS   BIT0
+#define HC_SUPPORTS_READ_ONLY_OPERATIONSBIT1
+#define HC_SUPPORTS_WRITE_THEN_READ_OPERATIONS  BIT2
+#define HC_TX_FRAME_IN_MOST_SIGNIFICANT_BITSBIT3
+#define HC_RX_FRAME_IN_MOST_SIGNIFICANT_BITSBIT4
+#define HC_SUPPORTS_2_BIT_DATA_BUS_WIDTHBIT5
+#define HC_SUPPORTS_4_BIT_DATA_BUS_WIDTHBIT6
+#define HC_SUPPORTS_8_BIT_DATA_BUS_WIDTHBIT7
+#define HC_TRANSFER_SIZE_INCLUDES_OPCODEBIT8
+#define HC_TRANSFER_SIZE_INCLUDES_ADDRESS   BIT9
 ///
 /// Support a SPI data transaction between the SPI controller and a SPI chip.
 ///
diff --git a/MdePkg/Include/Protocol/SpiIo.h b/MdePkg/Include/Protocol/SpiIo.h
index b4fc5e03b88..2c95a375a20 100644
--- a/MdePkg/Include/Protocol/SpiIo.h
+++ b/MdePkg/Include/Protocol/SpiIo.h
@@ -2,10 +2,11 @@
   This file defines the SPI I/O Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -223,6 +224,15 @@ typedef struct _EFI_SPI_BUS_TRANSACTION {
   UINT8   *ReadBuffer;
 } EFI_SPI_BUS_TRANSACTION;
 
+///
+/// Definitions of SPI I/O Attributes.
+///
+#define SPI_IO_SUPPORTS_2_BIT_DATA_BUS_WIDTH   BIT0
+#define SPI_IO_SUPPORTS_4_BIT_DATA_BUS_WIDTH   BIT1
+#define SPI_IO_SUPPORTS_8_BIT_DATA_BUS_WIDTH   BIT2
+#define SPI_IO_TRANSFER_SIZE_INCLUDES_OPCODE   BIT3
+#define SPI_IO_TRANSFER_SIZE_INCLUDES_ADDRESS  BIT4
+
 ///
 /// Support managed SPI data transactions between the SPI controller and a SPI
 /// chip.
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V5 0/6] SPI NOR Flash Driver for SFDP flash device

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

Sending V4 for review as SPI related ECR is approved by
PIWG in PI spec 1.8A

In V5: Correct patch 6/6, as some source files are fixed in this patch.
In RESEND V4: Add Cc in patch 6/6
In V4: Enhance timeout algorithm
In V3: Relocate GUIDs/PCDs for SPI SFDP drivers to
   MdeModulePkg.dec.
In V2: Add maintainer entry for Bus/Spi.

This patch fixes the missing SPI defintions per to PI spec
1.8 errata A.
This patch also provides the implemtation of SPI NOR flash
driver that supports JEDEC SFDP specification.
This driver support the flash device that has the GUID
gEdk2JedecSfdpSpiDxeDriverGuid or gEdk2JedecSfdpSpiSmmDriverGuid
declared in EFI_SPI_PERIPHERAL SpiPeripheralDriverGuid structure.

The driver has been verified with Macronix MX25U6435F flash device.

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Hao A Wu 
Cc: Ray Ni 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Brit Chesley 

Abner Chang (2):
  MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver
  Maintainers: AMD as SPI driver stack maintainer

abnchang (4):
  MdePkg/Include: Update definitions of SPI related header files
  MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file
  MdeModulePkg/SpiNorFlashJedecSfdp: SPI NOR Flash JEDEC SFDP
  MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC

 MdeModulePkg/MdeModulePkg.dec |   28 +-
 MdeModulePkg/MdeModulePkg.dsc |4 +-
 .../SpiNorFlashJedecSfdpDxe.inf   |   64 +
 .../SpiNorFlashJedecSfdpSmm.inf   |   64 +
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h|  286 +++
 .../SpiNorFlashJedecSfdpInternal.h|  299 +++
 .../IndustryStandard/SpiNorFlashJedecSfdp.h   |  324 +++
 MdePkg/Include/Protocol/SpiConfiguration.h|   10 +-
 MdePkg/Include/Protocol/SpiHc.h   |   16 +-
 MdePkg/Include/Protocol/SpiIo.h   |   12 +-
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c| 1141 +++
 .../SpiNorFlashJedecSfdp.c| 1780 +
 .../SpiNorFlashJedecSfdpDxe.c |  261 +++
 .../SpiNorFlashJedecSfdpSmm.c |  234 +++
 Maintainers.txt   |   11 +
 .../SpiNorFlashJedecSfdpDxe.uni   |   13 +
 .../SpiNorFlashJedecSfdpExtra.uni |   11 +
 .../SpiNorFlashJedecSfdpSmm.uni   |   13 +
 18 files changed, 4566 insertions(+), 5 deletions(-)
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.inf
 create mode 100644 MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpInternal.h
 create mode 100644 MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
 create mode 100644 MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.uni
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpExtra.uni
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.uni

-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH RESEND V4 5/6] MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

BZ#: 4471
SPI NOR Flash JEDEC Serial Flash Discoverable Driver
implementation.

Signed-off-by: Abner Chang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 MdeModulePkg/MdeModulePkg.dsc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index c0f1df3bfbc..6bed9205ea6 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -4,7 +4,7 @@
 # (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
 # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
 # Copyright (c) Microsoft Corporation.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -285,6 +285,8 @@
   MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
   MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
   
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
+  MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
+  MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.inf
 
   MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
   MdeModulePkg/Core/Pei/PeiMain.inf
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH RESEND V4 6/6] Maintainers: AMD as SPI driver stack maintainer

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

Signed-off-by: Abner Chang 
Cc: Andrew Fish 
Cc: Leif Lindholm 
Cc: Michael D Kinney 
---
 .../Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c   | 12 ++--
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c  | 12 ++--
 Maintainers.txt  | 11 +++
 3 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c 
b/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
index 066a827bf49..3ac5420fbf6 100644
--- a/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
+++ b/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
@@ -18,7 +18,7 @@
 #include "SpiNorFlash.h"
 
 /**
-  Fill Write Buffer with Opcode, Address, Dummy Bytes, and Data
+  Fill Write Buffer with Opcode, Address, Dummy Bytes, and Data.
 
   @param[in]Instance   The instance of SPI_NOR_FLASH
   @param[in]Opcode Opcode for transaction
@@ -187,7 +187,7 @@ InternalReadStatus (
 }
 
 /**
-  Set Write Enable Latch
+  Set Write Enable Latch.
 
   @param[in]  Instance  SPI NOR instance with all protocols, etc.
 
@@ -233,7 +233,7 @@ SetWel (
 }
 
 /**
-  Check for not device write in progress
+  Check for not device write in progress.
 
   @param[in]  SpiNorFlashInstance  SPI NOR instance with all protocols, etc.
   @param[in]  Timeout  Timeout in microsecond
@@ -287,7 +287,7 @@ WaitNotWip (
 }
 
 /**
-  Check for write enable latch set and not device write in progress
+  Check for write enable latch set and not device write in progress.
 
   @param[in]  SpiNorFlashInstance  SPI NOR instance with all protocols, etc.
   @param[in]  Timeout  Timeout in microsecond
@@ -342,7 +342,7 @@ WaitWelNotWip (
 }
 
 /**
-  Check for not write enable latch set and not device write in progress
+  Check for not write enable latch set and not device write in progress.
 
   @param[in]  SpiNorFlashInstance  SPI NOR instance with all protocols, etc.
   @param[in]  Timeout  Timeout in microsecond
@@ -462,7 +462,7 @@ GetFlashId (
 }
 
 /**
-  Read data from the SPI flash at not fast speed
+  Read data from the SPI flash at not fast speed.
 
   This routine must be called at or below TPL_NOTIFY.
   This routine reads data from the SPI part in the buffer provided.
diff --git a/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c 
b/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
index 78327d37ff0..284567d1f4b 100644
--- a/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
+++ b/MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
@@ -755,7 +755,7 @@ CreateSingleFlashSectorMap (
 }
 
 /**
-  Set EraseBlockBytes in SPI NOR Flash Protocol
+  Set EraseBlockBytes in SPI NOR Flash Protocol.
 
   @param[in]  InstanceSpi Nor Flash Instance data with pointer to
   EFI_SPI_NOR_FLASH_PROTOCOL and EFI_SPI_IO_PROTOCOL
@@ -1173,7 +1173,7 @@ GetFastReadParameter (
 }
 
 /**
-  Return the flash device size from SFDP Basic Flash Parameter Table DWORD 2
+  Return the flash device size from SFDP Basic Flash Parameter Table DWORD 2.
 
   @param[in]  InstanceSpi Nor Flash Instance data with pointer to
   EFI_SPI_NOR_FLASH_PROTOCOL and
@@ -1361,7 +1361,7 @@ ReadSfdp (
 }
 
 /**
-  Read SFDP Specific Parameter Header
+  Read SFDP Specific Parameter Header.
 
   This routine reads the JEDEC SPI Flash Discoverable Parameter header from the
   SPI chip.  Fails if Major Revision is not = SFDP_SUPPORTED_MAJOR_REVISION.
@@ -1469,7 +1469,7 @@ ReadSfdpParameterHeader (
 }
 
 /**
-  Read from SFDP table pointer
+  Read from SFDP table pointer.
 
   This routine sends SPI_FLASH_RDSFDP command and reads parameter from the
   given TablePointer.
@@ -1556,7 +1556,7 @@ SpiReadSfdpPtp (
 }
 
 /**
-  Read SFDP Sector Map Parameter into buffer
+  Read SFDP Sector Map Parameter into buffer.
 
   This routine reads the JEDEC SPI Flash Discoverable Parameters from the SPI
   chip.
@@ -1623,7 +1623,7 @@ ReadSfdpSectorMapParameterTable (
 }
 
 /**
-  Read SFDP Basic Parameters into buffer
+  Read SFDP Basic Parameters into buffer.
 
   This routine reads the JEDEC SPI Flash Discoverable Parameters from the SPI
   chip.
diff --git a/Maintainers.txt b/Maintainers.txt
index 799f27f914c..7d9cdca611f 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -417,6 +417,11 @@ M: Abner Chang  [changab]
 R: Abdul Lateef Attar  [abdattar]
 R: Nickle Wang  [nicklela]
 
+MdeModulePkg: SPI driver stack
+F: MdeModulePkg/Bus/Spi/
+M: Abner Chang  [changab]
+R: Brit Chesley  [BritChesley]
+
 MdePkg
 F: MdePkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
@@ -450,6 +455,12 @@ M: Abner Chang  [changab]
 R: Abdul Lateef Attar  [abdattar]
 R: Nickle Wang  [nicklela]
 
+MdePkg: SPI related C header files
+F: MdePkg/Include/Protocol/Spi*.h
+F: MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h

[edk2-devel] [PATCH RESEND V4 3/6] MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver

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

BZ#: 4473

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Jian J Wang 
Cc: Abdul Lateef Attar 
---
 MdeModulePkg/MdeModulePkg.dec | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index a82dedc070d..050871cdf6b 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -9,7 +9,7 @@
 # (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 # Copyright (c) Microsoft Corporation.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -454,6 +454,12 @@
   ## GUID used for Boot Discovery Policy FormSet guid and related variables.
   gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 
0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }
 
+  #
+  # SPI NOR flash JEDEC Serial Flash Discoverable Parameters (SFDP) driver GUID
+  #
+  gEdk2JedecSfdpSpiDxeDriverGuid  = { 0xBE71701E, 0xB63C, 0x4574, { 0x9C, 
0x5C, 0x36, 0x29, 0xE8, 0xEA, 0xC4, 0x14 }}
+  gEdk2JedecSfdpSpiSmmDriverGuid  = { 0x95A1E915, 0x195C, 0x477C, { 0x92, 
0x6F, 0x7E, 0x24, 0x67, 0xC1, 0xB3, 0x1F }}
+
 [Ppis]
   ## Include/Ppi/FirmwareVolumeShadowPpi.h
   gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 
0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }
@@ -1638,6 +1644,26 @@
   # @Prompt The value of Retry Count,  Default value is 5.
   gEfiMdeModulePkgTokenSpaceGuid.PcdAhciCommandRetryCount|5|UINT32|0x0032
 
+  ## SPI NOR Flash operation retry counts
+  #  0x:  No retry
+  #  0x:  Maximum retry value
+  #
+  # @Prompt SPI NOR Flash Operation Retry Value
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashOperationRetryCount|0x0003|UINT32|0x0033
+
+  ## SPI NOR Flash operation retry counts for the fixed timeout value
+  #  0x:  No retry
+  #  0x:  Maximum retry value
+  #
+  # @Prompt SPI NOR Flash Operation Retry Value for the Fixed Timeout Value
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashFixedTimeoutRetryCount|0x|UINT32|0x0034
+
+  ## SPI NOR Flash operation delay in microseconds
+  #  Deafult is set to 0x0010 microseconds
+  #
+  # @Prompt SPI NOR Flash Operation Delay in Microseconds (16 us)
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashOperationDelayMicroseconds|0x0010|UINT32|0x0035
+
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This PCD defines the Console output row. The default value is 25 
according to UEFI spec.
   #  This PCD could be set to 0 then console output would be at max column and 
max row.
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH RESEND V4 2/6] MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

BZ#: 4472
Add definition of JEDEC Serial Flash Discoverable Parameters
(SFDP) specification.
https://www.jedec.org/standards-documents/docs/jesd216b

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 .../IndustryStandard/SpiNorFlashJedecSfdp.h   | 324 ++
 1 file changed, 324 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h

diff --git a/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h 
b/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
new file mode 100644
index 000..2577a1289be
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
@@ -0,0 +1,324 @@
+/** @file
+  SPI NOR Flash JEDEC Serial Flash Discoverable Parameters (SFDP)
+  header file.
+
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+- JEDEC Standard, JESD216F.02
+  https://www.jedec.org/document_search?search_api_views_fulltext=JESD216
+
+  @par Glossary:
+- SFDP - Serial Flash Discoverable Parameters
+- PTP  - Parameter Table Pointer
+**/
+
+#ifndef SPI_NOR_FLASH_JEDEC_H_
+#define SPI_NOR_FLASH_JEDEC_H_
+
+#include 
+
+#define SFDP_HEADER_SIGNATURE  0x50444653
+#define SFDP_SUPPORTED_MAJOR_REVISION  0x1ul
+
+/// JEDEC Basic Flash Parameter Header
+#define SFDP_BASIC_PARAMETER_ID_LSB  0x00
+#define SFDP_BASIC_PARAMETER_ID_MSB  0xFF
+
+///
+/// JDEC Sector Map Parameter Header and Table
+///
+#define SFDP_SECTOR_MAP_PARAMETER_ID_LSB0x81
+#define SFDP_FOUR_BYTE_ADDRESS_INSTRUCTION_LSB  0x84
+#define SFDP_SECTOR_MAP_PARAMETER_ID_MSB0xFF
+
+#define SFDP_FLASH_MEMORY_DENSITY_4GBIT  0x8000
+
+#pragma pack (1)
+typedef struct _SFDP_HEADER {
+  UINT32Signature;
+  UINT32MinorRev: 8;
+  UINT32MajorRev: 8;
+  UINT32NumParameterHeaders : 8;
+  UINT32AccessProtocol  : 8;
+} SFDP_HEADER;
+
+typedef struct _SFDP_PARAMETER_HEADER {
+  UINT32IdLsb: 8;
+  UINT32MinorRev : 8;
+  UINT32MajorRev : 8;
+  UINT32Length   : 8;
+  UINT32TablePointer : 24;
+  UINT32IdMsb: 8;
+} SFDP_PARAMETER_HEADER;
+
+typedef struct _SFDP_BASIC_FLASH_PARAMETER {
+  // DWORD 1
+  UINT32EraseSizes : 2;
+  UINT32WriteGranularity   : 1;
+  UINT32VolatileStatusBlockProtect : 1;
+  UINT32WriteEnableVolatileStatus  : 1;
+  UINT32Unused1Dw1 : 3;
+  UINT32FourKEraseInstr: 8;
+  UINT32FastRead112: 1;
+  UINT32AddressBytes   : 2;
+  UINT32DtrClocking: 1;
+  UINT32FastRead122: 1;
+  UINT32FastRead144: 1;
+  UINT32FastRead114: 1;
+  UINT32Unused2Dw1 : 9;
+  // DWORD 2
+  UINT32Density;
+  // DWORD 3
+  // Fast Read 144
+  UINT32FastRead144Dummy   : 5;
+  UINT32FastRead144ModeClk : 3;
+  UINT32FastRead144Instr   : 8;
+  // Fast Read 114
+  UINT32FastRead114Dummy   : 5;
+  UINT32FastRead114ModeClk : 3;
+  UINT32FastRead114Instr   : 8;
+  // DWORD 4
+  // Fast Read 112
+  UINT32FastRead112Dummy   : 5;
+  UINT32FastRead112ModeClk : 3;
+  UINT32FastRead112Instr   : 8;
+  // Fast Read 122
+  UINT32FastRead122Dummy   : 5;
+  UINT32FastRead122ModeClk : 3;
+  UINT32FastRead122Instr   : 8;
+  // DWORD 5
+  UINT32FastRead222: 1;
+  UINT32Unused1Dw5 : 3;
+  UINT32FastRead444: 1;
+  UINT32Unused2Dw5 : 27;
+  // DWORD 6
+  UINT32UnusedDw6  : 16;
+  // Fast Read 222
+  UINT32FastRead222Dummy   : 5;
+  UINT32FastRead222ModeClk : 3;
+  UINT32FastRead222Instr   : 8;
+  // DWORD 7
+  UINT32UnusedDw7  : 16;
+  // Fast Read 444
+  UINT32FastRead444Dummy   : 5;
+  UINT32FastRead444ModeClk : 3;
+  UINT32FastRead444Instr   : 8;
+  // DWORD 8
+  UINT32Erase1Size : 8;
+  UINT32Erase1Instr: 8;
+  UINT32Erase2Size : 8;
+  UINT32Erase2Instr: 8;
+  // DWORD 9
+  UINT32Erase3Size : 8;
+  UINT32Erase3Instr: 8;
+  UINT32Erase4Size : 8;
+  UINT32Erase4Instr: 8;
+  // DWORD 10
+  UINT32EraseMultiplier: 4;
+  UINT32Erase1Time : 7;
+  UINT32Erase2Time : 7;
+  UINT32Erase3Time : 7;
+  UINT32Erase4Time : 7;
+  // DWORD 11
+  UINT32ProgramMultiplier  : 4;
+  UINT32PageSize   : 4;

[edk2-devel] [PATCH RESEND V4 0/6] SPI NOR Flash Driver for SFDP flash device

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

Sending V4 for review as SPI related ECR is approved by
PIWG in PI spec 1.8A

In RESEND V4: Add Cc in patch 6/6
In V4: Enhance timeout algorithm
In V3: Relocate GUIDs/PCDs for SPI SFDP drivers to
   MdeModulePkg.dec.
In V2: Add maintainer entry for Bus/Spi.

This patch fixes the missing SPI defintions per to PI spec
1.8 errata A.
This patch also provides the implemtation of SPI NOR flash
driver that supports JEDEC SFDP specification.
This driver support the flash device that has the GUID
gEdk2JedecSfdpSpiDxeDriverGuid or gEdk2JedecSfdpSpiSmmDriverGuid
declared in EFI_SPI_PERIPHERAL SpiPeripheralDriverGuid structure.

The driver has been verified with Macronix MX25U6435F flash device.

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Hao A Wu 
Cc: Ray Ni 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Brit Chesley 

Abner Chang (2):
  MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver
  Maintainers: AMD as SPI driver stack maintainer

abnchang (4):
  MdePkg/Include: Update definitions of SPI related header files
  MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file
  MdeModulePkg/SpiNorFlashJedecSfdp: SPI NOR Flash JEDEC SFDP
  MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC

 MdeModulePkg/MdeModulePkg.dec |   28 +-
 MdeModulePkg/MdeModulePkg.dsc |4 +-
 .../SpiNorFlashJedecSfdpDxe.inf   |   64 +
 .../SpiNorFlashJedecSfdpSmm.inf   |   64 +
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h|  286 +++
 .../SpiNorFlashJedecSfdpInternal.h|  299 +++
 .../IndustryStandard/SpiNorFlashJedecSfdp.h   |  324 +++
 MdePkg/Include/Protocol/SpiConfiguration.h|   10 +-
 MdePkg/Include/Protocol/SpiHc.h   |   16 +-
 MdePkg/Include/Protocol/SpiIo.h   |   12 +-
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c| 1141 +++
 .../SpiNorFlashJedecSfdp.c| 1780 +
 .../SpiNorFlashJedecSfdpDxe.c |  261 +++
 .../SpiNorFlashJedecSfdpSmm.c |  234 +++
 Maintainers.txt   |   11 +
 .../SpiNorFlashJedecSfdpDxe.uni   |   13 +
 .../SpiNorFlashJedecSfdpExtra.uni |   11 +
 .../SpiNorFlashJedecSfdpSmm.uni   |   13 +
 18 files changed, 4566 insertions(+), 5 deletions(-)
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.inf
 create mode 100644 MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpInternal.h
 create mode 100644 MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
 create mode 100644 MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.uni
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpExtra.uni
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.uni

-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH RESEND V4 1/6] MdePkg/Include: Update definitions of SPI related header files

2024-04-04 Thread Chang, Abner via groups.io
From: abnchang 

BZ#: 4471
Update definitions according to PI spec 1.8 errata A

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 MdePkg/Include/Protocol/SpiConfiguration.h | 10 +-
 MdePkg/Include/Protocol/SpiHc.h| 16 +++-
 MdePkg/Include/Protocol/SpiIo.h| 12 +++-
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h 
b/MdePkg/Include/Protocol/SpiConfiguration.h
index 3f8fb9ff62c..120b54bbad8 100644
--- a/MdePkg/Include/Protocol/SpiConfiguration.h
+++ b/MdePkg/Include/Protocol/SpiConfiguration.h
@@ -2,10 +2,11 @@
   This file defines the SPI Configuration Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -168,6 +169,13 @@ typedef struct _EFI_SPI_BUS {
   VOID*ClockParameter;
 } EFI_SPI_BUS;
 
+///
+/// Definitions of SPI Part Attributes.
+///
+#define SPI_PART_SUPPORTS_2_BIT_DATA_BUS_WIDTH  BIT0
+#define SPI_PART_SUPPORTS_4_B1T_DATA_BUS_WIDTH  BIT1
+#define SPI_PART_SUPPORTS_8_B1T_DATA_BUS_WIDTH  BIT2
+
 ///
 /// The EFI_SPI_PERIPHERAL data structure describes how a specific block of
 /// logic which is connected to the SPI bus. This data structure also selects
diff --git a/MdePkg/Include/Protocol/SpiHc.h b/MdePkg/Include/Protocol/SpiHc.h
index 30128dd5c4d..354de721606 100644
--- a/MdePkg/Include/Protocol/SpiHc.h
+++ b/MdePkg/Include/Protocol/SpiHc.h
@@ -2,10 +2,11 @@
   This file defines the SPI Host Controller Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -121,6 +122,19 @@ typedef EFI_STATUS
   IN EFI_SPI_BUS_TRANSACTION*BusTransaction
   );
 
+///
+/// Definitions of SPI Host Controller Attributes.
+///
+#define HC_SUPPORTS_WRITE_ONLY_OPERATIONS   BIT0
+#define HC_SUPPORTS_READ_ONLY_OPERATIONSBIT1
+#define HC_SUPPORTS_WRITE_THEN_READ_OPERATIONS  BIT2
+#define HC_TX_FRAME_IN_MOST_SIGNIFICANT_BITSBIT3
+#define HC_RX_FRAME_IN_MOST_SIGNIFICANT_BITSBIT4
+#define HC_SUPPORTS_2_BIT_DATA_BUS_WIDTHBIT5
+#define HC_SUPPORTS_4_BIT_DATA_BUS_WIDTHBIT6
+#define HC_SUPPORTS_8_BIT_DATA_BUS_WIDTHBIT7
+#define HC_TRANSFER_SIZE_INCLUDES_OPCODEBIT8
+#define HC_TRANSFER_SIZE_INCLUDES_ADDRESS   BIT9
 ///
 /// Support a SPI data transaction between the SPI controller and a SPI chip.
 ///
diff --git a/MdePkg/Include/Protocol/SpiIo.h b/MdePkg/Include/Protocol/SpiIo.h
index b4fc5e03b88..2c95a375a20 100644
--- a/MdePkg/Include/Protocol/SpiIo.h
+++ b/MdePkg/Include/Protocol/SpiIo.h
@@ -2,10 +2,11 @@
   This file defines the SPI I/O Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -223,6 +224,15 @@ typedef struct _EFI_SPI_BUS_TRANSACTION {
   UINT8   *ReadBuffer;
 } EFI_SPI_BUS_TRANSACTION;
 
+///
+/// Definitions of SPI I/O Attributes.
+///
+#define SPI_IO_SUPPORTS_2_BIT_DATA_BUS_WIDTH   BIT0
+#define SPI_IO_SUPPORTS_4_BIT_DATA_BUS_WIDTH   BIT1
+#define SPI_IO_SUPPORTS_8_BIT_DATA_BUS_WIDTH   BIT2
+#define SPI_IO_TRANSFER_SIZE_INCLUDES_OPCODE   BIT3
+#define SPI_IO_TRANSFER_SIZE_INCLUDES_ADDRESS  BIT4
+
 ///
 /// Support managed SPI data transactions between the SPI controller and a SPI
 /// chip.
-- 
2.37.1.windows.1



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




Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

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

Hi Nickle, I will rename it and send out the V3 together with Igor's comments 
addressed.

Thanks
Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Wednesday, March 27, 2024 10:40 AM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: RE: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config
> language searching optimization
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
>
> Could we change "DescriptionStr" below to something like "XuefiString", so
> people don't think it is a regular English string of HII statement?
>
> > +  EFI_STRING_ID Description;  // String 
> > token of this
> question.
> > +  CHAR16*DescriptionStr;  // String of 
> > this question.
> > +  EFI_STRING_ID Help; // String 
> > token of help message.
>
>
> Thanks,
> Nickle
>
> > -Original Message-
> > From: abner.ch...@amd.com 
> > Sent: Tuesday, March 26, 2024 11:15 PM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy 
> > Subject: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config
> language
> > searching optimization
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: abnchang 
> >
> > Build up the x-uefi-redfish string database for the Redfish confg language
> > searching, instead of using HII String protocol.
> > This can improve the time consumption lot on searching strings.
> >
> > Signed-off-by: Abner Chang 
> > Co-authored-by: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> > ---
> >  .../RedfishPlatformConfigImpl.h   | 107 ++-
> >  .../RedfishPlatformConfigDxe.c|  23 +-
> >  .../RedfishPlatformConfigImpl.c   | 820 +-
> >  3 files changed, 878 insertions(+), 72 deletions(-)
> >
> > diff --git
> a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > index 9f4312decf5..6e6c7fdb8a9 100644
> > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> > @@ -2,7 +2,8 @@
> >This file defines the EDKII Redfish Platform Config Protocol private
> structure.
> >
> >(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> > -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> > reserved.
> > +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights
> > + reserved.
> >
> >SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> > @@ -30,6 +31,10 @@
> >  #define ENGLISH_LANGUAGE_CODE  "en-US"
> >  #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
> >
> > +#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in
> UCS.
> > +
> > +typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
> > +REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
> > +
> >  //
> >  // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
> >  //
> > @@ -46,17 +51,49 @@ typedef struct {
> >CHAR8**SchemaList;// Schema list
> >  } REDFISH_PLATFORM_CONFIG_SCHEMA;
> >
> > +// Defines the number of elements in array #define
> > +X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
> > +
> > +//
> > +// Definition of x-uefi-redfish string element.
> > +//
> > +typedef struct {
> > +  EFI_STRING_IDStringId;
> > +  CHAR16   *UcsString;
> > +} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
> > +
> > +//
> > +// Discrete string array buffer, each has
> > X_UEFI_REDFISH_STRING_ARRAY_NUMBER element.
> > +//
> > +typedef struct {
> > +  LIST_ENTRY  NextArray;
> > +  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
> > +} REDFISH_X_UEFI_STRINGS_ARRAY;
> > +
> > +//
> > +// x-uefi-redfish string database, x-uefi-redfish language based.
> > +//
> > +typedef struct {
> > +  LIST_ENTRYNextXuefiRedfishLanguage;  
> >// Link to the
> > next suppoted x-uefi-Redfish language.
> > +  CHAR8 *XuefiRedfishLanguage; 
> >// x-uefi-redfish
> > language.
> > +  UINTN StringsArrayBlocks;
> >// Number of the
> array
> > blocks that accommodate X_UEFI_REDFISH_STRING_ARRAY_NUMBER
> > +   
> >// elements in each.
> > +  LIST_ENTRYXuefiRedfishStringArrays;  
> >// Link entry of
> x-
> > uefi-redfish string array.
> > +} REDFISH_X_UEFI_STRING_DATABASE;
> > +
> >  //
> >  // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
> >  //
> >  typedef struct {
> >LIST_ENTRY   

Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

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

Hi Igor, my responses to your three comments in line.

> -Original Message-
> From: Igor Kulchytskyy 
> Sent: Thursday, April 4, 2024 8:44 AM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Nickle Wang 
> Subject: RE: [EXTERNAL] [PATCH V2 1/6]
> RedfishPkg/RedfishPlatformConfigDxe: Config language searching
> optimization
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
> Sorry for that delay.
> Here is a couple of remarks.
> DescriptionStr was introduced and, I think, it can be used in
> RedfishPlatformConfigProtocolGetAttribute function instead of using
> HiiGetRedfishString.

As DescriptionStr only captures the HII string with language x-uefi, however 
RedfishPlatformConfigProtocolGetAttribute needs the human understandable string 
in Eng language, this is why we still keep using HiiGetRedfishAsciiString. 
Nickle and I, we think there is still some room to enhance 
HiiGetRedfishAsciiString later. Also, to prevent from the confusions, Nickle 
also suggested to rename DescriptionStr to XuefiDescriptionStr. I will address 
your two comments below and Nickle's as well then send out the V3 patch set.


> Also please check my comment below in NewRedfishXuefiStringArray and
> RedfishXuefiStringInsertDatabase  functions.
> Best regards,
> Igor
>
>
> -Original Message-
> From: abner.ch...@amd.com 
> Sent: Tuesday, March 26, 2024 11:15 AM
> To: devel@edk2.groups.io
> Cc: Nickle Wang ; Igor Kulchytskyy 
> Subject: [EXTERNAL] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe:
> Config language searching optimization
>
>
> **CAUTION: The e-mail below is from an external source. Please exercise
> caution before opening attachments, clicking links, or following guidance.**
>
> From: abnchang 
>
> Build up the x-uefi-redfish string database for the Redfish confg
> language searching, instead of using HII String protocol.
> This can improve the time consumption lot on searching strings.
>
> Signed-off-by: Abner Chang 
> Co-authored-by: Nickle Wang 
> Cc: Igor Kulchytskyy 
> ---
>  .../RedfishPlatformConfigImpl.h   | 107 ++-
>  .../RedfishPlatformConfigDxe.c|  23 +-
>  .../RedfishPlatformConfigImpl.c   | 820 +-
>  3 files changed, 878 insertions(+), 72 deletions(-)
>
> diff --git
> a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> index 9f4312decf5..6e6c7fdb8a9 100644
> --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
> @@ -2,7 +2,8 @@
>This file defines the EDKII Redfish Platform Config Protocol private 
> structure.
>
>(C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
> -  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights
> reserved.
> +  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
>
>SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -30,6 +31,10 @@
>  #define ENGLISH_LANGUAGE_CODE  "en-US"
>  #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
>
> +#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in
> UCS.
> +
> +typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
> REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
> +
>  //
>  // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
>  //
> @@ -46,17 +51,49 @@ typedef struct {
>CHAR8**SchemaList;// Schema list
>  } REDFISH_PLATFORM_CONFIG_SCHEMA;
>
> +// Defines the number of elements in array
> +#define X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
> +
> +//
> +// Definition of x-uefi-redfish string element.
> +//
> +typedef struct {
> +  EFI_STRING_IDStringId;
> +  CHAR16   *UcsString;
> +} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
> +
> +//
> +// Discrete string array buffer, each has
> X_UEFI_REDFISH_STRING_ARRAY_NUMBER element.
> +//
> +typedef struct {
> +  LIST_ENTRY  NextArray;
> +  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
> +} REDFISH_X_UEFI_STRINGS_ARRAY;
> +
> +//
> +// x-uefi-redfish string database, x-uefi-redfish language based.
> +//
> +typedef struct {
> +  LIST_ENTRYNextXuefiRedfishLanguage;
>  // Link to the
> next suppoted x-uefi-Redfish language.
> +  CHAR8 *XuefiRedfishLanguage;   
>  // x-uefi-redfish
> language.
> +  UINTN StringsArrayBlocks;  
>  // Number of the array
> blocks that accommodate X_UEFI_REDFISH_STRING_ARRAY_NUMBER
> + 
>  // elements in each.
> +  LIST_ENTRYXuefiRedfishStringArrays;   

[edk2-devel] [PATCH V4 6/6] Maintainers: AMD as SPI driver stack maintainer

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

Signed-off-by: Abner Chang 
M: Andrew Fish 
M: Leif Lindholm 
M: Michael D Kinney 
---
 Maintainers.txt | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 799f27f914c..7d9cdca611f 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -417,6 +417,11 @@ M: Abner Chang  [changab]
 R: Abdul Lateef Attar  [abdattar]
 R: Nickle Wang  [nicklela]
 
+MdeModulePkg: SPI driver stack
+F: MdeModulePkg/Bus/Spi/
+M: Abner Chang  [changab]
+R: Brit Chesley  [BritChesley]
+
 MdePkg
 F: MdePkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/MdePkg
@@ -450,6 +455,12 @@ M: Abner Chang  [changab]
 R: Abdul Lateef Attar  [abdattar]
 R: Nickle Wang  [nicklela]
 
+MdePkg: SPI related C header files
+F: MdePkg/Include/Protocol/Spi*.h
+F: MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
+M: Abner Chang  [changab]
+R: Brit Chesley  [BritChesley]
+
 NetworkPkg
 F: NetworkPkg/
 W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V4 5/6] MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC

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

BZ#: 4471
SPI NOR Flash JEDEC Serial Flash Discoverable Driver
implementation.

Signed-off-by: Abner Chang 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 MdeModulePkg/MdeModulePkg.dsc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index c0f1df3bfbc..6bed9205ea6 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -4,7 +4,7 @@
 # (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
 # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.
 # Copyright (c) Microsoft Corporation.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -285,6 +285,8 @@
   MdeModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2KeyboardDxe.inf
   MdeModulePkg/Bus/Isa/Ps2MouseDxe/Ps2MouseDxe.inf
   
MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf
+  MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
+  MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.inf
 
   MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
   MdeModulePkg/Core/Pei/PeiMain.inf
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V4 2/6] MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file

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

BZ#: 4472
Add definition of JEDEC Serial Flash Discoverable Parameters
(SFDP) specification.
https://www.jedec.org/standards-documents/docs/jesd216b

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 .../IndustryStandard/SpiNorFlashJedecSfdp.h   | 324 ++
 1 file changed, 324 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h

diff --git a/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h 
b/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
new file mode 100644
index 000..2577a1289be
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
@@ -0,0 +1,324 @@
+/** @file
+  SPI NOR Flash JEDEC Serial Flash Discoverable Parameters (SFDP)
+  header file.
+
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+- JEDEC Standard, JESD216F.02
+  https://www.jedec.org/document_search?search_api_views_fulltext=JESD216
+
+  @par Glossary:
+- SFDP - Serial Flash Discoverable Parameters
+- PTP  - Parameter Table Pointer
+**/
+
+#ifndef SPI_NOR_FLASH_JEDEC_H_
+#define SPI_NOR_FLASH_JEDEC_H_
+
+#include 
+
+#define SFDP_HEADER_SIGNATURE  0x50444653
+#define SFDP_SUPPORTED_MAJOR_REVISION  0x1ul
+
+/// JEDEC Basic Flash Parameter Header
+#define SFDP_BASIC_PARAMETER_ID_LSB  0x00
+#define SFDP_BASIC_PARAMETER_ID_MSB  0xFF
+
+///
+/// JDEC Sector Map Parameter Header and Table
+///
+#define SFDP_SECTOR_MAP_PARAMETER_ID_LSB0x81
+#define SFDP_FOUR_BYTE_ADDRESS_INSTRUCTION_LSB  0x84
+#define SFDP_SECTOR_MAP_PARAMETER_ID_MSB0xFF
+
+#define SFDP_FLASH_MEMORY_DENSITY_4GBIT  0x8000
+
+#pragma pack (1)
+typedef struct _SFDP_HEADER {
+  UINT32Signature;
+  UINT32MinorRev: 8;
+  UINT32MajorRev: 8;
+  UINT32NumParameterHeaders : 8;
+  UINT32AccessProtocol  : 8;
+} SFDP_HEADER;
+
+typedef struct _SFDP_PARAMETER_HEADER {
+  UINT32IdLsb: 8;
+  UINT32MinorRev : 8;
+  UINT32MajorRev : 8;
+  UINT32Length   : 8;
+  UINT32TablePointer : 24;
+  UINT32IdMsb: 8;
+} SFDP_PARAMETER_HEADER;
+
+typedef struct _SFDP_BASIC_FLASH_PARAMETER {
+  // DWORD 1
+  UINT32EraseSizes : 2;
+  UINT32WriteGranularity   : 1;
+  UINT32VolatileStatusBlockProtect : 1;
+  UINT32WriteEnableVolatileStatus  : 1;
+  UINT32Unused1Dw1 : 3;
+  UINT32FourKEraseInstr: 8;
+  UINT32FastRead112: 1;
+  UINT32AddressBytes   : 2;
+  UINT32DtrClocking: 1;
+  UINT32FastRead122: 1;
+  UINT32FastRead144: 1;
+  UINT32FastRead114: 1;
+  UINT32Unused2Dw1 : 9;
+  // DWORD 2
+  UINT32Density;
+  // DWORD 3
+  // Fast Read 144
+  UINT32FastRead144Dummy   : 5;
+  UINT32FastRead144ModeClk : 3;
+  UINT32FastRead144Instr   : 8;
+  // Fast Read 114
+  UINT32FastRead114Dummy   : 5;
+  UINT32FastRead114ModeClk : 3;
+  UINT32FastRead114Instr   : 8;
+  // DWORD 4
+  // Fast Read 112
+  UINT32FastRead112Dummy   : 5;
+  UINT32FastRead112ModeClk : 3;
+  UINT32FastRead112Instr   : 8;
+  // Fast Read 122
+  UINT32FastRead122Dummy   : 5;
+  UINT32FastRead122ModeClk : 3;
+  UINT32FastRead122Instr   : 8;
+  // DWORD 5
+  UINT32FastRead222: 1;
+  UINT32Unused1Dw5 : 3;
+  UINT32FastRead444: 1;
+  UINT32Unused2Dw5 : 27;
+  // DWORD 6
+  UINT32UnusedDw6  : 16;
+  // Fast Read 222
+  UINT32FastRead222Dummy   : 5;
+  UINT32FastRead222ModeClk : 3;
+  UINT32FastRead222Instr   : 8;
+  // DWORD 7
+  UINT32UnusedDw7  : 16;
+  // Fast Read 444
+  UINT32FastRead444Dummy   : 5;
+  UINT32FastRead444ModeClk : 3;
+  UINT32FastRead444Instr   : 8;
+  // DWORD 8
+  UINT32Erase1Size : 8;
+  UINT32Erase1Instr: 8;
+  UINT32Erase2Size : 8;
+  UINT32Erase2Instr: 8;
+  // DWORD 9
+  UINT32Erase3Size : 8;
+  UINT32Erase3Instr: 8;
+  UINT32Erase4Size : 8;
+  UINT32Erase4Instr: 8;
+  // DWORD 10
+  UINT32EraseMultiplier: 4;
+  UINT32Erase1Time : 7;
+  UINT32Erase2Time : 7;
+  UINT32Erase3Time : 7;
+  UINT32Erase4Time : 7;
+  // DWORD 11
+  UINT32ProgramMultiplier  : 4;
+  UINT32PageSize   : 4;

[edk2-devel] [PATCH V4 3/6] MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver

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

BZ#: 4473

Signed-off-by: Abner Chang 
Cc: Liming Gao 
Cc: Jian J Wang 
Cc: Abdul Lateef Attar 
---
 MdeModulePkg/MdeModulePkg.dec | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index a82dedc070d..050871cdf6b 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -9,7 +9,7 @@
 # (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.
 # Copyright (c) Microsoft Corporation.
-# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 ##
@@ -454,6 +454,12 @@
   ## GUID used for Boot Discovery Policy FormSet guid and related variables.
   gBootDiscoveryPolicyMgrFormsetGuid = { 0x5b6f7107, 0xbb3c, 0x4660, { 0x92, 
0xcd, 0x54, 0x26, 0x90, 0x28, 0x0b, 0xbd } }
 
+  #
+  # SPI NOR flash JEDEC Serial Flash Discoverable Parameters (SFDP) driver GUID
+  #
+  gEdk2JedecSfdpSpiDxeDriverGuid  = { 0xBE71701E, 0xB63C, 0x4574, { 0x9C, 
0x5C, 0x36, 0x29, 0xE8, 0xEA, 0xC4, 0x14 }}
+  gEdk2JedecSfdpSpiSmmDriverGuid  = { 0x95A1E915, 0x195C, 0x477C, { 0x92, 
0x6F, 0x7E, 0x24, 0x67, 0xC1, 0xB3, 0x1F }}
+
 [Ppis]
   ## Include/Ppi/FirmwareVolumeShadowPpi.h
   gEdkiiPeiFirmwareVolumeShadowPpiGuid = { 0x7dfe756c, 0xed8d, 0x4d77, {0x9e, 
0xc4, 0x39, 0x9a, 0x8a, 0x81, 0x51, 0x16 } }
@@ -1638,6 +1644,26 @@
   # @Prompt The value of Retry Count,  Default value is 5.
   gEfiMdeModulePkgTokenSpaceGuid.PcdAhciCommandRetryCount|5|UINT32|0x0032
 
+  ## SPI NOR Flash operation retry counts
+  #  0x:  No retry
+  #  0x:  Maximum retry value
+  #
+  # @Prompt SPI NOR Flash Operation Retry Value
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashOperationRetryCount|0x0003|UINT32|0x0033
+
+  ## SPI NOR Flash operation retry counts for the fixed timeout value
+  #  0x:  No retry
+  #  0x:  Maximum retry value
+  #
+  # @Prompt SPI NOR Flash Operation Retry Value for the Fixed Timeout Value
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashFixedTimeoutRetryCount|0x|UINT32|0x0034
+
+  ## SPI NOR Flash operation delay in microseconds
+  #  Deafult is set to 0x0010 microseconds
+  #
+  # @Prompt SPI NOR Flash Operation Delay in Microseconds (16 us)
+  
gEfiMdeModulePkgTokenSpaceGuid.PcdSpiNorFlashOperationDelayMicroseconds|0x0010|UINT32|0x0035
+
 [PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This PCD defines the Console output row. The default value is 25 
according to UEFI spec.
   #  This PCD could be set to 0 then console output would be at max column and 
max row.
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V4 1/6] MdePkg/Include: Update definitions of SPI related header files

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

BZ#: 4471
Update definitions according to PI spec 1.8 errata A

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Brit Chesley 
---
 MdePkg/Include/Protocol/SpiConfiguration.h | 10 +-
 MdePkg/Include/Protocol/SpiHc.h| 16 +++-
 MdePkg/Include/Protocol/SpiIo.h| 12 +++-
 3 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/MdePkg/Include/Protocol/SpiConfiguration.h 
b/MdePkg/Include/Protocol/SpiConfiguration.h
index 3f8fb9ff62c..7a5da9f9692 100644
--- a/MdePkg/Include/Protocol/SpiConfiguration.h
+++ b/MdePkg/Include/Protocol/SpiConfiguration.h
@@ -2,10 +2,11 @@
   This file defines the SPI Configuration Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -168,6 +169,13 @@ typedef struct _EFI_SPI_BUS {
   VOID*ClockParameter;
 } EFI_SPI_BUS;
 
+///
+/// Definitions of SPI Part Attributes.
+///
+#define SPI_PART_SUPPORTS_2_BIT_DATA_BUS_WIDTH  BIT0
+#define SPl_PART_SUPPORTS_4_B1T_DATA_BUS_WIDTH  BIT1
+#define SPl_PART_SUPPORTS_8_B1T_DATA_BUS_WIDTH  BIT2
+
 ///
 /// The EFI_SPI_PERIPHERAL data structure describes how a specific block of
 /// logic which is connected to the SPI bus. This data structure also selects
diff --git a/MdePkg/Include/Protocol/SpiHc.h b/MdePkg/Include/Protocol/SpiHc.h
index 30128dd5c4d..354de721606 100644
--- a/MdePkg/Include/Protocol/SpiHc.h
+++ b/MdePkg/Include/Protocol/SpiHc.h
@@ -2,10 +2,11 @@
   This file defines the SPI Host Controller Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -121,6 +122,19 @@ typedef EFI_STATUS
   IN EFI_SPI_BUS_TRANSACTION*BusTransaction
   );
 
+///
+/// Definitions of SPI Host Controller Attributes.
+///
+#define HC_SUPPORTS_WRITE_ONLY_OPERATIONS   BIT0
+#define HC_SUPPORTS_READ_ONLY_OPERATIONSBIT1
+#define HC_SUPPORTS_WRITE_THEN_READ_OPERATIONS  BIT2
+#define HC_TX_FRAME_IN_MOST_SIGNIFICANT_BITSBIT3
+#define HC_RX_FRAME_IN_MOST_SIGNIFICANT_BITSBIT4
+#define HC_SUPPORTS_2_BIT_DATA_BUS_WIDTHBIT5
+#define HC_SUPPORTS_4_BIT_DATA_BUS_WIDTHBIT6
+#define HC_SUPPORTS_8_BIT_DATA_BUS_WIDTHBIT7
+#define HC_TRANSFER_SIZE_INCLUDES_OPCODEBIT8
+#define HC_TRANSFER_SIZE_INCLUDES_ADDRESS   BIT9
 ///
 /// Support a SPI data transaction between the SPI controller and a SPI chip.
 ///
diff --git a/MdePkg/Include/Protocol/SpiIo.h b/MdePkg/Include/Protocol/SpiIo.h
index b4fc5e03b88..2c95a375a20 100644
--- a/MdePkg/Include/Protocol/SpiIo.h
+++ b/MdePkg/Include/Protocol/SpiIo.h
@@ -2,10 +2,11 @@
   This file defines the SPI I/O Protocol.
 
   Copyright (c) 2017, Intel Corporation. All rights reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
-This Protocol was introduced in UEFI PI Specification 1.6.
+This Protocol was introduced in UEFI PI Specification 1.8 A.
 
 **/
 
@@ -223,6 +224,15 @@ typedef struct _EFI_SPI_BUS_TRANSACTION {
   UINT8   *ReadBuffer;
 } EFI_SPI_BUS_TRANSACTION;
 
+///
+/// Definitions of SPI I/O Attributes.
+///
+#define SPI_IO_SUPPORTS_2_BIT_DATA_BUS_WIDTH   BIT0
+#define SPI_IO_SUPPORTS_4_BIT_DATA_BUS_WIDTH   BIT1
+#define SPI_IO_SUPPORTS_8_BIT_DATA_BUS_WIDTH   BIT2
+#define SPI_IO_TRANSFER_SIZE_INCLUDES_OPCODE   BIT3
+#define SPI_IO_TRANSFER_SIZE_INCLUDES_ADDRESS  BIT4
+
 ///
 /// Support managed SPI data transactions between the SPI controller and a SPI
 /// chip.
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V4 0/6] SPI NOR Flash Driver for SFDP flash device

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

Sending V4 for review as SPI related ECR is approved by
PIWG in PI spec 1.8A

IN V4: Enhance timeout algorithm
In V3: Relocate GUIDs/PCDs for SPI SFDP drivers to
   MdeModulePkg.dec.
In V2: Add maintainer entry for Bus/Spi.

This patch fixes the missing SPI defintions per to PI spec
1.8 errata A.
This patch also provides the implemtation of SPI NOR flash
driver that supports JEDEC SFDP specification.
This driver support the flash device that has the GUID
gEdk2JedecSfdpSpiDxeDriverGuid or gEdk2JedecSfdpSpiSmmDriverGuid
declared in EFI_SPI_PERIPHERAL SpiPeripheralDriverGuid structure.

The driver has been verified with Macronix MX25U6435F flash device.

Signed-off-by: Abner Chang 
Cc: Michael D Kinney 
Cc: Liming Gao 
Cc: Zhiguang Liu 
Cc: Abdul Lateef Attar 
Cc: Hao A Wu 
Cc: Ray Ni 
Cc: Jian J Wang 
Cc: Liming Gao 
Cc: Brit Chesley 

Abner Chang (2):
  MdeModulePkg: Add definitions in DEC for SPI NOR Flash SFDP driver
  Maintainers: AMD as SPI driver stack maintainer

abnchang (4):
  MdePkg/Include: Update definitions of SPI related header files
  MdePkg/Include: Add SPI NOR Flash JEDEC SFDP header file
  MdeModulePkg/SpiNorFlashJedecSfdp: SPI NOR Flash JEDEC SFDP
  MdeModulePkg: Add SPI NOR FLash SFDP drivers to DSC

 MdeModulePkg/MdeModulePkg.dec |   28 +-
 MdeModulePkg/MdeModulePkg.dsc |4 +-
 .../SpiNorFlashJedecSfdpDxe.inf   |   64 +
 .../SpiNorFlashJedecSfdpSmm.inf   |   64 +
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h|  286 +++
 .../SpiNorFlashJedecSfdpInternal.h|  299 +++
 .../IndustryStandard/SpiNorFlashJedecSfdp.h   |  324 +++
 MdePkg/Include/Protocol/SpiConfiguration.h|   10 +-
 MdePkg/Include/Protocol/SpiHc.h   |   16 +-
 MdePkg/Include/Protocol/SpiIo.h   |   12 +-
 .../Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c| 1137 +++
 .../SpiNorFlashJedecSfdp.c| 1782 +
 .../SpiNorFlashJedecSfdpDxe.c |  261 +++
 .../SpiNorFlashJedecSfdpSmm.c |  234 +++
 Maintainers.txt   |   11 +
 .../SpiNorFlashJedecSfdpDxe.uni   |   13 +
 .../SpiNorFlashJedecSfdpExtra.uni |   11 +
 .../SpiNorFlashJedecSfdpSmm.uni   |   13 +
 18 files changed, 4564 insertions(+), 5 deletions(-)
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.inf
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.inf
 create mode 100644 MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.h
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpInternal.h
 create mode 100644 MdePkg/Include/IndustryStandard/SpiNorFlashJedecSfdp.h
 create mode 100644 MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlash.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdp.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.c
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpDxe.uni
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpExtra.uni
 create mode 100644 
MdeModulePkg/Bus/Spi/SpiNorFlashJedecSfdp/SpiNorFlashJedecSfdpSmm.uni

-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117358): https://edk2.groups.io/g/devel/message/117358
Mute This Topic: https://groups.io/mt/105304853/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/Features: Variable used before being initialized

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

Hi Nickle,
Use Uri makes sense to me. Thanks! Please go ahead to merge it.
Reviewed-by: Abner Chang .

> -Original Message-
> From: Nickle Wang 
> Sent: Monday, April 1, 2024 10:38 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy
> 
> Subject: [edk2-redfish-client][PATCH] RedfishClientPkg/Features: Variable
> used before being initialized
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Private->Uri is initialized after calling SetRedfishSettingsObjectsUri()
> but it is used in SetRedfishSettingsObjectsUri function. Use input
> parameter "Uri" instead.
>
> Signed-off-by: Nickle Wang 
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> ---
>  RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c | 2 +-
>  RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c | 2 +-
>  .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c | 2 +-
>  .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c  | 2 +-
>  RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c | 2 +-
>  5 files changed, 5 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 bb64ef862..ed7823a59 100644
> --- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> +++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
> @@ -141,7 +141,7 @@ RedfishResourceConsumeResource (
>  );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git
> a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> index 5a66fe59e..fec3a0090 100644
> --- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> +++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
> @@ -130,7 +130,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings
> found: %s\n", __func__, PendingSettingUri));
> -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> mDxe.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyst
> emDxe.c
> index a0c71212b..d829a22d2 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyste
> mDxe.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSyst
> emDxe.c
> @@ -133,7 +133,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> mDxe.c
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> mDxe.c
> index 494bf59df..de1691534 100644
> ---
> a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> mDxe.c
> +++
> b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSyste
> mDxe.c
> @@ -134,7 +134,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
>  Private->Uri = PendingSettingUri;
>  ExpectedResponse = 
>} else {
> diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> index f2c0a7735..413b90c97 100644
> --- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> +++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
> @@ -134,7 +134,7 @@ RedfishResourceConsumeResource (
>   );
>if (!EFI_ERROR (Status)) {
>  DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n",
> __func__, PendingSettingUri));
> -SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
> +SetRedfishSettingsObjectsUri (Uri, PendingSettingUri);
>  Private->Uri

Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

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

Hi Mike,
Just letting you know that I merged this patch set to clean up the backlogs. I 
believe your comment was addressed in V5. Just let me know if you still find 
any improper code.
Thanks
Abner

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Chang,
> Abner via groups.io
> Sent: Thursday, March 28, 2024 2:54 PM
> To: Nickle Wang ; devel@edk2.groups.io; Mike
> Maslenkin 
> Cc: Igor Kulchytskyy 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V5 1/2]
> RedfishClientPkg: Set SettingsObject URI as the config language
>
> [AMD Official Use Only - General]
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> [AMD Official Use Only - General]
>
> Hi @Mike Maslenkin, would you like to review this patch again as I addressed
> your comments in V5 patch set.
> Thanks
> Abner
>
> > -Original Message-
> > From: Nickle Wang 
> > Sent: Tuesday, March 26, 2024 8:14 PM
> > To: Chang, Abner ; devel@edk2.groups.io
> > Cc: Igor Kulchytskyy 
> > Subject: RE: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set
> > SettingsObject URI as the config language
> >
> > Caution: This message originated from an External Source. Use proper
> caution
> > when opening attachments, clicking links, or responding.
> >
> >
> > Thanks for working on this, Abner.
> >
> >
> > Reviewed-by: Nickle Wang 
> >
> > Regards,
> > Nickle
> >
> > > -Original Message-
> > > From: abner.ch...@amd.com 
> > > Sent: Friday, March 22, 2024 10:41 PM
> > > To: devel@edk2.groups.io
> > > Cc: Igor Kulchytskyy ; Nickle Wang
> 
> > > Subject: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set
> > SettingsObject
> > > URI as the config language
> > >
> > > External email: Use caution opening links or attachments
> > >
> > >
> > > From: Abner Chang 
> > >
> > > Set SettingsObject URI in @Redfish.Settings resource as the config
> language
> > > which is the same as the config language of parent URI that mandates
> > > @Redfish.Settings.
> > > With this, we can find the config language of the properties in
> SettingsObject
> > URI.
> > >
> > > Signed-off-by: Abner Chang 
> > > Cc: Igor Kulchytskyy 
> > > Co-authored-by: Nickle Wang 
> > > ---
> > >  .../Library/RedfishFeatureUtilityLib.h| 17 
> > >  .../RedfishFeatureUtilityLib.c| 89 ---
> > >  .../RedfishConfigLangMapDxe.c | 15 +++-
> > >  3 files changed, 104 insertions(+), 17 deletions(-)
> > >
> > > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > index ba9ea01501..3c5f248eb7 100644
> > > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > @@ -369,6 +369,23 @@ RedfishSetRedfishUri (
> > >INEFI_STRING  Uri
> > >);
> > >
> > > +/**
> > > +
> > > +  Save Redfish SettingsObject URI in database for further use.
> > > +
> > > +  @param[in]ParentUri Parent URI of @Redfish.Settings 
> > > property.
> > > +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> > > +
> > > +  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
> > > +  @retval  EFI_SUCCESSRedfish uri is saved
> > > +
> > > +**/
> > > +EFI_STATUS
> > > +SetRedfishSettingsObjectsUri (
> > > +  IN EFI_STRING  ParentUri,
> > > +  IN EFI_STRING  SettingObjectUri
> > > +  );
> > > +
> > >  /**
> > >
> > >Get the property name by given Configure Language.
> > > diff --git
> > >
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> > >
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> > > index cc2b37b796..dda80c4608 100644
> > > ---
> > >
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> > > +++
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> > > +++ ilityLib.c
> > > @@ -2082,7 +2082,6 

Re: [edk2-devel] [PATCH RESEND v1] MdePkg: Adds a PCD to define IPMI interface type

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

Acked-by: Abner Chang 

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Saturday, March 30, 2024 1:23 PM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu 
> Subject: [PATCH RESEND v1] MdePkg: Adds a PCD to define IPMI interface
> type
>
> Define IPMI interface type as per specification version 2.0,
> section C1-1.1.
>
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  MdePkg/MdePkg.dec | 11 ++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 0c18e1decd..396d960dca 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -9,7 +9,7 @@
>  # (C) Copyright 2016 - 2021 Hewlett Packard Enterprise Development LP
>  # Copyright (c) 2022, Loongson Technology Corporation Limited. All rights
> reserved.
>  # Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
> -# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
> +# Copyright (C) 2023 - 2024, Advanced Micro Devices, Inc. All rights
> reserved.
>  # Copyright (c) 2023, Ampere Computing LLC. All rights reserved.
>  #
>  # SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -2401,6 +2401,15 @@
># @Prompt Time-out for a response, internal
>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond|
> 6|UINT32|0x0036
>
> +  ## Indicates IPMI Interface Type
> +  # The IPMI specification defines the following interface types: (section 
> C1-
> 1.1)
> +  # 0 - Unknown
> +  # 1 - KCS : Keyboard Controller Style
> +  # 2 - SMIC: Server Management Interface Chip
> +  # 3 - BT  : Block Transfer
> +  # 4 - SSIF: SMBus System Interface
> +  gEfiMdePkgTokenSpaceGuid.PcdIpmiInterfaceType|0|UINT8|0x0038
> +
>  [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64]
>## GUID identifying the Rng algorithm implemented by CPU instruction.
># @Prompt CPU Rng algorithm's GUID.
> --
> 2.34.1



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




Re: [edk2-devel] [PATCH v1] MdePkg: Adds a PCD to define IPMI interface type

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

Please update AMD copyright to 2024.
Thanks
Abner

> -Original Message-
> From: Abdul Lateef Attar 
> Sent: Friday, March 29, 2024 11:17 AM
> To: devel@edk2.groups.io
> Cc: Attar, AbdulLateef (Abdul Lateef) ; Chang,
> Abner ; Michael D Kinney
> ; Liming Gao ;
> Zhiguang Liu 
> Subject: [PATCH v1] MdePkg: Adds a PCD to define IPMI interface type
>
> Define IPMI interface type as per specification version 2.0,
> section C1-1.1.
>
> Cc: Abner Chang 
> Cc: Michael D Kinney 
> Cc: Liming Gao 
> Cc: Zhiguang Liu 
> Signed-off-by: Abdul Lateef Attar 
> ---
>  MdePkg/MdePkg.dec | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
> index 0c18e1decd..d394cad536 100644
> --- a/MdePkg/MdePkg.dec
> +++ b/MdePkg/MdePkg.dec
> @@ -2401,6 +2401,15 @@
># @Prompt Time-out for a response, internal
>
> gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifResponseRetryIntervalMicrosecond|
> 6|UINT32|0x0036
>
> +  ## Indicates IPMI Interface Type
> +  # The IPMI specification defines the following interface types: (section 
> C1-
> 1.1)
> +  # 0 - Unknown
> +  # 1 - KCS : Keyboard Controller Style
> +  # 2 - SMIC: Server Management Interface Chip
> +  # 3 - BT  : Block Transfer
> +  # 4 - SSIF: SMBus System Interface
> +  gEfiMdePkgTokenSpaceGuid.PcdIpmiInterfaceType|0|UINT8|0x0038
> +
>  [PcdsFixedAtBuild.AARCH64, PcdsPatchableInModule.AARCH64]
>## GUID identifying the Rng algorithm implemented by CPU instruction.
># @Prompt CPU Rng algorithm's GUID.
> --
> 2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117233): https://edk2.groups.io/g/devel/message/117233
Mute This Topic: https://groups.io/mt/105210533/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 V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

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

Hi @Mike Maslenkin, would you like to review this patch again as I addressed 
your comments in V5 patch set.
Thanks
Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Tuesday, March 26, 2024 8:14 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: RE: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set
> SettingsObject URI as the config language
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Thanks for working on this, Abner.
>
>
> Reviewed-by: Nickle Wang 
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: abner.ch...@amd.com 
> > Sent: Friday, March 22, 2024 10:41 PM
> > To: devel@edk2.groups.io
> > Cc: Igor Kulchytskyy ; Nickle Wang 
> > Subject: [edk2-redfish-client][PATCH V5 1/2] RedfishClientPkg: Set
> SettingsObject
> > URI as the config language
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: Abner Chang 
> >
> > Set SettingsObject URI in @Redfish.Settings resource as the config language
> > which is the same as the config language of parent URI that mandates
> > @Redfish.Settings.
> > With this, we can find the config language of the properties in 
> > SettingsObject
> URI.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Co-authored-by: Nickle Wang 
> > ---
> >  .../Library/RedfishFeatureUtilityLib.h| 17 
> >  .../RedfishFeatureUtilityLib.c| 89 ---
> >  .../RedfishConfigLangMapDxe.c | 15 +++-
> >  3 files changed, 104 insertions(+), 17 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > index ba9ea01501..3c5f248eb7 100644
> > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > @@ -369,6 +369,23 @@ RedfishSetRedfishUri (
> >INEFI_STRING  Uri
> >);
> >
> > +/**
> > +
> > +  Save Redfish SettingsObject URI in database for further use.
> > +
> > +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> > +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> > +
> > +  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
> > +  @retval  EFI_SUCCESSRedfish uri is saved
> > +
> > +**/
> > +EFI_STATUS
> > +SetRedfishSettingsObjectsUri (
> > +  IN EFI_STRING  ParentUri,
> > +  IN EFI_STRING  SettingObjectUri
> > +  );
> > +
> >  /**
> >
> >Get the property name by given Configure Language.
> > diff --git
> > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> > b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> > index cc2b37b796..dda80c4608 100644
> > ---
> > a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
> > +++ b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUt
> > +++ ilityLib.c
> > @@ -2082,7 +2082,6 @@ GetConfigureLang (
> >EFI_STRING  ResultStr;
> >EFI_STRING  UnicodeUri;
> >EFI_STATUS  Status;
> > -  EFI_STRING  StrFound;
> >
> >if (IS_EMPTY_STRING (Uri)) {
> >  return NULL;
> > @@ -2101,18 +2100,6 @@ GetConfigureLang (
> >}
> >
> >ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> > -  if (ConfigLang == NULL) {
> > -//
> > -// @Redfish.Settings share the same schema as its parent.
> > -// Remove "Settings" and try again.
> > -//
> > -StrFound = StrStr (UnicodeUri, L"/Settings");
> > -if (StrFound != NULL) {
> > -  StrFound[0] = L'\0';
> > -  DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try:
> %s\n",
> > __func__, UnicodeUri));
> > -  ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> > -}
> > -  }
> >
> >FreePool (UnicodeUri);
> >
> > @@ -2172,6 +2159,64 @@ RedfishSetRedfishUri (
> >return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang,
> > Uri);  }
> >
> > +/**
> > +
> > +  Save Redfish SettingsObject URI in database for further use.
> > +
> > +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> > +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> > +
> > +  @retval  EFI_INVALID_PARAMETER  ParentUri or SettingObjectUri is NULL.
> > +  @retval  EFI_NOT_FOUND  Config language for ParentUri is not 
> > found.
> > +  @retval  EFI_SUCCESSRedfish URI is saved with corresponding
> > +  config language.
> > +
> > +**/
> > +EFI_STATUS
> > +SetRedfishSettingsObjectsUri (
> > +  IN EFI_STRING  ParentUri,
> > +  IN EFI_STRING  SettingObjectUri
> > +  )
> > +{
> > +  EFI_STATUS  Status;
> > +  EFI_STRING  ConfigLang;
> > +
> > +  if ((ParentUri == NULL) || (SettingObjectUri == NULL)) {
> > +return 

Re: [edk2-devel] [PATCH V2 0/6] [PATCH V2 0/5] Config language searching algorithm enhancement and the bug fixes

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

Hi Igor,
If time is allowed, please also review this patch set.
Thanks
Abner

> -Original Message-
> From: Nickle Wang 
> Sent: Wednesday, March 27, 2024 3:42 PM
> To: Chang, Abner ; devel@edk2.groups.io
> Cc: Igor Kulchytskyy 
> Subject: RE: [PATCH V2 0/6] [PATCH V2 0/5] Config language searching
> algorithm enhancement and the bug fixes
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> I have tested this patch series on my system and got a lot of performance
> improvements too.
>
> Great work, Abner!
>
> Regards,
> Nickle
>
> > -Original Message-
> > From: abner.ch...@amd.com 
> > Sent: Tuesday, March 26, 2024 11:15 PM
> > To: devel@edk2.groups.io
> > Cc: Nickle Wang ; Igor Kulchytskyy 
> > Subject: [PATCH V2 0/6] [PATCH V2 0/5] Config language searching
> algorithm
> > enhancement and the bug fixes
> >
> > External email: Use caution opening links or attachments
> >
> >
> > From: Abner Chang 
> >
> > PR # 5491
> >
> > In V2, add patch 6/6 contibuted by Nvidia for updating BIOS menu path
> > implementation based on the performance improvement.
> >
> > In this patch set,
> > 1 We enhance the config language searching algorithm.
> >   As the performance of searching config language using HII GetString is
> >   pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
> >   to build up the metadata required for Redfish BIOS resource. With this
> >   improvement, it only takes 4 seconds.
> >
> > 2.Introduce the Redfish debug framework, there are three edk2 Redfish
> >   debug scopes.
> >   a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug
> message
> >  for edk2 Redfish.
> >   b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
> >  component. Currently we only support RedfishPlatformConfigDxe
> >  module.
> >   c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
> >  scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.
> >
> > 3 This patch set also fixes an issue that deletes HII string unexpectedly.
> >
> > Signed-off-by: Abner Chang 
> > Co-authored-by: Nickle Wang 
> > Cc: Igor Kulchytskyy 
> >
> > Abner Chang (4):
> >   RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
> >   RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
> >   RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
> > unexpectedly
> >   EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs
> >
> > Nickle Wang (1):
> >   RedfishPkg/RedfishPlatformConfigDxe: support menu path report
> >
> > abnchang (1):
> >   RedfishPkg/RedfishPlatformConfigDxe: Config language searching
> > optimization
> >
> >  RedfishPkg/RedfishPkg.dec |  24 +
> >  EmulatorPkg/EmulatorPkg.dsc   |  21 +
> >  .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
> >  .../RedfishPlatformConfigDxe.inf  |   8 +
> >  RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
> >  .../RedfishPlatformConfigDxe.h|  48 +-
> >  .../RedfishPlatformConfigImpl.h   | 135 ++-
> >  .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
> >  .../RedfishPlatformConfigCapability.c |  58 ++
> >  .../RedfishPlatformConfigDxe.c|  89 +-
> >  .../RedfishPlatformConfigImpl.c   | 928 --
> >  11 files changed, 1240 insertions(+), 173 deletions(-)  create mode 100644
> > RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c
> >
> > --
> > 2.37.1.windows.1



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




[edk2-devel] [PATCH V2 5/6] EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
---
 EmulatorPkg/EmulatorPkg.dsc | 21 +
 1 file changed, 21 insertions(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 85134b07816..5fa1ed345a3 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -278,6 +278,27 @@
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePath|{DEVICE_PATH("MAC(,0x1)")}
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|False
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|False
+
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfSecureBootDisabled|False
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfExitbootService|False
+
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishServiceEtagSupported|False
+
+  #
+  # Redfish Debug enablement
+  #
+  # 0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0
+
+  # Redfish Platform Configure DXE driver feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0
 !endif
 
 [PcdsDynamicDefault.common.DEFAULT]
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V2 6/6] RedfishPkg/RedfishPlatformConfigDxe: support menu path report

2024-03-26 Thread Chang, Abner via groups.io
From: Nickle Wang 

"MenuPath" is the attribute in BIOS attribute registry. To support
reporting this attribute, we need to include the formset without
x-uefi-redfish support in database. So driver can find menu path to
target attribute in BIOS menu.

Signed-off-by: Nickle Wang 
Cc: Abner Chang 
Cc: Igor Kulchytskyy 
Signed-off-by: Abner Chang 
---
 .../RedfishPlatformConfigDxe.h|  8 +--
 .../RedfishPlatformConfigDxe.c|  8 +--
 .../RedfishPlatformConfigImpl.c   | 51 +++
 3 files changed, 49 insertions(+), 18 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 688f2067bff..8eb7b0dc2aa 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -2,7 +2,7 @@
   This file defines the EDKII Redfish Platform Config Protocol interface.
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -49,8 +49,8 @@
 // 2  RedfishPlatformConfigDxe debug enablement must be set in
 //PcdRedfishDebugCategory (defined in RedfishPkg.dec)
 //
-// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
-//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+// 3. The subordinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugProperty (defined
 //in RedfishPkg.dec).
 //
 #define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
@@ -116,7 +116,7 @@ typedef struct {
 
 #define REDFISH_MENU_PATH_SIZE  8
 
-// Definitions of Redfish platform config capbility
+// Definitions of Redfish platform config capability
 #define REDFISH_PLATFORM_CONFIG_BUILD_MENU_PATH   0x1
 #define REDFISH_PLATFORM_CONFIG_ALLOW_SUPPRESSED  0x2
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index d165799f9a1..7821146e901 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -2016,7 +2016,7 @@ RedfishPlatformConfigProtocolGetConfigureLang (
   UINTN   Index;
   CHAR8   *FullSchema;
 
-  DEBUG ((DEBUG_INFO, "%a: Harvest config language of %a_%a (Regex: %s).\n", 
__func__, Schema, Version, RegexPattern));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Harvest config language of %a_%a 
(Regex: %s).\n", __func__, Schema, Version, RegexPattern));
 
   if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) 
|| (Count == NULL) || (ConfigureLangList == NULL) || IS_EMPTY_STRING 
(RegexPattern)) {
 return EFI_INVALID_PARAMETER;
@@ -2103,7 +2103,7 @@ RELEASE_RESOURCE:
 ReleaseStatementList ();
   }
 
-  DEBUG ((DEBUG_INFO, "%a: exit.\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: exit.\n", __func__));
   return Status;
 }
 
@@ -2318,7 +2318,7 @@ RedfishPlatformConfigProtocolGetAttribute (
   CHAR8  *FullSchema;
   CHAR8  *Buffer;
 
-  DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Entry\n", __func__));
   if ((This == NULL) || IS_EMPTY_STRING (Schema) || IS_EMPTY_STRING (Version) 
|| IS_EMPTY_STRING (ConfigureLang) || (AttributeValue == NULL)) {
 return EFI_INVALID_PARAMETER;
   }
@@ -2395,7 +2395,7 @@ RELEASE_RESOURCE:
 FreePool (FullSchema);
   }
 
-  DEBUG ((DEBUG_INFO, "%a: Exit\n", __func__));
+  DEBUG ((DEBUG_REDFISH_PLATFORM_CONFIG, "%a: Exit\n", __func__));
   return Status;
 }
 
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
index 537ce09a2d3..86f3aa529c5 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c
@@ -2,7 +2,7 @@
   The implementation of EDKII Redfish Platform Config Protocol.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
   Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -656,8 +656,10 @@ GetStatementPrivateByConfigureLangRegex (
   ++StatementList->Count;
 }
   } else {
-DEBUG 

[edk2-devel] [PATCH V2 4/6] RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Add the condition check when delete HII string.
Only when the HiiStatement operand equal to "EFI_IFR_STRING_OP"
and the statement value type = EFI_IFR_TYPE_STRING.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index 8a02c839035..d165799f9a1 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -1873,8 +1873,11 @@ RedfishPlatformConfigSetStatementCommon (
 DEBUG ((DEBUG_ERROR, "%a: failed to save question value: %r\n", __func__, 
Status));
   }
 
-  if (StatementValue->Value.string != 0) {
-HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+  if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && 
(StatementValue->Type == EFI_IFR_TYPE_STRING)) {
+if (StatementValue->Value.string != 0) {
+  // Delete HII string which was created for HII statement operand = 
EFI_IFR_STRING_OP and Type = EFI_IFR_TYPE_STRING.
+  HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+}
   }
 
   return Status;
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH V2 3/6] RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Add RedfishPlatformConfigDxe debug capability that aligns
with edk2 Redfish debug mechanism.

- PcdRedfishPlatformConfigDebugProperty, add PCD to control
  RedfishPlatformConfigDxe subordinate of Redfish debug
  capabilities.
- PcdRedfishPlatformConfigFeatureProperty, add PCD to
  manage RedfishPlatformConfigDxe features.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  15 +++
 .../RedfishPlatformConfigDxe.inf  |   8 ++
 .../RedfishPlatformConfigDxe.h|  46 +++-
 .../RedfishPlatformConfigImpl.h   |  28 +
 .../RedfishPlatformConfigCapability.c |  58 ++
 .../RedfishPlatformConfigDxe.c|  59 +++---
 .../RedfishPlatformConfigImpl.c   | 107 +++---
 7 files changed, 262 insertions(+), 59 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index a9665ff68ef..c048e43f53b 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -193,3 +193,18 @@
   #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
   #
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
+  #
+  # Redfish RedfishPlatformConfigDxe Debug Properties
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|UINT32|0x1013
+  #
+  # RedfishPlatformConfigDxe feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  #
+  # Redfish RedfishPlatformConfigDxe feature Properties
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0|UINT32|0x1014
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
index 5a249c8c3bc..2db47c2cffc 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
@@ -3,6 +3,7 @@
 #
 #  (C) Copyright 2021 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
 #
@@ -23,6 +24,7 @@
   RedfishPkg/RedfishPkg.dec
 
 [Sources]
+  RedfishPlatformConfigCapability.c
   RedfishPlatformConfigDxe.h
   RedfishPlatformConfigDxe.c
   RedfishPlatformConfigImpl.h
@@ -36,7 +38,9 @@
   HiiLib
   HiiUtilityLib
   MemoryAllocationLib
+  PcdLib
   PrintLib
+  RedfishDebugLib
   UefiLib
   UefiBootServicesTableLib
   UefiRuntimeServicesTableLib
@@ -51,5 +55,9 @@
 [Guids]
   gEfiRegexSyntaxTypePerlGuid ## CONSUMED
 
+[FixedPcd]
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 38adea04c5b..688f2067bff 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -3,6 +3,7 @@
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
   Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,7 +21,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -37,6 +40,41 @@
 //
 #include 
 
+//
+// Debug message in DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE scope.
+// To enable the debug message for this module, below PCDs must be set.
+//
+// 1. DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+//
+// 2  RedfishPlatformConfigDxe debug enablement must be set in
+//PcdRedfishDebugCategory (defined in RedfishPkg.dec)
+//
+// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+//in RedfishPkg.dec).
+//
+#define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
+  while (RedfishPlatformConfigDebugProp (DebugSubordinate)) { \
+DEBUG_REDFISH(DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE, ##__VA_ARGS__); 
\
+break; \
+  }
+
+#define DEBUG_REDFISH_THIS_MODULE_CODE_BEGIN(DebugSubordinate) \
+  if (RedfishPlatformConfigDebugProp 

[edk2-devel] [PATCH V2 2/6] RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

Introduce DEBUG_REDFISH macro for the debug message
of edk2 Redfish components.
DEBUG_REDFISH can be used in any edk2 Redfish component
with Redfish DebugCatagory as the first parameter.
Whether the debug message is output or not depends on
the platform setting of PcdRedfishDebugCatagory.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  9 +++
 .../RedfishDebugLib/RedfishDebugLib.inf   |  4 ++
 RedfishPkg/Include/Library/RedfishDebugLib.h  | 43 +++
 .../Library/RedfishDebugLib/RedfishDebugLib.c | 55 ---
 4 files changed, 57 insertions(+), 54 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 1a9c9ed7bc5..a9665ff68ef 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -5,6 +5,7 @@
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
 # Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -184,3 +185,11 @@
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
   ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
+  #
+  # Redfish debug catagories
+  # To enable the debug message for the entire edk2 Redfish implementation, 
below PCDs must be set.
+  # DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+  #
+  #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index d468bb213b6..42ff321b48e 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -2,6 +2,7 @@
 #  INF file for Redfish debug library.
 #
 #  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,5 +36,8 @@
   RedfishHttpLib
   UefiLib
 
+[FixedPcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index ad7a6975867..19e5a895cc8 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -2,6 +2,7 @@
   This file defines the Redfish debug library interface.
 
   Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -11,28 +12,48 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 
-#define DEBUG_REDFISH_NETWORK DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
-#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
+// Used with MdePKg DEBUG macro.
+#define DEBUG_REDFISH_NETWORK  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Host INterface
+#define DEBUG_REDFISH_PLATFORM_CONFIG  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Platform Configure Driver
+
+//
+// Definitions of Redfish debug capability in Redfish component scope, used 
with DEBUG_REDFISH macro
+// For example, Redfish Platform Config Driver
+//   DEBUG_REDFISH(DEBUG_REDFISH_PLATFORM_CONFIG_DXE, ...)
+//
+#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE  0x0001
+
+#define DEBUG_REDFISH(DebugCategory, ...) \
+do {\
+  if (!DebugPrintEnabled()) {   \
+break;  \
+  } \
+  if (!DebugRedfishComponentEnabled (DebugCategory)) { \
+break; \
+  }\
+  DEBUG ((DEBUG_MANAGEABILITY, ##__VA_ARGS__));   \
+} while (FALSE)
 
 /**
-  Debug print the value of StatementValue.
+  Determine whether the Redfish debug category is enabled in
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory.
 
-  @param[in]  ErrorLevel DEBUG macro error level.
-  @param[in]  StatementValue The statement value to print.
+  @param[in]  DebugCategory  

[edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-03-26 Thread Chang, Abner via groups.io
From: abnchang 

Build up the x-uefi-redfish string database for the Redfish confg
language searching, instead of using HII String protocol.
This can improve the time consumption lot on searching strings.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigImpl.h   | 107 ++-
 .../RedfishPlatformConfigDxe.c|  23 +-
 .../RedfishPlatformConfigImpl.c   | 820 +-
 3 files changed, 878 insertions(+), 72 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
index 9f4312decf5..6e6c7fdb8a9 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
@@ -2,7 +2,8 @@
   This file defines the EDKII Redfish Platform Config Protocol private 
structure.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -30,6 +31,10 @@
 #define ENGLISH_LANGUAGE_CODE  "en-US"
 #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
 
+#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in UCS.
+
+typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE 
REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
 //
@@ -46,17 +51,49 @@ typedef struct {
   CHAR8**SchemaList;// Schema list
 } REDFISH_PLATFORM_CONFIG_SCHEMA;
 
+// Defines the number of elements in array
+#define X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
+
+//
+// Definition of x-uefi-redfish string element.
+//
+typedef struct {
+  EFI_STRING_IDStringId;
+  CHAR16   *UcsString;
+} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
+
+//
+// Discrete string array buffer, each has X_UEFI_REDFISH_STRING_ARRAY_NUMBER 
element.
+//
+typedef struct {
+  LIST_ENTRY  NextArray;
+  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
+} REDFISH_X_UEFI_STRINGS_ARRAY;
+
+//
+// x-uefi-redfish string database, x-uefi-redfish language based.
+//
+typedef struct {
+  LIST_ENTRYNextXuefiRedfishLanguage; 
// Link to the next suppoted x-uefi-Redfish language.
+  CHAR8 *XuefiRedfishLanguage;
// x-uefi-redfish language.
+  UINTN StringsArrayBlocks;   
// Number of the array blocks that accommodate 
X_UEFI_REDFISH_STRING_ARRAY_NUMBER
+  
// elements in each.
+  LIST_ENTRYXuefiRedfishStringArrays; 
// Link entry of x-uefi-redfish string array.
+} REDFISH_X_UEFI_STRING_DATABASE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
 //
 typedef struct {
   LIST_ENTRYLink;
-  HII_FORMSET   *HiiFormSet; // Pointer to HII formset 
data.
-  EFI_GUID  Guid;// Formset GUID.
-  EFI_HII_HANDLEHiiHandle;   // Hii Handle of this 
formset.
-  LIST_ENTRYHiiFormList; // Form list that keep 
form data under this formset.
-  CHAR16*DevicePathStr;  // Device path of this 
formset.
-  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema; // Schema that is 
supported in this formset.
+  HII_FORMSET   *HiiFormSet;// Pointer to 
HII formset data.
+  EFI_GUID  Guid;   // Formset 
GUID.
+  EFI_HII_HANDLEHiiHandle;  // Hii Handle 
of this formset.
+  EFI_HII_PACKAGE_LIST_HEADER   *HiiPackageListHeader;  // Hii Package 
list header.
+  LIST_ENTRYHiiFormList;// Form list 
that keep form data under this formset.
+  CHAR16*DevicePathStr; // Device path 
of this formset.
+  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema;// Schema that 
is supported in this formset.
+  LIST_ENTRYXuefiRedfishStringDatabase; // 
x-uefi-redfish string/Id data base;
 } REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE;
 
 #define REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK(a)  BASE_CR (a, 
REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE, Link)
@@ -90,19 +127,19 @@ typedef struct {
 //
 // Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
 //
-typedef struct {
+struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE {
   LIST_ENTRYLink;
   

[edk2-devel] [PATCH V2 0/6] [PATCH V2 0/5] Config language searching algorithm enhancement and the bug fixes

2024-03-26 Thread Chang, Abner via groups.io
From: Abner Chang 

PR # 5491

In V2, add patch 6/6 contibuted by Nvidia for updating BIOS
menu path implementation based on the performance improvement.

In this patch set,
1 We enhance the config language searching algorithm.
  As the performance of searching config language using HII GetString is
  pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
  to build up the metadata required for Redfish BIOS resource. With this
  improvement, it only takes 4 seconds.

2.Introduce the Redfish debug framework, there are three edk2 Redfish
  debug scopes.
  a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
 for edk2 Redfish.
  b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
 component. Currently we only support RedfishPlatformConfigDxe
 module.
  c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
 scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.

3 This patch set also fixes an issue that deletes HII string unexpectedly.

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

Abner Chang (4):
  RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
  RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
  RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
unexpectedly
  EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

Nickle Wang (1):
  RedfishPkg/RedfishPlatformConfigDxe: support menu path report

abnchang (1):
  RedfishPkg/RedfishPlatformConfigDxe: Config language searching
optimization

 RedfishPkg/RedfishPkg.dec |  24 +
 EmulatorPkg/EmulatorPkg.dsc   |  21 +
 .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
 .../RedfishPlatformConfigDxe.inf  |   8 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
 .../RedfishPlatformConfigDxe.h|  48 +-
 .../RedfishPlatformConfigImpl.h   | 135 ++-
 .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
 .../RedfishPlatformConfigCapability.c |  58 ++
 .../RedfishPlatformConfigDxe.c|  89 +-
 .../RedfishPlatformConfigImpl.c   | 928 --
 11 files changed, 1240 insertions(+), 173 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117122): https://edk2.groups.io/g/devel/message/117122
Mute This Topic: https://groups.io/mt/105159781/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][RFC PATCH 0/3] RedfishClientPkg: fix GetRedpathNodeByIndex()

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

For this patch set,  Reviewed-by: Abner Chang 

Hi Nickle, please also take a look at this change. Thanks
Abner

> -Original Message-
> From: Mike Maslenkin 
> Sent: Saturday, March 23, 2024 8:01 PM
> To: devel@edk2.groups.io
> Cc: Chang, Abner ; Igor Kulchytskyy ;
> Nickle Wang ; Mike Maslenkin
> 
> Subject: [edk2-redfish-client][RFC PATCH 0/3] RedfishClientPkg: fix
> GetRedpathNodeByIndex()
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> This set contains fixes for proper nodes handling in GetRedpathNodeByIndex().
> It fixes handling of nodes with Index different from 0,
> it removes leading '/' returned for section with Index = 0,
> also it fixes return of the last section.

This set does not have any impact 
> to
> existing code,
> because in all places this function is used to obtain the end of the first 
> section.
> And actually returned pointer to the requested section is not used.
> The current usages is:
>GetRedpathNodeByIndex (ConfigLangList.List[0].ConfigureLang, 0,
> );
>
> and return of EndOfChar value is not affected by this set.
>
> Cc: Abner Chang 
> Cc: Igor Kulchytskyy 
> Cc: Nickle Wang 
> Signed-off-by: Mike Maslenkin 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117073): https://edk2.groups.io/g/devel/message/117073
Mute This Topic: https://groups.io/mt/105101990/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 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

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

Ah I got your point. I reviewed that function and sent the V5.
Thanks
Abner


> -Original Message-
> From: Mike Maslenkin 
> Sent: Friday, March 22, 2024 6:08 PM
> To: Chang, Abner 
> Cc: devel@edk2.groups.io; Igor Kulchytskyy ; Nickle Wang
> 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2]
> RedfishClientPkg: Set SettingsObject URI as the config language
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
>  Hi Abner,
>
> Sorry if I wasn't clear.
> I meant in this function including the success path.
> RedfishSetRedfishUri->..->NewConfigLangMapRecord() creates a copy of
> this string, so it should be freed in this function.
>
> Regards,
> Mike.
>
>
> On Fri, Mar 22, 2024 at 12:58 PM Chang, Abner 
> wrote:
> >
> > [AMD Official Use Only - General]
> >
> > Hi Mike,
> > Thanks for catching this, V4 sent.
> >
> > Abner
> >
> > > -Original Message-
> > > From: M M 
> > > Sent: Friday, March 22, 2024 5:20 PM
> > > To: devel@edk2.groups.io; Chang, Abner 
> > > Cc: Igor Kulchytskyy ; Nickle Wang
> 
> > > Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2]
> > > RedfishClientPkg: Set SettingsObject URI as the config language
> > >
> > > Caution: This message originated from an External Source. Use proper
> caution
> > > when opening attachments, clicking links, or responding.
> > >
> > >
> > > Hi Abner,
> > >
> > > > On 22. 3. 2024., at 12:09, Chang, Abner via groups.io
> > >  wrote:
> > > >
> > > > From: Abner Chang 
> > > >
> > > > Set SettingsObject URI in @Redfish.Settings resource as the config
> > > > language which is the same as the config language of parent URI
> > > > that mandates @Redfish.Settings.
> > > > With this, we can find the config language of the properties in
> > > > SettingsObject URI.
> > > >
> > > > Signed-off-by: Abner Chang 
> > > > Cc: Igor Kulchytskyy 
> > > > Co-authored-by: Nickle Wang 
> > > > ---
> > > > .../Library/RedfishFeatureUtilityLib.h| 17 
> > > > .../RedfishFeatureUtilityLib.c| 86 ---
> > > > .../RedfishConfigLangMapDxe.c | 15 +++-
> > > > 3 files changed, 101 insertions(+), 17 deletions(-)
> > > >
> > > > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > > index ba9ea01501..3c5f248eb7 100644
> > > > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > > > @@ -369,6 +369,23 @@ RedfishSetRedfishUri (
> > > >   INEFI_STRING  Uri
> > > >   );
> > > >
> > > > +/**
> > > > +
> > > > +  Save Redfish SettingsObject URI in database for further use.
> > > > +
> > > > +  @param[in]ParentUri Parent URI of @Redfish.Settings 
> > > > property.
> > > > +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> > > > +
> > > > +  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
> > > > +  @retval  EFI_SUCCESSRedfish uri is saved
> > > > +
> > > > +**/
> > > > +EFI_STATUS
> > > > +SetRedfishSettingsObjectsUri (
> > > > +  IN EFI_STRING  ParentUri,
> > > > +  IN EFI_STRING  SettingObjectUri
> > > > +  );
> > > > +
> > > > /**
> > > >
> > > >   Get the property name by given Configure Language.
> > > > diff --git
> > >
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> > > c
> > >
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> > > c
> > > > index cc2b37b796..c37bf85310 100644
> > > > ---
> > >
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> > > c
> > > > +++
> > >
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> > > c
> > > > @@ -2082,7 +2082,6 @@ GetConfigureLang (
> > > >   EFI_STRING  Resul

[edk2-devel] [edk2-redfish-client][PATCH V5 2/2] RedfishClientPkg/FeatureDriver: Use SetRedfishSettingsObjectsUri

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Use SetRedfishSettingsObjectsUri to set the config language
for SettingsObject URI.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c  | 1 +
 RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c  | 1 +
 .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c  | 1 +
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c   | 1 +
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index 1ca920640a..bb64ef8625 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -141,6 +141,7 @@ RedfishResourceConsumeResource (
 );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
index 7501c1a975..5a66fe59e0 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
@@ -130,6 +130,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings found: 
%s\n", __func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
index 1235760a18..a0c71212b3 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
@@ -133,6 +133,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 5207362dac..494bf59dfc 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index c4a363cdf5..f2c0a7735b 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117053): https://edk2.groups.io/g/devel/message/117053
Mute This Topic: https://groups.io/mt/105086470/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 V5 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Set SettingsObject URI in @Redfish.Settings resource as the config
language which is the same as the config language of parent URI
that mandates @Redfish.Settings.
With this, we can find the config language of the properties in
SettingsObject URI.

Signed-off-by: Abner Chang 
Cc: Igor Kulchytskyy 
Co-authored-by: Nickle Wang 
---
 .../Library/RedfishFeatureUtilityLib.h| 17 
 .../RedfishFeatureUtilityLib.c| 89 ---
 .../RedfishConfigLangMapDxe.c | 15 +++-
 3 files changed, 104 insertions(+), 17 deletions(-)

diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h 
b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
index ba9ea01501..3c5f248eb7 100644
--- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
+++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
@@ -369,6 +369,23 @@ RedfishSetRedfishUri (
   INEFI_STRING  Uri
   );
 
+/**
+
+  Save Redfish SettingsObject URI in database for further use.
+
+  @param[in]ParentUri Parent URI of @Redfish.Settings property.
+  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
+
+  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
+  @retval  EFI_SUCCESSRedfish uri is saved
+
+**/
+EFI_STATUS
+SetRedfishSettingsObjectsUri (
+  IN EFI_STRING  ParentUri,
+  IN EFI_STRING  SettingObjectUri
+  );
+
 /**
 
   Get the property name by given Configure Language.
diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
index cc2b37b796..dda80c4608 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
@@ -2082,7 +2082,6 @@ GetConfigureLang (
   EFI_STRING  ResultStr;
   EFI_STRING  UnicodeUri;
   EFI_STATUS  Status;
-  EFI_STRING  StrFound;
 
   if (IS_EMPTY_STRING (Uri)) {
 return NULL;
@@ -2101,18 +2100,6 @@ GetConfigureLang (
   }
 
   ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
-  if (ConfigLang == NULL) {
-//
-// @Redfish.Settings share the same schema as its parent.
-// Remove "Settings" and try again.
-//
-StrFound = StrStr (UnicodeUri, L"/Settings");
-if (StrFound != NULL) {
-  StrFound[0] = L'\0';
-  DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try: %s\n", 
__func__, UnicodeUri));
-  ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
-}
-  }
 
   FreePool (UnicodeUri);
 
@@ -2172,6 +2159,64 @@ RedfishSetRedfishUri (
   return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang, Uri);
 }
 
+/**
+
+  Save Redfish SettingsObject URI in database for further use.
+
+  @param[in]ParentUri Parent URI of @Redfish.Settings property.
+  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
+
+  @retval  EFI_INVALID_PARAMETER  ParentUri or SettingObjectUri is NULL.
+  @retval  EFI_NOT_FOUND  Config language for ParentUri is not found.
+  @retval  EFI_SUCCESSRedfish URI is saved with corresponding
+  config language.
+
+**/
+EFI_STATUS
+SetRedfishSettingsObjectsUri (
+  IN EFI_STRING  ParentUri,
+  IN EFI_STRING  SettingObjectUri
+  )
+{
+  EFI_STATUS  Status;
+  EFI_STRING  ConfigLang;
+
+  if ((ParentUri == NULL) || (SettingObjectUri == NULL)) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Check if the SettingsObject URI already in the database.
+  //
+  Status = EFI_SUCCESS;
+  ConfigLang = RedfishGetConfigLanguage (SettingObjectUri);
+  if (ConfigLang == NULL) {
+//
+// No config language of SettingsObject URI is found.
+// Get the config language of parent URI because the data model of
+// SettingsObject URI resource is the same as the data model of parent URI.
+//
+ConfigLang = RedfishGetConfigLanguage (ParentUri);
+if (ConfigLang == NULL) {
+  DEBUG ((DEBUG_ERROR, "%a: Failed to get the config language of parent 
URI that mandates SettingsObject - %s.\n", __func__, ParentUri));
+  Status = EFI_NOT_FOUND;
+} else {
+
+  // Set the config language of settings URI using parent's URI config 
language.
+  Status = RedfishSetRedfishUri (ConfigLang, SettingObjectUri);
+  if (EFI_ERROR (Status)) {
+DEBUG ((DEBUG_ERROR, "%a: Fails to set the config language of 
SettingsObject - %s.\n", __func__, SettingObjectUri));
+  } else {
+DEBUG ((DEBUG_INFO, "%a: Set the config language of SettingsObject - 
%s: SUCCESS.\n", __func__, SettingObjectUri));
+  }
+  FreePool (ConfigLang); // Free the ConfigLang of parent URI.
+}
+  } else {
+FreePool (ConfigLang); // Free the ConfigLang of SettingObject URI.
+  }
+  return Status;
+}
+
 /**
 
   Get @odata.id from give HTTP payload. It's call responsibility to release 
returned 

Re: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

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

Hi Mike,
Thanks for catching this, V4 sent.

Abner

> -Original Message-
> From: M M 
> Sent: Friday, March 22, 2024 5:20 PM
> To: devel@edk2.groups.io; Chang, Abner 
> Cc: Igor Kulchytskyy ; Nickle Wang 
> Subject: Re: [edk2-devel] [edk2-redfish-client][PATCH V3 1/2]
> RedfishClientPkg: Set SettingsObject URI as the config language
>
> Caution: This message originated from an External Source. Use proper caution
> when opening attachments, clicking links, or responding.
>
>
> Hi Abner,
>
> > On 22. 3. 2024., at 12:09, Chang, Abner via groups.io
>  wrote:
> >
> > From: Abner Chang 
> >
> > Set SettingsObject URI in @Redfish.Settings resource as the config
> > language which is the same as the config language of parent URI
> > that mandates @Redfish.Settings.
> > With this, we can find the config language of the properties in
> > SettingsObject URI.
> >
> > Signed-off-by: Abner Chang 
> > Cc: Igor Kulchytskyy 
> > Co-authored-by: Nickle Wang 
> > ---
> > .../Library/RedfishFeatureUtilityLib.h| 17 
> > .../RedfishFeatureUtilityLib.c| 86 ---
> > .../RedfishConfigLangMapDxe.c | 15 +++-
> > 3 files changed, 101 insertions(+), 17 deletions(-)
> >
> > diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > index ba9ea01501..3c5f248eb7 100644
> > --- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > +++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
> > @@ -369,6 +369,23 @@ RedfishSetRedfishUri (
> >   INEFI_STRING  Uri
> >   );
> >
> > +/**
> > +
> > +  Save Redfish SettingsObject URI in database for further use.
> > +
> > +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> > +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> > +
> > +  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
> > +  @retval  EFI_SUCCESSRedfish uri is saved
> > +
> > +**/
> > +EFI_STATUS
> > +SetRedfishSettingsObjectsUri (
> > +  IN EFI_STRING  ParentUri,
> > +  IN EFI_STRING  SettingObjectUri
> > +  );
> > +
> > /**
> >
> >   Get the property name by given Configure Language.
> > diff --git
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> > index cc2b37b796..c37bf85310 100644
> > ---
> a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> > +++
> b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.
> c
> > @@ -2082,7 +2082,6 @@ GetConfigureLang (
> >   EFI_STRING  ResultStr;
> >   EFI_STRING  UnicodeUri;
> >   EFI_STATUS  Status;
> > -  EFI_STRING  StrFound;
> >
> >   if (IS_EMPTY_STRING (Uri)) {
> > return NULL;
> > @@ -2101,18 +2100,6 @@ GetConfigureLang (
> >   }
> >
> >   ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> > -  if (ConfigLang == NULL) {
> > -//
> > -// @Redfish.Settings share the same schema as its parent.
> > -// Remove "Settings" and try again.
> > -//
> > -StrFound = StrStr (UnicodeUri, L"/Settings");
> > -if (StrFound != NULL) {
> > -  StrFound[0] = L'\0';
> > -  DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try:
> %s\n", __func__, UnicodeUri));
> > -  ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
> > -}
> > -  }
> >
> >   FreePool (UnicodeUri);
> >
> > @@ -2172,6 +2159,61 @@ RedfishSetRedfishUri (
> >   return mConfigLangMapProtocol->Set (mConfigLangMapProtocol,
> ConfigLang, Uri);
> > }
> >
> > +/**
> > +
> > +  Save Redfish SettingsObject URI in database for further use.
> > +
> > +  @param[in]ParentUri Parent URI of @Redfish.Settings property.
> > +  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
> > +
> > +  @retval  EFI_INVALID_PARAMETER  ParentUri or SettingObjectUri is NULL.
> > +  @retval  EFI_NOT_FOUND  Config language for ParentUri is not 
> > found.
> > +  @retval  EFI_SUCCESSRedfish URI is saved with corresponding
> > +  config language.
> > +
> > +**/
> > +EFI_STATUS
> > +SetRedfishSet

[edk2-devel] [edk2-redfish-client][PATCH V4 1/2] RedfishClientPkg: Set SettingsObject URI as the config language

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Set SettingsObject URI in @Redfish.Settings resource as the config
language which is the same as the config language of parent URI
that mandates @Redfish.Settings.
With this, we can find the config language of the properties in
SettingsObject URI.

Signed-off-by: Abner Chang 
Cc: Igor Kulchytskyy 
Co-authored-by: Nickle Wang 
---
 .../Library/RedfishFeatureUtilityLib.h| 17 
 .../RedfishFeatureUtilityLib.c| 87 ---
 .../RedfishConfigLangMapDxe.c | 15 +++-
 3 files changed, 102 insertions(+), 17 deletions(-)

diff --git a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h 
b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
index ba9ea01501..3c5f248eb7 100644
--- a/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
+++ b/RedfishClientPkg/Include/Library/RedfishFeatureUtilityLib.h
@@ -369,6 +369,23 @@ RedfishSetRedfishUri (
   INEFI_STRING  Uri
   );
 
+/**
+
+  Save Redfish SettingsObject URI in database for further use.
+
+  @param[in]ParentUri Parent URI of @Redfish.Settings property.
+  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
+
+  @retval  EFI_INVALID_PARAMETER  SystemId is NULL or EMPTY
+  @retval  EFI_SUCCESSRedfish uri is saved
+
+**/
+EFI_STATUS
+SetRedfishSettingsObjectsUri (
+  IN EFI_STRING  ParentUri,
+  IN EFI_STRING  SettingObjectUri
+  );
+
 /**
 
   Get the property name by given Configure Language.
diff --git 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
index cc2b37b796..02dee89b36 100644
--- 
a/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
+++ 
b/RedfishClientPkg/Library/RedfishFeatureUtilityLib/RedfishFeatureUtilityLib.c
@@ -2082,7 +2082,6 @@ GetConfigureLang (
   EFI_STRING  ResultStr;
   EFI_STRING  UnicodeUri;
   EFI_STATUS  Status;
-  EFI_STRING  StrFound;
 
   if (IS_EMPTY_STRING (Uri)) {
 return NULL;
@@ -2101,18 +2100,6 @@ GetConfigureLang (
   }
 
   ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
-  if (ConfigLang == NULL) {
-//
-// @Redfish.Settings share the same schema as its parent.
-// Remove "Settings" and try again.
-//
-StrFound = StrStr (UnicodeUri, L"/Settings");
-if (StrFound != NULL) {
-  StrFound[0] = L'\0';
-  DEBUG ((REDFISH_DEBUG_TRACE, "%a: \"Settings\" found in URI, try: %s\n", 
__func__, UnicodeUri));
-  ConfigLang = RedfishGetConfigLanguage (UnicodeUri);
-}
-  }
 
   FreePool (UnicodeUri);
 
@@ -2172,6 +2159,62 @@ RedfishSetRedfishUri (
   return mConfigLangMapProtocol->Set (mConfigLangMapProtocol, ConfigLang, Uri);
 }
 
+/**
+
+  Save Redfish SettingsObject URI in database for further use.
+
+  @param[in]ParentUri Parent URI of @Redfish.Settings property.
+  @param[in]SettingObjectUri  Redfish SettingsObject Uri to save.
+
+  @retval  EFI_INVALID_PARAMETER  ParentUri or SettingObjectUri is NULL.
+  @retval  EFI_NOT_FOUND  Config language for ParentUri is not found.
+  @retval  EFI_SUCCESSRedfish URI is saved with corresponding
+  config language.
+
+**/
+EFI_STATUS
+SetRedfishSettingsObjectsUri (
+  IN EFI_STRING  ParentUri,
+  IN EFI_STRING  SettingObjectUri
+  )
+{
+  EFI_STATUS  Status;
+  EFI_STRING  ConfigLang;
+
+  if ((ParentUri == NULL) || (SettingObjectUri == NULL)) {
+return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // Check if the SettingsObject URI already in the database.
+  //
+  ConfigLang = RedfishGetConfigLanguage (SettingObjectUri);
+  if (ConfigLang == NULL) {
+//
+// No config language of SettingsObject URI is found.
+// Get the config language of parent URI because the data model of
+// SettingsObject URI resource is the same as the data model of parent URI.
+//
+ConfigLang = RedfishGetConfigLanguage (ParentUri);
+if (ConfigLang == NULL) {
+  DEBUG ((DEBUG_ERROR, "%a: Failed to get the config language of parent 
URI that mandates SettingsObject - %s.\n", __func__, ParentUri));
+  return EFI_NOT_FOUND;
+}
+
+// Set the config language of settings URI using parent's URI config 
language.
+Status = RedfishSetRedfishUri (ConfigLang, SettingObjectUri);
+if (EFI_ERROR (Status)) {
+  FreePool (ConfigLang);
+  DEBUG ((DEBUG_ERROR, "%a: Fails to set the config language of 
SettingsObject - %s.\n", __func__, SettingObjectUri));
+  return Status;
+}
+
+DEBUG ((DEBUG_INFO, "%a: Set the config language of SettingsObject - %s: 
SUCCESS.\n", __func__, SettingObjectUri));
+  }
+
+  return EFI_SUCCESS;
+}
+
 /**
 
   Get @odata.id from give HTTP payload. It's call responsibility to release 
returned buffer.
@@ -3532,6 +3575,7 @@ CompareRedfishBooleanArrayValues (
   payload and URI to pending settings. Caller has to release "SettingPayload" 
and
   "SettingUri".
 
+  

[edk2-devel] [edk2-redfish-client][PATCH V4 2/2] RedfishClientPkg/FeatureDriver: Use SetRedfishSettingsObjectsUri

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Use SetRedfishSettingsObjectsUri to set the config language
for SettingsObject URI.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c  | 1 +
 RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c  | 1 +
 .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c  | 1 +
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c   | 1 +
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index 1ca920640a..bb64ef8625 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -141,6 +141,7 @@ RedfishResourceConsumeResource (
 );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
index 7501c1a975..5a66fe59e0 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
@@ -130,6 +130,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings found: 
%s\n", __func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
index 1235760a18..a0c71212b3 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
@@ -133,6 +133,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 5207362dac..494bf59dfc 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index c4a363cdf5..f2c0a7735b 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH 3/5] RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Add RedfishPlatformConfigDxe debug capability that aligns
with edk2 Redfish debug mechanism.

- PcdRedfishPlatformConfigDebugProperty, add PCD to control
  RedfishPlatformConfigDxe subordinate of Redfish debug
  capabilities.
- PcdRedfishPlatformConfigFeatureProperty, add PCD to
  manage RedfishPlatformConfigDxe features.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  15 +++
 .../RedfishPlatformConfigDxe.inf  |   8 ++
 .../RedfishPlatformConfigDxe.h|  46 +++-
 .../RedfishPlatformConfigImpl.h   |  24 +
 .../RedfishPlatformConfigCapability.c |  52 +
 .../RedfishPlatformConfigDxe.c|  59 +++
 .../RedfishPlatformConfigImpl.c   | 100 +++---
 7 files changed, 248 insertions(+), 56 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index a9665ff68ef..c048e43f53b 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -193,3 +193,18 @@
   #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
   #
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
+  #
+  # Redfish RedfishPlatformConfigDxe Debug Properties
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  #
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0|UINT32|0x1013
+  #
+  # RedfishPlatformConfigDxe feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  #
+  # Redfish RedfishPlatformConfigDxe feature Properties
+  
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0|UINT32|0x1014
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
index 5a249c8c3bc..2db47c2cffc 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.inf
@@ -3,6 +3,7 @@
 #
 #  (C) Copyright 2021 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
 #
@@ -23,6 +24,7 @@
   RedfishPkg/RedfishPkg.dec
 
 [Sources]
+  RedfishPlatformConfigCapability.c
   RedfishPlatformConfigDxe.h
   RedfishPlatformConfigDxe.c
   RedfishPlatformConfigImpl.h
@@ -36,7 +38,9 @@
   HiiLib
   HiiUtilityLib
   MemoryAllocationLib
+  PcdLib
   PrintLib
+  RedfishDebugLib
   UefiLib
   UefiBootServicesTableLib
   UefiRuntimeServicesTableLib
@@ -51,5 +55,9 @@
 [Guids]
   gEfiRegexSyntaxTypePerlGuid ## CONSUMED
 
+[FixedPcd]
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty
+ gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
index 38adea04c5b..688f2067bff 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.h
@@ -3,6 +3,7 @@
 
   (C) Copyright 2021 Hewlett Packard Enterprise Development LP
   Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -20,7 +21,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -37,6 +40,41 @@
 //
 #include 
 
+//
+// Debug message in DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE scope.
+// To enable the debug message for this module, below PCDs must be set.
+//
+// 1. DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+//
+// 2  RedfishPlatformConfigDxe debug enablement must be set in
+//PcdRedfishDebugCategory (defined in RedfishPkg.dec)
+//
+// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
+//must be set in PcdRedfishPlatformConfigDebugPropert (defined
+//in RedfishPkg.dec).
+//
+#define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
+  while (RedfishPlatformConfigDebugProp (DebugSubordinate)) { \
+DEBUG_REDFISH(DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE, ##__VA_ARGS__); 
\
+break; \
+  }
+
+#define DEBUG_REDFISH_THIS_MODULE_CODE_BEGIN(DebugSubordinate) \
+  if (RedfishPlatformConfigDebugProp 

[edk2-devel] [PATCH 5/5] EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
---
 EmulatorPkg/EmulatorPkg.dsc | 21 +
 1 file changed, 21 insertions(+)

diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc
index 85134b07816..5fa1ed345a3 100644
--- a/EmulatorPkg/EmulatorPkg.dsc
+++ b/EmulatorPkg/EmulatorPkg.dsc
@@ -278,6 +278,27 @@
   
gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceDevicePath.DevicePath|{DEVICE_PATH("MAC(,0x1)")}
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishRestExServiceAccessModeInBand|False
   gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDiscoverAccessModeInBand|False
+
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfSecureBootDisabled|False
+  gEmulatorPkgTokenSpaceGuid.PcdRedfishServiceStopIfExitbootService|False
+
+  gEfiRedfishClientPkgTokenSpaceGuid.PcdRedfishServiceEtagSupported|False
+
+  #
+  # Redfish Debug enablement
+  #
+  # 0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0
+  #   0x0001  x-uefi-redfish string database message enabled
+  #   0x0002  Debug Message for dumping formset
+  #   0x0004  Debug Message for x-uefi-redfish searching result
+  #   0x0008  Debug Message for x-uefi-redfish Regular Expression 
searching result
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigDebugProperty|0
+
+  # Redfish Platform Configure DXE driver feature enablement
+  #   0x0001  Enable building Redfish Attribute Registry menu path.
+  #   0x0002  Allow supressed HII option to be exposed on Redfish.
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishPlatformConfigFeatureProperty|0
 !endif
 
 [PcdsDynamicDefault.common.DEFAULT]
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH 4/5] RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted unexpectedly

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Add the condition check when delete HII string.
Only when the HiiStatement operand equal to "EFI_IFR_STRING_OP"
and the statement value type = EFI_IFR_TYPE_STRING.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c| 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
index 8a02c839035..d165799f9a1 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c
@@ -1873,8 +1873,11 @@ RedfishPlatformConfigSetStatementCommon (
 DEBUG ((DEBUG_ERROR, "%a: failed to save question value: %r\n", __func__, 
Status));
   }
 
-  if (StatementValue->Value.string != 0) {
-HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+  if ((TargetStatement->HiiStatement->Operand == EFI_IFR_STRING_OP) && 
(StatementValue->Type == EFI_IFR_TYPE_STRING)) {
+if (StatementValue->Value.string != 0) {
+  // Delete HII string which was created for HII statement operand = 
EFI_IFR_STRING_OP and Type = EFI_IFR_TYPE_STRING.
+  HiiDeleteString (StatementValue->Value.string, 
TargetStatement->ParentForm->ParentFormset->HiiHandle);
+}
   }
 
   return Status;
-- 
2.37.1.windows.1



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




[edk2-devel] [PATCH 1/5] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization

2024-03-22 Thread Chang, Abner via groups.io
From: abnchang 

Build up the x-uefi-redfish string database for the Redfish confg
language searching, instead of using HII String protocol.
This can improve the time consumption lot on searching strings.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 .../RedfishPlatformConfigImpl.h   | 107 ++-
 .../RedfishPlatformConfigDxe.c|  23 +-
 .../RedfishPlatformConfigImpl.c   | 820 +-
 3 files changed, 878 insertions(+), 72 deletions(-)

diff --git a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h 
b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
index 9f4312decf5..6e6c7fdb8a9 100644
--- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
+++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h
@@ -2,7 +2,8 @@
   This file defines the EDKII Redfish Platform Config Protocol private 
structure.
 
   (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP
-  Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -30,6 +31,10 @@
 #define ENGLISH_LANGUAGE_CODE  "en-US"
 #define X_UEFI_SCHEMA_PREFIX   "x-uefi-redfish-"
 
+#define MAX_X_UEFI_REDFISH_STRING_SIZE  (128 * 2)// 128 character in UCS.
+
+typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE 
REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE.
 //
@@ -46,17 +51,49 @@ typedef struct {
   CHAR8**SchemaList;// Schema list
 } REDFISH_PLATFORM_CONFIG_SCHEMA;
 
+// Defines the number of elements in array
+#define X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER  1024
+
+//
+// Definition of x-uefi-redfish string element.
+//
+typedef struct {
+  EFI_STRING_IDStringId;
+  CHAR16   *UcsString;
+} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT;
+
+//
+// Discrete string array buffer, each has X_UEFI_REDFISH_STRING_ARRAY_NUMBER 
element.
+//
+typedef struct {
+  LIST_ENTRY  NextArray;
+  REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT*ArrayEntryAddress;
+} REDFISH_X_UEFI_STRINGS_ARRAY;
+
+//
+// x-uefi-redfish string database, x-uefi-redfish language based.
+//
+typedef struct {
+  LIST_ENTRYNextXuefiRedfishLanguage; 
// Link to the next suppoted x-uefi-Redfish language.
+  CHAR8 *XuefiRedfishLanguage;
// x-uefi-redfish language.
+  UINTN StringsArrayBlocks;   
// Number of the array blocks that accommodate 
X_UEFI_REDFISH_STRING_ARRAY_NUMBER
+  
// elements in each.
+  LIST_ENTRYXuefiRedfishStringArrays; 
// Link entry of x-uefi-redfish string array.
+} REDFISH_X_UEFI_STRING_DATABASE;
+
 //
 // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE
 //
 typedef struct {
   LIST_ENTRYLink;
-  HII_FORMSET   *HiiFormSet; // Pointer to HII formset 
data.
-  EFI_GUID  Guid;// Formset GUID.
-  EFI_HII_HANDLEHiiHandle;   // Hii Handle of this 
formset.
-  LIST_ENTRYHiiFormList; // Form list that keep 
form data under this formset.
-  CHAR16*DevicePathStr;  // Device path of this 
formset.
-  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema; // Schema that is 
supported in this formset.
+  HII_FORMSET   *HiiFormSet;// Pointer to 
HII formset data.
+  EFI_GUID  Guid;   // Formset 
GUID.
+  EFI_HII_HANDLEHiiHandle;  // Hii Handle 
of this formset.
+  EFI_HII_PACKAGE_LIST_HEADER   *HiiPackageListHeader;  // Hii Package 
list header.
+  LIST_ENTRYHiiFormList;// Form list 
that keep form data under this formset.
+  CHAR16*DevicePathStr; // Device path 
of this formset.
+  REDFISH_PLATFORM_CONFIG_SCHEMASupportedSchema;// Schema that 
is supported in this formset.
+  LIST_ENTRYXuefiRedfishStringDatabase; // 
x-uefi-redfish string/Id data base;
 } REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE;
 
 #define REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK(a)  BASE_CR (a, 
REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE, Link)
@@ -90,19 +127,19 @@ typedef struct {
 //
 // Definition of REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE
 //
-typedef struct {
+struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE {
   LIST_ENTRYLink;
   

[edk2-devel] [PATCH 2/5] RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Introduce DEBUG_REDFISH macro for the debug message
of edk2 Redfish components.
DEBUG_REDFISH can be used in any edk2 Redfish component
with Redfish DebugCatagory as the first parameter.
Whether the debug message is output or not depends on
the platform setting of PcdRedfishDebugCatagory.

Signed-off-by: Abner Chang 
Cc: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishPkg/RedfishPkg.dec |  9 +++
 .../RedfishDebugLib/RedfishDebugLib.inf   |  4 ++
 RedfishPkg/Include/Library/RedfishDebugLib.h  | 43 +++
 .../Library/RedfishDebugLib/RedfishDebugLib.c | 55 ---
 4 files changed, 57 insertions(+), 54 deletions(-)

diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index 1a9c9ed7bc5..a9665ff68ef 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -5,6 +5,7 @@
 # (C) Copyright 2021 Hewlett Packard Enterprise Development LP
 # Copyright (c) 2023, American Megatrends International LLC.
 # Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 ##
@@ -184,3 +185,11 @@
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpRetryWaitInSecond|1|UINT16|0x1010
   ## This is used to disable Redfish HTTP cache function and every request 
will be sent to Redfish service.
   gEfiRedfishPkgTokenSpaceGuid.PcdHttpCacheDisabled|FALSE|BOOLEAN|0x1011
+  #
+  # Redfish debug catagories
+  # To enable the debug message for the entire edk2 Redfish implementation, 
below PCDs must be set.
+  # DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
+  #
+  #   0x0001  RedfishPlatformConfigDxe driver debug enabled.
+  #
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory|0|UINT64|0x1012
diff --git a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf 
b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
index d468bb213b6..42ff321b48e 100644
--- a/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
+++ b/RedfishPkg/Library/RedfishDebugLib/RedfishDebugLib.inf
@@ -2,6 +2,7 @@
 #  INF file for Redfish debug library.
 #
 #  Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -35,5 +36,8 @@
   RedfishHttpLib
   UefiLib
 
+[FixedPcd]
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory
+
 [Depex]
   TRUE
diff --git a/RedfishPkg/Include/Library/RedfishDebugLib.h 
b/RedfishPkg/Include/Library/RedfishDebugLib.h
index ad7a6975867..19e5a895cc8 100644
--- a/RedfishPkg/Include/Library/RedfishDebugLib.h
+++ b/RedfishPkg/Include/Library/RedfishDebugLib.h
@@ -2,6 +2,7 @@
   This file defines the Redfish debug library interface.
 
   Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights 
reserved.
+  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -11,28 +12,48 @@
 #define REDFISH_DEBUG_LIB_H_
 
 #include 
+#include 
 #include 
 #include 
 #include 
 
 #include 
 
-#define DEBUG_REDFISH_NETWORK DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
-#define DEBUG_REDFISH_HOST_INTERFACE  DEBUG_MANAGEABILITY   ///< Debug error 
level for Redfish networking function
+// Used with MdePKg DEBUG macro.
+#define DEBUG_REDFISH_NETWORK  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish networking function
+#define DEBUG_REDFISH_HOST_INTERFACE   DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Host INterface
+#define DEBUG_REDFISH_PLATFORM_CONFIG  DEBUG_MANAGEABILITY  ///< Debug 
error level for Redfish Platform Configure Driver
+
+//
+// Definitions of Redfish debug capability in Redfish component scope, used 
with DEBUG_REDFISH macro
+// For example, Redfish Platform Config Driver
+//   DEBUG_REDFISH(DEBUG_REDFISH_PLATFORM_CONFIG_DXE, ...)
+//
+#define DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE  0x0001
+
+#define DEBUG_REDFISH(DebugCategory, ...) \
+do {\
+  if (!DebugPrintEnabled()) {   \
+break;  \
+  } \
+  if (!DebugRedfishComponentEnabled (DebugCategory)) { \
+break; \
+  }\
+  DEBUG ((DEBUG_MANAGEABILITY, ##__VA_ARGS__));   \
+} while (FALSE)
 
 /**
-  Debug print the value of StatementValue.
+  Determine whether the Redfish debug category is enabled in
+  gEfiRedfishPkgTokenSpaceGuid.PcdRedfishDebugCategory.
 
-  @param[in]  ErrorLevel DEBUG macro error level.
-  @param[in]  StatementValue The statement value to print.
+  @param[in]  DebugCategory  

[edk2-devel] [PATCH 0/5] [PATCH 0/5] Config language searching algorithm enhancement and the bug fixes

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

PR # 5491

In this patch set,
1 We enhance the config language searching algorithm.
  As the performance of searching config language using HII GetString is
  pretty slow. For the example, 1800 HII BIOS options takes over 30 mins
  to build up the metadata required for Redfish BIOS resource. With this
  improvement, it only takes 4 seconds.

2.Introduce the Redfish debug framework, there are three edk2 Redfish
  debug scopes.
  a. PcdDebugPrintErrorLevel, DEBUG_MANAGEABILITY to enable debug message
 for edk2 Redfish.
  b. PcdRedfishDebugCategory, enablement of individule edk2 Redfish
 component. Currently we only support RedfishPlatformConfigDxe
 module.
  c. PcdRedfishPlatformConfigDebugProperty, edk2 Redfish module debug
 scope. This PCD is used by RedfishPlatformConfigDxe debug enablement.

3 This patch set also fixes an issue that deletes HII string unexpectedly.

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

Abner Chang (4):
  RedfishPkg/RedfishDebugLib: Introduce Redfish DEBUG macro
  RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support
  RedfishPkg/RedfishPlatformConfigDxe: HII string is deleted
unexpectedly
  EmulatorPkg/Redfish: Use edk2 Redfish debug PCDs

abnchang (1):
  RedfishPkg/RedfishPlatformConfigDxe: Config language searching
optimization

 RedfishPkg/RedfishPkg.dec |  24 +
 EmulatorPkg/EmulatorPkg.dsc   |  21 +
 .../RedfishDebugLib/RedfishDebugLib.inf   |   4 +
 .../RedfishPlatformConfigDxe.inf  |   8 +
 RedfishPkg/Include/Library/RedfishDebugLib.h  |  43 +-
 .../RedfishPlatformConfigDxe.h|  46 +-
 .../RedfishPlatformConfigImpl.h   | 131 ++-
 .../Library/RedfishDebugLib/RedfishDebugLib.c |  55 +-
 .../RedfishPlatformConfigCapability.c |  52 +
 .../RedfishPlatformConfigDxe.c|  89 +-
 .../RedfishPlatformConfigImpl.c   | 894 --
 11 files changed, 1196 insertions(+), 171 deletions(-)
 create mode 100644 
RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigCapability.c

-- 
2.37.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117036): https://edk2.groups.io/g/devel/message/117036
Mute This Topic: https://groups.io/mt/105082172/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 V3 2/2] RedfishClientPkg/FeatureDriver: Use SetRedfishSettingsObjectsUri

2024-03-22 Thread Chang, Abner via groups.io
From: Abner Chang 

Use SetRedfishSettingsObjectsUri to set the config language
for SettingsObject URI.

Signed-off-by: Abner Chang 
Co-authored-by: Nickle Wang 
Cc: Igor Kulchytskyy 
---
 RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c  | 1 +
 RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c  | 1 +
 .../Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c  | 1 +
 .../Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c   | 1 +
 RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c  | 1 +
 5 files changed, 5 insertions(+)

diff --git a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c 
b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
index 1ca920640a..bb64ef8625 100644
--- a/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
+++ b/RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.c
@@ -141,6 +141,7 @@ RedfishResourceConsumeResource (
 );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c 
b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
index 7501c1a975..5a66fe59e0 100644
--- a/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
+++ b/RedfishClientPkg/Features/BootOption/v1_0_4/Dxe/BootOptionDxe.c
@@ -130,6 +130,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_BOOT_OPTION_DEBUG_TRACE, "%a: @Redfish.Settings found: 
%s\n", __func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
index 1235760a18..a0c71212b3 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_13_0/Dxe/ComputerSystemDxe.c
@@ -133,6 +133,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git 
a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c 
b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
index 5207362dac..494bf59dfc 100644
--- a/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
+++ b/RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemDxe.c
@@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
diff --git a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c 
b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
index c4a363cdf5..f2c0a7735b 100644
--- a/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
+++ b/RedfishClientPkg/Features/Memory/V1_7_1/Dxe/MemoryDxe.c
@@ -134,6 +134,7 @@ RedfishResourceConsumeResource (
  );
   if (!EFI_ERROR (Status)) {
 DEBUG ((REDFISH_DEBUG_TRACE, "%a: @Redfish.Settings found: %s\n", 
__func__, PendingSettingUri));
+SetRedfishSettingsObjectsUri (Private->Uri, PendingSettingUri);
 Private->Uri = PendingSettingUri;
 ExpectedResponse = 
   } else {
-- 
2.37.1.windows.1



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