1 /***************************************************************************//** 2 * \file cyip_crypto.h 3 * 4 * \brief 5 * CRYPTO IP definitions 6 * 7 ******************************************************************************** 8 * \copyright 9 * (c) (2016-2021), Cypress Semiconductor Corporation (an Infineon company) or 10 * an affiliate of Cypress Semiconductor Corporation. 11 * 12 * SPDX-License-Identifier: Apache-2.0 13 * 14 * Licensed under the Apache License, Version 2.0 (the "License"); 15 * you may not use this file except in compliance with the License. 16 * You may obtain a copy of the License at 17 * 18 * http://www.apache.org/licenses/LICENSE-2.0 19 * 20 * Unless required by applicable law or agreed to in writing, software 21 * distributed under the License is distributed on an "AS IS" BASIS, 22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 * See the License for the specific language governing permissions and 24 * limitations under the License. 25 *******************************************************************************/ 26 27 #ifndef _CYIP_CRYPTO_H_ 28 #define _CYIP_CRYPTO_H_ 29 30 #include "cyip_headers.h" 31 32 /******************************************************************************* 33 * CRYPTO 34 *******************************************************************************/ 35 36 #define CRYPTO_SECTION_SIZE 0x00010000UL 37 38 /** 39 * \brief N/A (CRYPTO) 40 */ 41 typedef struct { 42 __IM uint32_t CTL; /*!< 0x00000000 Control */ 43 __IM uint32_t STATUS; /*!< 0x00000004 Status */ 44 __IM uint32_t RESERVED[2]; 45 __IOM uint32_t ECC_CTL; /*!< 0x00000010 ECC control */ 46 __IM uint32_t RESERVED1[11]; 47 __IOM uint32_t AES_DESCR; /*!< 0x00000040 AES descriptor pointer */ 48 __IM uint32_t RESERVED2[15]; 49 __IOM uint32_t VU_DESCR; /*!< 0x00000080 VU descriptor pointer */ 50 __IM uint32_t RESERVED3[15]; 51 __IOM uint32_t SHA_DESCR; /*!< 0x000000C0 SHA descriptor pointer */ 52 __IM uint32_t RESERVED4[11]; 53 __IOM uint32_t INTR_ERROR; /*!< 0x000000F0 Error interrupt */ 54 __IOM uint32_t INTR_ERROR_SET; /*!< 0x000000F4 Error interrupt set */ 55 __IOM uint32_t INTR_ERROR_MASK; /*!< 0x000000F8 Error interrupt mask */ 56 __IM uint32_t INTR_ERROR_MASKED; /*!< 0x000000FC Error interrupt masked */ 57 __IOM uint32_t TRNG_CTL0; /*!< 0x00000100 TRNG control 0 */ 58 __IOM uint32_t TRNG_CTL1; /*!< 0x00000104 TRNG control 1 */ 59 __IM uint32_t RESERVED5; 60 __IM uint32_t TRNG_STATUS; /*!< 0x0000010C TRNG status */ 61 __IM uint32_t TRNG_RESULT; /*!< 0x00000110 TRNG result */ 62 __IM uint32_t RESERVED6[3]; 63 __IOM uint32_t TRNG_GARO_CTL; /*!< 0x00000120 TRNG GARO control */ 64 __IOM uint32_t TRNG_FIRO_CTL; /*!< 0x00000124 TRNG FIRO control */ 65 __IM uint32_t RESERVED7[6]; 66 __IOM uint32_t TRNG_MON_CTL; /*!< 0x00000140 TRNG monitor control */ 67 __IM uint32_t RESERVED8[3]; 68 __IOM uint32_t TRNG_MON_RC_CTL; /*!< 0x00000150 TRNG monitor RC control */ 69 __IM uint32_t RESERVED9; 70 __IM uint32_t TRNG_MON_RC_STATUS0; /*!< 0x00000158 TRNG monitor RC status 0 */ 71 __IM uint32_t TRNG_MON_RC_STATUS1; /*!< 0x0000015C TRNG monitor RC status 1 */ 72 __IOM uint32_t TRNG_MON_AP_CTL; /*!< 0x00000160 TRNG monitor AP control */ 73 __IM uint32_t RESERVED10; 74 __IM uint32_t TRNG_MON_AP_STATUS0; /*!< 0x00000168 TRNG monitor AP status 0 */ 75 __IM uint32_t TRNG_MON_AP_STATUS1; /*!< 0x0000016C TRNG monitor AP status 1 */ 76 __IM uint32_t RESERVED11[32]; 77 __IOM uint32_t INTR_TRNG; /*!< 0x000001F0 TRNG interrupt */ 78 __IOM uint32_t INTR_TRNG_SET; /*!< 0x000001F4 TRNG Interrupt set */ 79 __IOM uint32_t INTR_TRNG_MASK; /*!< 0x000001F8 TRNG Interrupt mask */ 80 __IM uint32_t INTR_TRNG_MASKED; /*!< 0x000001FC TRNG Interrupt masked */ 81 } CRYPTO_Type; /*!< Size = 512 (0x200) */ 82 83 84 /* CRYPTO.CTL */ 85 #define CRYPTO_CTL_P_Pos 0UL 86 #define CRYPTO_CTL_P_Msk 0x1UL 87 #define CRYPTO_CTL_NS_Pos 1UL 88 #define CRYPTO_CTL_NS_Msk 0x2UL 89 #define CRYPTO_CTL_PC_Pos 4UL 90 #define CRYPTO_CTL_PC_Msk 0xF0UL 91 #define CRYPTO_CTL_MS_Pos 8UL 92 #define CRYPTO_CTL_MS_Msk 0xF00UL 93 /* CRYPTO.STATUS */ 94 #define CRYPTO_STATUS_BUSY_Pos 0UL 95 #define CRYPTO_STATUS_BUSY_Msk 0x1UL 96 /* CRYPTO.ECC_CTL */ 97 #define CRYPTO_ECC_CTL_CHECK_EN_Pos 3UL 98 #define CRYPTO_ECC_CTL_CHECK_EN_Msk 0x8UL 99 /* CRYPTO.AES_DESCR */ 100 #define CRYPTO_AES_DESCR_PTR_Pos 2UL 101 #define CRYPTO_AES_DESCR_PTR_Msk 0xFFFFFFFCUL 102 /* CRYPTO.VU_DESCR */ 103 #define CRYPTO_VU_DESCR_PTR_Pos 2UL 104 #define CRYPTO_VU_DESCR_PTR_Msk 0xFFFFFFFCUL 105 /* CRYPTO.SHA_DESCR */ 106 #define CRYPTO_SHA_DESCR_PTR_Pos 2UL 107 #define CRYPTO_SHA_DESCR_PTR_Msk 0xFFFFFFFCUL 108 /* CRYPTO.INTR_ERROR */ 109 #define CRYPTO_INTR_ERROR_BUS_ERROR_Pos 0UL 110 #define CRYPTO_INTR_ERROR_BUS_ERROR_Msk 0x1UL 111 /* CRYPTO.INTR_ERROR_SET */ 112 #define CRYPTO_INTR_ERROR_SET_BUS_ERROR_Pos 0UL 113 #define CRYPTO_INTR_ERROR_SET_BUS_ERROR_Msk 0x1UL 114 /* CRYPTO.INTR_ERROR_MASK */ 115 #define CRYPTO_INTR_ERROR_MASK_BUS_ERROR_Pos 0UL 116 #define CRYPTO_INTR_ERROR_MASK_BUS_ERROR_Msk 0x1UL 117 /* CRYPTO.INTR_ERROR_MASKED */ 118 #define CRYPTO_INTR_ERROR_MASKED_BUS_ERROR_Pos 0UL 119 #define CRYPTO_INTR_ERROR_MASKED_BUS_ERROR_Msk 0x1UL 120 /* CRYPTO.TRNG_CTL0 */ 121 #define CRYPTO_TRNG_CTL0_SAMPLE_CLOCK_DIV_Pos 0UL 122 #define CRYPTO_TRNG_CTL0_SAMPLE_CLOCK_DIV_Msk 0xFFUL 123 #define CRYPTO_TRNG_CTL0_RED_CLOCK_DIV_Pos 8UL 124 #define CRYPTO_TRNG_CTL0_RED_CLOCK_DIV_Msk 0xFF00UL 125 #define CRYPTO_TRNG_CTL0_INIT_DELAY_Pos 16UL 126 #define CRYPTO_TRNG_CTL0_INIT_DELAY_Msk 0xFF0000UL 127 #define CRYPTO_TRNG_CTL0_VON_NEUMANN_CORR_Pos 24UL 128 #define CRYPTO_TRNG_CTL0_VON_NEUMANN_CORR_Msk 0x1000000UL 129 #define CRYPTO_TRNG_CTL0_FEEDBACK_EN_Pos 25UL 130 #define CRYPTO_TRNG_CTL0_FEEDBACK_EN_Msk 0x2000000UL 131 #define CRYPTO_TRNG_CTL0_STOP_ON_AP_DETECT_Pos 28UL 132 #define CRYPTO_TRNG_CTL0_STOP_ON_AP_DETECT_Msk 0x10000000UL 133 #define CRYPTO_TRNG_CTL0_STOP_ON_RC_DETECT_Pos 29UL 134 #define CRYPTO_TRNG_CTL0_STOP_ON_RC_DETECT_Msk 0x20000000UL 135 /* CRYPTO.TRNG_CTL1 */ 136 #define CRYPTO_TRNG_CTL1_RO11_EN_Pos 0UL 137 #define CRYPTO_TRNG_CTL1_RO11_EN_Msk 0x1UL 138 #define CRYPTO_TRNG_CTL1_RO15_EN_Pos 1UL 139 #define CRYPTO_TRNG_CTL1_RO15_EN_Msk 0x2UL 140 #define CRYPTO_TRNG_CTL1_GARO15_EN_Pos 2UL 141 #define CRYPTO_TRNG_CTL1_GARO15_EN_Msk 0x4UL 142 #define CRYPTO_TRNG_CTL1_GARO31_EN_Pos 3UL 143 #define CRYPTO_TRNG_CTL1_GARO31_EN_Msk 0x8UL 144 #define CRYPTO_TRNG_CTL1_FIRO15_EN_Pos 4UL 145 #define CRYPTO_TRNG_CTL1_FIRO15_EN_Msk 0x10UL 146 #define CRYPTO_TRNG_CTL1_FIRO31_EN_Pos 5UL 147 #define CRYPTO_TRNG_CTL1_FIRO31_EN_Msk 0x20UL 148 /* CRYPTO.TRNG_STATUS */ 149 #define CRYPTO_TRNG_STATUS_INITIALIZED_Pos 0UL 150 #define CRYPTO_TRNG_STATUS_INITIALIZED_Msk 0x1UL 151 /* CRYPTO.TRNG_RESULT */ 152 #define CRYPTO_TRNG_RESULT_DATA_Pos 0UL 153 #define CRYPTO_TRNG_RESULT_DATA_Msk 0xFFFFFFFFUL 154 /* CRYPTO.TRNG_GARO_CTL */ 155 #define CRYPTO_TRNG_GARO_CTL_POLYNOMIAL_Pos 0UL 156 #define CRYPTO_TRNG_GARO_CTL_POLYNOMIAL_Msk 0x7FFFFFFFUL 157 /* CRYPTO.TRNG_FIRO_CTL */ 158 #define CRYPTO_TRNG_FIRO_CTL_POLYNOMIAL_Pos 0UL 159 #define CRYPTO_TRNG_FIRO_CTL_POLYNOMIAL_Msk 0x7FFFFFFFUL 160 /* CRYPTO.TRNG_MON_CTL */ 161 #define CRYPTO_TRNG_MON_CTL_BITSTREAM_SEL_Pos 0UL 162 #define CRYPTO_TRNG_MON_CTL_BITSTREAM_SEL_Msk 0x3UL 163 #define CRYPTO_TRNG_MON_CTL_AP_Pos 8UL 164 #define CRYPTO_TRNG_MON_CTL_AP_Msk 0x100UL 165 #define CRYPTO_TRNG_MON_CTL_RC_Pos 9UL 166 #define CRYPTO_TRNG_MON_CTL_RC_Msk 0x200UL 167 /* CRYPTO.TRNG_MON_RC_CTL */ 168 #define CRYPTO_TRNG_MON_RC_CTL_CUTOFF_COUNT8_Pos 0UL 169 #define CRYPTO_TRNG_MON_RC_CTL_CUTOFF_COUNT8_Msk 0xFFUL 170 /* CRYPTO.TRNG_MON_RC_STATUS0 */ 171 #define CRYPTO_TRNG_MON_RC_STATUS0_BIT_Pos 0UL 172 #define CRYPTO_TRNG_MON_RC_STATUS0_BIT_Msk 0x1UL 173 /* CRYPTO.TRNG_MON_RC_STATUS1 */ 174 #define CRYPTO_TRNG_MON_RC_STATUS1_REP_COUNT_Pos 0UL 175 #define CRYPTO_TRNG_MON_RC_STATUS1_REP_COUNT_Msk 0xFFUL 176 /* CRYPTO.TRNG_MON_AP_CTL */ 177 #define CRYPTO_TRNG_MON_AP_CTL_CUTOFF_COUNT16_Pos 0UL 178 #define CRYPTO_TRNG_MON_AP_CTL_CUTOFF_COUNT16_Msk 0xFFFFUL 179 #define CRYPTO_TRNG_MON_AP_CTL_WINDOW_SIZE_Pos 16UL 180 #define CRYPTO_TRNG_MON_AP_CTL_WINDOW_SIZE_Msk 0xFFFF0000UL 181 /* CRYPTO.TRNG_MON_AP_STATUS0 */ 182 #define CRYPTO_TRNG_MON_AP_STATUS0_BIT_Pos 0UL 183 #define CRYPTO_TRNG_MON_AP_STATUS0_BIT_Msk 0x1UL 184 /* CRYPTO.TRNG_MON_AP_STATUS1 */ 185 #define CRYPTO_TRNG_MON_AP_STATUS1_OCC_COUNT_Pos 0UL 186 #define CRYPTO_TRNG_MON_AP_STATUS1_OCC_COUNT_Msk 0xFFFFUL 187 #define CRYPTO_TRNG_MON_AP_STATUS1_WINDOW_INDEX_Pos 16UL 188 #define CRYPTO_TRNG_MON_AP_STATUS1_WINDOW_INDEX_Msk 0xFFFF0000UL 189 /* CRYPTO.INTR_TRNG */ 190 #define CRYPTO_INTR_TRNG_INITIALIZED_Pos 0UL 191 #define CRYPTO_INTR_TRNG_INITIALIZED_Msk 0x1UL 192 #define CRYPTO_INTR_TRNG_DATA_AVAILABLE_Pos 1UL 193 #define CRYPTO_INTR_TRNG_DATA_AVAILABLE_Msk 0x2UL 194 #define CRYPTO_INTR_TRNG_AP_DETECT_Pos 2UL 195 #define CRYPTO_INTR_TRNG_AP_DETECT_Msk 0x4UL 196 #define CRYPTO_INTR_TRNG_RC_DETECT_Pos 3UL 197 #define CRYPTO_INTR_TRNG_RC_DETECT_Msk 0x8UL 198 /* CRYPTO.INTR_TRNG_SET */ 199 #define CRYPTO_INTR_TRNG_SET_INITIALIZED_Pos 0UL 200 #define CRYPTO_INTR_TRNG_SET_INITIALIZED_Msk 0x1UL 201 #define CRYPTO_INTR_TRNG_SET_DATA_AVAILABLE_Pos 1UL 202 #define CRYPTO_INTR_TRNG_SET_DATA_AVAILABLE_Msk 0x2UL 203 #define CRYPTO_INTR_TRNG_SET_AP_DETECT_Pos 2UL 204 #define CRYPTO_INTR_TRNG_SET_AP_DETECT_Msk 0x4UL 205 #define CRYPTO_INTR_TRNG_SET_RC_DETECT_Pos 3UL 206 #define CRYPTO_INTR_TRNG_SET_RC_DETECT_Msk 0x8UL 207 /* CRYPTO.INTR_TRNG_MASK */ 208 #define CRYPTO_INTR_TRNG_MASK_INITIALIZED_Pos 0UL 209 #define CRYPTO_INTR_TRNG_MASK_INITIALIZED_Msk 0x1UL 210 #define CRYPTO_INTR_TRNG_MASK_DATA_AVAILABLE_Pos 1UL 211 #define CRYPTO_INTR_TRNG_MASK_DATA_AVAILABLE_Msk 0x2UL 212 #define CRYPTO_INTR_TRNG_MASK_AP_DETECT_Pos 2UL 213 #define CRYPTO_INTR_TRNG_MASK_AP_DETECT_Msk 0x4UL 214 #define CRYPTO_INTR_TRNG_MASK_RC_DETECT_Pos 3UL 215 #define CRYPTO_INTR_TRNG_MASK_RC_DETECT_Msk 0x8UL 216 /* CRYPTO.INTR_TRNG_MASKED */ 217 #define CRYPTO_INTR_TRNG_MASKED_INITIALIZED_Pos 0UL 218 #define CRYPTO_INTR_TRNG_MASKED_INITIALIZED_Msk 0x1UL 219 #define CRYPTO_INTR_TRNG_MASKED_DATA_AVAILABLE_Pos 1UL 220 #define CRYPTO_INTR_TRNG_MASKED_DATA_AVAILABLE_Msk 0x2UL 221 #define CRYPTO_INTR_TRNG_MASKED_AP_DETECT_Pos 2UL 222 #define CRYPTO_INTR_TRNG_MASKED_AP_DETECT_Msk 0x4UL 223 #define CRYPTO_INTR_TRNG_MASKED_RC_DETECT_Pos 3UL 224 #define CRYPTO_INTR_TRNG_MASKED_RC_DETECT_Msk 0x8UL 225 226 227 #endif /* _CYIP_CRYPTO_H_ */ 228 229 230 /* [] END OF FILE */ 231