ecc_mult_reg.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. /**
  2. * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include "soc/soc.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /** ECC_MULT_INT_RAW_REG register
  13. * ECC interrupt raw register, valid in level.
  14. */
  15. #define ECC_MULT_INT_RAW_REG (DR_REG_ECC_MULT_BASE + 0xc)
  16. /** ECC_MULT_CALC_DONE_INT_RAW : RO/WTC/SS; bitpos: [0]; default: 0;
  17. * The raw interrupt status bit for the ecc_calc_done_int interrupt
  18. */
  19. #define ECC_MULT_CALC_DONE_INT_RAW (BIT(0))
  20. #define ECC_MULT_CALC_DONE_INT_RAW_M (ECC_MULT_CALC_DONE_INT_RAW_V << ECC_MULT_CALC_DONE_INT_RAW_S)
  21. #define ECC_MULT_CALC_DONE_INT_RAW_V 0x00000001U
  22. #define ECC_MULT_CALC_DONE_INT_RAW_S 0
  23. /** ECC_MULT_INT_ST_REG register
  24. * ECC interrupt status register.
  25. */
  26. #define ECC_MULT_INT_ST_REG (DR_REG_ECC_MULT_BASE + 0x10)
  27. /** ECC_MULT_CALC_DONE_INT_ST : RO; bitpos: [0]; default: 0;
  28. * The masked interrupt status bit for the ecc_calc_done_int interrupt
  29. */
  30. #define ECC_MULT_CALC_DONE_INT_ST (BIT(0))
  31. #define ECC_MULT_CALC_DONE_INT_ST_M (ECC_MULT_CALC_DONE_INT_ST_V << ECC_MULT_CALC_DONE_INT_ST_S)
  32. #define ECC_MULT_CALC_DONE_INT_ST_V 0x00000001U
  33. #define ECC_MULT_CALC_DONE_INT_ST_S 0
  34. /** ECC_MULT_INT_ENA_REG register
  35. * ECC interrupt enable register.
  36. */
  37. #define ECC_MULT_INT_ENA_REG (DR_REG_ECC_MULT_BASE + 0x14)
  38. /** ECC_MULT_CALC_DONE_INT_ENA : R/W; bitpos: [0]; default: 0;
  39. * The interrupt enable bit for the ecc_calc_done_int interrupt
  40. */
  41. #define ECC_MULT_CALC_DONE_INT_ENA (BIT(0))
  42. #define ECC_MULT_CALC_DONE_INT_ENA_M (ECC_MULT_CALC_DONE_INT_ENA_V << ECC_MULT_CALC_DONE_INT_ENA_S)
  43. #define ECC_MULT_CALC_DONE_INT_ENA_V 0x00000001U
  44. #define ECC_MULT_CALC_DONE_INT_ENA_S 0
  45. /** ECC_MULT_INT_CLR_REG register
  46. * ECC interrupt clear register.
  47. */
  48. #define ECC_MULT_INT_CLR_REG (DR_REG_ECC_MULT_BASE + 0x18)
  49. /** ECC_MULT_CALC_DONE_INT_CLR : WT; bitpos: [0]; default: 0;
  50. * Set this bit to clear the ecc_calc_done_int interrupt
  51. */
  52. #define ECC_MULT_CALC_DONE_INT_CLR (BIT(0))
  53. #define ECC_MULT_CALC_DONE_INT_CLR_M (ECC_MULT_CALC_DONE_INT_CLR_V << ECC_MULT_CALC_DONE_INT_CLR_S)
  54. #define ECC_MULT_CALC_DONE_INT_CLR_V 0x00000001U
  55. #define ECC_MULT_CALC_DONE_INT_CLR_S 0
  56. /** ECC_MULT_CONF_REG register
  57. * ECC configure register
  58. */
  59. #define ECC_MULT_CONF_REG (DR_REG_ECC_MULT_BASE + 0x1c)
  60. /** ECC_MULT_START : R/W/SC; bitpos: [0]; default: 0;
  61. * Write 1 to start caculation of ECC Accelerator. This bit will be self-cleared after
  62. * the caculatrion is done.
  63. */
  64. #define ECC_MULT_START (BIT(0))
  65. #define ECC_MULT_START_M (ECC_MULT_START_V << ECC_MULT_START_S)
  66. #define ECC_MULT_START_V 0x00000001U
  67. #define ECC_MULT_START_S 0
  68. /** ECC_MULT_RESET : WT; bitpos: [1]; default: 0;
  69. * Write 1 to reset ECC Accelerator.
  70. */
  71. #define ECC_MULT_RESET (BIT(1))
  72. #define ECC_MULT_RESET_M (ECC_MULT_RESET_V << ECC_MULT_RESET_S)
  73. #define ECC_MULT_RESET_V 0x00000001U
  74. #define ECC_MULT_RESET_S 1
  75. /** ECC_MULT_KEY_LENGTH : R/W; bitpos: [2]; default: 0;
  76. * The key length mode bit of ECC Accelerator. 0: P-192. 1: P-256.
  77. */
  78. #define ECC_MULT_KEY_LENGTH (BIT(2))
  79. #define ECC_MULT_KEY_LENGTH_M (ECC_MULT_KEY_LENGTH_V << ECC_MULT_KEY_LENGTH_S)
  80. #define ECC_MULT_KEY_LENGTH_V 0x00000001U
  81. #define ECC_MULT_KEY_LENGTH_S 2
  82. /** ECC_MULT_SECURITY_MODE : R/W; bitpos: [3]; default: 0;
  83. * Reserved
  84. */
  85. #define ECC_MULT_SECURITY_MODE (BIT(3))
  86. #define ECC_MULT_SECURITY_MODE_M (ECC_MULT_SECURITY_MODE_V << ECC_MULT_SECURITY_MODE_S)
  87. #define ECC_MULT_SECURITY_MODE_V 0x00000001U
  88. #define ECC_MULT_SECURITY_MODE_S 3
  89. /** ECC_MULT_CLK_EN : R/W; bitpos: [4]; default: 0;
  90. * Write 1 to force on register clock gate.
  91. */
  92. #define ECC_MULT_CLK_EN (BIT(4))
  93. #define ECC_MULT_CLK_EN_M (ECC_MULT_CLK_EN_V << ECC_MULT_CLK_EN_S)
  94. #define ECC_MULT_CLK_EN_V 0x00000001U
  95. #define ECC_MULT_CLK_EN_S 4
  96. /** ECC_MULT_WORK_MODE : R/W; bitpos: [7:5]; default: 0;
  97. * The work mode bits of ECC Accelerator. 0: Point Mult Mode. 1: Division mode. 2:
  98. * Point verification mode. 3: Point Verif+mult mode. 4: Jacobian Point Mult Mode. 5:
  99. * Reserved. 6: Jacobian Point Verification Mode. 7: Point Verif + Jacobian Mult Mode.
  100. */
  101. #define ECC_MULT_WORK_MODE 0x00000007U
  102. #define ECC_MULT_WORK_MODE_M (ECC_MULT_WORK_MODE_V << ECC_MULT_WORK_MODE_S)
  103. #define ECC_MULT_WORK_MODE_V 0x00000007U
  104. #define ECC_MULT_WORK_MODE_S 5
  105. /** ECC_MULT_VERIFICATION_RESULT : RO/SS; bitpos: [8]; default: 0;
  106. * The verification result bit of ECC Accelerator, only valid when calculation is done.
  107. */
  108. #define ECC_MULT_VERIFICATION_RESULT (BIT(8))
  109. #define ECC_MULT_VERIFICATION_RESULT_M (ECC_MULT_VERIFICATION_RESULT_V << ECC_MULT_VERIFICATION_RESULT_S)
  110. #define ECC_MULT_VERIFICATION_RESULT_V 0x00000001U
  111. #define ECC_MULT_VERIFICATION_RESULT_S 8
  112. /** ECC_MULT_MEM_CLOCK_GATE_FORCE_ON : R/W; bitpos: [31]; default: 1;
  113. * ECC memory clock gate force on register
  114. */
  115. #define ECC_MULT_MEM_CLOCK_GATE_FORCE_ON (BIT(31))
  116. #define ECC_MULT_MEM_CLOCK_GATE_FORCE_ON_M (ECC_MULT_MEM_CLOCK_GATE_FORCE_ON_V << ECC_MULT_MEM_CLOCK_GATE_FORCE_ON_S)
  117. #define ECC_MULT_MEM_CLOCK_GATE_FORCE_ON_V 0x00000001U
  118. #define ECC_MULT_MEM_CLOCK_GATE_FORCE_ON_S 31
  119. /** ECC_MULT_DATE_REG register
  120. * Version control register
  121. */
  122. #define ECC_MULT_DATE_REG (DR_REG_ECC_MULT_BASE + 0xfc)
  123. /** ECC_MULT_DATE : R/W; bitpos: [27:0]; default: 35656256;
  124. * ECC mult version control register
  125. */
  126. #define ECC_MULT_DATE 0x0FFFFFFFU
  127. #define ECC_MULT_DATE_M (ECC_MULT_DATE_V << ECC_MULT_DATE_S)
  128. #define ECC_MULT_DATE_V 0x0FFFFFFFU
  129. #define ECC_MULT_DATE_S 0
  130. /** ECC_MULT_K_MEM register
  131. * The memory that stores k.
  132. */
  133. #define ECC_MULT_K_MEM (DR_REG_ECC_MULT_BASE + 0x100)
  134. #define ECC_MULT_K_MEM_SIZE_BYTES 32
  135. /** ECC_MULT_PX_MEM register
  136. * The memory that stores Px.
  137. */
  138. #define ECC_MULT_PX_MEM (DR_REG_ECC_MULT_BASE + 0x120)
  139. #define ECC_MULT_PX_MEM_SIZE_BYTES 32
  140. /** ECC_MULT_PY_MEM register
  141. * The memory that stores Py.
  142. */
  143. #define ECC_MULT_PY_MEM (DR_REG_ECC_MULT_BASE + 0x140)
  144. #define ECC_MULT_PY_MEM_SIZE_BYTES 32
  145. #ifdef __cplusplus
  146. }
  147. #endif