Setup.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /** @file
  2. Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef __SETUP__H__
  6. #define __SETUP__H__
  7. #ifndef MDEPKG_NDEBUG
  8. #define DEBUG_INTERFACE_FORM_ENABLE
  9. #endif // MDEPKG_NDEBUG
  10. //
  11. // Form class guid for the forms those will be showed on first front page.
  12. //
  13. #define FRONT_PAGE_GUID { 0xe58809f8, 0xfbc1, 0x48e2, { 0x88, 0x3a, 0xa3, 0xf, 0xdc, 0x4b, 0x44, 0x1e } }
  14. //
  15. // Form class guid for the forms those will be showed on boot maintenance manager menu.
  16. //
  17. #define BOOT_MAINTENANCE_GUID { 0xb2dedc91, 0xd59f, 0x48d2, { 0x89, 0x8a, 0x12, 0x49, 0xc, 0x74, 0xa4, 0xe0 } }
  18. // VFR common Definitions
  19. #define INVENTORY(Name,Value) \
  20. text \
  21. help = STRING_TOKEN(STR_EMPTY), \
  22. text = Name, \
  23. text = Value, \
  24. flags = 0, \
  25. key = 0;
  26. #define SUBTITLE(Text) subtitle text = Text;
  27. #define SEPARATOR SUBTITLE(STRING_TOKEN(STR_EMPTY))
  28. #define INTERACTIVE_TEXT(HelpToken, CaptionToken, ValueToken, Key)\
  29. grayoutif TRUE;\
  30. oneof varid = SETUP_DATA.InteractiveText,\
  31. questionid = Key,\
  32. prompt = CaptionToken,\
  33. help = HelpToken,\
  34. option text = ValueToken, value = 0, flags = INTERACTIVE | DEFAULT;\
  35. refresh interval = 1 \
  36. endoneof;\
  37. endif;
  38. #define SUPPRESS_GRAYOUT_ENDIF endif; endif;
  39. #define DEFAULT_FLAG
  40. #define SYSTEM_ACCESS_KEY_ID 0xF000
  41. //
  42. // System Access defintions.
  43. //
  44. #define SYSTEM_ACCESS_GUID \
  45. { 0xE770BB69, 0xBCB4, 0x4D04, { 0x9E, 0x97, 0x23, 0xFF, 0x94, 0x56, 0xFE, 0xAC }}
  46. #define SYSTEM_PASSWORD_ADMIN 0
  47. #define SYSTEM_PASSWORD_USER 1
  48. #define ADMIN_PW_CLEAR 0
  49. #define ADMIN_PW_SET 1
  50. typedef struct _SYSTEM_ACCESS
  51. {
  52. //
  53. // Passwords
  54. //
  55. UINT8 Access;
  56. } SYSTEM_ACCESS;
  57. //
  58. // Record the password status.
  59. //
  60. typedef struct {
  61. UINT8 AdminName;
  62. UINT8 UserName;
  63. } EFI_PASSWORD_STATUS;
  64. //
  65. // Config Data
  66. //
  67. typedef struct {
  68. UINT8 SerialDebug;
  69. UINT8 SerialDebugBaudRate;
  70. UINT8 RamDebugInterface;
  71. UINT8 UartDebugInterface;
  72. UINT8 Usb3DebugInterface;
  73. UINT8 SerialIoDebugInterface;
  74. UINT8 TraceHubDebugInterface;
  75. } DEBUG_CONFIG_DATA;
  76. //
  77. // Config Data Hob
  78. //
  79. #define DEBUG_CONFIG_DATA_HOB DEBUG_CONFIG_DATA
  80. //
  81. // Secure Boot Data
  82. //
  83. typedef struct{
  84. UINT8 SecureBoot;
  85. } SECURE_BOOT_VARIABLE;
  86. #pragma pack()
  87. //
  88. // Varstore statement
  89. // Setup is EfiVarStore that is related to EFI variable with attribute 0x07
  90. // (EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS)
  91. //
  92. #define SETUP_DATA_VARSTORE\
  93. efivarstore SETUP_DATA, varid = 1,\
  94. attribute = 0x7, name = Setup, guid = SETUP_GUID;
  95. #define SA_SETUP_VARSTORE\
  96. efivarstore SA_SETUP, varid = 2,\
  97. attribute = 0x7, name = SaSetup, guid = SA_SETUP_GUID;
  98. #define CPU_SETUP_VARSTORE\
  99. efivarstore CPU_SETUP, varid = 3,\
  100. attribute = 0x7, name = CpuSetup, guid = CPU_SETUP_GUID;
  101. #define ME_SETUP_VARSTORE\
  102. efivarstore ME_SETUP, varid = 4,\
  103. attribute = 0x7, name = MeSetup, guid = ME_SETUP_GUID;
  104. #define PCH_SETUP_VARSTORE\
  105. efivarstore PCH_SETUP, varid = 5,\
  106. attribute = 0x7, name = PchSetup, guid = PCH_SETUP_GUID;
  107. #define SI_SETUP_VARSTORE\
  108. efivarstore SI_SETUP, varid = 6,\
  109. attribute = 0x7, name = SiSetup, guid = SI_SETUP_GUID;
  110. #ifdef DEBUG_INTERFACE_FORM_ENABLE
  111. #define DEBUG_CONFIG_DATA_ID 0xF001
  112. #define DEBUG_CONFIG_DATA_VARSTORE\
  113. efivarstore DEBUG_CONFIG_DATA, varid = DEBUG_CONFIG_DATA_ID,\
  114. attribute = 0x7, name = DebugConfigData, guid = DEBUG_CONFIG_GUID;
  115. #endif // DEBUG_INTERFACE_FORM_ENABLE
  116. #define SYSTEM_ACCESS_VARSTORE\
  117. varstore SYSTEM_ACCESS, varid = SYSTEM_ACCESS_KEY_ID,\
  118. name = SystemAccess, guid = SYSTEM_ACCESS_GUID;
  119. #define SYSTEM_PASSWORD_VARSTORE\
  120. varstore EFI_PASSWORD_STATUS,\
  121. name = PasswordStatus, guid = SYSTEM_ACCESS_GUID;
  122. #define BOOT_FLOW_CONDITION_RECOVERY 2
  123. #define BOOT_FLOW_CONDITION_FIRST_BOOT 4
  124. #endif