fsl_secboot_err.h 4.8 KB

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