cc_ivgen.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2012-2018 ARM Limited or its affiliates. */
  3. #ifndef __CC_IVGEN_H__
  4. #define __CC_IVGEN_H__
  5. #include "cc_hw_queue_defs.h"
  6. #define CC_IVPOOL_SEQ_LEN 8
  7. /*!
  8. * Allocates iv-pool and maps resources.
  9. * This function generates the first IV pool.
  10. *
  11. * \param drvdata Driver's private context
  12. *
  13. * \return int Zero for success, negative value otherwise.
  14. */
  15. int cc_ivgen_init(struct cc_drvdata *drvdata);
  16. /*!
  17. * Free iv-pool and ivgen context.
  18. *
  19. * \param drvdata
  20. */
  21. void cc_ivgen_fini(struct cc_drvdata *drvdata);
  22. /*!
  23. * Generates the initial pool in SRAM.
  24. * This function should be invoked when resuming DX driver.
  25. *
  26. * \param drvdata
  27. *
  28. * \return int Zero for success, negative value otherwise.
  29. */
  30. int cc_init_iv_sram(struct cc_drvdata *drvdata);
  31. /*!
  32. * Acquires 16 Bytes IV from the iv-pool
  33. *
  34. * \param drvdata Driver private context
  35. * \param iv_out_dma Array of physical IV out addresses
  36. * \param iv_out_dma_len Length of iv_out_dma array (additional elements of
  37. * iv_out_dma array are ignore)
  38. * \param iv_out_size May be 8 or 16 bytes long
  39. * \param iv_seq IN/OUT array to the descriptors sequence
  40. * \param iv_seq_len IN/OUT pointer to the sequence length
  41. *
  42. * \return int Zero for success, negative value otherwise.
  43. */
  44. int cc_get_iv(struct cc_drvdata *drvdata, dma_addr_t iv_out_dma[],
  45. unsigned int iv_out_dma_len, unsigned int iv_out_size,
  46. struct cc_hw_desc iv_seq[], unsigned int *iv_seq_len);
  47. #endif /*__CC_IVGEN_H__*/