From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.107.237.80]) by mx.groups.io with SMTP id smtpd.web10.2680.1686120998180335276 for ; Tue, 06 Jun 2023 23:56:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=uTV3FBmw; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.237.80, mailfrom: abner.chang@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mxgto3ya7zi9APLZr9j1IqSY4onMyCP5qvu0A4NBeMs8tZielKcQf+kcnsgdjTO4jqubgOZp3NB2XRxgr7oqAD0MTjk7DU9c/19GvPbnKxlglGVK7Tk0AFd5bonUUh/vbAvR3iKwbnyXKVLjQBG/ZOzQ5AGLgdBfZAfFeoHOaz7k0W3WB4gNFMB3+OgcK+yf/VbTNLM9eACrbGOHM/V3pap5HEX8HtC+JglftNSp+WlzHOn+CKowvS57npk264snDVn6cRRlIU3kkwwi6RNFmsFpCh96MvArmNEsggb7sIo+D5TCOePy2RtP5+adBTm2VJNPqgoi1qCin9xxUD2eiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pn7sNMNw03lKqk7zxiYtED0qYx0jXX/IchoaBpQxbrs=; b=IR4OyyAsU38lJNHqslNhoPSfjiKGAMoLRRJQ1Bp8cBCEaVtnadE0dsJh4dLCxTnWBFz+rEEwlHqRcY41ajlVKJNLo+etaOSQWH6cIoYIl7QaPxA1FErzPejNr19xi0VaKCPdewwSeqXAuXvLrBP9TVDUIfjmT9wcEHWhFs9CRzIaozqM5eJG1P06a4t3Ro7+/fY5Br/XzFpl6RgYx9eedjID32ffZxlIbz1Q3V1P85aQboOF4hoGaDTp83kpy6r5iEl0Gkg0wE6IYzakZ1CR+SAGEJ+htGbxT7r+uEoqSimK+LCwsGpwtxoxvhpe+D1zep0/yQWfiUWNAyREfMG7tQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pn7sNMNw03lKqk7zxiYtED0qYx0jXX/IchoaBpQxbrs=; b=uTV3FBmwzDJofCwTGM3M2ZkVYChmZ/RqBjr6HL+1ZuD50AOHivV2lbOlxfDN4AMGPs6NHK+f292TTH9PEuOgSdu8bP3/QOhf96/thm1U+eeEAK6NJ9R8ywhK2bPbH94z9UJ767wHxhNXHctCoyjFuB4N3kuvkxSb17Ej3qMVJ0E= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by MW6PR12MB8950.namprd12.prod.outlook.com (2603:10b6:303:24a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.32; Wed, 7 Jun 2023 06:56:34 +0000 Received: from MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040]) by MN2PR12MB3966.namprd12.prod.outlook.com ([fe80::edb0:bed8:c650:5040%6]) with mapi id 15.20.6455.030; Wed, 7 Jun 2023 06:56:31 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: Add a sample memory configuration HII driver Thread-Topic: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: Add a sample memory configuration HII driver Thread-Index: AQHZmHwxg6LxTDYcN0Gs/ZYN1J5RL69+6OYA Date: Wed, 7 Jun 2023 06:56:30 +0000 Message-ID: References: <20230606133810.4542-1-nicklew@nvidia.com> In-Reply-To: <20230606133810.4542-1-nicklew@nvidia.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=087ae2c2-5596-4572-86c9-649827b34f18;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-06-07T06:54:41Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN2PR12MB3966:EE_|MW6PR12MB8950:EE_ x-ms-office365-filtering-correlation-id: e55354b8-745f-4680-eeb7-08db672452d4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8Vq0EBQymp4vcy0MTv0cUT2JKcH3Gk/rIkinnwiPjAD5k4EoZxYZKa4O1pK5rmAWD288487ChORsiWxv1Lqiyn4SKEFMy6dAkYmAd468dEJmkJMyHWBWfjeTO7lvaV/vLBBgk+NMI0WtQDq+758pdB4WwpVbYhtqYPjZ4SzS+WlraADOd9kfyMzuXYKdt32o7U0vmla4HBrAQ+mDlJsfSrrbn5xin+9HjFAwX2GNKIj61GGWrxUCy7Optb772R5iT6dRaSHXzef+iFQGVrBsPIKf01NA6em+HIsi9EmFBhCvBfGuztQbBzxeGInvJ57s+viQ7XLt9cbgT1DwDIAeVo0ZsN1STYReqhtHNjG1mcM2HVuIENFqcL1XPrqz+LSzWRogW0kRGhIU/SU5ELDCB+B7pW38v0WoSjQWpx9bPCBu6FR+JZ1FCCgjy8y5hUw74MjzidBd5UpL28OSBELSEroGr8TIT5fNw+vckGGe3s1CZ/nj2i78I0rWJcpbIj1WfZ8MMoS+9mVrQjBDDKJVWz3VzE5nUDnOzMywITt3GwewUsEjISsxlB+AeDsVd/eJMDdgbSwM17fI2smzjUfytKIVSwMr0gOzcUQIAmSYpxPv/nRLZ41VuiEnR48MpgbX9WelMjUDaMwMwuUtHeUmLN4/7i5sWNlK270cu7VYSWo= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3966.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(376002)(366004)(346002)(39860400002)(136003)(451199021)(66574015)(83380400001)(110136005)(55016003)(478600001)(33656002)(8676002)(8936002)(19627235002)(4326008)(66476007)(316002)(66446008)(76116006)(38070700005)(66946007)(64756008)(52536014)(66556008)(122000001)(38100700002)(5660300002)(41300700001)(86362001)(7696005)(30864003)(71200400001)(2906002)(966005)(26005)(9686003)(186003)(6506007)(53546011)(559001)(579004)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?al0/Klc5WT13nzoMLah1tmlg4mTXWMCwAQDGNXPwQBdJXED0nKpNJ7bQ3bll?= =?us-ascii?Q?ke8A10WLYc3Hoh0F5iwQ+y3GfCYZLmAxLOmgA/dhZZkfdAEIhl4Wg0ky8pKC?= =?us-ascii?Q?0j7B0bYdY2OmEK7Q4FRDdYE8DYx6IYeA65SLW3rKnPcuzG3U70hfbHH1VTAh?= =?us-ascii?Q?tdQHHFSSolcEBYYbpWaPkYFWLBmaXnJ7cOp6I0srLl7hXxB+u6ASWoZMMSOT?= =?us-ascii?Q?0Ev0sxe07IShGYgXKJumLLFe7ZwxOtZIgU7pdm6R3ePH8cZWJvPd3xf2MSlo?= =?us-ascii?Q?uxx92EXEK8wpUdaTegD/+fSsl8xzIoO8WPaVdBj565bc3wRGZDGtfryEsnLI?= =?us-ascii?Q?+AwCAviAc7NNoJrWq6iqMb/Ce1XNZajDNv9bb9CM4eqTOxOSMl8KUIV15I2H?= =?us-ascii?Q?juJK48nv1uwf6J4m1nRCPiquoG/lKqzEI6xZJK0NDeHfMsDHJArfwCmdbbeQ?= =?us-ascii?Q?y9bZeBxBGHhIl55uR8lztEECoo3ai3A+HqIyykLqP3/6tg0XBnH+kGns+F/L?= =?us-ascii?Q?aEtFoIzMmZ6tAtEh6aPyaZXUO4o52lUclm7DJm4uQPR2tIiq6sihBVVrkekL?= =?us-ascii?Q?A5HK8JxlWeQmeDT7p3SuGtthoTRkFxiyS24YUjWui31bfUcr/yk+MBTQrl9V?= =?us-ascii?Q?qeu/AYVGmP5kHHjAewAsLjYvaY2E68USiTQd81SKTU0ecPeId61Thqk0u8L4?= =?us-ascii?Q?KFjdUitkNUyuQNqFLVClATfoHApeTP//cOHGLdnxiNktIqCAEKhVpwUMAnOb?= =?us-ascii?Q?Bj/VVkHUjSh5Mg/gF4+ZYspJMbpuwq5ycFl56eCtMUeERKkHwm5nfnRih+Zn?= =?us-ascii?Q?N6ceGecpeNGiDE7XsOjIFGPi17i01hcy1tlWeYc69Ysv4iTDfeqMIdaDtpok?= =?us-ascii?Q?g2cfRaWqC1J+mDGYK4XHe9jFVmJHDj9VFkCCFeQdNg8G9jwTV1LXDkt3z13z?= =?us-ascii?Q?YqeLeZaUoz5m+vHoyLUUrB42t1vzr0cehBR15ogB0RW6Vk+1GMdB0GhVjh3F?= =?us-ascii?Q?hyFIY1kkQL7MX2HRr2cKx+QwSYRm7qdJWW49+6oI8Vme9WKQ5k9G6QYvWaBn?= =?us-ascii?Q?m2t7Clm4z7ytV6jzVA4Cix0Co2M7oQ5BQ9p5daT/b7/7QTyffEJPrjG1cxR6?= =?us-ascii?Q?lxiMT/LPjF6EoKCAgx+V8UCP/yoCBORyAlEaW9GuO2Wkt/Aaq5suWEx5t4uP?= =?us-ascii?Q?4o1uSpKV6+W1/goNKcfDZTFpbVsPi7h6yIiOv+J+1sxiHHVjK/h7DALBP2o4?= =?us-ascii?Q?ty3yqAhKLswToj2sZCbd6xKltl/tR7m5c38VnyCh7ver3mC8Tdpq99EtNHy5?= =?us-ascii?Q?OzPxaHvZjTU4vI2wB4OghZc8b9DDOsCOzpLPG6PmBUJM5eROomF/29UfSRuE?= =?us-ascii?Q?iLh9tQyJRRveVVZXUlUCfWQ1iht8j27z8B09uKVeTjKexhwQZ6vV96gjXaZt?= =?us-ascii?Q?0MVtAO2L3kNWjO3SdXbyiB10Td0yUYfJCUk8prplYmeFHSljVpwbrtg4DalW?= =?us-ascii?Q?xmZhWYVRZ/4xvtltJjmWR1KS3CC8lSIclIkArfIXTieirw5Z6pehqlSYJbf9?= =?us-ascii?Q?/cxcIrZkyoUl+ycON/W68Dj1gcTDxv0uebTBbkL3?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3966.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e55354b8-745f-4680-eeb7-08db672452d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2023 06:56:30.8822 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tSKBm7mnSYdtS7lUzUHXum3HdXcv6TPP2VpNJbesvbIyJkfTE5wXUKu/oN3YXpWKpTX7mXgxZ0nylkYeODF5jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB8950 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Hi Nickle, I have no problem with this patch except for the file naming and function t= hat use "2" instead of "To". Could you replace "2" with "To" in those naming? Thanks Abner > -----Original Message----- > From: Nickle Wang > Sent: Tuesday, June 6, 2023 9:38 PM > To: devel@edk2.groups.io > Cc: Chang, Abner ; Igor Kulchytskyy > > Subject: [edk2-redfish-client][PATCH 1/3] RedfishClientPkg: Add a sample > memory configuration HII driver > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > This is an HII sample driver of memory configuration. This demonstrates > the communication between platform configuration (EDK2/HII) and Redfish > service (Memory resource) base on RedfishClientPkg. > > The language ("x-uef-redfish-*") defined in the Redfish-specific uni file > is the connection between HII configuration and the Redfish schema. > > e.g. > > The HII option strings those applied with "x-uef-redfish-* HII language > are connected to the corresponding Redfish properties. > > e.g. > x-uefi-redfish-Memory.v1_7_1 "/Memory/{1}/BaseModuleType" > > The changes made on BIOS setup page or remote (OOB to Redfish service) > will be sync-up each other through EDKII Redfish feature driver using > the transport (REST_EX) provided by RedfishPkg. > > On EDK2, HTTP based REST EX protocol instance is used to consume and > update the Redfish properties. > > Check this for the RedfishClientPkg design architecture, > https://github.com/tianocore/edk2-redfish- > client/blob/main/RedfishClientPkg/Readme.md > > Below for RedfishPkg design architecture, > https://github.com/tianocore/edk2/blob/master/RedfishPkg/Readme.md > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > --- > RedfishClientPkg/RedfishClientPkg.dec | 2 + > .../RedfishClientComponents.dsc.inc | 2 + > RedfishClientPkg/RedfishClientPkg.dsc | 2 + > .../Hii2RedfishMemoryDxe.inf | 56 ++++ > .../Hii2RedfishMemoryData.h | 71 +++++ > .../Hii2RedfishMemoryDxe.h | 44 +++ > .../Hii2RedfishMemoryVfr.vfr | 219 +++++++++++++ > .../Hii2RedfishMemoryDxe.c | 292 ++++++++++++++++++ > .../Hii2RedfishMemoryDxeMap.uni | 38 +++ > .../Hii2RedfishMemoryDxeStrings.uni | 68 ++++ > RedfishClientPkg/RedfishClient.fdf.inc | 4 +- > 11 files changed, 797 insertions(+), 1 deletion(-) > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > create mode 100644 > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.uni > > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index 84bceca3..af241cf6 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -57,6 +57,8 @@ > ## Include/RedfishBase.h > gEfiRedfishClientVariableGuid =3D { 0x91c46a3d, 0xed= 1a, 0x477b, > { 0xa5, 0x33, 0x87, 0x2d, 0xcd, 0xb0, 0xfc, 0xc1 } } > > + gHii2RedfishMemoryFormsetGuid =3D { 0XC2BE579E, 0X3C= 57, > 0X499C, { 0XA9, 0XDF, 0XE6, 0X23, 0X8A, 0X49, 0X64, 0XF8 }} > + > [PcdsFixedAtBuild] > > gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32|UI > NT32|0x10000001 > > gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaVersionSize|8|UI > NT32|0x10000002 > diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc > b/RedfishClientPkg/RedfishClientComponents.dsc.inc > index e83f4bc9..3451c185 100644 > --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc > +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc > @@ -7,6 +7,7 @@ > # "RedfishClientDefines.dsc.inc". > # > # (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 > # > @@ -16,6 +17,7 @@ > RedfishClientPkg/RedfishFeatureCoreDxe/RedfishFeatureCoreDxe.inf > RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.inf > RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.inf > + RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > !endif > # > # Below two modules should be pulled in by build tool. > diff --git a/RedfishClientPkg/RedfishClientPkg.dsc > b/RedfishClientPkg/RedfishClientPkg.dsc > index d3b645b6..ac9f8e9d 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dsc > +++ b/RedfishClientPkg/RedfishClientPkg.dsc > @@ -37,6 +37,8 @@ > Ucs2Utf8Lib|RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf > RedfishCrtLib|RedfishPkg/PrivateLibrary/RedfishCrtLib/RedfishCrtLib.in= f > BaseSortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf > + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf > + > UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiService= sL > ib.inf > > [LibraryClasses.ARM, LibraryClasses.AARCH64] > # > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > new file mode 100644 > index 00000000..2dd6b0dd > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > @@ -0,0 +1,56 @@ > +## @file > +# HII-to-Redfish memory driver. > +# > +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D Hii2RedfishMemoryDxe > + FILE_GUID =3D 58134796-EB3A-4635-9664-6B7F68A8A9A= 1 > + MODULE_TYPE =3D UEFI_DRIVER > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D Hii2RedfishMemoryDxeDriverEntryPoin= t > + UNLOAD_IMAGE =3D Hii2RedfishMemoryDxeDriverUnload > + > +[Sources] > + Hii2RedfishMemoryDxe.c > + Hii2RedfishMemoryDxe.h > + Hii2RedfishMemoryData.h > + Hii2RedfishMemoryVfr.vfr > + Hii2RedfishMemoryDxeStrings.uni > + Hii2RedfishMemoryDxeMap.uni > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + RedfishClientPkg/RedfishClientPkg.dec > + > +[LibraryClasses] > + UefiDriverEntryPoint > + BaseLib > + BaseMemoryLib > + DebugLib > + PcdLib > + MemoryAllocationLib > + UefiBootServicesTableLib > + UefiRuntimeServicesTableLib > + UefiLib > + PrintLib > + HiiLib > + > +[Protocols] > + gEfiDevicePathProtocolGuid > + gEfiHiiConfigAccessProtocolGuid > + > + > +[Guids] > + gHii2RedfishMemoryFormsetGuid > + > +[Depex] > + gEfiHiiDatabaseProtocolGuid > + > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > new file mode 100644 > index 00000000..df8449d7 > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > @@ -0,0 +1,71 @@ > +/** @file > + The header file of HII-to-Redfish memory driver. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef HII_2_REDFISH_MEMORY_DATA_H_ > +#define HII_2_REDFISH_MEMORY_DATA_H_ > + > +#include > +#include > + > +#define HII_2_REDFISH_MEMORY_FORMSET_GUID \ > + { \ > + 0xC2BE579E, 0x3C57, 0x499C, { 0xA9, 0xDF, 0xE6, 0x23, 0x8A, 0x49, > 0x64, 0xF8 } \ > + } > + > +extern EFI_GUID gHii2RedfishMemoryFormsetGuid; > + > +#define FORM_ID 0x001 > +#define FROM_ID_MEMORY_1 0x002 > +#define FROM_ID_MEMORY_2 0x003 > +#define FROM_ID_MEMORY_3 0x004 > +#define FROM_ID_MEMORY_4 0x005 > + > +#define QUESTION_ID_MEMORY_1_BASE_MODULE_TYPE 0x100 > +#define QUESTION_ID_MEMORY_1_BUS_WIDTH_BITS 0x101 > +#define QUESTION_ID_MEMORY_1_CONFIGURATION_LOCKED 0x102 > + > +#define QUESTION_ID_MEMORY_2_BASE_MODULE_TYPE 0x200 > +#define QUESTION_ID_MEMORY_2_BUS_WIDTH_BITS 0x201 > +#define QUESTION_ID_MEMORY_2_CONFIGURATION_LOCKED 0x202 > + > +#define QUESTION_ID_MEMORY_3_BASE_MODULE_TYPE 0x300 > +#define QUESTION_ID_MEMORY_3_BUS_WIDTH_BITS 0x301 > +#define QUESTION_ID_MEMORY_3_CONFIGURATION_LOCKED 0x302 > + > +#define QUESTION_ID_MEMORY_4_BASE_MODULE_TYPE 0x400 > +#define QUESTION_ID_MEMORY_4_BUS_WIDTH_BITS 0x401 > +#define QUESTION_ID_MEMORY_4_CONFIGURATION_LOCKED 0x402 > + > +#define MEMORY_MAX_NO 0x04 > +#define ID_STRING_MIN 0 > +#define ID_STRING_MAX 15 > +#define ID_STRING_MAX_WITH_TERMINATOR 16 > + > +#pragma pack(1) > +// > +// Definiton of HII_2_REDFISH_MEMORY_SET > +// > +typedef struct { > + CHAR16 ModuleProductId[ID_STRING_MAX_WITH_TERMINATOR]; > + UINT8 BaseModuleType; > + UINT8 BusWidthBits; > + UINT8 ConfigurationLocked; > + UINT8 Reserved; // for 16 bit boundary of ModuleProd= uctId > +} HII_2_REDFISH_MEMORY_SET; > + > +// > +// Definiton of HII_2_REDFISH_MEMORY_EFI_VARSTORE_DATA > +// > +typedef struct { > + HII_2_REDFISH_MEMORY_SET Memory[MEMORY_MAX_NO]; > +} HII_2_REDFISH_MEMORY_EFI_VARSTORE_DATA; > + > +#pragma pack() > + > +#endif > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > new file mode 100644 > index 00000000..c00972ad > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > @@ -0,0 +1,44 @@ > +/** @file > + HII-to-Redfish memory driver header file. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef HII_2_REDFISH_MEMORY_DXE_H_ > +#define HII_2_REDFISH_MEMORY_DXE_H_ > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include "Hii2RedfishMemoryData.h" > + > +extern UINT8 Hii2RedfishMemoryVfrBin[]; > + > +#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() > + > +#endif > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > new file mode 100644 > index 00000000..99f5e9a4 > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > @@ -0,0 +1,219 @@ > +/** @file > + HII-to-Redfish memory driver VFR file. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > + > +#include "Hii2RedfishMemoryData.h" > + > +formset > + guid =3D HII_2_REDFISH_MEMORY_FORMSET_GUID, > + title =3D STRING_TOKEN(STR_FORM_SET_TITLE), > + help =3D STRING_TOKEN(STR_FORM_SET_TITLE_HELP), > + classguid =3D EFI_HII_PLATFORM_SETUP_FORMSET_GUID, > + > + // > + // Define a EFI variable Storage (EFI_IFR_VARSTORE_EFI) > + // > + efivarstore HII_2_REDFISH_MEMORY_EFI_VARSTORE_DATA, > + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | > EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures > + name =3D Hii2RedfishMemoryEfiVar, > + guid =3D HII_2_REDFISH_MEMORY_FORMSET_GUID; > + > + // > + // Define a Form (EFI_IFR_FORM) > + // > + form formid =3D FORM_ID, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE); // Form title > + > + goto FROM_ID_MEMORY_1, // Destination F= orm ID > + prompt =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_1), // Prompt > string > + help =3D STRING_TOKEN(STR_FORM_HELP_MEMORY_1); // Help string > + > + goto FROM_ID_MEMORY_2, // Destination F= orm ID > + prompt =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_2), // Prompt > string > + help =3D STRING_TOKEN(STR_FORM_HELP_MEMORY_2); // Help string > + > + goto FROM_ID_MEMORY_3, // Destination F= orm ID > + prompt =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_3), // Prompt > string > + help =3D STRING_TOKEN(STR_FORM_HELP_MEMORY_3); // Help string > + > + goto FROM_ID_MEMORY_4, // Destination F= orm ID > + prompt =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_4), // Prompt > string > + help =3D STRING_TOKEN(STR_FORM_HELP_MEMORY_4); // Help string > + > + endform; > + > + form formid =3D FROM_ID_MEMORY_1, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_1); // Form tit= le > + > + oneof varid =3D Hii2RedfishMemoryEfiVar.Memory[0].BaseModuleType, > + questionid =3D QUESTION_ID_MEMORY_1_BASE_MODULE_TYPE, > + prompt =3D > STRING_TOKEN(STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_1_BASE_MODULE_TYPE_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_MEMORY_RDIMM_PROMPT), > value =3D STR_MEMORY_RDIMM_PROMPT, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_MEMORY_UDIMM_PROMPT), > value =3D STR_MEMORY_UDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_SO_DIMM_PROMPT), > value =3D STR_MEMORY_SO_DIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_LRDIMM_PROMPT), > value =3D STR_MEMORY_LRDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_RDIMM_PROMPT), > value =3D STR_MEMORY_MINI_RDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_UDIMM_PROMPT), > value =3D STR_MEMORY_MINI_UDIMM_PROMPT, flags =3D 0; > + endoneof; > + > + string varid =3D Hii2RedfishMemoryEfiVar.Memory[0].ModuleProductId, > + prompt =3D > STRING_TOKEN(STR_MEMORY_1_MODULE_PRODUCT_ID_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_1_MODULE_PRODUCT_ID_HELP), > + flags =3D READ_ONLY, > + minsize =3D ID_STRING_MIN, > + maxsize =3D ID_STRING_MAX, > + endstring; > + > + numeric varid =3D Hii2RedfishMemoryEfiVar.Memory[0].BusWidthBits, > + prompt =3D > STRING_TOKEN(STR_MEMORY_1_BUS_WIDTH_BITS_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_1_BUS_WIDTH_BITS_HELP), > + minimum =3D 0, > + maximum =3D 0xff, > + step =3D 1, > + default =3D 20, > + endnumeric; > + > + checkbox varid =3D > Hii2RedfishMemoryEfiVar.Memory[0].ConfigurationLocked, > + prompt =3D > STRING_TOKEN(STR_MEMORY_1_CONFIGURATION_LOCKED_PROMPT), > + help =3D > STRING_TOKEN(STR_MEMORY_1_CONFIGURATION_LOCKED_HELP), > + flags =3D CHECKBOX_DEFAULT, > + default =3D TRUE, > + endcheckbox; > + > + endform; > + > + form formid =3D FROM_ID_MEMORY_2, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_2); // Form tit= le > + > + oneof varid =3D Hii2RedfishMemoryEfiVar.Memory[1].BaseModuleType, > + questionid =3D QUESTION_ID_MEMORY_2_BASE_MODULE_TYPE, > + prompt =3D > STRING_TOKEN(STR_MEMORY_2_BASE_MODULE_TYPE_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_2_BASE_MODULE_TYPE_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_MEMORY_RDIMM_PROMPT), > value =3D STR_MEMORY_RDIMM_PROMPT, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_MEMORY_UDIMM_PROMPT), > value =3D STR_MEMORY_UDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_SO_DIMM_PROMPT), > value =3D STR_MEMORY_SO_DIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_LRDIMM_PROMPT), > value =3D STR_MEMORY_LRDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_RDIMM_PROMPT), > value =3D STR_MEMORY_MINI_RDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_UDIMM_PROMPT), > value =3D STR_MEMORY_MINI_UDIMM_PROMPT, flags =3D 0; > + endoneof; > + > + string varid =3D Hii2RedfishMemoryEfiVar.Memory[1].ModuleProductId, > + prompt =3D > STRING_TOKEN(STR_MEMORY_2_MODULE_PRODUCT_ID_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_2_MODULE_PRODUCT_ID_HELP), > + flags =3D READ_ONLY, > + minsize =3D ID_STRING_MIN, > + maxsize =3D ID_STRING_MAX, > + endstring; > + > + numeric varid =3D Hii2RedfishMemoryEfiVar.Memory[1].BusWidthBits, > + prompt =3D > STRING_TOKEN(STR_MEMORY_2_BUS_WIDTH_BITS_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_2_BUS_WIDTH_BITS_HELP), > + minimum =3D 0, > + maximum =3D 0xff, > + step =3D 1, > + default =3D 20, > + endnumeric; > + > + checkbox varid =3D > Hii2RedfishMemoryEfiVar.Memory[1].ConfigurationLocked, > + prompt =3D > STRING_TOKEN(STR_MEMORY_2_CONFIGURATION_LOCKED_PROMPT), > + help =3D > STRING_TOKEN(STR_MEMORY_2_CONFIGURATION_LOCKED_HELP), > + flags =3D CHECKBOX_DEFAULT, > + default =3D TRUE, > + endcheckbox; > + > + endform; > + > + form formid =3D FROM_ID_MEMORY_3, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_3); // Form tit= le > + > + oneof varid =3D Hii2RedfishMemoryEfiVar.Memory[2].BaseModuleType, > + questionid =3D QUESTION_ID_MEMORY_3_BASE_MODULE_TYPE, > + prompt =3D > STRING_TOKEN(STR_MEMORY_3_BASE_MODULE_TYPE_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_3_BASE_MODULE_TYPE_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_MEMORY_RDIMM_PROMPT), > value =3D STR_MEMORY_RDIMM_PROMPT, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_MEMORY_UDIMM_PROMPT), > value =3D STR_MEMORY_UDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_SO_DIMM_PROMPT), > value =3D STR_MEMORY_SO_DIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_LRDIMM_PROMPT), > value =3D STR_MEMORY_LRDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_RDIMM_PROMPT), > value =3D STR_MEMORY_MINI_RDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_UDIMM_PROMPT), > value =3D STR_MEMORY_MINI_UDIMM_PROMPT, flags =3D 0; > + endoneof; > + > + string varid =3D Hii2RedfishMemoryEfiVar.Memory[2].ModuleProductId, > + prompt =3D > STRING_TOKEN(STR_MEMORY_3_MODULE_PRODUCT_ID_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_3_MODULE_PRODUCT_ID_HELP), > + flags =3D READ_ONLY, > + minsize =3D ID_STRING_MIN, > + maxsize =3D ID_STRING_MAX, > + endstring; > + > + numeric varid =3D Hii2RedfishMemoryEfiVar.Memory[2].BusWidthBits, > + prompt =3D > STRING_TOKEN(STR_MEMORY_3_BUS_WIDTH_BITS_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_3_BUS_WIDTH_BITS_HELP), > + minimum =3D 0, > + maximum =3D 0xff, > + step =3D 1, > + default =3D 20, > + endnumeric; > + > + checkbox varid =3D > Hii2RedfishMemoryEfiVar.Memory[2].ConfigurationLocked, > + prompt =3D > STRING_TOKEN(STR_MEMORY_3_CONFIGURATION_LOCKED_PROMPT), > + help =3D > STRING_TOKEN(STR_MEMORY_3_CONFIGURATION_LOCKED_HELP), > + flags =3D CHECKBOX_DEFAULT, > + default =3D TRUE, > + endcheckbox; > + > + endform; > + > + form formid =3D FROM_ID_MEMORY_4, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE_MEMORY_3); // Form tit= le > + > + oneof varid =3D Hii2RedfishMemoryEfiVar.Memory[3].BaseModuleType, > + questionid =3D QUESTION_ID_MEMORY_4_BASE_MODULE_TYPE, > + prompt =3D > STRING_TOKEN(STR_MEMORY_4_BASE_MODULE_TYPE_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_4_BASE_MODULE_TYPE_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_MEMORY_RDIMM_PROMPT), > value =3D STR_MEMORY_RDIMM_PROMPT, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_MEMORY_UDIMM_PROMPT), > value =3D STR_MEMORY_UDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_SO_DIMM_PROMPT), > value =3D STR_MEMORY_SO_DIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_LRDIMM_PROMPT), > value =3D STR_MEMORY_LRDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_RDIMM_PROMPT), > value =3D STR_MEMORY_MINI_RDIMM_PROMPT, flags =3D 0; > + option text =3D STRING_TOKEN(STR_MEMORY_MINI_UDIMM_PROMPT), > value =3D STR_MEMORY_MINI_UDIMM_PROMPT, flags =3D 0; > + endoneof; > + > + string varid =3D Hii2RedfishMemoryEfiVar.Memory[3].ModuleProductId, > + prompt =3D > STRING_TOKEN(STR_MEMORY_4_MODULE_PRODUCT_ID_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_4_MODULE_PRODUCT_ID_HELP), > + flags =3D READ_ONLY, > + minsize =3D ID_STRING_MIN, > + maxsize =3D ID_STRING_MAX, > + endstring; > + > + numeric varid =3D Hii2RedfishMemoryEfiVar.Memory[3].BusWidthBits, > + prompt =3D > STRING_TOKEN(STR_MEMORY_4_BUS_WIDTH_BITS_PROMPT), > + help =3D STRING_TOKEN(STR_MEMORY_4_BUS_WIDTH_BITS_HELP), > + minimum =3D 0, > + maximum =3D 0xff, > + step =3D 1, > + default =3D 20, > + endnumeric; > + > + checkbox varid =3D > Hii2RedfishMemoryEfiVar.Memory[3].ConfigurationLocked, > + prompt =3D > STRING_TOKEN(STR_MEMORY_4_CONFIGURATION_LOCKED_PROMPT), > + help =3D > STRING_TOKEN(STR_MEMORY_4_CONFIGURATION_LOCKED_HELP), > + flags =3D CHECKBOX_DEFAULT, > + default =3D TRUE, > + endcheckbox; > + > + endform; > + > +endformset; > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > new file mode 100644 > index 00000000..83710240 > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > @@ -0,0 +1,292 @@ > +/** @file > + HII-to-Redfish memory driver. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "Hii2RedfishMemoryDxe.h" > + > +EFI_GUID mHii2RedfishMemoryGuid =3D > HII_2_REDFISH_MEMORY_FORMSET_GUID; > +EFI_HII_HANDLE mHiiHandle; > +EFI_HANDLE DriverHandle; > +CHAR16 Hii2RedfishEfiVar[] =3D L"Hii2RedfishMemoryEfiVar"; > + > +/// > +/// HII specific Vendor Device Path definition. > +/// > +HII_VENDOR_DEVICE_PATH mHiiVendorDevicePath =3D { > + { > + { > + HARDWARE_DEVICE_PATH, > + HW_VENDOR_DP, > + { > + (UINT8)(sizeof (VENDOR_DEVICE_PATH)), > + (UINT8)((sizeof (VENDOR_DEVICE_PATH)) >> 8) > + } > + }, > + HII_2_REDFISH_MEMORY_FORMSET_GUID > + }, > + { > + END_DEVICE_PATH_TYPE, > + END_ENTIRE_DEVICE_PATH_SUBTYPE, > + { > + (UINT8)(END_DEVICE_PATH_LENGTH), > + (UINT8)((END_DEVICE_PATH_LENGTH) >> 8) > + } > + } > +}; > + > +/** > + Initial HII variable if it does not exist. > + > + @retval EFI_SUCESS HII variable is initialized. > + > +**/ > +EFI_STATUS > +InitialHiiVairable ( > + VOID > + ) > +{ > + EFI_STATUS Status; > + UINTN BufferSize; > + HII_2_REDFISH_MEMORY_EFI_VARSTORE_DATA Hii2RedfishMemoryVar; > + UINTN Index; > + > + // > + // Get Buffer Storage data from EFI variable. > + // Try to get the current setting from variable. > + // > + BufferSize =3D sizeof (HII_2_REDFISH_MEMORY_EFI_VARSTORE_DATA); > + Status =3D gRT->GetVariable ( > + Hii2RedfishEfiVar, > + &gHii2RedfishMemoryFormsetGuid, > + NULL, > + &BufferSize, > + &Hii2RedfishMemoryVar > + ); > + if (!EFI_ERROR (Status)) { > + return EFI_SUCCESS; > + } > + > + // > + // Initialization > + // > + for (Index =3D 0; Index < MEMORY_MAX_NO; Index++) { > + Hii2RedfishMemoryVar.Memory[Index].BaseModuleType =3D > STR_MEMORY_RDIMM_PROMPT; > + Hii2RedfishMemoryVar.Memory[Index].BusWidthBits =3D 20; > + Hii2RedfishMemoryVar.Memory[Index].ConfigurationLocked =3D TRUE; > + StrCpyS (Hii2RedfishMemoryVar.Memory[Index].ModuleProductId, > ID_STRING_MAX_WITH_TERMINATOR, L"1234"); > + } > + > + Status =3D gRT->SetVariable ( > + Hii2RedfishEfiVar, > + &gHii2RedfishMemoryFormsetGuid, > + VARIABLE_ATTRIBUTE_NV_BS, > + BufferSize, > + &Hii2RedfishMemoryVar > + ); > + > + return Status; > +} > + > +/** > + This function allows a caller to extract the current configuration for= one > + or more named elements from the target driver. > + > + @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PRO= TOCOL. > + @param[in] Request A null-terminated Unicode string in > + format. > + @param[out] Progress On return, points to a character in the= Request > + string. Points to the string's null ter= minator if > + request was successful. Points to the m= ost recent > + '&' before the first failing name/value= pair (or > + the beginning of the string if the fail= ure is in > + the first name/value pair) if the reque= st was not > + successful. > + @param[out] Results A null-terminated Unicode string in > + format which has all va= lues 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 requeste= d 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 > +Hii2RedfishMemoryExtractConfig ( > + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, > + IN CONST EFI_STRING Request, > + OUT EFI_STRING *Progress, > + OUT EFI_STRING *Results > + ) > +{ > + if ((Progress =3D=3D NULL) || (Results =3D=3D NULL)) { > + return EFI_INVALID_PARAMETER; > + } > + > + if (Request =3D=3D NULL) { > + return EFI_UNSUPPORTED; > + } > + > + // > + // Check whether request for EFI Varstore. EFI varstore get data > + // through hii database, not support in this path. > + // > + if (HiiIsConfigHdrMatch (Request, &gHii2RedfishMemoryFormsetGuid, > L"Hii2RedfishMemoryEfiVar")) { > + return EFI_UNSUPPORTED; > + } > + > + return EFI_NOT_FOUND; > +} > + > +/** > + This function processes the results of changes in configuration. > + > + @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PRO= TOCOL. > + @param[in] Configuration A null-terminated Unicode string in > > + format. > + @param[out] Progress A pointer to a string filled in with th= e offset of > + the most recent '&' before the first fa= iling > + name/value pair (or the beginning of th= e string if > + the failure is in the first name/value = pair) or > + the terminating NULL if all was success= ful. > + > + @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 > +Hii2RedfishMemoryRouteConfig ( > + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, > + IN CONST EFI_STRING Configuration, > + OUT EFI_STRING *Progress > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a, unsupported\n", __func__)); > + > + return EFI_UNSUPPORTED; > +} > + > +/** > + This function processes the results of changes in configuration. > + > + @param[in] This Points to the EFI_HII_CONFIG_ACCESS_PRO= TOCOL. > + @param[in] Action Specifies the type of action taken by t= he browser. > + @param[in] QuestionId A unique value which is sent to the ori= ginal > + exporting driver so that it can identif= y the type > + of data to expect. > + @param[in] Type The type of value for the question. > + @param[in] Value A pointer to the data being sent to the= original > + exporting driver. > + @param[out] ActionRequest On return, points to the action request= ed by > the > + callback function. > + > + @retval EFI_SUCCESS The callback successfully handled the a= ction. > + @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold > the > + variable and its data. > + @retval EFI_DEVICE_ERROR The variable could not be saved. > + @retval EFI_UNSUPPORTED The specified Action is not supported b= y the > + callback. > + > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishMemoryDriverCallback ( > + 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 > + ) > +{ > + DEBUG ((DEBUG_INFO, "%a, action: 0x%x QID: 0x%x\n", __func__, Action, > QuestionId)); > + > + return EFI_UNSUPPORTED; > +} > + > +EFI_HII_CONFIG_ACCESS_PROTOCOL mHii2RedfishConfigAccess =3D { > + Hii2RedfishMemoryExtractConfig, > + Hii2RedfishMemoryRouteConfig, > + Hii2RedfishMemoryDriverCallback > +}; > + > +/** > + Main entry for this driver. > + > + @param[in] ImageHandle Image handle this driver. > + @param[in] SystemTable Pointer to SystemTable. > + > + @retval EFI_SUCESS This function always complete successfully. > + > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishMemoryDxeDriverEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + DriverHandle =3D NULL; > + Status =3D gBS->InstallMultipleProtocolInterfaces ( > + &DriverHandle, > + &gEfiDevicePathProtocolGuid, > + &mHiiVendorDevicePath, > + &gEfiHiiConfigAccessProtocolGuid, > + &mHii2RedfishConfigAccess, > + NULL > + ); > + > + // > + // Publish our HII data > + // > + mHiiHandle =3D HiiAddPackages ( > + &mHii2RedfishMemoryGuid, > + DriverHandle, > + Hii2RedfishMemoryDxeStrings, > + Hii2RedfishMemoryVfrBin, > + NULL > + ); > + if (mHiiHandle =3D=3D NULL) { > + return EFI_OUT_OF_RESOURCES; > + } > + > + Status =3D InitialHiiVairable (); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to initial variable: %r\n", __func_= _, > Status)); > + } > + > + return EFI_SUCCESS; > +} > + > +/** > + Unloads the application and its installed protocol. > + > + @param[in] ImageHandle Handle that identifies the image to be > unloaded. > + > + @retval EFI_SUCCESS The image has been unloaded. > +**/ > +EFI_STATUS > +EFIAPI > +Hii2RedfishMemoryDxeDriverUnload ( > + IN EFI_HANDLE ImageHandle > + ) > +{ > + if (mHiiHandle !=3D NULL) { > + HiiRemovePackages (mHiiHandle); > + } > + > + return EFI_SUCCESS; > +} > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > new file mode 100644 > index 00000000..de1a6ef3 > --- /dev/null > +++ > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > @@ -0,0 +1,38 @@ > +/** @file > + HII-to-Redfish memory driver. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > +#langdef x-uefi-redfish-Memory.v1_7_1 "Memory.v1_7_1" > + > +#string STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{1}/BaseModuleType" > +#string STR_MEMORY_1_BUS_WIDTH_BITS_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "/Memory/{1}/BusWidthBits" > +#string STR_MEMORY_1_CONFIGURATION_LOCKED_PROMPT #language > x-uefi-redfish-Memory.v1_7_1 "/Memory/{1}/ConfigurationLocked" > +#string STR_MEMORY_1_MODULE_PRODUCT_ID_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{1}/ModuleProductID" > + > +#string STR_MEMORY_2_BASE_MODULE_TYPE_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{2}/BaseModuleType" > +#string STR_MEMORY_2_BUS_WIDTH_BITS_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "/Memory/{2}/BusWidthBits" > +#string STR_MEMORY_2_CONFIGURATION_LOCKED_PROMPT #language > x-uefi-redfish-Memory.v1_7_1 "/Memory/{2}/ConfigurationLocked" > +#string STR_MEMORY_2_MODULE_PRODUCT_ID_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{2}/ModuleProductID" > + > +#string STR_MEMORY_3_BASE_MODULE_TYPE_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{3}/BaseModuleType" > +#string STR_MEMORY_3_BUS_WIDTH_BITS_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "/Memory/{3}/BusWidthBits" > +#string STR_MEMORY_3_CONFIGURATION_LOCKED_PROMPT #language > x-uefi-redfish-Memory.v1_7_1 "/Memory/{3}/ConfigurationLocked" > +#string STR_MEMORY_3_MODULE_PRODUCT_ID_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{3}/ModuleProductID" > + > +#string STR_MEMORY_4_BASE_MODULE_TYPE_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{5}/BaseModuleType" > +#string STR_MEMORY_4_BUS_WIDTH_BITS_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "/Memory/{5}/BusWidthBits" > +#string STR_MEMORY_4_CONFIGURATION_LOCKED_PROMPT #language > x-uefi-redfish-Memory.v1_7_1 "/Memory/{5}/ConfigurationLocked" > +#string STR_MEMORY_4_MODULE_PRODUCT_ID_PROMPT #language x- > uefi-redfish-Memory.v1_7_1 "/Memory/{5}/ModuleProductID" > + > +#string STR_MEMORY_RDIMM_PROMPT #language x-uefi-red= fish- > Memory.v1_7_1 "RDIMM" > +#string STR_MEMORY_UDIMM_PROMPT #language x-uefi-red= fish- > Memory.v1_7_1 "UDIMM" > +#string STR_MEMORY_SO_DIMM_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "SO_DIMM" > +#string STR_MEMORY_LRDIMM_PROMPT #language x-uefi-red= fish- > Memory.v1_7_1 "LRDIMM" > +#string STR_MEMORY_MINI_RDIMM_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "Mini_RDIMM" > +#string STR_MEMORY_MINI_UDIMM_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "Mini_UDIMM" > diff --git > a/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.u > ni > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.u > ni > new file mode 100644 > index 00000000..bfa082fd > --- /dev/null > +++ > b/RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.u > ni > @@ -0,0 +1,68 @@ > +/** @file > + HII-to-Redfish memory driver. > + > + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > +#langdef en-US "English" > + > +#string STR_FORM_SET_TITLE #language en-US "HII t= o Redfish > (Memory)" > +#string STR_FORM_SET_TITLE_HELP #language en-US "HII t= o Redfish > (Memory)" > +#string STR_FORM_TITLE #language en-US "HII t= o Redfish > Memory properties" > + > +#string STR_FORM_TITLE_MEMORY_1 #language en-US "Memor= y > 1" > +#string STR_FORM_HELP_MEMORY_1 #language en-US "Memor= y > 1" > +#string STR_FORM_TITLE_MEMORY_2 #language en-US "Memor= y > 2" > +#string STR_FORM_HELP_MEMORY_2 #language en-US "Memor= y > 2" > +#string STR_FORM_TITLE_MEMORY_3 #language en-US "Memor= y > 3" > +#string STR_FORM_HELP_MEMORY_3 #language en-US "Memor= y > 3" > +#string STR_FORM_TITLE_MEMORY_4 #language en-US "Memor= y > 5" > +#string STR_FORM_HELP_MEMORY_4 #language en-US "Memor= y > 5" > + > + > +#string STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT #language en-US > "Base module type" > +#string STR_MEMORY_1_BASE_MODULE_TYPE_HELP #language en-US > "The value of this property shall be the base module type of Memory" > +#string STR_MEMORY_1_BUS_WIDTH_BITS_PROMPT #language en-US > "Bus Width in bits" > +#string STR_MEMORY_1_BUS_WIDTH_BITS_HELP #language en-US "The > value of this property shall be the bus width in bits" > +#string STR_MEMORY_1_CONFIGURATION_LOCKED_PROMPT #language en- > US "Configuration Locked" > +#string STR_MEMORY_1_CONFIGURATION_LOCKED_HELP #language en-US > "The value of this property shall be the current configuration lock state= of this > memory. True shall indicate that the configuration is locked and cannot b= e > altered. False shall indicate that the configuration is not locked and ma= y be > altered" > +#string STR_MEMORY_1_MODULE_PRODUCT_ID_PROMPT #language en- > US "Module Product ID" > +#string STR_MEMORY_1_MODULE_PRODUCT_ID_HELP #language en-US > "The product ID of this memory module." > + > +#string STR_MEMORY_2_BASE_MODULE_TYPE_PROMPT #language en-US > "Base module type" > +#string STR_MEMORY_2_BASE_MODULE_TYPE_HELP #language en-US > "The value of this property shall be the base module type of Memory" > +#string STR_MEMORY_2_BUS_WIDTH_BITS_PROMPT #language en-US > "Bus Width in bits" > +#string STR_MEMORY_2_BUS_WIDTH_BITS_HELP #language en-US "The > value of this property shall be the bus width in bits" > +#string STR_MEMORY_2_CONFIGURATION_LOCKED_PROMPT #language en- > US "Configuration Locked" > +#string STR_MEMORY_2_CONFIGURATION_LOCKED_HELP #language en-US > "The value of this property shall be the current configuration lock state= of this > memory. True shall indicate that the configuration is locked and cannot b= e > altered. False shall indicate that the configuration is not locked and ma= y be > altered" > +#string STR_MEMORY_2_MODULE_PRODUCT_ID_PROMPT #language en- > US "Module Product ID" > +#string STR_MEMORY_2_MODULE_PRODUCT_ID_HELP #language en-US > "The product ID of this memory module." > + > +#string STR_MEMORY_3_BASE_MODULE_TYPE_PROMPT #language en-US > "Base module type" > +#string STR_MEMORY_3_BASE_MODULE_TYPE_HELP #language en-US > "The value of this property shall be the base module type of Memory" > +#string STR_MEMORY_3_BUS_WIDTH_BITS_PROMPT #language en-US > "Bus Width in bits" > +#string STR_MEMORY_3_BUS_WIDTH_BITS_HELP #language en-US "The > value of this property shall be the bus width in bits" > +#string STR_MEMORY_3_CONFIGURATION_LOCKED_PROMPT #language en- > US "Configuration Locked" > +#string STR_MEMORY_3_CONFIGURATION_LOCKED_HELP #language en-US > "The value of this property shall be the current configuration lock state= of this > memory. True shall indicate that the configuration is locked and cannot b= e > altered. False shall indicate that the configuration is not locked and ma= y be > altered" > +#string STR_MEMORY_3_MODULE_PRODUCT_ID_PROMPT #language en- > US "Module Product ID" > +#string STR_MEMORY_3_MODULE_PRODUCT_ID_HELP #language en-US > "The product ID of this memory module." > + > +#string STR_MEMORY_4_BASE_MODULE_TYPE_PROMPT #language en-US > "Base module type" > +#string STR_MEMORY_4_BASE_MODULE_TYPE_HELP #language en-US > "The value of this property shall be the base module type of Memory" > +#string STR_MEMORY_4_BUS_WIDTH_BITS_PROMPT #language en-US > "Bus Width in bits" > +#string STR_MEMORY_4_BUS_WIDTH_BITS_HELP #language en-US "The > value of this property shall be the bus width in bits" > +#string STR_MEMORY_4_CONFIGURATION_LOCKED_PROMPT #language en- > US "Configuration Locked" > +#string STR_MEMORY_4_CONFIGURATION_LOCKED_HELP #language en-US > "The value of this property shall be the current configuration lock state= of this > memory. True shall indicate that the configuration is locked and cannot b= e > altered. False shall indicate that the configuration is not locked and ma= y be > altered" > +#string STR_MEMORY_4_MODULE_PRODUCT_ID_PROMPT #language en- > US "Module Product ID" > +#string STR_MEMORY_4_MODULE_PRODUCT_ID_HELP #language en-US > "The product ID of this memory module." > + > +#string STR_MEMORY_RDIMM_PROMPT #language en-US > "RDIMM" > +#string STR_MEMORY_UDIMM_PROMPT #language en-US > "UDIMM" > +#string STR_MEMORY_SO_DIMM_PROMPT #language en-US > "SO_DIMM" > +#string STR_MEMORY_LRDIMM_PROMPT #language en-US > "LRDIMM" > +#string STR_MEMORY_MINI_RDIMM_PROMPT #language en-US > "Mini_RDIMM" > +#string STR_MEMORY_MINI_UDIMM_PROMPT #language en-US > "Mini_UDIMM" > diff --git a/RedfishClientPkg/RedfishClient.fdf.inc > b/RedfishClientPkg/RedfishClient.fdf.inc > index fa4e5389..7421440b 100644 > --- a/RedfishClientPkg/RedfishClient.fdf.inc > +++ b/RedfishClientPkg/RedfishClient.fdf.inc > @@ -2,10 +2,11 @@ > # Redfish Client FDF include file for [FV*] section of all Architectures= . > # > # This file can be included to the [FV*] section(s) of a platform FDF fi= le > -# by using "!include RedfishClientPkg/RedfisClientLibs.fdf.inc" to speci= fy the > module instances > +# by using "!include RedfishClientPkg/RedfishClientLibs.fdf.inc" to spec= ify the > module instances > # to be built in the firmware volume. > # > # (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 > # > @@ -19,6 +20,7 @@ > INF > RedfishClientPkg/Features/ComputerSystem/v1_5_0/Dxe/ComputerSystemD > xe.inf > INF > RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystem > CollectionDxe.inf > INF RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf > + INF RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > > !include RedfishClientPkg/RedfishJsonStructureDxe.fdf.inc > # > -- > 2.17.1