cc_fips.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
  3. #ifndef __CC_FIPS_H__
  4. #define __CC_FIPS_H__
  5. #ifdef CONFIG_CRYPTO_FIPS
  6. enum cc_fips_status {
  7. CC_FIPS_SYNC_MODULE_OK = 0x0,
  8. CC_FIPS_SYNC_MODULE_ERROR = 0x1,
  9. CC_FIPS_SYNC_REE_STATUS = 0x4,
  10. CC_FIPS_SYNC_TEE_STATUS = 0x8,
  11. CC_FIPS_SYNC_STATUS_RESERVE32B = S32_MAX
  12. };
  13. int cc_fips_init(struct cc_drvdata *p_drvdata);
  14. void cc_fips_fini(struct cc_drvdata *drvdata);
  15. void fips_handler(struct cc_drvdata *drvdata);
  16. void cc_set_ree_fips_status(struct cc_drvdata *drvdata, bool ok);
  17. void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata);
  18. #else /* CONFIG_CRYPTO_FIPS */
  19. static inline int cc_fips_init(struct cc_drvdata *p_drvdata)
  20. {
  21. return 0;
  22. }
  23. static inline void cc_fips_fini(struct cc_drvdata *drvdata) {}
  24. static inline void cc_set_ree_fips_status(struct cc_drvdata *drvdata,
  25. bool ok) {}
  26. static inline void fips_handler(struct cc_drvdata *drvdata) {}
  27. static inline void cc_tee_handle_fips_error(struct cc_drvdata *p_drvdata) {}
  28. #endif /* CONFIG_CRYPTO_FIPS */
  29. #endif /*__CC_FIPS_H__*/