1 /* SPDX-License-Identifier: BSD-2-Clause */ 2 /* 3 * Copyright 2018-2021 NXP 4 * 5 * Brief CAAM Asymmetric Cipher manager header. 6 */ 7 #ifndef __CAAM_ACIPHER_H__ 8 #define __CAAM_ACIPHER_H__ 9 10 #include <caam_common.h> 11 #include <caam_jr.h> 12 13 #ifdef CFG_NXP_CAAM_RSA_DRV 14 /* 15 * Initialize the RSA module 16 * 17 * @caam_jrcfg JR configuration structure 18 */ 19 enum caam_status caam_rsa_init(struct caam_jrcfg *caam_jrcfg); 20 #else 21 static inline enum caam_status caam_rsa_init(struct caam_jrcfg * caam_jrcfg __unused)22caam_rsa_init(struct caam_jrcfg *caam_jrcfg __unused) 23 { 24 return CAAM_NO_ERROR; 25 } 26 #endif /* CFG_NXP_CAAM_RSA_DRV */ 27 28 #ifdef CFG_NXP_CAAM_DH_DRV 29 /* 30 * Initialize the DH module 31 * 32 * @caam_jrcfg JR configuration structure 33 */ 34 enum caam_status caam_dh_init(struct caam_jrcfg *caam_jrcfg); 35 #else 36 static inline enum caam_status caam_dh_init(struct caam_jrcfg * caam_jrcfg __unused)37caam_dh_init(struct caam_jrcfg *caam_jrcfg __unused) 38 { 39 return CAAM_NO_ERROR; 40 } 41 #endif /* CFG_NXP_CAAM_DH_DRV */ 42 43 #ifdef CFG_NXP_CAAM_ACIPHER_DRV 44 /* 45 * Initialize the MATH module 46 * 47 * @caam_jrcfg JR configuration structure 48 */ 49 enum caam_status caam_math_init(struct caam_jrcfg *caam_jrcfg); 50 #else 51 static inline enum caam_status caam_math_init(struct caam_jrcfg * caam_jrcfg __unused)52caam_math_init(struct caam_jrcfg *caam_jrcfg __unused) 53 { 54 return CAAM_NO_ERROR; 55 } 56 #endif /* CFG_NXP_CAAM_ACIPHER_DRV */ 57 58 #ifdef CFG_NXP_CAAM_ECC_DRV 59 /* 60 * Initialize the Cipher module 61 * 62 * @caam_jrcfg JR configuration structure 63 */ 64 enum caam_status caam_ecc_init(struct caam_jrcfg *caam_jrcfg); 65 #else 66 static inline enum caam_status caam_ecc_init(struct caam_jrcfg * caam_jrcfg __unused)67caam_ecc_init(struct caam_jrcfg *caam_jrcfg __unused) 68 { 69 return CAAM_NO_ERROR; 70 } 71 #endif /* CFG_NXP_CAAM_ECC_DRV */ 72 73 #ifdef CFG_NXP_CAAM_DSA_DRV 74 /* 75 * Initialize the DSA module 76 * 77 * @caam_jrcfg CAAM job ring configuration 78 */ 79 enum caam_status caam_dsa_init(struct caam_jrcfg *caam_jrcfg); 80 #else 81 static inline enum caam_status caam_dsa_init(struct caam_jrcfg * caam_jrcfg __unused)82caam_dsa_init(struct caam_jrcfg *caam_jrcfg __unused) 83 { 84 return CAAM_NO_ERROR; 85 } 86 #endif /* CFG_NXP_CAAM_DSA_DRV */ 87 #endif /* __CAAM_ACIPHER_H__ */ 88