public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [VFR support REST_STYLE PATCH 0/3] VFR support REST_STYLE
@ 2020-11-03  2:12 Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 1/3] MdePkg: Add GUID for REST Style Formset Abner Chang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Abner Chang @ 2020-11-03  2:12 UTC (permalink / raw)
  To: devel
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Dandan Bi, Eric Dong,
	Nickle Wang, Bob Feng, Liming Gao, Yuwei Chen, Michael D Kinney,
	Zhiguang Liu

VFR compiler and other related changes to support REST_STYLE in VFR
language for HII options to be configured in out-of-band management
such as the Redfish service. Add two HII options in the Sample driver
for REST_STYLE use cases.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Fan Wang <fan.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Abner Chang (3):
  MdePkg: Add GUID for REST Style Formset
  BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option
  MdeModulePkg/DriverSampleDxe: Add HII sample options

 BaseTools/Source/C/VfrCompile/VfrSyntax.g     | 25 +++++++++++++--
 .../Universal/DriverSampleDxe/NVDataStruc.h   |  4 ++-
 .../Universal/DriverSampleDxe/Vfr.vfr         | 32 +++++++++++++++++--
 .../Universal/DriverSampleDxe/VfrStrings.uni  | 11 +++++--
 MdePkg/MdePkg.dec                             |  3 ++
 5 files changed, 65 insertions(+), 10 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [VFR support REST_STYLE PATCH 1/3] MdePkg: Add GUID for REST Style Formset
  2020-11-03  2:12 [VFR support REST_STYLE PATCH 0/3] VFR support REST_STYLE Abner Chang
@ 2020-11-03  2:12 ` Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 2/3] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 3/3] MdeModulePkg/DriverSampleDxe: Add HII sample options Abner Chang
  2 siblings, 0 replies; 4+ messages in thread
From: Abner Chang @ 2020-11-03  2:12 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Nickle Wang

Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Ye Ting <ting.ye@intel.com>
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Wang Fan <fan.wang@intel.com>
Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 MdePkg/MdePkg.dec | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 645f61b80e..8b34915b9a 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -406,6 +406,9 @@
   ## Include/Guid/HiiPlatformSetupFormset.h
   gEfiHiiUserCredentialFormsetGuid = { 0x337f4407, 0x5aee, 0x4b83, { 0xb2, 0xa7, 0x4e, 0xad, 0xca, 0x30, 0x88, 0xcd }}
 
+  ## Include/Guid/HiiPlatformSetupFormset.h
+  gEfiHiiRestStyleFormsetGuid = { 0x790217bd, 0xbecf, 0x485b, { 0x91, 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 } }
+
   ## Include/Guid/HiiFormMapMethodGuid.h
   gEfiHiiStandardFormGuid = { 0x3bd2f4ec, 0xe524, 0x46e4, { 0xa9, 0xd8, 0x51, 0x1, 0x17, 0x42, 0x55, 0x62 }}
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [VFR support REST_STYLE PATCH 2/3] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option
  2020-11-03  2:12 [VFR support REST_STYLE PATCH 0/3] VFR support REST_STYLE Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 1/3] MdePkg: Add GUID for REST Style Formset Abner Chang
@ 2020-11-03  2:12 ` Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 3/3] MdeModulePkg/DriverSampleDxe: Add HII sample options Abner Chang
  2 siblings, 0 replies; 4+ messages in thread
From: Abner Chang @ 2020-11-03  2:12 UTC (permalink / raw)
  To: devel; +Cc: Bob Feng, Liming Gao, Yuwei Chen, Nickle Wang

