2recovery_reasons.h 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. /* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
  2. * Use of this source code is governed by a BSD-style license that can be
  3. * found in the LICENSE file.
  4. *
  5. * Recovery reasons
  6. */
  7. #ifndef VBOOT_REFERENCE_VBOOT_2RECOVERY_REASONS_H_
  8. #define VBOOT_REFERENCE_VBOOT_2RECOVERY_REASONS_H_
  9. /* Recovery reason codes */
  10. enum vb2_nv_recovery {
  11. /* Recovery not requested. */
  12. VB2_RECOVERY_NOT_REQUESTED = 0x00,
  13. /*
  14. * Recovery requested from legacy utility. (Prior to the NV storage
  15. * spec, recovery mode was a single bitfield; this value is reserved so
  16. * that scripts which wrote 1 to the recovery field are distinguishable
  17. * from scripts whch use the recovery reasons listed here.
  18. */
  19. VB2_RECOVERY_LEGACY = 0x01,
  20. /* User manually requested recovery via recovery button */
  21. VB2_RECOVERY_RO_MANUAL = 0x02,
  22. /*
  23. * RW firmware failed signature check (neither RW firmware slot was
  24. * valid)
  25. */
  26. VB2_RECOVERY_RO_INVALID_RW = 0x03,
  27. /* S3 resume failed */
  28. VB2_RECOVERY_RO_S3_RESUME = 0x04,
  29. /* TPM error in read-only firmware (deprecated) */
  30. VB2_RECOVERY_DEP_RO_TPM_ERROR = 0x05,
  31. /* Shared data error in read-only firmware */
  32. VB2_RECOVERY_RO_SHARED_DATA = 0x06,
  33. /* Test error from S3Resume() */
  34. VB2_RECOVERY_RO_TEST_S3 = 0x07,
  35. /* Test error from LoadFirmwareSetup() (deprecated) */
  36. VB2_RECOVERY_RO_TEST_LFS = 0x08,
  37. /* Test error from LoadFirmware() (deprecated) */
  38. VB2_RECOVERY_RO_TEST_LF = 0x09,
  39. /* Latest tried RW firmware keyblock verification failed */
  40. VB2_RECOVERY_FW_KEYBLOCK = 0x13,
  41. /* Latest tried RW firmware key version too old */
  42. VB2_RECOVERY_FW_KEY_ROLLBACK = 0x14,
  43. /* Latest tried RW firmware preamble verification failed */
  44. VB2_RECOVERY_FW_PREAMBLE = 0x16,
  45. /* Latest tried RW firmware version too old */
  46. VB2_RECOVERY_FW_ROLLBACK = 0x17,
  47. /* Latest tried RW firmware body verification failed */
  48. VB2_RECOVERY_FW_BODY = 0x1b,
  49. /*
  50. * Firmware boot failure outside of verified boot (RAM init, missing
  51. * SSD, etc.).
  52. */
  53. VB2_RECOVERY_RO_FIRMWARE = 0x20,
  54. /*
  55. * Recovery mode TPM initialization requires a system reboot. The
  56. * system was already in recovery mode for some other reason when this
  57. * happened.
  58. */
  59. VB2_RECOVERY_RO_TPM_REBOOT = 0x21,
  60. /* EC software sync - other error */
  61. VB2_RECOVERY_EC_SOFTWARE_SYNC = 0x22,
  62. /* EC software sync - unable to determine active EC image */
  63. VB2_RECOVERY_EC_UNKNOWN_IMAGE = 0x23,
  64. /* EC software sync - error obtaining EC image hash (deprecated) */
  65. VB2_RECOVERY_DEP_EC_HASH = 0x24,
  66. /* EC software sync - error obtaining expected EC image */
  67. VB2_RECOVERY_EC_EXPECTED_IMAGE = 0x25,
  68. /* EC software sync - error updating EC */
  69. VB2_RECOVERY_EC_UPDATE = 0x26,
  70. /* EC software sync - unable to jump to EC-RW */
  71. VB2_RECOVERY_EC_JUMP_RW = 0x27,
  72. /* EC software sync - unable to protect / unprotect EC-RW */
  73. VB2_RECOVERY_EC_PROTECT = 0x28,
  74. /* EC software sync - error obtaining expected EC hash */
  75. VB2_RECOVERY_EC_EXPECTED_HASH = 0x29,
  76. /* EC software sync - expected EC image doesn't match hash */
  77. VB2_RECOVERY_EC_HASH_MISMATCH = 0x2a,
  78. /* New error codes from VB2 */
  79. /* TODO: may need to add strings for these in the original fwlib */
  80. /* Secure data inititalization error */
  81. VB2_RECOVERY_SECDATA_INIT = 0x2b,
  82. /* GBB header is bad */
  83. VB2_RECOVERY_GBB_HEADER = 0x2c,
  84. /* Unable to clear TPM owner */
  85. VB2_RECOVERY_TPM_CLEAR_OWNER = 0x2d,
  86. /* Error determining/updating virtual dev switch */
  87. VB2_RECOVERY_DEV_SWITCH = 0x2e,
  88. /* Error determining firmware slot */
  89. VB2_RECOVERY_FW_SLOT = 0x2f,
  90. /* Unspecified/unknown error in read-only firmware */
  91. VB2_RECOVERY_RO_UNSPECIFIED = 0x3f,
  92. /*
  93. * User manually requested recovery by pressing a key at developer
  94. * warning screen
  95. */
  96. VB2_RECOVERY_RW_DEV_SCREEN = 0x41,
  97. /* No OS kernel detected */
  98. VB2_RECOVERY_RW_NO_OS = 0x42,
  99. /* OS kernel failed signature check */
  100. VB2_RECOVERY_RW_INVALID_OS = 0x43,
  101. /* TPM error in rewritable firmware (deprecated) */
  102. VB2_RECOVERY_DEP_RW_TPM_ERROR = 0x44,
  103. /* RW firmware in dev mode, but dev switch is off */
  104. VB2_RECOVERY_RW_DEV_MISMATCH = 0x45,
  105. /* Shared data error in rewritable firmware */
  106. VB2_RECOVERY_RW_SHARED_DATA = 0x46,
  107. /* Test error from LoadKernel() */
  108. VB2_RECOVERY_RW_TEST_LK = 0x47,
  109. /* No bootable disk found (deprecated)*/
  110. VB2_RECOVERY_DEP_RW_NO_DISK = 0x48,
  111. /* Rebooting did not correct TPM_E_FAIL or TPM_E_FAILEDSELFTEST */
  112. VB2_RECOVERY_TPM_E_FAIL = 0x49,
  113. /* TPM setup error in read-only firmware */
  114. VB2_RECOVERY_RO_TPM_S_ERROR = 0x50,
  115. /* TPM write error in read-only firmware */
  116. VB2_RECOVERY_RO_TPM_W_ERROR = 0x51,
  117. /* TPM lock error in read-only firmware */
  118. VB2_RECOVERY_RO_TPM_L_ERROR = 0x52,
  119. /* TPM update error in read-only firmware */
  120. VB2_RECOVERY_RO_TPM_U_ERROR = 0x53,
  121. /* TPM read error in rewritable firmware */
  122. VB2_RECOVERY_RW_TPM_R_ERROR = 0x54,
  123. /* TPM write error in rewritable firmware */
  124. VB2_RECOVERY_RW_TPM_W_ERROR = 0x55,
  125. /* TPM lock error in rewritable firmware */
  126. VB2_RECOVERY_RW_TPM_L_ERROR = 0x56,
  127. /* EC software sync unable to get EC image hash */
  128. VB2_RECOVERY_EC_HASH_FAILED = 0x57,
  129. /* EC software sync invalid image hash size */
  130. VB2_RECOVERY_EC_HASH_SIZE = 0x58,
  131. /* Unspecified error while trying to load kernel */
  132. VB2_RECOVERY_LK_UNSPECIFIED = 0x59,
  133. /* No bootable storage device in system */
  134. VB2_RECOVERY_RW_NO_DISK = 0x5a,
  135. /* No bootable kernel found on disk */
  136. VB2_RECOVERY_RW_NO_KERNEL = 0x5b,
  137. /* BCB related error in RW firmware */
  138. VB2_RECOVERY_RW_BCB_ERROR = 0x5c,
  139. /* New error codes from VB2 */
  140. /* TODO: may need to add strings for these in the original fwlib */
  141. /* Secure data inititalization error */
  142. VB2_RECOVERY_SECDATAK_INIT = 0x5d,
  143. /* Fastboot mode requested in firmware */
  144. VB2_RECOVERY_FW_FASTBOOT = 0x5e,
  145. /* Recovery hash space lock error in RO firmware */
  146. VB2_RECOVERY_RO_TPM_REC_HASH_L_ERROR = 0x5f,
  147. /* Unspecified/unknown error in rewritable firmware */
  148. VB2_RECOVERY_RW_UNSPECIFIED = 0x7f,
  149. /* DM-verity error */
  150. VB2_RECOVERY_KE_DM_VERITY = 0x81,
  151. /* Unspecified/unknown error in kernel */
  152. VB2_RECOVERY_KE_UNSPECIFIED = 0xbf,
  153. /* Recovery mode test from user-mode */
  154. VB2_RECOVERY_US_TEST = 0xc1,
  155. /* Recovery requested by user-mode via BCB */
  156. VB2_RECOVERY_BCB_USER_MODE = 0xc2,
  157. /* Fastboot mode requested by user-mode */
  158. VB2_RECOVERY_US_FASTBOOT = 0xc3,
  159. /* User requested recovery for training memory and rebooting. */
  160. VB2_RECOVERY_TRAIN_AND_REBOOT = 0xc4,
  161. /* Unspecified/unknown error in user-mode */
  162. VB2_RECOVERY_US_UNSPECIFIED = 0xff,
  163. };
  164. #endif /* VBOOT_REFERENCE_VBOOT_2RECOVERY_REASONS_H_ */