18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */ 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#ifndef __CC_FIPS_H__ 58c2ecf20Sopenharmony_ci#define __CC_FIPS_H__ 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_ci#ifdef CONFIG_CRYPTO_FIPS 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_cienum cc_fips_status { 108c2ecf20Sopenharmony_ci CC_FIPS_SYNC_MODULE_OK = 0x0, 118c2ecf20Sopenharmony_ci CC_FIPS_SYNC_MODULE_ERROR = 0x1, 128c2ecf20Sopenharmony_ci CC_FIPS_SYNC_REE_STATUS = 0x4, 138c2ecf20Sopenharmony_ci CC_FIPS_SYNC_TEE_STATUS = 0x8, 148c2ecf20Sopenharmony_ci CC_FIPS_SYNC_STATUS_RESERVE32B = S32_MAX 158c2ecf20Sopenharmony_ci}; 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ciint cc_fips_init(struct cc_drvdata *p_drvdata); 188c2ecf20Sopenharmony_civoid cc_fips_fini(struct cc_drvdata *drvdata); 198c2ecf20Sopenharmony_civoid fips_handler(struct cc_drvdata *drvdata); 208c2ecf20Sopenharmony_civoid cc_set_ree_fips_status(struct cc_drvdata *drvdata, bool ok); 218c2ecf20Sopenharmony_civoid cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata); 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#else /* CONFIG_CRYPTO_FIPS */ 248c2ecf20Sopenharmony_ci 258c2ecf20Sopenharmony_cistatic inline int cc_fips_init(struct cc_drvdata *p_drvdata) 268c2ecf20Sopenharmony_ci{ 278c2ecf20Sopenharmony_ci return 0; 288c2ecf20Sopenharmony_ci} 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_cistatic inline void cc_fips_fini(struct cc_drvdata *drvdata) {} 318c2ecf20Sopenharmony_cistatic inline void cc_set_ree_fips_status(struct cc_drvdata *drvdata, 328c2ecf20Sopenharmony_ci bool ok) {} 338c2ecf20Sopenharmony_cistatic inline void fips_handler(struct cc_drvdata *drvdata) {} 348c2ecf20Sopenharmony_cistatic inline void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata) {} 358c2ecf20Sopenharmony_ci 368c2ecf20Sopenharmony_ci#endif /* CONFIG_CRYPTO_FIPS */ 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci#endif /*__CC_FIPS_H__*/ 39