public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Leif Lindholm" <leif@nuviainc.com>
To: Nhi Pham <nhi@os.amperecomputing.com>
Cc: devel@edk2.groups.io, Vu Nguyen <vunguyen@os.amperecomputing.com>,
	Thang Nguyen <thang@os.amperecomputing.com>,
	Chuong Tran <chuong@os.amperecomputing.com>,
	Phong Vo <phong@os.amperecomputing.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Nate DeSimone <nathaniel.l.desimone@intel.com>
Subject: Re: [edk2-platforms][PATCH v2 22/32] AmpereAltraPkg: Add platform info screen
Date: Tue, 8 Jun 2021 00:10:02 +0100	[thread overview]
Message-ID: <20210607231002.hkwtbkndilffwr47@leviathan> (raw)
In-Reply-To: <20210526100724.5359-24-nhi@os.amperecomputing.com>

On Wed, May 26, 2021 at 17:07:14 +0700, Nhi Pham wrote:
> From: Vu Nguyen <vunguyen@os.amperecomputing.com>
> 
> Provide screen menu with basic platform information include:
> * Platform name
> * SCP firmware info
> * System bus clock frequency.
> 
> Cc: Thang Nguyen <thang@os.amperecomputing.com>
> Cc: Chuong Tran <chuong@os.amperecomputing.com>
> Cc: Phong Vo <phong@os.amperecomputing.com>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> 
> Signed-off-by: Vu Nguyen <vunguyen@os.amperecomputing.com>

Reviewed-by: Leif Lindholm <leif@nuviainc.com>

/
    Leif

