From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (NAM10-BN7-obe.outbound.protection.outlook.com [40.107.92.55]) by mx.groups.io with SMTP id smtpd.web11.2727.1686121326870758795 for ; Wed, 07 Jun 2023 00:02:07 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=dug8RsZd; 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.92.55, mailfrom: abner.chang@amd.com) 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=YvzuNJ6bM7Jit6LhpKV89Hbeu8gjQMt7yLHfJ6Y768Q=; b=dug8RsZdejqL6OO5xUuQxK1k4JbwWrlBsteDi9AVyyK8/g7ygvGmBiMApWxzVKk1ngHbCE/cP0QQHecSLc9FKz/Do2S5dQefq7Yj765irAgv2UiQpfzijPi0hx2c11PdIjB6GWXYq+b1WiNOR+BldK7RnJ0eDA6zijOFz7LyyGA= Received: from MN2PR12MB3966.namprd12.prod.outlook.com (2603:10b6:208:165::18) by PH7PR12MB5829.namprd12.prod.outlook.com (2603:10b6:510:1d4::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.31; Wed, 7 Jun 2023 07:02:02 +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 07:02:02 +0000 From: "Chang, Abner" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-redfish-client][PATCH 2/3] RedfishClientPkg: Introduce Hii2RedfishBootDxe driver Thread-Topic: [edk2-redfish-client][PATCH 2/3] RedfishClientPkg: Introduce Hii2RedfishBootDxe driver Thread-Index: AQHZmHwyrkiqRz2D00OiI+3EBGYn+K9+6qlQ Date: Wed, 7 Jun 2023 07:02:01 +0000 Message-ID: References: <20230606133817.4631-1-nicklew@nvidia.com> In-Reply-To: <20230606133817.4631-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=83be74cc-d588-4afd-8eaf-8255c8d62fda;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-07T07:01:00Z;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_|PH7PR12MB5829:EE_ x-ms-office365-filtering-correlation-id: 7888fe9d-3d38-4fdc-6571-08db67251823 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rsK/tm8IRPhBgX6UTFlz+Y7oFRADtcObFCLInWuH5a25ydoWC6x/uNerwbt4mSInnjLYSGvKesDj4N9xWfO58WpebLrCfhtqfzLNSlgSmexqcK/U2MR5sAJqR+OsDANM2VoA/p6u4c5pmFagGd4PjFNJIfj7vCIx6lB67BUGW9+Z55k6VkOg2sRxiHdMQkDtzEIEEiFzQDqyrlBs9hStaZq/Y07Lu1xtXb8bxbtYwB90zxGrAi5O1J0G6b0X9r/vhuYMJWXmBi4zm1OR2qTm5jhYEszyiealu02JuAa/743W7Fatt4rPCX2WgQE/Ta8ZmfaPEJ+gj+YJyL0UEGqSjUFwQ3gg4Zg61XYS1rOoXW7vFrEreU9qDemKqD32GLW+bC93JDNmlhFklPqVEeaVtkDfVnr5E5xc4PVnE8pkMNeBZUHMRag9+rne1uQBj7PMm/mcSdGVY857fCiIZS1+jwD5dGraxBTznEe/Wwaz5ekbgJeqeKZTgromrT0kmZ8de4nopQ//FgNLW7iQVXZRn8Uy8D4qil36wH0A8knI7iFxf8MMpdLWgo1Ad7RlPqJqAGloSacfIQ9fJioIyxSNWu+XB0eTrRtUBWXR5cKSfts6CqCK2erNw8TSPRJq/VfBXrT1EpgdtvL+oy/e26L+Xw== 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)(346002)(396003)(366004)(39860400002)(136003)(376002)(451199021)(8936002)(8676002)(30864003)(186003)(41300700001)(2906002)(66574015)(5660300002)(26005)(6506007)(53546011)(9686003)(52536014)(83380400001)(7696005)(19627235002)(478600001)(110136005)(316002)(55016003)(71200400001)(122000001)(38100700002)(66556008)(33656002)(66446008)(66476007)(86362001)(76116006)(66946007)(38070700005)(4326008)(64756008)(579004)(559001)(44824005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?449Z2Gu+kGgf5ntuJD443PUtA7SDe8OPORhupGqmc2XK40fOnWaFMWAdyU+q?= =?us-ascii?Q?7VE7Pj4Fge7N+0BFsTBU/v//V/5D7Puf2kVslX1OMJrv9n/XifHk1GiT03sf?= =?us-ascii?Q?OFa3Pdw5q6lSOKA78UCoH+Bb+LnrbjOldeJnTHVEncmy6jErhvwSf0AU5S8e?= =?us-ascii?Q?RMaADvAzHGgur/4oLKo+//hf6FFpV+D1VeWzX6qFbhgMfpyWUxkcgwj4/2e7?= =?us-ascii?Q?lDmsSca7vEoJhwzD7dAeP5+HAHQ1piI3pZSIIY1KMZ1raz6mUzN5+xNwLULi?= =?us-ascii?Q?2agsk+EzvW2fYD8KPqkSfBfGySytRHxtJBhwYYnWmOqaZWkHHz0OkGXX86EF?= =?us-ascii?Q?h/TgiJrB4vkrWb3U9lUu9Gv9KGuPHAhtCqwMrHiPey65Y01hH+AHQ3bwK+Po?= =?us-ascii?Q?EYcyTTanVTfrxYoUuoEqJH7jWEu4HlMpHRsXnzAM6o67ig2nw61o3dq3uCA3?= =?us-ascii?Q?GijlNTjZXigJtjkWabLV1JOQ3gy2OLdtl06I6v4y8lPAM4zbhwlkL1ZRS4dE?= =?us-ascii?Q?jcTkGXkawnqA05wMHPwlSlH7J6wm87WvRpZVimGSqeFXW0w+qDMNHOy4zX8b?= =?us-ascii?Q?XXW1irdiIOWSeXgB2JN0HLN5qoZkEkvvcfU5QlPXC78UM+RPRkIN1Y8vryA9?= =?us-ascii?Q?z4bpWVSUPiBiOO3UphnlsWzlPxcmpKGHfBLpB8j8IXRHmi7A8Di0gOe28qcY?= =?us-ascii?Q?VRGh6heKV+Xfz5b/e0KkN2hjxz3dSKMAnaA/8b4FBQanES390t7m1fOWL24p?= =?us-ascii?Q?K5sITM0YKtud268fCq19MSBRHhK/jfompGAHmWPDHxbG6tACV/a/WocN1cAk?= =?us-ascii?Q?p7snW2+REdBEv7b57nxwFiNk3v7uj7bqVQsr/oKXUgrZZauqTLPX597Rqgpz?= =?us-ascii?Q?l+0PURlZRvAGh+zGB2xNaj4FrFufWfe9KB+sPEpB6DA+kV54iJVotBcts4VF?= =?us-ascii?Q?rXsqAxcX4fGHWAkowIyvTZRkcKjIBxan7ehZ5Lc4pIsUSpwSM5sR+CDdRnkk?= =?us-ascii?Q?Q67PQCKvSr+8PQcl1Y6qq/3Ni4qXA3/MhSBrimqe1V5bwYo9rSgFxtj7Fspy?= =?us-ascii?Q?Ka542Z5V5HPxxh6mPlzI20J/5KbnrZA2Wc7KMA8UsxogjCFk8u4XOCdm2iYF?= =?us-ascii?Q?vavhg6/SZGeRsaI9mWXvAeNwn+WnTDR6l9JGRwehYVSH81wPpfi0W73v8iiD?= =?us-ascii?Q?0AxUuITI5jyKqeuzn1WGWYefjdWSuvDjRFRoEKyK0YS51X4QgnTEdMbEFt2O?= =?us-ascii?Q?7/khMQwxfQ5z5VibsZj2lU22BjiJ1ZfZawBNk8O0UG5LRBVXFBxqPWXlMntx?= =?us-ascii?Q?q/v8qhQHoTkHBOodrVoja2Kx5YHXrCS1s8gLHxZGtq+5KA4tanMfl+yOGAJw?= =?us-ascii?Q?CpTZFVWivCL5LwPJ0Xr9hANs57rUHVAu/kUMmkxss2eEn52bi+4woiOZbG1M?= =?us-ascii?Q?uXvP0Dd1J6iJz/UJNsFfjCl2sglC1arzttxTKvTWNj59MuGXiJIPDPltuFpu?= =?us-ascii?Q?kZiCF1cWScKnkVg9mHKZhLQjg9E5yZqVPoULs8rIJcTJIZbPyq0OOUC5HtqY?= =?us-ascii?Q?xyqRMl8WPg6ElCb7REyjQCgal+DIaAgraCo/Uep6?= 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: 7888fe9d-3d38-4fdc-6571-08db67251823 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jun 2023 07:02:01.9033 (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: gAoJcN0ycl1a+G5USRoBxcg8jM0J6qYDPf2yI8ZaNhFY26V5kmOswLLGTO9PQekn8cUu8C96nYVYKlLhx4xu8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5829 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [AMD Official Use Only - General] Same as the comment given to 1/3, let's rename Hii2 to HiiTo. The same comm= ent applied to 3/3. 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 2/3] RedfishClientPkg: Introduce > Hii2RedfishBootDxe driver > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Add Hii2RedfishBootDxe driver with configure language defined in UNI > file in order to demonstrate the use of Redfish Platform Config > Protocol. Feature drivers under RedfishClientPkg will work with this > driver and provide the REST data to Redfish service. > > Signed-off-by: Nickle Wang > Cc: Abner Chang > Cc: Igor Kulchytskyy > --- > RedfishClientPkg/RedfishClientPkg.dec | 1 + > .../RedfishClientComponents.dsc.inc | 1 + > RedfishClientPkg/RedfishClientPkg.dsc | 9 + > .../Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf | 59 ++ > .../Hii2RedfishBootDxe/Hii2RedfishBootData.h | 60 ++ > .../Hii2RedfishBootDxe/Hii2RedfishBootDxe.h | 53 ++ > .../Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr | 83 +++ > .../Hii2RedfishBootDxe/Hii2RedfishBootDxe.c | 698 ++++++++++++++++++ > .../Hii2RedfishBootDxeMap.uni | 28 + > .../Hii2RedfishBootDxeStrings.uni | 41 + > RedfishClientPkg/RedfishClient.fdf.inc | 1 + > 11 files changed, 1034 insertions(+) > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootData.h > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.h > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.c > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeMap.uni > create mode 100644 > RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeStrings.uni > > diff --git a/RedfishClientPkg/RedfishClientPkg.dec > b/RedfishClientPkg/RedfishClientPkg.dec > index af241cf6..055c1924 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dec > +++ b/RedfishClientPkg/RedfishClientPkg.dec > @@ -58,6 +58,7 @@ > 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 }} > + gHii2RedfishBootFormsetGuid =3D { 0x8399a787, 0x10= 8e, 0x4e53, > { 0x9e, 0xde, 0x4b, 0x18, 0xcc, 0x9e, 0xab, 0x3b }} > > [PcdsFixedAtBuild] > > gEfiRedfishClientPkgTokenSpaceGuid.PcdMaxRedfishSchemaStringSize|32|UI > NT32|0x10000001 > diff --git a/RedfishClientPkg/RedfishClientComponents.dsc.inc > b/RedfishClientPkg/RedfishClientComponents.dsc.inc > index 3451c185..4633e962 100644 > --- a/RedfishClientPkg/RedfishClientComponents.dsc.inc > +++ b/RedfishClientPkg/RedfishClientComponents.dsc.inc > @@ -18,6 +18,7 @@ > RedfishClientPkg/RedfishETagDxe/RedfishETagDxe.inf > RedfishClientPkg/RedfishConfigLangMapDxe/RedfishConfigLangMapDxe.inf > RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > + RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > !endif > # > # Below two modules should be pulled in by build tool. > diff --git a/RedfishClientPkg/RedfishClientPkg.dsc > b/RedfishClientPkg/RedfishClientPkg.dsc > index ac9f8e9d..edc387ac 100644 > --- a/RedfishClientPkg/RedfishClientPkg.dsc > +++ b/RedfishClientPkg/RedfishClientPkg.dsc > @@ -39,6 +39,15 @@ > BaseSortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf > HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf > > UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiService= sL > ib.inf > + > UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBoot > ManagerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + > PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLi > bNull.inf > + > PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePe > CoffGetEntryPointLib.inf > + > DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLi > b.inf > + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf > + > ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeR > eportStatusCodeLib.inf > + SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf > + > VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Vari= a > blePolicyHelperLib.inf > > [LibraryClasses.ARM, LibraryClasses.AARCH64] > # > diff --git a/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > new file mode 100644 > index 00000000..da80b79b > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > @@ -0,0 +1,59 @@ > +## @file > +# HII-to-Redfish boot driver. > +# > +# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION =3D 0x00010005 > + BASE_NAME =3D Hii2RedfishBootDxe > + FILE_GUID =3D F9BA69BD-1EDB-4334-9D57-7E974ADF136= 1 > + MODULE_TYPE =3D UEFI_DRIVER > + VERSION_STRING =3D 1.0 > + ENTRY_POINT =3D Hii2RedfishBootDxeDriverEntryPoint > + UNLOAD_IMAGE =3D Hii2RedfishBootDxeDriverUnload > + > +[Sources] > + Hii2RedfishBootDxe.c > + Hii2RedfishBootDxe.h > + Hii2RedfishBootData.h > + Hii2RedfishBootVfr.vfr > + Hii2RedfishBootDxeStrings.uni > + Hii2RedfishBootDxeMap.uni > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + RedfishClientPkg/RedfishClientPkg.dec > + > +[LibraryClasses] > + UefiDriverEntryPoint > + BaseLib > + BaseMemoryLib > + DebugLib > + PcdLib > + MemoryAllocationLib > + UefiBootServicesTableLib > + UefiRuntimeServicesTableLib > + UefiLib > + PrintLib > + HiiLib > + UefiBootManagerLib > + UefiHiiServicesLib > + RedfishEventLib > + > +[Protocols] > + gEfiDevicePathProtocolGuid > + gEfiHiiConfigAccessProtocolGuid > + > + > +[Guids] > + gHii2RedfishBootFormsetGuid > + gEfiIfrTianoGuid > + > +[Depex] > + gEfiHiiDatabaseProtocolGuid > + > diff --git a/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootData.h > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootData.h > new file mode 100644 > index 00000000..896327bc > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootData.h > @@ -0,0 +1,60 @@ > +/** @file > + The header file of HII-to-Redfish boot driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef HII_2_REDFISH_BOOT_DATA_H_ > +#define HII_2_REDFISH_BOOT_DATA_H_ > + > +#include > +#include > + > +#define HII_2_REDFISH_BOOT_FORMSET_GUID \ > + { \ > + 0x8399a787, 0x108e, 0x4e53, { 0x9e, 0xde, 0x4b, 0x18, 0xcc, 0x9e, 0x= ab, > 0x3b } \ > + } > + > +extern EFI_GUID gHii2RedfishBootFormsetGuid; > + > +#define FORM_ID 0x001 > +#define QUESTION_ID_BOOT_SOURCE_OVERRIDE_ENABLED 0x100 > +#define QUESTION_ID_BOOT_SOURCE_OVERRIDE_MODE 0x101 > +#define QUESTION_ID_BOOT_SOURCE_OVERRIDE_TARGET 0x102 > +#define LABEL_BOOT_OPTION 0x200 > +#define LABEL_BOOT_OPTION_END 0x201 > +#define BOOT_ORDER_LIST 0x300 > +#define MAX_BOOT_OPTIONS 100 > +#define BOOT_OPTION_VAR_STORE_ID 0x800 > +// > +// VarOffset that will be used to create question > +// all these values are computed from the structure > +// defined below > +// > +#define VAR_OFFSET(Field) ((UINT16) ((UINTN) > &(((HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA *) 0)->Field))) > + > +#pragma pack(1) > + > +// > +// Definiton of HII_2_REDFISH_BOOT_EFI_VARSTORE_DATA > +// > +typedef struct { > + UINT8 BootSourceOverrideEnabled; > + UINT8 BootSourceOverrideMode; > + UINT8 BootSourceOverrideTarget; > + UINT8 Reversed; > +} HII_2_REDFISH_BOOT_EFI_VARSTORE_DATA; > + > +// > +// Definiton of HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA > +// > +typedef struct { > + UINT32 BootOptionOrder[MAX_BOOT_OPTIONS]; > +} HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA; > + > +#pragma pack() > + > +#endif > diff --git a/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.h > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.h > new file mode 100644 > index 00000000..1635c70b > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.h > @@ -0,0 +1,53 @@ > +/** @file > + HII-to-Redfish memory driver header file. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#ifndef HII_2_REDFISH_BOOT_DXE_H_ > +#define HII_2_REDFISH_BOOT_DXE_H_ > + > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > +#include > + > +#include "Hii2RedfishBootData.h" > + > +extern UINT8 Hii2RedfishBootVfrBin[]; > + > +#define COMPUTER_SYSTEM_SECHEMA_VERSION "x-uefi-redfish- > ComputerSystem.v1_5_0" > +#define COMPUTER_SYSTEM_BOOT_BOOTORDER > L"/Systems/{1}/Boot/BootOrder" > + > +#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/Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr > new file mode 100644 > index 00000000..3758de6b > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootVfr.vfr > @@ -0,0 +1,83 @@ > +/** @file > + HII-to-Redfish boot driver VFR file. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > + > +#include "Hii2RedfishBootData.h" > + > +formset > + guid =3D HII_2_REDFISH_BOOT_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_BOOT_EFI_VARSTORE_DATA, > + attribute =3D EFI_VARIABLE_BOOTSERVICE_ACCESS | > EFI_VARIABLE_NON_VOLATILE, // EFI variable attribures > + name =3D Hii2RedfishBootEfiVar, > + guid =3D HII_2_REDFISH_BOOT_FORMSET_GUID; > + > + // > + // Define a variable Storage for boot order > + // > + varstore HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA, > + varid =3D BOOT_OPTION_VAR_STORE_ID, > + name =3D Hii2RedfishBootOptionVar, > + guid =3D HII_2_REDFISH_BOOT_FORMSET_GUID; > + > + // > + // Define a Form (EFI_IFR_FORM) > + // > + form formid =3D FORM_ID, // Form ID > + title =3D STRING_TOKEN(STR_FORM_TITLE); // Form title > + > + oneof varid =3D Hii2RedfishBootEfiVar.BootSourceOverrideEnabled, > + questionid =3D QUESTION_ID_BOOT_SOURCE_OVERRIDE_ENABLED, > + prompt =3D STRING_TOKEN(STR_BOOT_SOURCE_OVERRIDE_ENABLED), > + help =3D > STRING_TOKEN(STR_BOOT_SOURCE_OVERRIDE_ENABLED_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_DISABLED), value =3D > STR_DISABLED, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_ONCE), value =3D = STR_ONCE, > flags =3D 0; > + option text =3D STRING_TOKEN(STR_CONTINUOUS), value =3D > STR_CONTINUOUS, flags =3D 0; > + endoneof; > + > + oneof varid =3D Hii2RedfishBootEfiVar.BootSourceOverrideMode, > + questionid =3D QUESTION_ID_BOOT_SOURCE_OVERRIDE_MODE, > + prompt =3D STRING_TOKEN(STR_BOOT_SOURCE_OVERRIDE_MODE), > + help =3D STRING_TOKEN(STR_BOOT_SOURCE_OVERRIDE_MODE_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_UEFI), value =3D = STR_UEFI, flags > =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_LEGACY), value =3D = STR_LEGACY, > flags =3D 0; > + endoneof; > + > + oneof varid =3D Hii2RedfishBootEfiVar.BootSourceOverrideTarget, > + questionid =3D QUESTION_ID_BOOT_SOURCE_OVERRIDE_TARGET, > + prompt =3D STRING_TOKEN(STR_BOOT_SOURCE_OVERRIDE_TARGET), > + help =3D STRING_TOKEN(STR_BOOT_SOURCE_OVERRIDE_TARGET_HELP), > + flags =3D INTERACTIVE | NUMERIC_SIZE_1, > + option text =3D STRING_TOKEN(STR_TARGET_NONE), value = =3D > STR_TARGET_NONE, flags =3D DEFAULT; > + option text =3D STRING_TOKEN(STR_TARGET_PXE), value = =3D > STR_TARGET_PXE, flags =3D 0; > + option text =3D STRING_TOKEN(STR_TARGET_USB), value = =3D > STR_TARGET_USB, flags =3D 0; > + option text =3D STRING_TOKEN(STR_TARGET_HDD), value = =3D > STR_TARGET_HDD, flags =3D 0; > + option text =3D STRING_TOKEN(STR_TARGET_BIOS_SETUP), value = =3D > STR_TARGET_BIOS_SETUP, flags =3D 0; > + option text =3D STRING_TOKEN(STR_TARGET_UEFI), value = =3D > STR_TARGET_UEFI, flags =3D 0; > + option text =3D STRING_TOKEN(STR_TARGET_UEFI_HTTP), value = =3D > STR_TARGET_UEFI_HTTP, flags =3D 0; > + endoneof; > + > + subtitle text =3D STRING_TOKEN(STR_BOOT_ORDER); > + > + // > + // This is where we will dynamically add choices for the Boot Manage= r > + // > + label LABEL_BOOT_OPTION; > + label LABEL_BOOT_OPTION_END; > + > + endform; > +endformset; > diff --git a/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.c > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.c > new file mode 100644 > index 00000000..51a2bed0 > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.c > @@ -0,0 +1,698 @@ > +/** @file > + HII-to-Redfish boot driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights > reserved. > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "Hii2RedfishBootDxe.h" > + > +EFI_GUID mHii2RedfishBootGuid =3D > HII_2_REDFISH_BOOT_FORMSET_GUID; > +EFI_HII_HANDLE mHiiHandle; > +EFI_HANDLE mDriverHandle; > +EFI_EVENT mEvent =3D NULL; > +CHAR16 mHii2RedfishEfiVar[] =3D L"Hii2= RedfishBootEfiVar"; > +HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA mBootOptionsVarData; > + > +/// > +/// 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_BOOT_FORMSET_GUID > + }, > + { > + END_DEVICE_PATH_TYPE, > + END_ENTIRE_DEVICE_PATH_SUBTYPE, > + { > + (UINT8)(END_DEVICE_PATH_LENGTH), > + (UINT8)((END_DEVICE_PATH_LENGTH) >> 8) > + } > + } > +}; > + > +/** > + This function add 'x-uefi-' configuration language to given string ID. > + > + @param[in] HiiHandle HII handle > + @param[in] StringId String token ID > + @param[in] ConfigLang Configure language of question > + > + @retval EFI_STATUS > + > +**/ > +EFI_STATUS > +UpdateConfigLanguageToQuestion ( > + IN EFI_HII_HANDLE HiiHandle, > + IN EFI_STRING_ID StringId, > + IN EFI_STRING ConfigLang > + ) > +{ > + CHAR16 ConfigLanguage[32]; > + > + if ((HiiHandle =3D=3D NULL) || (StringId =3D=3D 0) || (ConfigLang =3D= =3D NULL)) { > + return EFI_INVALID_LANGUAGE; > + } > + > + UnicodeSPrint (ConfigLanguage, sizeof (ConfigLanguage), ConfigLang); > + > + DEBUG ((DEBUG_INFO, "%a, add config-language for string(%d): %s\n", > __func__, StringId, ConfigLanguage)); > + > + HiiSetString ( > + HiiHandle, > + StringId, > + ConfigLanguage, > + COMPUTER_SYSTEM_SECHEMA_VERSION > + ); > + > + return EFI_SUCCESS; > +} > + > +/** > + This function add 'x-uefi-' configuration language to given string ID. > + > + @param[in] HiiHandle HII handle > + @param[in] StringId String token ID > + @param[in] Index The index of boot option > + @param[in] BootOption Boot option context > + > + @retval EFI_STATUS > + > +**/ > +EFI_STATUS > +UpdateConfigLanguageToValues ( > + IN EFI_HII_HANDLE HiiHandle, > + IN EFI_STRING_ID StringId, > + IN UINTN Index, > + IN EFI_BOOT_MANAGER_LOAD_OPTION *BootOption > + ) > +{ > + CHAR16 ConfigLanguage[10]; > + > + if ((HiiHandle =3D=3D NULL) || (StringId =3D=3D 0) || (BootOption =3D= =3D NULL)) { > + return EFI_INVALID_LANGUAGE; > + } > + > + UnicodeSPrint (ConfigLanguage, sizeof (ConfigLanguage), L"Boot%04x", > BootOption->OptionNumber); > + > + DEBUG ((DEBUG_INFO, "%a, add config-language for string(%d): %s\n", > __func__, StringId, ConfigLanguage)); > + > + HiiSetString ( > + HiiHandle, > + StringId, > + ConfigLanguage, > + COMPUTER_SYSTEM_SECHEMA_VERSION > + ); > + > + return EFI_SUCCESS; > +} > + > +/** > + This function creates boot order with ordered-list op-codes in runtime= . > + > + @retval EFI_STATUS > + > +**/ > +EFI_STATUS > +RefreshBootOrderList ( > + VOID > + ) > +{ > + UINTN Index; > + EFI_BOOT_MANAGER_LOAD_OPTION *BootOption; > + UINTN BootOptionCount; > + EFI_STRING_ID Token; > + VOID *StartOpCodeHandle; > + VOID *EndOpCodeHandle; > + EFI_IFR_GUID_LABEL *StartLabel; > + EFI_IFR_GUID_LABEL *EndLabel; > + BOOLEAN IsLegacyOption; > + VOID *OptionsOpCodeHandle; > + UINTN OptionIndex; > + > + // > + // for better user experience > + // 1. User changes HD configuration (e.g.: unplug HDD), here we have a > chance to remove the HDD boot option > + // 2. User enables/disables UEFI PXE, here we have a chance to add/rem= ove > EFI Network boot option > + // > + EfiBootManagerRefreshAllBootOption (); > + > + BootOption =3D EfiBootManagerGetLoadOptions (&BootOptionCount, > LoadOptionTypeBoot); > + > + if (BootOptionCount =3D=3D 0) { > + return EFI_NOT_FOUND; > + } > + > + // > + // Initial var store > + // > + ZeroMem (&mBootOptionsVarData, sizeof > (HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA)); > + > + // > + // Allocate space for creation of UpdateData Buffer > + // > + StartOpCodeHandle =3D HiiAllocateOpCodeHandle (); > + ASSERT (StartOpCodeHandle !=3D NULL); > + > + EndOpCodeHandle =3D HiiAllocateOpCodeHandle (); > + ASSERT (EndOpCodeHandle !=3D NULL); > + > + // > + // Create Hii Extend Label OpCode as the start opcode > + // > + StartLabel =3D (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode > (StartOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL))= ; > + StartLabel->ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL; > + StartLabel->Number =3D LABEL_BOOT_OPTION; > + > + // > + // Create Hii Extend Label OpCode as the end opcode > + // > + EndLabel =3D (EFI_IFR_GUID_LABEL *)HiiCreateGuidOpCode > (EndOpCodeHandle, &gEfiIfrTianoGuid, NULL, sizeof (EFI_IFR_GUID_LABEL)); > + EndLabel->ExtendOpCode =3D EFI_IFR_EXTEND_OP_LABEL; > + EndLabel->Number =3D LABEL_BOOT_OPTION_END; > + > + OptionsOpCodeHandle =3D HiiAllocateOpCodeHandle (); > + ASSERT (OptionsOpCodeHandle !=3D NULL); > + > + for (Index =3D 0, OptionIndex =3D 0; Index < BootOptionCount; Index++)= { > + // > + // Don't display hidden boot options, but retain inactive ones. > + // > + if ((BootOption[Index].Attributes & LOAD_OPTION_HIDDEN) !=3D 0) { > + continue; > + } > + > + // > + // Group the legacy boot option in the sub title created dynamically > + // > + IsLegacyOption =3D (BOOLEAN)( > + (DevicePathType (BootOption[Index].FilePa= th) =3D=3D > BBS_DEVICE_PATH) && > + (DevicePathSubType (BootOption[Index].Fil= ePath) =3D=3D > BBS_BBS_DP) > + ); > + > + // > + // Don't display legacy boot options > + // > + if (IsLegacyOption) { > + continue; > + } > + > + mBootOptionsVarData.BootOptionOrder[OptionIndex++] =3D > (UINT32)BootOption[Index].OptionNumber; > + > + ASSERT (BootOption[Index].Description !=3D NULL); > + > + Token =3D HiiSetString (mHiiHandle, 0, BootOption[Index].Description= , NULL); > + > + // > + // Add boot option > + // > + HiiCreateOneOfOptionOpCode ( > + OptionsOpCodeHandle, > + Token, > + 0, > + EFI_IFR_TYPE_NUM_SIZE_32, > + BootOption[Index].OptionNumber > + ); > + > + // > + // Add x-uefi configure language for boot options. > + // > + UpdateConfigLanguageToValues (mHiiHandle, Token, OptionIndex, > &BootOption[Index]); > + } > + > + // > + // Create ordered list op-code > + // > + HiiCreateOrderedListOpCode ( > + StartOpCodeHandle, // Container for dynamic c= reated opcodes > + BOOT_ORDER_LIST, // Question ID > + BOOT_OPTION_VAR_STORE_ID, // VarStore ID > + (UINT16)VAR_OFFSET (BootOptionOrder), // Offset in Buffer Storag= e > + STRING_TOKEN (STR_BOOT_ORDER_LIST), // Question prompt text > + STRING_TOKEN (STR_BOOT_ORDER_LIST_HELP), // Question help text > + 0, // Question flag > + EFI_IFR_UNIQUE_SET, // Ordered list flag, e.g. > EFI_IFR_UNIQUE_SET > + EFI_IFR_TYPE_NUM_SIZE_32, // Data type of Question v= alue > + MAX_BOOT_OPTIONS, // Maximum container > + OptionsOpCodeHandle, // Option Opcode list > + NULL // Default Opcode is NULL > + ); > + > + // > + // Add x-uefi configure language for boot order. > + // > + UpdateConfigLanguageToQuestion (mHiiHandle, STRING_TOKEN > (STR_BOOT_ORDER_LIST), COMPUTER_SYSTEM_BOOT_BOOTORDER); > + > + // > + // Update HII form > + // > + HiiUpdateForm ( > + mHiiHandle, > + &mHii2RedfishBootGuid, > + FORM_ID, > + StartOpCodeHandle, > + EndOpCodeHandle > + ); > + > + HiiFreeOpCodeHandle (StartOpCodeHandle); > + HiiFreeOpCodeHandle (EndOpCodeHandle); > + HiiFreeOpCodeHandle (OptionsOpCodeHandle); > + > + EfiBootManagerFreeLoadOptions (BootOption, BootOptionCount); > + > + return EFI_SUCCESS; > +} > + > +/** > + This function update the "BootOrder" EFI Variable based on > + BMM Formset's NV map. It then refresh BootOptionMenu > + with the new "BootOrder" list. > + > + @param[in] BootOptionVar Boot option NV data > + > + @retval EFI_SUCCESS The function complete successfully. > + @retval EFI_OUT_OF_RESOURCES Not enough memory to complete the > function. > + @return The EFI variable can not be saved. See gRT->SetVariable for de= tail > return information. > + > +**/ > +EFI_STATUS > +UpdateBootorderList ( > + IN HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA *BootOptionVar > + ) > +{ > + EFI_STATUS Status; > + UINT16 Index; > + UINT16 OrderIndex; > + UINT16 *BootOrder; > + UINTN BootOrderSize; > + UINT16 OptionNumber; > + > + if (BootOptionVar =3D=3D NULL) { > + return EFI_INVALID_PARAMETER; > + } > + > + // > + // First check whether BootOrder is present in current configuration > + // > + GetEfiGlobalVariable2 (L"BootOrder", (VOID **)&BootOrder, > &BootOrderSize); > + if (BootOrder =3D=3D NULL) { > + return EFI_OUT_OF_RESOURCES; > + } > + > + // > + // OptionOrder is subset of BootOrder > + // > + for (OrderIndex =3D 0; (OrderIndex < MAX_BOOT_OPTIONS) && > (BootOptionVar->BootOptionOrder[OrderIndex] !=3D 0); OrderIndex++) { > + for (Index =3D OrderIndex; Index < BootOrderSize / sizeof (UINT16); = Index++) > { > + if ((BootOrder[Index] =3D=3D (UINT16)BootOptionVar- > >BootOptionOrder[OrderIndex]) && (OrderIndex !=3D Index)) { > + OptionNumber =3D BootOrder[Index]; > + CopyMem (&BootOrder[OrderIndex + 1], &BootOrder[OrderIndex], > (Index - OrderIndex) * sizeof (UINT16)); > + BootOrder[OrderIndex] =3D OptionNumber; > + } > + } > + } > + > + Status =3D gRT->SetVariable ( > + L"BootOrder", > + &gEfiGlobalVariableGuid, > + EFI_VARIABLE_BOOTSERVICE_ACCESS | > EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE, > + BootOrderSize, > + BootOrder > + ); > + FreePool (BootOrder); > + > + return Status; > +} > + > +/** > + 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_BOOT_EFI_VARSTORE_DATA Hii2RedfishBootVar; > + > + // > + // Get Buffer Storage data from EFI variable. > + // Try to get the current setting from variable. > + // > + BufferSize =3D sizeof (HII_2_REDFISH_BOOT_EFI_VARSTORE_DATA); > + Status =3D gRT->GetVariable ( > + mHii2RedfishEfiVar, > + &gHii2RedfishBootFormsetGuid, > + NULL, > + &BufferSize, > + &Hii2RedfishBootVar > + ); > + if (!EFI_ERROR (Status)) { > + return EFI_SUCCESS; > + } > + > + // > + // Initialization > + // > + Hii2RedfishBootVar.BootSourceOverrideEnabled =3D STR_DISABLED; > + Hii2RedfishBootVar.BootSourceOverrideMode =3D STR_UEFI; > + Hii2RedfishBootVar.BootSourceOverrideTarget =3D STR_TARGET_NONE; > + Hii2RedfishBootVar.Reversed =3D 0x00; > + > + Status =3D gRT->SetVariable ( > + mHii2RedfishEfiVar, > + &gHii2RedfishBootFormsetGuid, > + VARIABLE_ATTRIBUTE_NV_BS, > + BufferSize, > + &Hii2RedfishBootVar > + ); > + > + // > + // Initial var store > + // > + ZeroMem (&mBootOptionsVarData, sizeof > (HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA)); > + > + 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 > +Hii2RedfishBootExtractConfig ( > + 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; > + } > + > + *Progress =3D Request; > + > + 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, &gHii2RedfishBootFormsetGuid, > L"Hii2RedfishBootEfiVar")) { > + return EFI_UNSUPPORTED; > + } > + > + // > + // Handle boot order list > + // > + if (HiiIsConfigHdrMatch (Request, &gHii2RedfishBootFormsetGuid, > L"Hii2RedfishBootOptionVar")) { > + gHiiConfigRouting->BlockToConfig ( > + gHiiConfigRouting, > + Request, > + (UINT8 *)&mBootOptionsVarData, > + sizeof (HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA= ), > + Results, > + Progress > + ); > + > + // > + // Set Progress string to the original request string. > + // > + if (Request =3D=3D NULL) { > + *Progress =3D NULL; > + } else if (StrStr (Request, L"OFFSET") =3D=3D NULL) { > + *Progress =3D Request + StrLen (Request); > + } > + > + return EFI_SUCCESS; > + } > + > + 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 > +Hii2RedfishBootRouteConfig ( > + IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This, > + IN CONST EFI_STRING Configuration, > + OUT EFI_STRING *Progress > + ) > +{ > + EFI_STATUS Status; > + UINTN BufferSize; > + HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA BootOptionsVar; > + > + *Progress =3D Configuration; > + > + // > + // Check whether request for EFI Varstore. EFI varstore get data > + // through hii database, not support in this path. > + // > + if (HiiIsConfigHdrMatch (Configuration, &gHii2RedfishBootFormsetGuid, > L"Hii2RedfishBootEfiVar")) { > + return EFI_UNSUPPORTED; > + } > + > + // > + // Handle boot order list > + // > + if (HiiIsConfigHdrMatch (Configuration, &gHii2RedfishBootFormsetGuid, > L"Hii2RedfishBootOptionVar")) { > + BufferSize =3D sizeof (HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA); > + ZeroMem (&BootOptionsVar, sizeof > (HII_2_REDFISH_BOOT_OPTION_VARSTORE_DATA)); > + Status =3D gHiiConfigRouting->ConfigToBlock ( > + gHiiConfigRouting, > + Configuration, > + (UINT8 *)&BootOptionsVar, > + &BufferSize, > + Progress > + ); > + > + if (CompareMem (BootOptionsVar.BootOptionOrder, > mBootOptionsVarData.BootOptionOrder, (sizeof (UINT32) * > MAX_BOOT_OPTIONS))) { > + Status =3D UpdateBootorderList (&BootOptionsVar); > + if (!EFI_ERROR (Status)) { > + // > + // Boot order update successed. Copy it to local copy. > + // > + CopyMem (mBootOptionsVarData.BootOptionOrder, > BootOptionsVar.BootOptionOrder, (sizeof (UINT32) * > MAX_BOOT_OPTIONS)); > + } > + } > + > + return EFI_SUCCESS; > + } > + > + 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] 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 > +Hii2RedfishBootDriverCallback ( > + 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)); > + > + if ((QuestionId =3D=3D QUESTION_ID_BOOT_SOURCE_OVERRIDE_ENABLED) && > (Action =3D=3D EFI_BROWSER_ACTION_FORM_OPEN)) { > + RefreshBootOrderList (); > + > + return EFI_SUCCESS; > + } > + > + return EFI_UNSUPPORTED; > +} > + > +EFI_HII_CONFIG_ACCESS_PROTOCOL mHii2RedfishConfigAccess =3D { > + Hii2RedfishBootExtractConfig, > + Hii2RedfishBootRouteConfig, > + Hii2RedfishBootDriverCallback > +}; > + > +/** > + Callback function executed when the ready-to-provisioning event group = is > signaled. > + > + @param[in] Event Event whose notification function is being invok= ed. > + @param[out] Context Pointer to the Context buffer > + > +**/ > +VOID > +EFIAPI > +Hii2RedfishBootReadyToProvisioning ( > + IN EFI_EVENT Event, > + OUT VOID *Context > + ) > +{ > + // > + // Refresh boot order and create configure language > + // > + RefreshBootOrderList (); > +} > + > +/** > + 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 > +Hii2RedfishBootDxeDriverEntryPoint ( > + IN EFI_HANDLE ImageHandle, > + IN EFI_SYSTEM_TABLE *SystemTable > + ) > +{ > + EFI_STATUS Status; > + > + mDriverHandle =3D NULL; > + Status =3D gBS->InstallMultipleProtocolInterfaces ( > + &mDriverHandle, > + &gEfiDevicePathProtocolGuid, > + &mHiiVendorDevicePath, > + &gEfiHiiConfigAccessProtocolGuid, > + &mHii2RedfishConfigAccess, > + NULL > + ); > + > + // > + // Publish our HII data > + // > + mHiiHandle =3D HiiAddPackages ( > + &mHii2RedfishBootGuid, > + mDriverHandle, > + Hii2RedfishBootDxeStrings, > + Hii2RedfishBootVfrBin, > + 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)); > + } > + > + // > + // Register read-to-provisioning event > + // > + Status =3D CreateReadyToProvisioningEvent ( > + Hii2RedfishBootReadyToProvisioning, > + NULL, > + &mEvent > + ); > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "%a, failed to register ready-to-provisioning > event: %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 > +Hii2RedfishBootDxeDriverUnload ( > + IN EFI_HANDLE ImageHandle > + ) > +{ > + if (mHiiHandle !=3D NULL) { > + HiiRemovePackages (mHiiHandle); > + } > + > + if (mEvent !=3D NULL) { > + gBS->CloseEvent (mEvent); > + } > + > + return EFI_SUCCESS; > +} > diff --git a/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeMap.un= i > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeMap.uni > new file mode 100644 > index 00000000..0589c90d > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeMap.uni > @@ -0,0 +1,28 @@ > +/** @file > + HII-to-Redfish memory driver. > + > + (C) Copyright 2022 Hewlett Packard Enterprise Development LP
> + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +/=3D# > +#langdef x-uefi-redfish-ComputerSystem.v1_5_0 > "ComputerSystem.v1_5_0" > + > +#string STR_BOOT_SOURCE_OVERRIDE_ENABLED #language x-uefi- > redfish-ComputerSystem.v1_5_0 > "/Systems/{1}/Boot/BootSourceOverrideEnabled" > +#string STR_BOOT_SOURCE_OVERRIDE_MODE #language x-uefi-redfish- > ComputerSystem.v1_5_0 "/Systems/{1}/Boot/BootSourceOverrideMode" > +#string STR_BOOT_SOURCE_OVERRIDE_TARGET #language x-uefi-redfish- > ComputerSystem.v1_5_0 "/Systems/{1}/Boot/BootSourceOverrideTarget" > + > +#string STR_DISABLED #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Disabled" > +#string STR_ONCE #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Once" > +#string STR_CONTINUOUS #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Continuous" > +#string STR_UEFI #language x-uefi-redfish- > ComputerSystem.v1_5_0 "UEFI" > +#string STR_LEGACY #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Legacy" > +#string STR_TARGET_NONE #language x-uefi-redfish- > ComputerSystem.v1_5_0 "None" > +#string STR_TARGET_PXE #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Pxe" > +#string STR_TARGET_USB #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Usb" > +#string STR_TARGET_HDD #language x-uefi-redfish- > ComputerSystem.v1_5_0 "Hdd" > +#string STR_TARGET_BIOS_SETUP #language x-uefi-redfish- > ComputerSystem.v1_5_0 "BiosSetup" > +#string STR_TARGET_UEFI #language x-uefi-redfish- > ComputerSystem.v1_5_0 "UefiTarget" > +#string STR_TARGET_UEFI_HTTP #language x-uefi-redfish- > ComputerSystem.v1_5_0 "UefiHttp" > diff --git > a/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeStrings.uni > b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeStrings.uni > new file mode 100644 > index 00000000..c2057633 > --- /dev/null > +++ b/RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxeStrings.uni > @@ -0,0 +1,41 @@ > +/** @file > + HII-to-Redfish memory driver. > + > + (C) Copyright 2022 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 > (Boot)" > +#string STR_FORM_SET_TITLE_HELP #language en-US "HII t= o Redfish > (Boot)" > +#string STR_FORM_TITLE #language en-US "HII t= o Redfish Boot > properties" > + > +#string STR_BOOT_ORDER #language en-US "Boot = Order" > +#string STR_BOOT_ORDER_LIST #language en-US "Boot = Order List" > +#string STR_BOOT_ORDER_LIST_HELP #language en-US "Boot = Order > List" > + > +#string STR_BOOT_SOURCE_OVERRIDE_ENABLED #language en-US "Boot > Source Override Enabled" > +#string STR_BOOT_SOURCE_OVERRIDE_ENABLED_HELP #language en-US > "Describes the state of the Boot Source Override feature." > + > +#string STR_BOOT_SOURCE_OVERRIDE_MODE #language en-US "Boot > Source Override Mode" > +#string STR_BOOT_SOURCE_OVERRIDE_MODE_HELP #language en-US > "The BIOS Boot Mode (either Legacy or UEFI) to be used when > BootSourceOverrideTarget boot source is booted from." > + > +#string STR_BOOT_SOURCE_OVERRIDE_TARGET #language en-US "Boot > Source Override Target" > +#string STR_BOOT_SOURCE_OVERRIDE_TARGET_HELP #language en-US > "The current boot source to be used at next boot instead of the normal bo= ot > device, if BootSourceOverrideEnabled is true." > + > +#string STR_DISABLED #language en-US "Disabl= ed" > +#string STR_ONCE #language en-US "Once" > +#string STR_CONTINUOUS #language en-US "Contin= uous" > +#string STR_UEFI #language en-US "UEFI" > +#string STR_LEGACY #language en-US "Legacy= " > +#string STR_TARGET_NONE #language en-US "None" > +#string STR_TARGET_PXE #language en-US "Pxe" > +#string STR_TARGET_USB #language en-US "Usb" > +#string STR_TARGET_HDD #language en-US "Hdd" > +#string STR_TARGET_BIOS_SETUP #language en-US "Bios S= etup > Menu" > +#string STR_TARGET_UEFI #language en-US "Uefi T= arget" > +#string STR_TARGET_UEFI_HTTP #language en-US "Uefi H= ttp" > diff --git a/RedfishClientPkg/RedfishClient.fdf.inc > b/RedfishClientPkg/RedfishClient.fdf.inc > index 7421440b..95c1eb3e 100644 > --- a/RedfishClientPkg/RedfishClient.fdf.inc > +++ b/RedfishClientPkg/RedfishClient.fdf.inc > @@ -21,6 +21,7 @@ > INF > RedfishClientPkg/Features/ComputerSystemCollectionDxe/ComputerSystem > CollectionDxe.inf > INF RedfishClientPkg/Features/Bios/v1_0_9/Dxe/BiosDxe.inf > INF RedfishClientPkg/Hii2RedfishMemoryDxe/Hii2RedfishMemoryDxe.inf > + INF RedfishClientPkg/Hii2RedfishBootDxe/Hii2RedfishBootDxe.inf > > !include RedfishClientPkg/RedfishJsonStructureDxe.fdf.inc > # > -- > 2.17.1