162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
362306a36Sopenharmony_ci
462306a36Sopenharmony_ci#ifndef __CC_FIPS_H__
562306a36Sopenharmony_ci#define __CC_FIPS_H__
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#ifdef CONFIG_CRYPTO_FIPS
862306a36Sopenharmony_ci
962306a36Sopenharmony_cienum cc_fips_status {
1062306a36Sopenharmony_ci	CC_FIPS_SYNC_MODULE_OK = 0x0,
1162306a36Sopenharmony_ci	CC_FIPS_SYNC_MODULE_ERROR = 0x1,
1262306a36Sopenharmony_ci	CC_FIPS_SYNC_REE_STATUS = 0x4,
1362306a36Sopenharmony_ci	CC_FIPS_SYNC_TEE_STATUS = 0x8,
1462306a36Sopenharmony_ci	CC_FIPS_SYNC_STATUS_RESERVE32B = S32_MAX
1562306a36Sopenharmony_ci};
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ciint cc_fips_init(struct cc_drvdata *p_drvdata);
1862306a36Sopenharmony_civoid cc_fips_fini(struct cc_drvdata *drvdata);
1962306a36Sopenharmony_civoid fips_handler(struct cc_drvdata *drvdata);
2062306a36Sopenharmony_civoid cc_set_ree_fips_status(struct cc_drvdata *drvdata, bool ok);
2162306a36Sopenharmony_civoid cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata);
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci#else  /* CONFIG_CRYPTO_FIPS */
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_cistatic inline int cc_fips_init(struct cc_drvdata *p_drvdata)
2662306a36Sopenharmony_ci{
2762306a36Sopenharmony_ci	return 0;
2862306a36Sopenharmony_ci}
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistatic inline void cc_fips_fini(struct cc_drvdata *drvdata) {}
3162306a36Sopenharmony_cistatic inline void cc_set_ree_fips_status(struct cc_drvdata *drvdata,
3262306a36Sopenharmony_ci					  bool ok) {}
3362306a36Sopenharmony_cistatic inline void fips_handler(struct cc_drvdata *drvdata) {}
3462306a36Sopenharmony_cistatic inline void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata) {}
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#endif /* CONFIG_CRYPTO_FIPS */
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#endif  /*__CC_FIPS_H__*/
39