2 * Copyright (C) 2012-2017 ARM Limited or its affiliates.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 #ifndef __SSI_IVGEN_H__
18 #define __SSI_IVGEN_H__
20 #include "cc_hw_queue_defs.h"
23 #define SSI_IVPOOL_SEQ_LEN 8
26 * Allocates iv-pool and maps resources.
27 * This function generates the first IV pool.
29 * \param drvdata Driver's private context
31 * \return int Zero for success, negative value otherwise.
33 int ssi_ivgen_init(struct ssi_drvdata *drvdata);
36 * Free iv-pool and ivgen context.
40 void ssi_ivgen_fini(struct ssi_drvdata *drvdata);
43 * Generates the initial pool in SRAM.
44 * This function should be invoked when resuming DX driver.
48 * \return int Zero for success, negative value otherwise.
50 int ssi_ivgen_init_sram_pool(struct ssi_drvdata *drvdata);
53 * Acquires 16 Bytes IV from the iv-pool
55 * \param drvdata Driver private context
56 * \param iv_out_dma Array of physical IV out addresses
57 * \param iv_out_dma_len Length of iv_out_dma array (additional elements of iv_out_dma array are ignore)
58 * \param iv_out_size May be 8 or 16 bytes long
59 * \param iv_seq IN/OUT array to the descriptors sequence
60 * \param iv_seq_len IN/OUT pointer to the sequence length
62 * \return int Zero for success, negative value otherwise.
65 struct ssi_drvdata *drvdata,
66 dma_addr_t iv_out_dma[],
67 unsigned int iv_out_dma_len,
68 unsigned int iv_out_size,
70 unsigned int *iv_seq_len);
72 #endif /*__SSI_IVGEN_H__*/