Add REST_STYLE support on VFR language

Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com>
Signed-off-by: Ye Ting <ting.ye@intel.com>
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Signed-off-by: Wang Fan <fan.wang@intel.com>

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 BaseTools/Source/C/VfrCompile/VfrSyntax.g | 25 ++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/BaseTools/Source/C/VfrCompile/VfrSyntax.g b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
index 127cb8b2b2..3f896c6f1a 100644
--- a/BaseTools/Source/C/VfrCompile/VfrSyntax.g
+++ b/BaseTools/Source/C/VfrCompile/VfrSyntax.g
@@ -192,6 +192,7 @@ VfrParserStart (
 #token LateCheckFlag("LATE_CHECK")              "LATE_CHECK"
 #token ReadOnlyFlag("READ_ONLY")                "READ_ONLY"
 #token OptionOnlyFlag("OPTIONS_ONLY")           "OPTIONS_ONLY"
+#token RestStyleFlag("REST_STYLE")              "REST_STYLE"
 #token Class("class")                           "class"
 #token Subclass("subclass")                     "subclass"
 #token ClassGuid("classguid")                   "classguid"
@@ -584,7 +585,7 @@ vfrFormSetDefinition :
   <<
      EFI_GUID    Guid;
      EFI_GUID    DefaultClassGuid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID;
-     EFI_GUID    ClassGuid1, ClassGuid2, ClassGuid3;
+     EFI_GUID    ClassGuid1, ClassGuid2, ClassGuid3, ClassGuid4;
      UINT8       ClassGuidNum = 0;
      CIfrFormSet *FSObj = NULL;
      UINT16      C, SC;
@@ -600,13 +601,16 @@ vfrFormSetDefinition :
                      "\|" guidDefinition[ClassGuid2]  << ++ClassGuidNum; >>
                      {
                       "\|" guidDefinition[ClassGuid3]  << ++ClassGuidNum; >>
+                       {
+                         "\|" guidDefinition[ClassGuid4]  << ++ClassGuidNum; >>
+                       }
                      }
                   }
                   ","
   }
                                                     <<
-                                                      if (mOverrideClassGuid != NULL && ClassGuidNum >= 3) {
-                                                        _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 3 class guids, can't add extra class guid!");
+                                                      if (mOverrideClassGuid != NULL && ClassGuidNum >= 4) {
+                                                        _PCATCH (VFR_RETURN_INVALID_PARAMETER, L->getLine(), "Already has 4 class guids, can't add extra class guid!");
                                                       }
                                                       switch (ClassGuidNum) {
                                                       case 0:
@@ -643,10 +647,23 @@ vfrFormSetDefinition :
                                                         }
                                                         break;
                                                       case 3:
+                                                        if (mOverrideClassGuid != NULL) {
+                                                          ClassGuidNum ++;
+                                                        }
+                                                        FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
+                                                        FSObj->SetClassGuid(&ClassGuid1);
+                                                        FSObj->SetClassGuid(&ClassGuid2);
+                                                        FSObj->SetClassGuid(&ClassGuid3);
+                                                        if (mOverrideClassGuid != NULL) {
+                                                          FSObj->SetClassGuid(mOverrideClassGuid);
+                                                        }
+                                                        break;
+                                                      case 4:
                                                         FSObj = new CIfrFormSet(sizeof(EFI_IFR_FORM_SET) + ClassGuidNum * sizeof(EFI_GUID));
                                                         FSObj->SetClassGuid(&ClassGuid1);
                                                         FSObj->SetClassGuid(&ClassGuid2);
                                                         FSObj->SetClassGuid(&ClassGuid3);
+                                                        FSObj->SetClassGuid(&ClassGuid4);
                                                         break;
                                                       default:
                                                         break;
@@ -1321,6 +1338,7 @@ questionheaderFlagsField[UINT8 & Flags] :
     ReadOnlyFlag                                    << $Flags |= 0x01; >>
   | InteractiveFlag                                 << $Flags |= 0x04; >>
   | ResetRequiredFlag                               << $Flags |= 0x10; >>
+  | RestStyleFlag                                   << $Flags |= 0x20; >>
   | ReconnectRequiredFlag                           << $Flags |= 0x40; >>
   | O:OptionOnlyFlag                                <<
                                                        gCVfrErrorHandle.HandleWarning (
@@ -3766,6 +3784,7 @@ oneofoptionFlagsField [UINT8 & HFlags, UINT8 & LFlags] :
   | "OPTION_DEFAULT_MFG"                               << $LFlags |= 0x20; >>
   | InteractiveFlag                                    << $HFlags |= 0x04; >>
   | ResetRequiredFlag                                  << $HFlags |= 0x10; >>
+  | RestStyleFlag                                      << $HFlags |= 0x20; >>
   | ReconnectRequiredFlag                              << $HFlags |= 0x40; >>
   | ManufacturingFlag                                  << $LFlags |= 0x20; >>
   | DefaultFlag                                        << $LFlags |= 0x10; >>
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [VFR support REST_STYLE PATCH 3/3] MdeModulePkg/DriverSampleDxe: Add HII sample options
  2020-11-03  2:12 [VFR support REST_STYLE PATCH 0/3] VFR support REST_STYLE Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 1/3] MdePkg: Add GUID for REST Style Formset Abner Chang
  2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 2/3] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option Abner Chang
