/** @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.
*
*  SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/

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;

