From: Leif Lindholm <leif.lindholm@linaro.org>
To: Ming Huang <ming.huang@linaro.org>
Cc: linaro-uefi@lists.linaro.org, edk2-devel@lists.01.org,
graeme.gregory@linaro.org, ard.biesheuvel@linaro.org,
michael.d.kinney@intel.com, lersek@redhat.com,
guoheyi@huawei.com, wanghuiqiang@huawei.com,
huangming23@huawei.com, zhangjinsong2@huawei.com,
huangdaode@hisilicon.com, john.garry@huawei.com,
xinliang.liu@linaro.org, Yang XinYi <yangxingyi@huawei.com>
Subject: Re: [PATCH edk2-platforms v2 18/43] Hisilicon/D06: Add Hi1620OemConfigUiLib
Date: Wed, 22 Aug 2018 15:14:33 +0100 [thread overview]
Message-ID: <20180822141433.22npey5rje6zijgl@bivouac.eciton.net> (raw)
In-Reply-To: <20180814080903.50466-19-ming.huang@linaro.org>
On Tue, Aug 14, 2018 at 04:08:38PM +0800, Ming Huang wrote:
> From: Yang XinYi <yangxingyi@huawei.com>
>
> This library is added for oem setup menu item.
> Setup item include:
> 1 DDR option item;
> 2 BMC option item;
> 3 Ras option item;
> 4 Misc option item;
>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yang XinYi <yangxingyi@huawei.com>
> ---
> Silicon/Hisilicon/HisiPkg.dec | 1 +
> Platform/Hisilicon/D06/D06.dsc | 5 +-
> Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf | 2 +-
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf | 68 ++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h | 142 ++++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h | 64 ++++
> Silicon/Hisilicon/Include/Library/OemConfigData.h | 84 +++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c | 363 ++++++++++++++++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr | 154 +++++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni | 103 ++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr | 41 +++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni | 27 ++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.uni | 24 ++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLibStrings.uni | 42 +++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigVfr.Vfr | 89 +++++
Ah, I didn't spot thie before - but can you please rename this one
from
.Vfr to
.vfr
to align with the others?
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfig.hfr | 219 ++++++++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfigStrings.uni | 111 ++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PciePortConfig.hfr | 167 +++++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.hfr | 172 ++++++++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.uni | 85 +++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.hfr | 81 +++++
> Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.uni | 34 ++
> 22 files changed, 2076 insertions(+), 2 deletions(-)
>
> diff --git a/Silicon/Hisilicon/HisiPkg.dec b/Silicon/Hisilicon/HisiPkg.dec
> index b56a6a6af7..858b840a57 100644
> --- a/Silicon/Hisilicon/HisiPkg.dec
> +++ b/Silicon/Hisilicon/HisiPkg.dec
> @@ -44,6 +44,7 @@
> gHisiTokenSpaceGuid = {0xc8bc553e, 0x12bf, 0x11e6, {0x97, 0x4f, 0x87, 0xf7, 0x7c, 0xfd, 0x52, 0x1d}}
>
> gHisiEfiMemoryMapGuid = {0xf8870015, 0x6994, 0x4b98, {0x95, 0xa2, 0xbd, 0x56, 0xda, 0x91, 0xc0, 0x7f}}
> + gOemConfigGuid = {0x42927b59, 0x58fc, 0x41be, {0x8f, 0x59, 0xd1, 0x7c, 0x02, 0x1a, 0x70, 0x13}}
> gVersionInfoHobGuid = {0xe13a14c, 0x859c, 0x4f22, {0x82, 0xbd, 0x18, 0xe, 0xe1, 0x42, 0x12, 0xbf}}
> gHisiOemVariableGuid = {0xac62b9a5, 0x9939, 0x41d3, {0xff, 0x5c, 0xc5, 0x80, 0x32, 0x7d, 0x9b, 0x29}}
> gOemBootVariableGuid = {0xb7784577, 0x5aaf, 0x4557, {0xa1, 0x99, 0xd4, 0xa4, 0x2f, 0x45, 0x06, 0xf8}}
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 9d4a86a4f4..bec422670d 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -330,7 +330,10 @@
> #ACPI
> #
> MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> - Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> + Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf {
> + <LibraryClasses>
> + NULL|Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> + }
>
> Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
> Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> diff --git a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> index e268a56bbd..281a4f2ebd 100644
> --- a/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> +++ b/Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> @@ -56,7 +56,7 @@
> gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiTableStorageFile ## CONSUMES
>
> [Depex]
> - gEfiAcpiTableProtocolGuid
> + gEfiAcpiTableProtocolGuid AND gEfiVariableWriteArchProtocolGuid
>
> [UserExtensions.TianoCore."ExtraFiles"]
> AcpiPlatformExtra.uni
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> new file mode 100644
> index 0000000000..fba619e9ba
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> @@ -0,0 +1,68 @@
> +## @file
> +# OEM config Library used by BDS
> +#
> +# Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +# Copyright (c) 2018, Linaro Limited. All rights reserved.
> +# This program and the accompanying materials are licensed and made available under
> +# the terms and conditions of the BSD License that accompanies this distribution.
> +# The full text of the license may be found at
> +# http://opensource.org/licenses/bsd-license.php.
> +#
> +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +#
> +##
> +[Defines]
> + INF_VERSION = 0x0001001A
> + BASE_NAME = OemConfigUiLib
> + MODULE_UNI_FILE = OemConfigUiLib.uni
> + FILE_GUID = 32B373AC-00B6-471b-B3AE-6E4A4501F6BA
> + MODULE_TYPE = DXE_DRIVER
> + VERSION_STRING = 1.0
> + LIBRARY_CLASS = NULL|DXE_DRIVER UEFI_APPLICATION
> + CONSTRUCTOR = OemConfigUiLibConstructor
> + DESTRUCTOR = OemConfigUiLibDestructor
> +
> +[Sources]
> + iBMCConfig.hfr
> + iBMCConfig.uni
> + MemoryConfig.hfr
> + MemoryConfig.uni
> + MiscConfig.hfr
> + MiscConfig.uni
> + OemConfig.c
> + OemConfig.h
> + OemConfigUiLibStrings.uni
> + OemConfigVfr.Vfr
> + PcieConfig.hfr
> + PcieConfigStrings.uni
> + PciePortConfig.hfr
> + RasConfig.hfr
> + RasConfig.uni
> +
> +[Packages]
> + MdeModulePkg/MdeModulePkg.dec
> + MdePkg/MdePkg.dec
> + Silicon/Hisilicon/HisiPkg.dec
> +
> +[LibraryClasses]
> + BaseLib
> + BaseMemoryLib
> + DebugLib
> + DevicePathLib
> + HiiLib
> + MemoryAllocationLib
> + PrintLib
> + UefiBootServicesTableLib
> + UefiHiiServicesLib
> + UefiRuntimeServicesTableLib
> +
> +[Guids]
> + gEfiHiiPlatformSetupFormsetGuid ## CONSUMES ## GUID (Indicate the formset class guid to be displayed)
> + gEfiIfrFrontPageGuid ## CONSUMES ## GUID (Indicate the formset in this library need to dispaly in which page)
> + gEfiIfrTianoGuid ## CONSUMES ## GUID (Extended IFR Guid Opcode)
> + gOemConfigGuid
> + gVersionInfoHobGuid
> +
> +[Protocols]
> + gEfiHiiConfigAccessProtocolGuid ## CONSUMES
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h
> new file mode 100644
> index 0000000000..f91400150c
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h
> @@ -0,0 +1,142 @@
> +/** @file
> +The Oem config reference implement
> +
> +Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +Copyright (c) 2018, Linaro Limited. All rights reserved.
> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD License
> +which accompanies this distribution. The full text of the license may be found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#ifndef _OEM_CONFIG_H_
> +#define _OEM_CONFIG_H_
> +
> +#include <Guid/HiiPlatformSetupFormset.h>
> +#include <Guid/MdeModuleHii.h>
> +#include <Guid/VersionInfoHobGuid.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/BaseLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/DevicePathLib.h>
> +#include <Library/HiiLib.h>
> +#include <Library/HobLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +#include "Library/OemConfigData.h"
> +#include <Library/PcdLib.h>
> +#include <Library/PrintLib.h>
> +#include <Library/UefiBootServicesTableLib.h>
> +#include <Library/UefiHiiServicesLib.h>
> +#include <Library/UefiRuntimeServicesTableLib.h>
> +#include <Pi/PiFirmwareVolume.h>
> +#include <Protocol/HiiConfigAccess.h>
> +
> +//
> +// These are the VFR compiler generated data representing our VFR data.
> +//
> +extern UINT8 OemConfigVfrBin[];
> +
> +//
> +// HII specific Vendor Device Path definition.
> +//
> +typedef struct {
> + VENDOR_DEVICE_PATH VendorDevicePath;
> + EFI_DEVICE_PATH_PROTOCOL End;
> +} HII_VENDOR_DEVICE_PATH;
> +
> +#define OEM_CONFIG_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('O', 'E', 'M', 'C')
> +typedef struct {
> + UINTN Signature;
> + EFI_HII_HANDLE HiiHandle;
> + EFI_HANDLE DriverHandle;
> + EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
> +} OEM_CONFIG_CALLBACK_DATA;
> +
> +/**
> + This function allows a caller to extract the current configuration for one
> + or more named elements from the target driver.
> +
> +
> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> + @param Request A null-terminated Unicode string in <ConfigRequest> format.
> + @param Progress On return, points to a character in the Request string.
> + Points to the string's null terminator if request was successful.
> + Points to the most recent '&' before the first failing name/value
> + pair (or the beginning of the string if the failure is in the
> + first name/value pair) if the request was not successful.
> + @param Results A null-terminated Unicode string in <ConfigAltResp> format which
> + has all values filled in for the names in the Request string.
> + String to be allocated by the called function.
> +
> + @retval EFI_SUCCESS The Results is filled with the requested values.
> + @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
> + @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
> + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemExtractConfig (
> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
> + IN CONST EFI_STRING Request,
> + OUT EFI_STRING *Progress,
> + OUT EFI_STRING *Results
> + );
> +
> +/**
> + This function processes the results of changes in configuration.
> +
> +
> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> + @param Configuration A null-terminated Unicode string in <ConfigResp> format.
> + @param Progress A pointer to a string filled in with the offset of the most
> + recent '&' before the first failing name/value pair (or the
> + beginning of the string if the failure is in the first
> + name/value pair) or the terminating NULL if all was successful.
> +
> + @retval EFI_SUCCESS The Results is processed successfully.
> + @retval EFI_INVALID_PARAMETER Configuration is NULL.
> + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemRouteConfig (
> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
> + IN CONST EFI_STRING Configuration,
> + OUT EFI_STRING *Progress
> + );
> +
> +/**
> + This function is invoked if user selected a interactive opcode from Device Manager's
> + Formset. If user set VBIOS, the new value is saved to EFI variable.
> +
> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> + @param Action Specifies the type of action taken by the browser.
> + @param QuestionId A unique value which is sent to the original exporting driver
> + so that it can identify the type of data to expect.
> + @param Type The type of value for the question.
> + @param Value A pointer to the data being sent to the original exporting driver.
> + @param ActionRequest On return, points to the action requested by the callback function.
> +
> + @retval EFI_SUCCESS The callback successfully handled the action.
> + @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemCallback (
> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
> + IN EFI_BROWSER_ACTION Action,
> + IN EFI_QUESTION_ID QuestionId,
> + IN UINT8 Type,
> + IN EFI_IFR_TYPE_VALUE *Value,
> + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
> + );
> +
> +VOID GetReleaseTime (EFI_TIME *Time);
> +#endif
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h
> new file mode 100644
> index 0000000000..792e544c22
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h
> @@ -0,0 +1,64 @@
> +/** @file
> +
> +Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +Copyright (c) 2018, Linaro Limited. All rights reserved.
> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD License
> +which accompanies this distribution. The full text of the license may be found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +Module Name:
> +
> + OemConfigUi.h
> +
> +Abstract:
> +
> + NVData structure used by the OEM Config.
> +
> +Revision History:
> +
> +
> +**/
> +
> +#ifndef _OEM_CONFIG_UI_H_
> +#define _OEM_CONFIG_UI_H_
> +
> +#include <Uefi/UefiMultiPhase.h>
> +
> +#define OEM_CONFIG_FORM_ID 1
> +#define MEMORY_CONFIG_FORM_ID 2
> +#define IBMC_CONFIG_FORM_ID 3
> +#define PCIE_CONFIG_FORM_ID 4
> +#define MISC_CONFIG_FORM_ID 5
> +#define RAS_CONFIG_FORM_ID 6
> +
> +#define VFR_FORMID_PCIE_SOCKET0 0x4100
> +#define VFR_FORMID_PCIE_SOCKET1 0x4200
> +#define VFR_FORMID_PCIE_PORT0 0x4000
> +#define VFR_FORMID_PCIE_PORT1 0x4001
> +#define VFR_FORMID_PCIE_PORT2 0x4002
> +#define VFR_FORMID_PCIE_PORT3 0x4003
> +#define VFR_FORMID_PCIE_PORT4 0x4004
> +#define VFR_FORMID_PCIE_PORT5 0x4005
> +#define VFR_FORMID_PCIE_PORT6 0x4006
> +#define VFR_FORMID_PCIE_PORT7 0x4007
> +#define VFR_FORMID_PCIE_PORT8 0x4008
> +#define VFR_FORMID_PCIE_PORT9 0x4009
> +#define VFR_FORMID_PCIE_PORT10 0x4010
> +#define VFR_FORMID_PCIE_PORT11 0x4011
> +#define VFR_FORMID_PCIE_PORT12 0x4012
> +#define VFR_FORMID_PCIE_PORT13 0x4013
> +#define VFR_FORMID_PCIE_PORT14 0x4014
> +#define VFR_FORMID_PCIE_PORT15 0x4015
> +
> +#define VFR_FORMID_MEMORY_RAS 0x6100
> +#define VFR_FORMID_CORRECT_ERROR 0x6101
> +#define VFR_FORMID_PCIE_RAS 0x6200
> +
> +#define RMT_PATTERN_LENGTH 256
> +
> +
> +#endif
> diff --git a/Silicon/Hisilicon/Include/Library/OemConfigData.h b/Silicon/Hisilicon/Include/Library/OemConfigData.h
> new file mode 100644
> index 0000000000..478821ae2c
> --- /dev/null
> +++ b/Silicon/Hisilicon/Include/Library/OemConfigData.h
> @@ -0,0 +1,84 @@
> +/** @file
> +*
> +* Copyright (c) 2017 - 2018, Hisilicon Limited. All rights reserved.
> +* Copyright (c) 2017 - 2018, Linaro Limited. All rights reserved.
> +*
> +* This program and the accompanying materials
> +* are licensed and made available under the terms and conditions of the BSD License
> +* which accompanies this distribution. The full text of the license may be found at
> +* http://opensource.org/licenses/bsd-license.php
> +*
> +* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +*
> +**/
> +
> +
> +#ifndef _OEM_CONFIG_DATA_H_
> +#define _OEM_CONFIG_DATA_H_
> +
> +#define PCIE_MAX_TOTAL_PORTS 16
> +#define OEM_CONFIG_NAME L"OemConfig"
> +#define PLATFORM_SETUP_VARIABLE_FLAG (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE)
> +
> +#pragma pack(1)
> +typedef struct {
> + /*Memory Config*/
> + UINT8 DdrDebugLevel;
> + UINT8 DdrFreqLimit;
> + UINT8 DdrRefreshSupport;
> + UINT8 DdrRefreshRate;
> + UINT8 RankMargin;
> + UINT8 RankMarginMode;
> + UINT32 rmtPatternLength;
> + UINT8 perbitmargin;
> + UINT8 CaMargin;
> + UINT8 CaVrefMarginOption;
> + UINT8 NumaEn;
> + UINT8 HwMemTest;
> + UINT8 DieInterleaving;
> + UINT8 ChannelInterleaving;
> + UINT8 RankInterleaving;
> + UINT8 EccSupport;
> + /*iBMC Config*/
> + UINT8 BmcWdtEnable;
> + UINT8 BmcWdtTimeout;
> + UINT8 BmcWdtAction;
> + UINT8 OSWdtEnable;
> + UINT8 OSWdtTimeout;
> + UINT8 OSWdtAction;
> + /*PCIe Config*/
> + UINT8 PcieSRIOVSupport;
> + UINT8 PciePort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieLinkSpeedPort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieLinkDeEmphasisPort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieLinkStatusPort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieLinkSpeedRateStatusPort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieLinkMaxPort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieMaxPayloadSizePort[PCIE_MAX_TOTAL_PORTS];
> + UINT8 PcieAspmPort[PCIE_MAX_TOTAL_PORTS];
> + /*Misc Config*/
> + UINT8 EnableSmmu;
> + UINT8 EnableFdtTable;
> + UINT8 EnableSpcr;
> + /*RAS Config*/
> + UINT8 EnRasSupport;
> + UINT8 EnPoison;
> + UINT8 CheckAlgorithm;
> + UINT8 PatrolScrub;
> + UINT8 PatrolScrubDuration;
> + UINT8 DemandScrubMode;
> + UINT8 CorrectErrorThreshold;
> + UINT8 AdvanceDeviceCorrection;
> + UINT8 RankSparing;
> + UINT8 FunnelPeriod;
> + UINT8 DpcFeature;
> + UINT8 EcrcFeature;
> + UINT8 CompletionTimeout;
> + UINT8 CompletionTimeoutValue;
> + UINT8 HotPlug;
> +
> +} OEM_CONFIG_DATA;
> +#pragma pack()
> +
> +#endif
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> new file mode 100644
> index 0000000000..1e3635307c
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> @@ -0,0 +1,363 @@
> +/** @file
> +The OEM config reference implementation
> +
> +Copyright (c) 2018, Hisilicon Limited. All rights reserved.
> +Copyright (c) 2018, Linaro Limited. All rights reserved.
> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD License
> +which accompanies this distribution. The full text of the license may be found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#include "OemConfig.h"
> +
> +OEM_CONFIG_CALLBACK_DATA mOemConfigPrivate = {
> + OEM_CONFIG_CALLBACK_DATA_SIGNATURE,
> + NULL,
> + NULL,
> + {
> + OemExtractConfig,
> + OemRouteConfig,
> + OemCallback
> + }
> +};
> +
> +HII_VENDOR_DEVICE_PATH mOemHiiVendorDevicePath = {
> + {
> + {
> + HARDWARE_DEVICE_PATH,
> + HW_VENDOR_DP,
> + {
> + (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> + (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> + }
> + },
> + { 0x874c4dcb, 0x08ec, 0x4fe6, { 0xb5, 0x8e, 0x3a, 0x9e, 0x1c, 0x26, 0x70, 0xb9 } }
> + },
> + {
> + END_DEVICE_PATH_TYPE,
> + END_ENTIRE_DEVICE_PATH_SUBTYPE,
> + {
> + (UINT8) (END_DEVICE_PATH_LENGTH),
> + (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
> + }
> + }
> +};
> +
> +
> +
> +
> +
> +
> +/**
> + This function allows a caller to extract the current configuration for one
> + or more named elements from the target driver.
> +
> +
> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> + @param Request A null-terminated Unicode string in <ConfigRequest> format.
> + @param Progress On return, points to a character in the Request string.
> + Points to the string's null terminator if request was successful.
> + Points to the most recent '&' before the first failing name/value
> + pair (or the beginning of the string if the failure is in the
> + first name/value pair) if the request was not successful.
> + @param Results A null-terminated Unicode string in <ConfigAltResp> format which
> + has all values filled in for the names in the Request string.
> + String to be allocated by the called function.
> +
> + @retval EFI_INVALID_PARAMETER Request is illegal syntax, or unknown name.
> + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemExtractConfig (
> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
> + IN CONST EFI_STRING Request,
> + OUT EFI_STRING *Progress,
> + OUT EFI_STRING *Results
> + )
> +{
> + if (Progress == NULL || Results == NULL) {
> + return EFI_INVALID_PARAMETER;
> + }
> + *Progress = Request;
> + return EFI_NOT_FOUND;
> +}
> +
> +/**
> + This function processes the results of changes in configuration.
> +
> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> + @param Configuration A null-terminated Unicode string in <ConfigResp> format.
> + @param Progress A pointer to a string filled in with the offset of the most
> + recent '&' before the first failing name/value pair (or the
> + beginning of the string if the failure is in the first
> + name/value pair) or the terminating NULL if all was successful.
> +
> + @retval EFI_INVALID_PARAMETER Configuration is NULL.
> + @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemRouteConfig (
> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
> + IN CONST EFI_STRING Configuration,
> + OUT EFI_STRING *Progress
> + )
> +{
> + if (Configuration == NULL || Progress == NULL) {
> + return EFI_INVALID_PARAMETER;
> + }
> +
> + *Progress = Configuration;
> +
> + return EFI_NOT_FOUND;
> +}
> +
> +/**
> + This function is invoked if user selected a interactive opcode from Device Manager's
> + Formset. If user set VBIOS, the new value is saved to EFI variable.
> +
> + @param This Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> + @param Action Specifies the type of action taken by the browser.
> + @param QuestionId A unique value which is sent to the original exporting driver
> + so that it can identify the type of data to expect.
> + @param Type The type of value for the question.
> + @param Value A pointer to the data being sent to the original exporting driver.
> + @param ActionRequest On return, points to the action requested by the callback function.
> +
> + @retval EFI_SUCCESS The callback successfully handled the action.
> + @retval EFI_INVALID_PARAMETER The setup browser call this function with invalid parameters.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemCallback (
> + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
> + IN EFI_BROWSER_ACTION Action,
> + IN EFI_QUESTION_ID QuestionId,
> + IN UINT8 Type,
> + IN EFI_IFR_TYPE_VALUE *Value,
> + OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
> + )
> +{
> + if (Action != EFI_BROWSER_ACTION_CHANGING) {
> + //
> + // Do nothing for other UEFI Action. Only do call back when data is changed.
> + //
> + return EFI_UNSUPPORTED;
> + }
> + if ((Value == NULL) || (ActionRequest == NULL)) {
> + return EFI_INVALID_PARAMETER;
> + }
> +
> + return EFI_SUCCESS;
> +}
> +
> +/**
> + Install Boot Manager Menu driver.
> +
> + @param ImageHandle The image handle.
> + @param SystemTable The system table.
> +
> + @retval EFI_SUCEESS Install Boot manager menu success.
> + @retval Other Return error status.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemConfigUiLibConstructor (
> + IN EFI_HANDLE ImageHandle,
> + IN EFI_SYSTEM_TABLE *SystemTable
> + )
> +{
> + EFI_STATUS Status;
> + OEM_CONFIG_DATA Configuration;
> + VOID *Hob;
> + VERSION_INFO *VersionInfo;
> + UINTN BufSize;
> + BOOLEAN Action;
> + EFI_STRING ConfigRequestHdr;
> + EFI_TIME Time = {0};
> + CHAR16 TmpString[0x100] = {0};
> +
> + mOemConfigPrivate.DriverHandle = NULL;
> + Status = gBS->InstallMultipleProtocolInterfaces (
> + &mOemConfigPrivate.DriverHandle,
> + &gEfiDevicePathProtocolGuid,
> + &mOemHiiVendorDevicePath,
> + &gEfiHiiConfigAccessProtocolGuid,
> + &mOemConfigPrivate.ConfigAccess,
> + NULL
> + );
> + if (EFI_ERROR (Status)) {
> + return Status;
> + }
> +
> + //
> + // Publish our HII data.
> + //
> + mOemConfigPrivate.HiiHandle = HiiAddPackages (
> + &gOemConfigGuid,
> + mOemConfigPrivate.DriverHandle,
> + OemConfigVfrBin,
> + OemConfigUiLibStrings,
> + NULL
> + );
> + if (mOemConfigPrivate.HiiHandle == NULL) {
> + DEBUG ((DEBUG_ERROR, "OemConfigUiLibConstructor(), Fail to Add Oem Hii Package.\n"));
Sorry, missed this one first time around:
Please use %a and __FUNCTION__ instead of hardcoding the function name.
> + return EFI_INVALID_PARAMETER;
> + }
> + //
> + //BIOS Build Time Init
> + //
> + Hob = GetFirstGuidHob (&gVersionInfoHobGuid);
> + if (Hob == NULL) {
> + DEBUG ((DEBUG_ERROR, "[%a]:[%d] Version information HOB not found!\n",
> + __FILE__, __LINE__));
> + return EFI_NOT_FOUND;
> + }
> + VersionInfo = GET_GUID_HOB_DATA (Hob);
> + Time = VersionInfo->BuildTime;
> + UnicodeSPrint (
> + TmpString,
> + sizeof (TmpString),
> + L"%02d/%02d/%04d %02d:%02d",
> + Time.Month,
> + Time.Day,
> + Time.Year,
> + Time.Hour,
> + Time.Minute
> + );
> + HiiSetString (
> + mOemConfigPrivate.HiiHandle,
> + STRING_TOKEN (STR_MISC_BIOS_BUILDTIME),
> + TmpString,
> + "en-US"
> + );
> + //
> + // Check Oem Config Variable.
> + //
> + ConfigRequestHdr = HiiConstructConfigHdr (
> + &gOemConfigGuid,
> + OEM_CONFIG_NAME,
> + mOemConfigPrivate.DriverHandle
> + );
> + ZeroMem (&Configuration, sizeof (OEM_CONFIG_DATA));
> + BufSize = sizeof (OEM_CONFIG_DATA);
> + Status = gRT->GetVariable (
> + OEM_CONFIG_NAME,
> + &gOemConfigGuid,
> + NULL,
> + &BufSize,
> + &Configuration
> + );
> + if (EFI_ERROR (Status)) {
> + Action = HiiSetToDefaults (ConfigRequestHdr, EFI_HII_DEFAULT_CLASS_STANDARD);
> + if (!Action) {
> + //
> + //Set the default value of the DDR option
> + //
> + Configuration.DdrDebugLevel = 0;
> + Configuration.DdrFreqLimit = 0;
> + Configuration.DdrRefreshSupport = 0;
> + Configuration.DdrRefreshRate = 0;
> + Configuration.RankMargin = 0;
> + Configuration.RankMarginMode = 2;
> + Configuration.rmtPatternLength = 256;
> + Configuration.perbitmargin = 0x0;
> + Configuration.CaMargin = 0x0;
> + Configuration.CaVrefMarginOption = 0x0;
> + Configuration.NumaEn = 1;
> + Configuration.HwMemTest = 0;
> + Configuration.DieInterleaving = 0;
> + Configuration.ChannelInterleaving = 1;
> + Configuration.RankInterleaving = 2;
> + Configuration.EccSupport = 0;
> + //
> + //Set the default value of the BMC option
> + //
> + Configuration.BmcWdtEnable = 0;
> + Configuration.BmcWdtTimeout = 15;
> + Configuration.BmcWdtAction = 1;
> + Configuration.OSWdtEnable = 0;
> + Configuration.OSWdtTimeout = 5;
> + Configuration.OSWdtAction = 1;
Where did the PCIe go?
/
Leif
next prev parent reply other threads:[~2018-08-22 14:14 UTC|newest]
Thread overview: 93+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 8:08 [PATCH edk2-platforms v2 00/43] Upload for D06 platform Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 01/43] Silicon/Hisilicon: Modify the MRC interface for other module Ming Huang
2018-08-21 17:50 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 02/43] Silicon/Hisilicon: Separate PlatformArch.h Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 03/43] Silicon/Hisilicon/Acpi: Move some macro to PlatformArch.h Ming Huang
2018-08-17 13:23 ` Leif Lindholm
2018-08-18 7:26 ` Ming
2018-08-14 8:08 ` [PATCH edk2-platforms v2 04/43] Silicon/Hisilicon/D0x: Move dimm size definition " Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 05/43] Silicon/Hisilicon/D0x: Move RAS macro " Ming Huang
2018-08-21 17:48 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 06/43] Hisilicon/D0x: Move CustomData.Fv to common path of Hisilicon Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 07/43] Hisilicon/D0x: Move IpmiCmdLib " Ming Huang
2018-08-15 13:58 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 08/43] Hisilicon/D0x: Unify FlashFvbDxe driver Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 09/43] Hisilicon/D0X: Rename the global variable gDS3231RtcDevice Ming Huang
2018-08-21 17:59 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 10/43] Hisilicon/D06: Add several base file for D06 Ming Huang
2018-08-21 21:56 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 11/43] Platform/Hisilicon/D06: Add M41T83RealTimeClockLib Ming Huang
2018-08-21 22:57 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 12/43] Platform/Hisilicon/D06: Add edk2-non-osi components for D06 Ming Huang
2018-08-22 9:49 ` Leif Lindholm
2018-08-22 14:54 ` Ming
2018-08-22 16:43 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 13/43] Hisilicon/D06: Add OemMiscLibD06 Ming Huang
2018-08-22 10:17 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 14/43] Silicon/Hisilicon/D06: Wait for all disk ready Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 15/43] Silicon/Hisilicon/Acpi: Unify HisiAcipPlatformDxe Ming Huang
2018-08-22 10:29 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 16/43] Hisilicon/D06: Add Debug Serial Port Init Driver Ming Huang
2018-08-22 11:01 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 17/43] Hisilicon/D06: Add ACPI Tables for D06 Ming Huang
2018-08-22 11:49 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 18/43] Hisilicon/D06: Add Hi1620OemConfigUiLib Ming Huang
2018-08-22 14:14 ` Leif Lindholm [this message]
2018-08-22 15:11 ` Ming
2018-08-14 8:08 ` [PATCH edk2-platforms v2 19/43] Silicon/Hisilicon/D06: Stop watchdog Ming Huang
2018-08-22 14:17 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 20/43] Hisilicon/I2C: Modify I2CLib.c for coding style Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 21/43] Silicon/Hisilicon/I2C: Refactor I2C library Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 22/43] Silicon/Hisilicon/D06: Fix I2C enable fail issue for D06 Ming Huang
2018-08-22 14:21 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 23/43] Silicon/Hisilicon/D06: Add I2C delay for HNS auto config Ming Huang
2018-08-22 14:27 ` Leif Lindholm
2018-08-22 15:16 ` Ming
2018-08-22 16:46 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 24/43] Hisilicon/I2C: Fix a typo issue Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 25/43] Silicon/Hisilicon/D06: Optimize HNS config CDR post time Ming Huang
2018-08-22 14:30 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 26/43] Silicon/Hisilicon/Setup: Add Setup Item "EnableGOP" Ming Huang
2018-08-22 14:33 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 27/43] Hisilicon/Hi1620: Add ACPI PPTT table Ming Huang
2018-08-22 14:39 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 28/43] Platform/Hisilicon/D06: Enable ACPI PPTT Ming Huang
2018-08-22 14:40 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 29/43] Platform/Hisilicon/D06: Add OemNicLib Ming Huang
2018-08-14 8:08 ` [PATCH edk2-platforms v2 30/43] Platform/Hisilicon/D06: Add OemNicConfig2P Driver Ming Huang
2018-08-22 14:57 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 31/43] Hisilicon/D0x: Update SMBIOS type9 info Ming Huang
2018-08-22 15:01 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 32/43] Platform/Hisilicon/D06: Add EarlyConfigPeim peim Ming Huang
2018-08-22 15:04 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 33/43] Platform/Hisilicon/D06: Add PciHostBridgeLib Ming Huang
2018-08-22 15:09 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 34/43] Hisilicon/D06: add apei driver Ming Huang
2018-08-22 15:31 ` Leif Lindholm
2018-08-23 7:35 ` Ming
2018-08-23 9:43 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 35/43] Silicon/Hisilicon/D06: Add some Lpc macro to LpcLib.h Ming Huang
2018-08-22 15:33 ` Leif Lindholm
2018-08-23 7:39 ` Ming
2018-08-23 9:44 ` Leif Lindholm
2018-08-23 9:51 ` Ming
2018-08-14 8:08 ` [PATCH edk2-platforms v2 36/43] Platform/Hisilicon/D06: Add capsule upgrade support Ming Huang
2018-08-22 18:42 ` Leif Lindholm
2018-08-24 14:43 ` Ard Biesheuvel
2018-08-14 8:08 ` [PATCH edk2-platforms v2 37/43] Silicon/Hisilicon/D06: Modify for close slave core clock Ming Huang
2018-08-22 15:44 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 38/43] Silicon/Hisilicon/D06: Add I2C Bus Exception handle function Ming Huang
2018-08-22 15:45 ` Leif Lindholm
2018-08-14 8:08 ` [PATCH edk2-platforms v2 39/43] Silicon/Hisilicon/Setup: Support SPCR table switch Ming Huang
2018-08-23 9:54 ` Ming
2018-08-23 9:57 ` Leif Lindholm
2018-08-14 8:09 ` [PATCH edk2-platforms v2 40/43] Silicon/Hisilicon/setup: Support SMMU switch Ming Huang
2018-08-22 18:42 ` Leif Lindholm
2018-08-14 8:09 ` [PATCH edk2-platforms v2 41/43] Hisilicon/D06: Add PciPlatformLib Ming Huang
2018-08-22 16:12 ` Leif Lindholm
2018-08-14 8:09 ` [PATCH edk2-platforms v2 42/43] Hisilicon/D06: Add edk2-non-osi Shell components Ming Huang
2018-08-22 18:48 ` Leif Lindholm
2018-08-23 8:37 ` Ming
2018-08-14 8:09 ` [PATCH edk2-platforms v2 43/43] Platform/Hisilicon/D0x: Update version string to 18.08 Ming Huang
2018-08-22 16:09 ` Leif Lindholm
2018-08-22 18:49 ` [PATCH edk2-platforms v2 00/43] Upload for D06 platform 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=20180822141433.22npey5rje6zijgl@bivouac.eciton.net \
--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