From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.2862.1635496802453693300 for ; Fri, 29 Oct 2021 01:40:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=OE/HppGa; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0936a41adb=abner.chang@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19T4JNcn028505; Fri, 29 Oct 2021 08:39:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=zyTLzn5RYJedZ2l3cAOHVcAT+VTCRld16N+UrpWkDlc=; b=OE/HppGa1LqnKoUFm6e4MmwndPjlUgW/XWQpXNhBCusK31AcpBcRaXlfVkyrPVHqTVLO OAQWtmRSqDRAKdMS96HN2d61N50E+oBFX6hlyAnLEn3BIx+c2f+CYt/QvvSPIg2K6cJx zSd4s6DR92M1G0GJ59HzefLU6PPdMbxyv1VbSyvjIiQyMmG8aUomy9zRvMv8MNHQYRUk wMEwJRv2eoYSXE6uM8zEYhBk8TZVSjJhxKMMgAK4kUfDm/t7NQcelc67SqPco03DvtGO WzXuWGg7ENJpI4L8szY/FvEvJcVo9eyjCLl6ZtCUiAWwq9YztVVu1dDPKtdF6D/eXmTc Pw== Received: from g9t5009.houston.hpe.com (g9t5009.houston.hpe.com [15.241.48.73]) by mx0b-002e3701.pphosted.com with ESMTP id 3bypxqjths-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Oct 2021 08:39:47 +0000 Received: from G1W8108.americas.hpqcorp.net (g1w8108.austin.hp.com [16.193.72.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5009.houston.hpe.com (Postfix) with ESMTPS id 11C4979; Fri, 29 Oct 2021 08:39:47 +0000 (UTC) Received: from G4W9121.americas.hpqcorp.net (2002:10d2:1510::10d2:1510) by G1W8108.americas.hpqcorp.net (2002:10c1:483c::10c1:483c) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 29 Oct 2021 08:39:46 +0000 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (15.241.52.10) by G4W9121.americas.hpqcorp.net (16.210.21.16) with Microsoft SMTP Server (TLS) id 15.0.1497.23 via Frontend Transport; Fri, 29 Oct 2021 08:39:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SVrMeP5Hkx0m0ONcuE0ai/ompFVMqwh2uci3vhr3VcWka8gztgUagioK11hJgYJZMurm3EcM0L73SvlaktFQ7C9FWu1Gx4ESAcuCvc871UfzGEUFaoi1DKMM+BraiCh4D6AkBRBp+zYqlrzLOzv2U7hQjRK1vBkuI+EQ9FH40lY6Z5cfmK1o/0AWiRKHqoD5bID+Dc8Nj4fDQrbWvHmtvKQ3XGR26MZx1L8By/QgThVlq/mQdDZlnZCV4aqleAwhEZ5F6FF8jGq0oOLp5gk/0sAU1Yht6BptNEoRPfR6b4KLnc2F4rr09fRGyI+pzyl667TZdh17fl6YSjaz1NglHg== 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=95CYi6SnHX3U21EZ6oeFJ5syGJJB0+wgw/ww/JlTdrQ=; b=mAuvv7CwTVSLEF0NB5vaiPcxNZa9rVtIMK4vflOH01C5IBbEKDlPGoCnNl+BK179QCFKHFPAVLut3+HOo2MIIoVYCRJH/XwbMmUboXXEvxRIXkD+ETqZsd+fj92weKhc6mIaG2Z5xtcN12dM8ak+FDl6t47oeuTqmNSXBJpyYt7TS6oqvirlm9oaiRRfiDrSrru8onwM0F/0r+Rq8rTY/npMqBp3iWUQUd6oU9cmVJNbdF0Oox2c22z8cdD6ulbzgZIrJKG7yfbhmna49hckhYpxQfk3uuOveITbTVO7zN2VwuB9TtoJXUHqqpVLHp2wfDn0iR2T25CZ8IlaSqsyKw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7508::16) by CS1PR8401MB0518.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7512::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Fri, 29 Oct 2021 08:39:44 +0000 Received: from CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::85c4:1828:a12:8be7]) by CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM ([fe80::85c4:1828:a12:8be7%8]) with mapi id 15.20.4649.015; Fri, 29 Oct 2021 08:39:43 +0000 From: "Abner Chang" To: "devel@edk2.groups.io" , "Chang, Abner (HPS SW/FW Technologist)" CC: "Wang, Nickle (HPS SW)" , Liming Gao , Andrew Fish , Ray Ni Subject: Re: [edk2-devel] [PATCH] edk2-staging/EmulatorPkg: Add a sample memory configuration HII driver Thread-Topic: [edk2-devel] [PATCH] edk2-staging/EmulatorPkg: Add a sample memory configuration HII driver Thread-Index: AQHXzGaztUgURZGhPk++EPPZg3imYKvpp/lg Date: Fri, 29 Oct 2021 08:39:43 +0000 Message-ID: References: <16B25D0D5E069C47.9643@groups.io> In-Reply-To: <16B25D0D5E069C47.9643@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f628c246-6eee-4341-8bf0-08d99ab7a81c x-ms-traffictypediagnostic: CS1PR8401MB0518: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: c3tpuyKzytT02e+99Yyqn1urVpQd96QkNG8dnmDYEGCdApu7Gccd4TMEQ7KFyOdi/CwrVPzkhYJKHekmvi23gRlUgeTOUluCXMWgJu5uZcKDK1XamwZPm6MaKZd/A8xoHAWbF5yTdxJwBsOddIo+M+NQT8AlgSHIK6bj+5WOo0fO/vXJZgMoQYXq70jz2F3qSF8F7nqzKoXWFb68Sq3obdqbVM9fmrJ+qMgffT3WtjL5ALnsEBIskKEZvD1DaXWJcCXYI1t1+m5AfaPPsDFd6Y85Ut4fYz4HceSzzaoNk551sFkjjvdtD7vO1j5og+ZldCKUlnBRShUb3PaiHWn9i54J8q38ZKRQ6JOwg+dH4oYLdAAn6Dm5jWX5INcgJZbPoLWjRfcRxbGCNBqP3Dnr98xmmNrU2jG1x4mBYrou5HHMNtLMMYFLS+cqCTsBSolJtlm0Xv0Qxe399BZqZ/FGbKkquhxrmXn92RZ7EWkklB6It3N2tsvh0W5Mq09oJiK/P1PFMOVInf7rD0B2dhO4jfzAOAwlhoH2BuV32zGjZacOfJ87M9VvU+mevusZZaUVSjegiTU7ZDZstd7d509w0xKRlSF+lM/IJd1zndASVVTNJOluAMuqn6/sLLL/t2MoJ4hpe91VBzMxHsToFrEH74QYjuAI0WTWBJk/aeAXeydElsS1OhXWOQfiGssB5sjMGGl0QEb0ltMRKkpjngI7VujL0sP37zujhr/1mJqLKywIqb2N/I1nbKX4FriMRy3JDxUOdkaB3uGQSmeXpRB3a8bl++FP6dIOjWCOY/7G0RpQDMc3i9R620Fnt7E1woPfkZvsYvugExoRoKgCTznIbruc5tG5/j/BVSL85ajMQas= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(366004)(66476007)(66574015)(19627235002)(66556008)(122000001)(38070700005)(64756008)(316002)(83380400001)(52536014)(9686003)(71200400001)(30864003)(66446008)(8676002)(76116006)(66946007)(54906003)(55016002)(8936002)(53546011)(966005)(186003)(508600001)(110136005)(82960400001)(26005)(86362001)(7696005)(4326008)(2906002)(33656002)(38100700002)(6506007)(5660300002)(559001)(579004)(44824005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?uMSKikt4q3qL4s7WNhoQlGvUiftK2fGZFE2S/ogFMxUEdY2dKcdn5Px9gjTE?= =?us-ascii?Q?hlk799l+/YoWYNeRjjO3kYNO5gx6GYLfEG5OHMmGjDuzCTHWa+c5T8YBQqSb?= =?us-ascii?Q?9IQ0YVS6Ms7fvtoAQkdj/yP0aPmNFibUyt0AQthSBucn0W9SORqXpb1/wkwG?= =?us-ascii?Q?w+HUjBoj1wPk1fsj9mJBkx+uqmZQKmvrN13QkrePp3Gx1QlIPEbUl0yYMblX?= =?us-ascii?Q?4S71c+WVAmg9g8voSAMBYdytsev9lPtiFS0dgBqP51Y+NOTIv9OBSSIFL0WC?= =?us-ascii?Q?dy7QQxppmB7HAKI+2z6wO+XdqC0JyqU06Kjqk5b/1omU3dfvbfm9rPzlrofa?= =?us-ascii?Q?D2a47mpwysPUYx99hBbVRtUWLGDEdf5SW1hEuNQ9SLc353OXdaNuNUWP1UMy?= =?us-ascii?Q?mOWruFeKrf2G98ejy8sWt1bE62jkG1Nx4wKxwY6M9jgfS9oguTyeDdSTYWpz?= =?us-ascii?Q?murs5xkPLVq0AhBduNAz5hVLyZhTBFA0zuE8hAk2A+SjXwLwQ8t+0IrzS048?= =?us-ascii?Q?q88oDcs4yuXYVqoYBnbYMktNZkS9IbOmWSji3G85gBWF76zM9kLzyA2BP+1P?= =?us-ascii?Q?zWT7TrsJnrBVlqm1r8gIIp7SNjErH6aDBFZyiwic1csmsq1QT5J6F91K0fza?= =?us-ascii?Q?bTXLMg9sx6/mUOsZla7PR1IvMpuNNwLlfVdOeeuq440HM9q9jr+4z/xwrFkQ?= =?us-ascii?Q?8CDBLmaJeW85/CVytu9/itEeOLQsBUlZmqRlnLkIRgY6ICPFcD+9ZpHQ263T?= =?us-ascii?Q?0iqep+Buk6+ZIACottbDtiYj5eI6vHJno24ioAeeYYzTYNXtKC5EZbxj8Kkc?= =?us-ascii?Q?Id8/RjH5HuADzTFIyEi+cOV4OVYZdea8aYSRlwr6CLHWj5BbgrPuVCdDeW1n?= =?us-ascii?Q?ITXNXP9oAcimnna7rBzoT21Zs/8wNKJMZNlIlkQ2bXSnq2KXpyXVBsJ6x1dT?= =?us-ascii?Q?nzkVQcyknwqPOVJPlx4Lt9V8qYKoYB9f0URuvnr5zvk+bCn7MxE4JzL7Y10T?= =?us-ascii?Q?G0l9C8OMVfq6/8OksUHFKiH7rE0fEqlcL/2hbYpgEHXzrimaOqbhVhHi1U5k?= =?us-ascii?Q?w0LMvWQNDOZhK7KxZSK3O/Qe0yERAEIi0cR3P2l2enWxgZjhq7TPM7aHYdNJ?= =?us-ascii?Q?wUjn6B74Pg24Gglvic61xVuMODeMWLpKYwgsH3OjhdxQdLOk1+MLNnZJ2c5f?= =?us-ascii?Q?9f+oc/3AwptNXanjRC3EZm2VkOK8QqXwSCvA7lAnDNazjTxQXtgURXrouD6v?= =?us-ascii?Q?+XYsuvxSKJDFV+RpXyTt0CddcXMGsCQ+Lsah/ULuMoZ+XIt8tBhat7+pBgqA?= =?us-ascii?Q?cVeHoVxCp00XOjt9QIpu5sxV1F5wBTJrA4td37S0mlftPLg/dq/9Uq8j3Mts?= =?us-ascii?Q?96F8sxaHmfQxwXzj9lYo1+HI/oTQuHuMasKyQqN8aH3H2MSXonHTvA4A7Kv6?= =?us-ascii?Q?rFBEpqAbDi3OxndSIYYYh3g6NESW4SGLGQ9+Zqe1ML5qjAXKr1ZH/d918YoY?= =?us-ascii?Q?/7witwNdyeuyQx4Zj7MPTRPrqhusXmwtF1hia/4oFMZWh1eWh5XJzmx9FmQ3?= =?us-ascii?Q?/6ipmkT1kPj4hS/PA62+q5I/1qPNnPNgntu1Ikt5kr0GbxqL7eLy5DQf7LUX?= =?us-ascii?Q?vULn57kdAfao61ifGezmfM8=3D?= X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CS1PR8401MB1144.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: f628c246-6eee-4341-8bf0-08d99ab7a81c X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2021 08:39:43.7682 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rrNWISSVftVts0Uaa66MMaYoSiVdLES+50LONx83H8gXc0Sfz5hmh5967ESK38Uv6lPqRU3OcfqzRY6DD6zW4Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CS1PR8401MB0518 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: -EACswfDQ6rAk5Bc7vGmOgAfVRIetKuU X-Proofpoint-ORIG-GUID: -EACswfDQ6rAk5Bc7vGmOgAfVRIetKuU X-Proofpoint-UnRewURL: 2 URL's were un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-29_01,2021-10-26_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 adultscore=0 phishscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 priorityscore=1501 spamscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2110290048 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is sent in behalf of Nickle Wang who is the author of this chang= e. Reviewed-by: Abner Chang > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Abner Chang > Sent: Friday, October 29, 2021 9:45 AM > To: devel@edk2.groups.io > Cc: Wang, Nickle (HPS SW) ; Liming Gao > ; Andrew Fish ; Ray Ni > > Subject: [edk2-devel] [PATCH] edk2-staging/EmulatorPkg: Add a sample > memory configuration HII driver >=20 > 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. >=20 > The language ("x-uef-redfish-*") defined in the Redfish-specific uni file= is > the connection between HII configuration and the Redfish schema. >=20 > e.g. > #langdef x-uefi-redfish-Memory.v1_7_1 "Memory.v1_7_1" >=20 > The HII option strings those applied with "x-uef-redfish-* HII language > are connected to the corresponding Redfish properties. >=20 > e.g. > #string STR_MEMORY_1_BASE_MODULE_TYPE_PROMPT #language x-uefi- > redfish-Memory.v1_7_1 "/Memory/{1}/BaseModuleType" >=20 > 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 transpo= rt > (REST_EX) provided by RedfishPkg. >=20 > On EDK2, HTTP based REST EX protocol instance is used to consume and > update > the Redfish properties. >=20 > Check this for the RedfishClientPkg design architecture, > https://github.com/tianocore/edk2-staging/blob/edk2-redfish- > client/RedfishClientPkg/Readme.md >=20 > Below for RedfishPkg design architecture, > https://github.com/tianocore/edk2/blob/master/RedfishPkg/Readme.md >=20 > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Liming Gao > Cc: Andrew Fish > Cc: Ray Ni > --- > .../Hii2RedfishMemoryDxe.inf | 55 ++++ > .../Hii2RedfishMemoryData.h | 71 +++++ > .../Hii2RedfishMemoryDxe.h | 44 +++ > .../Hii2RedfishMemoryVfr.vfr | 219 +++++++++++++ > .../Hii2RedfishMemoryDxe.c | 294 ++++++++++++++++++ > .../Hii2RedfishMemoryDxeMap.uni | 38 +++ > .../Hii2RedfishMemoryDxeStrings.uni | 68 ++++ > 7 files changed, 789 insertions(+) > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > create mode 100644 > EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.uni >=20 > diff --git a/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > new file mode 100644 > index 00000000000..3376f7e7b49 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > @@ -0,0 +1,55 @@ > +## @file > +# HII-to-Redfish memory driver. > +# > +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP
> +# > +# 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 > + EmulatorPkg/EmulatorPkg.dec > + > +[LibraryClasses] > + UefiDriverEntryPoint > + BaseLib > + BaseMemoryLib > + DebugLib > + PcdLib > + MemoryAllocationLib > + UefiBootServicesTableLib > + UefiRuntimeServicesTableLib > + UefiLib > + PrintLib > + HiiLib > + > +[Protocols] > + gEfiDevicePathProtocolGuid > + gEfiHiiConfigAccessProtocolGuid > + > + > +[Guids] > + gHii2RedfishMemoryFormsetGuid > + > +[Depex] > + gEfiHiiDatabaseProtocolGuid > + > diff --git a/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryData.h > new file mode 100644 > index 00000000000..f5ffaaec631 > --- /dev/null > +++ b/EmulatorPkg/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, 0x= 64, > 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/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.h > new file mode 100644 > index 00000000000..98bfd7246a4 > --- /dev/null > +++ b/EmulatorPkg/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 > \ No newline at end of file > diff --git a/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryVfr.vfr > new file mode 100644 > index 00000000000..288686f8303 > --- /dev/null > +++ b/EmulatorPkg/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; > \ No newline at end of file > diff --git a/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > new file mode 100644 > index 00000000000..4c13a197fa4 > --- /dev/null > +++ b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.c > @@ -0,0 +1,294 @@ > +/** @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_PROTOCOL. > + @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_PROTOCOL. > + @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", __FUNCTION__)); > + > + return EFI_UNSUPPORTED; > +} > + > + > +/** > + This function processes the results of changes in configuration. > + > + @param[in] This Points to the > EFI_HII_CONFIG_ACCESS_PROTOCOL. > + @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", __FUNCTION__, > 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", > __FUNCTION__, 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/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeMap.uni > new file mode 100644 > index 00000000000..66e2ece21f5 > --- /dev/null > +++ > b/EmulatorPkg/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- > redfish-Memory.v1_7_1 "RDIMM" > +#string STR_MEMORY_UDIMM_PROMPT #language x-uefi- > redfish-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- > redfish-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" > \ No newline at end of file > diff --git > a/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.uni > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.uni > new file mode 100644 > index 00000000000..92e8b8b5f3d > --- /dev/null > +++ > b/EmulatorPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxeStrings.uni > @@ -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 be altered. False shall indicate that the configuration is not loc= ked and > may 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 be altered. False shall indicate that the configuration is not loc= ked and > may 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 be altered. False shall indicate that the configuration is not loc= ked and > may 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 be altered. False shall indicate that the configuration is not loc= ked and > may 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" > -- > 2.21.0.windows.1 >=20 >=20 >=20 >=20 >=20