omap-crypto.h 908 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * OMAP Crypto driver common support routines.
  4. *
  5. * Copyright (c) 2017 Texas Instruments Incorporated
  6. * Tero Kristo <[email protected]>
  7. */
  8. #ifndef __CRYPTO_OMAP_CRYPTO_H
  9. #define __CRYPTO_OMAP_CRYPTO_H
  10. enum {
  11. OMAP_CRYPTO_NOT_ALIGNED = 1,
  12. OMAP_CRYPTO_BAD_DATA_LENGTH,
  13. };
  14. #define OMAP_CRYPTO_DATA_COPIED BIT(0)
  15. #define OMAP_CRYPTO_SG_COPIED BIT(1)
  16. #define OMAP_CRYPTO_COPY_MASK 0x3
  17. #define OMAP_CRYPTO_COPY_DATA BIT(0)
  18. #define OMAP_CRYPTO_FORCE_COPY BIT(1)
  19. #define OMAP_CRYPTO_ZERO_BUF BIT(2)
  20. #define OMAP_CRYPTO_FORCE_SINGLE_ENTRY BIT(3)
  21. int omap_crypto_align_sg(struct scatterlist **sg, int total, int bs,
  22. struct scatterlist *new_sg, u16 flags,
  23. u8 flags_shift, unsigned long *dd_flags);
  24. void omap_crypto_cleanup(struct scatterlist *sg, struct scatterlist *orig,
  25. int offset, int len, u8 flags_shift,
  26. unsigned long flags);
  27. #endif