On Tue, Jul 24, 2018 at 03:08:55PM +0800, Ming Huang wrote:
> From: Yang XinYi <[email protected]>
> 
> This library is added for oem setup menu item.

Please add some detail about what settings are made available here.

> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Yang XinYi <[email protected]>
> Signed-off-by: Ming Huang <[email protected]>
> Signed-off-by: Heyi Guo <[email protected]>
> ---
>  Platform/Hisilicon/D06/D06.dsc                                          |   
> 5 +-
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr          | 
> 154 ++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni          | 
> 172 +++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr            |  
> 41 +++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni            |  
> 36 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c               | 
> 380 ++++++++++++++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h               | 
> 141 ++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h             |  
> 64 ++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf        |  
> 67 ++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.uni        |  
> 24 ++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLibStrings.uni |  
> 64 ++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigVfr.Vfr          |  
> 89 +++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfig.hfr            | 
> 219 +++++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PcieConfigStrings.uni     | 
> 185 ++++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/PciePortConfig.hfr        | 
> 167 +++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.hfr             | 
> 171 +++++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/RasConfig.uni             | 
> 135 +++++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.hfr            |  
> 80 +++++
>  Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/iBMCConfig.uni            |  
> 49 +++
>  Silicon/Hisilicon/HisiPkg.dec                                           |   
> 1 +
>  Silicon/Hisilicon/Include/Library/OemConfigData.h                       |  
> 84 +++++
>  21 files changed, 2327 insertions(+), 1 deletion(-)
> 
> diff --git a/Platform/Hisilicon/D06/D06.dsc b/Platform/Hisilicon/D06/D06.dsc
> index 392225250f..6f3786f0eb 100644
> --- a/Platform/Hisilicon/D06/D06.dsc
> +++ b/Platform/Hisilicon/D06/D06.dsc
> @@ -334,7 +334,10 @@
>    #ACPI
>    #
>    MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
> -  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf
> +  Silicon/Hisilicon/Drivers/HisiAcpiPlatformDxe/AcpiPlatformDxe.inf {
> +    <LibraryClasses>
> +    NULL|Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> +  }
>  
>    Silicon/Hisilicon/Hi1620/Hi1620AcpiTables/AcpiTablesHi1620.inf
>    Silicon/Hisilicon/Drivers/AcpiPlatformDxe/AcpiPlatformDxe.inf
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr
> new file mode 100644
> index 0000000000..c709975c38
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.hfr
> @@ -0,0 +1,154 @@
> +/** @file
> +*
> +*  Memory Config form at Oem Config fromset.
> +*
> +*  Copyright (c) 2017 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2017 - 2018, Linaro Limited. All rights reserved.
> +*
> +*  This program and the accompanying materials
> +*  are licensed and made available under the terms and conditions of the BSD 
> License
> +*  which accompanies this distribution.  The full text of the license may be 
> found at
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +form formid = MEMORY_CONFIG_FORM_ID,
> +  title  = STRING_TOKEN(STR_MEMORY_CONFIG_FORM_TITLE);
> +
> +  oneof varid  = OEM_CONFIG_DATA.DdrDebugLevel,
> +        prompt   = STRING_TOKEN (STR_MEM_PRINT_LEVEL_PROMPT),
> +        help     = STRING_TOKEN (STR_MEM_PRINT_LEVEL_HELP),
> +        option text = STRING_TOKEN (STR_MEM_PRINT_LEVEL_DISABLE),  value = 
> 0, flags = RESET_REQUIRED;
> +        option text = STRING_TOKEN (STR_MEM_PRINT_LEVEL_MINIMUM), value = 1, 
> flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;
> +        option text = STRING_TOKEN (STR_MEM_PRINT_LEVEL_MINMAX),  value = 2, 
> flags = RESET_REQUIRED;
> +        option text = STRING_TOKEN (STR_MEM_PRINT_LEVEL_MAXIMUM),  value = 
> 3, flags = RESET_REQUIRED;
> +  endoneof;
> +
> +  oneof varid = OEM_CONFIG_DATA.DdrFreqLimit,
> +        prompt  = STRING_TOKEN(STR_XMP_DDR_FREQ_LIMIT_PROMPT),
> +        help    = STRING_TOKEN(STR_XMP_DDR_FREQ_LIMIT_HELP),
> +        option text = STRING_TOKEN(STR_AUTO), value = 0, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_1333_STRING), value = 5, 
> flags = RESET_REQUIRED;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_1600_STRING), value = 7, 
> flags = RESET_REQUIRED;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_1866_STRING), value = 9, 
> flags = RESET_REQUIRED;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_2133_STRING), value = 11, 
> flags = RESET_REQUIRED ;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_2400_STRING), value = 13, 
> flags = RESET_REQUIRED ;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_2667_STRING), value = 15, 
> flags = RESET_REQUIRED ;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_2933_STRING), value = 17, 
> flags = RESET_REQUIRED ;
> +        option text = STRING_TOKEN(STR_DDR_FREQ_3200_STRING), value = 19, 
> flags = RESET_REQUIRED ;
> +  endoneof;
> +
> +  suppressif TRUE;
> +    oneof varid = OEM_CONFIG_DATA.DdrRefreshSupport,
> +          prompt  = STRING_TOKEN(STR_DDR_REFRESH_SUPPORT_PROMPT),
> +          help    = STRING_TOKEN(STR_DDR_REFRESH_SUPPORT_HELP),
> +          option text = STRING_TOKEN(STR_ENABLE), value = 1, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +          option text = STRING_TOKEN(STR_DISABLE), value = 0, flags = 
> RESET_REQUIRED;
> +    endoneof;
> +
> +    suppressif ideqval OEM_CONFIG_DATA.DdrRefreshSupport == 0;
> +      oneof varid = OEM_CONFIG_DATA.DdrRefreshRate,
> +            prompt  = STRING_TOKEN(STR_DDR_REFRESH_PROMPT),
> +            help    = STRING_TOKEN(STR_DDR_REFRESH_HELP),
> +            option text = STRING_TOKEN(STR_32MS), value = 0, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +            option text = STRING_TOKEN(STR_64MS), value = 1, flags = 
> RESET_REQUIRED;
> +      endoneof;
> +    endif;
> +
> +    oneof varid  = OEM_CONFIG_DATA.RankMargin,
> +          prompt   = STRING_TOKEN (STR_RMT_PROMPT),
> +          help     = STRING_TOKEN (STR_RMT_HELP),
> +          option text = STRING_TOKEN (STR_DISABLE), value = 0, flags = 
> DEFAULT | MANUFACTURING |RESET_REQUIRED;
> +          option text = STRING_TOKEN (STR_ENABLE),  value = 1, flags = 
> RESET_REQUIRED;
> +    endoneof;
> +
> +    suppressif  ideqval OEM_CONFIG_DATA.RankMargin == 0;
> +      oneof varid  = OEM_CONFIG_DATA.RankMarginMode,
> +            prompt   = STRING_TOKEN (STR_RMTM_PROMPT),
> +            help     = STRING_TOKEN (STR_RMTM_HELP),
> +            option text = STRING_TOKEN (STR_RMTM_SFC),     value = 1, flags 
> = RESET_REQUIRED;
> +            option text = STRING_TOKEN (STR_RMTM_EXMBIST), value = 2, flags 
> = DEFAULT | MANUFACTURING |RESET_REQUIRED;
> +      endoneof;
> +
> +      numeric varid = OEM_CONFIG_DATA.rmtPatternLength,
> +              prompt    = STRING_TOKEN (STR_RMT_PATTERN_PROMPT),
> +              help      = STRING_TOKEN (STR_RMT_PATTERN_HELP),
> +              flags     = RESET_REQUIRED,
> +              minimum   = 1,
> +              maximum   = 32767,
> +              step      = 1,
> +              default   = RMT_PATTERN_LENGTH,
> +      endnumeric;
> +
> +      oneof varid  = OEM_CONFIG_DATA.perbitmargin,
> +            prompt   = STRING_TOKEN (STR_PER_BIT_MARGIN_PROMPT),
> +            help     = STRING_TOKEN (STR_PER_BIT_MARGIN_HELP),
> +            option text = STRING_TOKEN (STR_DISABLE), value = 0, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +            option text = STRING_TOKEN (STR_ENABLE),  value = 1, flags = 
> RESET_REQUIRED;
> +      endoneof;
> +
> +      oneof varid  = OEM_CONFIG_DATA.CaMargin,
> +            prompt   = STRING_TOKEN (STR_CA_MARGINS_PROMPT),
> +            help     = STRING_TOKEN (STR_CA_MARGINS_HELP),
> +            option text = STRING_TOKEN (STR_DISABLE), value = 0, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +            option text = STRING_TOKEN (STR_ENABLE),  value = 1, flags = 
> RESET_REQUIRED;
> +      endoneof;
> +
> +      oneof varid  = OEM_CONFIG_DATA.CaVrefMarginOption,
> +            prompt   = STRING_TOKEN (STR_CAVREF_MARGINS_PROMPT),
> +            help     = STRING_TOKEN (STR_CAVREF_MARGINS_HELP),
> +            option text = STRING_TOKEN (STR_CAVREF_MARGINS_OPTION0), value = 
> 0, flags = MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +            option text = STRING_TOKEN (STR_CAVREF_MARGINS_OPTION2),  value 
> = 1, flags = RESET_REQUIRED;
> +      endoneof;
> +    endif;
> +
> +    oneof varid = OEM_CONFIG_DATA.DieInterleaving,
> +          prompt  = STRING_TOKEN(STR_DIE_INTERLEAVING_PROMPT),
> +          help    = STRING_TOKEN(STR_DIE_INTERLEAVING_HELP),
> +          option text = STRING_TOKEN(STR_DISABLE),               value = 0, 
> flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;
> +          option text = STRING_TOKEN(STR_ENABLE),                value = 1, 
> flags = RESET_REQUIRED;
> +    endoneof;
> +
> +    oneof varid = OEM_CONFIG_DATA.ChannelInterleaving,
> +          prompt  = STRING_TOKEN(STR_CHANNEL_INTERLEAVING_PROMPT),
> +          help    = STRING_TOKEN(STR_CHANNEL_INTERLEAVING_HELP),
> +          option text = STRING_TOKEN(STR_DISABLE),               value = 0, 
> flags = RESET_REQUIRED;
> +          option text = STRING_TOKEN(STR_ENABLE),                value = 1, 
> flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;
> +    endoneof;
> +
> +    oneof varid = OEM_CONFIG_DATA.RankInterleaving,
> +          prompt  = STRING_TOKEN(STR_RANK_INTERLEAVING_PROMPT),
> +          help    = STRING_TOKEN(STR_RANK_INTERLEAVING_HELP),
> +          option text = STRING_TOKEN(STR_1WAY_STRING),           value = 1, 
> flags = RESET_REQUIRED;
> +          option text = STRING_TOKEN(STR_2WAY_STRING),           value = 2, 
> flags = RESET_REQUIRED | MANUFACTURING | DEFAULT;
> +          option text = STRING_TOKEN(STR_4WAY_STRING),           value = 4, 
> flags = RESET_REQUIRED;
> +    endoneof;
> +
> +    oneof varid = OEM_CONFIG_DATA.NumaEn,
> +          prompt  = STRING_TOKEN(STR_NUMA_PROMPT),
> +          help    = STRING_TOKEN(STR_NUMA_HELP),
> +          option text = STRING_TOKEN(STR_DISABLE),      value = 0,  flags = 
> RESET_REQUIRED;
> +          option text = STRING_TOKEN(STR_ENABLE),       value = 1,  flags = 
> RESET_REQUIRED | MANUFACTURING | DEFAULT;
> +    endoneof;
> +
> +    oneof varid  = OEM_CONFIG_DATA.HwMemTest,
> +          prompt   = STRING_TOKEN (STR_MEM_TEST_PROMPT),
> +          help     = STRING_TOKEN (STR_MEM_TEST_HELP),
> +          option text = STRING_TOKEN (STR_DISABLE), value = 0, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +          option text = STRING_TOKEN (STR_ENABLE),  value = 1, flags = 
> RESET_REQUIRED;
> +    endoneof;
> +
> +    oneof varid  = OEM_CONFIG_DATA.EccSupport,
> +          prompt   = STRING_TOKEN (STR_ECC_SUPPORT_PROMPT),
> +          help     = STRING_TOKEN (STR_ECC_SUPPORT_HELP),
> +          option text = STRING_TOKEN (STR_DISABLE), value = 0, flags = 
> MANUFACTURING | DEFAULT | RESET_REQUIRED;
> +          option text = STRING_TOKEN (STR_ECC_EN),  value = 1, flags = 
> RESET_REQUIRED;
> +          option text = STRING_TOKEN (STR_SDEC_EN),  value = 2, flags = 
> RESET_REQUIRED;
> +    endoneof;
> +  endif;
> +
> +endform;
> +
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni
> new file mode 100644
> index 0000000000..5caf42c18f
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MemoryConfig.uni
> @@ -0,0 +1,172 @@
> +/** @file
> +*
> +*  String definitions for the Memory Config.
> +*
> +*  Copyright (c) 2017 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2017 - 2018, Linaro Limited. All rights reserved.
> +*
> +*  This program and the accompanying materials
> +*  are licensed and made available under the terms and conditions of the BSD 
> License
> +*  which accompanies this distribution.  The full text of the license may be 
> found at
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +/=#
> +
> +#langdef   en-US "English"
> +#langdef   fr-FR "Français"

I approve of adding multiple languages, but this French appears
autotranslated (or at least translated completely out of context).

If French translations are required, please pass it to a person
accustomed to technical writing in French.
If not, please get rid of them.

I would always be happy to include Chinese translations.

> +
> +#string STR_MEMORY_CONFIG_FORM_TITLE        #language en-US "Memory 
> Configuration"
> +                                            #language fr-FR "Configuration 
> de la mémoire"
> +#string STR_MEMORY_CONFIG_FORM_HELP         #language en-US "Displays and 
> provides option to change the Memory Settings"
> +                                            #language fr-FR "Affiche et 
> fournit l'option pour modifier les paramètres de la mémoire"
> +#string STR_MEMORY_RAS_CONFIG_FORM_TITLE    #language en-US "Memory RAS 
> Configuration"
> +                                            #language fr-FR "Configuration 
> de la mémoire RAS"
> +#string STR_MEMORY_RAS_CONFIG_FORM_HELP     #language en-US "Displays and 
> provides option to change the Ras Configuration"
> +                                            #language fr-FR "Affiche et 
> fournit l'option de modification de la configuration RAS"
> +#string STR_MEM_PRINT_LEVEL_PROMPT          #language en-US "Memory Print 
> Level"
> +                                            #language fr-FR "Niveau 
> d'impression mémoire"
> +#string STR_MEM_PRINT_LEVEL_HELP            #language en-US "Memory Print 
> Level Set. Disable: Do not print any MRC statement/ Minimum: Print the most 
> important(High level) MRC statement/ Minmax: Print the Mid-important(Mid 
> level) and most important MRC statement/ Maximum: Print all of the MRC 
> statement"
> +                                            #language fr-FR "Niveau 
> d'impression mémoire réglé. Désactiver: n'imprimez aucune instruction 
> MRC/minimum: imprimez le plus important (haut niveau) MRC Statement/MinMax: 
> imprimez le Mid-important (moyen niveau) et la plus importante déclaration 
> MRC/maximum: imprimer tous les énoncés du MRC"
> +#string STR_ENABLE                          #language en-US  "Enabled"
> +                                            #language fr-FR  "Activé"
> +#string STR_DISABLE                         #language en-US  "Disabled"
> +                                            #language fr-FR  "Handicapés"
> +
> +#string STR_MEM_PRINT_LEVEL_MINIMUM         #language en-US "Minimum"
> +                                            #language fr-FR "Minimum"
> +#string STR_MEM_PRINT_LEVEL_MINMAX          #language en-US "Minmax"
> +                                            #language fr-FR "MinMax"
> +#string STR_MEM_PRINT_LEVEL_MAXIMUM         #language en-US "Maximum"
> +                                            #language fr-FR "Maximum"
> +#string STR_MEM_PRINT_LEVEL_DISABLE         #language en-US "Disable"
> +                                            #language fr-FR "Désactiver"
> +
> +#string STR_XMP_DDR_FREQ_LIMIT_PROMPT       #language en-US "Memory 
> Frequency"
> +                                            #language fr-FR "Fréquence de 
> mémoire"
> +#string STR_XMP_DDR_FREQ_LIMIT_HELP         #language en-US "Maximum Memory 
> Frequency Selections in Mhz. Do not select Reserved"
> +                                            #language fr-FR "Sélections 
> maximales de fréquence de mémoire en MHz. Ne sélectionnez pas réservé"
> +#string STR_AUTO                            #language en-US "Auto"
> +                                            #language fr-FR "Voiture"
> +#string STR_DDR_FREQ_1333_STRING            #language en-US "1333"
> +                                            #language fr-FR "1333"
> +#string STR_DDR_FREQ_1600_STRING            #language en-US "1600"
> +                                            #language fr-FR "1600"
> +#string STR_DDR_FREQ_1866_STRING            #language en-US "1866"
> +                                            #language fr-FR "1866"
> +#string STR_DDR_FREQ_2133_STRING            #language en-US "2133"
> +                                            #language fr-FR "2133"
> +#string STR_DDR_FREQ_2400_STRING            #language en-US "2400"
> +                                            #language fr-FR "2400"
> +#string STR_DDR_FREQ_2600_STRING            #language en-US "2600"
> +                                            #language fr-FR "2600"
> +#string STR_DDR_FREQ_2667_STRING            #language en-US "2667"
> +                                            #language fr-FR "2667"
> +#string STR_DDR_FREQ_2800_STRING            #language en-US "2800"
> +                                            #language fr-FR "2800"
> +#string STR_DDR_FREQ_2933_STRING            #language en-US "2993"
> +                                            #language fr-FR "2993"
> +#string STR_DDR_FREQ_3000_STRING            #language en-US "3000"
> +                                            #language fr-FR "3000"
> +#string STR_DDR_FREQ_3200_STRING            #language en-US "3200"
> +                                            #language fr-FR "3200"
> +
> +#string STR_DDR_REFRESH_SUPPORT_PROMPT      #language en-US "Custom Refresh 
> Enable"
> +                                            #language fr-FR "Activer 
> l'actualisation personnalisée"
> +#string STR_DDR_REFRESH_SUPPORT_HELP        #language en-US "Memory Custom 
> Refresh Enable "
> +                                            #language fr-FR "Mémoire 
> personnalisée actualiser activer"
> +#string STR_DDR_REFRESH_PROMPT              #language en-US "Custom Refresh 
> Rate"
> +                                            #language fr-FR "Taux de 
> rafra?chissement personnalisé"
> +#string STR_DDR_REFRESH_HELP                #language en-US "Memory Custom 
> Refresh Rate "
> +                                            #language fr-FR "Taux de 
> rafra?chissement personnalisé de la mémoire"
> +#string STR_32MS                            #language en-US "32ms"
> +                                            #language fr-FR "32ms"
> +#string STR_64MS                            #language en-US "64ms"
> +                                            #language fr-FR "64ms"
> +
> +#string STR_RMT_PROMPT                      #language en-US "Rank Margin 
> Tool"
> +                                            #language fr-FR "Outil marge de 
> classement"
> +#string STR_RMT_HELP                        #language en-US "Enable the rank 
> margin tool to run after DDR memory training"
> +                                            #language fr-FR "Activer l'outil 
> marge de rang pour exécuter après la formation mémoire DDR"
> +#string STR_RMTM_PROMPT                     #language en-US "Rank Margin 
> Mode"
> +                                            #language fr-FR "Mode de marge 
> de classement"
> +#string STR_RMTM_HELP                       #language en-US "Select test 
> mode for rank margin test"
> +                                            #language fr-FR "Sélectionner le 
> mode test pour le test de marge de rang"
> +#string STR_RMTM_SFC                        #language en-US "SFC"
> +                                            #language fr-FR "SFC"
> +#string STR_RMTM_EXMBIST                    #language en-US "EXMBIST"
> +                                            #language fr-FR "EXMBIST"
> +#string STR_RMT_PATTERN_PROMPT              #language en-US "RMT Pattern 
> Length"
> +                                            #language fr-FR "Longueur de 
> modèle de RMT"
> +#string STR_RMT_PATTERN_HELP                #language en-US "Set the pattern 
> length(1-32767) for the Rank Margin Tool"
> +                                            #language fr-FR "Définir la 
> longueur du modèle (1-32 767) pour l'outil marge de classement"
> +#string STR_PER_BIT_MARGIN_PROMPT           #language en-US "Per Bit Margin"
> +                                            #language fr-FR "Marge par bit"
> +#string STR_PER_BIT_MARGIN_HELP             #language en-US "Enables the 
> logging from the serial port of DDR Per Bit Margin Data"
> +                                            #language fr-FR "Active la 
> journalisation à partir du port série de données de marge DDR par bit"
> +#string STR_CA_MARGINS_PROMPT               #language en-US "CA Margin"
> +                                            #language fr-FR "Marge de ca"
> +#string STR_CA_MARGINS_HELP                 #language en-US "Enables CA 
> margin"
> +                                            #language fr-FR "Active la marge 
> de ca"
> +#string STR_CAVREF_MARGINS_PROMPT           #language en-US "CAVref Margin"
> +                                            #language fr-FR "Marge CAVref"
> +#string STR_CAVREF_MARGINS_HELP             #language en-US "CAVref margin 
> Options"
> +                                            #language fr-FR "Options de 
> marge CAVref"
> +#string STR_CAVREF_MARGINS_OPTION0          #language en-US "VDD/2^2 
> connected to QVrefVA and BVrefCA"
> +                                            #language fr-FR "DMV/2 ^ 2 
> connecté à QVrefVA et BVrefCA"
> +#string STR_CAVREF_MARGINS_OPTION2          #language en-US "Internally 
> generated Vref connected to QVrefCA^3 VDD/2^2 connected to BVrefCA"
> +                                            #language fr-FR "Vref interne 
> connecté à QVrefCA ^ 3 DMV/2 ^ 2 connecté à BVrefCA"
> +
> +#string STR_DIE_INTERLEAVING_PROMPT         #language en-US "Die 
> Interleaving"
> +                                            #language fr-FR "L'entrelacement"
> +#string STR_DIE_INTERLEAVING_HELP           #language en-US "Select Die 
> Interleaving setting"
> +                                            #language fr-FR "Sélectionner le 
> paramètre d'entrelacement de matrice"
> +#string STR_CHANNEL_INTERLEAVING_PROMPT     #language en-US "Channel 
> Interleaving"
> +                                            #language fr-FR "Entrelacement 
> de canaux"
> +#string STR_CHANNEL_INTERLEAVING_HELP       #language en-US "Select Channel 
> Interleaving setting"
> +                                            #language fr-FR "Sélectionner le 
> paramètre d'entrelacement de canal"
> +#string STR_RANK_INTERLEAVING_PROMPT        #language en-US "Rank 
> Interleaving"
> +                                            #language fr-FR "Entrelacement 
> de rang"
> +#string STR_RANK_INTERLEAVING_HELP          #language en-US "Select Rank 
> Interleaving setting"
> +                                            #language fr-FR "Sélectionner le 
> paramètre d'entrelacement de rang"
> +
> +#string STR_1WAY_STRING                     #language en-US "1-way 
> Interleave"
> +                                            #language fr-FR "1-Way 
> Interleave"
> +#string STR_2WAY_STRING                     #language en-US "2-way 
> Interleave"
> +                                            #language fr-FR "2-way 
> Interleave"
> +#string STR_3WAY_STRING                     #language en-US "3-way 
> Interleave"
> +                                            #language fr-FR "3-way 
> Interleave"
> +#string STR_4WAY_STRING                     #language en-US "4-way 
> Interleave"
> +                                            #language fr-FR "4-way 
> Interleave"
> +#string STR_6WAY_STRING                     #language en-US "6-way 
> Interleave"
> +                                            #language fr-FR "6-way 
> Interleave"
> +#string STR_8WAY_STRING                     #language en-US "8-way 
> Interleave"
> +                                            #language fr-FR "8-way 
> Interleave"
> +
> +#string STR_NUMA_PROMPT                     #language en-US "NUMA"
> +                                            #language fr-FR "NUMA"
> +#string STR_NUMA_HELP                       #language en-US "Enable or 
> Disable Non uniform Memory Access (NUMA)."
> +                                            #language fr-FR "Activer ou 
> désactiver l'accès mémoire non uniforme (NUMA)."
> +
> +#string STR_MEM_TEST_PROMPT                 #language en-US "Memory Test"
> +                                            #language fr-FR "Test de mémoire"
> +#string STR_MEM_TEST_HELP                   #language en-US "Enable/disable 
> memory test during normal boot"
> +                                            #language fr-FR 
> "Activer/désactiver le test de mémoire pendant le démarrage normal"
> +
> +#string STR_ECC_SUPPORT_PROMPT              #language en-US "ECC/SDEC 
> Support"
> +                                            #language fr-FR "ECC/SDEC 
> Support"
> +#string STR_ECC_SUPPORT_HELP                #language en-US "Enable/disable 
> DDR Ecc/SDEC Support"
> +                                            #language fr-FR "Enable/disable 
> DDR Ecc/SDEC Support"
> +#string STR_ECC_EN                          #language en-US "Ecc Enable"
> +                                            #language fr-FR "Ecc Enable"
> +#string STR_SDEC_EN                         #language en-US "SDEC Enable"
> +                                            #language fr-FR "SDEC Enable"
> +
> +
> +
> +
> +
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> new file mode 100644
> index 0000000000..9e3ac73116
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.hfr
> @@ -0,0 +1,41 @@
> +/** @file
> +*
> +*  Misc Config form at Oem Config fromset.
> +*
> +*  Copyright (c) 2017 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2017 - 2018, Linaro Limited. All rights reserved.
> +*
> +*  This program and the accompanying materials
> +*  are licensed and made available under the terms and conditions of the BSD 
> License
> +*  which accompanies this distribution.  The full text of the license may be 
> found at
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +form formid = MISC_CONFIG_FORM_ID,
> +  title  = STRING_TOKEN(STR_MISC_CONFIG_FORM_TITLE);
> +
> +    oneof varid   = OEM_CONFIG_DATA.EnableSmmu,
> +      prompt      = STRING_TOKEN(STR_OEM_TABLE),
> +      help        = STRING_TOKEN(STR_OEM_CONFIG_HELP),
> +      option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = 0;
> +      option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = DEFAULT;
> +    endoneof;
> +
> +    oneof varid   = OEM_CONFIG_DATA.EnableFdtTable,
> +      prompt      = STRING_TOKEN(STR_FDT_TABLE),
> +      help        = STRING_TOKEN(STR_FDT_CONFIG_HELP),
> +      option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT;
> +      option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = 0;
> +    endoneof;
> +
> +    oneof varid   = OEM_CONFIG_DATA.EnableSpcr,
> +      prompt      = STRING_TOKEN(STR_ENABLE_SPCR_TABLE),
> +      help        = STRING_TOKEN(STR_ENABLE_SPCR_HELP),
> +      option text = STRING_TOKEN(STR_DISABLED), value = 0, flags = DEFAULT;
> +      option text = STRING_TOKEN(STR_ENABLED), value = 1, flags = 0;
> +    endoneof;
> +
> +endform;
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> new file mode 100644
> index 0000000000..5ad1d1df30
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/MiscConfig.uni
> @@ -0,0 +1,36 @@
> +/** @file
> +*
> +*  String definitions for the Misc Config form.
> +*
> +*  Copyright (c) 2017 - 2018, Hisilicon Limited. All rights reserved.
> +*  Copyright (c) 2017 - 2018, Linaro Limited. All rights reserved.
> +*
> +*  This program and the accompanying materials
> +*  are licensed and made available under the terms and conditions of the BSD 
> License
> +*  which accompanies this distribution.  The full text of the license may be 
> found at
> +*  http://opensource.org/licenses/bsd-license.php
> +*
> +*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +*
> +**/
> +
> +#langdef   en-US "English"
> +#langdef   fr-FR "Français"
> +
> +#string STR_OEM_TABLE                  #language en-US  "Support Smmu"
> +                                       #language fr-FR  "Support Smmu"
> +#string STR_OEM_CONFIG_HELP            #language en-US  "Enable or Disable 
> Smmu."
> +                                       #language fr-FR  "Activer ou 
> désactiver Smmu."
> +#string STR_FDT_TABLE                  #language en-US  "Install DTB Table"
> +                                       #language fr-FR  "Installer la table 
> DTB"
> +#string STR_FDT_CONFIG_HELP            #language en-US  "Enable or Disable 
> Fdt Table."
> +                                       #language fr-FR  "Activer ou 
> désactiver la table FDT."
> +#string STR_ENABLE_SPCR_TABLE          #language en-US  "Support SPCR"
> +                                       #language fr-FR  "Support SPCR"
> +#string STR_ENABLE_SPCR_HELP           #language en-US  "Enable or Disable 
> SPCR Table."
> +                                       #language fr-FR  "Activer ou 
> désactiver la table SPCR."
> +#string STR_ENABLE_GOP_FRAME_BUFFER    #language en-US  "Support GOP FB"
> +                                       #language fr-FR  "Support GOP FB"
> +#string STR_ENABLE_GOP_FRAME_BUFFER_HELP     #language en-US  "Enable or 
> Disable GOP frame buffer."
> +                                             #language fr-FR  "Activer ou 
> désactiver Buffer de frame GOP."
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> new file mode 100644
> index 0000000000..586094dfbf
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.c
> @@ -0,0 +1,380 @@
> +/** @file
> +The OEM config reference implementation
> +
> +Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD 
> License
> +which accompanies this distribution.  The full text of the license may be 
> found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#include "OemConfig.h"
> +
> +struct MonthDescription {
> +  CONST CHAR8* MonthStr;
> +  UINT32       MonthInt;
> +} gMonthDescription[] = {
> +  { "Jan", 1 },
> +  { "Feb", 2 },
> +  { "Mar", 3 },
> +  { "Apr", 4 },
> +  { "May", 5 },
> +  { "Jun", 6 },
> +  { "Jul", 7 },
> +  { "Aug", 8 },
> +  { "Sep", 9 },
> +  { "Oct", 10 },
> +  { "Nov", 11 },
> +  { "Dec", 12 },
> +  { "???", 1 },  // Use 1 as default month
> +};

This duplicates a struct defined in
Silicon/Hisilicon/Drivers/VersionInfoPeim/VersionInfoPeim.c
Bu I don't see this struct used anywhere in this set?

> +
> +OEM_CONFIG_CALLBACK_DATA    mOemConfigPrivate = {
> +  OEM_CONFIG_CALLBACK_DATA_SIGNATURE,
> +  NULL,
> +  NULL,
> +  {
> +    OemExtractConfig,
> +    OemRouteConfig,
> +    OemCallback
> +  }
> +};
> +
> +HII_VENDOR_DEVICE_PATH  mOemHiiVendorDevicePath = {
> +  {
> +    {
> +      HARDWARE_DEVICE_PATH,
> +      HW_VENDOR_DP,
> +      {
> +        (UINT8) (sizeof (VENDOR_DEVICE_PATH)),
> +        (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8)
> +      }
> +    },
> +    { 0x874c4dcb, 0x08ec, 0x4fe6, { 0xb5, 0x8e, 0x3a, 0x9e, 0x1c, 0x26, 
> 0x70, 0xb9 } }
> +  },
> +  {
> +    END_DEVICE_PATH_TYPE,
> +    END_ENTIRE_DEVICE_PATH_SUBTYPE,
> +    {
> +      (UINT8) (END_DEVICE_PATH_LENGTH),
> +      (UINT8) ((END_DEVICE_PATH_LENGTH) >> 8)
> +    }
> +  }
> +};
> +
> +
> +
> +
> +
> +
> +/**
> +  This function allows a caller to extract the current configuration for one
> +  or more named elements from the target driver.
> +
> +
> +  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> +  @param Request         A null-terminated Unicode string in <ConfigRequest> 
> format.
> +  @param Progress        On return, points to a character in the Request 
> string.
> +                         Points to the string's null terminator if request 
> was successful.
> +                         Points to the most recent '&' before the first 
> failing name/value
> +                         pair (or the beginning of the string if the failure 
> is in the
> +                         first name/value pair) if the request was not 
> successful.
> +  @param Results         A null-terminated Unicode string in <ConfigAltResp> 
> format which
> +                         has all values filled in for the names in the 
> Request string.
> +                         String to be allocated by the called function.
> +
> +  @retval  EFI_INVALID_PARAMETER  Request is illegal syntax, or unknown name.
> +  @retval  EFI_NOT_FOUND          Routing data doesn't match any storage in 
> this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemExtractConfig (
> +  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
> +  IN  CONST EFI_STRING                       Request,
> +  OUT EFI_STRING                             *Progress,
> +  OUT EFI_STRING                             *Results
> +  )
> +{
> +  if (Progress == NULL || Results == NULL) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +  *Progress = Request;
> +  return EFI_NOT_FOUND;
> +}
> +
> +/**
> +  This function processes the results of changes in configuration.
> +
> +  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> +  @param Configuration   A null-terminated Unicode string in <ConfigResp> 
> format.
> +  @param Progress        A pointer to a string filled in with the offset of 
> the most
> +                         recent '&' before the first failing name/value pair 
> (or the
> +                         beginning of the string if the failure is in the 
> first
> +                         name/value pair) or the terminating NULL if all was 
> successful.
> +
> +  @retval  EFI_INVALID_PARAMETER  Configuration is NULL.
> +  @retval  EFI_NOT_FOUND          Routing data doesn't match any storage in 
> this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemRouteConfig (
> +  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
> +  IN  CONST EFI_STRING                       Configuration,
> +  OUT EFI_STRING                             *Progress
> +  )
> +{
> +  if (Configuration == NULL || Progress == NULL) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  *Progress = Configuration;
> +
> +  return EFI_NOT_FOUND;
> +}
> +
> +/**
> +  This function is invoked if user selected a interactive opcode from Device 
> Manager's
> +  Formset. If user set VBIOS, the new value is saved to EFI variable.
> +
> +  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> +  @param Action          Specifies the type of action taken by the browser.
> +  @param QuestionId      A unique value which is sent to the original 
> exporting driver
> +                         so that it can identify the type of data to expect.
> +  @param Type            The type of value for the question.
> +  @param Value           A pointer to the data being sent to the original 
> exporting driver.
> +  @param ActionRequest   On return, points to the action requested by the 
> callback function.
> +
> +  @retval  EFI_SUCCESS           The callback successfully handled the 
> action.
> +  @retval  EFI_INVALID_PARAMETER The setup browser call this function with 
> invalid parameters.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemCallback (
> +  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
> +  IN  EFI_BROWSER_ACTION                     Action,
> +  IN  EFI_QUESTION_ID                        QuestionId,
> +  IN  UINT8                                  Type,
> +  IN  EFI_IFR_TYPE_VALUE                     *Value,
> +  OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest
> +  )
> +{
> +  if (Action != EFI_BROWSER_ACTION_CHANGING) {
> +    //
> +    // Do nothing for other UEFI Action. Only do call back when data is 
> changed.
> +    //
> +    return EFI_UNSUPPORTED;
> +  }
> +  if ((Value == NULL) || (ActionRequest == NULL)) {
> +    return EFI_INVALID_PARAMETER;
> +  }
> +
> +  return EFI_SUCCESS;
> +}
> +
> +/**
> +  Install Boot Manager Menu driver.
> +
> +  @param ImageHandle     The image handle.
> +  @param SystemTable     The system table.
> +
> +  @retval  EFI_SUCEESS  Install Boot manager menu success.
> +  @retval  Other        Return error status.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemConfigUiLibConstructor (
> +  IN EFI_HANDLE                            ImageHandle,
> +  IN EFI_SYSTEM_TABLE                      *SystemTable
> +  )
> +{
> +  EFI_STATUS                  Status;
> +  OEM_CONFIG_DATA             Configuration;
> +  VOID                        *Hob;
> +  VERSION_INFO                *VersionInfo;
> +  UINTN                       BufSize;
> +  BOOLEAN                     Action;
> +  EFI_STRING                  ConfigRequestHdr;
> +  EFI_TIME                    Time = {0};
> +  CHAR16                      TmpString[0x100] = {0};
> +  UINT8                       Port;
> +
> +  mOemConfigPrivate.DriverHandle = NULL;
> +  Status = gBS->InstallMultipleProtocolInterfaces (
> +                  &mOemConfigPrivate.DriverHandle,
> +                  &gEfiDevicePathProtocolGuid,
> +                  &mOemHiiVendorDevicePath,
> +                  &gEfiHiiConfigAccessProtocolGuid,
> +                  &mOemConfigPrivate.ConfigAccess,
> +                  NULL
> +                  );
> +  if (EFI_ERROR (Status)) {
> +    return Status;
> +  }
> +
> +  //
> +  // Publish our HII data.
> +  //
> +  mOemConfigPrivate.HiiHandle = HiiAddPackages (
> +                                   &gOemConfigGuid,
> +                                   mOemConfigPrivate.DriverHandle,
> +                                   OemConfigVfrBin,
> +                                   OemConfigUiLibStrings,
> +                                   NULL
> +                                   );
> +  if (mOemConfigPrivate.HiiHandle == NULL) {
> +    DEBUG ((DEBUG_ERROR, "OemConfigUiLibConstructor(), Fail to Add Oem Hii 
> Package.\n"));
> +    return EFI_INVALID_PARAMETER;
> +  }
> +  //
> +  //BIOS Build Time Init
> +  //
> +  Hob = GetFirstGuidHob (&gVersionInfoHobGuid);
> +  if (Hob == NULL) {
> +    DEBUG ((DEBUG_ERROR, "[%a]:[%d] Version information HOB not found!\n", 
> __FILE__, __LINE__));

Many long lines in this function. Please break before or at 80 (where
doing so does not break up the format string).

> +    return EFI_NOT_FOUND;
> +  }
> +  VersionInfo = GET_GUID_HOB_DATA (Hob);
> +  Time = VersionInfo->BuildTime;
> +  UnicodeSPrint (TmpString, 50, L"%02d/%02d/%04d %02d:%02d", Time.Month, 
> Time.Day, Time.Year, Time.Hour, Time.Minute);

No hard-coded buffer sizes. In this case, use sizeof (TmpString).

> +  HiiSetString (mOemConfigPrivate.HiiHandle, STRING_TOKEN 
> (STR_MISC_BIOS_BUILDTIME), TmpString, "en-US");
> +  //
> +  // Check Oem Config Variable.
> +  //
> +  ConfigRequestHdr = HiiConstructConfigHdr (&gOemConfigGuid, 
> OEM_CONFIG_NAME, mOemConfigPrivate.DriverHandle);
> +  ZeroMem (&Configuration, sizeof (OEM_CONFIG_DATA));
> +  BufSize = sizeof (OEM_CONFIG_DATA);
> +  Status = gRT->GetVariable (OEM_CONFIG_NAME, &gOemConfigGuid, NULL, 
> &BufSize, &Configuration);
> +  if (EFI_ERROR (Status)) {
> +    Action = HiiSetToDefaults (ConfigRequestHdr, 
> EFI_HII_DEFAULT_CLASS_STANDARD);
> +    if (!Action) {
> +      //
> +      //Set the default value of the DDR option
> +      //
> +      Configuration.DdrDebugLevel = 0;
> +      Configuration.DdrFreqLimit = 0;
> +      Configuration.DdrRefreshSupport = 0;
> +      Configuration.DdrRefreshRate = 0;
> +      Configuration.RankMargin = 0;
> +      Configuration.RankMarginMode = 2;
> +      Configuration.rmtPatternLength = 256;
> +      Configuration.perbitmargin = 0x0;
> +      Configuration.CaMargin = 0x0;
> +      Configuration.CaVrefMarginOption = 0x0;
> +      Configuration.NumaEn = 1;
> +      Configuration.HwMemTest = 0;
> +      Configuration.DieInterleaving = 0;
> +      Configuration.ChannelInterleaving = 1;
> +      Configuration.RankInterleaving = 2;
> +      Configuration.EccSupport = 0;
> +      //
> +      //Set the default value of the BMC option
> +      //
> +      Configuration.BmcWdtEnable = 0;
> +      Configuration.BmcWdtTimeout = 15;
> +      Configuration.BmcWdtAction = 1;
> +      Configuration.OSWdtEnable = 0;
> +      Configuration.OSWdtTimeout = 5;
> +      Configuration.OSWdtAction = 1;
> +      //
> +      //Set the default value of the PCIe option
> +      //
> +      for (Port = 0; Port < PCIE_MAX_TOTAL_PORTS; Port++) {
> +        if (Port == 0 || Port == 1 || Port == 3 ||
> +            Port == 8 || Port == 9 || Port == 11 || Port == 14 || Port == 
> 15) {

Could this be abstracted out to a macro with a descriptive name?
What is it we're filtering on here?

> +          Configuration.PciePort[Port] = 0;
> +        } else {
> +          Configuration.PciePort[Port] = 1;
> +        }
> +        Configuration.PcieSRIOVSupport = 0;
> +        Configuration.PcieLinkSpeedPort[Port] = 3;
> +        Configuration.PcieLinkDeEmphasisPort[Port] = 0;
> +        if (Port == 2 || Port == 5 || Port == 10 || Port == 12 || Port == 
> 13) {

Macro with descriptive name?

> +          Configuration.PcieLinkDeEmphasisPort[Port] = 1;
> +        }
> +        Configuration.PcieLinkStatusPort[Port] = 0;
> +        Configuration.PcieMaxPayloadSizePort[Port] = 0;
> +        Configuration.PcieLinkSpeedRateStatusPort[Port] = 0;
> +        Configuration.PcieLinkMaxPort[Port] = 8;
> +        Configuration.PcieAspmPort[Port] = 0;
> +      }
> +      //
> +      //Set the default value of the Misc option
> +      //
> +      Configuration.EnableSmmu = 1;
> +      Configuration.EnableFdtTable = 0;
> +      Configuration.EnableSpcr = 0;
> +      //Configuration.EnableGOP=0;
> +      //
> +      //Set the default value of the Ras option
> +      //
> +      Configuration.EnRasSupport = 1;
> +      Configuration.EnPoison = 1;
> +      Configuration.CheckAlgorithm = 0;
> +      Configuration.PatrolScrub = 1;
> +      Configuration.PatrolScrubDuration = 24;
> +      Configuration.DemandScrubMode = 0;
> +      Configuration.CorrectErrorThreshold = 0;
> +      Configuration.AdvanceDeviceCorrection = 0;
> +      Configuration.RankSparing = 0;
> +      Configuration.FunnelPeriod = 0;
> +      Configuration.DpcFeature = 0;
> +      Configuration.EcrcFeature = 0;
> +      Configuration.CompletionTimeout = 1;
> +      Configuration.CompletionTimeoutValue = 0;
> +      Configuration.HotPlug = 1;
> +      Status = gRT->SetVariable (
> +                      OEM_CONFIG_NAME,
> +                      &gOemConfigGuid,
> +                      EFI_VARIABLE_NON_VOLATILE | 
> EFI_VARIABLE_BOOTSERVICE_ACCESS,
> +                      sizeof (OEM_CONFIG_DATA),
> +                      &Configuration
> +                      );
> +    }
> +  } else {
> +    Action = HiiValidateSettings (ConfigRequestHdr);
> +    if (!Action) {
> +      return EFI_INVALID_PARAMETER;
> +    }
> +  }
> +  return EFI_SUCCESS;
> +}
> +
> +/**
> +  Unloads the application and its installed protocol.
> +
> +  @param  ImageHandle     Handle that identifies the image to be unloaded.
> +  @param  SystemTable     The system table.
> +
> +  @retval EFI_SUCCESS           The image has been unloaded.
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemConfigUiLibDestructor (
> +  IN EFI_HANDLE                            ImageHandle,
> +  IN EFI_SYSTEM_TABLE                      *SystemTable
> +  )
> +{
> +  EFI_STATUS                  Status;
> +
> +  Status = gBS->UninstallMultipleProtocolInterfaces (
> +                  mOemConfigPrivate.DriverHandle,
> +                  &gEfiDevicePathProtocolGuid,
> +                  &mOemHiiVendorDevicePath,
> +                  &gEfiHiiConfigAccessProtocolGuid,
> +                  &mOemConfigPrivate.ConfigAccess,
> +                  NULL
> +                  );
> +
> +  HiiRemovePackages (mOemConfigPrivate.HiiHandle);
> +
> +  return Status;
> +}
> +
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h
> new file mode 100644
> index 0000000000..a03d0c2cda
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfig.h
> @@ -0,0 +1,141 @@
> +/** @file
> +The Oem config reference implement
> +
> +Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>

Add Hisilicon and/or Linaro copyright? (make sure that's in all the
files in patch)

> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD 
> License
> +which accompanies this distribution.  The full text of the license may be 
> found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +**/
> +
> +#ifndef _OEM_CONFIG_H_
> +#define _OEM_CONFIG_H_
> +
> +#include <Guid/HiiPlatformSetupFormset.h>
> +#include <Guid/MdeModuleHii.h>
> +#include <Guid/VersionInfoHobGuid.h>
> +#include <Library/BaseMemoryLib.h>
> +#include <Library/BaseLib.h>
> +#include <Library/DebugLib.h>
> +#include <Library/DevicePathLib.h>
> +#include <Library/HiiLib.h>
> +#include <Library/HobLib.h>
> +#include <Library/MemoryAllocationLib.h>
> +#include "Library/OemConfigData.h"
> +#include <Library/PcdLib.h>
> +#include <Library/PrintLib.h>
> +#include <Library/UefiBootServicesTableLib.h>
> +#include <Library/UefiHiiServicesLib.h>
> +#include <Library/UefiRuntimeServicesTableLib.h>
> +#include <Pi/PiFirmwareVolume.h>
> +#include <Protocol/HiiConfigAccess.h>
> +
> +//
> +// These are the VFR compiler generated data representing our VFR data.
> +//
> +extern UINT8  OemConfigVfrBin[];
> +
> +//
> +// HII specific Vendor Device Path definition.
> +//
> +typedef struct {
> +  VENDOR_DEVICE_PATH          VendorDevicePath;
> +  EFI_DEVICE_PATH_PROTOCOL    End;
> +} HII_VENDOR_DEVICE_PATH;
> +
> +#define OEM_CONFIG_CALLBACK_DATA_SIGNATURE  SIGNATURE_32 ('O', 'E', 'M', 'C')
> +typedef struct {
> +  UINTN                             Signature;
> +  EFI_HII_HANDLE                    HiiHandle;
> +  EFI_HANDLE                        DriverHandle;
> +  EFI_HII_CONFIG_ACCESS_PROTOCOL    ConfigAccess;
> +} OEM_CONFIG_CALLBACK_DATA;
> +
> +/**
> +  This function allows a caller to extract the current configuration for one
> +  or more named elements from the target driver.
> +
> +
> +  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> +  @param Request         A null-terminated Unicode string in <ConfigRequest> 
> format.
> +  @param Progress        On return, points to a character in the Request 
> string.
> +                         Points to the string's null terminator if request 
> was successful.
> +                         Points to the most recent '&' before the first 
> failing name/value
> +                         pair (or the beginning of the string if the failure 
> is in the
> +                         first name/value pair) if the request was not 
> successful.
> +  @param Results         A null-terminated Unicode string in <ConfigAltResp> 
> format which
> +                         has all values filled in for the names in the 
> Request string.
> +                         String to be allocated by the called function.
> +
> +  @retval  EFI_SUCCESS            The Results is filled with the requested 
> values.
> +  @retval  EFI_OUT_OF_RESOURCES   Not enough memory to store the results.
> +  @retval  EFI_INVALID_PARAMETER  Request is illegal syntax, or unknown name.
> +  @retval  EFI_NOT_FOUND          Routing data doesn't match any storage in 
> this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemExtractConfig (
> +  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
> +  IN  CONST EFI_STRING                       Request,
> +  OUT       EFI_STRING                       *Progress,
> +  OUT       EFI_STRING                       *Results
> +  );
> +
> +/**
> +  This function processes the results of changes in configuration.
> +
> +
> +  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> +  @param Configuration   A null-terminated Unicode string in <ConfigResp> 
> format.
> +  @param Progress        A pointer to a string filled in with the offset of 
> the most
> +                         recent '&' before the first failing name/value pair 
> (or the
> +                         beginning of the string if the failure is in the 
> first
> +                         name/value pair) or the terminating NULL if all was 
> successful.
> +
> +  @retval  EFI_SUCCESS            The Results is processed successfully.
> +  @retval  EFI_INVALID_PARAMETER  Configuration is NULL.
> +  @retval  EFI_NOT_FOUND          Routing data doesn't match any storage in 
> this driver.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemRouteConfig (
> +  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
> +  IN  CONST EFI_STRING                       Configuration,
> +  OUT       EFI_STRING                       *Progress
> +  );
> +
> +/**
> +  This function is invoked if user selected a interactive opcode from Device 
> Manager's
> +  Formset. If user set VBIOS, the new value is saved to EFI variable.
> +
> +  @param This            Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
> +  @param Action          Specifies the type of action taken by the browser.
> +  @param QuestionId      A unique value which is sent to the original 
> exporting driver
> +                         so that it can identify the type of data to expect.
> +  @param Type            The type of value for the question.
> +  @param Value           A pointer to the data being sent to the original 
> exporting driver.
> +  @param ActionRequest   On return, points to the action requested by the 
> callback function.
> +
> +  @retval  EFI_SUCCESS           The callback successfully handled the 
> action.
> +  @retval  EFI_INVALID_PARAMETER The setup browser call this function with 
> invalid parameters.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +OemCallback (
> +  IN  CONST EFI_HII_CONFIG_ACCESS_PROTOCOL   *This,
> +  IN        EFI_BROWSER_ACTION               Action,
> +  IN        EFI_QUESTION_ID                  QuestionId,
> +  IN        UINT8                            Type,
> +  IN        EFI_IFR_TYPE_VALUE               *Value,
> +  OUT       EFI_BROWSER_ACTION_REQUEST       *ActionRequest
> +  );
> +
> +VOID GetReleaseTime (EFI_TIME *Time);
> +#endif
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h
> new file mode 100644
> index 0000000000..ee44411420
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUi.h
> @@ -0,0 +1,64 @@
> +/** @file
> +
> +Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
> +This program and the accompanying materials
> +are licensed and made available under the terms and conditions of the BSD 
> License
> +which accompanies this distribution.  The full text of the license may be 
> found at
> +http://opensource.org/licenses/bsd-license.php
> +
> +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
> +
> +Module Name:
> +
> +  OemConfigUi.h
> +
> +Abstract:
> +
> +  NVData structure used by the OEM Config.
> +
> +Revision History:
> +
> +
> +**/
> +
> +#ifndef _OEM_CONFIG_UI_H_
> +#define _OEM_CONFIG_UI_H_
> +
> +#define EFI_VARIABLE_NON_VOLATILE            0x00000001
> +#define EFI_VARIABLE_BOOTSERVICE_ACCESS      0x00000002
> +#define EFI_VARIABLE_RUNTIME_ACCESS          0x00000004