@ 2020-11-03  2:12 ` Abner Chang
  2 siblings, 0 replies; 4+ messages in thread
From: Abner Chang @ 2020-11-03  2:12 UTC (permalink / raw)
  To: devel
  Cc: Jiaxin Wu, Siyuan Fu, Fan Wang, Jiewen Yao, Dandan Bi, Eric Dong,
	Nickle Wang

Add x-uefi-ns keyword REST_STYLE HII option and non
x-uefi keyword REST_STYLE HII option.

Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Fan Wang <fan.wang@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Nickle Wang <nickle.wang@hpe.com>
---
 .../Universal/DriverSampleDxe/NVDataStruc.h   |  4 ++-
 .../Universal/DriverSampleDxe/Vfr.vfr         | 32 +++++++++++++++++--
 .../Universal/DriverSampleDxe/VfrStrings.uni  | 11 +++++--
 3 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
index 8617617684..761f5e169c 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
+++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
@@ -1,6 +1,7 @@
 /** @file
 
-Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>*
+(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 Module Name:
@@ -92,6 +93,7 @@ typedef struct {
   UINT16  BitNumeric  : 12;
   MY_BITS_DATA  MyBitData;
   MY_EFI_UNION_DATA MyUnionData;
+  UINT8   QuestionNonXUefiKeywordRestStyle;
 } DRIVER_SAMPLE_CONFIGURATION;
 
 //
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index 65a65d4d1d..eecb062320 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -3,6 +3,7 @@
 //    Sample Setup formset.
 //
 //  Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>
+// (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
 //  SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 //**/
@@ -280,15 +281,40 @@ formset
 
     endoneof;
 
+    //
+    // This is an HII option which has REST_STYLE flag and x-UEFI namespace
+    // UNI string associated. This HII option could be configured by either in-band
+    // edk2 setup browser or the remote management in out-of-band such as Redfish
+    // service. This HII option is configured through EFI_KEYWORD_HANDLER_PROTOCOL.
+    //
     oneof varid  = MyIfrNVData.QuestionAboutTreeHugging,
-      prompt      = STRING_TOKEN(STR_ONE_OF_PROMPT_KEYWORD),
-      help        = STRING_TOKEN(STR_ONE_OF_HELP),
-      flags       = RESET_REQUIRED,
+      prompt      = STRING_TOKEN(STR_ONE_OF_PROMPT_X_UEFI),
+      help        = STRING_TOKEN(STR_ONE_OF_PROMPT_X_UEFI_HELP),
+      flags       = RESET_REQUIRED | REST_STYLE,
       option text = STRING_TOKEN(STR_ONE_OF_TEXT1), value = 0, flags = 0;
       option text = STRING_TOKEN(STR_ONE_OF_TEXT2), value = 1, flags = DEFAULT;
       option text = STRING_TOKEN(STR_ONE_OF_TEXT3), value = 3, flags = 0;
     endoneof;
 
+    //
+    // This is a HII option which has REST_STYLE flag but without the x-UEFI namespace
+    // UNI string associated. This HII option could be configured by either
+    // setup browser or the remote management in out-of-band such as Redfish
+    // service. This HII option is configured through EFI HII Configuration Routing
+    // Protocol becasue it doesn't have x-UEFI namespace UNI string.
+    //
+    numeric varid  = MyIfrNVData.QuestionNonXUefiKeywordRestStyle,
+      prompt       = STRING_TOKEN(STR_ONE_OF_PROMPT_NON_X_UEFI),
+      help         = STRING_TOKEN(STR_ONE_OF_PROMPT_NON_X_UEFI_HELP),
+      flags        = RESET_REQUIRED | REST_STYLE,
+      minimum      = 0,
+      maximum      = 0xf0,
+      step         = 0,          // Stepping of 0 equates to a manual entering
+                                 // of a value, otherwise it will be adjusted by "+"/"-"
+      default      = 0,          // defaultstore could be used to specify the default type
+                                 // If no defaultstore is specified, it implies Standard Default
+    endnumeric;
+
     //
     // Define a string (EFI_IFR_STRING)
     //
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
index bafa194c63..e67b888783 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
+++ b/MdeModulePkg/Universal/DriverSampleDxe/VfrStrings.uni
@@ -1,6 +1,7 @@
 // *++
   //
 // Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
 // SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 // Module Name:
@@ -51,9 +52,13 @@
                                        #language fr-FR "Check the input number, test the efi buffer varstore"
 #string STR_ONE_OF_PROMPT              #language en-US "My one-of prompt #1"
                                        #language fr-FR "Mi uno- de guía # 1"
-#string STR_ONE_OF_PROMPT_KEYWORD      #language en-US "My Keyword Namespace Test"
-                                       #language fr-FR "My Keyword Namespace Test"
-                                       #language x-UEFI-ns "iSCSIBootEnable"
+#string STR_ONE_OF_PROMPT_X_UEFI       #language en-US "x-UEFI HII Option"
+                                       #language fr-FR "x-UEFI HII Option"
+                                       #language x-UEFI-ns "xUefiHiiOption"
+#string STR_ONE_OF_PROMPT_X_UEFI_HELP  #language en-US "This is an HII option which has REST_STYLE flag and x-UEFI namespace UNI string associated. This HII option could be configured by either in-band edk2 setup browser or the remote management in out-of-band such as Redfish service. This HII option is configured through EFI_KEYWORD_HANDLER_PROTOCOL."
+#string STR_ONE_OF_PROMPT_NON_X_UEFI       #language en-US "Non x-UEFI HII Option"
+                                           #language fr-FR "Non x-UEFI HII Option"
+#string STR_ONE_OF_PROMPT_NON_X_UEFI_HELP  #language en-US "This is a HII option which has REST_STYLE flag but without the x-UEFI namespace UNI string associated. This HII option could be configured by either setup browser or the remote management in out-of-band such as Redfish service. This HII option is configured through EFI HII Configuration Routing Protocol becasue it doesn't have x-UEFI namespace UNI string."
 #string STR_CHECK_KEYWORD_SUPPORT      #language en-US "Check iSCSI Boot Enable"
                                        #language fr-FR "Check iSCSI Boot Enable"
 #string STR_ONE_OF_HELP                #language en-US "My one-of help is going to be a long string to test out the efficiency of the ability of the I am tired of typing capabilities"
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-03  2:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-03  2:12 [VFR support REST_STYLE PATCH 0/3] VFR support REST_STYLE Abner Chang
2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 1/3] MdePkg: Add GUID for REST Style Formset Abner Chang
2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 2/3] BaseTools/VfrCompile: VFR compiler supports REST_STYLE in HII option Abner Chang
2020-11-03  2:12 ` [VFR support REST_STYLE PATCH 3/3] MdeModulePkg/DriverSampleDxe: Add HII sample options Abner Chang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox