fsl_secboot_err.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. * Copyright 2015 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #ifndef _FSL_SECBOOT_ERR_H
  7. #define _FSL_SECBOOT_ERR_H
  8. #define ERROR_ESBC_PAMU_INIT 0x100000
  9. #define ERROR_ESBC_SEC_RESET 0x200000
  10. #define ERROR_ESBC_SEC_INIT 0x400000
  11. #define ERROR_ESBC_SEC_DEQ 0x800000
  12. #define ERROR_ESBC_SEC_DEQ_TO 0x1000000
  13. #define ERROR_ESBC_SEC_ENQ 0x2000000
  14. #define ERROR_ESBC_SEC_JOBQ_STATUS 0x4000000
  15. #define ERROR_ESBC_CLIENT_CPUID_NO_MATCH 0x1
  16. #define ERROR_ESBC_CLIENT_HDR_LOC 0x2
  17. #define ERROR_ESBC_CLIENT_HEADER_BARKER 0x4
  18. #define ERROR_ESBC_CLIENT_HEADER_KEY_LEN 0x8
  19. #define ERROR_ESBC_CLIENT_HEADER_SIG_LEN 0x10
  20. #define ERROR_ESBC_CLIENT_HEADER_KEY_REVOKED 0x11
  21. #define ERROR_ESBC_CLIENT_HEADER_INVALID_SRK_NUM_ENTRY 0x12
  22. #define ERROR_ESBC_CLIENT_HEADER_INVALID_KEY_NUM 0x13
  23. #define ERROR_ESBC_CLIENT_HEADER_INV_SRK_ENTRY_KEYLEN 0x14
  24. #define ERROR_ESBC_CLIENT_HEADER_IE_KEY_REVOKED 0x15
  25. #define ERROR_ESBC_CLIENT_HEADER_INVALID_IE_NUM_ENTRY 0x16
  26. #define ERROR_ESBC_CLIENT_HEADER_INVALID_IE_KEY_NUM 0x17
  27. #define ERROR_ESBC_CLIENT_HEADER_INV_IE_ENTRY_KEYLEN 0x18
  28. #define ERROR_IE_TABLE_NOT_FOUND 0x19
  29. #define ERROR_ESBC_CLIENT_HEADER_KEY_LEN_NOT_TWICE_SIG_LEN 0x20
  30. #define ERROR_KEY_TABLE_NOT_FOUND 0x21
  31. #define ERROR_ESBC_CLIENT_HEADER_KEY_MOD_1 0x40
  32. #define ERROR_ESBC_CLIENT_HEADER_KEY_MOD_2 0x80
  33. #define ERROR_ESBC_CLIENT_HEADER_SIG_KEY_MOD 0x100
  34. #define ERROR_ESBC_CLIENT_HEADER_SG_ESBC_EP 0x200
  35. #define ERROR_ESBC_CLIENT_HASH_COMPARE_KEY 0x400
  36. #define ERROR_ESBC_CLIENT_HASH_COMPARE_EM 0x800
  37. #define ERROR_ESBC_CLIENT_SSM_TRUSTSTS 0x1000
  38. #define ERROR_ESBC_CLIENT_BAD_ADDRESS 0x2000
  39. #define ERROR_ESBC_CLIENT_MISC 0x4000
  40. #define ERROR_ESBC_CLIENT_HEADER_SG_ENTIRES_BAD 0x8000
  41. #define ERROR_ESBC_CLIENT_HEADER_SG 0x10000
  42. #define ERROR_ESBC_CLIENT_HEADER_IMG_SIZE 0x20000
  43. #define ERROR_ESBC_WRONG_CMD 0x40000
  44. #define ERROR_ESBC_MISSING_BOOTM 0x80000
  45. #define ERROR_ESBC_CLIENT_MAX 0x0
  46. struct fsl_secboot_errcode {
  47. int errcode;
  48. const char *name;
  49. };
  50. static const struct fsl_secboot_errcode fsl_secboot_errcodes[] = {
  51. { ERROR_ESBC_PAMU_INIT,
  52. "Error in initializing PAMU"},
  53. { ERROR_ESBC_SEC_RESET,
  54. "Error in resetting Job ring of SEC"},
  55. { ERROR_ESBC_SEC_INIT,
  56. "Error in initializing SEC"},
  57. { ERROR_ESBC_SEC_ENQ,
  58. "Error in enqueue operation by SEC"},
  59. { ERROR_ESBC_SEC_DEQ_TO,
  60. "Dequeue operation by SEC is timed out"},
  61. { ERROR_ESBC_SEC_DEQ,
  62. "Error in dequeue operation by SEC"},
  63. { ERROR_ESBC_SEC_JOBQ_STATUS,
  64. "Error in status of the job submitted to SEC"},
  65. { ERROR_ESBC_CLIENT_CPUID_NO_MATCH,
  66. "Current core is not boot core i.e core0" },
  67. { ERROR_ESBC_CLIENT_HDR_LOC,
  68. "Header address not in allowed memory range" },
  69. { ERROR_ESBC_CLIENT_HEADER_BARKER,
  70. "Wrong barker code in header" },
  71. { ERROR_ESBC_CLIENT_HEADER_KEY_LEN,
  72. "Wrong public key length in header" },
  73. { ERROR_ESBC_CLIENT_HEADER_SIG_LEN,
  74. "Wrong signature length in header" },
  75. { ERROR_ESBC_CLIENT_HEADER_KEY_LEN_NOT_TWICE_SIG_LEN,
  76. "Public key length not twice of signature length" },
  77. { ERROR_ESBC_CLIENT_HEADER_KEY_MOD_1,
  78. "Public key Modulus most significant bit not set" },
  79. { ERROR_ESBC_CLIENT_HEADER_KEY_MOD_2,
  80. "Public key Modulus in header not odd" },
  81. { ERROR_ESBC_CLIENT_HEADER_SIG_KEY_MOD,
  82. "Signature not less than modulus" },
  83. { ERROR_ESBC_CLIENT_HEADER_SG_ESBC_EP,
  84. "Entry point not in allowed space or one of the SG entries" },
  85. { ERROR_ESBC_CLIENT_HASH_COMPARE_KEY,
  86. "Public key hash comparison failed" },
  87. { ERROR_ESBC_CLIENT_HASH_COMPARE_EM,
  88. "RSA verification failed" },
  89. { ERROR_ESBC_CLIENT_SSM_TRUSTSTS,
  90. "SNVS not in TRUSTED state" },
  91. { ERROR_ESBC_CLIENT_BAD_ADDRESS,
  92. "Bad address error" },
  93. { ERROR_ESBC_CLIENT_MISC,
  94. "Miscallaneous error" },
  95. { ERROR_ESBC_CLIENT_HEADER_SG,
  96. "No SG support" },
  97. { ERROR_ESBC_CLIENT_HEADER_IMG_SIZE,
  98. "Invalid Image size" },
  99. { ERROR_ESBC_WRONG_CMD,
  100. "Unknown cmd/Wrong arguments. Core in infinite loop"},
  101. { ERROR_ESBC_MISSING_BOOTM,
  102. "Bootm command missing from bootscript" },
  103. { ERROR_ESBC_CLIENT_HEADER_KEY_REVOKED,
  104. "Selected key is revoked" },
  105. { ERROR_ESBC_CLIENT_HEADER_INVALID_SRK_NUM_ENTRY,
  106. "Wrong key entry" },
  107. { ERROR_ESBC_CLIENT_HEADER_INVALID_KEY_NUM,
  108. "Wrong key is selected" },
  109. { ERROR_ESBC_CLIENT_HEADER_INV_SRK_ENTRY_KEYLEN,
  110. "Wrong srk public key len in header" },
  111. { ERROR_ESBC_CLIENT_HEADER_IE_KEY_REVOKED,
  112. "Selected IE key is revoked" },
  113. { ERROR_ESBC_CLIENT_HEADER_INVALID_IE_NUM_ENTRY,
  114. "Wrong key entry in IE Table" },
  115. { ERROR_ESBC_CLIENT_HEADER_INVALID_IE_KEY_NUM,
  116. "Wrong IE key is selected" },
  117. { ERROR_ESBC_CLIENT_HEADER_INV_IE_ENTRY_KEYLEN,
  118. "Wrong IE public key len in header" },
  119. { ERROR_IE_TABLE_NOT_FOUND,
  120. "Information about IE Table missing" },
  121. { ERROR_KEY_TABLE_NOT_FOUND,
  122. "No Key/ Key Table Found in header"},
  123. { ERROR_ESBC_CLIENT_MAX, "NULL" }
  124. };
  125. void fsl_secboot_handle_error(int error);
  126. #endif