/** @file
*
*  Copyright (c) 2017 - 2018, Linaro, Ltd. All rights reserved.
*
*  SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/

#include <Guid/HiiPlatformSetupFormset.h>
#include <Guid/SynQuacerPlatformFormSet.h>
#include <Platform/VarStore.h>
#include <Uefi/UefiMultiPhase.h>

formset
  guid      = SYNQUACER_PLATFORM_FORMSET_GUID,
  title     = STRING_TOKEN(STR_FORM_SET_TITLE),
  help      = STRING_TOKEN(STR_FORM_SET_TITLE_HELP),
  classguid = EFI_HII_PLATFORM_SETUP_FORMSET_GUID,

  efivarstore SYNQUACER_PLATFORM_VARSTORE_DATA,
    attribute = EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE,  // EFI variable attributes
    name  = SynQuacerPlatformSettings,
    guid  = SYNQUACER_PLATFORM_FORMSET_GUID;

  form formid = 0x1000,
    title  = STRING_TOKEN(STR_MAIN_FORM_TITLE);

    oneof varid = SynQuacerPlatformSettings.PcieSlot0MaxSpeed,
        prompt      = STRING_TOKEN(STR_PCIE0_MAX_SPEED_PROMPT),
        help        = STRING_TOKEN(STR_PCIE_MAX_SPEED_HELP),
        flags       = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
        option text = STRING_TOKEN(STR_PCIE_MAX_SPEED_UNLIMITED), value = PCIE_MAX_SPEED_UNLIMITED, flags = DEFAULT;
        option text = STRING_TOKEN(STR_PCIE_MAX_SPEED_GEN1), value = PCIE_MAX_SPEED_GEN1, flags = 0;
    endoneof;

    oneof varid = SynQuacerPlatformSettings.PcieSlot1MaxSpeed,
        prompt      = STRING_TOKEN(STR_PCIE1_MAX_SPEED_PROMPT),
        help        = STRING_TOKEN(STR_PCIE_MAX_SPEED_HELP),
        flags       = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
        option text = STRING_TOKEN(STR_PCIE_MAX_SPEED_UNLIMITED), value = PCIE_MAX_SPEED_UNLIMITED, flags = DEFAULT;
        option text = STRING_TOKEN(STR_PCIE_MAX_SPEED_GEN1), value = PCIE_MAX_SPEED_GEN1, flags = 0;
    endoneof;

    oneof varid = SynQuacerPlatformSettings.PcieSlot2MaxSpeed,
        prompt      = STRING_TOKEN(STR_PCIE2_MAX_SPEED_PROMPT),
        help        = STRING_TOKEN(STR_PCIE_MAX_SPEED_HELP),
        flags       = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
        option text = STRING_TOKEN(STR_PCIE_MAX_SPEED_UNLIMITED), value = PCIE_MAX_SPEED_UNLIMITED, flags = DEFAULT;
        option text = STRING_TOKEN(STR_PCIE_MAX_SPEED_GEN1), value = PCIE_MAX_SPEED_GEN1, flags = 0;
    endoneof;

    oneof varid = SynQuacerPlatformSettings.EnableEmmc,
        prompt      = STRING_TOKEN(STR_EMMC_ENABLE_PROMPT),
        help        = STRING_TOKEN(STR_EMMC_ENABLE_HELP),
        flags       = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
        option text = STRING_TOKEN(STR_EMMC_DISABLED), value = EMMC_DISABLED, flags = DEFAULT;
        option text = STRING_TOKEN(STR_EMMC_ENABLED), value = EMMC_ENABLED, flags = 0;
    endoneof;

    oneof varid = SynQuacerPlatformSettings.AcpiPref,
        prompt      = STRING_TOKEN(STR_DT_ACPI_SELECT_PROMPT),
        help        = STRING_TOKEN(STR_DT_ACPI_SELECT_HELP),
        flags       = NUMERIC_SIZE_1 | INTERACTIVE | RESET_REQUIRED,
        option text = STRING_TOKEN(STR_DT_ACPI_SELECT_DT), value = ACPIPREF_DT, flags = DEFAULT;
        option text = STRING_TOKEN(STR_DT_ACPI_SELECT_ACPI), value = ACPIPREF_ACPI, flags = 0;
    endoneof;

    subtitle text = STRING_TOKEN(STR_NULL_STRING);

  endform;

endformset;