> ---
>  Platform/Ampere/JadePkg/Jade.dsc                                          |   5 +
>  Platform/Ampere/JadePkg/Jade.fdf                                          |   5 +
>  Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf |  52 +++
>  Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoHii.h   |  22 ++
>  Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/Vfr.vfr             | 112 ++++++
>  Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.c   | 391 ++++++++++++++++++++
>  Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/VfrStrings.uni      |  56 +++
>  7 files changed, 643 insertions(+)
> 
> diff --git a/Platform/Ampere/JadePkg/Jade.dsc b/Platform/Ampere/JadePkg/Jade.dsc
> index 9c7d7cad4915..b5edb673abba 100755
> --- a/Platform/Ampere/JadePkg/Jade.dsc
> +++ b/Platform/Ampere/JadePkg/Jade.dsc
> @@ -174,3 +174,8 @@ [Components.common]
>    Platform/Ampere/JadePkg/Drivers/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
>    Platform/Ampere/JadePkg/Drivers/SmbiosCpuDxe/SmbiosCpuDxe.inf
>    Platform/Ampere/JadePkg/Drivers/SmbiosMemInfoDxe/SmbiosMemInfoDxe.inf
> +
> +  #
> +  # HII
> +  #
> +  Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf
> diff --git a/Platform/Ampere/JadePkg/Jade.fdf b/Platform/Ampere/JadePkg/Jade.fdf
> index 8c09e2a49089..6dd759322d9d 100755
> --- a/Platform/Ampere/JadePkg/Jade.fdf
> +++ b/Platform/Ampere/JadePkg/Jade.fdf
> @@ -350,4 +350,9 @@ [FV.FvMain]
>    INF Platform/Ampere/JadePkg/Drivers/SmbiosCpuDxe/SmbiosCpuDxe.inf
>    INF Platform/Ampere/JadePkg/Drivers/SmbiosMemInfoDxe/SmbiosMemInfoDxe.inf
>  
> +  #
> +  # HII
> +  #
> +  INF Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf
> +
>  !include Platform/Ampere/AmperePlatformPkg/FvRules.fdf.inc
> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf
> new file mode 100644
> index 000000000000..09de87915510
> --- /dev/null
> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.inf
> @@ -0,0 +1,52 @@
> +## @file
> +#
> +# Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
> +#
> +# SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION                    = 0x0001001B
> +  BASE_NAME                      = PlatformInfoDxe
> +  FILE_GUID                      = 6FDFB3E8-105E-48C4-94AA-3D7646F9B50D
> +  MODULE_TYPE                    = DXE_DRIVER
> +  VERSION_STRING                 = 1.0
> +  ENTRY_POINT                    = PlatformInfoEntryPoint
> +
> +[Sources.common]
> +  PlatformInfoDxe.c
> +  PlatformInfoHii.h
> +  Vfr.vfr
> +  VfrStrings.uni
> +
> +[Packages]
> +  MdeModulePkg/MdeModulePkg.dec
> +  MdePkg/MdePkg.dec
> +  Silicon/Ampere/AmpereAltraPkg/AmpereAltraPkg.dec
> +  Silicon/Ampere/AmpereSiliconPkg/AmpereSiliconPkg.dec
> +
> +[LibraryClasses]
> +  AmpereCpuLib
> +  BaseLib
> +  BaseMemoryLib
> +  DebugLib
> +  DevicePathLib
> +  DevicePathLib
> +  HiiLib
> +  HobLib
> +  IoLib
> +  MemoryAllocationLib
> +  UefiBootServicesTableLib
> +  UefiDriverEntryPoint
> +  UefiLib
> +
> +[Guids]
> +  gPlatformManagerFormsetGuid
> +  gEfiIfrTianoGuid
> +  gPlatformHobGuid
> +
> +[Protocols]
> +
> +[Depex]
> +  TRUE
> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoHii.h b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoHii.h
> new file mode 100644
> index 000000000000..7f363160afc8
> --- /dev/null
> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoHii.h
> @@ -0,0 +1,22 @@
> +/** @file
> +
> +  Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef PLATFORM_INFO_HII_H_
> +#define PLATFORM_INFO_HII_H_
> +
> +#define PLATFORM_INFO_FORMSET_GUID \
> +  { \
> +    0x8DF0F6FB, 0x65A5, 0x434B, { 0xB2, 0xA6, 0xCE, 0xDF, 0xD2, 0x0A, 0x96, 0x8A } \
> +  }
> +
> +#define LABEL_UPDATE             0x2223
> +#define LABEL_END                0x2224
> +
> +#define PLATFORM_INFO_FORM_ID    0x1
> +
> +#endif
> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/Vfr.vfr b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/Vfr.vfr
> new file mode 100644
> index 000000000000..5dd32a30f0ad
> --- /dev/null
> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/Vfr.vfr
> @@ -0,0 +1,112 @@
> +/** @file
> +
> +  Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include "PlatformInfoHii.h"
> +
> +formset
> +  guid      = PLATFORM_INFO_FORMSET_GUID,
> +  title     = STRING_TOKEN(STR_PLATFORM_INFO_FORM),
> +  help      = STRING_TOKEN(STR_PLATFORM_INFO_FORM_HELP),
> +  classguid = gPlatformManagerFormsetGuid,
> +
> +  form
> +    formid = PLATFORM_INFO_FORM_ID,
> +    title  = STRING_TOKEN(STR_PLATFORM_INFO_FORM);
> +    subtitle text = STRING_TOKEN(STR_PLATFORM_INFO_FORM_HELP);
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_BOARD),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_BOARD),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_BOARD_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_SCPVER),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SCPVER),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SCPVER_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_SCPBUILD),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SCPBUILD),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SCPBUILD_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_CPUINFO),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_CPUINFO),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_CPUINFO_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_CPUCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_CPUCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_CPUCLK_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_PCPCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_PCPCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_PCPCLK_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_L1ICACHE),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_L1ICACHE),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_L1ICACHE_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_L1DCACHE),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_L1DCACHE),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_L1DCACHE_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_L2CACHE),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_L2CACHE),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_L2CACHE_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_SOCCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SOCCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SOCCLK_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_SYSCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SYSCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_SYSCLK_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    text
> +      help   = STRING_TOKEN(STR_PLATFORM_INFO_AHBCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_AHBCLK),
> +      text   = STRING_TOKEN(STR_PLATFORM_INFO_AHBCLK_VALUE),
> +      flags  = 0,
> +      key    = 0;
> +
> +    label LABEL_UPDATE;
> +    // dynamic content here
> +    label LABEL_END;
> +
> +  endform;
> +
> +endformset;
> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.c b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.c
> new file mode 100644
> index 000000000000..a55d0e9da9e7
> --- /dev/null
> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/PlatformInfoDxe.c
> @@ -0,0 +1,391 @@
> +/** @file
> +
> +  Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
> +
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Uefi.h>
> +
> +#include <Guid/MdeModuleHii.h>
> +#include <Guid/PlatformInfoHobGuid.h>
> +#include <Library/AmpereCpuLib.h>
> +#include <Library/BaseLib.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/DevicePathLib.h>
> +#include <Library/DevicePathLib.h>
> +#include <Library/HiiLib.h>
> +#include <Library/HobLib.h>
> +#include <Library/IoLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +#include <Library/PrintLib.h>
> +#include <Library/UefiBootServicesTableLib.h>
> +#include <Library/UefiLib.h>
> +#include <PlatformInfoHob.h>
> +
> +#include "PlatformInfoHii.h"
> +
> +//
> +// uni string and Vfr Binary data.
> +//
> +extern UINT8 VfrBin[];
> +extern UINT8 PlatformInfoDxeStrings[];
> +
> +EFI_HANDLE     mDriverHandle = NULL;
> +EFI_HII_HANDLE mHiiHandle = NULL;
> +
> +#pragma pack(1)
> +
> +//
> +// HII specific Vendor Device Path definition.
> +//
> +typedef struct {
> +  VENDOR_DEVICE_PATH       VendorDevicePath;
> +  EFI_DEVICE_PATH_PROTOCOL End;
> +} HII_VENDOR_DEVICE_PATH;
> +
> +#pragma pack()
> +
> +// PLATFORM_INFO_FORMSET_GUID
> +EFI_GUID gPlatformInfoFormSetGuid = PLATFORM_INFO_FORMSET_GUID;
> +
> +HII_VENDOR_DEVICE_PATH mPlatformInfoHiiVendorDevicePath = {
> +  {
> +    {
> +      HARDWARE_DEVICE_PATH,
> +      HW_VENDOR_DP,
> +      {
> +        (UINT8)(sizeof (VENDOR_DEVICE_PATH)),
> +        (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> +      }
> +    },
> +    PLATFORM_INFO_FORMSET_GUID
> +  },
> +  {
> +    END_DEVICE_PATH_TYPE,
> +    END_ENTIRE_DEVICE_PATH_SUBTYPE,
> +    {
> +      (UINT8)(END_DEVICE_PATH_LENGTH),
> +      (UINT8)((END_DEVICE_PATH_LENGTH) >> 8)
> +    }
> +  }
> +};
> +
> +#define MAX_STRING_SIZE     64
> +#define MHZ_SCALE_FACTOR    1000000
> +
> +STATIC
> +CHAR8 *
> +GetCCIXLinkSpeed (
> +  IN UINTN Speed
> +  )
> +{
> +  switch (Speed) {
> +  case 1:
> +    return "2.5 GT/s";
> +
> +  case 2:
> +    return "5 GT/s";
> +
> +  case 3:
> +    return "8 GT/s";
> +
> +  case 4:
> +  case 6:
> +    return "16 GT/s";
> +
> +  case 0xa:
> +    return "20 GT/s";
> +
> +  case 0xf:
> +    return "25 GT/s";
> +  }
> +
> +  return "Unknown";
> +}
> +
> +STATIC
> +EFI_STATUS
> +UpdatePlatformInfoScreen (
> +  IN EFI_HII_HANDLE *HiiHandle
> +  )
> +{
> +  VOID               *Hob;
> +  PLATFORM_INFO_HOB  *PlatformHob;
> +  CHAR16             Str[MAX_STRING_SIZE];
> +
> +  VOID               *StartOpCodeHandle;
> +  EFI_IFR_GUID_LABEL *StartLabel;
> +  VOID               *EndOpCodeHandle;
> +  EFI_IFR_GUID_LABEL *EndLabel;
> +
> +  /* Get the Platform HOB */
> +  Hob = GetFirstGuidHob (&gPlatformHobGuid);
> +  if (Hob == NULL) {
> +    return EFI_DEVICE_ERROR;
> +  }
> +  PlatformHob = (PLATFORM_INFO_HOB *)GET_GUID_HOB_DATA (Hob);
> +
> +  /* SCP Version */
> +  AsciiStrToUnicodeStrS ((const CHAR8 *)PlatformHob->SmPmProVer, Str, MAX_STRING_SIZE);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_SCPVER_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* SCP build */
> +  AsciiStrToUnicodeStrS ((const CHAR8 *)PlatformHob->SmPmProBuild, Str, MAX_STRING_SIZE);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_SCPBUILD_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* CPU Info */
> +  AsciiStrToUnicodeStrS ((const CHAR8 *)PlatformHob->CpuInfo, Str, MAX_STRING_SIZE);
> +  UnicodeSPrint (Str, sizeof (Str), L"%s", Str);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_CPUINFO_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* CPU clock */
> +  UnicodeSPrint (Str, sizeof (Str), L"%dMHz", PlatformHob->CpuClk / MHZ_SCALE_FACTOR);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_CPUCLK_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* PCP clock */
> +  UnicodeSPrint (Str, sizeof (Str), L"%dMHz", PlatformHob->PcpClk / MHZ_SCALE_FACTOR);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_PCPCLK_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* SOC clock */
> +  UnicodeSPrint (Str, sizeof (Str), L"%dMHz", PlatformHob->SocClk / MHZ_SCALE_FACTOR);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_SOCCLK_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* L1 Cache */
> +  UnicodeSPrint (Str, sizeof (Str), L"64KB");
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_L1ICACHE_VALUE),
> +    Str,
> +    NULL
> +    );
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_L1DCACHE_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* L2 Cache */
> +  UnicodeSPrint (Str, sizeof (Str), L"1MB");
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_L2CACHE_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* AHB clock */
> +  UnicodeSPrint (Str, sizeof (Str), L"%dMHz", PlatformHob->AhbClk / MHZ_SCALE_FACTOR);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_AHBCLK_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* SYS clock */
> +  UnicodeSPrint (Str, sizeof (Str), L"%dMHz", PlatformHob->SysClk / MHZ_SCALE_FACTOR);
> +  HiiSetString (
> +    HiiHandle,
> +    STRING_TOKEN (STR_PLATFORM_INFO_SYSCLK_VALUE),
> +    Str,
> +    NULL
> +    );
> +
> +  /* Initialize the container for dynamic opcodes */
> +  StartOpCodeHandle = HiiAllocateOpCodeHandle ();
> +  ASSERT (StartOpCodeHandle != NULL);
> +
> +  EndOpCodeHandle = HiiAllocateOpCodeHandle ();
> +  ASSERT (EndOpCodeHandle != NULL);
> +
> +  /* Create Hii Extend Label OpCode as the start opcode */
> +  StartLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (
> +                                       StartOpCodeHandle,
> +                                       &gEfiIfrTianoGuid,
> +                                       NULL,
> +                                       sizeof (EFI_IFR_GUID_LABEL)
> +                                       );
> +  ASSERT (StartLabel != NULL);
> +  StartLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
> +  StartLabel->Number       = LABEL_UPDATE;
> +
> +  /* Create Hii Extend Label OpCode as the end opcode */
> +  EndLabel = (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode (
> +                                     EndOpCodeHandle,
> +                                     &gEfiIfrTianoGuid,
> +                                     NULL,
> +                                     sizeof (EFI_IFR_GUID_LABEL)
> +                                     );
> +  ASSERT (EndLabel != NULL);
> +  EndLabel->ExtendOpCode = EFI_IFR_EXTEND_OP_LABEL;
> +  EndLabel->Number       = LABEL_END;
> +
> +  if (IsSlaveSocketActive ()) {
> +    /* Create the inter socket link text string */
> +    UnicodeSPrint (
> +      Str,
> +      sizeof (Str),
> +      L"Width x%d / Speed %a",
> +      PlatformHob->Link2PWidth[0],
> +      GetCCIXLinkSpeed (PlatformHob->Link2PSpeed[0])
> +      );
> +
> +    HiiSetString (
> +      mHiiHandle,
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK0_VALUE),
> +      Str,
> +      NULL
> +      );
> +
> +    HiiCreateTextOpCode (
> +      StartOpCodeHandle,
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK0),
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK0),
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK0_VALUE)
> +      );
> +
> +    UnicodeSPrint (
> +      Str,
> +      sizeof (Str),
> +      L"Width x%d / Speed %a",
> +      PlatformHob->Link2PWidth[1],
> +      GetCCIXLinkSpeed (PlatformHob->Link2PSpeed[1])
> +      );
> +
> +    HiiSetString (
> +      mHiiHandle,
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK1_VALUE),
> +      Str,
> +      NULL
> +      );
> +
> +    HiiCreateTextOpCode (
> +      StartOpCodeHandle,
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK1),
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK1),
> +      STRING_TOKEN (STR_CPU_FORM_INTER_SOCKET_LINK1_VALUE)
> +      );
> +  }
> +
> +  HiiUpdateForm (
> +    mHiiHandle,                 // HII handle
> +    &gPlatformInfoFormSetGuid,  // Formset GUID
> +    PLATFORM_INFO_FORM_ID,      // Form ID
> +    StartOpCodeHandle,          // Label for where to insert opcodes
> +    EndOpCodeHandle             // Insert data
> +    );
> +
> +  HiiFreeOpCodeHandle (StartOpCodeHandle);
> +  HiiFreeOpCodeHandle (EndOpCodeHandle);
> +
> +  return EFI_SUCCESS;
> +}
> +
> +EFI_STATUS
> +EFIAPI
> +PlatformInfoUnload (
> +  VOID
> +  )
> +{
> +  if (mDriverHandle != NULL) {
> +    gBS->UninstallMultipleProtocolInterfaces (
> +           mDriverHandle,
> +           &gEfiDevicePathProtocolGuid,
> +           &mPlatformInfoHiiVendorDevicePath,
> +           NULL
> +           );
> +    mDriverHandle = NULL;
> +  }
> +
> +  if (mHiiHandle != NULL) {
> +    HiiRemovePackages (mHiiHandle);
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +EFI_STATUS
> +EFIAPI
> +PlatformInfoEntryPoint (
> +  IN EFI_HANDLE       ImageHandle,
> +  IN EFI_SYSTEM_TABLE *SystemTable
> +  )
> +{
> +  EFI_STATUS Status;
> +
> +  Status = gBS->InstallMultipleProtocolInterfaces (
> +                  &mDriverHandle,
> +                  &gEfiDevicePathProtocolGuid,
> +                  &mPlatformInfoHiiVendorDevicePath,
> +                  NULL
> +                  );
> +  ASSERT_EFI_ERROR (Status);
> +
> +  //
> +  // Publish our HII data
> +  //
> +  mHiiHandle = HiiAddPackages (
> +                 &gPlatformInfoFormSetGuid,
> +                 mDriverHandle,
> +                 PlatformInfoDxeStrings,
> +                 VfrBin,
> +                 NULL
> +                 );
> +  if (mHiiHandle == NULL) {
> +    gBS->UninstallMultipleProtocolInterfaces (
> +           mDriverHandle,
> +           &gEfiDevicePathProtocolGuid,
> +           &mPlatformInfoHiiVendorDevicePath,
> +           NULL
> +           );
> +    return EFI_OUT_OF_RESOURCES;
> +  }
> +
> +  Status = UpdatePlatformInfoScreen (mHiiHandle);
> +  if (EFI_ERROR (Status)) {
> +    PlatformInfoUnload ();
> +    DEBUG ((
> +      DEBUG_ERROR,
> +      "%a %d Fail to update the platform info screen \n",
> +      __FUNCTION__,
> +      __LINE__
> +      ));
> +    return Status;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> diff --git a/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/VfrStrings.uni b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/VfrStrings.uni
> new file mode 100644
> index 000000000000..235d104c217f
> --- /dev/null
> +++ b/Silicon/Ampere/AmpereAltraPkg/Drivers/PlatformInfoDxe/VfrStrings.uni
> @@ -0,0 +1,56 @@
> +//
> +// Copyright (c) 2020 - 2021, Ampere Computing LLC. All rights reserved.<BR>
> +//
> +// SPDX-License-Identifier: BSD-2-Clause-Patent
> +//
> +
> +#langdef en-US  "English"
> +
> +#string STR_PLATFORM_INFO_FORM                      #language en-US "Platform Board Information"
> +#string STR_PLATFORM_INFO_FORM_HELP                 #language en-US "Platform Board Information"
> +
> +#string STR_PLATFORM_INFO_SEPERATE_LINE             #language en-US ""
> +
> +#string STR_PLATFORM_INFO_BOARD                     #language en-US "Board"
> +#string STR_PLATFORM_INFO_BOARD_VALUE               #language en-US "Mt. Jade"
> +
> +#string STR_PLATFORM_INFO_SCPVER                    #language en-US "SCP FW Version"
> +#string STR_PLATFORM_INFO_SCPVER_VALUE              #language en-US "0"
> +
> +#string STR_PLATFORM_INFO_RCVER                     #language en-US "Reference Code version"
> +#string STR_PLATFORM_INFO_RCVER_VALUE               #language en-US "0"
> +
> +#string STR_PLATFORM_INFO_SCPBUILD                  #language en-US "SCP FW Build"
> +#string STR_PLATFORM_INFO_SCPBUILD_VALUE            #language en-US "0"
> +
> +#string STR_PLATFORM_INFO_CPUINFO                   #language en-US "CPU"
> +#string STR_PLATFORM_INFO_CPUINFO_VALUE             #language en-US " "
> +
> +#string STR_PLATFORM_INFO_CPUCLK                    #language en-US "CPU Clock"
> +#string STR_PLATFORM_INFO_CPUCLK_VALUE              #language en-US "0MHz"
> +
> +#string STR_PLATFORM_INFO_PCPCLK                    #language en-US "PCP Clock"
> +#string STR_PLATFORM_INFO_PCPCLK_VALUE              #language en-US "0MHz"
> +
> +#string STR_PLATFORM_INFO_L1ICACHE                  #language en-US "L1I CACHE"
> +#string STR_PLATFORM_INFO_L1ICACHE_VALUE            #language en-US "0KB"
> +
> +#string STR_PLATFORM_INFO_L1DCACHE                  #language en-US "L1D CACHE"
> +#string STR_PLATFORM_INFO_L1DCACHE_VALUE            #language en-US "0KB"
> +
> +#string STR_PLATFORM_INFO_L2CACHE                   #language en-US "L2 CACHE"
> +#string STR_PLATFORM_INFO_L2CACHE_VALUE             #language en-US "0KB"
> +
> +#string STR_PLATFORM_INFO_SOCCLK                    #language en-US "SOC Clock"
> +#string STR_PLATFORM_INFO_SOCCLK_VALUE              #language en-US "0MHz"
> +
> +#string STR_PLATFORM_INFO_SYSCLK                    #language en-US "Sys Clock"
> +#string STR_PLATFORM_INFO_SYSCLK_VALUE              #language en-US "0MHz"
> +
> +#string STR_PLATFORM_INFO_AHBCLK                    #language en-US "AHB Clock"
> +#string STR_PLATFORM_INFO_AHBCLK_VALUE              #language en-US "0MHz"
> +
> +#string STR_CPU_FORM_INTER_SOCKET_LINK0             #language en-US "Inter Socket Connection: Link 0"
> +#string STR_CPU_FORM_INTER_SOCKET_LINK0_VALUE       #language en-US ""
> +#string STR_CPU_FORM_INTER_SOCKET_LINK1             #language en-US "Inter Socket Connection: Link 1"
> +#string STR_CPU_FORM_INTER_SOCKET_LINK1_VALUE       #language en-US ""
> -- 
> 2.17.1
> 

  reply	other threads:[~2021-06-07 23:10 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 10:06 [edk2-platforms][PATCH v2 00/32] Add new Ampere Mt. Jade platform Nhi Pham
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 01/32] Ampere: Initial support for Ampere Altra processor and " Nhi Pham
2021-06-04 23:04   ` Leif Lindholm
2021-06-09  4:50     ` Nhi Pham
2021-06-09 12:40       ` Leif Lindholm
2021-06-15 16:46     ` Nhi Pham
2021-05-26 10:06 ` [PATCH 1/1] UsbCdcNetDxe: Remove reading connection status in SNP GetStatus Nhi Pham
2021-05-26 10:23   ` [edk2-devel] " Nhi Pham
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 02/32] AmpereAltraPkg: Add MmCommunication modules Nhi Pham
2021-06-04 23:05   ` Leif Lindholm
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 03/32] AmperePlatformPkg: Implement FailSafe library Nhi Pham
2021-06-04 23:07   ` Leif Lindholm
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 04/32] AmperePlatformPkg: Add FailSafe and WDT support Nhi Pham
2021-06-04 23:12   ` Leif Lindholm
2021-06-15 16:47     ` Nhi Pham
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 05/32] AmpereAltraPkg: Add DwI2cLib library Nhi Pham
2021-06-04 23:21   ` Leif Lindholm
2021-06-15 16:47     ` Nhi Pham
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 06/32] AmpereAltraPkg: Add DwGpioLib library Nhi Pham
2021-06-04 23:22   ` Leif Lindholm
2021-05-26 10:06 ` [edk2-platforms][PATCH v2 07/32] JadePkg: Implement RealTimeClockLib for PCF85063 Nhi Pham
2021-06-04 23:26   ` Leif Lindholm
2021-06-15 16:48     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 08/32] AmpereAltraPkg: Add BootProgress support Nhi Pham
2021-06-04 23:27   ` Leif Lindholm
2021-06-15 16:48     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 09/32] AmpereAltraPkg: Support non-volatile variables Nhi Pham
2021-06-04 23:36   ` Leif Lindholm
2021-06-15 16:48     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 10/32] AmpereSiliconPkg: Add PlatformManagerUiLib library instance Nhi Pham
2021-06-04 23:37   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 11/32] AmperePlatformPkg: Add AcpiPccLib to support ACPI PCCT Table Nhi Pham
2021-06-04 23:44   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 12/32] AmperePlatformPkg: Add AcpiHelperLib to update ACPI DSDT table Nhi Pham
2021-06-04 23:47   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 13/32] AmpereAltraPkg, JadePkg: Add ACPI support Nhi Pham
2021-06-04 23:50   ` Leif Lindholm
2021-06-15 16:49     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 14/32] AmpereAltraPkg: Add PcieCoreLib library instance Nhi Pham
2021-06-05  0:05   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 15/32] JadePkg: Add PcieBoardLib " Nhi Pham
2021-06-07 22:45   ` Leif Lindholm
2021-06-15 16:50     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 16/32] AmpereAltraPkg: Add PciHostBridge driver Nhi Pham
2021-06-08 22:26   ` Leif Lindholm
2021-06-09  5:29   ` Ard Biesheuvel
2021-06-15 15:54     ` Nhi Pham
2021-06-16 14:20       ` Ard Biesheuvel
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 17/32] JadePkg: Enable PCIe-related libraries and device drivers Nhi Pham
2021-06-07 22:51   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 18/32] JadePkg: Add ASpeed GOP driver Nhi Pham
2021-06-07 22:51   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 19/32] AmpereAltraPkg: Add Random Number Generator Support Nhi Pham
2021-06-08 11:13   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 20/32] JadePkg: Add SMBIOS tables support Nhi Pham
2021-06-07 23:00   ` Leif Lindholm
2021-06-15 16:51     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 21/32] AmpereAltraPkg: Add DebugInfoPei module Nhi Pham
2021-06-07 23:08   ` Leif Lindholm
2021-06-15 16:51     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 22/32] AmpereAltraPkg: Add platform info screen Nhi Pham
2021-06-07 23:10   ` Leif Lindholm [this message]
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 23/32] AmpereAltraPkg: Add configuration screen for memory Nhi Pham
2021-06-07 23:14   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 24/32] AmpereAltraPkg: Add configuration screen for CPU Nhi Pham
2021-06-07 23:15   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 25/32] AmpereAltraPkg: Add configuration screen for ACPI Nhi Pham
2021-06-07 23:20   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 26/32] AmpereAltraPkg: Add configuration screen for RAS Nhi Pham
2021-06-07 23:22   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 27/32] AmpereAltraPkg: Add configuration screen for Watchdog timer Nhi Pham
2021-06-07 23:24   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 28/32] AmpereAltraPkg: Add configuration screen for Pcie Devices Nhi Pham
2021-06-07 23:34   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 29/32] JadePkg: Recover boot options when NVRAM cleared Nhi Pham
2021-06-07 23:46   ` Leif Lindholm
2021-06-15 16:52     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 30/32] AmpereSiliconPkg: Implement PlatformBootManagerLib for LinuxBoot Nhi Pham
2021-06-07 23:50   ` Leif Lindholm
2021-06-09 15:21     ` Nhi Pham
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 31/32] Platform/Ampere: Introduce the LinuxBootPkg Nhi Pham
2021-06-07 23:51   ` Leif Lindholm
2021-05-26 10:07 ` [edk2-platforms][PATCH v2 32/32] AmpereAltraPkg,JadePkg: Support LinuxBoot DSC/FDF build for Jade platform Nhi Pham
2021-06-07 23:58   ` Leif Lindholm
2021-06-09 15:20     ` Nhi Pham
2021-05-27 12:56 ` [edk2-platforms][PATCH v2 00/32] Add new Ampere Mt. " Leif Lindholm
2021-06-04 13:54 ` Leif Lindholm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210607231002.hkwtbkndilffwr47@leviathan \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox