Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
0003 
0004 #ifndef __CC_FIPS_H__
0005 #define __CC_FIPS_H__
0006 
0007 #ifdef CONFIG_CRYPTO_FIPS
0008 
0009 enum cc_fips_status {
0010     CC_FIPS_SYNC_MODULE_OK = 0x0,
0011     CC_FIPS_SYNC_MODULE_ERROR = 0x1,
0012     CC_FIPS_SYNC_REE_STATUS = 0x4,
0013     CC_FIPS_SYNC_TEE_STATUS = 0x8,
0014     CC_FIPS_SYNC_STATUS_RESERVE32B = S32_MAX
0015 };
0016 
0017 int cc_fips_init(struct cc_drvdata *p_drvdata);
0018 void cc_fips_fini(struct cc_drvdata *drvdata);
0019 void fips_handler(struct cc_drvdata *drvdata);
0020 void cc_set_ree_fips_status(struct cc_drvdata *drvdata, bool ok);
0021 void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata);
0022 
0023 #else  /* CONFIG_CRYPTO_FIPS */
0024 
0025 static inline int cc_fips_init(struct cc_drvdata *p_drvdata)
0026 {
0027     return 0;
0028 }
0029 
0030 static inline void cc_fips_fini(struct cc_drvdata *drvdata) {}
0031 static inline void cc_set_ree_fips_status(struct cc_drvdata *drvdata,
0032                       bool ok) {}
0033 static inline void fips_handler(struct cc_drvdata *drvdata) {}
0034 static inline void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata) {}
0035 
0036 #endif /* CONFIG_CRYPTO_FIPS */
0037 
0038 #endif  /*__CC_FIPS_H__*/