Can you include Uefi/UefiMultiPhase.h instead?

> +#define OEM_CONFIG_FORM_ID                   1
> +#define MEMORY_CONFIG_FORM_ID                2
> +#define IBMC_CONFIG_FORM_ID                  3
> +#define PCIE_CONFIG_FORM_ID                  4
> +#define MISC_CONFIG_FORM_ID                  5
> +#define RAS_CONFIG_FORM_ID                   6
> +
> +#define VFR_FORMID_PCIE_SOCKET0              0x4100
> +#define VFR_FORMID_PCIE_SOCKET1              0x4200
> +#define VFR_FORMID_PCIE_PORT0                0x4000
> +#define VFR_FORMID_PCIE_PORT1                0x4001
> +#define VFR_FORMID_PCIE_PORT2                0x4002
> +#define VFR_FORMID_PCIE_PORT3                0x4003
> +#define VFR_FORMID_PCIE_PORT4                0x4004
> +#define VFR_FORMID_PCIE_PORT5                0x4005
> +#define VFR_FORMID_PCIE_PORT6                0x4006
> +#define VFR_FORMID_PCIE_PORT7                0x4007
> +#define VFR_FORMID_PCIE_PORT8                0x4008
> +#define VFR_FORMID_PCIE_PORT9                0x4009
> +#define VFR_FORMID_PCIE_PORT10               0x4010
> +#define VFR_FORMID_PCIE_PORT11               0x4011
> +#define VFR_FORMID_PCIE_PORT12               0x4012
> +#define VFR_FORMID_PCIE_PORT13               0x4013
> +#define VFR_FORMID_PCIE_PORT14               0x4014
> +#define VFR_FORMID_PCIE_PORT15               0x4015
> +
> +#define VFR_FORMID_MEMORY_RAS                0x6100
> +#define VFR_FORMID_CORRECT_ERROR             0x6101
> +#define VFR_FORMID_PCIE_RAS                  0x6200
> +
> +#define RMT_PATTERN_LENGTH                   256
> +
> +
> +#endif
> diff --git a/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf 
> b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> new file mode 100644
> index 0000000000..63cc01dafe
> --- /dev/null
> +++ b/Silicon/Hisilicon/Hi1620/Hi1620OemConfigUiLib/OemConfigUiLib.inf
> @@ -0,0 +1,67 @@
> +## @file
> +#  OEM config Library used by BDS
> +#
> +#  Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
> +#  This program and the accompanying materials are licensed and made 
> available under
> +#  the terms and conditions of the BSD License that accompanies this 
> distribution.
> +#  The full text of the license may be found at
> +#  http://opensource.org/licenses/bsd-license.php.
> +#
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
> +#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR 
> IMPLIED.
> +#
> +##
> +[Defines]
> +  INF_VERSION                    = 0x0001001A
> +  BASE_NAME                      = OemConfigUiLib
> +  MODULE_UNI_FILE                = OemConfigUiLib.uni
> +  FILE_GUID                      = 32B373AC-00B6-471b-B3AE-6E4A4501F6BA
> +  MODULE_TYPE                    = DXE_DRIVER
> +  VERSION_STRING                 = 1.0
> +  LIBRARY_CLASS                  = NULL|DXE_DRIVER UEFI_APPLICATION
> +  CONSTRUCTOR                    = OemConfigUiLibConstructor
> +  DESTRUCTOR                     = OemConfigUiLibDestructor
> +
> +[Sources]
> +  OemConfig.h
> +  OemConfigVfr.Vfr
> +  OemConfigUiLibStrings.uni
> +  OemConfig.c
> +  MemoryConfig.hfr
> +  MemoryConfig.uni
> +  iBMCConfig.hfr
> +  iBMCConfig.uni
> +  PcieConfig.hfr
> +  PcieConfigStrings.uni
> +  PciePortConfig.hfr
> +  MiscConfig.uni
> +  MiscConfig.hfr
> +  RasConfig.hfr
> +  RasConfig.uni

Can you sort source files alphabetically please?

/
    Leif
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to